:root {
  color-scheme: light;
  --bg: #f6f6f4;
  --surface: #fcfcfb;
  --surface-2: #f0efec;
  --border: #e4e3de;
  --text: #0b0b0b;
  --text-2: #52514e;
  --muted: #8a8984;
  --accent: #6250d6;
  --accent-soft: #ece9fb;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  --good: #0ca30c; --warn: #fab219; --serious: #ec835a; --bad: #d03b3b;
  --good-text: #006300; --bad-text: #b02a2a;
  --seq-0: #f0efec; --seq-1: #cde2fb; --seq-2: #9ec5f4; --seq-3: #6da7ec; --seq-4: #3987e5; --seq-5: #256abf; --seq-6: #184f95;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 2px 8px rgba(0,0,0,.04);
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121211; --surface: #1a1a19; --surface-2: #232321; --border: #2e2e2b;
    --text: #f0efec; --text-2: #c3c2b7; --muted: #8f8e86;
    --accent: #9085e9; --accent-soft: #2a2645;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
    --good-text: #4cc94c; --bad-text: #f07a7a;
    --seq-0: #232321; --seq-1: #104281; --seq-2: #184f95; --seq-3: #1c5cab; --seq-4: #256abf; --seq-5: #3987e5; --seq-6: #6da7ec;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121211; --surface: #1a1a19; --surface-2: #232321; --border: #2e2e2b;
  --text: #f0efec; --text-2: #c3c2b7; --muted: #8f8e86;
  --accent: #9085e9; --accent-soft: #2a2645;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --good-text: #4cc94c; --bad-text: #f07a7a;
  --seq-0: #232321; --seq-1: #104281; --seq-2: #184f95; --seq-3: #1c5cab; --seq-4: #256abf; --seq-5: #3987e5; --seq-6: #6da7ec;
  --shadow: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.45 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "tnum" 1;
}
a { color: var(--accent); text-decoration: none; }
button, input, select { font: inherit; color: inherit; }

/* ---------- layout */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--border); padding: 18px 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 700; font-size: 16px; }
.brand .logo { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #6250d6, #e87ba4); display: grid; place-items: center; color: #fff; font-size: 16px; }
.brand small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px;
  color: var(--text-2); font-weight: 500;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.on { background: var(--accent-soft); color: var(--accent); }
.nav .ico { width: 18px; text-align: center; }
.side .foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 8px; }

