/* main-2-shell-sidebar-2.css -- split from main-2-shell-sidebar.css (File Split Plan #6, CSS pass).
   Pure move: byte-identical rules, only the file boundary is new. Loaded via
   its own <link> tag in index.html immediately after main-2-shell-sidebar.css's, preserving
   the exact cascade order the single file had. */

/* ── Tambour Shutter ───────────────────────────────────── */
.tambour {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  pointer-events: all;
  z-index: 10;
  transition: opacity 0.1s;
}
.tambour.open {
  pointer-events: none;
}
.tambour-slats {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: top center;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}
.tambour.open .tambour-slats {
  transform: translateY(-100%);
  opacity: 0;
}
/* Individual slats generated by JS */
.tambour-slat {
  flex-shrink: 0;
  height: 10px;
  position: relative;
  background: linear-gradient(180deg,
    rgba(42,34,14,1) 0%,
    rgba(58,46,18,1) 20%,
    rgba(72,57,22,1) 45%,
    rgba(54,43,16,1) 70%,
    rgba(38,30,11,1) 100%
  );
  border-bottom: 1px solid rgba(0,0,0,0.55);
}
/* Top highlight edge on each slat */
.tambour-slat::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    rgba(140,105,25,0.20),
    rgba(160,120,32,0.55) 30%,
    rgba(200,165,70,0.70) 50%,
    rgba(160,120,32,0.55) 70%,
    rgba(140,105,25,0.20)
  );
}
/* Bevel groove on each slat */
.tambour-slat::after {
  content: '';
  position: absolute; bottom: 1px; left: 0; right: 0;
  height: 1px;
  background: rgba(180,130,35,0.08);
}
/* Every other slat slightly darker for texture */
.tambour-slat:nth-child(even) {
  background: linear-gradient(180deg,
    rgba(36,28,10,1) 0%,
    rgba(50,39,14,1) 25%,
    rgba(62,49,18,1) 50%,
    rgba(46,36,13,1) 75%,
    rgba(32,24,8,1) 100%
  );
}

