/* ============================================================
   app.css — shell, components, sections
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
  /* Fixed off-canvas sidebar is positioned to the viewport → clip its negative-x
     box here so the root never scrolls horizontally. `clip` keeps sticky working. */
  overflow-x: hidden;   /* fallback */
  overflow-x: clip;
}

/* No-flash lock: applied by inline head script before paint */
html.pb-locked, html.pb-locked body { overflow: hidden; }

body {
  font-family: var(--font-body);
  background: var(--ground);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  /* The off-canvas sidebar lives in negative-x space; clip it at the root so
     the page body never scrolls horizontally. `clip` (not hidden) preserves the
     sticky topbar because it does not create a scroll container. */
  overflow-x: hidden;      /* fallback for engines without `clip` */
  overflow-x: clip;
}

h1,h2,h3,h4 { font-family: var(--font-head); font-weight: 600; letter-spacing: .3px; margin: 0; line-height: 1.1; }
a { color: var(--med-blue); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--orange-soft); }

/* Scrollbars */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--line-2); background-clip: padding-box; }

/* ==================== PASSWORD GATE ==================== */
#gate {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(70% 90% at 20% 0%, rgba(42,147,193,.16), transparent 60%),
    radial-gradient(60% 90% at 100% 100%, rgba(241,66,11,.14), transparent 60%),
    var(--ground);
  padding: 24px;
}
#gate.hidden { display: none; }
.gate-card {
  width: 100%; max-width: 420px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 40px 34px;
  box-shadow: var(--shadow-lg); text-align: center;
}
.gate-mark {
  width: 54px; height: 54px; margin: 0 auto 18px;
  display: grid; place-items: center;
}
.gate-card h1 { font-size: 26px; letter-spacing: .5px; }
.gate-card .sub { color: var(--ink-3); font-size: 13px; margin: 6px 0 26px; }
.gate-card input {
  width: 100%; padding: 13px 15px; font-size: 15px;
  background: var(--surface-3); border: 1px solid var(--line-2);
  border-radius: var(--r-md); color: var(--ink); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.gate-card input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--blue-soft); }
.gate-card button {
  width: 100%; margin-top: 14px; padding: 13px;
  background: var(--accent-grad); color: #fff; font-weight: 600;
  font-family: var(--font-head); font-size: 15px; letter-spacing: .5px;
  border: none; border-radius: var(--r-md); text-transform: uppercase;
  transition: transform .1s, filter .15s;
}
.gate-card button:hover { filter: brightness(1.08); }
.gate-card button:active { transform: translateY(1px); }
.gate-err { color: var(--red); font-size: 12.5px; height: 16px; margin-top: 12px; }
.gate-hint { color: var(--ink-3); font-size: 11px; margin-top: 20px; }
@keyframes shake { 10%,90%{transform:translateX(-1px)} 20%,80%{transform:translateX(2px)} 30%,50%,70%{transform:translateX(-4px)} 40%,60%{transform:translateX(4px)} }
.shake { animation: shake .4s; }

/* ==================== APP SHELL ==================== */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex: none;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
  background: linear-gradient(180deg, #0b0e18 0%, #080a12 100%);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  transition: transform .25s ease;
}
.sb-brand {
  height: var(--topbar-h); flex: none;
  display: flex; align-items: center; gap: 11px;
  padding: 0 18px; border-bottom: 1px solid var(--line);
}
.sb-brand .hex { width: 26px; height: 29px; flex: none; object-fit: contain; display: block; }
.sb-brand .bt { display: flex; flex-direction: column; line-height: 1; }
.sb-brand .bt b { font-family: var(--font-head); font-weight: 700; font-size: 15px; letter-spacing: .5px; }
.sb-brand .bt span { font-size: 9.5px; letter-spacing: 1.6px; color: var(--ink-3); text-transform: uppercase; margin-top: 3px; }

