/* Palm Eye Cloud portal — design tokens and components. Copyright © 2026 Palm Digitalz. All rights reserved. */

:root {
  color-scheme: dark;
  --ground: #0A0A0C;
  --surface: #111114;
  --surface2: #1B1B1F;
  --surface3: #26262B;
  --label: #F5F5F7;
  --secondary: rgba(245, 245, 247, .62);
  --tertiary: rgba(245, 245, 247, .34);
  --quaternary: rgba(245, 245, 247, .18);
  --hairline: rgba(255, 255, 255, .12);
  --hairline-soft: rgba(255, 255, 255, .07);
  --glass-top: rgba(255, 255, 255, .05);
  --accent: #E8A33D;
  --accent-soft: rgba(232, 163, 61, .2);
  --on-accent: #1A1200;
  --green: #30D158;
  --yellow: #FFD60A;
  --orange: #FF9F0A;
  --red: #FF453A;
  --blue: #0A84FF;
  --teal: #64D2FF;
  --purple: #BF5AF2;
  --ivory: #F5F1E8;
  --track: rgba(255, 255, 255, .1);
  --shadow: 0 12px 40px rgba(0, 0, 0, .5);
  --page: 20px;
  --gutter: 12px;
  --inset: 20px;
  --tile-inset: 16px;
  --row: 52px;
  --r-card: 20px;
  --r-tile: 16px;
  --r-btn: 12px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --ground: #F2F2F7;
    --surface: #FFFFFF;
    --surface2: #F7F7F9;
    --surface3: #EBEBF0;
    --label: #111113;
    --secondary: rgba(17, 17, 19, .6);
    --tertiary: rgba(17, 17, 19, .34);
    --quaternary: rgba(17, 17, 19, .18);
    --hairline: rgba(0, 0, 0, .1);
    --hairline-soft: rgba(0, 0, 0, .06);
    --glass-top: rgba(255, 255, 255, .6);
    --accent: #C77F12;
    --accent-soft: rgba(199, 127, 18, .16);
    --on-accent: #FFFFFF;
    --green: #34C759;
    --yellow: #E0B000;
    --orange: #FF9500;
    --red: #FF3B30;
    --blue: #007AFF;
    --teal: #32ADE6;
    --purple: #AF52DE;
    --ivory: #3A342A;
    --track: rgba(0, 0, 0, .08);
    --shadow: 0 12px 40px rgba(0, 0, 0, .14);
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; min-height: 100%; background: var(--ground); color: var(--label);
  font-family: var(--font); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum" 1, "lnum" 1;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-size: .93em; letter-spacing: .01em; }
.muted { color: var(--secondary); }
.faint { color: var(--tertiary); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--ground) 86%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-bottom: 1px solid var(--hairline-soft); }
.top-inner { max-width: 1320px; margin: 0 auto; padding: 0 var(--page); height: 56px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--label); flex: none; }
.brand:hover { text-decoration: none; }
.mark { display: block; color: var(--label); }
.wordmark { font-size: 16px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.wordmark-cloud { color: var(--secondary); font-weight: 500; }
.nav { display: flex; gap: 4px; margin-left: 8px; position: relative; }
.nav a { display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border-radius: 10px; color: var(--secondary); font-weight: 500; font-size: 14px; }
.nav a:hover { color: var(--label); background: var(--surface2); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--label); background: var(--surface2); box-shadow: inset 0 -2px 0 var(--accent); }
.nav-toggle { display: none; width: 40px; height: 40px; border: 0; background: none; border-radius: 10px; flex-direction: column; justify-content: center; align-items: center; gap: 4px; }
.nav-toggle-bar { width: 18px; height: 2px; background: var(--label); border-radius: 1px; display: block; }
.user { margin-left: auto; position: relative; }
.user-btn { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 6px; border: 1px solid var(--hairline); background: var(--surface); border-radius: 999px; }
.avatar { width: 24px; height: 24px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffd98a, var(--accent) 60%, #8a5a0f); display: inline-block; }
.user-name { font-size: 13px; font-weight: 500; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; }
.menu-head { padding: 8px 10px; font-size: 12px; color: var(--secondary); border-bottom: 1px solid var(--hairline-soft); margin-bottom: 4px; }
.menu-item { display: block; width: 100%; text-align: left; padding: 9px 10px; border: 0; background: none; border-radius: 8px; font-size: 14px; }
.menu-item:hover { background: var(--surface2); }

@media (max-width: 720px) {
  .nav-toggle { display: flex; margin-left: auto; }
  .user { margin-left: 0; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 56px; flex-direction: column; background: var(--surface); border-bottom: 1px solid var(--hairline); padding: 8px var(--page) 12px; margin: 0; gap: 2px; }
  .nav.open { display: flex; }
  .nav a { height: 44px; }
  .user-name { display: none; }
  .user-btn { padding: 0 6px; }
}

/* ---------- page grid ---------- */
.app { max-width: 1320px; margin: 0 auto; padding: var(--page); outline: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 8px 0 20px; }
.page-title { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.page-sub { color: var(--secondary); font-size: 14px; margin-top: 4px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { font-size: 13px; color: var(--secondary); margin-bottom: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--secondary); }
.crumbs a:hover { color: var(--label); }
.section-title { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--tertiary); font-weight: 600; margin: 28px 0 8px; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gutter); }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-6 { grid-column: span 6; } .span-4 { grid-column: span 4; } .span-3 { grid-column: span 3; }
@media (max-width: 1080px) { .span-8 { grid-column: span 12; } .span-4, .span-3 { grid-column: span 6; } }
@media (max-width: 720px) { .span-6, .span-4, .span-3 { grid-column: span 12; } }