main { min-width: 0; padding: 0 28px 48px; }
.topbar {
  position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px); padding: 16px 0 12px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  border-bottom: 1px solid var(--border); margin-bottom: 20px;
}
.topbar h1 { font-size: 20px; margin: 0 auto 0 0; letter-spacing: -.01em; }
.ctrl { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 2px; }
.seg button { border: 0; background: none; padding: 5px 10px; border-radius: 7px; cursor: pointer; color: var(--text-2); font-size: 13px; }
.seg button.on { background: var(--accent); color: #fff; }
select, input[type=date], input[type=search], .btn {
  background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 6px 10px; font-size: 13px;
}
.btn { cursor: pointer; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.custom-range { display: none; gap: 6px; align-items: center; }
.custom-range.on { display: inline-flex; }
.env-pill { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 3px 8px; border-radius: 99px; }
.env-pill.prod { background: #e8f6e8; color: #006300; }
.env-pill.staging { background: #fff3d6; color: #8a5a00; }
:root[data-theme="dark"] .env-pill.prod { background: #183018; color: #7ad27a; }
:root[data-theme="dark"] .env-pill.staging { background: #3a2e10; color: #f0c25a; }

/* ---------- cards */
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); margin-bottom: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.card h3 { margin: 0 0 2px; font-size: 14px; font-weight: 600; }
.card .sub { color: var(--muted); font-size: 12px; margin: 0 0 12px; }
.section-title { font-size: 13px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; margin: 28px 0 10px; }
.kpi { padding: 14px 16px; }
.kpi .label { color: var(--text-2); font-size: 12px; display: flex; justify-content: space-between; gap: 6px; }
.kpi .val { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; }
.kpi .meta { font-size: 12px; color: var(--muted); margin-top: 2px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.delta { font-weight: 600; font-size: 12px; }
.delta.up { color: var(--good-text); }
.delta.down { color: var(--bad-text); }
.info-tip { cursor: help; color: var(--muted); }

.chart-box { position: relative; height: 260px; }
.chart-box.tall { height: 340px; }
.chart-box.short { height: 200px; }

.insights { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.insights li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 9px; background: var(--surface-2); }
.insights .dot { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; margin-top: 1px; }
.dot.good { background: var(--good); } .dot.warn { background: #c98500; } .dot.bad { background: var(--bad); } .dot.info { background: var(--s1); }

/* ---------- tables */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 600; color: var(--text-2); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; background: var(--surface); }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
th.num, td.num { text-align: right; }
td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
.bar-cell { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.bar-cell .bar { height: 8px; border-radius: 4px; background: var(--s1); min-width: 2px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.trunc { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.user-cell { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--surface-2); flex: none; display: grid; place-items: center; font-weight: 600; font-size: 12px; color: var(--text-2); }
.user-cell .nm { font-weight: 600; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--text-2); }
.badge.Power { background: #ece9fb; color: #4a3aa7; }
.badge.Activ { background: #e3f5ec; color: #0b6b47; }
.badge.Nou { background: #e5effb; color: #1c5cab; }
.badge.risc { background: #fdf0e0; color: #8a5a00; }
.badge.Adormit { background: #f3e6e6; color: #a03030; }
.badge.Neactivat { background: var(--surface-2); color: var(--muted); }
:root[data-theme="dark"] .badge.Power { background: #2a2645; color: #b9b0f5; }
:root[data-theme="dark"] .badge.Activ { background: #12301f; color: #6fd3a4; }
:root[data-theme="dark"] .badge.Nou { background: #142a45; color: #86b6ef; }
:root[data-theme="dark"] .badge.risc { background: #3a2e10; color: #f0c25a; }
:root[data-theme="dark"] .badge.Adormit { background: #3a1a1a; color: #f09090; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .badge.Power { background: #2a2645; color: #b9b0f5; }
  :root:not([data-theme="light"]) .badge.Activ { background: #12301f; color: #6fd3a4; }
  :root:not([data-theme="light"]) .badge.Nou { background: #142a45; color: #86b6ef; }
  :root:not([data-theme="light"]) .badge.risc { background: #3a2e10; color: #f0c25a; }
  :root:not([data-theme="light"]) .badge.Adormit { background: #3a1a1a; color: #f09090; }
  :root:not([data-theme="light"]) .env-pill.prod { background: #183018; color: #7ad27a; }
  :root:not([data-theme="light"]) .env-pill.staging { background: #3a2e10; color: #f0c25a; }
}
.score { display: inline-flex; align-items: center; gap: 6px; }
.score .track { width: 46px; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.score .fill { height: 100%; background: var(--accent); border-radius: 3px; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar input[type=search] { min-width: 260px; flex: 1; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: var(--surface); padding: 4px 10px; border-radius: 99px; cursor: pointer; font-size: 12px; color: var(--text-2); }
.chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; color: var(--muted); font-size: 12px; }

/* heatmaps */
.heat td { text-align: center; font-size: 11px; padding: 6px 4px; border: 2px solid var(--surface); border-radius: 4px; min-width: 38px; }
.heat th { text-align: center; font-size: 11px; padding: 4px; }
.heat td.lbl { text-align: left; color: var(--text-2); white-space: nowrap; background: none; }

/* funnel */
.funnel { display: grid; gap: 8px; }
.funnel .row { display: grid; grid-template-columns: 220px 1fr 90px; gap: 12px; align-items: center; }
.funnel .track { height: 22px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.funnel .fill { height: 100%; background: var(--s1); border-radius: 0 4px 4px 0; }
.funnel .pct { text-align: right; font-weight: 600; }
.funnel .pct small { color: var(--muted); font-weight: 400; display: block; font-size: 11px; }

/* drawer */
.drawer-bg { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 20; display: none; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100vw); background: var(--bg); z-index: 21; overflow-y: auto; transform: translateX(100%); transition: transform .2s ease; border-left: 1px solid var(--border); }
.drawer.open { transform: none; }
.drawer-bg.open { display: block; }
.drawer header { position: sticky; top: 0; background: var(--surface); border-bottom: 1px solid var(--border); padding: 18px 22px; display: flex; gap: 14px; align-items: center; z-index: 2; }
.drawer header .avatar { width: 56px; height: 56px; font-size: 18px; }
.drawer header h2 { margin: 0; font-size: 18px; }
.drawer .close { margin-left: auto; border: 0; background: var(--surface-2); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 18px; }
.drawer .body { padding: 18px 22px 40px; display: grid; gap: 14px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.mini-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mini-kpis div { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px; }
.mini-kpis b { display: block; font-size: 20px; }
.mini-kpis span { font-size: 11px; color: var(--muted); }
.timeline { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.timeline li { display: grid; grid-template-columns: 130px 150px 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.timeline li span:first-child { color: var(--muted); font-size: 12px; }

.loading { padding: 60px; text-align: center; color: var(--muted); }
.err { padding: 14px; border-radius: 10px; background: #fbe9e9; color: #a02020; }
.empty { padding: 24px; text-align: center; color: var(--muted); }
.note { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); }
.login h1 { font-size: 20px; margin: 14px 0 4px; }
.login p { color: var(--muted); margin: 0 0 20px; font-size: 13px; }
.login label { display: block; font-size: 12px; color: var(--text-2); margin: 12px 0 4px; }
.login input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg); }
.login button { width: 100%; margin-top: 18px; padding: 10px; border-radius: 9px; border: 0; background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; }
.login .msg { color: var(--bad-text); font-size: 13px; margin-top: 10px; min-height: 18px; }

.menu-btn { display: none; }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; z-index: 30; width: 250px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; }
  .menu-btn { display: inline-flex; }
  main { padding: 0 16px 40px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .funnel .row { grid-template-columns: 1fr 70px; }
  .funnel .row .track { grid-column: 1 / -1; grid-row: 2; }
  .mini-kpis { grid-template-columns: repeat(2, 1fr); }
  .timeline li { grid-template-columns: 1fr; gap: 0; }
  .kv { grid-template-columns: 110px 1fr; }
  .toolbar input[type=search] { min-width: 0; }
}

/* ---------- v2 additions */
.nav-group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 14px 12px 4px; }
.filters-note { margin: -8px 0 14px; font-size: 12px; color: var(--muted); }
.filters-note b { color: var(--accent); }
.explain { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; background: var(--accent-soft); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; }
.explain .ic { font-size: 20px; line-height: 1; }
.explain p { margin: 0; color: var(--text); }
.explain p + p { margin-top: 4px; color: var(--text-2); font-size: 13px; }
.kpi .help { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.35; border-top: 1px dashed var(--border); padding-top: 6px; }
.card .why { margin: 10px 0 0; font-size: 12px; color: var(--text-2); background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }
.card .why b { color: var(--text); }
.ec { width: 100%; height: 280px; }
.ec.tall { height: 380px; }
.ec.xtall { height: 460px; }
.ec.short { height: 220px; }
.group-head { display: flex; align-items: baseline; gap: 10px; margin: 26px 0 10px; }
.group-head h2 { font-size: 16px; margin: 0; }
.group-head span { color: var(--muted); font-size: 13px; }

/* activity log */
.feed { list-style: none; margin: 0; padding: 0; }
.feed .day { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 18px 0 6px; }
.feed .ev { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.feed .ev .tic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 16px; background: var(--surface-2); }
.feed .ev .txt { min-width: 0; }
.feed .ev .txt .who { font-weight: 600; cursor: pointer; color: var(--text); }
.feed .ev .txt .who:hover { color: var(--accent); text-decoration: underline; }
.feed .ev .txt .det { font-size: 12px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .ev time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.legend-dots { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-2); }
.legend-dots i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.glossary dt { font-weight: 700; margin-top: 14px; }
.glossary dd { margin: 4px 0 0; color: var(--text-2); }

/* =====================================================================
   v3 — clean, Apple-like polish
   ===================================================================== */
:root {
  --bg: #f5f5f7; --surface: #ffffff; --surface-2: #f2f2f5; --border: rgba(0,0,0,.07);
  --text: #1d1d1f; --text-2: #424245; --muted: #86868b;
  --accent: #6e56cf; --accent-soft: rgba(110,86,207,.10);
  --shadow: 0 1px 1px rgba(0,0,0,.02), 0 4px 16px rgba(0,0,0,.05);
  --radius: 18px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --surface: #1c1c1e; --surface-2: #2c2c2e; --border: rgba(255,255,255,.08);
    --text: #f5f5f7; --text-2: #d2d2d7; --muted: #8e8e93; --accent: #9e8cfc; --accent-soft: rgba(158,140,252,.16);
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --surface: #1c1c1e; --surface-2: #2c2c2e; --border: rgba(255,255,255,.08);
  --text: #f5f5f7; --text-2: #d2d2d7; --muted: #8e8e93; --accent: #9e8cfc; --accent-soft: rgba(158,140,252,.16);
  --shadow: none;
}
body { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; letter-spacing: -.003em; }
.side { background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: saturate(180%) blur(20px); border-right: 1px solid var(--border); }
.nav a { border-radius: 10px; font-size: 13.5px; padding: 8px 12px; }
.nav-group { padding-top: 18px; letter-spacing: .06em; }
.topbar { background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--border); }
.topbar h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", sans-serif; }
select, input[type=date], input[type=search], .btn { border-radius: 10px; border-color: var(--border); background: var(--surface); }
.seg { border-radius: 11px; border-color: var(--border); background: var(--surface-2); padding: 3px; }
.seg button { border-radius: 8px; font-weight: 500; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.card { border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.card h3 { font-size: 15px; font-weight: 600; letter-spacing: -.01em; display: flex; align-items: center; gap: 6px; }
.card .sub { font-size: 12.5px; margin-bottom: 14px; }
.kpis { gap: 14px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.kpi { padding: 16px 18px; }
.kpi .label { font-size: 12.5px; color: var(--muted); font-weight: 500; align-items: center; }
.kpi .val { font-size: 30px; font-weight: 700; letter-spacing: -.03em; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", sans-serif; }
.kpi .meta { font-size: 12px; }
.grid { gap: 18px; }
.group-head { margin: 34px 0 12px; }
.group-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.filters-note { font-size: 11.5px; }

/* info tips: long explanations hidden behind ⓘ */
.tip { position: relative; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 0; padding: 0; margin: 0;
  background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 700; cursor: help; flex: none; font-family: Georgia, serif; font-style: italic; }
.tip:hover, .tip:focus { background: var(--accent-soft); color: var(--accent); outline: none; }
.tip .pop { display: none; position: absolute; z-index: 40; top: 24px; left: 50%; transform: translateX(-50%); width: 280px; max-width: 80vw;
  background: var(--surface); color: var(--text-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px;
  font: 400 12.5px/1.45 -apple-system, BlinkMacSystemFont, "Inter", sans-serif; font-style: normal; text-align: left; letter-spacing: 0;
  box-shadow: 0 10px 30px rgba(0,0,0,.18); white-space: normal; }
.tip:hover .pop, .tip:focus .pop { display: block; }
.kpi .tip .pop { left: auto; right: -8px; transform: none; }
.card h3 .tip .pop { left: 0; transform: none; }

/* page intro: one quiet line, details on demand */
details.about { margin: -4px 0 18px; }
details.about summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); padding: 6px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); }
details.about summary::-webkit-details-marker { display: none; }
details.about summary:hover { color: var(--text); }
details.about[open] summary { color: var(--accent); }
details.about .about-body { margin-top: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; font-size: 13.5px; color: var(--text-2); max-width: 820px; }
details.about .about-body p { margin: 0; } details.about .about-body p + p { margin-top: 6px; color: var(--muted); }

/* insights: compact */
.insights li { background: transparent; border-bottom: 1px solid var(--border); border-radius: 0; padding: 10px 2px; font-size: 13.5px; }
.insights li:last-child { border-bottom: 0; }
.insights .dot { width: 20px; height: 20px; font-size: 11px; }
.insights.collapsed li:nth-child(n+5) { display: none; }
.more-link { margin-top: 8px; font-size: 13px; background: none; border: 0; color: var(--accent); cursor: pointer; padding: 4px 0; }

/* tables */
th { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: none; border-bottom: 1px solid var(--border); background: var(--surface); }
td { border-bottom: 1px solid var(--border); }
.bar-cell .bar { height: 6px; border-radius: 3px; }
.badge { border-radius: 7px; font-weight: 600; }

/* fullscreen chart cards */
.card-tools { margin-left: auto; display: flex; gap: 6px; }
.icon-btn { border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); border-radius: 9px; height: 28px; padding: 0 10px; font-size: 12.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.icon-btn:hover { color: var(--accent); }
.card:fullscreen { border-radius: 0; padding: 18px 22px; background: var(--bg); display: flex; flex-direction: column; overflow: auto; }
.card:fullscreen .ec { flex: 1; height: auto !important; min-height: 60vh; }
.card:-webkit-full-screen { border-radius: 0; background: var(--bg); width: 100%; height: 100%; }
.card:-webkit-full-screen .ec { height: calc(100vh - 110px) !important; }
.card.pseudo-fs { position: fixed; inset: 0; z-index: 60; border-radius: 0; display: flex; flex-direction: column; }
.card.pseudo-fs .ec { flex: 1; height: auto !important; }

.drawer { background: var(--bg); }
.drawer header { background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(20px); }
.mini-kpis div { border-radius: 14px; border-color: var(--border); }
.feed .ev .tic { border-radius: 12px; }