.sb-nav { flex: 1; overflow-y: auto; padding: 14px 12px 24px; }
.sb-sec { font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--ink-3); padding: 16px 10px 7px; font-weight: 600; }
.sb-sec:first-child { padding-top: 4px; }
.nav-item {
  position: relative; width: 100%;
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; margin-bottom: 2px;
  background: transparent; border: none; color: var(--ink-2);
  font-size: 13.5px; text-align: left; border-radius: var(--r-sm);
  transition: background .14s, color .14s;
}
.nav-item svg { width: 17px; height: 17px; flex: none; opacity: .8; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--blue-soft); color: #fff; }
.nav-item.active svg { opacity: 1; }
.nav-item.active::before {
  content: ''; position: absolute; left: -12px; top: 6px; bottom: 6px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--accent-grad);
}
.sb-foot { flex: none; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 11px; color: var(--ink-3); }
.sb-foot .who { display: flex; align-items: center; gap: 8px; }
.sb-foot .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }

/* ==================== TOPBAR ==================== */
.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--topbar-h); position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 16px; padding: 0 22px;
  background: rgba(8,10,18,.82); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.tb-titles { min-width: 0; }
.tb-titles h2 { font-size: 17px; font-weight: 600; }
.tb-titles .tb-sub { font-size: 12px; color: var(--ink-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-spacer { flex: 1; }
.hamburger { display: none; background: none; border: none; color: var(--ink); padding: 6px; }

/* Mode toggle */
.mode-toggle {
  display: flex; background: var(--surface-3); border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 3px; gap: 2px;
}
.mode-toggle button {
  border: none; background: transparent; color: var(--ink-2);
  font-size: 12px; font-weight: 600; padding: 6px 14px; border-radius: var(--r-pill);
  display: flex; align-items: center; gap: 6px; transition: color .14s;
  font-family: var(--font-head); letter-spacing: .4px;
}
.mode-toggle button .md { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .5; }
.mode-toggle button.on { color: #fff; }
.mode-toggle button.on.company { background: var(--blue-grad); }
.mode-toggle button.on.scenario { background: var(--accent-grad); }
.mode-toggle button.on .md { opacity: 1; }

/* Plan/version selector */
.ver-select { display: flex; align-items: center; gap: 8px; }
.ver-select select {
  background: var(--surface-3); color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 7px 10px; font-size: 12.5px; font-family: inherit; outline: none; max-width: 190px;
}
.ver-select select:focus { border-color: var(--primary); }

/* ==================== BUTTONS ==================== */
.btn { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-head); letter-spacing: .4px;
  font-size: 13px; font-weight: 600; padding: 9px 16px; border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--ink); transition: filter .14s, transform .1s, border-color .14s; }
.btn:hover { border-color: var(--line-glow); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--accent-grad); color: #fff; border: none; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-blue { background: var(--blue-grad); color: #fff; border: none; }
.btn-blue:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ==================== CONTENT / SECTIONS ==================== */
.content { flex: 1; padding: 26px 28px 60px; max-width: 1500px; width: 100%; }
.view { display: none; animation: fade .24s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.section-title { display: flex; align-items: center; gap: 14px; margin: 4px 0 20px; }
.section-title h3 { font-size: 20px; text-transform: uppercase; letter-spacing: 1px; white-space: nowrap; }
.section-title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); }
.section-title .badge { flex: none; }
.eyebrow { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--primary); font-weight: 600; margin-bottom: 8px; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Badges / pills */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: var(--r-pill); border: 1px solid var(--line); color: var(--ink-2); background: var(--surface-2); }
.badge .d { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 7px currentColor; }
.badge.green { color: var(--green); background: var(--green-soft); border-color: transparent; }
.badge.amber { color: var(--amber); background: var(--amber-soft); border-color: transparent; }
.badge.red   { color: var(--red);   background: var(--red-soft);   border-color: transparent; }
.badge.blue  { color: var(--med-blue); background: var(--blue-soft); border-color: transparent; }
.badge.orange{ color: var(--accent); background: var(--orange-soft); border-color: transparent; }

/* Focus color chips */
.chip-people  { color: var(--med-blue); }
.chip-product { color: var(--green); }
.chip-profit  { color: var(--accent); }

