:root {
  --brand: #5426a8;
  --brand-deep: #24105e;
  --brand-mid: #35136f;
  --brand-soft: #8b63d9;
  --brand-wash: #f1ecfa;
  --brand-line: #e4daf7;
  --on-brand: #ffffff;
  --link: #5426a8;
  --ink: #211a32;
  --body: #3d3750;
  --muted: #6e6982;
  --faint: #8a8599;
  --bg: #f7f6fa;
  --surface: #ffffff;
  --raised: #f8f6fc;
  --line: #eeeaf4;
  --line-strong: #e2dcec;
  --good: #177952;
  --good-wash: #e7f7ef;
  --warn: #9a5a12;
  --warn-wash: #fff3e2;
  --bad: #b23d58;
  --bad-wash: #fdecef;
  --info: #2f5fb8;
  --info-wash: #eaf1fd;
  --shadow: 0 1px 2px rgba(40, 20, 90, 0.04), 0 4px 16px rgba(40, 20, 90, 0.07);
  --radius: 16px;
  --radius-sm: 10px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #c1a2ff;
    --brand-soft: #8a5fe0;
    --brand-wash: #2a2042;
    --brand-line: #3d2f5c;
    --on-brand: #1b1029;
    --link: #c1a2ff;
    --ink: #f7f2fd;
    --body: #ddd4ec;
    --muted: #aca2bf;
    --faint: #8d84a0;
    --bg: #140e1e;
    --surface: #1f182b;
    --raised: #261e34;
    --line: #342a45;
    --line-strong: #43375a;
    --good: #74dfb3;
    --good-wash: #183229;
    --warn: #f4bc78;
    --warn-wash: #33240f;
    --bad: #f79aae;
    --bad-wash: #3a1621;
    --info: #9cbcf5;
    --info-wash: #18263f;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --brand: #c1a2ff;
  --brand-soft: #8a5fe0;
  --brand-wash: #2a2042;
  --brand-line: #3d2f5c;
  --on-brand: #1b1029;
  --link: #c1a2ff;
  --ink: #f7f2fd;
  --body: #ddd4ec;
  --muted: #aca2bf;
  --faint: #8d84a0;
  --bg: #140e1e;
  --surface: #1f182b;
  --raised: #261e34;
  --line: #342a45;
  --line-strong: #43375a;
  --good: #74dfb3;
  --good-wash: #183229;
  --warn: #f4bc78;
  --warn-wash: #33240f;
  --bad: #f79aae;
  --bad-wash: #3a1621;
  --info: #9cbcf5;
  --info-wash: #18263f;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--body);
  font: 14px/1.5 Inter, "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1, h2, h3 { color: var(--ink); margin: 0; line-height: 1.25; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
a { color: var(--link); }
p { margin: 0; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.faint { color: var(--faint); font-size: 12.5px; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.stack > * + * { margin-top: 16px; }
.grow { flex: 1; }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--brand); }

/* Brand lockup */
.lockup { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.lockup .logo {
  width: 42px; height: 42px; border-radius: 13px;
  background: rgba(255, 255, 255, 0.13);
  display: grid; place-items: center; color: #fff; flex: none;
}
.lockup .logo svg { width: 28px; height: 22px; }
.lockup b { display: block; font-size: 19px; font-weight: 700; line-height: 1.1; color: #fff; }
.lockup small { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: 0.2em; color: #cfc2ee; margin-top: 2px; }

/* Sign-in */
.gate { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--bg); }
.gate-art {
  position: relative;
  overflow: hidden;
  background: #24105e;
  color: #fff;
  padding: 44px 56px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.gate-art > * { position: relative; }
.gate-circles i { position: absolute; border-radius: 50%; }
.gate-circles i:nth-child(1) { width: 520px; height: 520px; right: -220px; top: -160px; background: #2e176a; }
.gate-circles i:nth-child(2) { width: 300px; height: 300px; left: -120px; bottom: -110px; background: #321c70; }
.gate-circles i:nth-child(3) { width: 180px; height: 180px; right: 60px; bottom: 90px; background: #2b1766; }
.gate-copy { margin: auto 0; max-width: 500px; }
.gate-copy .eyebrow { color: #d6c8f2; }
.gate-copy h2 { color: #fff; font-size: clamp(30px, 3.4vw, 45px); font-weight: 700; line-height: 1.12; letter-spacing: -0.02em; margin-top: 16px; }
.gate-copy > p:not(.eyebrow) { color: #e1d8f4; font-size: 16px; margin-top: 18px; max-width: 440px; }
.journey {
  margin-top: 34px;
  display: flex; gap: 16px; align-items: center;
  background: #392276; border: 1px solid #624a9a; border-radius: 18px;
  padding: 18px 20px; max-width: 440px;
}
.journey .logo { width: 52px; height: 52px; border-radius: 50%; background: rgba(255, 255, 255, 0.12); display: grid; place-items: center; flex: none; color: #fff; }
.journey .logo svg { width: 30px; height: 24px; }
.journey strong { display: block; color: #fff; font-size: 15px; }
.journey span { display: block; color: #cfc2ee; font-size: 13px; margin-top: 2px; }
.secure-pill {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 22px;
  border: 1px solid #624a9a; border-radius: 99px; padding: 6px 14px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em; color: #d6c8f2; text-transform: uppercase;
}
.secure-pill svg.i { width: 15px; height: 15px; }
.gate-foot { color: #a99acb; font-size: 13px; }
.gate-form { display: grid; place-items: center; padding: 40px 20px; }
.gate-form > div { width: 100%; max-width: 440px; min-width: 0; }
.gate-card {
  width: 100%; max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 2px 4px rgba(40, 20, 90, 0.04), 0 18px 48px rgba(40, 20, 90, 0.1);
  padding: 38px 36px 32px;
}
.gate-card h1 { font-size: 26px; margin-top: 10px; }
.gate-card h1 + p { margin-top: 6px; }
.gate-card form { margin-top: 26px; }
.gate-card .submit { width: 100%; justify-content: center; padding: 12px 16px; font-size: 15px; margin-top: 6px; }
.gate-mobile { display: none; }
.divider { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; color: var(--faint); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.divider svg.i { width: 15px; height: 15px; color: var(--brand); }
.assure { text-align: center; color: var(--muted); font-size: 12.5px; }
@media (max-width: 900px) {
  .gate { grid-template-columns: minmax(0, 1fr); }
  .gate-art { display: none; }
  .gate-mobile { display: flex; justify-content: center; margin-bottom: 22px; }
  .gate-mobile .lockup { color: var(--ink); }
  .gate-mobile .lockup b { color: var(--ink); }
  .gate-mobile .lockup small { color: var(--brand); }
  .gate-mobile .logo { background: var(--brand-deep); }
  .gate-form { align-items: start; padding: 32px 16px; }
  .gate-card { padding: 28px 20px 24px; }
}

/* Inputs with icons */
.affix { position: relative; display: block; }
.affix > svg.i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.affix > input { padding-left: 42px; }
.affix > input.has-end { padding-right: 46px; }
.affix > .end {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: transparent; color: var(--muted); border: 0; padding: 6px 8px; border-radius: 8px;
}
.affix > .end:hover { background: var(--raised); filter: none; }

/* Shell */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side {
  background: linear-gradient(180deg, #35136f 0%, #24105e 100%);
  color: #d6cde8;
  padding: 22px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.side .lockup { padding: 0 6px 6px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav .group { font-size: 10.5px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: #a99acb; padding: 14px 12px 6px; }
.nav a {
  position: relative;
  color: #d6cde8;
  text-decoration: none;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 13.5px;
  font-weight: 500;
}
.nav a span.label { flex: 1; }
.nav a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.nav a.on { background: rgba(255, 255, 255, 0.15); color: #fff; font-weight: 600; }
.nav a.on::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: #c7aeff; }
.nav a:focus-visible { outline: 2px solid #c7aeff; outline-offset: -2px; }
.nav .count { background: rgba(199, 174, 255, 0.22); color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 0 8px; line-height: 20px; }
.nav .count.hot { background: #f05d79; }
.who {
  margin-top: auto;
  display: flex; gap: 10px; align-items: center;
  padding: 12px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 12.5px;
}
.who strong { color: #fff; display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who .grow { min-width: 0; }
.who .avatar { background: rgba(255, 255, 255, 0.16); color: #fff; }
.who button { background: transparent; color: #d6cde8; padding: 6px; border-radius: 8px; }
.who button:hover { background: rgba(255, 255, 255, 0.1); color: #fff; filter: none; }
.work { min-width: 0; display: flex; flex-direction: column; }
.main { padding: 26px 32px 56px; min-width: 0; }
.main > header { margin-bottom: 22px; }
.main > header p.muted { margin-top: 4px; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  height: 66px; padding: 0 32px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.crumb { font-size: 13px; color: var(--faint); white-space: nowrap; }
.crumb b { color: var(--ink); font-weight: 600; }
.crumb .sep { margin: 0 8px; }
.topbar .search { margin-left: auto; width: min(360px, 40vw); }
.topbar .search input { background: var(--raised); border-color: var(--line); border-radius: 12px; padding-top: 9px; padding-bottom: 9px; }
.icon-btn {
  position: relative; display: inline-flex; align-items: center;
  width: 40px; height: 40px; padding: 0; justify-content: center;
  background: var(--surface); color: var(--body); border: 1px solid var(--line); border-radius: 12px;
}
.icon-btn:hover { background: var(--raised); filter: none; }
.icon-btn .dot { position: absolute; top: -5px; right: -6px; background: #f05d79; color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 99px; padding: 0 6px; line-height: 18px; border: 2px solid var(--surface); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-grid; place-items: center; flex: none;
  background: var(--brand-wash); color: var(--brand);
  font-size: 13px; font-weight: 700; letter-spacing: 0.02em;
}
.avatar.lg { width: 40px; height: 40px; }
.me { position: relative; }
.me > button { background: transparent; color: var(--ink); padding: 2px 4px 2px 2px; border-radius: 99px; gap: 10px; }
.me > button:hover { background: var(--raised); filter: none; }
.me .who-text { text-align: left; line-height: 1.25; }
.me .who-text small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }
.pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40;
  width: 260px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 18px 40px rgba(20, 10, 50, 0.16); padding: 8px;
}
.pop .head { padding: 10px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.pop .head strong { color: var(--ink); display: block; }
.pop button { width: 100%; background: transparent; color: var(--body); font-weight: 500; padding: 9px 10px; border-radius: 9px; }
.pop button:hover { background: var(--raised); filter: none; }
.theme-row { padding: 4px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.theme-row .faint { font-size: 12px; margin-bottom: 6px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--raised); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.pop .seg button { width: auto; justify-content: center; gap: 5px; padding: 6px 4px; font-size: 12px; border-radius: 7px; color: var(--muted); }
.pop .seg button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg .i { width: 14px; height: 14px; }
.menu-btn { display: none !important; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 50; transform: translateX(-100%); transition: transform 0.2s; }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.45); }
  .menu-btn { display: inline-flex !important; }
  .topbar { padding: 0 16px; gap: 10px; }
  .main { padding: 20px 16px 48px; }
  .me .who-text { display: none; }
}
@media (max-width: 640px) {
  .topbar .search, .crumb { display: none; }
  .topbar .icon-btn.bell { margin-left: auto; }
  h1 { font-size: 22px; }
}

/* Surfaces */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}
.card.flush { padding: 0; overflow: hidden; }
.card > h2 { margin-bottom: 14px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.card-head p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.panel { background: var(--brand-wash); border: 1px solid var(--brand-line); border-radius: var(--radius); padding: 18px 20px; }
.panel h2 { margin-bottom: 6px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 1100px) { .cols, .cols-2 { grid-template-columns: 1fr; } }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.tile {
  display: block; color: inherit; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px;
}
a.tile:hover { border-color: var(--brand-line); }
.tile .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.tile .label { font-size: 13px; color: var(--muted); font-weight: 500; }
.tile .value { font-size: 26px; font-weight: 700; color: var(--ink); margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.tile .sub { font-size: 12.5px; color: var(--faint); margin-top: 4px; }
.tile-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--brand-wash); color: var(--brand); }
.tile-icon.good { background: var(--good-wash); color: var(--good); }
.tile-icon.warn { background: var(--warn-wash); color: var(--warn); }
.tile-icon.info { background: var(--info-wash); color: var(--info); }
.tile-icon.bad { background: var(--bad-wash); color: var(--bad); }
.hero {
  background: linear-gradient(135deg, #5426a8 0%, #35136f 100%);
  color: #e6dcf7; border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow);
}
.hero h2, .hero .big { color: #fff; }
.hero .big { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.hero dl.facts { margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.16); }
.hero dl.facts dt { color: #cfc2ee; }
.hero dl.facts dd { color: #fff; text-align: right; font-variant-numeric: tabular-nums; }
.hero a { color: #fff; }

dl.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }

.snap { list-style: none; margin: 0; padding: 0; }
.snap li + li { border-top: 1px solid var(--line); }
.snap a { display: flex; align-items: center; gap: 12px; padding: 12px 2px; color: var(--body); text-decoration: none; }
.snap a:hover .label { color: var(--brand); }
.snap .label { flex: 1; }
.snap .n { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.snap .tile-icon { width: 34px; height: 34px; border-radius: 10px; }
.snap .tile-icon svg.i { width: 16px; height: 16px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); background: var(--raised); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td, tr.click:focus-visible td { background: var(--brand-wash); }
tr.click:focus-visible { outline: none; }
td .sub { font-size: 12.5px; color: var(--muted); }
.person { display: flex; gap: 12px; align-items: center; }
.empty { padding: 32px 18px; text-align: center; color: var(--muted); }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; border-radius: 99px; padding: 1px 10px; line-height: 21px; white-space: nowrap; }
.pill.neutral { background: var(--raised); color: var(--muted); border: 1px solid var(--line); }
.pill.good { background: var(--good-wash); color: var(--good); }
.pill.warn { background: var(--warn-wash); color: var(--warn); }
.pill.bad { background: var(--bad-wash); color: var(--bad); }
.pill.info { background: var(--info-wash); color: var(--info); }
.pill.brand { background: var(--brand-wash); color: var(--brand); }

/* Controls */
button, .btn {
  font: inherit;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 9px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--brand);
  color: var(--on-brand);
  text-decoration: none;
  line-height: 1.3;
}
button:hover, .btn:hover { filter: brightness(1.08); }
button:disabled { opacity: 0.55; cursor: default; filter: none; }
button.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
button.ghost { background: transparent; color: var(--link); padding: 6px 8px; }
button.danger { background: var(--bad); color: #fff; }
button.small { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
label.field { display: block; margin-bottom: 16px; }
label.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
label.field > span.affix { font-size: inherit; font-weight: inherit; margin: 0; color: inherit; }
label.field > small { display: block; font-size: 12px; color: var(--muted); margin-top: 5px; }
input, select, textarea {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 9px 12px;
  width: 100%;
}
.gate-card input { padding-top: 11px; padding-bottom: 11px; border-radius: 12px; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--brand-soft); outline-offset: 1px; }
input[type="checkbox"] { width: auto; accent-color: var(--brand); }
label.check { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; color: var(--ink); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar input, .toolbar select { width: auto; min-width: 160px; }
.toolbar input[type="checkbox"], .toolbar input[type="radio"] { min-width: 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { background: var(--surface); color: var(--body); border: 1px solid var(--line-strong); font-weight: 500; padding: 6px 13px; border-radius: 99px; font-size: 13px; }
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.chip .n { opacity: 0.75; margin-left: 4px; }

/* Notices */
.notice { border-radius: 10px; padding: 10px 14px; font-size: 13.5px; }
.notice.bad { background: var(--bad-wash); color: var(--bad); }
.notice.warn { background: var(--warn-wash); color: var(--warn); }
.notice.good { background: var(--good-wash); color: var(--good); }
.notice.info { background: var(--info-wash); color: var(--info); }
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--surface);
  padding: 10px 18px; border-radius: 10px; font-weight: 600; z-index: 60;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 18px; border-left: 2px solid var(--line); margin-left: 5px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand-soft); }
.timeline li.internal::before { background: var(--faint); }
.timeline li:last-child { border-left-color: transparent; }
.timeline .t { font-weight: 600; color: var(--ink); }
.timeline .note { margin-top: 2px; white-space: pre-wrap; }
.list > div { padding: 10px 0; border-top: 1px solid var(--line); }
.list > div:first-child { border-top: 0; padding-top: 0; }
.statement { white-space: pre-wrap; background: var(--raised); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }

/* Dialog */
dialog {
  border: 0;
  border-radius: 18px;
  padding: 0;
  width: min(520px, calc(100vw - 32px));
  background: var(--surface);
  color: var(--body);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}
dialog::backdrop { background: rgba(20, 12, 40, 0.55); }
dialog .d-head { padding: 20px 22px 4px; }
dialog .d-body { padding: 14px 22px 6px; max-height: 70vh; overflow-y: auto; }
dialog .d-foot { padding: 12px 22px 20px; display: flex; justify-content: flex-end; gap: 8px; }
.secret { font-family: ui-monospace, Consolas, monospace; font-size: 18px; letter-spacing: 0.04em; background: var(--raised); border: 1px dashed var(--line-strong); padding: 12px; border-radius: 10px; text-align: center; color: var(--ink); user-select: all; }

/* Bar chart (reports) */
.bars { display: flex; align-items: flex-end; gap: 2px; height: 160px; padding-top: 8px; border-bottom: 1px solid var(--line); }
.bars .bar { flex: 1; background: var(--brand-soft); border-radius: 4px 4px 0 0; min-height: 1px; position: relative; }
.bars .bar:hover { background: var(--brand); }
.bars .target { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--warn); pointer-events: none; }
.bars-wrap { position: relative; }
.meter { height: 8px; background: var(--raised); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.meter > i { display: block; height: 100%; background: var(--brand); }

/* Line chart (dashboard) */
.lc { position: relative; padding-left: 34px; margin-top: 8px; }
.lc .plot { position: relative; height: 210px; }
.lc svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.lc .grid { stroke: var(--line); stroke-width: 1; }
.lc .base { stroke: var(--line-strong); stroke-width: 1; }
.lc .area { fill: var(--brand); opacity: 0.08; stroke: none; }
.lc .line { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.lc .goal { fill: none; stroke: var(--warn); stroke-width: 1.5; stroke-dasharray: 5 5; }
.lc .ylab { position: absolute; left: -34px; width: 26px; text-align: right; transform: translateY(-50%); font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.lc .xlabs { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11.5px; color: var(--faint); }
.lc .hit { position: absolute; inset: 0; cursor: crosshair; }
.lc .cross { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line-strong); pointer-events: none; }
.lc .mark { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); border: 2px solid var(--surface); transform: translate(-50%, -50%); pointer-events: none; }
.lc .tip {
  position: absolute; top: -6px; transform: translate(-50%, -100%); pointer-events: none; white-space: nowrap;
  background: var(--ink); color: var(--surface); font-size: 12px; padding: 6px 10px; border-radius: 8px;
}
.lc .tip b { font-weight: 700; }
.legend-note { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.legend-note i { width: 16px; border-top: 2px dashed var(--warn); }

/* QR print */
.qr-sheet { text-align: center; }
.qr-sheet svg { width: 240px; height: 240px; background: #fff; padding: 8px; border-radius: 8px; }
.qr-sheet .code { font-family: ui-monospace, Consolas, monospace; font-size: 20px; font-weight: 700; color: var(--ink); margin-top: 10px; }
#print-area { display: none; }
@media print {
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; color: #000; text-align: center; padding-top: 40px; }
  #print-area svg { width: 70mm; height: 70mm; }
  #print-area .code { font: 700 22pt ui-monospace, Consolas, monospace; margin-top: 8mm; }
  #print-area .label { font: 14pt system-ui, sans-serif; margin-top: 3mm; }
  #print-area .link { font: 11pt system-ui, sans-serif; margin-top: 3mm; color: #333; }
  #print-area .brand { font: 700 16pt system-ui, sans-serif; margin-bottom: 8mm; }
}

.loading { color: var(--muted); padding: 24px 0; }
.skeleton { background: linear-gradient(90deg, var(--raised), var(--line), var(--raised)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 12px; height: 56px; margin-bottom: 8px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } .side { transition: none; } }