/* ---------- card ---------- */
.card { background: var(--surface); border: 1px solid var(--hairline-soft); border-radius: var(--r-card); padding: var(--inset); min-width: 0; position: relative; box-shadow: inset 0 1px 0 var(--glass-top); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head > div:first-child { min-width: 0; flex: 1 1 200px; }
.card-title { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--tertiary); font-weight: 600; }
.card-sub { font-size: 12.5px; color: var(--secondary); margin-top: 2px; overflow-wrap: anywhere; }
.card-actions { display: flex; gap: 6px; align-items: center; flex: 0 1 auto; flex-wrap: wrap; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .card-head { padding: var(--inset) var(--inset) 0; }

/* ---------- kpi tile ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--gutter); }
.kpi { background: var(--surface); border: 1px solid var(--hairline-soft); border-radius: var(--r-tile); padding: var(--tile-inset); min-width: 0; box-shadow: inset 0 1px 0 var(--glass-top); }
.kpi-k { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--tertiary); font-weight: 600; }
.kpi-n { font-size: clamp(22px, 2.4vw, 30px); font-weight: 300; letter-spacing: -.03em; line-height: 1.15; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-s { font-size: 12px; color: var(--secondary); margin-top: 2px; }
@media (max-width: 640px) { .kpi-n { font-size: 24px; } }

/* ---------- table ---------- */
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--tertiary); font-weight: 600; padding: 0 12px; height: 40px; border-bottom: 1px solid var(--hairline); white-space: nowrap; position: sticky; top: 0; background: var(--surface); }
.table td { padding: 0 12px; height: var(--row); border-bottom: 1px solid var(--hairline-soft); white-space: nowrap; vertical-align: middle; }
.table td.wrap { white-space: normal; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.link { cursor: pointer; transition: background .15s, transform .18s var(--ease); }
.table tbody tr.link:hover, .table tbody tr.link:focus-within { background: var(--surface2); }
.table tbody tr.link:hover { transform: translateY(-1px); }
.table th.num, .table td.num { text-align: right; }
.table th:first-child, .table td:first-child { padding-left: var(--inset); }
.table th:last-child, .table td:last-child { padding-right: var(--inset); }
.th-sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; display: inline-flex; align-items: center; gap: 4px; }
.th-sort:hover { color: var(--label); }
.th-sort[aria-sort="ascending"], .th-sort[aria-sort="descending"] { color: var(--label); }
.th-sort .arrow { font-size: 10px; opacity: .8; }
.row-link { color: inherit; display: block; }
.row-link:hover { text-decoration: none; }
.tfoot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px var(--inset); border-top: 1px solid var(--hairline-soft); font-size: 13px; color: var(--secondary); flex-wrap: wrap; }
.pager { display: flex; gap: 4px; align-items: center; }

