/* PeAutopilot Panou: brand tokens from peautopilot-web docs/BRAND.md (violet #6D28D9, night ink #140C2A,
   amber #F5A524 for signals only, lavender #C4B5FD), Sora + Manrope self-hosted. Dark by design. */
@font-face { font-family: "Sora"; src: url("fonts/sora-latin-wght-normal.woff2") format("woff2"); font-weight: 100 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: "Sora"; src: url("fonts/sora-latin-ext-wght-normal.woff2") format("woff2"); font-weight: 100 800; font-display: swap; unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF; }
@font-face { font-family: "Manrope"; src: url("fonts/manrope-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: "Manrope"; src: url("fonts/manrope-latin-ext-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF; }

:root {
  --ink: #140c2a;          /* page */
  --ink-2: #1b1238;        /* sidebar, wells */
  --surface: #211645;      /* cards */
  --surface-2: #2c1d57;    /* raised / hover */
  --line: #36286a;
  --text: #f5f1fd;
  --muted: #b9aed6;        /* 8.6:1 on --surface */
  --faint: #9a8fbf;        /* 5.4:1 on --surface, labels only */
  --violet: #6d28d9;
  --violet-2: #7c3aed;
  --lav: #c4b5fd;
  --lav-2: #a78bfa;
  --amber: #f5a524;
  --amber-soft: #ffe2a8;
  --good: #34d399;
  --bad: #f87171;
  --info: #7dd3fc;
  --display: "Sora", "Segoe UI", system-ui, sans-serif;
  --body: "Manrope", "Segoe UI", system-ui, sans-serif;
  --r: 16px;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --side: 236px;
  --tabbar: 64px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ink); color: var(--text); font: 15px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; }