/* Handle */
.tambour-handle {
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: all;
  background: linear-gradient(180deg,
    rgba(6,9,18,1) 0%,
    rgba(8,12,22,1) 40%,
    rgba(6,9,18,1) 70%,
    rgba(5,7,14,1) 100%
  );
  border-top: 1px solid rgba(160,120,32,0.55);
  position: relative;
  transition: background 0.2s;
  box-shadow:
    inset 0 1px 0 rgba(200,165,70,0.18),
    inset 0 -1px 0 rgba(0,0,0,0.70),
    inset 0 0 16px rgba(4,6,14,0.90);
}
.tambour-handle:hover {
  background: linear-gradient(180deg,
    rgba(8,12,26,1) 0%,
    rgba(12,18,34,1) 40%,
    rgba(9,13,24,1) 70%,
    rgba(6,9,18,1) 100%
  );
}
/* Navy accent lines extending outward from the pull */
.tambour-handle-bar {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg,
    transparent,
    rgba(160,120,32,0.55) 15%,
    rgba(20,40,90,0.50) 40%,
    rgba(30,60,130,0.70) 100%
  );
  margin: 0 8px;
}
.tambour-handle-bar:last-child {
  background: linear-gradient(90deg,
    rgba(30,60,130,0.70) 0%,
    rgba(20,40,90,0.50) 60%,
    rgba(160,120,32,0.55) 85%,
    transparent
  );
}
/* The pull knob — navy */
.tambour-handle-pull {
  width: 48px;
  height: 18px;
  border-radius: 3px;
  position: relative;
  flex-shrink: 0;
  background: linear-gradient(180deg,
    rgba(14,22,52,1) 0%,
    rgba(8,14,36,1) 50%,
    rgba(5,9,24,1) 100%
  );
  border: 1px solid rgba(160,120,32,0.60);
  border-top-color: rgba(210,175,90,0.85);
  border-bottom-color: rgba(100,70,10,0.75);
  box-shadow:
    0 2px 8px rgba(0,0,0,0.80),
    0 1px 2px rgba(0,0,0,0.90),
    inset 0 1px 0 rgba(40,70,160,0.30),
    inset 0 -1px 0 rgba(0,0,0,0.55),
    inset 0 0 6px rgba(4,8,20,0.80);
  transition: box-shadow 0.2s, border-color 0.2s;
}
/* Top highlight edge on pull */
.tambour-handle-pull::before {
  content: '';
  position: absolute; top: 1px; left: 8px; right: 8px;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(210,175,90,0.55) 30%,
    rgba(220,185,110,0.85) 50%,
    rgba(210,175,90,0.55) 70%,
    transparent
  );
  border-radius: 1px;
}
/* Center grip line */
.tambour-handle-pull::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 16px; height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(160,120,32,0.50) 30%,
    rgba(200,165,70,0.70) 50%,
    rgba(160,120,32,0.50) 70%,
    transparent
  );
}
.tambour-handle:hover .tambour-handle-pull {
  border-color: rgba(160,120,32,0.75);
  border-top-color: rgba(220,180,100,1);
  box-shadow:
    0 3px 12px rgba(0,0,0,0.75),
    0 1px 3px rgba(0,0,0,0.90),
    inset 0 1px 0 rgba(50,90,200,0.25),
    inset 0 -1px 0 rgba(0,0,0,0.55),
    inset 0 0 8px rgba(4,8,24,0.70),
    0 0 8px rgba(160,120,32,0.15);
}
.tambour.open .tambour-handle {
  border-top-color: rgba(160,120,32,0.30);
}
@keyframes tambourOpen {
  from { transform: translateY(0); opacity: 1; }
  to   { transform: translateY(-100%); opacity: 0; }
}
@keyframes tambourClose {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.sb-plaque {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 12px 16px 11px;
  border-radius: 4px;
  position: relative;
  isolation: isolate;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  /* Calm uniform gold ring — matches the login card's muted antique look */
  border: 1px solid rgba(160,120,32,0.50);
  /* Clean dark face — no warm glow behind the text */
  background: linear-gradient(170deg, rgba(10,15,28,0.99) 0%, rgba(6,9,18,1) 100%);
  /* Outer drop shadow for lift, very subtle inner highlight */
  box-shadow:
    /* Right wall */
    2px 0 0 rgba(0,0,0,0.55),
    /* Left wall */
    -2px 0 0 rgba(0,0,0,0.45),
    /* Bottom wall */
    0 2px 0 rgba(0,0,0,0.85),
    /* Outer lift shadow */
    0 6px 18px rgba(0,0,0,0.80),
    0 2px 6px rgba(0,0,0,0.90),
    /* Inner top highlight — same low alpha as login card */
    inset 0 1px 0 rgba(210,175,90,0.10),
    /* Inner bottom recess */
    inset 0 -2px 8px rgba(0,0,0,0.65),
    /* Inner side catches */
    inset 2px 0 4px rgba(0,0,0,0.40),
    inset -2px 0 4px rgba(0,0,0,0.35);
}
/* Horizontal scanline grain on plaque face */
.sb-plaque::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255,255,255,0.010) 2px,
    rgba(255,255,255,0.010) 3px
  );
  pointer-events: none;
}
/* Bright top edge seam — matched to login card */
.sb-plaque::after {
  content: '';
  position: absolute; top: 0; left: 8%; right: 8%;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(160,120,32,0.30) 15%,
    rgba(210,175,90,0.85) 40%,
    rgba(220,180,100,1) 50%,
    rgba(210,175,90,0.85) 60%,
    rgba(160,120,32,0.30) 85%,
    transparent
  );
  pointer-events: none;
}
.sb-nav { padding: 8px 8px 4px; flex-shrink: 0; }