/* ---------- pills, chips, status ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: .01em; background: var(--surface2); color: var(--secondary); white-space: nowrap; border: 1px solid transparent; }
.pill.good { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.pill.warn { color: var(--yellow); background: color-mix(in srgb, var(--yellow) 14%, transparent); }
.pill.orange { color: var(--orange); background: color-mix(in srgb, var(--orange) 14%, transparent); }
.pill.bad { color: var(--red); background: color-mix(in srgb, var(--red) 14%, transparent); }
.pill.info { color: var(--blue); background: color-mix(in srgb, var(--blue) 14%, transparent); }
.pill.teal { color: var(--teal); background: color-mix(in srgb, var(--teal) 14%, transparent); }
.pill.accent { color: var(--accent); background: var(--accent-soft); }
.pill.mono { font-family: var(--mono); }
.pill-x { border: 0; background: none; color: inherit; padding: 0 0 0 2px; line-height: 1; font-size: 14px; opacity: .7; }
.pill-x:hover { opacity: 1; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; flex-direction: column; padding: 8px 12px; border-radius: 12px; background: var(--surface2); min-width: 92px; }
.chip-k { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--tertiary); font-weight: 600; }
.chip-v { font-size: 18px; font-weight: 500; letter-spacing: -.02em; }
.status-bar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface2); border-left: 3px solid var(--tertiary); font-size: 14px; }
.status-bar.good { border-color: var(--green); } .status-bar.warn { border-color: var(--yellow); } .status-bar.bad { border-color: var(--red); } .status-bar.info { border-color: var(--blue); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tertiary); display: inline-block; flex: none; }
.dot.good { background: var(--green); } .dot.warn { background: var(--yellow); } .dot.bad { background: var(--red); } .dot.info { background: var(--blue); }
.score { display: inline-block; min-width: 38px; text-align: center; border-radius: 999px; padding: 2px 8px; font-weight: 600; background: var(--surface2); font-size: 12.5px; }
.score.good { color: var(--green); } .score.warn { color: var(--yellow); } .score.bad { color: var(--red); }

/* ---------- disclosure & tabs ---------- */
.disclosure { border-top: 1px solid var(--hairline-soft); }
.disclosure > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; min-height: var(--row); padding: 8px 0; font-weight: 500; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::before { content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--secondary); border-bottom: 1.5px solid var(--secondary); transform: rotate(-45deg); transition: transform .2s var(--ease); flex: none; margin-left: 4px; }
.disclosure[open] > summary::before { transform: rotate(45deg); }
.disclosure-body { padding: 0 0 14px 21px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--hairline-soft); margin-bottom: 14px; overflow-x: auto; }
.tab { border: 0; background: none; padding: 8px 12px; color: var(--secondary); font-weight: 500; font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; border-radius: 6px 6px 0 0; }
.tab:hover { color: var(--label); }
.tab[aria-selected="true"] { color: var(--label); border-bottom-color: var(--accent); }
.seg { display: inline-flex; background: var(--surface2); border-radius: 10px; padding: 2px; gap: 2px; }
.seg button { border: 0; background: none; padding: 5px 10px; border-radius: 8px; color: var(--secondary); font-size: 13px; font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--surface3); color: var(--label); }

/* ---------- inputs ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .field-label { font-size: 12.5px; color: var(--secondary); font-weight: 500; }
.input, .select, .textarea { width: 100%; height: 40px; padding: 0 12px; background: var(--surface2); border: 1px solid var(--hairline); border-radius: var(--r-btn); color: var(--label); outline: none; transition: border-color .15s; }
.textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder { color: var(--tertiary); }
.input[type="date"] { color-scheme: inherit; }
.select { appearance: none; -webkit-appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--secondary) 50%), linear-gradient(135deg, var(--secondary) 50%, transparent 50%); background-position: calc(100% - 18px) 17px, calc(100% - 13px) 17px; background-size: 5px 5px; background-repeat: no-repeat; }
.search { position: relative; display: flex; align-items: center; }
.search .input { padding-left: 34px; }
.search::before { content: ""; position: absolute; left: 12px; width: 12px; height: 12px; border: 1.7px solid var(--tertiary); border-radius: 50%; }
.search::after { content: ""; position: absolute; left: 22px; top: 25px; width: 6px; height: 1.7px; background: var(--tertiary); transform: rotate(45deg); }
.hint { font-size: 12px; color: var(--tertiary); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.form-error { color: var(--red); font-size: 13px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--r-btn); border: 1px solid transparent; font-weight: 600; font-size: 13.5px; white-space: nowrap; transition: transform .12s var(--ease), background .15s; user-select: none; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.06); }
.btn.secondary { background: var(--surface2); color: var(--label); border-color: var(--hairline); }
.btn.secondary:hover:not(:disabled) { background: var(--surface3); }
.btn.ghost { background: none; color: var(--secondary); }
.btn.ghost:hover:not(:disabled) { background: var(--surface2); color: var(--label); }
.btn.destructive { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.btn.destructive:hover:not(:disabled) { background: color-mix(in srgb, var(--red) 24%, transparent); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn .spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- toast ---------- */
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 60; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px; box-shadow: var(--shadow); padding: 12px 14px; display: flex; gap: 10px; align-items: center; font-size: 14px; animation: toastIn .22s var(--ease); }
.toast.out { animation: toastOut .2s var(--ease) forwards; pointer-events: none; }
.toast.good { border-color: color-mix(in srgb, var(--green) 40%, transparent); }
.toast.bad { border-color: color-mix(in srgb, var(--red) 50%, transparent); }
.toast .grow { flex: 1; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- skeleton ---------- */
.skel { position: relative; overflow: hidden; background: var(--surface2); border-radius: 8px; color: transparent !important; }
.skel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, var(--glass-top), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.skel-line { height: 14px; margin: 6px 0; }
.skel-block { height: 200px; }

/* ---------- empty state & callouts ---------- */
.empty { text-align: center; padding: 36px 20px; color: var(--secondary); }
.empty-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--surface2); margin: 0 auto 12px; display: flex; align-items: center; justify-content: center; color: var(--tertiary); font-size: 20px; }
.empty-title { color: var(--label); font-weight: 600; font-size: 15px; }
.empty-text { font-size: 13.5px; margin-top: 4px; }
.empty .btn { margin-top: 14px; }
.callout { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 14px; background: color-mix(in srgb, var(--red) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--red) 35%, transparent); font-size: 14px; flex-wrap: wrap; }
.callout.info { background: color-mix(in srgb, var(--blue) 10%, var(--surface)); border-color: color-mix(in srgb, var(--blue) 35%, transparent); }
.callout.warn { background: color-mix(in srgb, var(--yellow) 10%, var(--surface)); border-color: color-mix(in srgb, var(--yellow) 35%, transparent); }
.callout .grow { flex: 1; min-width: 160px; }
.callout-title { font-weight: 600; }
.callout-text { color: var(--secondary); font-size: 13px; }