/* ==================== OVERVIEW ==================== */
.hero {
  position: relative; overflow: hidden; border-radius: var(--r-lg);
  border: 1px solid var(--line); background: var(--surface);
  padding: 34px 34px; margin-bottom: 22px;
}
.hero::before { content: ''; position: absolute; inset: 0; background: var(--glow-grad); pointer-events: none; }
.hero .fade-rule { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--pure-fade); }
.hero-in { position: relative; }
.hero .ns-label { font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--ink-3); }
.hero .ns-text { font-family: var(--font-head); font-weight: 600; font-size: clamp(22px, 3vw, 34px); line-height: 1.14; margin: 12px 0 16px; max-width: 900px; }
.hero .ns-text em { font-style: normal; background: var(--pure-fade); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .ns-meta { display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--ink-2); font-size: 13px; }
.hero .ns-meta b { color: var(--ink); font-family: var(--font-head); }

.stat { padding: 18px; }
.stat .k { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-3); }
.stat .v { font-family: var(--font-head); font-weight: 700; font-size: 30px; margin: 6px 0 2px; }
.stat .t { font-size: 12px; display: flex; align-items: center; gap: 5px; }
.stat .t.up { color: var(--green); } .stat .t.down { color: var(--red); } .stat .t.flat { color: var(--ink-3); }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 30px; margin-top: 12px; }
.spark i { flex: 1; background: linear-gradient(180deg, var(--med-blue), rgba(42,147,193,.25)); border-radius: 2px 2px 0 0; min-height: 2px; }
.spark.orange i { background: linear-gradient(180deg, var(--accent), rgba(241,66,11,.25)); }

.qa-list { display: flex; flex-direction: column; }
.qa-row { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line); }
.qa-row:last-child { border-bottom: none; }
.qa-row .av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 12px; color: #fff; flex: none; }
.qa-row .nm { flex: 1; min-width: 0; }
.qa-row .nm b { font-size: 13.5px; display: block; }
.qa-row .nm span { font-size: 11.5px; color: var(--ink-3); }

/* ==================== NORTH STAR GRID ==================== */
.ns-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.seg { display: inline-flex; background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 3px; gap: 2px; }
.seg button { border: none; background: transparent; color: var(--ink-2); font-size: 12px; font-weight: 600; padding: 6px 13px; border-radius: 6px; font-family: var(--font-head); letter-spacing: .3px; }
.seg button.on { background: var(--surface); color: #fff; box-shadow: var(--shadow-sm); }

.ns-year-head { display: grid; grid-template-columns: 130px repeat(3, 1fr); gap: 12px; margin-bottom: 10px; }
.ns-year-head .yh { font-family: var(--font-head); font-weight: 600; font-size: 15px; padding: 6px 2px; }
.ns-year-head .fh { text-align: center; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 700; padding: 8px; border-radius: var(--r-sm); }
.fh.people  { color: var(--med-blue); background: var(--blue-soft); }
.fh.product { color: var(--green);    background: var(--green-soft); }
.fh.profit  { color: var(--accent);   background: var(--orange-soft); }
.ns-row { display: grid; grid-template-columns: 130px repeat(3, 1fr); gap: 12px; margin-bottom: 12px; align-items: stretch; }
.ns-row .rowlab { display: flex; flex-direction: column; justify-content: center; padding: 8px 2px; }
.ns-row .rowlab b { font-family: var(--font-head); font-weight: 600; font-size: 15px; }
.ns-row .rowlab span { font-size: 11px; color: var(--ink-3); }
.ns-cell {
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--line-2);
  border-radius: var(--r-sm); padding: 12px; font-size: 13px; color: var(--ink); line-height: 1.45;
  min-height: 84px; outline: none; transition: border-color .14s, background .14s; white-space: pre-wrap;
}
.ns-cell:hover { background: var(--surface-2); }
.ns-cell:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--blue-soft); background: var(--surface-2); }
.ns-cell.people  { border-left-color: var(--med-blue); }
.ns-cell.product { border-left-color: var(--green); }
.ns-cell.profit  { border-left-color: var(--accent); }
.ns-cell:empty::before { content: 'Click to add…'; color: var(--ink-3); font-style: italic; }
.editable-hint { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 7px; }

