/* Creative Jayax portal. Brand: blue #3264AD, orange #F47B20. */
:root {
  --brand: #3264ad; --brand-strong: #26508f; --brand-soft: #eaf0fa; --brand-text: #2b5aa0;
  --accent: #f47b20; --accent-soft: #fef0e4; --accent-text: #b85409;
  --bg: #f4f6fb; --surface: #ffffff; --surface-2: #f8fafd; --text: #142033; --muted: #5d6b82; --faint: #8a96aa;
  --line: #e2e7f0; --line-strong: #cfd7e4;
  --good: #16803c; --good-soft: #e5f5eb; --warn: #b45309; --warn-soft: #fdf2e3; --bad: #c0262d; --bad-soft: #fdeaea;
  --shadow: 0 1px 2px rgb(20 32 51 / 0.05), 0 4px 16px rgb(20 32 51 / 0.06);
  --shadow-lg: 0 12px 40px rgb(20 32 51 / 0.18);
  --radius: 14px; --radius-sm: 10px;
  --side-w: 256px; --tab-h: 64px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #3f72c0; --brand-strong: #5a8ad4; --brand-soft: #1a2a46; --brand-text: #8db2ef;
    --accent: #f68a38; --accent-soft: #3a2614; --accent-text: #f8a868;
    --bg: #0c1220; --surface: #141c2d; --surface-2: #182236; --text: #e8edf6; --muted: #9aa8bf; --faint: #6f7d95;
    --line: #243049; --line-strong: #2f3d5a;
    --good: #4ade80; --good-soft: #15291d; --warn: #fbbf24; --warn-soft: #2e2512; --bad: #f87171; --bad-soft: #341b1d;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 4px 16px rgb(0 0 0 / 0.25);
    --shadow-lg: 0 12px 40px rgb(0 0 0 / 0.5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 17px; margin: 0; }
h3 { font-size: 15px; margin: 0; }
p { margin: 0 0 8px; }
small, .muted { color: var(--muted); }
.faint { color: var(--faint); }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; border-radius: 6px; }

/* ---------- app shell ---------- */
.sidebar, .topbar, .tabbar { display: none; }
body.mode-app .sidebar { display: flex; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--side-w); flex-direction: column; gap: 8px; padding: 18px 14px;
  background: var(--surface); border-right: 1px solid var(--line); z-index: 20; }
.side-brand { display: block; background: #fff; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 10px; box-shadow: var(--shadow); }
.side-brand img { display: block; width: 100%; height: auto; max-width: 190px; margin: 0 auto; }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 600; }
.side-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.side-nav a.active { background: var(--brand-soft); color: var(--brand-text); }
.side-nav a.active svg { stroke: var(--brand-text); }
.side-nav .nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 14px 12px 4px; font-weight: 700; }
.side-user { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.who { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--radius-sm); color: var(--text); }
.who:hover { background: var(--surface-2); text-decoration: none; }
.who .meta { min-width: 0; }
.who .meta b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who .meta small { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700; font-size: 14px;
  background: linear-gradient(135deg, var(--accent), #f9a35a); color: #fff; }

.view { min-height: 100vh; padding: 32px clamp(16px, 4vw, 40px) 48px; max-width: 1240px; outline: none; }
body.mode-app .view { margin-left: var(--side-w); }

/* phones and small tablets */
@media (max-width: 899px) {
  body.mode-app .sidebar { display: none; }
  body.mode-app .view { margin-left: 0; padding: 16px 16px calc(var(--tab-h) + 28px + env(safe-area-inset-bottom)); }
  body.mode-app .topbar { display: flex; }
  body.mode-app .tabbar { display: flex; }
  h1 { font-size: 22px; }
}
.topbar { position: sticky; top: 0; z-index: 20; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.top-brand { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 600; color: var(--brand-text); }
.top-brand:hover { text-decoration: none; }
.top-brand img { width: 34px; height: 34px; }
.top-brand b { color: var(--accent); font-weight: 700; margin-left: 2px; }
.top-account .avatar { width: 38px; height: 38px; }
.tabbar { position: fixed; inset: auto 0 0 0; z-index: 20; height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-top: 1px solid var(--line); justify-content: space-around; }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--faint); min-width: 0; }
.tabbar a:hover { text-decoration: none; }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.active { color: var(--brand-text); }
.tabbar a.active svg { stroke: var(--brand-text); }

/* ---------- page parts ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .sub { margin: 4px 0 0; color: var(--muted); }
.crumb { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.card-head h2 svg { color: var(--brand-text); }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); }
.grid > .card { margin-bottom: 0; }
.stack > * + * { margin-top: 18px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 168px), 1fr)); gap: 14px; margin-bottom: 18px; }
@media (max-width: 599px) { .kpis { grid-template-columns: 1fr 1fr; gap: 10px; } .kpis .kpi.hero { grid-column: 1 / -1; } .kpi { padding: 14px; } .kpi .value { font-size: 22px; } }
.kpi { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); overflow: hidden; }
.kpi .ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); margin-bottom: 10px; }
.kpi.accent .ico { background: var(--accent-soft); color: var(--accent-text); }
.kpi .label { color: var(--muted); font-size: 13px; font-weight: 600; }
.kpi .value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 13px; color: var(--muted); }
.kpi.hero { background: linear-gradient(135deg, var(--brand) 0%, #2a548f 100%); color: #fff; border-color: transparent; }
.kpi.hero .label, .kpi.hero .sub { color: rgb(255 255 255 / .82); }
.kpi.hero .ico { background: rgb(255 255 255 / .16); color: #fff; }
.kpi.hero::after { content: ""; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%; background: var(--accent); opacity: .9; }
.kpi.hero > * { position: relative; z-index: 1; }

.info { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 14px 24px; }
.info div > span { display: block; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.note { background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); padding: 10px 12px; color: var(--muted); margin-top: 14px; font-size: 14px; }

/* ---------- buttons ---------- */
.btn { font: inherit; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  cursor: pointer; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: var(--brand); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); background: var(--bad-soft); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn svg { width: 18px; height: 18px; }
.icon-btn { font: inherit; width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); font-size: 26px; line-height: 1; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* ---------- badges, chips, score ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.info { background: var(--brand-soft); color: var(--brand-text); border-color: transparent; }
.badge.accent { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font: inherit; font-size: 13px; font-weight: 600; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); cursor: pointer; }
.chip:hover { color: var(--text); }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.score { display: inline-flex; align-items: center; gap: 10px; min-width: 130px; font-weight: 700; font-variant-numeric: tabular-nums; }
.score .bar { flex: 1; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; min-width: 70px; }
.score .bar span { display: block; height: 100%; border-radius: 99px; }
.tierbar { display: flex; flex-direction: column; gap: 14px; }
.tierbar .row { display: grid; grid-template-columns: 110px 1fr auto; gap: 12px; align-items: center; }
.tierbar .track { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; }
.tierbar .fill { height: 100%; background: var(--brand); border-radius: 99px; }
.tierbar .row:nth-child(3) .fill { background: var(--accent); }

