/* CopyTrader — design system. Tokens first; components below. Chart colours follow the dataviz palette:
   blue = profit / primary series, red = loss (a colour-blind-safe pair); a glyph or label always accompanies colour. */

:root {
  color-scheme: light;
  --bg: #f3f4f7; --card: #ffffff; --card-2: #f6f7f9; --line: #e1e4ea; --line-2: #cfd4dd;
  --text: #131a27; --text-2: #465063; --muted: #6a7587;
  --accent: #256abf; --accent-hover: #1c5cab; --accent-ink: #ffffff; --accent-soft: #e6f0fc; --link: #1c5cab;
  --profit: #2a78d6; --loss: #e34948; --neutral: #9aa3b2;
  --ok: #0ca30c; --ok-text: #0a6b0a; --ok-soft: #e4f5e4;
  --warn: #fab219; --warn-text: #8a5a00; --warn-soft: #fff4dc;
  --bad: #d03b3b; --bad-text: #b02a2a; --bad-soft: #fdecec;
  --live: #d03b3b; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.06);
  --side-bg: #0f1522; --side-text: #c9d1e0; --side-muted: #7f8aa0; --side-active: #1b2740; --side-line: #1f2a40;
  --grid: #e9ecf1; --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #0c1017; --card: #151b25; --card-2: #1a212d; --line: #263042; --line-2: #33405a;
    --text: #e8ebf1; --text-2: #b6bfce; --muted: #8b96a9;
    --accent: #3987e5; --accent-hover: #5598e7; --accent-ink: #08101e; --accent-soft: #16263d; --link: #6da7ec;
    --profit: #3987e5; --loss: #e66767; --neutral: #66718a;
    --ok: #3cc796; --ok-text: #4fd3a4; --ok-soft: #10261f;
    --warn: #f0a04b; --warn-text: #f0b567; --warn-soft: #2a2010;
    --bad: #f2705c; --bad-text: #f58c7b; --bad-soft: #2d1614;
    --live: #f2705c; --shadow: none;
    --side-bg: #090d14; --side-text: #c5cddc; --side-muted: #7a869c; --side-active: #16203a; --side-line: #182036;
    --grid: #1f2836;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c1017; --card: #151b25; --card-2: #1a212d; --line: #263042; --line-2: #33405a;
  --text: #e8ebf1; --text-2: #b6bfce; --muted: #8b96a9;
  --accent: #3987e5; --accent-hover: #5598e7; --accent-ink: #08101e; --accent-soft: #16263d; --link: #6da7ec;
  --profit: #3987e5; --loss: #e66767; --neutral: #66718a;
  --ok: #3cc796; --ok-text: #4fd3a4; --ok-soft: #10261f;
  --warn: #f0a04b; --warn-text: #f0b567; --warn-soft: #2a2010;
  --bad: #f2705c; --bad-text: #f58c7b; --bad-soft: #2d1614;
  --live: #f2705c; --shadow: none;
  --side-bg: #090d14; --side-text: #c5cddc; --side-muted: #7a869c; --side-active: #16203a; --side-line: #182036;
  --grid: #1f2836;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 650; } h2 { font-size: 16px; font-weight: 650; } h3 { font-size: 14px; font-weight: 650; }
p { margin: 0 0 8px; }
a { color: var(--link); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .strong { font-weight: 650; }
.mono { font-family: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace; font-size: 12.5px; }
.right { text-align: right; } .nowrap { white-space: nowrap; } .grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.tight { gap: 6px; } .row.between { justify-content: space-between; } .col { display: flex; flex-direction: column; gap: 10px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.mt { margin-top: 14px; } .mt-s { margin-top: 8px; } .mb { margin-bottom: 14px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side-bg); color: var(--side-text); display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 700; font-size: 17px; color: #fff; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; color: var(--accent-ink); }
.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 9px; color: var(--side-text); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--side-active); }
.nav a[aria-current="page"] { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav .sep { height: 1px; background: var(--side-line); margin: 10px 6px; }
.side-foot { margin-top: auto; border-top: 1px solid var(--side-line); padding: 14px 8px 0; display: flex; flex-direction: column; gap: 10px; }
.side-foot .who { font-size: 12.5px; color: var(--side-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot .who b { display: block; color: #fff; font-weight: 600; font-size: 13.5px; }
.side-status { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 8px 10px; border-radius: 8px; background: var(--side-active); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--neutral); flex: none; }
.dot.ok { background: var(--ok); } .dot.live { background: var(--live); box-shadow: 0 0 0 3px rgba(208,59,59,.25); } .dot.warn { background: var(--warn); }
.main { padding: 26px 30px 60px; max-width: 1240px; width: 100%; }
.topbar { display: none; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.side-close, .side-overlay { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 30; left: 0; top: 0; width: 264px; transform: translateX(-105%); transition: transform .2s; }
  .shell.nav-open .side { transform: none; }
  .shell.nav-open .side-overlay { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 20; }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
  .main { padding: 18px 16px 50px; }
}

/* ---------- cards & basics ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card > h2, .card-head h2 { margin-bottom: 4px; }
.card-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-head p { margin: 2px 0 0; }
.sub { color: var(--muted); font-size: 13px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; border: 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; border: 1px solid var(--line-2); color: var(--text-2); white-space: nowrap; }
.pill.ok { color: var(--ok-text); border-color: var(--ok); background: var(--ok-soft); }
.pill.warn { color: var(--warn-text); border-color: var(--warn); background: var(--warn-soft); }
.pill.bad { color: var(--bad-text); border-color: var(--bad); background: var(--bad-soft); }
.pill.live { color: #fff; background: var(--live); border-color: var(--live); }
.pill.info { color: var(--link); border-color: var(--accent); background: var(--accent-soft); }
.badge { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; background: var(--card-2); color: var(--muted); border: 1px solid var(--line); }

/* ---------- buttons & inputs ---------- */
button { font: inherit; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 14px; min-height: 36px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--card); color: var(--text); cursor: pointer; font-weight: 550; text-decoration: none; }
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { background: var(--live); color: #fff; border-color: var(--live); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--link); padding: 6px 8px; }
.btn.small { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.btn svg { width: 16px; height: 16px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; min-height: 36px; min-width: 0; max-width: 100%; }
textarea { width: 100%; min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
input:disabled, select:disabled { opacity: .55; }
input[type="checkbox"], input[type="radio"] { min-height: 0; width: 17px; height: 17px; accent-color: var(--accent); }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 550; }
label.f input, label.f select { font-weight: 400; }
label.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.field-help { font-size: 12px; color: var(--muted); font-weight: 400; }
.switch { position: relative; width: 42px; height: 24px; flex: none; display: inline-block; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; background: var(--line-2); border-radius: 99px; transition: background .15s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--accent); } .switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + span { opacity: .5; }
.switch.danger input:checked + span { background: var(--live); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; background: var(--card); }
.seg button { border: 0; background: transparent; color: var(--text-2); padding: 7px 13px; cursor: pointer; font-weight: 550; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--link); }
.seg button:disabled { opacity: .45; cursor: not-allowed; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; color: var(--muted); cursor: pointer; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--link); border-bottom-color: var(--accent); }

/* ---------- messages ---------- */
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card-2); margin-bottom: 14px; }
.banner.info { background: var(--accent-soft); border-color: var(--accent); }
.banner.ok { background: var(--ok-soft); border-color: var(--ok); color: var(--ok-text); }
.banner.warn { background: var(--warn-soft); border-color: var(--warn); color: var(--warn-text); }
.banner.bad { background: var(--bad-soft); border-color: var(--bad); color: var(--bad-text); }
.banner svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.banner .grow > :last-child { margin-bottom: 0; }
.err-inline { color: var(--bad-text); background: var(--bad-soft); border: 1px solid var(--bad); border-radius: 8px; padding: 8px 12px; margin-top: 8px; font-weight: 500; }
.ok-inline { color: var(--ok-text); font-weight: 550; }
.conn-bar { position: sticky; top: 0; z-index: 100; padding: 10px 16px; background: var(--bad); color: #fff; font-weight: 600; text-align: center; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--text); color: var(--bg); padding: 11px 15px; border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.25); font-weight: 550; }
.toast.bad { background: var(--bad); color: #fff; }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty h3 { color: var(--text); margin-bottom: 4px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; font-weight: 650; color: var(--muted); text-transform: none; white-space: nowrap; background: var(--card-2); }
tbody tr:hover td { background: var(--card-2); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- stat tiles ---------- */
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat .label { font-size: 12.5px; color: var(--muted); font-weight: 550; }
.stat .value { font-size: 26px; font-weight: 650; margin-top: 2px; letter-spacing: -.01em; }
.stat .hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat.hero .value { font-size: 48px; line-height: 1.1; }
.up { color: var(--text); } .glyph-up { color: var(--profit); } .glyph-down { color: var(--loss); }
.pnl { font-variant-numeric: tabular-nums; }

/* ---------- auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-hero { background: linear-gradient(160deg, #0f1522 0%, #16294d 60%, #1c4a8a 100%); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: center; gap: 22px; }
.auth-hero h1 { font-size: 34px; line-height: 1.15; } .auth-hero p { color: #c5d3ec; font-size: 16px; }
.auth-hero ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.auth-hero li { display: flex; gap: 12px; align-items: flex-start; color: #dbe6fb; }
.auth-hero li svg { width: 20px; height: 20px; flex: none; margin-top: 2px; color: #7fb2f5; }
.auth-panel { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 14px; }
.auth-card h1 { font-size: 24px; }
@media (max-width: 860px) { .auth-wrap { grid-template-columns: 1fr; } .auth-hero { display: none; } }

/* ---------- copier ---------- */
.flow { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.5fr); gap: 16px; align-items: center; }
.flow .arrow { color: var(--muted); font-size: 26px; }
@media (max-width: 800px) { .flow { grid-template-columns: 1fr; } .flow .arrow { transform: rotate(90deg); text-align: center; } }
.acct { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--card-2); }
.acct.leader { border-color: var(--accent); background: var(--accent-soft); }
.acct .name { font-weight: 650; overflow-wrap: anywhere; }
.follower { border: 1px solid var(--line); border-radius: 12px; background: var(--card); margin-bottom: 12px; }
.follower-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 12px 14px; }
.follower-body { border-top: 1px solid var(--line); padding: 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.follower-body h4 { font-size: 13px; margin-bottom: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.savebar { position: sticky; bottom: 14px; z-index: 15; margin-top: 16px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
.savebar .btn { border-color: transparent; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; counter-reset: s; }
.step { border: 1px dashed var(--line-2); border-radius: 10px; padding: 12px; counter-increment: s; }
.step::before { content: counter(s); display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 12px; margin-bottom: 6px; }
.step.done { border-style: solid; border-color: var(--ok); } .step.done::before { content: "✓"; background: var(--ok); color: #fff; }
.logbox { background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; height: 260px; overflow: auto; }
.logbox .lvl-WARNING { color: var(--warn-text); } .logbox .lvl-ERROR, .logbox .lvl-CRITICAL { color: var(--bad-text); }
.platforms { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.platform { border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.platform.off { opacity: .75; background: var(--card-2); }

/* ---------- home / market ---------- */
.quote { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--card); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.quote .sym { font-weight: 650; } .quote .nm { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote .px { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; }
.quote svg.spark { width: 100%; height: 34px; }
.news a { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); }
.news a:last-child { border-bottom: 0; } .news a:hover .t { color: var(--link); text-decoration: underline; }
.news .t { font-weight: 550; } .news .m { font-size: 12px; color: var(--muted); }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis text { fill: var(--muted); font-size: 11.5px; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--line-2); stroke-width: 1; }
.chart .series-line { fill: none; stroke: var(--profit); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart .series-area { fill: var(--profit); opacity: .1; }
.chart .dot { fill: var(--profit); stroke: var(--card); stroke-width: 2; }
.chart .bar-pos { fill: var(--profit); } .chart .bar-neg { fill: var(--loss); } .chart .bar-flat { fill: var(--neutral); }
.chart .bar { transition: opacity .1s; } .chart .bar:hover, .chart .bar:focus { opacity: .8; outline: none; stroke: var(--text); stroke-width: 1; }
.chart .crosshair { stroke: var(--line-2); stroke-width: 1; }
.chart .end-label { fill: var(--text); font-size: 12px; font-weight: 650; }
.chart .val-label { fill: var(--text-2); font-size: 11.5px; }
.chart .cat-label { fill: var(--text-2); font-size: 12px; }
.tip { position: absolute; pointer-events: none; z-index: 5; background: var(--card); border: 1px solid var(--line-2); border-radius: 9px; padding: 8px 11px; box-shadow: 0 6px 20px rgba(0,0,0,.18); font-size: 12.5px; min-width: 130px; transform: translate(-50%, -100%); }
.tip .tv { font-size: 15px; font-weight: 700; } .tip .tl { color: var(--muted); }
.tip .key { display: inline-block; width: 12px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; background: var(--profit); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.loading-dim { opacity: .5; transition: opacity .15s; pointer-events: none; }

/* ---------- misc ---------- */
.copyfield { display: flex; gap: 8px; } .copyfield input { flex: 1; }
.meter { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; } .meter > i { display: block; height: 100%; background: var(--accent); }
.plan { border: 2px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 10px; background: var(--card); }
.plan.current { border-color: var(--accent); }
.plan .price { font-size: 30px; font-weight: 700; } .plan .price small { font-size: 13px; color: var(--muted); font-weight: 500; }
.plan ul { padding-left: 18px; margin: 0; color: var(--text-2); flex: 1; }
.creditcard { border-radius: 14px; padding: 18px 20px; color: #fff; background: linear-gradient(135deg, #1c3f78, #2a78d6); max-width: 340px; }
.creditcard .num { font-size: 19px; letter-spacing: .12em; margin: 22px 0 10px; }
.modal-bg { position: fixed; inset: 0; background: rgba(6,10,18,.6); display: grid; place-items: center; padding: 16px; z-index: 150; }
.modal { background: var(--card); border: 1px solid var(--line-2); border-radius: 14px; padding: 22px; max-width: 480px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.4); max-height: 90vh; overflow: auto; }
.modal.live { border: 2px solid var(--live); }
.ticket { padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; display: flex; gap: 10px; align-items: center; }
.ticket:hover { background: var(--card-2); } .ticket[aria-current="true"] { background: var(--accent-soft); }
.msg { padding: 10px 14px; border-radius: 12px; max-width: 88%; margin-bottom: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.user { background: var(--accent-soft); margin-left: auto; } .msg.staff { background: var(--card-2); border: 1px solid var(--line); }
details.faq { border-bottom: 1px solid var(--line); padding: 10px 0; } details.faq summary { cursor: pointer; font-weight: 600; }
details.faq p { margin: 8px 0 0; color: var(--text-2); }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 22px; font-weight: 700; }
.lock-hero { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.lock-hero.locked { border-color: var(--bad); background: var(--bad-soft); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .side, .topbar, .toasts { display: none; } .shell { display: block; } }

/* dropdown (account picker) */
.dd { position: relative; } .dd summary { list-style: none; cursor: pointer; } .dd summary::-webkit-details-marker { display: none; }
.dd-panel { position: absolute; z-index: 25; top: calc(100% + 6px); left: 0; min-width: 280px; max-height: 320px; overflow: auto; background: var(--card); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); display: flex; flex-direction: column; gap: 8px; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 16px; }

/* fixes from visual review */
.stat.hero { grid-column: span 2; }
.stat .value .glyph-up, .stat .value .glyph-down { font-size: .5em; vertical-align: .3em; margin-right: 4px; }
.form-grid { align-items: end; }
.follower-body .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row.nowrap-row { flex-wrap: nowrap; align-items: flex-start; }
td.nowrap { white-space: nowrap; }
@media (max-width: 520px) { .stat.hero { grid-column: auto; } .stat.hero .value { font-size: 38px; } }
.follower-body .form-grid { align-items: start; }

/* ---- legal pages, manual, public layout, security UI ---- */
.tab-link { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; }
.tab-link:hover { color: var(--text); }
.tab-link[aria-selected="true"] { color: var(--link); border-bottom-color: var(--accent); }
.doc-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; }
.toc { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 4px; max-height: calc(100vh - 32px); overflow: auto; }
.toc h3 { margin-bottom: 6px; }
.toc a { color: var(--text-2); text-decoration: none; font-size: 13px; padding: 4px 6px; border-radius: 6px; }
.toc a:hover { background: var(--accent-soft); color: var(--link); }
.doc h1 { margin-bottom: 4px; }
.doc h2 { margin: 22px 0 8px; font-size: 18px; scroll-margin-top: 16px; }
.doc h3 { margin: 14px 0 6px; font-size: 15px; }
.doc p, .doc li { line-height: 1.6; color: var(--text); max-width: 78ch; }
.doc ul, .doc ol { padding-left: 22px; margin: 8px 0; }
.doc li { margin: 4px 0; }
.doc .table-wrap { margin: 10px 0; }
.doc td, .doc th { vertical-align: top; }
.manual .doc { margin-bottom: 16px; }
.public-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--card); }
.public-head .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); text-decoration: none; }
.public-page { max-width: 1100px; margin: 0 auto; padding: 24px 16px; }
.site-foot { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; padding: 20px 16px; margin-top: 24px; border-top: 1px solid var(--line); font-size: 13px; }
.site-foot a { color: var(--muted); }
.site-foot a:hover { color: var(--link); }
.legal-links { text-align: center; }
.checks { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-direction: column; gap: 6px; }
.checks li { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.checks .ck { flex: none; width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; margin-top: 2px; }
.checks .ok .ck { background: var(--ok-soft); color: var(--ok-text); }
.checks .warn .ck { background: var(--warn-soft); color: var(--warn-text); }
.checks .fail .ck { background: var(--bad-soft); color: var(--bad-text); }
.codes { background: var(--card-2); border: 1px solid var(--line); border-radius: 8px; padding: 14px; font-size: 15px; letter-spacing: .06em; line-height: 1.9; text-align: center; user-select: all; }
.qr { background: #fff; padding: 8px; border-radius: 8px; border: 1px solid var(--line); }
.captcha { min-height: 65px; display: flex; justify-content: center; }
@media (max-width: 860px) { .doc-layout { grid-template-columns: 1fr; } .toc { position: static; max-height: 260px; } }
@media print { .side, .topbar, .site-foot, .toc, .tabs, .public-head, .page-head .btn { display: none !important; } .doc-layout { display: block; } .card { border: 0; box-shadow: none; } }
.auth-card label.check, .modal label.check { align-items: flex-start; }
.auth-card label.check input, .modal label.check input { margin-top: 3px; flex: none; }
@media (max-width: 860px) { .doc-layout { grid-template-columns: minmax(0, 1fr); } .doc, .toc { min-width: 0; } .doc .table-wrap { overflow-x: auto; } }