/* ━━━ Recent Changes Feed ━━━ */
.sb-feed {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 6px 10px 0;
  padding: 10px 0 0;
  border-top: 1px solid rgba(160,120,32,0.10);
  overflow: hidden;
}
.sb-feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 8px;
  flex-shrink: 0;
}
.sb-feed-eyebrow {
  font-family: var(--f-mono);
  font-size: 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(160,120,32,0.55);
}
.sb-feed-refresh {
  background: transparent;
  border: 1px solid rgba(160,120,32,0.18);
  color: rgba(160,120,32,0.45);
  border-radius: 3px;
  width: 18px;
  height: 18px;
  padding: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.sb-feed-refresh:hover {
  color: rgba(160,120,32,0.85);
  border-color: rgba(160,120,32,0.45);
  background: rgba(160,120,32,0.06);
}
.sb-feed-refresh.spinning svg { animation: sb-feed-spin 0.6s linear infinite; }
@keyframes sb-feed-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.sb-feed-refresh svg { width: 100%; height: 100%; display: block; }

.sb-feed-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 4px 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(160,120,32,0.20) transparent;
}
.sb-feed-list::-webkit-scrollbar { width: 4px; }
.sb-feed-list::-webkit-scrollbar-thumb { background: rgba(160,120,32,0.20); border-radius: 2px; }
.sb-feed-list::-webkit-scrollbar-track { background: transparent; }

.sb-feed-empty {
  font-family: var(--f-mono);
  font-size: 9px;
  color: var(--smoke4);
  letter-spacing: 0.06em;
  text-align: center;
  padding: 16px 6px;
  opacity: 0.7;
}

.sb-feed-item {
  display: block;
  padding: 8px 8px 9px;
  margin-bottom: 4px;
  background: linear-gradient(160deg, rgba(10,15,26,0.85), rgba(6,9,18,0.92));
  border: 1px solid rgba(160,120,32,0.08);
  border-left: 2px solid rgba(160,120,32,0.25);
  border-radius: 3px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  position: relative;
}
.sb-feed-item:hover {
  border-color: rgba(160,120,32,0.32);
  border-left-color: rgba(160,120,32,0.7);
  background: linear-gradient(160deg, rgba(15,22,38,0.95), rgba(8,12,22,1));
}
.sb-feed-item:active { transform: translateX(1px); }

.sb-feed-item.tier-critical { border-left-color: rgba(220,90,90,0.65); }
.sb-feed-item.tier-critical:hover { border-left-color: rgba(220,90,90,1); }
.sb-feed-item.tier-important { border-left-color: rgba(180,130,35,0.65); }
.sb-feed-item.tier-important:hover { border-left-color: rgba(180,130,35,1); }
.sb-feed-item.tier-info { border-left-color: rgba(120,190,140,0.55); }
.sb-feed-item.tier-info:hover { border-left-color: rgba(120,190,140,0.95); }

.sb-feed-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-family: var(--f-mono);
  font-size: 8px;
  letter-spacing: 0.10em;
  color: rgba(160,120,32,0.55);
  text-transform: uppercase;
}
.sb-feed-tier {
  font-size: 9px;
  line-height: 1;
}
.sb-feed-collection {
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(160,120,32,0.45);
}
.sb-feed-when {
  flex-shrink: 0;
  color: var(--smoke4);
  letter-spacing: 0.05em;
  text-transform: none;
  font-size: 8px;
}
.sb-feed-title {
  font-family: var(--f-ui);
  font-size: 11px;
  font-weight: 300;
  line-height: 1.35;
  color: rgba(195,170,115,0.92);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: 0.01em;
}

#sidebar.collapsed .sb-feed { display: none; }