/* ==================== MANDALA (9x9) ==================== */
.mandala-wrap { overflow-x: auto; padding-bottom: 8px; }
.mandala { display: grid; grid-template-columns: repeat(9, minmax(96px, 1fr)); gap: 4px; min-width: 900px; }
.mcell {
  aspect-ratio: 1 / 1; border-radius: 6px; padding: 6px; font-size: 10.5px; line-height: 1.25;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2);
  display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden;
  outline: none; transition: background .14s, border-color .14s, transform .1s;
}
.mcell:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--blue-soft); z-index: 2; }
.mcell.theme { background: var(--blue-soft); color: var(--med-blue); font-weight: 700; font-family: var(--font-head); border-color: transparent; }
.mcell.center-goal { background: var(--accent-grad); color: #fff; font-weight: 700; font-family: var(--font-head); font-size: 11px; border: none; }
.mcell.center-theme { background: var(--orange-soft); color: var(--accent); font-weight: 700; font-family: var(--font-head); border-color: transparent; }
.mcell:hover { transform: scale(1.03); z-index: 2; }

/* 3x3 plan */
.grid3x3 { display: grid; grid-template-columns: 120px repeat(3,1fr); gap: 10px; }
.g3-h { text-align: center; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; font-weight: 700; padding: 8px; border-radius: var(--r-sm); }
.g3-rl { display: flex; align-items: center; font-family: var(--font-head); font-weight: 600; font-size: 14px; padding-left: 4px; }
.g3-cell { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; font-size: 12.5px; min-height: 76px; outline: none; }
.g3-cell:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--blue-soft); }

/* Roadmap */
.roadmap { overflow-x: auto; }
.rm-grid { min-width: 760px; }
.rm-head { display: grid; grid-template-columns: 120px repeat(var(--rm-cols,6), 1fr); gap: 8px; margin-bottom: 10px; }
.rm-head .q { text-align: center; font-size: 11px; color: var(--ink-3); font-weight: 600; letter-spacing: .5px; padding: 6px; border-bottom: 1px solid var(--line); }
.rm-lane { display: grid; grid-template-columns: 120px 1fr; gap: 8px; margin-bottom: 12px; align-items: start; }
.rm-lane-lab { font-family: var(--font-head); font-weight: 600; font-size: 14px; padding: 10px 6px; border-radius: var(--r-sm); text-align: center; }
.rm-lane-lab.people { background: var(--blue-soft); color: var(--med-blue); }
.rm-lane-lab.product { background: var(--green-soft); color: var(--green); }
.rm-lane-lab.profit { background: var(--orange-soft); color: var(--accent); }
.rm-track { position: relative; display: grid; grid-template-columns: repeat(var(--rm-cols,6), 1fr); gap: 8px; }
.rm-item {
  grid-row: 1; padding: 9px 11px; border-radius: var(--r-sm); font-size: 12px;
  background: var(--surface-2); border: 1px solid var(--line-2); border-left: 3px solid var(--primary);
  min-height: 46px;
}
.rm-item b { font-family: var(--font-head); font-weight: 600; font-size: 12.5px; display: block; }
.rm-item span { color: var(--ink-3); font-size: 11px; }
.rm-item .nt { display: inline-block; margin-top: 4px; font-size: 9.5px; letter-spacing: .5px; text-transform: uppercase; padding: 1px 6px; border-radius: 999px; }
.nt.hire{background:var(--blue-soft);color:var(--med-blue)} .nt.ai{background:var(--orange-soft);color:var(--accent)}
.nt.product{background:var(--green-soft);color:var(--green)} .nt.capital{background:var(--amber-soft);color:var(--amber)}
.nt.partner{background:rgba(127,127,127,.18);color:var(--ink-2)}

