  :root {
    --paper: #EEF1F7;
    --surface: #FFFFFF;
    --surface-2: #F6F8FC;
    --rail: #0A0D16;
    --rail-2: #070A11;
    --rail-ink: #C4CBDA;
    --rail-ink-dim: #767F95;
    --hair: #E4E8F0;
    --hair-strong: #D3D9E5;
    --ink: #0B0F1A;
    --ink-2: #38414F;
    --ink-mut: #616B7D;
    --ink-faint: #949CAD;
    --accent: #8A18D6;
    --accent-ink: #6301C8;
    --accent-tint: #F4E7FC;
    --accent-tint-2: #E7CFF9;
    --good: #12946B;
    --good-tint: #E1F3EC;
    --watch: #C2841A;
    --watch-tint: #F7EED9;
    --risk: #DA4C3C;
    --risk-tint: #FAE5E2;
    --violet: #7C5CFF;
    --data-blue: #3B82F6;
    --shadow: 0 1px 2px rgba(11,15,26,.05), 0 10px 26px -14px rgba(11,15,26,.16);
    --shadow-lg: 0 30px 70px -26px rgba(11,20,45,.4);
    --r: 12px;
    --r-sm: 8px;
    --font-ui: "Inter var", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  }
  @media (prefers-color-scheme: dark) {
    :root {
      --paper: #090C13; --surface: #10141E; --surface-2: #0C1017;
      --rail: #06080E; --rail-2: #04060B; --rail-ink: #BEC6D6; --rail-ink-dim: #697187;
      --hair: #1E2430; --hair-strong: #2A3140;
      --ink: #EAEEF6; --ink-2: #C0C8D6; --ink-mut: #8892A2; --ink-faint: #626C7D;
      --accent: #B57CFF; --accent-ink: #CBA6FF; --accent-tint: #251338; --accent-tint-2: #37205E;
      --good: #35B98A; --good-tint: #10281F; --watch: #D6A34A; --watch-tint: #2C2210;
      --risk: #E7695B; --risk-tint: #2E1815; --violet: #9B82FF; --data-blue: #5B9BFF;
      --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 30px -16px rgba(0,0,0,.7);
      --shadow-lg: 0 34px 80px -30px rgba(0,0,0,.8);
    }
  }
  :root[data-theme="light"] {
    --paper:#EEF1F7;--surface:#FFFFFF;--surface-2:#F6F8FC;--rail:#0A0D16;--rail-2:#070A11;
    --rail-ink:#C4CBDA;--rail-ink-dim:#767F95;--hair:#E4E8F0;--hair-strong:#D3D9E5;
    --ink:#0B0F1A;--ink-2:#38414F;--ink-mut:#616B7D;--ink-faint:#949CAD;
    --accent:#8A18D6;--accent-ink:#6301C8;--accent-tint:#F4E7FC;--accent-tint-2:#E7CFF9;
    --good:#12946B;--good-tint:#E1F3EC;--watch:#C2841A;--watch-tint:#F7EED9;--risk:#DA4C3C;--risk-tint:#FAE5E2;--violet:#7C5CFF;--data-blue:#3B82F6;
    --shadow:0 1px 2px rgba(11,15,26,.05),0 10px 26px -14px rgba(11,15,26,.16);--shadow-lg:0 30px 70px -26px rgba(11,20,45,.4);
  }
  :root[data-theme="dark"] {
    --paper:#090C13;--surface:#10141E;--surface-2:#0C1017;--rail:#06080E;--rail-2:#04060B;
    --rail-ink:#BEC6D6;--rail-ink-dim:#697187;--hair:#1E2430;--hair-strong:#2A3140;
    --ink:#EAEEF6;--ink-2:#C0C8D6;--ink-mut:#8892A2;--ink-faint:#626C7D;
    --accent:#B57CFF;--accent-ink:#CBA6FF;--accent-tint:#251338;--accent-tint-2:#37205E;
    --good:#35B98A;--good-tint:#10281F;--watch:#D6A34A;--watch-tint:#2C2210;--risk:#E7695B;--risk-tint:#2E1815;--violet:#9B82FF;--data-blue:#5B9BFF;
    --shadow:0 1px 2px rgba(0,0,0,.4),0 12px 30px -16px rgba(0,0,0,.7);--shadow-lg:0 34px 80px -30px rgba(0,0,0,.8);
  }

  * { box-sizing: border-box; }
  body { margin: 0; }
  .app {
    font-family: var(--font-ui); color: var(--ink); background: var(--paper);
    -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
    height: 100vh; display: grid; grid-template-columns: 236px minmax(0,1fr) 372px; overflow: hidden;
    letter-spacing: -0.006em;
  }
  .app.copilot-collapsed { grid-template-columns: 236px minmax(0,1fr) 56px; }
  .app.hidden { display: none; }
  button { font-family: inherit; cursor: pointer; }
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
  .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }

  /* ---------- RAIL ---------- */
  .rail { background: var(--rail); color: var(--rail-ink); display: flex; flex-direction: column; padding: 16px 12px 12px; gap: 3px; }
  .brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; }
  .brand-mark { width: 26px; height: 21px; flex: none; display: grid; place-items: center; }
  .brand-mark svg { width: 26px; height: 21px; display: block; }
  .brand-stack { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
  .brand-name { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; color: #fff; line-height: 1; }
  .brand-name span { color: #c79bff; }
  .brand-by { display: flex; align-items: center; gap: 4px; font-size: 9.5px; color: var(--rail-ink-dim); letter-spacing: .02em; }
  .brand-by .dw-word { display: inline-flex; color: var(--rail-ink); }
  .brand-by .dw-word svg { height: 8px; width: auto; display: block; }

  .ws { display: flex; align-items: center; gap: 9px; padding: 8px; margin-bottom: 6px; border: 1px solid rgba(255,255,255,.08); border-radius: var(--r-sm); background: rgba(255,255,255,.03); }
  .ws .dot { width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(140deg,#7C5CFF,#4b34c8); flex: none; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 700; }
  .ws .ws-name { font-weight: 600; color: #fff; font-size: 12.5px; }
  .ws .ws-role { color: var(--rail-ink-dim); font-size: 11px; }
  .ws .chev { margin-left: auto; color: var(--rail-ink-dim); }

  .nav-label { font-size: 10px; letter-spacing: .11em; text-transform: uppercase; color: var(--rail-ink-dim); padding: 13px 8px 5px; font-weight: 700; }
  .nav-item { display: flex; align-items: center; gap: 11px; padding: 8px; border-radius: var(--r-sm); color: var(--rail-ink); background: none; border: 0; width: 100%; text-align: left; font-size: 13px; line-height: 1; font-weight: 500; }
  .nav-item svg { width: 17px; height: 17px; opacity: .8; flex: none; }
  .nav-item .count { margin-left: auto; font-size: 11px; color: var(--rail-ink-dim); font-family: var(--font-mono); }
  .nav-item:hover { background: rgba(255,255,255,.055); }
  .nav-item.active { background: rgba(181,124,255,.17); color: #fff; }
  .nav-item.active svg { opacity: 1; color: #c79bff; }
  .nav-item.active .count { color: #c79bff; }
  .rail-spacer { flex: 1; }
  .rail-foot { border-top: 1px solid rgba(255,255,255,.07); padding-top: 8px; margin-top: 6px; }

  /* ---------- WORK ---------- */
  .work { display: flex; flex-direction: column; min-width: 0; background: var(--paper); }
  .topbar { display: flex; align-items: center; gap: 13px; padding: 0 24px; height: 56px; flex: none; border-bottom: 1px solid var(--hair); background: color-mix(in srgb, var(--paper) 84%, transparent); backdrop-filter: blur(8px); }
  .crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-mut); }
  .crumb b { color: var(--ink); font-weight: 600; }
  .crumb .sep { color: var(--ink-faint); }
  .cmdk { margin-left: auto; display: flex; align-items: center; gap: 8px; padding: 7px 10px 7px 11px; min-width: 220px; border: 1px solid var(--hair-strong); border-radius: 9px; background: var(--surface); color: var(--ink-mut); font-size: 12.5px; }
  .cmdk:hover { border-color: var(--accent); }
  .cmdk svg { width: 14px; height: 14px; }
  .cmdk .kbd { margin-left: auto; }
  .kbd { font-family: var(--font-mono); font-size: 10.5px; padding: 2px 5px; border: 1px solid var(--hair-strong); border-radius: 5px; color: var(--ink-mut); background: var(--surface-2); }
  .icon-btn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--hair-strong); background: var(--surface); color: var(--ink-2); display: grid; place-items: center; }
  .icon-btn svg { width: 16px; height: 16px; }
  .icon-btn:hover { border-color: var(--accent); color: var(--accent); }
  .avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(140deg,#7C5CFF,#4b34c8); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 600; }

  .scroll { overflow-y: auto; flex: 1; }
  .scroll::-webkit-scrollbar { width: 11px; }
  .scroll::-webkit-scrollbar-thumb { background: var(--hair-strong); border-radius: 10px; border: 3px solid var(--paper); }
  .section { display: none; padding: 22px 24px 64px; }
  .section.active { display: block; }
  .asset-body { display: none; }
  .asset-body.active { display: block; }

  .page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
  .page-title { font-size: 24px; font-weight: 700; letter-spacing: -0.03em; margin: 0; text-wrap: balance; }
  .page-sub { color: var(--ink-mut); font-size: 13px; margin: 4px 0 0; max-width: 62ch; }
  .page-head .actions { margin-left: auto; display: flex; gap: 9px; }
  .btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 9px; font-size: 13px; font-weight: 550; border: 1px solid var(--hair-strong); background: var(--surface); color: var(--ink); white-space: nowrap; }
  .btn svg { width: 15px; height: 15px; }
  .btn:hover { border-color: var(--ink-faint); }
  .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
  .btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
  .btn.ai { background: var(--accent-tint); border-color: var(--accent-tint-2); color: var(--accent-ink); }
  .btn.ai:hover { background: var(--accent-tint-2); }
  .btn.sm { padding: 6px 10px; font-size: 12px; }

  .kpis { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 20px; }
  .kpi { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); }
  .kpi .k-label { font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-mut); font-weight: 700; }
  .kpi .k-val { font-size: 27px; font-weight: 700; letter-spacing: -0.03em; margin-top: 7px; display: flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; }
  .kpi .k-val small { font-size: 13px; color: var(--ink-mut); font-weight: 500; letter-spacing: 0; }
  .kpi .k-trend { font-size: 11.5px; margin-top: 6px; color: var(--ink-mut); }
  .kpi .k-trend .up { color: var(--good); font-weight: 600; }
  .kpi .k-trend .dn { color: var(--risk); font-weight: 600; }

  .panel { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
  .panel-bar { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--hair); flex-wrap: wrap; }
  .seg { display: flex; gap: 2px; background: var(--surface-2); border: 1px solid var(--hair); border-radius: 9px; padding: 3px; }
  .seg button { border: 0; background: none; padding: 5px 11px; border-radius: 6px; font-size: 12.5px; color: var(--ink-mut); font-weight: 500; }
  .seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
  .find { margin-left: auto; display: flex; align-items: center; gap: 7px; color: var(--ink-mut); font-size: 12.5px; border: 1px solid var(--hair-strong); border-radius: 9px; padding: 6px 10px; background: var(--surface); }
  .find svg { width: 14px; height: 14px; }
  .find input { border: 0; background: none; outline: none; color: var(--ink); font-family: inherit; font-size: 12.5px; width: 150px; }

  table { width: 100%; border-collapse: collapse; }
  thead th { text-align: left; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-mut); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--hair); background: var(--surface-2); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
  thead th.num { text-align: right; }
  tbody td { padding: 12px 14px; border-bottom: 1px solid var(--hair); font-size: 13px; vertical-align: middle; }
  tbody tr.data { cursor: pointer; }
  tbody tr:last-child td { border-bottom: 0; }
  tbody tr.data:hover { background: var(--surface-2); }
  tbody tr.open { background: var(--accent-tint); }
  .row-name { display: flex; align-items: center; gap: 11px; }
  .glyph { width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 12px; background: var(--accent-tint); color: var(--accent-ink); }
  .rn-main { font-weight: 600; letter-spacing: -0.01em; }
  .rn-sub { font-size: 11px; color: var(--ink-mut); margin-top: 1px; font-family: var(--font-mono); }

  .chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 7px; white-space: nowrap; }
  .chip.ai { background: var(--accent-tint); color: var(--accent-ink); }
  .chip.hybrid { background: var(--watch-tint); color: var(--watch); }
  .chip.core { background: color-mix(in srgb, var(--ink-mut) 15%, transparent); color: var(--ink-2); }
  .lang { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); }
  .lang .arw { color: var(--ink-faint); margin: 0 2px; }

  .status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); white-space: nowrap; }
  .status .sd { width: 7px; height: 7px; border-radius: 50%; }
  .status.live .sd { background: var(--good); box-shadow: 0 0 0 3px var(--good-tint); }
  .status.tuning .sd { background: var(--watch); box-shadow: 0 0 0 3px var(--watch-tint); }
  .status.review .sd { background: var(--risk); box-shadow: 0 0 0 3px var(--risk-tint); }
  .status.idx .sd { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
  .status.draft .sd { background: var(--ink-faint); box-shadow: 0 0 0 3px var(--hair); }

  /* volume bar */
  .vol { display: flex; align-items: center; gap: 9px; justify-content: flex-end; }
  .vol .vnum { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); width: 52px; text-align: right; }
  .vol .vbar { width: 46px; height: 5px; border-radius: 4px; background: var(--hair-strong); overflow: hidden; }
  .vol .vbar i { display: block; height: 100%; background: var(--data-blue); border-radius: 4px; }

  /* trust meter */
  .trust { display: flex; align-items: center; gap: 9px; justify-content: flex-end; }
  .trust .tval { font-family: var(--font-mono); font-weight: 600; font-size: 13px; width: 24px; text-align: right; }
  .trust .meter { width: 60px; height: 6px; border-radius: 5px; background: var(--hair-strong); position: relative; overflow: hidden; }
  .trust .meter i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; }
  .g-good{color:var(--good);} .bg-good{background:var(--good);}
  .g-watch{color:var(--watch);} .bg-watch{background:var(--watch);}
  .g-risk{color:var(--risk);} .bg-risk{background:var(--risk);}
  .spark-svg { display: block; }

  /* pager */
  .pager { display: flex; align-items: center; gap: 6px; padding: 12px 14px; border-top: 1px solid var(--hair); }
  .pager .pinfo { font-size: 12px; color: var(--ink-mut); margin-right: auto; }
  .pager button { min-width: 30px; height: 30px; padding: 0 8px; border-radius: 7px; border: 1px solid var(--hair-strong); background: var(--surface); color: var(--ink-2); font-size: 12.5px; font-family: var(--font-mono); }
  .pager button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
  .pager button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
  .pager button:disabled { opacity: .4; cursor: default; }
  .pager .dots { color: var(--ink-faint); padding: 0 2px; }

  /* detail drawer */
  .detail-row td { padding: 0; background: var(--surface-2); }
  .detail { padding: 4px 18px 20px 56px; }
  .detail-tabs { display: flex; border-bottom: 1px solid var(--hair); margin-bottom: 16px; }
  .detail-tabs button { border: 0; background: none; padding: 11px 4px; margin-right: 18px; font-size: 12.5px; color: var(--ink-mut); border-bottom: 2px solid transparent; font-weight: 550; }
  .detail-tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
  .dgrid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 24px; }
  .dcard-label { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-mut); font-weight: 700; margin-bottom: 10px; }
  .attach { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--hair); border-radius: var(--r-sm); background: var(--surface); margin-bottom: 8px; }
  .attach .a-ic { width: 26px; height: 26px; border-radius: 6px; background: var(--accent-tint); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
  .attach .a-ic svg { width: 14px; height: 14px; }
  .attach .a-main { font-size: 13px; font-weight: 550; }
  .attach .a-sub { font-size: 11px; color: var(--ink-mut); }
  .attach .a-meta { margin-left: auto; font-size: 11px; color: var(--ink-mut); font-family: var(--font-mono); }
  .eval-line { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--hair); font-size: 12.5px; }
  .eval-line:last-child { border-bottom: 0; }
  .eval-line .el-date { font-family: var(--font-mono); font-size: 11px; color: var(--ink-mut); width: 58px; }

  /* generic cards */
  .cards { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; }
  .cards.three { grid-template-columns: repeat(3,1fr); }
  .card { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r); padding: 16px 17px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 13px; }
  .card:hover { border-color: var(--hair-strong); }
  .card .c-head { display: flex; align-items: flex-start; gap: 11px; }
  .card .c-glyph { width: 34px; height: 34px; border-radius: 9px; flex: none; display: grid; place-items: center; background: var(--accent-tint); color: var(--accent-ink); }
  .card .c-glyph svg { width: 17px; height: 17px; }
  .card h3 { margin: 0; font-size: 14.5px; font-weight: 650; letter-spacing: -0.01em; }
  .card .c-sub { font-size: 12px; color: var(--ink-mut); margin-top: 2px; }
  .tags { display: flex; flex-wrap: wrap; gap: 6px; }
  .tg { font-size: 11px; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--hair); color: var(--ink-2); }
  .c-foot { display: flex; align-items: center; gap: 12px; margin-top: auto; padding-top: 3px; font-size: 11.5px; color: var(--ink-mut); }
  .c-foot .src { display: inline-flex; align-items: center; gap: 5px; }
  .c-foot .src svg { width: 12px; height: 12px; }

  /* tone axis */
  .tone-axis { margin-bottom: 12px; }
  .tone-axis:last-child { margin-bottom: 0; }
  .tone-axis .ta-top { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-mut); margin-bottom: 5px; }
  .tone-axis .ta-track { height: 5px; border-radius: 4px; background: var(--hair-strong); position: relative; }
  .tone-axis .ta-track i { position: absolute; top: -3.5px; width: 11px; height: 11px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); box-shadow: var(--shadow); }

  /* benchmarks */
  .rank-badge { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-family: var(--font-mono); font-size: 11px; font-weight: 700; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--hair); }
  .rank-badge.top { background: var(--accent); color: #fff; border-color: var(--accent); }
  .delta { font-family: var(--font-mono); font-size: 12px; font-weight: 600; }

  /* knowledge graph */
  .kg-wrap { display: grid; grid-template-columns: 1fr 260px; gap: 16px; }
  .kg-canvas { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; position: relative; }
  .kg-canvas svg { display: block; width: 100%; height: auto; }
  .kg-node-label { font-size: 10.5px; font-weight: 600; fill: var(--ink); font-family: var(--font-ui); }
  .kg-side .kg-stat { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r); padding: 13px 15px; box-shadow: var(--shadow); margin-bottom: 10px; }
  .kg-legend { display: flex; flex-direction: column; gap: 8px; }
  .kg-legend .lg { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--ink-2); }
  .kg-legend .lg .sw { width: 11px; height: 11px; border-radius: 3px; }

  .empty-hint { text-align: center; color: var(--ink-mut); padding: 50px 20px; background: var(--surface); border: 1px dashed var(--hair-strong); border-radius: var(--r); }

  /* ---------- COPILOT ---------- */
  .copilot { background: var(--surface); border-left: 1px solid var(--hair); display: flex; flex-direction: column; min-width: 0; }
  .app.copilot-collapsed .cop-body, .app.copilot-collapsed .cop-title-wrap, .app.copilot-collapsed .cop-compose { display: none; }
  .cop-head { display: flex; align-items: center; gap: 10px; padding: 13px 14px; border-bottom: 1px solid var(--hair); flex: none; }
  .cop-title { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 14px; }
  .cop-title .spark-badge { width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(145deg,#C205DF,#6301C8); display: grid; place-items: center; }
  .cop-title .spark-badge svg { width: 13px; height: 13px; color: #fff; }
  .cop-sub { font-size: 11px; color: var(--ink-mut); margin-top: 2px; }
  .cop-collapse { margin-left: auto; }
  .app.copilot-collapsed .cop-head { flex-direction: column; padding: 13px 0; }
  .app.copilot-collapsed .cop-collapse { margin-left: 0; }
  .cop-body { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 16px; }
  .cop-body::-webkit-scrollbar { width: 8px; }
  .cop-body::-webkit-scrollbar-thumb { background: var(--hair-strong); border-radius: 8px; border: 2px solid var(--surface); }
  .msg { display: flex; flex-direction: column; gap: 7px; }
  .msg .who { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; color: var(--ink-faint); }
  .msg.user .bubble { align-self: flex-start; background: var(--accent-tint); border: 1px solid var(--accent-tint-2); color: var(--accent-ink); padding: 10px 12px; border-radius: 11px 11px 11px 3px; font-size: 13px; }
  .msg.bot .body { font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
  .msg.bot .body p { margin: 0 0 9px; }
  .msg.bot .body p:last-child { margin-bottom: 0; }
  .msg.bot .body b { color: var(--ink); font-weight: 600; }
  .cursor::after { content: "▍"; color: var(--accent); animation: blink 1s steps(1) infinite; }
  @keyframes blink { 50% { opacity: 0; } }
  .artifact { border: 1px solid var(--accent-tint-2); border-radius: var(--r); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); opacity: 0; transform: translateY(6px); animation: rise .4s ease forwards; }
  @keyframes rise { to { opacity: 1; transform: none; } }
  .art-head { display: flex; align-items: center; gap: 9px; padding: 9px 12px; background: var(--accent-tint); border-bottom: 1px solid var(--accent-tint-2); }
  .art-head .ah-ic { color: var(--accent-ink); display: grid; place-items: center; }
  .art-head .ah-ic svg { width: 15px; height: 15px; }
  .art-head .ah-title { font-size: 12.5px; font-weight: 650; color: var(--accent-ink); }
  .art-head .ah-tag { margin-left: auto; font-size: 9.5px; letter-spacing: .05em; text-transform: uppercase; font-weight: 700; color: var(--accent); background: var(--surface); padding: 2px 7px; border-radius: 20px; border: 1px solid var(--accent-tint-2); }
  .art-body { padding: 11px 12px; font-size: 12.5px; color: var(--ink-2); display: flex; flex-direction: column; gap: 8px; }
  .art-kv { display: flex; justify-content: space-between; gap: 10px; }
  .art-kv .k { color: var(--ink-mut); }
  .art-kv .v { font-weight: 550; color: var(--ink); text-align: right; }
  .art-kv .v.mono { font-family: var(--font-mono); font-size: 12px; }
  .art-list { display: flex; flex-direction: column; gap: 6px; }
  .art-list .ali { display: flex; gap: 8px; align-items: flex-start; }
  .art-list .ali svg { width: 13px; height: 13px; color: var(--good); flex: none; margin-top: 2px; }
  .art-foot { display: flex; gap: 7px; padding: 10px 12px; border-top: 1px solid var(--hair); background: var(--surface-2); }
  .art-foot .btn { padding: 6px 11px; font-size: 12px; flex: 1; justify-content: center; }
  .cop-compose { flex: none; border-top: 1px solid var(--hair); padding: 12px 14px 14px; }
  .cop-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
  .cop-chips button { font-size: 11.5px; padding: 5px 10px; border-radius: 20px; border: 1px solid var(--hair-strong); background: var(--surface); color: var(--ink-2); }
  .cop-chips button:hover { border-color: var(--accent); color: var(--accent); }
  .composer { border: 1px solid var(--hair-strong); border-radius: var(--r); background: var(--surface-2); padding: 10px 11px; }
  .composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
  .composer textarea { width: 100%; border: 0; background: none; resize: none; outline: none; font-family: inherit; font-size: 13px; color: var(--ink); line-height: 1.45; }
  .composer textarea::placeholder { color: var(--ink-faint); }
  .composer-bar { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
  .composer-bar .model { font-size: 11px; color: var(--ink-mut); display: inline-flex; align-items: center; gap: 5px; }
  .composer-bar .model .d { width: 6px; height: 6px; border-radius: 50%; background: var(--good); }
  .send { margin-left: auto; width: 30px; height: 30px; border-radius: 8px; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; }
  .send:hover { background: var(--accent-ink); }
  .send svg { width: 15px; height: 15px; }
  .cop-collapsed-rail { display: none; }
  .app.copilot-collapsed .cop-collapsed-rail { display: flex; justify-content: center; padding-top: 16px; color: var(--ink-mut); }
  .app.copilot-collapsed .cop-collapsed-rail svg { width: 18px; height: 18px; }

  /* ---------- ADMIN (separate page) ---------- */
  .admin { display: none; height: 100vh; overflow: hidden; grid-template-columns: 250px minmax(0,1fr); font-family: var(--font-ui); color: var(--ink); background: var(--paper); letter-spacing: -0.006em; }
  .admin.active { display: grid; }
  .adm-rail { background: var(--rail-2); color: var(--rail-ink); display: flex; flex-direction: column; padding: 16px 12px; }
  .adm-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 8px; }
  .adm-brand .tag { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: #f0b34a; font-weight: 700; border: 1px solid rgba(240,179,74,.3); padding: 2px 7px; border-radius: 20px; }
  .adm-back { display: flex; align-items: center; gap: 9px; padding: 9px 8px; border-radius: var(--r-sm); background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); color: var(--rail-ink); font-size: 12.5px; margin: 8px 0 12px; width: 100%; }
  .adm-back:hover { background: rgba(255,255,255,.08); color: #fff; }
  .adm-back svg { width: 15px; height: 15px; }
  .adm-main { display: flex; flex-direction: column; min-width: 0; }
  .adm-top { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 26px; border-bottom: 1px solid var(--hair); background: var(--surface); flex: none; }
  .adm-top .at-title { font-weight: 700; font-size: 15px; letter-spacing: -0.02em; }
  .adm-body { overflow-y: auto; padding: 24px 26px 60px; }
  .adm-sec { display: none; }
  .adm-sec.active { display: block; }
  .stat-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 20px; }

  .badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 20px; }
  .badge.admin { background: var(--accent-tint); color: var(--accent-ink); }
  .badge.mgr { background: color-mix(in srgb,var(--violet) 16%,transparent); color: var(--violet); }
  .badge.ling { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--hair); }
  .badge.on { background: var(--good-tint); color: var(--good); }
  .badge.off { background: var(--surface-2); color: var(--ink-mut); border: 1px solid var(--hair); }
  .badge.inv { background: var(--watch-tint); color: var(--watch); }
  .ava-sm { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 600; flex: none; }

  /* ---------- ENGINE EDITOR (separate page) ---------- */
  .editor { display: none; height: 100vh; overflow: hidden; flex-direction: column; font-family: var(--font-ui); color: var(--ink); background: var(--paper); letter-spacing: -0.006em; }
  .editor.active { display: flex; }
  .ed-top { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 20px; border-bottom: 1px solid var(--hair); background: var(--surface); flex: none; }
  .ed-titlewrap { min-width: 0; }
  .ed-title { font-weight: 700; font-size: 15px; letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; }
  .ed-crumb { font-size: 11px; color: var(--ink-mut); margin-top: 1px; }
  .ed-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }
  .ed-actions select { font-family: inherit; font-size: 12.5px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--hair-strong); border-radius: 8px; padding: 7px 9px; outline: none; }
  .ed-body { overflow-y: auto; flex: 1; padding: 24px; }
  .ed-body::-webkit-scrollbar { width: 11px; }
  .ed-body::-webkit-scrollbar-thumb { background: var(--hair-strong); border-radius: 10px; border: 3px solid var(--paper); }
  .ed-grid { display: grid; grid-template-columns: minmax(0,1fr) 344px; gap: 20px; max-width: 1120px; margin: 0 auto; align-items: start; }
  .ed-card { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r); box-shadow: var(--shadow); margin-bottom: 18px; }
  .ed-card-head { padding: 13px 16px; border-bottom: 1px solid var(--hair); display: flex; align-items: center; gap: 10px; }
  .ed-card-head h3 { margin: 0; font-size: 14px; font-weight: 650; letter-spacing: -0.01em; }
  .ed-card-head .sub { font-size: 11px; color: var(--ink-mut); }
  .ed-card-body { padding: 16px; }
  .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
  .field:last-child { margin-bottom: 0; }
  .field label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-mut); }
  .field input, .field textarea, .field select { font-family: inherit; font-size: 13px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--hair-strong); border-radius: 8px; padding: 9px 11px; outline: none; width: 100%; }
  .field textarea { resize: vertical; }
  .field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
  .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .seg-choice { display: flex; gap: 6px; }
  .seg-choice button { flex: 1; padding: 9px; border: 1px solid var(--hair-strong); border-radius: 8px; background: var(--surface-2); font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
  .seg-choice button.on { border-color: var(--accent); background: var(--accent-tint); color: var(--accent-ink); font-weight: 600; }

  .pipeline { display: flex; flex-direction: column; align-items: stretch; }
  .pl-end { align-self: center; font-family: var(--font-mono); font-size: 11px; color: var(--ink-mut); background: var(--surface-2); border: 1px solid var(--hair); border-radius: 20px; padding: 5px 13px; }
  .pl-conn { align-self: center; width: 2px; height: 14px; background: var(--hair-strong); }
  .pl-add { align-self: center; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--accent-ink); background: var(--accent-tint); border: 1px dashed var(--accent-tint-2); border-radius: 8px; padding: 6px 13px; font-weight: 550; }
  .pl-add svg { width: 13px; height: 13px; }
  .pl-add:hover { background: var(--accent-tint-2); }
  .pl-phase-label { align-self: center; font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); font-weight: 700; margin: 4px 0; }
  .pl-stage { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border: 1px solid var(--hair); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
  .pl-stage .st-ic { width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center; background: var(--accent-tint); color: var(--accent-ink); }
  .pl-stage .st-ic svg { width: 16px; height: 16px; }
  .pl-stage .st-main { font-size: 13px; font-weight: 600; }
  .pl-stage .st-sub { font-size: 11px; color: var(--ink-mut); margin-top: 1px; }
  .pl-stage .st-ctrls { margin-left: auto; display: flex; gap: 4px; }
  .pl-stage .st-ctrls button { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--hair); background: var(--surface); color: var(--ink-mut); display: grid; place-items: center; }
  .pl-stage .st-ctrls button svg { width: 13px; height: 13px; }
  .pl-stage .st-ctrls button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
  .pl-stage .st-ctrls button:disabled { opacity: .35; cursor: default; }
  .pl-nmt { border: 1.5px solid var(--accent); background: var(--accent-tint); cursor: pointer; }
  .pl-nmt .st-ic { background: var(--accent); color: #fff; }
  .pl-nmt:hover { box-shadow: 0 0 0 3px var(--accent-tint); }

  .att-list { display: flex; flex-direction: column; gap: 8px; }
  .att-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--hair); border-radius: 8px; background: var(--surface-2); }
  .att-item .ai2 { width: 24px; height: 24px; border-radius: 6px; flex: none; display: grid; place-items: center; background: var(--accent-tint); color: var(--accent-ink); }
  .att-item .ai2 svg { width: 13px; height: 13px; }
  .att-item .an { font-size: 12.5px; font-weight: 550; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .att-item .an small { display: block; font-weight: 400; color: var(--ink-mut); font-size: 10.5px; }
  .att-item .rm { margin-left: auto; width: 24px; height: 24px; border-radius: 6px; border: 0; background: none; color: var(--ink-faint); display: grid; place-items: center; flex: none; }
  .att-item .rm svg { width: 14px; height: 14px; }
  .att-item .rm:hover { color: var(--risk); background: var(--risk-tint); }
  .att-empty { font-size: 12px; color: var(--ink-faint); }
  .danger-zone { border: 1px solid color-mix(in srgb, var(--risk) 40%, transparent); border-radius: var(--r-sm); padding: 13px 14px; background: var(--risk-tint); display: flex; align-items: center; gap: 12px; }
  .danger-zone .dz-txt { font-size: 12px; color: var(--ink-2); }
  .danger-zone .dz-txt b { color: var(--ink); }
  .btn.danger { margin-left: auto; background: var(--surface); border-color: var(--risk); color: var(--risk); }
  .btn.danger:hover { background: var(--risk); color: #fff; }

  .pk-title { padding: 14px 17px 2px; font-weight: 650; font-size: 14px; }
  .pk-title small { display: block; font-weight: 400; font-size: 11.5px; color: var(--ink-mut); margin-top: 2px; }
  .pk-opt { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; font-size: 13px; cursor: pointer; }
  .pk-opt:hover { background: var(--accent-tint); }
  .pk-opt .ck { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--hair-strong); display: grid; place-items: center; flex: none; color: #fff; }
  .pk-opt .ck svg { width: 12px; height: 12px; opacity: 0; }
  .pk-opt.sel .ck { background: var(--accent); border-color: var(--accent); }
  .pk-opt.sel .ck svg { opacity: 1; }
  .pk-opt .pk-ic { width: 26px; height: 26px; border-radius: 7px; background: var(--accent-tint); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
  .pk-opt .pk-ic svg { width: 14px; height: 14px; }
  .pk-opt .pk-sub { color: var(--ink-mut); font-size: 11.5px; }
  .pk-foot { padding: 11px 14px; border-top: 1px solid var(--hair); display: flex; justify-content: flex-end; gap: 8px; }
  .pl-nmt.view { cursor: default; }
  .pl-nmt.view:hover { box-shadow: var(--shadow); }
  .ep-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 18px; }

  /* live translations feed */
  .tx-live { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--good); }
  .tx-live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px var(--good-tint); animation: pulse 1.6s infinite; }
  .tx-live.paused { color: var(--ink-mut); }
  .tx-live.paused .dot { background: var(--ink-faint); box-shadow: 0 0 0 3px var(--hair); animation: none; }
  @keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
  @keyframes txflash { from { background: var(--accent-tint); } to { background: transparent; } }
  #txTable tbody tr.tx-fresh { animation: txflash 1.5s ease; }
  .tx-cell { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
  .tx-src { color: var(--ink-mut); }
  .tx-tgt { color: var(--ink); font-weight: 500; }
  .tx-note { padding: 11px 14px; border-top: 1px solid var(--hair); font-size: 12px; color: var(--ink-mut); }

  /* dashboard */
  .dash-hero { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 16px; }
  .dash-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; }
  .dash-grid .span2 { grid-column: 1 / -1; }
  .barh { display: flex; flex-direction: column; gap: 10px; }
  .barh .br { display: grid; grid-template-columns: 108px 1fr 58px; align-items: center; gap: 10px; }
  .barh .br .bl { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
  .barh .br .bt { height: 8px; border-radius: 5px; background: var(--hair-strong); overflow: hidden; }
  .barh .br .bt i { display: block; height: 100%; border-radius: 5px; }
  .barh .br .bv { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; text-align: right; font-size: 12px; }
  .dlegend { display: flex; flex-wrap: wrap; gap: 8px 14px; }
  .dlegend .li { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-2); }
  .dlegend .li .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
  .dlist { display: flex; flex-direction: column; }
  .dlist .di { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--hair); font-size: 12.5px; }
  .dlist .di:last-child { border-bottom: 0; }
  .dlist .di.clk { cursor: pointer; margin: 0 -6px; padding-left: 6px; padding-right: 6px; border-radius: 6px; }
  .dlist .di.clk:hover { background: var(--surface-2); }
  .dlist .di .dn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
  .dlist .di .dsub { color: var(--ink-mut); font-size: 11px; font-weight: 400; }
  .help { position: relative; display: inline-flex; outline: none; }
  .help .hbtn { width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--hair-strong); background: var(--surface-2); color: var(--ink-mut); font-size: 9.5px; font-weight: 700; display: grid; place-items: center; cursor: help; line-height: 1; }
  .help:hover .hbtn, .help:focus-visible .hbtn { border-color: var(--accent); color: var(--accent); }
  .help .hpop { position: absolute; top: calc(100% + 9px); right: 0; width: 232px; background: var(--rail); color: #fff; font-size: 11.5px; font-weight: 400; line-height: 1.5; text-transform: none; letter-spacing: 0; padding: 10px 12px; border-radius: 9px; box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity .15s ease, transform .15s ease; z-index: 40; pointer-events: none; }
  .help .hpop::after { content: ""; position: absolute; bottom: 100%; right: 8px; border: 5px solid transparent; border-bottom-color: var(--rail); }
  .help:hover .hpop, .help:focus-within .hpop { opacity: 1; visibility: visible; transform: none; }

  /* developer docs */
  .doc-wrap { max-width: 940px; }
  .code { background: var(--rail); border-radius: 10px; overflow: hidden; }
  .code .cbar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid rgba(255,255,255,.08); }
  .code .cbar .cname { font-family: var(--font-mono); font-size: 11px; color: var(--rail-ink-dim); }
  .code .copy-btn { margin-left: auto; font-family: var(--font-ui); font-size: 11px; color: var(--rail-ink); background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: 6px; padding: 3px 9px; }
  .code .copy-btn:hover { background: rgba(255,255,255,.14); color: #fff; }
  .code pre { margin: 0; padding: 13px 14px; overflow-x: auto; font-family: var(--font-mono); font-size: 12px; line-height: 1.65; color: #dbe3f0; white-space: pre; }
  .endpoint { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--hair); }
  .endpoint:last-of-type { border-bottom: 0; margin-bottom: 6px; }
  .method { font-family: var(--font-mono); font-size: 10px; font-weight: 700; padding: 3px 7px; border-radius: 5px; flex: none; min-width: 46px; text-align: center; }
  .method.get { background: var(--good-tint); color: var(--good); }
  .method.post { background: var(--accent-tint); color: var(--accent-ink); }
  .epath { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink); }
  .edesc { margin-left: auto; color: var(--ink-mut); font-size: 12px; text-align: right; }
  .toolrow { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--hair); }
  .toolrow:last-child { border-bottom: 0; }
  .toolrow code { font-family: var(--font-mono); font-size: 12px; color: var(--accent-ink); background: var(--accent-tint); padding: 2px 7px; border-radius: 5px; flex: none; }
  .toolrow .td { font-size: 12px; color: var(--ink-mut); padding-top: 2px; }

  /* provenance badge */
  .prov { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 600; padding: 2px 8px 2px 6px; border-radius: 20px; letter-spacing: .01em; white-space: nowrap; vertical-align: middle; }
  .prov svg { width: 11px; height: 11px; flex: none; }
  .prov.ai { background: var(--accent-tint); color: var(--accent-ink); }
  .prov.human { background: color-mix(in srgb, var(--data-blue) 15%, transparent); color: var(--data-blue); }
  .prov.auto { background: var(--good-tint); color: var(--good); }

  /* Lia thinking + reasoning */
  .thinking { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-mut); font-size: 13px; }
  .thinking .spk { width: 15px; height: 15px; color: var(--accent); animation: spkpulse 1.1s ease-in-out infinite; }
  @keyframes spkpulse { 0%,100% { opacity: .4; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.1); } }
  .thinking .dots span { display: inline-block; width: 4px; height: 4px; margin: 0 1px; border-radius: 50%; background: var(--ink-faint); animation: dot 1.2s infinite; }
  .thinking .dots span:nth-child(2) { animation-delay: .18s; }
  .thinking .dots span:nth-child(3) { animation-delay: .36s; }
  @keyframes dot { 0%,60%,100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }
  .art-why { border-top: 1px solid var(--hair); }
  .why-toggle { display: flex; align-items: center; gap: 6px; width: 100%; background: none; border: 0; padding: 9px 12px; font-family: inherit; font-size: 11.5px; font-weight: 550; color: var(--ink-mut); text-align: left; }
  .why-toggle:hover { color: var(--accent-ink); }
  .why-toggle svg { width: 12px; height: 12px; transition: transform .18s ease; }
  .art-why.open .why-toggle svg { transform: rotate(90deg); }
  .why-body { display: none; padding: 0 12px 12px; }
  .art-why.open .why-body { display: block; }
  .why-rat { font-size: 12px; color: var(--ink-2); line-height: 1.5; margin-bottom: 9px; }
  .why-src { display: flex; flex-wrap: wrap; gap: 6px; }
  .why-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; background: var(--surface-2); border: 1px solid var(--hair); color: var(--ink-2); padding: 3px 8px; border-radius: 6px; }
  .why-chip svg { width: 11px; height: 11px; color: var(--ink-mut); }

  /* live pulse on dashboard tiles */
  @keyframes kpipulse { 0% { box-shadow: 0 0 0 2.5px var(--accent-tint); } 100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); } }
  .kpi.live-pulse { animation: kpipulse 1.5s ease; }

  /* agent-first empty state */
  .ai-empty { text-align: center; padding: 40px 24px; }
  .ai-empty .ae-badge { width: 48px; height: 48px; border-radius: 14px; margin: 0 auto 14px; display: grid; place-items: center; background: linear-gradient(150deg, var(--accent), var(--accent-ink)); box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--accent) 60%, transparent); }
  .ai-empty .ae-badge svg { width: 24px; height: 24px; color: #fff; }
  .ai-empty h3 { margin: 0 0 5px; font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
  .ai-empty p { margin: 0 auto 16px; font-size: 13px; color: var(--ink-mut); max-width: 44ch; }
  .ai-empty .ae-actions { display: flex; gap: 9px; justify-content: center; }

  /* overlay/palette/toast */
  .overlay { position: fixed; inset: 0; background: rgba(6,10,22,.5); backdrop-filter: blur(3px); display: none; align-items: flex-start; justify-content: center; padding-top: 12vh; z-index: 50; }
  .overlay.show { display: flex; }
  .palette { width: min(580px,92vw); background: var(--surface); border: 1px solid var(--hair-strong); border-radius: 15px; box-shadow: var(--shadow-lg); overflow: hidden; }
  .palette .p-input { display: flex; align-items: center; gap: 11px; padding: 15px 17px; border-bottom: 1px solid var(--hair); }
  .palette .p-input svg { width: 17px; height: 17px; color: var(--accent); }
  .palette .p-input input { flex: 1; border: 0; outline: none; background: none; font-family: inherit; font-size: 15px; color: var(--ink); }
  .palette .p-list { max-height: 344px; overflow-y: auto; padding: 7px; }
  .p-group-label { font-size: 10px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-faint); font-weight: 700; padding: 10px 10px 5px; }
  .p-item { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; font-size: 13.5px; }
  .p-item .pi-ic { width: 26px; height: 26px; border-radius: 7px; background: var(--accent-tint); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
  .p-item .pi-ic svg { width: 14px; height: 14px; }
  .p-item .pi-sub { color: var(--ink-mut); font-size: 11.5px; }
  .p-item .pi-k { margin-left: auto; }
  .p-item.sel, .p-item:hover { background: var(--accent-tint); }
  .toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%,20px); background: var(--rail); color: #fff; padding: 11px 16px; border-radius: 10px; font-size: 13px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 9px; opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 60; }
  .toast.show { opacity: 1; transform: translate(-50%,0); }
  .toast svg { width: 15px; height: 15px; color: #c79bff; }

  @media (prefers-reduced-motion: reduce) { * { animation-duration: .001ms !important; transition-duration: .001ms !important; } }
  @media (max-width: 1180px) {
    .app { grid-template-columns: 64px minmax(0,1fr) 340px; }
    .brand-name,.ws .ws-name,.ws .ws-role,.ws .chev,.nav-label,.nav-item span:not(.count),.nav-item .count { display: none; }
    .rail { align-items: center; } .nav-item { justify-content: center; }
    .kpis,.stat-row,.dash-hero { grid-template-columns: repeat(2,1fr); }
    .dgrid,.cards,.cards.three,.kg-wrap,.dash-grid,.ep-stats { grid-template-columns: 1fr; }
    .admin { grid-template-columns: 64px minmax(0,1fr); }
  }

  /* =====================================================================================================
     LangTrust Django rebuild — additions (docs/ARCHITECTURE.md §5.5). Everything above this line is
     index.html L8–572 verbatim (the four token blocks untouched). Only the rules the contract lists:
     ===================================================================================================== */
  /* anchor reset — the prototype body has no <a>; the rebuild renders real links for rail items,
     .adm-back, dashboard engine rows, pager buttons and the #assetTabs seg (§5.5, twin of L81 button{…}) */
  a { color: inherit; text-decoration: none; }
  /* modal overlay for forms loaded by lt.js into #modal (§5.5, §6.2) */
  #modal.overlay.show { display: flex; }
  /* horizontal scroll wrapper for wide tables (§5.5; the inline style="overflow-x:auto;" may stay inline) */
  .tbl-wrap { overflow-x: auto; }
  /* .pager anchor twins of the three .pager button rules (L210–212); anchors are flex items here, so the
     inline-flex centring reproduces the button's vertically centred label at height 30px */
  .pager a { min-width: 30px; height: 30px; padding: 0 8px; border-radius: 7px; border: 1px solid var(--hair-strong); background: var(--surface); color: var(--ink-2); font-size: 12.5px; font-family: var(--font-mono); display: inline-flex; align-items: center; justify-content: center; }
  .pager a:hover { border-color: var(--accent); color: var(--accent); }
  .pager a.on { background: var(--accent); border-color: var(--accent); color: #fff; }
  /* .seg anchor twins of .seg button / .seg button.on (L163–164) — used by #assetTabs only */
  .seg a { border: 0; background: none; padding: 5px 11px; border-radius: 6px; font-size: 12.5px; color: var(--ink-mut); font-weight: 500; }
  .seg a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
/* `.badge.admin` (roleMeta, L1411) also matches the full-screen `.admin` page rule (L339: height:100vh;
   overflow:hidden) — latent in the prototype too; neutralise it for the role badge. */
.badge.admin { height: auto; overflow: visible; letter-spacing: inherit; }
/* Phase 4 — Google single sign-on (templates/registration/login.html). The login card is rail-dark, so the
   Google button is a white surface with the four-colour "G" (Google's sign-in branding), full width like the
   primary button below it; the divider carries "or sign in with a password" between hairlines. */
.btn.sso-google { width: 100%; justify-content: center; gap: 10px; padding: 10px 13px; background: #fff; border-color: rgba(255,255,255,.14); color: #1f1f1f; font-weight: 600; }
.btn.sso-google:hover { background: #f2f2f4; border-color: rgba(255,255,255,.3); }
.btn.sso-google svg { width: 18px; height: 18px; flex: none; }
.login-divider { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--rail-ink-dim); white-space: nowrap; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.1); }
/* V2.5 change 7 (L186) — BCP-47 tags are twice as long as the two-letter codes; keep "fr-FR → de-DE" on one line
   in squeezed table cells (`.lang` is the Locales column of #engineTable / #tmTable / #glossaryTable / #benchTable,
   the glossary `Type` chip, and the block-level pair under the engine name in the translations feed). */
.lang { white-space: nowrap; }