.nav-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r);
  border: 1px solid transparent;
  background: transparent;
  color: rgba(160,120,32,0.45);
  font-family: var(--f-ui);
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  width: 100%;
  text-align: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
  position: relative;
}
.nav-btn::before {
  content: '';
  position: absolute; bottom: 0; left: 20%; right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-metal-1), var(--gold-metal-3), transparent);
  opacity: 0;
  transition: opacity 0.18s;
}
.nav-btn:hover {
  background: rgba(160,120,32,0.05);
  color: rgba(160,120,32,0.70);
  border-color: rgba(160,120,32,0.10);
  box-shadow: 0 1px 4px rgba(0,0,0,0.50), inset 0 1px 0 rgba(210,175,90,0.05);
}
.nav-btn.active {
  background: rgba(160,120,32,0.08);
  color: var(--gold-metal-2);
  text-shadow: 0 0 14px rgba(160,120,32,0.3), 0 0 28px rgba(160,120,32,0.18);
  border-color: transparent;
  border-bottom-color: rgba(160,120,32,0.20);
  box-shadow:
    inset 0 2px 5px rgba(0,0,0,0.55),
    inset 0 1px 2px rgba(0,0,0,0.40),
    0 1px 0 rgba(210,175,90,0.05);
}
.nav-btn.active::before { opacity: 1; }
.nav-icon { font-size: 13px; width: 18px; text-align: center; flex-shrink: 0; opacity: 0.8; }
.sb-depts {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px 8px;
  scrollbar-width: none;
}
.sb-depts::-webkit-scrollbar { display: none; }
.dept-btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  padding: 7px 12px;
  border-radius: var(--r);
  border: 1px solid transparent;
  background: transparent;
  color: rgba(140,105,25,0.38);
  font-family: var(--f-ui);
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  width: 100%;
  text-align: center;
  transition: background 0.15s, color 0.2s, text-shadow 0.2s, box-shadow 0.15s, border-color 0.15s;
  position: relative;
}
.dept-btn::before {
  content: '';
  position: absolute; bottom: 0; left: 25%; right: 25%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-lt), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}
.dept-btn:hover {
  color: rgba(160,120,32,0.65);
  border-color: rgba(160,120,32,0.08);
  box-shadow: 0 1px 3px rgba(0,0,0,0.40), inset 0 1px 0 rgba(210,175,90,0.04);
}
.dept-btn.active {
  color: var(--gold-metal-2);
  text-shadow: 0 0 12px rgba(160,120,32,0.35), 0 0 24px rgba(160,120,32,0.15);
  border-color: transparent;
  border-bottom-color: rgba(160,120,32,0.18);
  box-shadow:
    inset 0 2px 4px rgba(0,0,0,0.50),
    inset 0 1px 2px rgba(0,0,0,0.35),
    0 1px 0 rgba(210,175,90,0.04);
}
.dept-btn.active::before { opacity: 1; }
.d-pip { display: none; }
.sb-footer {
  padding: 12px 10px;
  border-top: 1px solid rgba(160,120,32,0.14);
  flex-shrink: 0;
  box-shadow:
    inset 0 2px 5px rgba(0,0,0,0.45),
    inset 0 1px 2px rgba(0,0,0,0.30);
}
.model-pill {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  padding: 9px 12px;
  border-radius: var(--r);
  border: 1px solid rgba(160,120,32,0.32);
  border-top-color: rgba(210,175,90,0.42);
  border-bottom-color: rgba(0,0,0,0.55);
  background: linear-gradient(160deg, rgba(18,25,40,1) 0%, rgba(13,18,30,1) 50%, rgba(10,14,24,1) 100%);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  box-shadow:
    0 3px 10px rgba(0,0,0,0.5),
    0 1px 3px rgba(0,0,0,0.75),
    inset 0 1px 0 rgba(210,175,90,0.15),
    inset 0 -1px 0 rgba(0,0,0,0.40);
}
.model-pill:hover {
  border-color: rgba(160,120,32,0.45);
  border-top-color: rgba(210,175,90,0.55);
  background: linear-gradient(160deg, rgba(22,30,46,1) 0%, rgba(16,22,36,1) 60%, rgba(12,17,28,1) 100%);
  box-shadow:
    0 4px 14px rgba(0,0,0,0.55),
    0 1px 3px rgba(0,0,0,0.80),
    inset 0 1px 0 rgba(210,175,90,0.20),
    inset 0 -1px 0 rgba(0,0,0,0.45);
}
.mp-indicator {
  width: 6px; height: 6px; border-radius: 50%;
  box-shadow: 0 0 6px currentColor;
  flex-shrink: 0;
}
.mp-text { min-width: 0; text-align: center; }
.mp-name {
  font-family: var(--f-ui);
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.10em;
  background: linear-gradient(160deg, var(--gold-lt) 0%, var(--gold-lt) 35%, var(--gold) 65%, #a07820 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-align: center;
}
.mp-sub {
  font-family: var(--f-ui);
  font-size: 9px;
  font-weight: 300;
  color: rgba(160,120,32,0.65);
  letter-spacing: 0.08em;
  margin-top: 1px;
  text-align: center;
}
.mp-arrow {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.90));
  transition: opacity 0.2s, transform 0.2s;
}
.model-pill:hover .mp-arrow {
  opacity: 1;
  transform: translateY(-1px);
}