/* Cascade sub-nav */
.subnav { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 0; }
.subnav button { background: none; border: none; color: var(--ink-2); font-family: var(--font-head); font-weight: 600; font-size: 13.5px;
  letter-spacing: .4px; padding: 10px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav button.on { color: #fff; border-bottom-color: var(--accent); }
.subnav button:hover { color: var(--ink); }
.sub-view { display: none; } .sub-view.on { display: block; animation: fade .2s; }

/* ==================== LIKELIHOOD ==================== */
.lk-layout { display: grid; grid-template-columns: 380px 1fr; gap: 20px; align-items: start; }
.lk-input { margin-bottom: 18px; }
.lk-input .lab { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.lk-input .lab b { font-size: 13.5px; font-family: var(--font-head); font-weight: 600; }
.lk-input .lab .val { font-family: var(--font-head); font-weight: 700; color: var(--primary); font-size: 15px; }
.lk-input .desc { font-size: 11.5px; color: var(--ink-3); margin-bottom: 9px; }
input[type=range] { -webkit-appearance: none; width: 100%; height: 6px; border-radius: 999px; outline: none;
  background: linear-gradient(90deg, var(--primary) var(--pct,50%), var(--surface-3) var(--pct,50%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 3px solid var(--primary); cursor: pointer; box-shadow: var(--shadow-sm); }
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--primary); cursor: pointer; }

.gauge { text-align: center; padding: 10px 0 6px; }
.gauge svg { width: 220px; height: 220px; }
.gauge .score-num { font-family: var(--font-head); font-weight: 700; font-size: 58px; fill: var(--ink); }
.gauge .score-lab { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; fill: var(--ink-3); }
.gauge-verdict { font-family: var(--font-head); font-weight: 600; font-size: 18px; margin-top: 2px; }

.reason-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.reason-row:last-child { border-bottom: none; }
.reason-row .rlab { width: 130px; flex: none; font-size: 12.5px; font-weight: 600; }
.reason-row .rbar { flex: 1; height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.reason-row .rbar i { display: block; height: 100%; border-radius: 999px; background: var(--blue-grad); }
.reason-row .rpts { width: 96px; text-align: right; font-size: 11.5px; color: var(--ink-3); font-family: var(--mono); }
.reason-row .rpts b { color: var(--ink); }
.res-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.res-item:last-child { border-bottom: none; }
.res-item .ri-ic { width: 20px; flex: none; color: var(--accent); }

/* ==================== COUNCIL ==================== */
.council-layout { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }
.roster-panel { position: sticky; top: 84px; }
.roster-tools { display: flex; gap: 8px; margin-bottom: 12px; }
.roster-search { flex: 1; background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 11px; color: var(--ink); font-size: 12.5px; outline: none; }
.roster-search:focus { border-color: var(--primary); }
.roster-stats { display: flex; gap: 8px; margin-bottom: 12px; font-size: 11px; color: var(--ink-3); flex-wrap: wrap; }
.roster-list { max-height: 560px; overflow-y: auto; margin: -4px; padding: 4px; }
.expert-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-sm); border: 1px solid transparent; transition: background .12s; }
.expert-row:hover { background: var(--surface-2); }
.expert-row.selected { background: var(--blue-soft); border-color: var(--line-glow); }
.expert-row .av { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 12px; color: #fff; }
.expert-row .info { flex: 1; min-width: 0; }
.expert-row .info b { font-size: 13px; display: flex; align-items: center; gap: 6px; }
.expert-row .info b .star { color: var(--amber); font-size: 10px; }
.expert-row .info span { font-size: 11px; color: var(--ink-3); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.expert-row .info .deep { color: var(--accent); }
.expert-row .tog { width: 34px; height: 20px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); position: relative; flex: none; transition: background .15s; }
.expert-row .tog::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--ink-3); transition: transform .15s, background .15s; }
.expert-row.active .tog { background: var(--green-soft); border-color: transparent; }
.expert-row.active .tog::after { transform: translateX(14px); background: var(--green); }

.council-main { min-width: 0; }
.council-modebar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.council-chat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); display: flex; flex-direction: column; height: 600px; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.chat-head .ch-hash { font-family: var(--font-head); font-weight: 600; font-size: 15px; }
.chat-head .ch-sub { font-size: 11.5px; color: var(--ink-3); }
.chat-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; gap: 11px; max-width: 88%; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg .m-av { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 12px; color: #fff; }
.msg.me .m-av { background: var(--surface-3); color: var(--ink-2); }
.msg .m-body { min-width: 0; }
.msg .m-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 12px; }
.msg .m-meta b { font-family: var(--font-head); font-weight: 600; }
.msg .m-meta .firm { color: var(--ink-3); font-size: 11px; }
.msg .m-bubble { background: var(--surface-2); border: 1px solid var(--line); border-radius: 3px 12px 12px 12px; padding: 12px 14px; font-size: 13.5px; line-height: 1.55; }
.msg.me .m-bubble { background: var(--blue-soft); border-color: transparent; border-radius: 12px 3px 12px 12px; }
.msg .m-bubble .q { color: var(--ink-3); font-style: italic; }
.msg .m-quote { margin-top: 8px; padding-left: 11px; border-left: 2px solid var(--accent); color: var(--ink-2); font-size: 12.5px; font-style: italic; }
.msg.sys { align-self: center; max-width: 100%; }
.msg.sys .m-bubble { background: transparent; border: 1px dashed var(--line-2); color: var(--ink-3); font-size: 12px; text-align: center; border-radius: 999px; padding: 6px 16px; }
.lean { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .5px; }
.lean.go{background:var(--green-soft);color:var(--green)} .lean.caution{background:var(--amber-soft);color:var(--amber)} .lean.stop{background:var(--red-soft);color:var(--red)}
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); animation: blink 1.3s infinite; }
.typing i:nth-child(2){animation-delay:.2s} .typing i:nth-child(3){animation-delay:.4s}
@keyframes blink { 0%,60%,100%{opacity:.25} 30%{opacity:1} }
.chair-card { border: 1px solid var(--line-glow); border-radius: var(--r-md); background: var(--surface-2); padding: 16px; margin-top: 4px; }
.chair-card h4 { font-size: 14px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.chair-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.chair-cols .cc-h { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 6px; }
.chair-cols ul { margin: 0; padding-left: 16px; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.chat-input { display: flex; gap: 10px; padding: 13px 16px; border-top: 1px solid var(--line); }
.chat-input input { flex: 1; background: var(--surface-3); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 11px 13px; color: var(--ink); font-size: 13.5px; outline: none; }
.chat-input input:focus { border-color: var(--primary); }
.suggest-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); font-size: 12px; padding: 6px 12px; border-radius: 999px; transition: border-color .14s, color .14s; }
.chip:hover { border-color: var(--line-glow); color: var(--ink); }
.council-note { font-size: 12px; color: var(--amber); background: var(--amber-soft); border: 1px solid transparent; border-radius: var(--r-sm); padding: 8px 12px; display: inline-flex; gap: 8px; align-items: center; }

