/* BC53 dashboard · liquid glass over a painted artwork (owner pins 20/11/2026: layout kept; colours, background,
   logos and theme toggle from the owner's references; glass transparency 30%, artwork blur 33%). */
:root {
  color-scheme: light;
  --art-blur: 16px; /* owner: artwork blur 33% (16px of a 0-48px scale) */
  --art-filter: blur(var(--art-blur)) saturate(1.05);
  --field: #c8d2e6;
  --glass: rgba(247, 248, 252, .70); /* owner: glass transparency 30% */
  --glass-strong: rgba(250, 251, 254, .93);
  --glass-edge: rgba(255, 255, 255, .72);
  --glass-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 18px 40px -22px rgba(18, 28, 56, .38);
  --side-glass: rgba(44, 64, 114, .70);
  --side-solid: rgba(40, 58, 104, .96);
  --side-ink: #f1f4fb;
  --side-ink-2: rgba(241, 244, 251, .78);
  --side-active: rgba(255, 255, 255, .18);
  --sunk: rgba(27, 40, 72, .05);
  --ink: #1b2848;
  --ink-2: #3a4766;
  --ink-3: #536080;
  --ink-4: #a9b2c7;
  --line: rgba(27, 40, 72, .11);
  --line-2: rgba(27, 40, 72, .2);
  --accent: #24365f;
  --accent-hover: #1a2849;
  --accent-ink: #ffffff;
  --accent-soft: rgba(36, 54, 95, .10);
  --link: #1d6b62;
  --link-hover: #14514a;
  --dot: #ec9469;
  --brand-interaction-ink: var(--s2);
  --kite-chat-ink: #bd6646;
  --kite-hover-border: var(--s2);
  --kite-hover-ink: var(--kite-chat-ink);
  --focus: #24365f;
  --t1: rgba(206, 238, 227, .74); --t2: rgba(250, 221, 204, .74); --t3: rgba(208, 228, 245, .74); --t4: rgba(242, 216, 229, .74);
  --good: #0f6e45;
  --good-soft: rgba(15, 110, 69, .11);
  --warn: #8a5300;
  --warn-soft: rgba(196, 128, 0, .15);
  --bad: #b02a3a;
  --bad-soft: rgba(176, 42, 58, .1);
  --s1: #6fbfae; --s2: #f0a283; --s3: #8aa3da; --s4: #f2c46d; --s5: #ad9be3; /* pastel (owner 20/11): mint, peach, periwinkle, butter, lavender */
  --grid: rgba(27, 40, 72, .08);
  --base: rgba(27, 40, 72, .24);
  --radius: 20px;
  --radius-sm: 12px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  accent-color: var(--accent);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --art-filter: blur(var(--art-blur)) brightness(.48) saturate(.9);
    --field: #121a30;
    --glass: rgba(30, 42, 74, .70); --glass-strong: rgba(27, 37, 64, .95); --glass-edge: rgba(255, 255, 255, .09);
    --glass-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 18px 44px -20px rgba(0, 0, 0, .65);
    --side-glass: rgba(34, 48, 86, .70); --side-solid: rgba(30, 42, 76, .97);
    --side-ink: #eef2fb; --side-ink-2: rgba(238, 242, 251, .74); --side-active: rgba(255, 255, 255, .14);
    --sunk: rgba(255, 255, 255, .05);
    --ink: #eef2fb; --ink-2: #c4cce0; --ink-3: #9ba7c4; --ink-4: #4d5a7a;
    --line: rgba(255, 255, 255, .09); --line-2: rgba(255, 255, 255, .17);
    --accent: #9fd8c9; --accent-hover: #b9e6da; --accent-ink: #13213d; --accent-soft: rgba(159, 216, 201, .15);
    --link: #9fd8c9; --link-hover: #c4ece1; --dot: #f0a07a; --focus: #9fd8c9;
    --kite-chat-ink: var(--accent);
    --brand-interaction-ink: var(--accent);
    --kite-hover-border: var(--accent);
    --kite-hover-ink: var(--accent);
    --t1: rgba(36, 86, 86, .55); --t2: rgba(98, 52, 66, .55); --t3: rgba(44, 68, 112, .55); --t4: rgba(80, 54, 98, .55);
    --good: #5fd39a; --good-soft: rgba(95, 211, 154, .13); --warn: #f0b545; --warn-soft: rgba(240, 181, 69, .14);
    --bad: #f28b97; --bad-soft: rgba(242, 139, 151, .13);
    --s1: #7fcdbb; --s2: #f0a98a; --s3: #99b0e2; --s4: #f2cb7c; --s5: #b9a9ea;
    --grid: rgba(255, 255, 255, .07); --base: rgba(255, 255, 255, .2);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --art-filter: blur(var(--art-blur)) brightness(.48) saturate(.9);
  --field: #121a30;
  --glass: rgba(30, 42, 74, .70); --glass-strong: rgba(27, 37, 64, .95); --glass-edge: rgba(255, 255, 255, .09);
  --glass-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 18px 44px -20px rgba(0, 0, 0, .65);
  --side-glass: rgba(34, 48, 86, .70); --side-solid: rgba(30, 42, 76, .97);
  --side-ink: #eef2fb; --side-ink-2: rgba(238, 242, 251, .74); --side-active: rgba(255, 255, 255, .14);
  --sunk: rgba(255, 255, 255, .05);
  --ink: #eef2fb; --ink-2: #c4cce0; --ink-3: #9ba7c4; --ink-4: #4d5a7a;
  --line: rgba(255, 255, 255, .09); --line-2: rgba(255, 255, 255, .17);
  --accent: #9fd8c9; --accent-hover: #b9e6da; --accent-ink: #13213d; --accent-soft: rgba(159, 216, 201, .15);
  --link: #9fd8c9; --link-hover: #c4ece1; --dot: #f0a07a; --focus: #9fd8c9;
  --kite-chat-ink: var(--accent);
  --brand-interaction-ink: var(--accent);
  --kite-hover-border: var(--accent);
  --kite-hover-ink: var(--accent);
  --t1: rgba(36, 86, 86, .55); --t2: rgba(98, 52, 66, .55); --t3: rgba(44, 68, 112, .55); --t4: rgba(80, 54, 98, .55);
  --good: #5fd39a; --good-soft: rgba(95, 211, 154, .13); --warn: #f0b545; --warn-soft: rgba(240, 181, 69, .14);
  --bad: #f28b97; --bad-soft: rgba(242, 139, 151, .13);
  --s1: #7fcdbb; --s2: #f0a98a; --s3: #99b0e2; --s4: #f2cb7c; --s5: #b9a9ea;
  --grid: rgba(255, 255, 255, .07); --base: rgba(255, 255, 255, .2);
}

* { box-sizing: border-box; }
html { scrollbar-color: var(--line-2) transparent; }
body { margin: 0; min-height: 100dvh; background-color: var(--field); position: relative; }
body::before { content: ""; position: fixed; inset: -48px; z-index: -1; background: url("/art.webp") center / cover no-repeat;
  filter: var(--art-filter); transform: translateZ(0); }