/* ── Topbar ────────────────────────────────────────────── */
#topbar {
  position: fixed; top: 0; right: 0; left: 0;
  height: var(--topbar);
  background: linear-gradient(180deg, rgba(3,5,12,0.97) 0%, rgba(6,9,18,0.94) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(160,120,32,0.18);
  display: flex; align-items: center;
  padding: 0 20px 0 16px;
  gap: 12px;
  z-index: 100;
  /* Recessed ceiling — inset shadow from top, bright bottom edge */
  box-shadow:
    inset 0 2px 6px rgba(0,0,0,0.80),
    inset 0 1px 3px rgba(0,0,0,0.60),
    0 1px 0 rgba(210,175,90,0.08),
    0 2px 12px rgba(0,0,0,0.50);
}
.tb-logo {
  font-family: var(--f-display);
  font-size: 20px;
  font-weight: 300;
  letter-spacing: 0.25em;
  color: var(--smoke);
  white-space: nowrap;
  flex-shrink: 0;
  overflow: visible;
  display: none;
  padding-left: 2px;
}
.tb-module {
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--smoke3);
  text-transform: uppercase;
}
.tb-sep { width: 1px; height: 20px; background: linear-gradient(180deg, transparent, rgba(160,120,32,0.24), transparent); }
.tb-spacer { flex: 1; }

/* Status chip */
.tb-status {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 12px;
  border: 1px solid rgba(160,120,32,0.14);
  border-top-color: rgba(0,0,0,0.6);
  border-radius: 3px;
  background: rgba(4,6,14,0.60);
  box-shadow:
    inset 0 1px 3px rgba(0,0,0,0.60),
    inset 0 1px 1px rgba(0,0,0,0.40),
    0 1px 0 rgba(210,175,90,0.05);
}
.status-pip {
  width: 4px; height: 4px; border-radius: 50%;
  background: rgba(200,210,220,0.4);
  flex-shrink: 0;
  transition: background 0.3s, box-shadow 0.3s;
}
.status-pip.online {
  background: rgba(200,220,210,0.6);
  box-shadow: 0 0 4px rgba(180,210,195,0.4);
}
.status-pip.warn { background: rgba(150,130,55,0.5); box-shadow: none; }
.status-pip.off { background: rgba(80,90,110,0.4); box-shadow: none; }
.tb-status-text {
  font-family: var(--f-ui);
  font-size: 9px;
  font-weight: 300;
  letter-spacing: 0.14em;
  background: linear-gradient(160deg, var(--gold-lt) 0%, var(--gold) 50%, #a07820 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-transform: uppercase;
}


/* Mobile model chip */
.tb-model-chip {
  display: none;
  align-items: center; gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--ink3);
  cursor: pointer;
}
.tmc-pip { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.tmc-name { font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.12em; color: var(--smoke3); text-transform: uppercase; }

/* ── Content ───────────────────────────────────────────── */
#content { position: fixed; right: 0; overflow: hidden; pointer-events: all; }
.panel { display: none; position: absolute; inset: 0; flex-direction: column; pointer-events: none; overflow: hidden; isolation: isolate; background: var(--ink); }
.panel[data-panel="chat"] { background: transparent; }
.panel.active { pointer-events: all; }
.panel.active { display: flex; }

/* ── Chat background ghost overlay ─────────────────────── */
.chat-bg-overlay {
  position: absolute; inset: 0; z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
/* Base image layer */
/* Chat background image — responsive tiers.
   Phones (≤767): 800px wide, ~100KB. Sharp on small screens, fast to load.
   Tablets and small laptops (768–1599): 2752px wide, ~670KB. Sharp through QHD.
   Large desktops (≥1600): 4128px wide, ~1.26MB. Sharp on 4K and Retina.
   Default rule below sets the small image so phones always have something
   even before media queries resolve; larger viewports override.
*/