/* Team HQ */
.team-card { display: flex; align-items: center; gap: 13px; padding: 14px; }
.team-card .av { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; color: #fff; flex: none; }
.team-card .ti { flex: 1; } .team-card .ti b { font-size: 14.5px; } .team-card .ti span { font-size: 12px; color: var(--ink-3); display: block; }

/* Empty / toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--surface-2); border: 1px solid var(--line-glow); color: var(--ink); padding: 12px 20px; border-radius: var(--r-pill); box-shadow: var(--shadow-lg); font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 300; display: flex; align-items: center; gap: 9px; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast .tk { color: var(--green); }

.mobile-scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 45; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1100px) {
  .lk-layout, .council-layout { grid-template-columns: 1fr; }
  .roster-panel { position: static; }
  .roster-list { max-height: 360px; }
  .grid-4 { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 860px) {
  :root { --sidebar-w: 0px; }
  .sidebar { width: 236px; transform: translateX(-100%); }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .sidebar.open ~ .mobile-scrim { display: block; }
  .main { margin-left: 0; }
  .hamburger { display: inline-flex; }
  .content { padding: 20px 16px 50px; }
  .grid-3, .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .chair-cols { grid-template-columns: 1fr; }
  .ver-select select { max-width: 120px; }
  .tb-titles .tb-sub { display: none; }
}