::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--link-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
h1 { font-family: var(--font-display); font-size: 1.75rem; line-height: 1.2; letter-spacing: -.02em; font-weight: 650; text-wrap: balance; }
h2 { font-size: 1.07rem; line-height: 1.35; letter-spacing: -.01em; font-weight: 650; }
h3 { font-size: .95rem; font-weight: 650; }
[hidden] { display: none !important; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 50; padding: 8px 14px; background: var(--glass-strong); border-radius: 10px; }
.skip:focus { top: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.num, .tabular { font-variant-numeric: tabular-nums; }

/* glass */
.glass, .glass-strong {
  background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(22px) saturate(1.4); backdrop-filter: blur(22px) saturate(1.4);
}
.glass-strong { background: var(--glass-strong); }

/* shell */
.shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); gap: 16px; padding: 16px; max-width: 1680px; margin: 0 auto; }
.sidebar { position: sticky; top: 16px; height: calc(100dvh - 32px); border-radius: 24px; padding: 14px 12px 10px; display: flex; flex-direction: column; overflow: auto; }
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 10px; color: var(--ink); text-decoration: none; }
.brand img { border-radius: 12px; object-fit: contain; background: rgba(255,255,255,.7); }
.brand strong { display: block; font-size: 1.05rem; letter-spacing: -.01em; }
.brand small { display: block; color: var(--ink-3); font-size: .75rem; line-height: 1.3; }
.nav-group { font-size: .72rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 10px 12px 4px; }
#nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
#nav a { display: flex; align-items: center; gap: 11px; min-height: 36px; padding: 6px 12px; border-radius: 12px; color: var(--ink-2); text-decoration: none; font-weight: 520; transition: background-color .16s ease, color .16s ease; }
#nav a:hover { background: var(--sunk); color: var(--ink); }
#nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 650; box-shadow: inset 0 0 0 1px var(--glass-edge); }
.side-foot { margin-top: auto; padding-top: 7px; border-top: 1px solid var(--line); }
.sidebar-tip { position: fixed; z-index: 60; transform: translateY(-50%); pointer-events: none; white-space: nowrap; padding: 5px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--glass-strong); color: var(--ink); box-shadow: var(--glass-shadow); font-size: .82rem; }
@media (width > 980px) {
  .shell.collapsed { grid-template-columns: 76px minmax(0, 1fr); }
  .collapsed .brand, .collapsed #nav a, .collapsed .side-foot button { justify-content: center; padding-inline: 0; gap: 0; }
  .collapsed .brand-text, .collapsed .nav-label { inline-size: 0; overflow: hidden; white-space: nowrap; }
  .collapsed .nav-group { clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
  .collapsed #nav a[aria-current="page"]::after { display: none; }
}
@media (max-height: 820px) {
  .nav-group { padding-block: 8px 3px; }
  #nav a { min-height: 32px; padding-block: 5px; }
}
.main-col { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.toolbar { position: sticky; top: 16px; z-index: 5; border-radius: 18px; min-height: 60px; padding: 8px 10px 8px 18px; display: flex; align-items: center; gap: 12px; }
.crumbs { display: flex; gap: 8px; align-items: baseline; color: var(--ink-3); font-size: .9rem; white-space: nowrap; }
.crumbs strong { color: var(--ink); font-weight: 650; }
.search { margin-left: auto; display: flex; align-items: center; gap: 8px; width: min(420px, 40vw); min-height: 40px; padding: 0 12px; border-radius: 12px; background: var(--sunk); border: 1px solid var(--line); color: var(--ink-3); }
.search:focus-within { border-color: var(--accent); background: var(--glass-strong); }
.search input { border: 0; background: transparent; outline: 0; width: 100%; color: var(--ink); }
.search input::placeholder { color: var(--ink-3); }
#menu { display: none; }
main { min-width: 0; outline: 0; display: grid; gap: 16px; }

/* controls */
.button, .ghost { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 7px 14px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--glass-strong); color: var(--ink); cursor: pointer; text-decoration: none; font-weight: 560; white-space: nowrap; transition: background-color .16s ease, border-color .16s ease, color .16s ease; }
.button:hover { border-color: var(--accent); color: var(--accent); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.button.primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
.button.profile-create { --accent: #9fd8c9; --accent-hover: #b9e6da; --accent-ink: #13213d; }
.button.danger { color: var(--bad); }
.button.danger:hover { border-color: var(--bad); background: var(--bad-soft); }
.button:disabled, .button[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.ghost:hover { background: var(--sunk); color: var(--ink); }
.icon-only { width: 40px; padding: 0; }
.icon-text { width: 100%; justify-content: flex-start; }
.linkish { border: 0; background: none; padding: 0; color: var(--link); cursor: pointer; font-size: .85rem; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.linkish:hover { color: var(--link-hover); }
select, input[type="text"], input[type="search"], input[type="email"], input[type="password"] { min-height: 38px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--glass-strong); padding: 6px 10px; color: var(--ink); }
select { padding-right: 28px; }
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 13px; background: var(--sunk); border: 1px solid var(--line); }
.segmented button { border: 0; background: transparent; min-height: 34px; padding: 5px 13px; border-radius: 10px; cursor: pointer; color: var(--ink-2); font-weight: 560; }
.segmented button:hover { color: var(--ink); }
.segmented button[aria-pressed="true"] { background: var(--glass-strong); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08), inset 0 0 0 1px var(--line); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; line-height: 1; padding: 5px 9px; border-radius: 999px; background: var(--sunk); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.chip.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chip.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* page */
.sheet { border-radius: var(--radius); padding: 22px 24px; min-width: 0; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 20px; }
.page-head .lede { color: var(--ink-2); margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.head-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.section-head p, .hint { color: var(--ink-3); font-size: .86rem; }
.muted { color: var(--ink-3); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-2-even { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

/* KPI strip: one sheet, hairline-divided counts (not a grid of cards) */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { padding: 4px 20px; border-left: 1px solid var(--line); min-width: 0; }
.kpi:first-child { border-left: 0; padding-left: 0; }
.kpi-label { color: var(--ink-2); font-size: .88rem; display: flex; gap: 6px; align-items: center; }
.kpi-value { font-family: var(--font-display); font-size: 2.1rem; line-height: 1.15; letter-spacing: -.025em; font-weight: 650; margin: 4px 0 2px; }
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: .82rem; color: var(--ink-3); }
.delta .ic { width: 14px; height: 14px; stroke-width: 2.2; }
.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }
.evidence-btn { border: 0; background: none; padding: 2px; color: var(--ink-3); cursor: pointer; border-radius: 6px; display: inline-grid; }
.evidence-btn:hover { color: var(--accent); }
.evidence-btn .ic { width: 16px; height: 16px; }
.pop { position: absolute; z-index: 20; max-width: 320px; padding: 12px 14px; border-radius: 14px; font-size: .86rem; color: var(--ink-2); }
.pop b { color: var(--ink); display: block; margin-bottom: 4px; }
.pop .linkish { margin-top: 8px; display: inline-block; }

/* findings + top stories */
.findings { list-style: none; margin: 0; padding: 0; display: grid; }
.findings > li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.findings > li:first-child { border-top: 0; padding-top: 2px; }
.finding-mark { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .85rem; }
.findings p { color: var(--ink); line-height: 1.45; }
.findings .meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 5px; font-size: .82rem; color: var(--ink-3); }
.stories { list-style: none; margin: 0; padding: 0; }
.story { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px 12px; align-items: start; padding: 11px 10px; margin: 0 -10px; border-radius: 12px; cursor: pointer; border: 0; background: none; text-align: left; width: calc(100% + 20px); color: inherit; }
.story:hover { background: var(--sunk); }
.story-rank { font-family: var(--font-display); font-weight: 700; color: var(--ink-3); font-size: 1rem; text-align: right; padding-top: 1px; }
.story-title { font-weight: 600; line-height: 1.38; color: var(--ink); }
.story-meta { font-size: .8rem; color: var(--ink-3); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 2px 10px; }
.story-score { font-variant-numeric: tabular-nums; font-size: .82rem; color: var(--ink-2); padding-top: 2px; }
.week-tag { font-size: .78rem; color: var(--ink-3); margin: 12px 0 2px; font-weight: 600; }

/* charts */
.chart-card { min-width: 0; }
.chart-card h2 { margin-bottom: 2px; }
.chart-card > .hint { margin-bottom: 12px; }
.chart .plot { width: 100%; min-height: 40px; touch-action: pan-y; }
.chart svg { display: block; overflow: visible; }
.chart .tick { font-size: 11.5px; fill: var(--ink-3); font-variant-numeric: tabular-nums; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .base { stroke: var(--base); stroke-width: 1; }
.chart .gap { stroke: var(--line-2); stroke-dasharray: 3 4; }
.chart .band { fill: var(--accent-soft); }
.chart .series-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { stroke: var(--glass-strong); stroke-width: 2; }
.chart .cross { stroke: var(--line-2); stroke-width: 1; }
.chart .bar { transition: opacity .15s ease; }
.chart .pick { cursor: pointer; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 10px; font-size: .84rem; color: var(--ink-2); }
.legend-item { display: inline-flex; align-items: center; gap: 7px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.chart-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; margin-top: 10px; font-size: .8rem; color: var(--ink-3); }
.chart-tip { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; min-width: 150px; padding: 9px 11px; border-radius: 11px; background: var(--glass-strong); border: 1px solid var(--line); box-shadow: 0 10px 28px -8px rgba(0,0,0,.25); font-size: .82rem; color: var(--ink-2); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.chart-tip b { display: block; color: var(--ink); margin-bottom: 4px; }
.tip-row { display: flex; align-items: center; gap: 7px; }
.tip-row strong { margin-left: auto; padding-left: 12px; color: var(--ink); font-variant-numeric: tabular-nums; }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.hbar { display: grid; grid-template-columns: minmax(84px, 9.5rem) minmax(0, 1fr) 3rem; align-items: center; gap: 10px; width: 100%; padding: 5px 6px; margin: 0 -6px; border: 0; background: none; border-radius: 9px; text-align: left; color: inherit; font-size: .87rem; }
button.hbar { cursor: pointer; }
button.hbar:hover { background: var(--sunk); }
.hbar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.hbar-track { height: 10px; border-radius: 5px; background: var(--sunk); overflow: hidden; }
.hbar-fill { display: block; height: 100%; width: var(--w); border-radius: 5px; min-width: 2px; }
.hbar-value { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut-track { stroke: var(--sunk); }
.donut-seg { transition: opacity .15s ease; }
.donut-seg.pick { cursor: pointer; }
.donut-total { font-family: var(--font-display); font-size: 26px; font-weight: 700; fill: var(--ink); }
.donut-sub { font-size: 12px; fill: var(--ink-3); }
.donut-keys { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; flex: 1; min-width: 170px; }
.donut-key { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 3rem; gap: 9px; align-items: center; width: 100%; padding: 5px 6px; border: 0; background: none; border-radius: 9px; font-size: .87rem; color: var(--ink-2); text-align: left; }
button.donut-key { cursor: pointer; }
button.donut-key:hover { background: var(--sunk); }
.donut-key strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.k-pct { color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }
.hbar.dot-plot-row { grid-template-columns: 5.25rem minmax(0, 1fr) 3.1rem 2.4rem; gap: 8px; min-height: 44px; margin: 0; padding-inline: 6px; }
.dot-plot-row[aria-pressed="true"] { background: var(--accent-soft); }
.dot-plot-track { position: relative; height: 1px; margin-inline: 4px; background: var(--base); }
.dot-plot-point { position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%; transform: translate(-50%, -50%); }
.hbar.dot-plot-axis { min-height: 0; padding-block: 2px; color: var(--ink-3); font-size: .75rem; }
.dot-plot-ticks { grid-column: 2; position: relative; display: flex; justify-content: space-between; margin-inline: 4px; font-variant-numeric: tabular-nums; }
.dot-plot-ticks > :nth-child(2) { position: absolute; left: 50%; transform: translateX(-50%); }
.chart-foot.dot-plot-foot { justify-content: flex-start; }

/* tables */
.table-scroll { overflow: auto; border-radius: 12px; }
table.data { width: 100%; border-collapse: collapse; font-size: .87rem; }
table.data th, table.data td { padding: 10px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data thead th { position: sticky; top: 0; background: var(--glass-strong); color: var(--ink-3); font-weight: 600; font-size: .8rem; z-index: 1; white-space: nowrap; }
table.data tbody th { font-weight: 560; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data tbody tr.rowlink { cursor: pointer; }
table.data tbody tr.rowlink:hover { background: var(--sunk); }
.cell-title { font-weight: 600; color: var(--ink); line-height: 1.38; }
.cell-sub { color: var(--ink-3); font-size: .82rem; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 72ch; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filters .search { margin: 0; width: auto; flex: 1 1 240px; background: var(--glass-strong); }
.article-filters { flex-wrap: nowrap; overflow-x: auto; max-inline-size: 100%; padding: 4px; }
.article-filters .search { min-inline-size: 10rem; }
.article-filters > select { min-inline-size: 7rem; max-inline-size: 13rem; }
.article-filters > .article-week-filter { flex: none; inline-size: 13rem; }
.article-filters > .chip { flex: none; white-space: nowrap; }
@media (max-width: 640px) {
  .article-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }
  .article-filters .search, .article-filters > .article-week-filter { grid-column: 1 / -1; }
  .article-filters > select { inline-size: 100%; min-inline-size: 0; max-inline-size: none; }
  .article-filters > .chip { grid-column: 1 / -1; justify-self: start; white-space: normal; }
}
.result-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 4px 0 8px; color: var(--ink-3); font-size: .85rem; }
.pager { display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 12px; font-size: .85rem; color: var(--ink-3); }
.active-filter { display: inline-flex; align-items: center; gap: 6px; }

/* tabs */
.tabs { display: flex; gap: 2px; box-shadow: inset 0 -1px 0 var(--line); margin: 18px 0 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: 10px 14px; cursor: pointer; color: var(--ink-3); font-weight: 560; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }

/* meta list */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 22px; margin-top: 16px; }
.facts div { min-width: 0; }
.facts dt { font-size: .78rem; color: var(--ink-3); }
.facts dd { margin: 2px 0 0; font-weight: 560; overflow-wrap: anywhere; }
.facts.report-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); text-align: center; }
.report-facts > div { display: flex; flex-direction: column; justify-content: space-between; }

/* drawer */
.scrim { position: fixed; inset: 0; z-index: 30; background: rgba(8, 20, 16, .28); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.drawer { position: fixed; z-index: 31; top: 12px; right: 12px; bottom: 12px; width: min(560px, calc(100vw - 24px)); border-radius: 22px; display: flex; flex-direction: column; overflow: hidden; animation: slide-in .22s cubic-bezier(.2, .8, .2, 1); }
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 18px 12px 22px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 1.12rem; line-height: 1.35; }
.drawer-body { overflow: auto; padding: 16px 22px 26px; display: grid; gap: 18px; align-content: start; }
.drawer-body h3 { margin-bottom: 6px; }
.drawer-body p { line-height: 1.55; }
.kv { display: grid; grid-template-columns: minmax(130px, auto) minmax(0, 1fr); gap: 7px 14px; font-size: .88rem; margin: 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.meter { display: grid; grid-template-columns: minmax(0, 1fr) 3rem; gap: 10px; align-items: center; }
.meter span { height: 8px; border-radius: 4px; background: var(--sunk); overflow: hidden; }
.meter i { display: block; height: 100%; width: var(--w); background: var(--accent); border-radius: 4px; }
.meter b { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.links { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: .87rem; }
.links a { overflow-wrap: anywhere; display: inline-flex; gap: 6px; align-items: flex-start; }
.links .ic { width: 15px; height: 15px; margin-top: 3px; }
.quote { padding: 12px 14px; border-radius: 12px; background: var(--sunk); color: var(--ink-2); font-size: .9rem; white-space: pre-wrap; }
.report-email [hidden] { display: none; }
.report-email-body { margin-top: 12px; font-family: inherit; overflow-wrap: anywhere; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.checks li { padding: 8px 11px; border-radius: 10px; background: var(--warn-soft); color: var(--ink); font-size: .86rem; }

/* dialog */
dialog { border: 1px solid var(--glass-edge); border-radius: 22px; padding: 22px; width: min(540px, calc(100vw - 32px)); color: var(--ink); }
dialog::backdrop { background: rgba(8, 20, 16, .35); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
#confirm-body { margin: 12px 0 18px; display: grid; gap: 12px; color: var(--ink-2); }
#confirm-body ul { margin: 0; padding-left: 20px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* forms, runs */
.run-form { display: grid; gap: 16px; }
.choice-list { display: grid; gap: 8px; }
.choice { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; align-items: start; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--glass-strong); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.choice input { margin: 3px 0 0; width: 16px; height: 16px; }
.choice b { display: block; }
.choice span { color: var(--ink-3); font-size: .86rem; }
.field { display: grid; gap: 6px; font-size: .88rem; color: var(--ink-2); max-width: 340px; }
.logbox { margin: 0; padding: 14px; border-radius: 14px; background: #0f1a17; color: #d5e4de; font: 12.5px/1.55 ui-monospace, "Cascadia Mono", Consolas, monospace; max-height: 340px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.status-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 12px; }
.error { color: var(--bad); font-size: .88rem; }
.empty { padding: 26px; text-align: center; color: var(--ink-3); border: 1px dashed var(--line-2); border-radius: 14px; }
.empty b { display: block; color: var(--ink-2); margin-bottom: 4px; }
.skeleton { border-radius: var(--radius); min-height: 140px; background: linear-gradient(100deg, var(--glass) 30%, var(--glass-strong) 50%, var(--glass) 70%) 0 0 / 300% 100%; animation: shimmer 1.4s ease-in-out infinite; border: 1px solid var(--glass-edge); }
@keyframes shimmer { to { background-position: -150% 0; } }
.toggle { position: relative; width: 40px; height: 24px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--sunk); cursor: pointer; padding: 0; transition: background-color .16s ease; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--glass-strong); box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s cubic-bezier(.2,.8,.2,1); }
.toggle[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.toggle[aria-checked="true"]::after { transform: translateX(16px); }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.recipient-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0 8px; }
.import-notice { overflow-wrap: anywhere; }
.import-notice:empty { display: none; }
.block-forms { display: grid; gap: 18px; }
.block-forms .hint { margin: 4px 0 8px; }
.block-input { width: 23rem; max-width: 100%; }
.block-forms ~ [role="status"]:empty { display: none; }
.block-list th[scope="row"] { white-space: normal; overflow-wrap: anywhere; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; }
.timeline li { display: grid; grid-template-columns: 112px 18px minmax(0, 1fr); gap: 12px; align-items: start; padding-bottom: 16px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 132px; top: 18px; bottom: -2px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline time { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: .86rem; text-align: right; padding-top: 1px; }
.timeline .node { width: 12px; height: 12px; margin: 4px 0 0 3px; border-radius: 50%; background: var(--glass-strong); border: 2px solid var(--accent); }
.timeline .node.once { border-color: var(--s3); }

@media (max-width: 1180px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 980px) {
  .shell { grid-template-columns: minmax(0, 1fr); padding: 10px; gap: 10px; }
  .sidebar { position: fixed; z-index: 40; left: 10px; top: 10px; bottom: 10px; height: auto; width: 264px; transform: translateX(-110%); transition: transform .22s cubic-bezier(.2,.8,.2,1); background: var(--glass-strong); }
  .shell.nav-open .sidebar { transform: none; }
  .side-foot { display: none; }
  #menu { display: inline-flex; }
  .toolbar { top: 10px; padding-left: 8px; }
  .grid-2, .grid-2-even { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 16px; }
  .kpi:nth-child(3) { border-left: 0; padding-left: 0; }
}
@media (max-width: 640px) {
  .crumbs { display: none; }
  .search { width: auto; flex: 1; margin-left: 0; }
  .sheet { padding: 16px; }
  h1 { font-size: 1.45rem; }
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .kpi { padding: 2px 12px; }
  .kpi-value { font-size: 1.7rem; }
  .hbar { grid-template-columns: minmax(70px, 7rem) minmax(0, 1fr) 2.6rem; }
  .timeline li { grid-template-columns: 84px 18px minmax(0, 1fr); }
  .timeline li::before { left: 104px; }
  .page-head { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (forced-colors: active) {
  .glass, .glass-strong { border: 1px solid CanvasText; }
  .hbar-fill, .sw, .meter i { forced-color-adjust: none; }
}
@media (max-width: 640px) {
  .head-tools { width: 100%; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; padding: 6px 4px; font-size: .84rem; line-height: 1.25; }
  .section-head { flex-direction: column; gap: 2px; }
  .kpi-label { align-items: flex-start; }
}
.search input[type="search"] { border: 0; background: transparent; min-height: 36px; padding: 0; border-radius: 0; box-shadow: none; }
.search input[type="search"]:focus-visible { outline: 0; }
@media (max-width: 640px) {
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- theme layer (20/11/2026): navy glass sidebar, tinted counts, artwork toggle, logo per mode ---- */
.sidebar { background: var(--side-glass); color: var(--side-ink); border-color: rgba(255, 255, 255, .2); }
.brand { color: var(--side-ink); }
.brand:is(:hover, :focus-visible, :active) strong { color: var(--brand-interaction-ink); }
.brand small { color: var(--side-ink-2); }
.brand img { background: none; border-radius: 0; }
.logo-dark { display: none; }
.nav-group { color: var(--side-ink-2); }
#nav a { color: var(--side-ink-2); }
#nav a:hover { background: rgba(255, 255, 255, .1); color: var(--side-ink); }
#nav a[aria-current="page"] { background: var(--side-active); color: var(--side-ink); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); }
#nav a[aria-current="page"]::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--dot); margin-left: auto; flex: none; }
.side-foot { border-top-color: rgba(255, 255, 255, .16); }
.side-foot .ghost { color: var(--side-ink-2); }
.side-foot .ghost:hover { background: rgba(255, 255, 255, .1); color: var(--side-ink); }
h1::after { content: "."; color: var(--dot); }
.kpis { gap: 12px; }
.kpi, .kpi:first-child { border-left: 0; padding: 16px 18px; border-radius: 16px; background: var(--t1); border: 1px solid var(--glass-edge); }
.kpi:nth-child(2) { background: var(--t2); }
.kpi:nth-child(3) { background: var(--t3); }
.kpi:nth-child(4) { background: var(--t4); }
#theme { width: 68px; height: 28px; min-height: 28px; padding: 0; border-radius: 999px; overflow: hidden; border: 1px solid var(--glass-edge); background: none; margin-right: 4px; }
#theme img { display: block; width: 100%; height: 100%; object-fit: cover; }
#theme:hover { box-shadow: 0 0 0 3px var(--accent-soft); }
.button.primary { box-shadow: 0 8px 18px -10px rgba(18, 28, 56, .55); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: block; }
}
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
@media (max-width: 980px) {
  .sidebar { background: var(--side-solid); }
  .kpi:nth-child(3) { padding: 16px 18px; }
}
@media (max-width: 640px) {
  .kpi, .kpi:first-child, .kpi:nth-child(3) { padding: 12px 14px; }
  .kpis { gap: 8px; }
}

/* page changes: old page stays until the new one is ready; a short fade marks the swap */
main { transition: opacity .15s ease; }
main.busy { opacity: .55; pointer-events: none; }
@keyframes page-in { from { opacity: 0; transform: translateY(4px); } }

/* bottleneck strip */
.bottleneck { padding: 12px 18px; }
.bottleneck summary { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; min-height: 28px; }
.bottleneck summary::-webkit-details-marker { display: none; }
.bottleneck:not(details) { display: flex; align-items: center; gap: 12px; }
.bn-where { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bn-more { color: var(--link); font-size: .86rem; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.bn-more::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: translateY(-3px) rotate(45deg); transition: transform .16s ease; }
details[open] .bn-more::after { transform: translateY(0) rotate(-135deg); }
.bn-body { padding: 10px 0 2px; display: grid; gap: 6px; max-width: 90ch; }

/* evidence target: brief highlight after "Xem bằng chứng" */
.flash { animation: flash 1.4s ease-out; }
@keyframes flash { 0%, 30% { box-shadow: var(--glass-shadow), 0 0 0 3px var(--dot); } 100% { box-shadow: var(--glass-shadow), 0 0 0 0 transparent; } }
[data-evidence] { scroll-margin-top: 92px; }

.cost-accounts { display: grid; gap: 12px; }
.cost-account { padding: 14px 16px; border-radius: 16px; background: var(--t3); border: 1px solid var(--glass-edge); display: grid; gap: 6px; }
.cost-account:nth-child(2) { background: var(--t4); }
.filters .segmented { flex: none; }

/* trend chart options */
.chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 10px 16px; margin-bottom: 10px; }
.chart-head .hint { max-width: 70ch; margin-top: 2px; }
.chart-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.seg-sm button { min-height: 30px; padding: 4px 11px; font-size: .84rem; }
.series-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.series-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--ink-3); font-size: .84rem; cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.series-chip:hover { color: var(--ink); }
.series-chip[aria-pressed="true"] { background: var(--glass-strong); color: var(--ink); border-color: var(--glass-edge); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.series-chip[aria-pressed="false"] .sw { opacity: .35; }
.trend-card .legend { display: none; }

/* trending */
.profile-sec { margin-top: 16px; }
.profile-sec h3 { margin-bottom: 6px; }
.profile-points { margin: 0; padding-left: 20px; display: grid; gap: 6px; max-width: 90ch; line-height: 1.55; }
.profile-table { table-layout: fixed; }
.profile-table th:first-child { width: 33%; }
.profile-table th:last-child { width: 21%; }
table.profile-table :is(th, td) { white-space: normal; overflow-wrap: anywhere; vertical-align: top; }
table.profile-table thead th { white-space: normal; }
.profile-date-label { display: none; }
.profile-entry-history { margin-top: 8px; }
.profile-entry-status { display: block; margin-bottom: 3px; color: var(--ink-2); font-weight: 650; }
.profile-review-list { margin: 8px 0 0; padding: 0; list-style: none; }
.profile-review-list > li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.profile-review-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 8px; margin-top: 8px; }
.profile-review-form label { display: grid; gap: 3px; min-width: 0; }
.profile-review-form :is(input, select) { width: 100%; }
.profile-review [hidden] { display: none; }
.profile-review-actions { display: flex; gap: 8px; flex-wrap: wrap; grid-column: 1 / -1; }
.profile-review-form .error { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .profile-table, .profile-table tbody, .profile-table tbody :is(tr, th, td) { display: block; }
  .profile-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table.profile-table tbody th { width: auto; padding: 9px 0 2px; border-bottom: 0; font-weight: 650; }
  table.profile-table tbody td { padding: 0 0 9px; }
  .profile-date-label { display: inline; }
}
.profile-disclosure > summary { cursor: pointer; font-weight: 650; }
.profile-disclosure[open] > summary { margin-bottom: 8px; }
.profile-sec .cite, .profile-points .cite { min-width: 24px; min-height: 24px; }
.cite { border: 0; background: var(--accent-soft); color: var(--link); border-radius: 6px; padding: 0 5px; margin-left: 2px; font-size: .78rem; font-weight: 650; cursor: pointer; vertical-align: 1px; }
.cite:hover { background: var(--link); color: var(--glass-strong); }
.profile-refs { margin: 6px 0 0; padding-left: 22px; display: grid; gap: 4px; font-size: .86rem; }
.profile-refs .linkish { text-align: left; font-size: .86rem; }
table.data tbody tr[aria-current="true"] { background: var(--accent-soft); }

.findings .stories { margin: 6px 0 2px; }
.findings .story { padding: 7px 10px; }

/* pipeline */
.flow { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.flow-step { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 4px 10px; align-items: center; padding: 10px 12px; border-radius: 14px;
  background: var(--sunk); border: 1px solid var(--line); color: var(--ink); text-decoration: none; height: 100%; }
.flow-step:hover { border-color: var(--line-2); background: var(--glass-strong); color: var(--ink); }
.flow-no, .stage-no { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .85rem; }
.stage-no { margin-right: 10px; vertical-align: 1px; }
.flow-name { font-weight: 600; line-height: 1.3; }
.flow-time { display: block; margin-top: 3px; color: var(--ink-2); font-size: .8rem; line-height: 1.35; }
.flow-note { margin: 8px 0 0; }
.stage { scroll-margin-top: 92px; }
.stage .section-head { align-items: center; }
.stage-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px 28px; }
.stage-method { line-height: 1.6; max-width: 70ch; }
.stage-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 6px; }
.stage-results div { padding: 10px 12px; border-radius: 12px; background: var(--sunk); }
.stage-results dt { font-size: .78rem; color: var(--ink-3); }
.stage-results dd { margin: 2px 0 0; font-size: 1.15rem; font-weight: 650; }
table.data tr.is-current { background: var(--accent-soft); }
@media (max-width: 1180px) { .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 980px) { .stage-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .flow { grid-template-columns: minmax(0, 1fr); } }

.sum-rows { display: grid; gap: 10px; margin: 0 0 10px; }
.sum-rows div { padding: 10px 12px; border-radius: 12px; background: var(--sunk); }
.sum-rows dt { font-size: .8rem; color: var(--ink-3); }
.sum-rows dd { margin: 2px 0; font-weight: 650; font-size: 1.05rem; }
.sum-rows small { display: block; color: var(--ink-3); font-size: .76rem; line-height: 1.4; }

/* ---------- Kite (chatbot, 26/11/2026) ---------- */
.kite-log { display: flex; flex-direction: column; gap: 14px; max-height: 62vh; overflow-y: auto; padding: 2px 2px 8px; }
.kite-msg { border-radius: 14px; padding: 12px 14px; max-width: 100%; }
.kite-msg.user { align-self: flex-end; background: var(--accent-soft); max-width: min(680px, 92%); }
.kite-msg.user p { margin: 0; }
.kite-msg.bot { align-self: stretch; background: var(--sunk); border: 1px solid var(--line); }
.kite-who { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; color: var(--kite-chat-ink); }
.kite-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.kite-chips .chip { white-space: normal; }
.kite-summary { margin: 6px 0; }
.kite-notice { margin: 6px 0; padding: 8px 10px; border-radius: 10px; background: var(--glass-strong); border: 1px solid var(--line); }
.kite-notice.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.kite-quotes blockquote { margin: 6px 0; padding: 6px 10px; border-left: 3px solid var(--accent); }
.kite-quotes .kite-orig { margin: 0 0 2px; }
.kite-quotes h3, .kite-refs summary, .kite-dropped summary { font-size: .86rem; }
.kite-refs, .kite-dropped { margin-top: 8px; }
.kite-refs summary, .kite-dropped summary { cursor: pointer; color: var(--ink-2); }
.kite-table { margin: 6px 0; max-width: 420px; }
table.kite-table thead th { position: static; }
.kite-meta { margin: 8px 0 0; color: var(--ink-3); font-size: .78rem; }
.kite-suggest { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 8px; }
.kite-suggest .chip { cursor: pointer; white-space: normal; text-align: left; }
.kite-form { display: flex; gap: 8px; align-items: flex-end; }
.kite-form textarea { flex: 1; resize: vertical; min-height: 44px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--glass-strong); }
.kite-context { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
@media (max-width: 640px) { .kite-form { flex-direction: column; align-items: stretch; } .kite-log { max-height: none; } }

/* ---------- 12-column bento layout (26/11/2026): denser grid, columns line up row to row ---------- */
main { gap: 14px; }
.main-col { gap: 14px; }
.shell { gap: 14px; }
.sheet { padding: 18px 20px; }
.section-head { margin-bottom: 10px; }
.chart-card > .hint { margin-bottom: 8px; }
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.bento > * { min-width: 0; display: flex; flex-direction: column; }
.bento > * > .chart-card { flex: 1; display: flex; flex-direction: column; }
@media (width > 980px) {
  /* Let Top 5 set the shared row height, then fit the chart into it. */
  .bento > .fit-week-trend { contain: size; min-height: 300px; }
  .bento > .fit-week-trend + .span-4 { align-self: start; }
  .fit-week-trend .trend-card,
  .fit-week-trend .trend-card > .chart,
  .fit-week-trend .chart .plot { flex: 1 1 0; min-height: 0; }
  .fit-week-trend .trend-card > .chart { display: flex; flex-direction: column; }
}
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: 1 / -1; }
/* page bar: title + period control on one compact row */
.page-bar { padding: 14px 20px; }
.page-bar .page-head { align-items: center; }
.page-bar h1 { font-size: 1.45rem; }
.page-bar .lede { margin-top: 2px; font-size: .9rem; }
/* KPI rows */
.kpi-row { gap: 14px; }
.overview-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpi-row .kpi { border-radius: var(--radius); padding: 14px 18px; display: flex; flex-direction: column; gap: 2px; }
.kpi-row .kpi-value { font-size: 1.9rem; margin: 2px 0 0; }
/* donuts sit side by side with their keys inside a third-width card */
.bento .donut-wrap { gap: 14px; flex-wrap: nowrap; }
.bento .donut-keys { min-width: 0; }
.bento .donut-wrap svg { flex: none; }
.bento .findings > li { padding: 10px 0; }
@media (max-width: 1280px) {
  .bento > .span-3, .bento > .span-4 { grid-column: span 6; }
  .bento > .span-7, .bento > .span-8 { grid-column: span 7; }
  .bento > .span-8 + .span-4 { grid-column: span 5; }
  .bento > .span-4 + .span-4 + .span-4:not(:has(+ .span-4)) { grid-column: 1 / -1; }
  .bento > .span-6:has(+ .span-3) { grid-column: 1 / -1; }
}
@media (max-width: 980px) {
  .bento > * { grid-column: 1 / -1 !important; }
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .page-bar { padding: 14px 16px; }
  .bento .donut-wrap { flex-wrap: wrap; }
  .kpi-row { gap: 8px; }
}
.bento .donut-wrap svg { width: 124px; height: 124px; }
.bento .donut-key { grid-template-columns: 10px minmax(0, 1fr) auto 2.6rem; gap: 7px; padding: 4px 4px; line-height: 1.3; }
.bento .donut-keys { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.bento > .stack { align-self: start; }
.stack > * { flex: none; }
/* older two/three-column helpers sit on the same 12-column track */
.grid-2, .grid-3, .grid-2-even { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.grid-2 > :nth-child(odd) { grid-column: span 7; } .grid-2 > :nth-child(even) { grid-column: span 5; }
.grid-2-even > * { grid-column: span 6; }
.grid-3 > * { grid-column: span 4; }
.grid-3 .donut-wrap, .stack .donut-wrap { gap: 14px; flex-wrap: nowrap; }
.grid-3 .donut-wrap svg, .stack .donut-wrap svg { width: 124px; height: 124px; flex: none; }
.grid-3 .donut-keys, .stack .donut-keys { min-width: 0; flex: 1; }
.grid-3 .donut-key, .stack .donut-key { grid-template-columns: 10px minmax(0, 1fr) auto 2.6rem; gap: 7px; padding: 4px; line-height: 1.3; }
@media (max-width: 1180px) {
  .grid-3 > * { grid-column: span 6; }
  .grid-3 > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 980px) {
  .grid-2 > *, .grid-2-even > *, .grid-3 > * { grid-column: 1 / -1 !important; }
}
@media (max-width: 640px) {
  .grid-3 .donut-wrap, .stack .donut-wrap { flex-wrap: wrap; }
}

.country-detail .stack .donut-wrap { gap: 10px; }
.country-detail .stack .donut-wrap svg { width: clamp(86px, 7.5vw, 112px); height: auto; }
.country-detail .stack .donut-key { grid-template-columns: 10px minmax(0, 1fr) auto 2rem; gap: 5px; }
.country-detail .stack .chart-foot { margin-top: 0; }
/* narrow list cards: two-line titles keep rows even; the drawer shows the full title */
.bento .span-4 .story-title, .bento .span-5 .story-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- 26/11/2026: data-source captions hidden (owner); table view link stays ---------- */
.source { display: none !important; }
.chart-foot { justify-content: flex-end; }

/* ---------- notification bell: page bottlenecks (replaces the strip under the page head) ---------- */
.notify { position: relative; display: flex; }
#notify-btn { position: relative; }
.notify-badge { position: absolute; top: 3px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px;
  display: grid; place-items: center; font-size: .68rem; font-weight: 700; line-height: 1; color: #fff; background: var(--bad);
  box-shadow: 0 0 0 2px var(--glass-strong); font-variant-numeric: tabular-nums; }
.notify-badge.warn { background: var(--warn); }
.notify-panel, .notify-detail { position: absolute; right: 0; top: calc(100% + 10px); z-index: 25; width: min(360px, calc(100vw - 24px));
  border-radius: 16px; padding: 10px; animation: page-in .16s cubic-bezier(.2, .8, .2, 1); }
.notify-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 4px 8px 8px; font-size: .9rem; }
.notify-head .muted { font-size: .8rem; }
.notify-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 60vh; overflow: auto; }
.notify-item { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 10px; align-items: start; width: 100%; padding: 9px 8px;
  border: 0; border-radius: 10px; background: none; color: inherit; text-align: left; cursor: pointer; }
.notify-item:hover, .notify-item:focus-visible { background: var(--sunk); }
.notify-dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--bad); }
.notify-dot.warn { background: var(--warn); }
.notify-dot.good { background: var(--good); }
.notify-title { display: block; font-weight: 600; line-height: 1.35; color: var(--ink); }
.notify-sub { display: block; font-size: .78rem; color: var(--ink-3); }
.notify-empty { padding: 8px; font-size: .86rem; color: var(--ink-3); display: flex; gap: 8px; align-items: center; }
.notify-detail { padding: 14px 16px 16px; display: grid; gap: 8px; }
.notify-detail-head { display: flex; justify-content: space-between; align-items: center; margin: -4px -6px 0 0; }
.notify-detail h2 { font-size: 1rem; line-height: 1.35; }
#notify-detail-body { display: grid; gap: 8px; font-size: .88rem; line-height: 1.55; color: var(--ink-2); }
#notify-detail-body b { color: var(--ink); }

/* ---------- shares: two breakdowns of the same total in one card ---------- */
.shares { display: grid; gap: 18px; }
.share-group { display: grid; gap: 8px; }
.share-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.share-label { font-size: .9rem; }
.share-total { font-size: .8rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.share-bar { display: flex; gap: 2px; height: 14px; }
.share-seg { flex-basis: 0; min-width: 3px; height: 100%; }
.share-seg:first-child { border-radius: 4px 0 0 4px; }
.share-seg:last-child { border-radius: 0 4px 4px 0; }
.share-seg:only-child { border-radius: 4px; }
.share-seg.pick { border: 0; padding: 0; cursor: pointer; }
.share-seg.pick:focus-visible { outline-offset: -2px; }
.share-seg:hover { filter: brightness(1.08); }
.share-keys { gap: 0; }
.share-keys .donut-key { grid-template-columns: 10px minmax(0, 1fr) auto 2.6rem; gap: 7px; padding: 3px 4px; line-height: 1.3; }
.share-note { font-size: .8rem; color: var(--ink-3); }
@media (max-width: 640px) {
  .notify-panel, .notify-detail { position: fixed; left: 12px; right: 12px; top: 72px; width: auto; }
}

/* ---------- Kite: History panel beside the chat (26/11/2026) ---------- */
.kite-layout { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: 14px; align-items: start; }
.kite-history { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100dvh - 108px); }
.kite-hist-head { margin-bottom: 0; align-items: center; }
.kite-new { width: 100%; }
.kite-new span { font-size: 1.1rem; line-height: 1; }
.kite-hist-list { list-style: none; margin: 0 -6px; padding: 0; display: grid; gap: 2px; overflow-y: auto; min-height: 0; }
.kite-hist-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; border-radius: 10px; }
.kite-hist-item:hover { background: var(--sunk); }
.kite-hist-item[aria-current="true"] { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.kite-hist-open { border: 0; background: none; color: inherit; text-align: left; padding: 8px 6px 8px 10px; cursor: pointer; min-width: 0; border-radius: 10px; }
.kite-hist-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .88rem; font-weight: 560; line-height: 1.35; color: var(--ink); }
.kite-hist-meta { display: block; font-size: .76rem; color: var(--ink-3); margin-top: 2px; }
.kite-hist-del { width: 32px; min-height: 32px; margin-right: 4px; opacity: .55; }
.kite-hist-del .ic { width: 16px; height: 16px; }
.kite-hist-item:hover .kite-hist-del, .kite-hist-del:focus-visible { opacity: 1; }
.kite-hist-del:hover { color: var(--bad); background: var(--bad-soft); }
.kite-hist-empty { padding: 8px 10px; font-size: .84rem; color: var(--ink-3); }
.danger-link { color: var(--bad); font-size: .82rem; }
.danger-link:hover { color: var(--bad); }
.button.primary.destructive { background: var(--bad); border-color: var(--bad); color: #fff; }
.button.primary.destructive:hover { background: color-mix(in srgb, var(--bad) 85%, #000); color: #fff; }
@media (max-width: 980px) {
  .kite-layout { grid-template-columns: minmax(0, 1fr); }
  .kite-history { position: static; max-height: 320px; }
}
/* Ask Kite shortcut beside the bell */
.ask-kite { min-height: 36px; padding: 6px 12px; gap: 6px; border-radius: 999px; }
.ask-kite:hover { border-color: var(--kite-hover-border); color: var(--kite-hover-ink); }
.ask-kite .ic { width: 18px; height: 18px; }
@media (max-width: 640px) { .ask-kite { width: 40px; padding: 0; } .ask-kite-label { display: none; } }

/* Kite fills the window: History and chat reach the bottom edge; only their insides scroll (owner 26/11) */
@media (min-width: 981px) {
  main:has(> .kite-layout) { height: calc(100dvh - 106px); grid-template-rows: auto minmax(0, 1fr); }
  .kite-layout { height: 100%; min-height: 0; align-items: stretch; }
  .kite-history { position: static; max-height: none; height: 100%; min-height: 0; }
  .kite-layout > .sheet:last-child { display: flex; flex-direction: column; min-height: 0; }
  .kite-layout .kite-log { flex: 1; max-height: none; min-height: 0; }
  .kite-layout .kite-log > .empty { margin: auto 0; }
}

/* ---------- sign-in screen and account menu (26/11/2026) ---------- */
.login-screen { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(400px, 100%); border-radius: 24px; padding: 28px 26px 22px; display: grid; gap: 16px; }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand h1 { font-size: 1.5rem; }
.login-brand h1::after { content: none; }
.login-brand p { color: var(--ink-3); font-size: .9rem; }
.login-form { display: grid; gap: 12px; }
.login-form label { display: grid; gap: 6px; font-size: .86rem; color: var(--ink-2); }
.login-form input { min-height: 42px; }
.login-form .error:empty { display: none; }
.login-form .button { min-height: 42px; }
.login-or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: .8rem; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.login-google { min-height: 42px; width: 100%; gap: 10px; }
.login-note { text-align: center; font-size: .8rem; }
.account { position: relative; display: flex; }
.avatar-btn { border: 0; padding: 0; background: none; border-radius: 50%; cursor: pointer; }
.avatar-btn:hover .avatar { box-shadow: 0 0 0 3px var(--accent-soft); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; flex: none;
  background: var(--s3); color: #13213d; font-weight: 700; font-size: .82rem; letter-spacing: .02em; border: 1px solid var(--glass-edge); }
.avatar.admin { background: var(--s2); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 44px; height: 44px; font-size: .95rem; }
.account-menu { position: absolute; right: 0; top: calc(100% + 10px); z-index: 25; width: 260px; border-radius: 16px; padding: 14px;
  display: grid; gap: 12px; animation: page-in .16s cubic-bezier(.2, .8, .2, 1); }
.account-who { display: flex; gap: 12px; align-items: center; min-width: 0; }
.account-who > div { min-width: 0; display: grid; gap: 2px; justify-items: start; }
.account-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
#account-mail { font-size: .8rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.account-who .chip { margin-top: 4px; }
.account-out { width: 100%; }
.account-out:hover { border-color: var(--bad); color: var(--bad); }
.weekday-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.weekday-pick label { position: relative; }
.weekday-pick input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.weekday-pick span { display: inline-grid; place-items: center; min-width: 40px; min-height: 34px; padding: 0 8px; border-radius: 10px; border: 1px solid var(--line-2); font-weight: 600; font-size: .85rem; }
.weekday-pick input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.weekday-pick input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
#confirm-body .field { max-width: none; }
#confirm-body input[type="time"], #confirm-body input[type="date"] { min-height: 38px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--glass-strong); padding: 6px 10px; color: var(--ink); }
#confirm-body .error:empty { display: none; }
@media (max-width: 640px) { .account-menu { position: fixed; left: 12px; right: 12px; top: 72px; width: auto; } }
.nowrap { white-space: nowrap; }
/* avatar wears the same surface as the Ask Kite button (owner 26/11) */
.avatar, .avatar.admin { background: var(--glass-strong); color: var(--ink); border: 1px solid var(--line-2); }
.chart .end-label { font-size: 12px; font-weight: 650; fill: var(--ink); font-variant-numeric: tabular-nums; }
.chart .band { fill: var(--accent-soft); opacity: .7; }
/* Manual runs: period picker (26/11/2026) */
.range-inputs { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.range-inputs label { display: inline-flex; gap: 8px; align-items: center; color: var(--ink-2); font-size: .88rem; }
.run-form input[type="date"] { min-height: 38px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--glass-strong); padding: 6px 10px; color: var(--ink); }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; color: var(--ink-2); cursor: pointer; }
.check-row input { margin-top: 3px; width: 16px; height: 16px; }
.run-form .field { max-width: none; }

/* Lịch theo dõi */
.digest-table td { vertical-align: top; }
.digest-table .cell-sub { max-width: 55ch; }
.digest-name { text-align: left; font-weight: 650; }
.digest-form { display: grid; gap: 14px; margin-top: 12px; }
.digest-field { display: grid; gap: 5px; min-width: 0; font-size: .88rem; }
.digest-field > input, .digest-field > select { width: 100%; min-width: 0; }
.digest-field > input[type="number"] { min-height: 38px; border-radius: 11px; border: 1px solid var(--line-2);
  background: var(--glass-strong); padding: 6px 10px; }
.digest-timing { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 10px; }
.digest-filters { min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px 12px; }
.digest-filters legend { font-weight: 650; padding: 0 4px; }
.digest-filters .digest-field { margin-top: 10px; }
.digest-options { border-bottom: 1px solid var(--line); padding: 7px 0; }
.digest-options summary, .digest-run summary { cursor: pointer; font-weight: 600; }
.digest-chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 14rem; overflow: auto; padding: 6px 2px; }
.digest-check { display: flex; align-items: baseline; gap: 8px; font-size: .88rem; }
.digest-filters .digest-check { margin-top: 12px; }
.digest-form .error:empty, .digest-form [role=status]:empty, .sheet > .error:empty { display: none; }
.digest-preview ol { padding-inline-start: 1.45rem; margin: 12px 0; }
.digest-preview li { margin-bottom: 8px; }
.digest-preview .linkish { text-align: left; }
.digest-total { font-size: 1.3rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.digest-run { padding: 10px 0; border-top: 1px solid var(--line); }
.digest-run .button { margin-top: 6px; }
@media (max-width: 480px) {
  .digest-timing { grid-template-columns: 1fr 1fr; }
  .digest-timing > :first-child { grid-column: 1 / -1; }
}

/* Run history collection timeline */
.run-timeline-line { display: grid; grid-template-columns: minmax(100px, 26%) minmax(0, 1fr); align-items: center; gap: 16px; }
.run-timeline-scale { margin-top: 12px; padding: 5px 0; color: var(--ink-2); font-size: .78rem; }
.run-timeline-ticks { display: flex; justify-content: space-between; }
.run-timeline-row { border-top: 1px solid var(--line); }
.run-timeline-row > summary { padding: 7px 0; cursor: pointer; list-style: none; }
.run-timeline-row > summary::-webkit-details-marker { display: none; }
.run-timeline-label { font-size: .86rem; line-height: 1.25; }
.run-timeline-label small { color: var(--ink-2); }
.run-timeline-row[open] .run-timeline-label strong, .run-timeline-row > summary:hover strong { color: var(--link); }
.run-timeline-track { position: relative; display: block; height: 15px; border-radius: 4px; background-color: var(--sunk);
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px); background-size: 25% 100%; }
.run-timeline-bar { position: absolute; top: 4px; bottom: 4px; border-radius: 2px; background: var(--accent); }
.run-timeline-detail { padding: 0 0 6px 12px; color: var(--ink-2); font-size: .82rem; overflow-wrap: anywhere; }
.run-timeline-detail p { margin: 4px 0; }
.run-timeline-more { margin: 6px 0 10px; }
.run-timeline-more > summary { color: var(--link); cursor: pointer; padding: 4px 0; }
.run-timeline-collapse { margin-top: 8px; }
@media (max-width: 540px) {
  .run-timeline-line { grid-template-columns: minmax(90px, 33%) minmax(0, 1fr); gap: 8px; }
  .run-timeline-label small { display: block; }
  .run-timeline-ticks span:nth-child(even) { display: none; }
}