/* ---------- modal / sheet ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .18s var(--ease); }
.modal { background: var(--surface); border: 1px solid var(--hairline); border-radius: 22px; box-shadow: var(--shadow); width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: var(--inset); animation: modalIn .2s var(--ease); }
.modal.sheet { width: min(680px, 100%); }
.modal-title { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.modal-text { color: var(--secondary); font-size: 14px; margin-top: 6px; }
.modal-body { margin-top: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 640px) {
  .modal-back { align-items: flex-end; padding: 0; }
  .modal { border-radius: 24px 24px 0 0; max-height: 92vh; width: 100%; }
}

/* ---------- tooltip ---------- */
.tip { position: fixed; z-index: 70; background: var(--surface3); color: var(--label); border: 1px solid var(--hairline); border-radius: 10px; padding: 7px 10px; font-size: 12.5px; pointer-events: none; max-width: 300px; box-shadow: var(--shadow); line-height: 1.4; }
.tip .t-k { color: var(--secondary); }
.tip .t-row { display: flex; gap: 10px; justify-content: space-between; }
.tip .t-sw { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 6px; }

/* ---------- facts (dl) ---------- */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px 20px; margin: 0; }
.fact dt { font-size: 11.5px; color: var(--tertiary); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.fact dd { margin: 2px 0 0; font-size: 15px; overflow-wrap: anywhere; }
.fact dd.mono { font-size: 14px; }

/* ---------- charts host ---------- */
.chart { position: relative; width: 100%; min-width: 0; }
.chart canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.chart.h200 { height: 200px; } .chart.h240 { height: 240px; } .chart.h320 { height: 320px; } .chart.h120 { height: 120px; }
.chart.zoomable canvas { cursor: crosshair; }
.chart.clickable canvas { cursor: pointer; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 8px; }
.legend-item { display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; padding: 4px 8px; border-radius: 8px; color: var(--secondary); font-size: 12.5px; }
.legend-item:hover { background: var(--surface2); color: var(--label); }
.legend-item[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }
.legend-item.on { background: var(--surface2); color: var(--label); }
.legend-sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend-v { font-family: var(--mono); font-size: 12px; color: var(--label); min-width: 60px; text-align: right; }
.legend-n { margin-left: auto; color: var(--tertiary); font-size: 12px; }
.bars { display: flex; flex-direction: column; gap: 2px; }
.bar { display: grid; grid-template-columns: minmax(70px, 36%) 1fr 52px; gap: 10px; align-items: center; border: 0; background: none; color: var(--label); font: inherit; font-size: 13px; padding: 5px 6px; border-radius: 8px; text-align: left; cursor: pointer; min-height: 30px; }
.bar.static { cursor: default; }
.bar:hover:not(.static) { background: var(--surface2); }
.bar.on { background: var(--surface2); box-shadow: inset 0 0 0 1px var(--accent); }
.bar.dim { opacity: .45; }
.bar-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-t { height: 8px; background: var(--track); border-radius: 4px; overflow: hidden; }
.bar-f { display: block; height: 100%; background: var(--accent); border-radius: 4px; width: var(--w, 0%); animation: barIn .55s var(--ease) both; }
.bar-n { text-align: right; color: var(--secondary); font-size: 12.5px; }
.heat { display: grid; grid-template-columns: repeat(16, 1fr); gap: 3px; max-width: 520px; }
.heat-c { aspect-ratio: 1; border-radius: 3px; border: 0; padding: 0; background: var(--track); cursor: pointer; }
.heat-c:hover { outline: 1px solid var(--label); }
.heat-c.on { outline: 2px solid var(--label); }
.heat-axis { display: grid; grid-template-columns: repeat(16, 1fr); gap: 3px; max-width: 520px; font-family: var(--mono); font-size: 9.5px; color: var(--tertiary); text-align: center; margin-top: 4px; }

/* ---------- utilities (replace inline styles) ---------- */
.mt { margin-top: 12px; } .mt14 { margin-top: 14px; } .mt16 { margin-top: 16px; } .mb12 { margin-bottom: 12px; } .mb14 { margin-bottom: 14px; } .my12 { margin: 12px 0; }
.pad { padding: var(--inset); } .span-all { grid-column: 1 / -1; }
.seen { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

/* ---------- offline banner ---------- */
.offline { position: sticky; top: 56px; z-index: 19; display: flex; gap: 10px; align-items: center; padding: 8px var(--page); font-size: 13.5px; background: color-mix(in srgb, var(--yellow) 14%, var(--surface)); border-bottom: 1px solid color-mix(in srgb, var(--yellow) 40%, transparent); animation: pageIn .2s var(--ease); }
.offline .grow { flex: 1; }
.top[hidden] ~ .offline { top: 0; }

/* ---------- motion: page, nav underline, toast, modal, focus, bars, live dot, copy check ---------- */
.page { animation: pageIn .16s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.nav.has-ul::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: var(--ul-w, 0px); transform: translateX(var(--ul-x, 0px)); background: var(--accent); border-radius: 1px; transition: transform .28s var(--ease), width .28s var(--ease); pointer-events: none; }
.nav.has-ul a[aria-current="page"] { box-shadow: none; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes modalIn { from { opacity: 0; transform: scale(.96) translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) { .modal { animation: sheetIn .22s var(--ease); } }
@keyframes sheetIn { from { transform: translateY(28px); opacity: 0; } to { transform: none; opacity: 1; } }
:focus-visible { animation: focusIn .2s var(--ease); }
@keyframes focusIn { from { outline-offset: 7px; outline-color: transparent; } }
@keyframes barIn { from { width: 0; } }
.dot.live { position: relative; }
.dot.live::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 1.5px solid var(--green); animation: pulse 2s var(--ease) infinite; }
@keyframes pulse { 0% { transform: scale(.55); opacity: .9; } 70%, 100% { transform: scale(1.7); opacity: 0; } }
.copy-btn { gap: 8px; }
.copy-ic { display: inline-block; width: 14px; height: 14px; position: relative; flex: none; }
.copy-ic::before { content: ""; position: absolute; left: 2px; top: 3px; width: 8px; height: 9px; border: 1.6px solid currentColor; border-radius: 2px; box-shadow: 3px -3px 0 -1px var(--surface2), 3px -3px 0 0 currentColor; transition: opacity .16s, transform .2s var(--ease); }
.copy-ic::after { content: ""; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); opacity: 0; transition: transform .24s var(--ease), opacity .16s; }
.copy-btn.copied { color: var(--green); border-color: color-mix(in srgb, var(--green) 45%, transparent); }
.copy-btn.copied .copy-ic::before { opacity: 0; transform: scale(.5); }
.copy-btn.copied .copy-ic::after { opacity: 1; transform: rotate(45deg) scale(1); }

/* ---------- below-the-fold cards render lazily ---------- */
.grid > .card:nth-child(n+4), .report > .card:nth-child(n+4) { content-visibility: auto; contain-intrinsic-size: auto 320px; }

/* ---------- reduced motion: everything instant, nothing moves ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .dot.live::after { display: none; }
  .table tbody tr.link:hover { transform: none; }
}