/* ---------- tables (turn into cards on phones) ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table.rtable { width: 100%; border-collapse: separate; border-spacing: 0; }
.rtable th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-weight: 700; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.rtable td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.rtable tr:last-child td { border-bottom: 0; }
.rtable .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rtable .nowrap { white-space: nowrap; }
.rtable tr.click { cursor: pointer; }
.rtable tr.click:hover td { background: var(--surface-2); }
.rtable td.primary { font-weight: 600; }
.rtable .row-actions { display: flex; gap: 6px; justify-content: flex-end; }
@media (max-width: 719px) {
  .table-wrap { overflow: visible; margin: 0; }
  .rtable thead { display: none; }
  .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; width: 100%; }
  .rtable tr { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 10px; background: var(--surface); }
  .rtable tr.click:hover td { background: transparent; }
  .rtable tr.click:active { background: var(--surface-2); }
  .rtable td { border: 0; padding: 5px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; min-height: 30px; }
  .rtable td::before { content: attr(data-label); color: var(--muted); font-size: 13px; font-weight: 600; text-align: left; flex: none; }
  .rtable td.primary { font-size: 16px; text-align: left; padding: 2px 0 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
  .rtable td.primary::before { display: none; }
  .rtable td.num { text-align: right; }
  .rtable td.empty-cell { display: none; }
  .rtable .row-actions { width: 100%; justify-content: flex-start; padding-top: 6px; }
  .rtable td.actions-cell::before { display: none; }
}

/* ---------- lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list a.row { display: flex; align-items: center; gap: 12px; color: inherit; flex: 1; min-width: 0; }
.list a.row:hover { text-decoration: none; }
.list a.row:hover .title { color: var(--brand-text); }
.list .title { font-weight: 600; }

/* switches */
.switch { position: relative; display: inline-block; width: 46px; height: 28px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--line-strong); border-radius: 99px; transition: background .2s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .25); transition: transform .2s; }
.switch input:checked + span { background: var(--good); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:disabled { cursor: default; }
.switch input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }

/* ---------- forms ---------- */
input, select, textarea { font: inherit; font-size: 16px; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; min-height: 44px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; accent-color: var(--brand); }
textarea { min-height: 96px; resize: vertical; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search input { padding-left: 40px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field > label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field.check { flex-direction: row; align-items: center; gap: 10px; }
.field.check label { color: var(--text); font-size: 15px; }
.field .hint { font-size: 12px; color: var(--faint); }
.error { color: var(--bad); font-size: 14px; font-weight: 600; min-height: 1.2em; margin: 10px 0 0; }
.error:empty { display: none; }

/* ---------- dialogs: centered on PC, bottom sheet on phones ---------- */
dialog.sheet { border: 0; padding: 0; border-radius: 18px; background: var(--surface); color: var(--text); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); box-shadow: var(--shadow-lg); }
dialog.sheet::backdrop { background: rgb(10 16 30 / .5); backdrop-filter: blur(2px); }
dialog.sheet > form, #info-body { padding: 22px; display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
#form-fields { overflow-y: auto; padding: 2px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -6px -8px 14px 0; }
.sheet-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
@media (max-width: 599px) {
  dialog.sheet { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 20px 20px 0 0; max-height: 92vh; }
  dialog.sheet[open] { animation: sheet-up .22s ease-out; }
  dialog.sheet > form, #info-body { max-height: 92vh; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .form-grid { grid-template-columns: 1fr; }
  .sheet-foot .btn { flex: 1; }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }

/* ---------- sign-in screens ---------- */
body.mode-auth .view { max-width: none; padding: 0; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); min-height: 100vh; }
.auth-brand { background: #3264ad; color: #fff; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 48px; position: relative; overflow: hidden; }
.auth-brand img { width: min(460px, 90%); height: auto; position: relative; z-index: 1; }
.auth-brand p { position: relative; z-index: 1; max-width: 420px; text-align: center; color: rgb(255 255 255 / .85); margin-top: 24px; font-size: 16px; }
.auth-brand::before { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; background: #f47b20; opacity: .14; right: -180px; bottom: -220px; }
.auth-brand::after { content: ""; position: absolute; width: 300px; height: 300px; border-radius: 50%; border: 2px solid rgb(255 255 255 / .12); left: -90px; top: -90px; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .mobile-logo { display: none; }
.auth-card h1 { margin-bottom: 6px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; margin-top: 24px; }
.auth-card .field > label { color: var(--text); }
.auth-foot { margin-top: 28px; font-size: 13px; color: var(--faint); display: flex; align-items: center; gap: 6px; }
.code-input { font-size: 24px; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
@media (max-width: 899px) {
  body.mode-auth .view { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-panel { align-items: flex-start; padding: calc(32px + env(safe-area-inset-top)) 20px 32px; }
  .auth-card .mobile-logo { display: block; width: 210px; margin: 0 auto 28px; background: #fff; padding: 12px 16px; border-radius: var(--radius); box-shadow: var(--shadow); }
}

/* two-factor setup */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 22px; }
.steps > li { position: relative; padding-left: 44px; }
.steps > li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.qr { width: 200px; height: 200px; padding: 10px; background: #fff; border-radius: 12px; border: 1px solid var(--line); margin: 12px 0; }
.qr svg { width: 100%; height: 100%; display: block; }
.secret { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 15px; background: var(--surface-2); border: 1px solid var(--line); padding: 8px 12px; border-radius: 8px; word-break: break-all; user-select: all; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 14px 0; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 16px; }
.codes span { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px; text-align: center; user-select: all; }

/* ---------- public policy pages ---------- */
.legal-page { background: var(--surface); }
.legal-top { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; max-width: 1040px; margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top)) 20px 16px; border-bottom: 1px solid var(--line); }
.legal-logo { background: #fff; border-radius: 12px; padding: 6px 10px; display: inline-block; }
.legal-logo img { height: 46px; width: auto; display: block; }
.legal-top nav { display: flex; align-items: center; gap: 4px 16px; flex-wrap: wrap; }
.legal-top nav a:not(.btn) { color: var(--muted); font-weight: 600; font-size: 14px; }
.legal-top nav a[aria-current="page"] { color: var(--brand-text); }
.legal { max-width: 760px; margin: 0 auto; padding: 36px 20px 56px; font-size: 16px; line-height: 1.65; }
.legal h1 { font-size: clamp(28px, 5vw, 36px); }
.legal h2 { font-size: 20px; margin: 36px 0 10px; padding-top: 4px; }
.legal h3 { font-size: 16px; margin: 22px 0 6px; }
.legal p, .legal li { color: var(--text); }
.legal ul { padding-left: 22px; margin: 8px 0 12px; }
.legal li { margin: 4px 0; }
.legal code { font-size: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.legal .updated { color: var(--faint); font-size: 14px; margin-top: 6px; }
.legal .lead { font-size: 18px; color: var(--muted); margin: 18px 0 8px; }
.legal .rtable { margin: 10px 0 14px; font-size: 15px; }
.legal .rtable td { vertical-align: top; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 12px; margin: 26px 0; }
.feature { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; background: var(--surface-2); border-top: 3px solid var(--brand); }
.feature:nth-child(even) { border-top-color: var(--accent); }
.feature p { margin: 6px 0 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.legal-foot { max-width: 1040px; margin: 0 auto; padding: 20px 20px calc(28px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; color: var(--faint); font-size: 14px; }
.legal-foot nav { display: flex; gap: 16px; }
.policy-links { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; margin-top: 10px; }
.policy-links a { color: var(--faint); }
.side-user .policy-links { padding: 0 8px; }

/* misc */
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.empty svg { width: 36px; height: 36px; color: var(--faint); margin-bottom: 6px; }
.empty p { margin: 0; }
.loading { display: grid; place-items: center; min-height: 50vh; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-text); margin-bottom: 18px; font-weight: 600; }
.banner.info { background: var(--brand-soft); color: var(--brand-text); }
#toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: #142033; color: #fff;
  padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 899px) { body.mode-app #toast { bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
