:root {
  --accent-2: #6ea8fe;
  --border-2: #2f3d55;
  --bg: #0b0e14;
  --panel: #121722;
  --panel-2: #182030;
  --border: #243044;
  --text: #e6ebf3;
  --muted: #8b97ab;
  --accent: #3d8bfd;
  --green: #22c55e;
  --red: #ef4444;
  --amber: #f59e0b;
  --radius: 10px;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 20px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 24px 0 10px; }
h3 { font-size: 14px; margin: 16px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.hidden { display: none !important; }

/* layout */
.topbar { display: flex; align-items: center; gap: clamp(12px, 1.6vw, 26px); padding: 12px clamp(14px, 1.8vw, 28px); min-height: 68px; background: var(--panel);
  border-bottom: 1px solid var(--border); z-index: 10; }
/* Brand lockup (DimaChain proportions): icon + wordmark, tagline under it
   sized by JS to exactly the same width (App.fitTagline). */
.brand { display: inline-flex; flex-direction: column; align-items: flex-start; text-decoration: none !important; flex-shrink: 0; }
.brand-row { display: flex; align-items: center; gap: 9px; }
.brand-logo { width: 30px; height: 30px; border-radius: 7px; display: block; flex-shrink: 0; }
.wm { font-weight: 800; font-size: 24px; letter-spacing: -0.005em; line-height: 1; white-space: nowrap; }
.wm-1 { color: #1E90FF; }
.wm-2 { color: #FFFFFF; }
.brand-sub { display: inline-block; margin-top: 5px; font-size: 13.5px; font-weight: 600; line-height: 1.25; color: rgba(255,255,255,0.7); white-space: nowrap; }
.nav { display: flex; gap: clamp(0px, 0.25vw, 4px); flex: 1; flex-wrap: nowrap; min-width: 0; }  /* always one line */
.nav { font-size: 15px; }  /* set by App.fitNav to fill the free width */
.nav a { color: var(--muted); padding: 0.45em 0.75em; border-radius: 8px; white-space: nowrap; font-size: 1em; font-weight: 500; }
.nav a.active, .nav a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.userbox { display: flex; gap: 12px; align-items: center; white-space: nowrap; flex-shrink: 0; }
.bell { position: relative; }
.bell .count { position: absolute; top: -6px; right: -8px; background: var(--red); color: #fff; border-radius: 9px;
  font-size: 10px; padding: 1px 5px; }
main { padding: 20px; max-width: 1500px; margin: 0 auto; }

/* Phones / small tablets: the menu collapses behind a ☰ button and opens as a
   full-width list under the top bar. */
.topbar .nav-toggle { display: none; }
@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; gap: 10px; min-height: 0; padding: 10px 14px; }
  .userbox { margin-left: auto; gap: 8px; }
  .topbar .nav-toggle { display: inline-flex; flex-shrink: 0; }
  .nav-toggle[aria-expanded="true"] { background: var(--panel-2); border-color: var(--border-2); }
  .nav { display: none; order: 10; flex: 0 0 100%; flex-direction: column; gap: 2px; font-size: 16px !important;
    border-top: 1px solid var(--border); padding-top: 8px; }
  .topbar.nav-open .nav { display: flex; }
  .nav a { padding: 11px 12px; }
  main { padding: 16px 14px; }
}
@media (max-width: 480px) {
  .brand-sub { display: none; }
  .wm { font-size: 21px; }
  .brand-logo { width: 28px; height: 28px; }
  .userbox .btn { padding: 6px 10px; }
  .userbox .btn.primary-link { display: none; }  /* "Create account" stays reachable via Log in + the home page CTA */
}

.prod-banner { background: #3b1d0b; color: #fed7aa; border-bottom: 1px solid #7c2d12; padding: 8px 20px; font-size: 13px; }
.halt-banner { background: #450a0a; color: #fecaca; padding: 8px 20px; font-weight: 600; }

/* cards / tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.tile { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.tile .label { color: var(--muted); font-size: 12px; }
.tile .value { font-size: 20px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 12px; background: var(--panel-2); position: sticky; top: 0; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; }
.empty { padding: 18px; color: var(--muted); text-align: center; }

/* badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: var(--panel-2); color: var(--muted); border: 1px solid var(--border); }
.badge.green { color: var(--green); border-color: #14532d; background: #052e16; }
.badge.red { color: #fca5a5; border-color: #7f1d1d; background: #2a0a0a; }
.badge.amber { color: #fcd34d; border-color: #78350f; background: #2a1a05; }
.badge.gold { color: #f3d36b; border-color: #8a6d1a; background: #2a2205; }
.badge.blue { color: #93c5fd; border-color: #1e3a8a; background: #0b1a3a; }

/* forms */
label { display: block; color: var(--muted); font-size: 12px; margin: 10px 0 4px; }
input, select, textarea { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; font: inherit; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
input[type=checkbox] { width: auto; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 14px; }
@media (max-width: 800px) { .grid2, .grid3, .grid4 { grid-template-columns: 1fr; } }
.check { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: 13px; margin-top: 12px; }
.help { color: var(--muted); font-size: 12px; margin-top: 4px; }

button, .btn { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 12px; font: inherit; cursor: pointer; white-space: nowrap; display: inline-block; }
button:hover, .btn:hover { border-color: var(--accent); text-decoration: none; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { background: #7f1d1d; border-color: #991b1b; color: #fee2e2; }
button.warn { background: #78350f; border-color: #92400e; color: #fef3c7; }
button.sm { padding: 3px 8px; font-size: 12px; }
button:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 6px; flex-wrap: nowrap; align-items: center; }
.actions > * { flex-shrink: 0; }

.alert { padding: 10px 12px; border-radius: 8px; margin: 10px 0; border: 1px solid var(--border); white-space: pre-line; }
.alert.error { background: #2a0a0a; border-color: #7f1d1d; color: #fecaca; }
.alert.warn { background: #2a1a05; border-color: #78350f; color: #fde68a; }
.alert.ok { background: #052e16; border-color: #14532d; color: #bbf7d0; }
.alert.info { background: #0b1a3a; border-color: #1e3a8a; color: #bfdbfe; }

/* auth */
.auth-wrap { max-width: 400px; margin: 8vh auto; }
.auth-wrap .card { padding: 26px; }
.auth-wrap h1 { text-align: center; }
.auth-links { display: flex; justify-content: space-between; margin-top: 14px; font-size: 13px; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 16px 0 12px; flex-wrap: wrap; }
.tabs button { border: none; border-radius: 8px 8px 0 0; background: transparent; color: var(--muted); }
.tabs button.active { color: var(--text); background: var(--panel); border: 1px solid var(--border); border-bottom-color: var(--panel); }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: flex-start; justify-content: center;
  z-index: 50; overflow-y: auto; padding: 5vh 12px; }
.modal { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 20px; width: 100%; max-width: 820px; }
.modal h2 { margin-top: 0; }
.modal.wide { max-width: 1040px; }
/* bot types: all 4 on one line (2×2 on phones) */
#risk-pick { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 640px) { #risk-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.modal .footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* chart */
#chart { height: 560px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin: 8px 0; flex-wrap: wrap; }
.legend i { display: inline-block; width: 12px; height: 3px; vertical-align: middle; margin-right: 4px; }

.toast { position: fixed; bottom: 18px; right: 18px; z-index: 60; max-width: 420px; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 6px 12px; }
.kv div:nth-child(odd) { color: var(--muted); }
pre.reason { white-space: pre-wrap; margin: 0; font-family: inherit; }

/* EMA 200/50 + Guide pages */
.hero-sub { font-size: 16px; color: var(--muted); line-height: 1.7; margin-bottom: 18px; max-width: 1000px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button { border: none; border-radius: 0; background: transparent; color: var(--muted); padding: 6px 12px; }
.seg button.on { background: var(--accent); color: #fff; }
.heat-pos { background: rgba(34,197,94,0.12); }
.heat-neg { background: rgba(239,68,68,0.10); }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
.code-like { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; line-height: 1.7; white-space: pre; overflow-x: auto; }
.btn-pill { display: inline-block; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; color: var(--text); background: var(--panel-2); text-decoration: none !important; }
.btn-pill:hover { border-color: var(--accent); }
.cta-row { display: flex; gap: 10px; flex-wrap: wrap; }
.cta { padding: 9px 16px; border-radius: 8px; font-weight: 600; text-decoration: none !important; border: 1px solid var(--border); color: var(--text); }
.cta.primary { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Home page */
.hero-title { font-size: clamp(30px, 1vw + 18px, 42px); font-weight: 800; letter-spacing: -0.6px; line-height: 1.15; margin: 6px 0 12px; }
.sec-h { font-size: clamp(22px, 0.7vw + 14px, 30px); font-weight: 800; letter-spacing: -0.4px; margin: 34px 0 14px; }
.ex-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.ex-card { display: flex; flex-direction: column; gap: 9px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; color: var(--text); text-decoration: none !important; position: relative; overflow: hidden; transition: transform .15s, border-color .15s; }
.ex-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--c, #888); }
.ex-card:hover { transform: translateY(-2px); border-color: var(--c); }
.ex-icon { width: 42px; height: 42px; border-radius: 50%; background: var(--c); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; color: #000; }
.ex-name { font-size: 17px; font-weight: 700; }
.ex-desc { font-size: 13px; color: var(--muted); line-height: 1.6; }
.ex-cta { font-size: 13px; font-weight: 700; color: var(--c); margin-top: auto; }
.steps-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.step { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.step-n { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; margin-bottom: 10px; }
.step b { display: block; font-size: 15px; margin-bottom: 6px; }
.step p { font-size: 13px; color: var(--muted); line-height: 1.6; }
.risk-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.risk-card { border-radius: var(--radius); padding: 18px; background: var(--panel); border: 1px solid var(--border); border-top: 3px solid var(--c); }
.risk-card .lev { font-size: 28px; font-weight: 800; color: var(--c); }
.faq-wrap { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }
.faq-item summary { padding: 15px 20px; cursor: pointer; font-size: 15px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 14px; }
.faq-item summary::after { content: '▾'; color: var(--muted); transition: transform .2s; }
.faq-item[open] summary::after { transform: rotate(180deg); }
.faq-item summary:hover { background: var(--panel-2); }
.faq-item .faq-a { padding: 0 20px 16px; color: var(--muted); line-height: 1.7; }
.cta.ghost { background: transparent; }
.cta.primary:hover { background: var(--accent-2); }
.guest-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #0b1a3a; border: 1px solid #1e3a8a; color: #bfdbfe;
  border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; }
.guest-bar .btn-pill { padding: 5px 12px; }
.btn-pill.solid { background: var(--accent); border-color: var(--accent); color: #fff; }
.userbox .btn.primary-link { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Community footer */
#community-footer { border-top: 1px solid var(--border); padding: 36px 20px 34px; text-align: center; margin-top: 30px; }
#community-footer h2 { font-size: clamp(24px, 0.7vw + 16px, 32px); font-weight: 800; margin: 0 0 18px; }
.comm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 440px; margin: 0 auto 20px; }
.comm-btn { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 10px; color: #fff; font-weight: 600; text-decoration: none !important; }
.comm-btn:hover { opacity: .88; }
.comm-btn svg { width: 19px; height: 19px; fill: #fff; flex-shrink: 0; }
.comm-btn.yt { background: #FF0000; } .comm-btn.tw { background: #000; border: 1px solid var(--border); } .comm-btn.tg { background: #229ED9; } .comm-btn.dc { background: #5865F2; }
.footer-txt { font-size: 13px; color: var(--muted); line-height: 2.1; }
.footer-txt a { color: var(--text); }
@media (max-width: 1000px) { .steps-grid { grid-template-columns: repeat(2, 1fr); } .ex-grid, .risk-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .steps-grid, .comm-grid { grid-template-columns: 1fr; } }

/* User menu (icon + dropdown panel) */
.icon-btn { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent; color: var(--text); cursor: pointer; padding: 0; text-decoration: none !important; }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { background: var(--panel-2); border-color: var(--border); }
.avatar-btn { color: #F5B70B; }
.avatar-btn[aria-expanded="true"] { background: var(--panel-2); border-color: var(--border-2); }
.bell .count { top: 2px; right: 0; }
.user-wrap { position: relative; }
.user-menu { position: absolute; right: 0; top: calc(100% + 10px); width: 300px; background: #2b3242; border: 1px solid #3b4456;
  border-radius: 12px; box-shadow: 0 18px 50px rgba(0,0,0,.55); padding: 14px 10px 10px; z-index: 100; }
.um-head { display: flex; gap: 12px; align-items: center; padding: 2px 8px 10px; }
.um-avatar { width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(180deg, #F5B70B, #d99a00); color: #1b1f2a;
  font-weight: 800; font-size: 22px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.um-id { display: flex; flex-direction: column; min-width: 0; }
.um-id b { font-size: 17px; overflow: hidden; text-overflow: ellipsis; }
.um-id span { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.um-chips { display: flex; gap: 6px; padding: 0 8px 10px; flex-wrap: wrap; }
.um-chip { background: #3b4456; color: #e6ebf3; font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 6px; }
.um-chip.ok { background: #1d3b33; color: #4ade80; }
.um-sep { height: 1px; background: #3b4456; margin: 6px 4px; }
.um-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 10px; border-radius: 8px; color: #fff; font-size: 15px;
  font-weight: 600; background: none; border: none; text-align: left; cursor: pointer; text-decoration: none !important; font-family: inherit; }
.um-item:hover { background: #3b4456; }
.um-item svg { flex-shrink: 0; }
.um-logout { color: #fca5a5; }

/* ── Guide: DimaChain "How" documentation layout ──
   White reading area, sticky Contents on the left with scroll-spy,
   reading-progress bar, back-to-top button. Top bar stays dark. */
body.guide-page { background: #ffffff; }
body.guide-page main { max-width: none; padding: 0; }
body.guide-page #community-footer { background: var(--bg); margin-top: 0; }
.g-shell { display: flex; align-items: flex-start; color: #14121b; }
.g-toc { position: sticky; top: 0; width: 290px; flex-shrink: 0; max-height: 100vh; overflow-y: auto;
  padding: 26px 16px 60px 24px; border-right: 1px solid #e8e6ee; background: #fff; align-self: stretch; }
.g-toc-title { font-size: 11px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: #6b6478; margin: 0 0 12px 8px; }
.g-toc a { display: block; font-size: 13px; line-height: 1.4; color: #3a3648; padding: 5px 8px; border-radius: 7px; text-decoration: none !important; }
.g-toc a:hover { background: #f7f7fa; color: #14121b; }
.g-toc a.toc-part { font-family: 'Space Grotesk', sans-serif; font-size: 14px; font-weight: 700; color: #0b1a3a; margin: 18px 0 4px; }
.g-toc a.toc-part:first-of-type { margin-top: 0; }
.g-toc a.toc-h2 { padding-left: 20px; font-size: 12.5px; color: #6b6478; }
.g-toc a.active { background: #e8f1ff; color: #0b1a3a; font-weight: 600; }
.g-content { flex: 1; min-width: 0; padding: 44px 56px 100px; max-width: clamp(820px, 58vw, 1400px); margin: 0 auto; line-height: 1.7; }
.g-content h1 { font-family: 'Space Grotesk', sans-serif; font-size: clamp(28px, 0.67vw + 19px, 36px); line-height: 1.2; font-weight: 700;
  letter-spacing: -0.6px; color: #14121b; margin: 52px 0 16px; scroll-margin-top: 16px; }
.g-content h1.g-title { font-size: clamp(38px, 0.89vw + 26px, 48px); margin-top: 0; }
.g-content h1.g-part { color: #1E90FF; border-top: 2px solid #e8e6ee; padding-top: 26px; margin-top: 60px; }
.g-content h2 { font-family: 'Space Grotesk', sans-serif; font-size: clamp(20px, 0.47vw + 13.5px, 25px); font-weight: 600; color: #14121b;
  letter-spacing: -0.2px; margin: 30px 0 10px; scroll-margin-top: 16px; }
.g-content p, .g-content ul, .g-content ol { font-size: clamp(16px, 0.3vw + 11.5px, 18.5px); color: #3a3648; margin: 0 0 15px; }
.g-content ul, .g-content ol { padding-left: 24px; }
.g-content li { margin: 6px 0; }
.g-content strong { color: #14121b; }
.g-content a { color: #1E90FF; }
.g-content hr { border: none; border-top: 1px solid #eeecf2; margin: 30px 0; }
.g-content code { background: #f7f7fa; border: 1px solid #e8e6ee; border-radius: 5px; padding: 1px 6px; font-size: 0.85em; color: #0b1a3a;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.g-content pre { background: #14121b; color: #ece8f7; border: 1px solid #34303f; border-radius: 12px; padding: 18px 20px; overflow-x: auto;
  margin: 8px 0 22px; line-height: 1.9; font-size: 14px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; }
.g-content table { width: 100%; border-collapse: collapse; margin: 8px 0 24px; font-size: 15px; }
.g-content th, .g-content td { border: 1px solid #e8e6ee; padding: 10px 14px; text-align: left; white-space: normal; color: #3a3648; background: #fff; }
.g-content th { background: #f7f7fa; font-weight: 700; color: #14121b; position: static; }
.g-content tbody tr:hover td { background: #fff; }
.callout { border-radius: 12px; padding: 16px 20px; margin: 8px 0 24px; border: 1px solid #e8e6ee; background: #f7f7fa; }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.cal-label { font-weight: 700; font-size: 13px; letter-spacing: .4px; text-transform: uppercase; margin-bottom: 6px; }
.cal-note { background: #f0f6ff; border-color: #cfe1fb; } .cal-note .cal-label { color: #1E90FF; }
.cal-tip { background: #eefaf2; border-color: #bfe6cd; } .cal-tip .cal-label { color: #12a150; }
.cal-warn { background: #fff5f4; border-color: #f6cfcb; } .cal-warn .cal-label { color: #d0342c; }
.cal-hero { background: linear-gradient(135deg, #041220, #0f4fa8); border: none; padding: 26px 30px; }
.cal-hero h2 { color: #fff; margin: 0 0 10px; }
.cal-hero p { color: rgba(255,255,255,.9) !important; }
.read-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, #4DA6FF, #1E90FF); z-index: 200; }
.backtop { position: fixed; right: 22px; bottom: 22px; background: #1E90FF; color: #fff; width: 44px; height: 44px; border-radius: 12px; border: none;
  font-size: 18px; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 150; }
.backtop.show { opacity: 1; pointer-events: auto; }
@media (max-width: 1024px) { .g-toc { display: none; } .g-content { padding: 30px 22px 80px; } }

/* Google sign-in */
.google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 10px 14px; border-radius: 8px;
  background: #fff; color: #1f1f1f !important; font-weight: 600; text-decoration: none !important; border: 1px solid #dadce0; margin-top: 6px; }
.google-btn:hover { background: #f5f7fb; }
.or-sep { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 16px 0 4px; }
.or-sep::before, .or-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* Modern scrollbars (tables, page, menus) — thin dark track, brand-blue thumb */
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: #2f6fd6 #0f141d; } }  /* Firefox */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: #0f141d; border-radius: 10px; }
::-webkit-scrollbar-thumb { background: linear-gradient(90deg, #1E90FF, #6a5cff); border-radius: 10px; border: 3px solid #0f141d; }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(90deg, #4DA6FF, #8a7dff); }
::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
body.guide-page .g-content ::-webkit-scrollbar-track, body.guide-page .g-toc::-webkit-scrollbar-track { background: #f1f2f6; }
body.guide-page .g-content ::-webkit-scrollbar-thumb, body.guide-page .g-toc::-webkit-scrollbar-thumb { border-color: #f1f2f6; }

/* Password show/hide */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 42px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--muted);
  padding: 6px 8px; cursor: pointer; display: flex; align-items: center; border-radius: 6px; }
.pw-eye:hover { color: var(--text); background: var(--panel-2); border: none; }

/* Audit log */
.audit-filters .row { gap: 8px; }
.audit-table tr.audit-row { cursor: pointer; }
.audit-table tr.audit-row:hover td { background: var(--panel-2); }
.audit-table tr.audit-row.open td { background: var(--panel-2); }
.audit-table tr.audit-problem td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.audit-table .audit-sum { white-space: normal; max-width: 520px; color: var(--muted); }
.audit-detail-row td { background: var(--bg); white-space: normal; }
.audit-detail { padding: 6px 4px 10px; }
.audit-detail pre.code-like { max-height: 260px; overflow: auto; white-space: pre; }

/* Home FAQ — DimaChain layout (centered questions, ▼ on the right) in the site's own colours */
.faq2 { margin: 44px 0 0; padding: 0; }
.faq2-title { text-align: center; color: var(--text); font-size: clamp(30px, 1vw + 20px, 44px); font-weight: 800; letter-spacing: -0.7px; margin: 0 0 26px; }
.faq2-wrap { max-width: 1400px; margin: 0 auto; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.faq2-item { border-bottom: 1px solid var(--border); }
.faq2-item:last-child { border-bottom: none; }
.faq2-item summary { list-style: none; cursor: pointer; position: relative; padding: 24px 64px; text-align: center; color: var(--text);
  font-size: clamp(16px, 0.3vw + 12px, 19px); font-weight: 700; transition: background .15s; }
.faq2-item summary::-webkit-details-marker { display: none; }
.faq2-item summary::after { content: "▼"; position: absolute; right: 32px; top: 50%; transform: translateY(-50%); font-size: 13px;
  color: var(--muted); transition: transform .2s; }
.faq2-item[open] summary::after { transform: translateY(-50%) rotate(180deg); }
.faq2-item summary:hover, .faq2-item[open] summary { background: var(--panel-2); }
.faq2-item .wm-1 { color: #1E90FF; }
.faq2-a { padding: 4px 64px 24px; text-align: center; color: var(--muted); line-height: 1.75; font-size: 15.5px; max-width: 1000px; margin: 0 auto; }
@media (max-width: 700px) { .faq2-item summary { padding: 20px 44px 20px 20px; text-align: left; } .faq2-item summary::after { right: 16px; } .faq2-a { padding: 0 20px 20px; text-align: left; } }

/* Modern choice cards (bot type, funds mode): the whole card is the control;
   the native radio is visually hidden but still focusable/keyboard-usable. */
label.card:has(> input[type="radio"]) {
  position: relative; cursor: pointer; padding: 14px 16px !important; border: 1.5px solid var(--border);
  background: var(--panel); transition: border-color .15s, background .15s, box-shadow .15s, transform .1s;
}
label.card:has(> input[type="radio"]):hover { border-color: var(--border-2); background: var(--panel-2); }
label.card:has(> input[type="radio"]:checked) {
  border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--panel));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
label.card:has(> input[type="radio"]:focus-visible) { outline: 2px solid var(--accent-2); outline-offset: 2px; }
label.card > input[type="radio"] { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
label.card:has(> input[type="radio"])::after {
  content: ""; position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--border-2); background: transparent; transition: all .15s;
}
label.card:has(> input[type="radio"]:checked)::after {
  border-color: var(--accent); background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 13px no-repeat;
}
label.card:has(> input[type="radio"]) > b { font-size: 15px; padding-right: 26px; display: block; }
label.card:has(> input[type="radio"]) > .lev-tag { display: inline-block; margin: 4px 0 2px; font-size: 12px; font-weight: 700;
  color: var(--accent-2); background: color-mix(in srgb, var(--accent) 14%, transparent); padding: 2px 8px; border-radius: 999px; }

/* Checkboxes in the brand colour */
input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }

/* brief highlight when jumping to a section (e.g. user menu → Telegram) */
.card.flash { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); transition: box-shadow .4s; }

/* Row delete (✕) buttons: quiet until hovered */
button.icon-del { background: transparent; border-color: transparent; color: var(--muted); line-height: 1; }
button.icon-del:hover { color: var(--red, #e5484d); border-color: currentColor; }