a { color: var(--lav); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 22px; }
h2 { font-size: 15px; }
h3 { font-size: 14px; }
.num, td.n, .kpi .v { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100dvh; background: var(--ink-2); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; text-decoration: none; color: var(--text); }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.brand b { font: 600 13px/1 var(--display); letter-spacing: 0.2em; }
.brand small { display: block; color: var(--faint); font-size: 11px; letter-spacing: 0.04em; margin-top: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; color: var(--muted); text-decoration: none; font-weight: 600; transition: background 0.15s, color 0.15s; min-height: 44px; }
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a[aria-current="page"] { background: linear-gradient(90deg, rgb(124 58 237 / 0.35), rgb(124 58 237 / 0.12)); color: #fff; box-shadow: inset 2px 0 0 var(--amber); }
.nav svg { width: 20px; height: 20px; flex: none; }
.badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--amber); color: #1b1230; font: 700 12px/22px var(--body); text-align: center; font-variant-numeric: tabular-nums; }
.badge[hidden] { display: none; }
.side-foot { margin-top: auto; padding: 12px; font-size: 12px; color: var(--faint); }
.side-foot .demo { display: inline-block; background: var(--amber); color: #1b1230; font-weight: 700; padding: 2px 8px; border-radius: 6px; margin-bottom: 6px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 14px 28px; background: rgb(20 12 42 / 0.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.top h1 { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .mobile-logo { display: none; }
.content { padding: 22px 28px 48px; max-width: 1440px; width: 100%; }

/* segmented period control + sub tabs */
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.seg::-webkit-scrollbar { display: none; }
.seg button { border: 0; background: none; padding: 7px 12px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; min-height: 36px; transition: background 0.15s, color 0.15s; }
.seg button[aria-pressed="true"] { background: var(--violet); color: #fff; }
.subtabs { display: flex; gap: 6px; margin: 0 0 18px; overflow-x: auto; scrollbar-width: none; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs a { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); text-decoration: none; font-weight: 600; font-size: 13px; white-space: nowrap; min-height: 38px; display: inline-flex; align-items: center; gap: 6px; }
.subtabs a[aria-current="page"] { background: var(--surface-2); color: #fff; border-color: var(--lav-2); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.toolbar .grow { flex: 1; }

.iconbtn { position: relative; width: 42px; height: 42px; flex: none; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--muted); transition: background 0.15s, color 0.15s, transform 0.1s; }
.iconbtn:hover { background: var(--surface-2); color: var(--text); }
.iconbtn:active { transform: scale(0.96); }
.iconbtn svg { width: 20px; height: 20px; }
.iconbtn .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 2px var(--surface); }
.spin svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- cards & grids ---------- */
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-h .sub { color: var(--faint); font-size: 12px; }
.card-h a { font-size: 13px; font-weight: 600; text-decoration: none; }
.stack > * + * { margin-top: 16px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; min-width: 0; position: relative; overflow: hidden; }
.kpi .l { color: var(--faint); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .v { font: 600 26px/1.15 var(--display); margin-top: 6px; white-space: nowrap; }
.kpi .v small { font-size: 14px; color: var(--muted); font-weight: 500; margin-left: 2px; }
.kpi .s { color: var(--muted); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.accent { background: linear-gradient(145deg, #4c1d95, #6d28d9 70%, #7c3aed); border-color: transparent; }
.kpi.accent .l, .kpi.accent .s { color: #e4dafd; }
.kpi.signal::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--amber); }
.kpi a.cover { position: absolute; inset: 0; border-radius: 14px; }
.up { color: var(--good); } .down { color: var(--bad); }

/* ---------- alerts ---------- */
.alerts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.alerts li a, .alerts li > div { display: flex; gap: 12px; align-items: flex-start; padding: 11px 12px; border-radius: 12px; background: var(--ink-2); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 14px; line-height: 1.4; }
.alerts li a:hover { border-color: var(--lav-2); }
.alerts .ico { width: 22px; height: 22px; border-radius: 7px; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.lv-bad .ico { background: rgb(248 113 113 / 0.18); color: var(--bad); }
.lv-warn .ico { background: rgb(245 165 36 / 0.18); color: var(--amber); }
.lv-info .ico { background: rgb(125 211 252 / 0.15); color: var(--info); }
.lv-setup .ico { background: rgb(196 181 253 / 0.15); color: var(--lav); }
.empty { color: var(--muted); padding: 18px 4px; text-align: center; font-size: 14px; }
.empty b { display: block; color: var(--text); font-family: var(--display); margin-bottom: 4px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--faint); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 0 10px 10px; white-space: nowrap; }
td { padding: 11px 10px; border-top: 1px solid var(--line); vertical-align: middle; }
td.n, th.n { text-align: right; white-space: nowrap; }
tr.click { cursor: pointer; transition: background 0.12s; }
tr.click:hover td { background: var(--surface-2); }
td .who { font-weight: 600; }
td .meta { color: var(--faint); font-size: 12px; }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.c-violet { background: rgb(124 58 237 / 0.22); color: var(--lav); }
.c-amber { background: rgb(245 165 36 / 0.16); color: var(--amber-soft); }
.c-green { background: rgb(52 211 153 / 0.14); color: #a7f3d0; }
.c-red { background: rgb(248 113 113 / 0.14); color: #fecaca; }
.c-gray { background: rgb(185 174 214 / 0.12); color: var(--muted); }
.c-blue { background: rgb(125 211 252 / 0.12); color: #bae6fd; }

/* ranked lists */
.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.rank li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: 14px; }
.rank .k { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.rank .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.rank .bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--ink-2); overflow: hidden; }
.rank .bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--violet), var(--lav-2)); transform-origin: left; animation: grow 0.6s var(--ease) both; }
@keyframes grow { from { transform: scaleX(0); } }

/* funnel */
.funnel { display: grid; gap: 8px; }
.funnel .row { display: grid; grid-template-columns: 110px 1fr 56px; gap: 10px; align-items: center; font-size: 13px; }
.funnel .track { height: 26px; background: var(--ink-2); border-radius: 8px; overflow: hidden; }
.funnel .fill { height: 100%; background: linear-gradient(90deg, #5b21b6, var(--violet-2)); border-radius: 8px; display: flex; align-items: center; padding-left: 10px; font-weight: 700; font-size: 12px; min-width: 34px; transform-origin: left; animation: grow 0.6s var(--ease) both; }
.funnel .pct { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* charts */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .gridline { stroke: var(--line); stroke-width: 1; }
.chart text { fill: var(--faint); font: 11px var(--body); }
.chart .b1 { fill: var(--violet-2); }
.chart .b2 { fill: var(--lav); }
.chart .bsoft { fill: #4b3a85; }
.chart .ln { fill: none; stroke: var(--amber); stroke-width: 2; stroke-linejoin: round; }
.chart .dt { fill: var(--amber); }
.chart g.col:hover .bar, .chart g.col:focus .bar { filter: brightness(1.3); }
.chart g.col:focus { outline: none; }
.chart-tip { position: fixed; z-index: 70; pointer-events: none; background: var(--surface-2); border: 1px solid var(--lav-2); border-radius: 10px; padding: 7px 10px; font-size: 12px; white-space: nowrap; box-shadow: 0 12px 30px -10px rgb(0 0 0 / 0.6); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* health strip */
.health { display: flex; flex-wrap: wrap; gap: 8px; }
.health a { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 999px; background: var(--ink-2); border: 1px solid var(--line); color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 600; }
.health .d { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px rgb(52 211 153 / 0.18); }
.health .off .d { background: var(--bad); box-shadow: 0 0 0 3px rgb(248 113 113 / 0.2); }

/* lists (forms, reminders, feed, mail) */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.item { display: flex; gap: 12px; padding: 12px 2px; align-items: flex-start; }
.item .body { flex: 1; min-width: 0; }
.item .t { font-weight: 600; overflow-wrap: anywhere; }
.item .m { color: var(--faint); font-size: 12px; margin-top: 2px; }
.item .x { color: var(--muted); font-size: 14px; margin-top: 4px; overflow-wrap: anywhere; }
.item .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.avatar { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; font: 700 13px var(--display); background: var(--surface-2); color: var(--lav); }
.avatar svg { width: 18px; height: 18px; }
.done .t { text-decoration: line-through; color: var(--faint); }
.overdue .m { color: var(--amber); font-weight: 600; }
details.more summary { cursor: pointer; color: var(--lav); font-size: 13px; font-weight: 600; margin-top: 6px; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }

dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 10px 0 0; font-size: 14px; }
dl.kv dt { color: var(--faint); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }

/* buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 15px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; transition: background 0.15s, transform 0.1s, border-color 0.15s; white-space: nowrap; }
.btn:hover { border-color: var(--lav-2); }
.btn:active { transform: scale(0.97); }
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: var(--violet); border-color: var(--violet); color: #fff; }
.btn.primary:hover { background: var(--violet-2); }
.btn.ghost { background: transparent; }
.btn.small { min-height: 34px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn.good { background: rgb(52 211 153 / 0.16); border-color: rgb(52 211 153 / 0.35); color: #a7f3d0; }
.btn.danger { color: #fecaca; }
.btn[disabled] { opacity: 0.55; cursor: default; }
label.f { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.in { width: 100%; min-height: 42px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--ink-2); color: var(--text); font-size: 15px; }
textarea.in { min-height: 110px; resize: vertical; line-height: 1.5; }
.in:focus { outline: none; border-color: var(--lav-2); box-shadow: 0 0 0 3px rgb(167 139 250 / 0.25); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: start; }
.hint { color: var(--faint); font-size: 12px; font-weight: 500; }
.err { color: #fecaca; font-size: 13px; }

/* drawer + toasts + popover */
.scrim { position: fixed; inset: 0; background: rgb(8 4 20 / 0.6); z-index: 50; opacity: 0; transition: opacity 0.2s; }
.scrim.on { opacity: 1; }
.drawer { position: fixed; z-index: 51; top: 0; right: 0; bottom: 0; width: min(540px, 100vw); background: var(--ink-2); border-left: 1px solid var(--line); display: flex; flex-direction: column; transform: translateX(100%); transition: transform 0.28s var(--ease); }
.drawer.on { transform: none; }
.drawer header { display: flex; align-items: center; gap: 10px; padding: calc(14px + env(safe-area-inset-top)) 18px 14px; border-bottom: 1px solid var(--line); }
.drawer header h2 { flex: 1; font-size: 17px; }
.drawer .db { padding: 18px; overflow-y: auto; flex: 1; }
.drawer footer { padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.toasts { position: fixed; z-index: 60; right: 20px; bottom: 20px; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--surface-2); border: 1px solid var(--lav-2); border-radius: 14px; padding: 12px 14px; box-shadow: 0 20px 40px -12px rgb(0 0 0 / 0.6); animation: toast-in 0.28s var(--ease) both; cursor: pointer; }
.toast b { display: block; font-family: var(--display); font-size: 14px; }
.toast span { color: var(--muted); font-size: 13px; }
.toast.err-t { border-color: var(--bad); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
.pop { position: absolute; z-index: 40; right: 0; top: 50px; width: min(380px, calc(100vw - 24px)); max-height: 70vh; overflow-y: auto; background: var(--ink-2); border: 1px solid var(--line); border-radius: 14px; padding: 8px 14px; box-shadow: 0 30px 60px -20px rgb(0 0 0 / 0.7); }
.rel { position: relative; }

/* inbox */
.mail { display: grid; grid-template-columns: minmax(280px, 390px) minmax(0, 1fr); gap: 16px; align-items: start; }
.mail-list .item { cursor: pointer; padding: 11px 10px; border-radius: 10px; }
.mail-list .item:hover, .mail-list .item[aria-selected="true"] { background: var(--surface-2); }
.mail-list .unseen .t { color: #fff; }
.mail-list .unseen .t::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); margin-right: 7px; vertical-align: 2px; }
.mail-frame { width: 100%; height: 520px; border: 0; border-radius: 12px; background: #fff; }
.mail-text { white-space: pre-wrap; font-size: 14px; line-height: 1.6; background: var(--ink-2); border-radius: 12px; padding: 16px; overflow-wrap: anywhere; margin: 0; font-family: var(--body); }

/* setup card */
.setup ol { margin: 8px 0 0; padding-left: 20px; color: var(--muted); }
.setup li { margin: 6px 0; }
.setup code { background: var(--ink-2); padding: 2px 6px; border-radius: 6px; font-size: 13px; color: var(--amber-soft); overflow-wrap: anywhere; }
.skeleton { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: sk 1.2s linear infinite; border-radius: 14px; min-height: 96px; }
@keyframes sk { to { background-position: -200% 0; } }

/* tab bar (phone) */
.tabbar { display: none; }

/* ---------- tablet ---------- */
@media (max-width: 1180px) {
  .g-main, .g3, .g2 { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- phone ---------- */
@media (max-width: 760px) {
  .shell { display: block; }
  .side { display: none; }
  .top { padding: calc(10px + env(safe-area-inset-top)) 14px 10px; gap: 10px; }
  .top .mobile-logo { display: block; width: 30px; height: 30px; border-radius: 8px; flex: none; }
  .top h1 { font-size: 18px; }
  .content { padding: 14px 14px calc(var(--tabbar) + 28px + env(safe-area-inset-bottom)); }
  .card { padding: 15px; border-radius: 14px; }
  .table-wrap { margin: 0 -15px; padding: 0 15px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px 13px; }
  .kpi .v { font-size: 22px; }
  .mail { grid-template-columns: minmax(0, 1fr); }
  .mail.reading .mail-list-card { display: none; }
  .mail:not(.reading) .mail-read-card { display: none; }
  .mail-frame { height: 60vh; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: rgb(27 18 56 / 0.94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
  .tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; min-height: 50px; color: var(--faint); text-decoration: none; font-size: 11px; font-weight: 700; border-radius: 12px; }
  .tabbar a svg { width: 23px; height: 23px; }
  .tabbar a[aria-current="page"] { color: #fff; }
  .tabbar a[aria-current="page"] svg { color: var(--amber); }
  .tabbar .badge { position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; min-width: 18px; height: 18px; font-size: 11px; line-height: 18px; padding: 0 5px; }
  .toasts { left: 16px; right: 16px; width: auto; bottom: calc(var(--tabbar) + 18px + env(safe-area-inset-bottom)); }
  .funnel .row { grid-template-columns: 84px 1fr 46px; }
  .hide-phone { display: none !important; }
  /* tables collapse to cards */
  table.cards thead { display: none; }
  table.cards, table.cards tbody, table.cards tr, table.cards td { display: block; width: 100%; }
  table.cards tr { border-top: 1px solid var(--line); padding: 10px 0; }
  table.cards tr:first-child { border-top: 0; }
  table.cards td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  table.cards td::before { content: attr(data-l); color: var(--faint); font-size: 12px; font-weight: 600; text-align: left; }
  table.cards td.first { display: block; text-align: left; padding-bottom: 6px; }
  table.cards td.first::before { content: none; }
}
@media (min-width: 761px) { .only-phone { display: none !important; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
