/* Layout: sticky top bar; desktop = tool drawer on the left + one working column; each tool = input panel beside a sticky "shelf-ticket" answer. Phones stack, with a pinned answer bar. */
:root {
  --bg: #EDF0F4; --surface: #FFFFFF; --surface-2: #F5F7FA; --sunk: #E3E7ED;
  --ink: #121823; --ink-2: #485263; --ink-3: #6C7789; --line: #CDD4DE; --line-2: #E0E5EC;
  --accent: #2443C8; --accent-2: #1A3299; --accent-soft: #E2E7FB; --on-accent: #FFFFFF;
  --ticket: #FFD84A; --ticket-soft: #FFF3C2; --ticket-ink: #1D1600; --ticket-line: #CFA514;
  --good: #0E7651; --good-soft: #DAF2E7; --bad: #B0322A; --bad-soft: #FBE3E0; --warn: #8A5B00; --warn-soft: #FFF0CC;
  --c-shop: #B97E00; --c-text: #2443C8; --c-home: #C14E26; --c-words: #6F44C4; --c-time: #0C7C6B; --c-kitchen: #B33260;
  --h1: #2E7D32; --h2: #46607A; --h3: #B97E00; --h4: #B33260; --h5: #C14E26; --h6: #2443C8; --h7: #0C7C6B; --h8: #6F44C4; --h9: #0B7A99;
  --f-display: 'Archivo', 'Arial Narrow', 'Helvetica Neue', system-ui, sans-serif;
  --f-body: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --r: 12px; --r-sm: 8px;
  --shadow: 0 1px 0 rgba(18, 24, 35, .04), 0 4px 14px rgba(18, 24, 35, .06);
  --hdr: 60px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D1117; --surface: #151A23; --surface-2: #1A212C; --sunk: #0A0E13;
    --ink: #E6EBF2; --ink-2: #A9B3C3; --ink-3: #808B9D; --line: #2C3442; --line-2: #222A36;
    --accent: #8AA3FF; --accent-2: #AFC0FF; --accent-soft: #1C2546; --on-accent: #0A0F1F;
    --ticket: #F4C93A; --ticket-soft: #33290E; --ticket-ink: #1D1600; --ticket-line: #A9871A;
    --good: #4CCB98; --good-soft: #0F2E22; --bad: #FF8A7C; --bad-soft: #3A1916; --warn: #F2BE55; --warn-soft: #33270F;
    --c-shop: #F0B53A; --c-text: #8AA3FF; --c-home: #FF8A5E; --c-words: #B596FF; --c-time: #4FD1BC; --c-kitchen: #FF7FAA;
    --h1: #6FCF73; --h2: #9DB4CC; --h3: #F0B53A; --h4: #FF7FAA; --h5: #FF8A5E; --h6: #8AA3FF; --h7: #4FD1BC; --h8: #B596FF; --h9: #4CC9E8;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .28);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0D1117; --surface: #151A23; --surface-2: #1A212C; --sunk: #0A0E13;
  --ink: #E6EBF2; --ink-2: #A9B3C3; --ink-3: #808B9D; --line: #2C3442; --line-2: #222A36;
  --accent: #8AA3FF; --accent-2: #AFC0FF; --accent-soft: #1C2546; --on-accent: #0A0F1F;
  --ticket: #F4C93A; --ticket-soft: #33290E; --ticket-ink: #1D1600; --ticket-line: #A9871A;
  --good: #4CCB98; --good-soft: #0F2E22; --bad: #FF8A7C; --bad-soft: #3A1916; --warn: #F2BE55; --warn-soft: #33270F;
  --c-shop: #F0B53A; --c-text: #8AA3FF; --c-home: #FF8A5E; --c-words: #B596FF; --c-time: #4FD1BC; --c-kitchen: #FF7FAA;
  --h1: #6FCF73; --h2: #9DB4CC; --h3: #F0B53A; --h4: #FF7FAA; --h5: #FF8A5E; --h6: #8AA3FF; --h7: #4FD1BC; --h8: #B596FF; --h9: #4CC9E8;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .28);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--f-body); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--surface); }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
.num, .tab { font-variant-numeric: tabular-nums; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: var(--surface); border-bottom: 1px solid var(--line-2);
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.top-in { max-width: 1280px; margin: 0 auto; height: var(--hdr); display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: baseline; gap: 2px; text-decoration: none; color: var(--ink); font-family: var(--f-display); font-weight: 850; font-stretch: 78%; font-size: 1.7rem; letter-spacing: -0.02em; line-height: 1; }
.brand b { color: var(--ticket-line); font-weight: 900; }
.brand small { font-family: var(--f-body); font-stretch: normal; font-weight: 400; font-size: .8rem; color: var(--ink-3); letter-spacing: 0; margin-left: 10px; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; min-width: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--ink-2); }
.iconbtn:hover { background: var(--surface-2); color: var(--ink); }
.menu-btn { margin-left: -8px; }
.hsearch { position: relative; flex: 1; max-width: 460px; margin-left: auto; }
.hsearch input { width: 100%; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); padding: 0 12px 0 38px; }
.hsearch input:focus { background: var(--surface); }
.hsearch .icon { position: absolute; left: 11px; top: 10px; color: var(--ink-3); pointer-events: none; }
.hsearch kbd { position: absolute; right: 10px; top: 9px; font-family: var(--f-mono); font-size: .72rem; color: var(--ink-3); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; pointer-events: none; }
.sres { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 6px; z-index: 30; max-height: 70vh; overflow: auto; }
.sres a { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.sres a[aria-selected="true"], .sres a:hover { background: var(--accent-soft); }
.sres .d { color: var(--ink-3); font-size: .85rem; }
.sres .empty { padding: 10px; color: var(--ink-3); }
.cur select { height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); padding: 0 8px; }
@media (max-width: 760px) { .hsearch { display: none; } .brand small { display: none; } }

/* ---------- layout ---------- */
.layout {
  max-width: 1280px; margin: 0 auto; display: flex; gap: 32px; align-items: flex-start;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 24px 64px;
}
main { flex: 1; min-width: 0; }
.side { width: 236px; flex: none; position: sticky; top: calc(var(--hdr) + env(safe-area-inset-top, 0px) + 16px); max-height: calc(100vh - var(--hdr) - 40px); overflow: auto; padding-right: 4px; }
.side[hidden] { display: none !important; }
@media (max-width: 1023px) { .side { display: none; } }
.nav-cat { margin-bottom: 14px; }
.nav-cat h3 { display: flex; align-items: center; gap: 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; font-stretch: 100%; font-weight: 700; color: var(--ink-3); margin: 0 0 6px 8px; }
.nav-cat h3 .icon { width: 16px; height: 16px; }
.nav-cat a { display: block; padding: 5px 8px 5px 32px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-size: .94rem; line-height: 1.3; }
.nav-cat a:hover { background: var(--surface); color: var(--ink); }
.nav-cat a[aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: inset 3px 0 0 var(--cat, var(--accent)); }

/* drawer (phones/tablets) */
.drawer { position: fixed; inset: 0; z-index: 50; display: flex; }
.drawer[hidden] { display: none !important; }
.drawer .scrim { position: absolute; inset: 0; background: rgba(8, 12, 20, .45); }
.drawer .sheet { position: relative; width: min(360px, 90vw); height: 100%; background: var(--bg); overflow: auto; padding: calc(env(safe-area-inset-top, 0px) + 14px) 14px calc(env(safe-area-inset-bottom, 0px) + 24px) max(14px, env(safe-area-inset-left, 0px)); box-shadow: var(--shadow); }
.drawer .sheet-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.drawer .filter { position: relative; margin-bottom: 16px; }
.drawer .filter input { width: 100%; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); padding: 0 12px 0 38px; }
.drawer .filter .icon { position: absolute; left: 11px; top: 12px; color: var(--ink-3); }

/* ---------- home ---------- */
.hero { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); align-items: start; margin-bottom: 40px; }
@media (min-width: 900px) { .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 470px); gap: 40px; } }
.hero h1 { font-size: clamp(2.3rem, 5.2vw, 3.6rem); line-height: .98; font-weight: 820; font-stretch: 80%; letter-spacing: -0.025em; margin-top: 8px; }
.hero h1 mark { background: linear-gradient(transparent 58%, var(--ticket) 58%, var(--ticket) 92%, transparent 92%); color: inherit; padding: 0 .05em; }
.hero .lede { font-size: 1.12rem; color: var(--ink-2); max-width: 34em; margin-top: 16px; }
.hero .bigsearch { position: relative; margin-top: 22px; max-width: 520px; }
.hero .bigsearch input { width: 100%; height: 54px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); padding: 0 16px 0 46px; font-size: 1.05rem; box-shadow: var(--shadow); }
.hero .bigsearch > .icon { position: absolute; left: 15px; top: 17px; color: var(--ink-3); }
.facts { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 18px; color: var(--ink-2); font-size: .92rem; }
.facts span { display: inline-flex; align-items: center; gap: 6px; }
.facts .icon { width: 17px; height: 17px; color: var(--good); }
.demo { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; }
.demo-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.demo-h h2 { font-size: 1.15rem; font-stretch: 90%; }
.demo-h a { font-size: .9rem; white-space: nowrap; }

.dir-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 0 14px; }
.dir-h h2 { font-size: 1.5rem; font-stretch: 85%; }
.dir-h p { color: var(--ink-3); }
.dir { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.dcat { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); padding: 18px 18px 10px; }
.dcat-h { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.mark { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--cat) 14%, transparent); color: var(--cat); flex: none; }
.mark .icon { width: 20px; height: 20px; }
.dcat h3 { font-size: 1.15rem; font-stretch: 90%; }
.dcat-h p { font-size: .85rem; color: var(--ink-3); }
.dcat ul { list-style: none; margin: 0; padding: 0; }
.dcat li + li { border-top: 1px solid var(--line-2); }
.dcat li a { display: block; padding: 9px 0; text-decoration: none; color: var(--ink); }
.dcat li a:hover .tn { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.dcat .tn { font-weight: 700; display: block; }
.dcat .td { font-size: .87rem; color: var(--ink-3); display: block; line-height: 1.35; }

/* ---------- tool page ---------- */
.crumb { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 700; color: var(--cat); text-decoration: none; text-transform: uppercase; letter-spacing: .08em; }
.crumb .icon { width: 16px; height: 16px; }
.tool-h { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; justify-content: space-between; margin: 6px 0 20px; }
.tool-h h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); line-height: 1.02; font-weight: 800; font-stretch: 82%; letter-spacing: -0.02em; }
.tool-h p { color: var(--ink-2); margin-top: 6px; max-width: 46em; }
.tool-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 700; font-size: .92rem; color: var(--ink); text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--ink-3); }
.btn .icon { width: 18px; height: 18px; }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--accent); padding: 0 8px; }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.sm { height: 34px; padding: 0 10px; font-size: .86rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.tool-body { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) {
  .split .tool-body { grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); }
  .split .results { position: sticky; top: calc(var(--hdr) + env(safe-area-inset-top, 0px) + 16px); }
}
.panel { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); padding: 20px; min-width: 0; }
.panel + .panel { margin-top: 16px; }
.panel h2, .rcard h2 { font-size: 1.05rem; font-stretch: 92%; font-weight: 750; margin-bottom: 12px; }
.panel-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.panel-h h2 { margin: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.results { display: flex; flex-direction: column; gap: 14px; min-width: 0; scroll-margin-top: calc(var(--hdr) + 20px); }
.rcard { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); padding: 16px 18px; min-width: 0; }
.related { margin-top: 36px; }
.related h2 { font-size: 1rem; font-stretch: 92%; margin-bottom: 10px; color: var(--ink-2); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-flex; align-items: center; height: 34px; padding: 0 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2); color: var(--ink); text-decoration: none; font-size: .9rem; }
.pill:hover { border-color: var(--cat, var(--accent)); color: var(--cat, var(--accent)); }

/* ---------- form ---------- */
.grid { display: grid; gap: 14px 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); }
.grid.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 520px) { .grid.g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field > label, .lbl { font-size: .84rem; font-weight: 700; color: var(--ink-2); }
.field .hint { font-size: .8rem; color: var(--ink-3); line-height: 1.35; }
.inp { display: flex; align-items: center; height: 44px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); min-width: 0; transition: border-color .15s; }
.inp:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.inp input, .inp select { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; padding: 0 10px; outline: none; font-variant-numeric: tabular-nums; }
.inp select { padding-right: 4px; cursor: pointer; }
.inp .ad { padding: 0 0 0 10px; color: var(--ink-3); font-size: .92rem; white-space: nowrap; }
.inp .ad.r { padding: 0 10px 0 0; }
.inp input[aria-invalid="true"] { color: var(--bad); }
.inp:has(input[aria-invalid="true"]) { border-color: var(--bad); }
.inp input[type="date"], .inp input[type="time"] { padding-right: 6px; }
textarea.ta { width: 100%; min-height: 220px; resize: vertical; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); padding: 12px; font-family: var(--f-mono); font-size: .88rem; line-height: 1.55; tab-size: 4; }
textarea.ta:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.ta[readonly] { background: var(--surface-2); }

.seg { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; background: var(--sunk); border-radius: 10px; max-width: 100%; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.seg span { display: block; padding: 7px 12px; border-radius: 8px; font-size: .88rem; font-weight: 700; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.seg input:focus-visible + span { outline: 2.5px solid var(--accent); outline-offset: 1px; }

.sw { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: .93rem; line-height: 1.3; user-select: none; }
.sw input { appearance: none; -webkit-appearance: none; width: 38px; height: 22px; border-radius: 99px; background: var(--line); position: relative; flex: none; cursor: pointer; transition: background .15s; margin: 0; }
.sw input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.sw input:checked { background: var(--accent); }
.sw input:checked::after { transform: translateX(16px); }
.sws { display: flex; flex-wrap: wrap; gap: 12px 22px; }

.rows { display: flex; flex-direction: column; gap: 10px; }
.row { display: grid; gap: 10px; align-items: end; padding: 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line-2); }
.rowtag { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; font-family: var(--f-display); font-weight: 850; font-stretch: 80%; font-size: 1.05rem; background: var(--ink); color: var(--surface); align-self: center; }
.rowtag.win { background: var(--ticket); color: var(--ticket-ink); }
.rm { width: 36px; height: 44px; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; border-radius: 8px; display: grid; place-items: center; }
.rm:hover { color: var(--bad); background: var(--bad-soft); }
.add { align-self: flex-start; }
.subtle { color: var(--ink-3); font-size: .86rem; }
.divider { height: 1px; background: var(--line-2); margin: 4px 0; }
details.more summary { cursor: pointer; font-weight: 700; color: var(--accent); font-size: .92rem; list-style: none; display: inline-flex; gap: 6px; align-items: center; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "+"; font-family: var(--f-mono); }
details.more[open] summary::before { content: "−"; }
details.more > div { margin-top: 12px; }

/* ---------- results ---------- */
.ticket { position: relative; background: var(--ticket); color: var(--ticket-ink); border-radius: var(--r-sm); padding: 16px 18px 16px 30px; overflow: hidden; }
.ticket::before { content: ""; position: absolute; left: 10px; top: 10px; bottom: 10px; width: 6px; background: radial-gradient(circle at 3px 3px, var(--bg) 2.4px, transparent 2.8px) 0 0 / 6px 10px repeat-y; opacity: .9; }
.ticket .k { font-size: .78rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; opacity: .78; }
.ticket .big { font-family: var(--f-display); font-weight: 850; font-stretch: 72%; font-size: clamp(2.2rem, 6vw, 3.1rem); line-height: 1; letter-spacing: -0.02em; margin: 6px 0 4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ticket .big small { font-size: .45em; font-stretch: 85%; font-weight: 700; letter-spacing: 0; margin-left: .2em; }
.ticket .sub { font-size: .98rem; font-weight: 700; }
.ticket .tnote { font-size: .9rem; margin-top: 10px; padding-top: 9px; border-top: 1.5px dashed rgba(29, 22, 0, .32); }
.ticket.muted { background: var(--sunk); color: var(--ink); }
.ticket.muted .tnote { border-color: var(--line); }

.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0; }
.kv > div { display: contents; }
.kv dt, .kv dd { padding: 8px 0; border-bottom: 1px solid var(--line-2); margin: 0; }
.kv dt { color: var(--ink-2); padding-right: 12px; }
.kv dd { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.kv > div:last-child dt, .kv > div:last-child dd { border-bottom: 0; }
.kv dd .s { display: block; font-weight: 400; color: var(--ink-3); font-size: .82rem; }

.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--ink); font-size: .93rem; line-height: 1.45; }
.note .icon { margin-top: 1px; color: var(--accent); }
.note.warn { background: var(--warn-soft); }
.note.warn .icon { color: var(--warn); }
.note.bad { background: var(--bad-soft); }
.note.bad .icon { color: var(--bad); }
.note.good { background: var(--good-soft); }
.note.good .icon { color: var(--good); }

.tblwrap { overflow-x: auto; margin: 0 -2px; }
table.t { width: 100%; border-collapse: collapse; font-size: .92rem; font-variant-numeric: tabular-nums; }
table.t th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 700; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 8px; border-bottom: 1px solid var(--line-2); }
table.t td.r, table.t th.r { text-align: right; }
table.t tr.hl td { background: var(--ticket-soft); }
table.t tr.me td { font-weight: 700; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 99px; font-size: .74rem; font-weight: 700; letter-spacing: .03em; white-space: nowrap; }
.tag.best { background: var(--ticket); color: var(--ticket-ink); }
.tag.good { background: var(--good-soft); color: var(--good); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.n { background: var(--sunk); color: var(--ink-2); }
.up { color: var(--bad); }
.down { color: var(--good); }

/* ranking bars */
.rank { display: flex; flex-direction: column; gap: 10px; }
.rk { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; }
.rk .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk .v { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.rk .bar { grid-column: 2 / -1; height: 8px; background: var(--sunk); border-radius: 99px; overflow: hidden; }
.rk .bar i { display: block; height: 100%; background: var(--ink-3); border-radius: 99px; }
.rk.win .bar i { background: var(--ticket-line); }
.rk .meta { grid-column: 2 / -1; font-size: .84rem; color: var(--ink-3); margin-top: -2px; }

/* chips (words) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: baseline; gap: 5px; padding: 5px 9px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line-2); font-family: var(--f-mono); font-size: .92rem; cursor: pointer; color: var(--ink); }
.chip:hover { border-color: var(--accent); }
.chip.common { background: var(--surface); border-color: var(--line); font-weight: 600; }
.chip sub { font-size: .68rem; color: var(--ink-3); bottom: 0; font-weight: 400; }
.chip u { text-decoration: none; color: var(--ink-3); }
.wgroup + .wgroup { margin-top: 16px; }
.wgroup h3 { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-stretch: 100%; font-weight: 700; margin-bottom: 8px; display: flex; gap: 8px; align-items: baseline; }

/* wordle tiles */
.wrows { display: flex; flex-direction: column; gap: 10px; }
.wrow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.wrow .inp { width: 150px; flex: none; }
.wrow .inp input { font-family: var(--f-mono); text-transform: uppercase; letter-spacing: .15em; font-weight: 600; }
.tiles { display: flex; gap: 5px; }
.tile { width: 44px; height: 44px; border-radius: 6px; border: 2px solid var(--line); background: var(--surface); font-family: var(--f-display); font-weight: 850; font-size: 1.3rem; text-transform: uppercase; cursor: pointer; display: grid; place-items: center; color: var(--ink); }
.tile.b { background: var(--ink-3); border-color: var(--ink-3); color: var(--surface); }
.tile.y { background: var(--ticket); border-color: var(--ticket-line); color: var(--ticket-ink); }
.tile.g { background: var(--good); border-color: var(--good); color: var(--surface); }
.tile:disabled { cursor: default; opacity: .4; }
@media (max-width: 420px) { .tile { width: 40px; height: 40px; } .wrow .inp { width: 100%; } }

/* timeline */
.tl { display: flex; flex-direction: column; gap: 10px; }
.tl-row { display: grid; grid-template-columns: minmax(70px, 120px) minmax(0, 1fr); gap: 10px; align-items: center; }
.tl-name { font-size: .88rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-name small { display: block; font-weight: 400; color: var(--ink-3); font-size: .76rem; }
.tl-track { position: relative; height: 26px; background: repeating-linear-gradient(90deg, var(--sunk) 0 calc(12.5% - 1px), var(--line-2) calc(12.5% - 1px) 12.5%); border-radius: 6px; overflow: hidden; }
.tl-seg { position: absolute; top: 3px; bottom: 3px; background: var(--accent); border-radius: 4px; opacity: .85; }
.tl-row.common .tl-seg { background: var(--ticket); border: 1.5px solid var(--ticket-line); opacity: 1; }
.tl-axis { position: relative; height: 18px; margin-left: calc(min(120px, 30%) + 10px); }
.tl-axis span { position: absolute; transform: translateX(-50%); font-size: .72rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .tl-row { grid-template-columns: minmax(0, 1fr); gap: 4px; } .tl-axis { margin-left: 0; } }

/* diff */
.diff { font-family: var(--f-mono); font-size: .84rem; line-height: 1.5; border: 1px solid var(--line-2); border-radius: var(--r-sm); overflow: auto; max-height: 560px; background: var(--surface); }
.diff table { border-collapse: collapse; width: 100%; }
.diff td { padding: 1px 8px; vertical-align: top; white-space: pre-wrap; word-break: break-word; }
.diff td.ln { width: 1%; color: var(--ink-3); text-align: right; user-select: none; white-space: nowrap; border-right: 1px solid var(--line-2); }
.diff td.sg { width: 1%; user-select: none; color: var(--ink-3); }
.diff tr.add td { background: var(--good-soft); }
.diff tr.del td { background: var(--bad-soft); }
.diff tr.add td.sg { color: var(--good); }
.diff tr.del td.sg { color: var(--bad); }
.wdiff { padding: 12px; white-space: pre-wrap; word-break: break-word; }
.wdiff ins { background: var(--good-soft); color: var(--good); text-decoration: none; border-radius: 3px; }
.wdiff del { background: var(--bad-soft); color: var(--bad); border-radius: 3px; }

/* stats */
.stats { display: grid; gap: 1px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 120px), 1fr)); background: var(--line-2); border: 1px solid var(--line-2); border-radius: var(--r-sm); overflow: hidden; }
.stats > div { background: var(--surface); padding: 12px 14px; }
.stats b { display: block; font-family: var(--f-display); font-stretch: 78%; font-weight: 800; font-size: 1.7rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats span { font-size: .8rem; color: var(--ink-3); }
.meter { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; font-size: .88rem; }
.meter + .meter { margin-top: 10px; }
.meter .track { grid-column: 1 / -1; height: 6px; background: var(--sunk); border-radius: 99px; overflow: hidden; }
.meter .track i { display: block; height: 100%; background: var(--good); }
.meter.over .track i { background: var(--bad); }
.meter .v { font-variant-numeric: tabular-nums; color: var(--ink-3); }
.meter.over .v { color: var(--bad); font-weight: 700; }

.recipe-out { font-family: var(--f-body); }
.recipe-out li { padding: 7px 0; border-bottom: 1px solid var(--line-2); display: flex; gap: 10px; justify-content: space-between; align-items: baseline; }
.recipe-out ul { list-style: none; margin: 0; padding: 0; }
.recipe-out .q { font-weight: 700; }
.recipe-out .unsc { color: var(--ink-3); }
.cdown { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 8px 0 4px; }
.cdown div { text-align: center; }
.cdown b { display: block; font-family: var(--f-display); font-weight: 850; font-stretch: 72%; font-size: clamp(2rem, 7vw, 3rem); line-height: 1; font-variant-numeric: tabular-nums; }
.cdown span { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; opacity: .75; }
.pan svg { width: 100%; max-width: 260px; height: auto; display: block; margin: 0 auto; }
.legend { display: flex; gap: 16px; justify-content: center; font-size: .85rem; color: var(--ink-2); margin-top: 6px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.loading { display: flex; gap: 10px; align-items: center; color: var(--ink-2); padding: 8px 0; }
.spin { width: 18px; height: 18px; border: 2.5px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: sp 0.8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 3s; } * { transition: none !important; } }

/* mobile answer bar */
.mbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--ticket); color: var(--ticket-ink); display: flex; align-items: center; gap: 12px; padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); box-shadow: 0 -4px 16px rgba(0, 0, 0, .15); border: 0; width: 100%; text-align: left; cursor: pointer; }
.mbar[hidden] { display: none !important; }
.mbar .l { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; opacity: .75; display: block; }
.mbar .v { font-family: var(--f-display); font-weight: 850; font-stretch: 75%; font-size: 1.45rem; line-height: 1.05; font-variant-numeric: tabular-nums; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mbar .t { flex: 1; min-width: 0; }
.mbar .go { font-weight: 700; font-size: .88rem; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
@media (min-width: 900px) { .mbar { display: none !important; } }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 700; font-size: .92rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

footer.foot { --fbg: #0E1A3C; --ft: #B8C3DD; --fh: #FFFFFF; --fl: rgba(255,255,255,.28); background: var(--fbg); color: var(--ft); margin-top: 48px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 40px 36px; font-size: .86rem; }
footer.foot > div { max-width: 1280px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
footer.foot a { color: var(--fh); text-decoration: none; font-weight: 600; }
footer.foot a:hover { text-decoration: underline; text-underline-offset: 3px; }
footer.foot a:focus-visible, footer.foot summary:focus-visible, footer.foot .btn:focus-visible { outline: 2px solid #FFD84A; outline-offset: 3px; border-radius: 4px; }
.fcols { order: 1; display: grid; gap: 28px 40px; grid-template-columns: minmax(0, 2.3fr) minmax(0, 1fr) minmax(0, 1fr); }
.fcol h2 { max-width: none; width: 100%; font-size: 1.02rem; font-weight: 800; color: var(--fh); margin: 0 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--fl); letter-spacing: 0; }
.fcol ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px 20px; }
.fcol.pop ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fcol li { min-width: 0; overflow-wrap: anywhere; }
.fdisc { order: 2; max-width: 62em; margin: 6px auto 0; text-align: center; font-size: .8rem; line-height: 1.55; }
.foot details { order: 3; text-align: center; }
.foot .langs { order: 4; justify-content: center; border-top-color: var(--fl); }
.foot .langs a { font-weight: 600; color: var(--ft); }
.foot .langs a[aria-current="true"] { color: var(--fh); }
.fcopy { order: 5; text-align: center; color: var(--fh); font-weight: 600; font-size: .8rem; margin: 0; }
.foot .btn.ghost { color: var(--fh); border-color: var(--fl); background: transparent; }
.foot .btn.ghost:hover { background: rgba(255,255,255,.1); }
@media (max-width: 899px) { .fcols { grid-template-columns: 1fr 1fr; } .fcol.pop { grid-column: 1 / -1; } }
@media (max-width: 560px) { .fcols { grid-template-columns: 1fr; } .fcol.pop ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fdisc { text-align: left; } }
.prose { max-width: 46rem; margin: 0 auto; padding: 8px 0 24px; }
.prose h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); margin: 18px 0 10px; }
.prose h2 { font-size: 1.2rem; margin: 26px 0 6px; }
.prose p, .prose li { color: var(--ink-2); line-height: 1.65; }
.prose ul { padding-left: 1.2em; display: grid; gap: 6px; }
.prose a { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.prose .upd { color: var(--ink-3); font-size: .85rem; }
@media (max-width: 899px) { body.has-mbar footer.foot { padding-bottom: 110px; } }

/* pack rows: stack on narrow panels, one line on wide ones */
.up-rows { container-type: inline-size; }
.up-row { grid-template-columns: 32px minmax(0, 1fr) minmax(0, 1fr) 36px; grid-template-areas: "tag name name rm" "price price count count" "size size unit unit"; }
@container (min-width: 430px) {
  .up-row { grid-template-columns: 32px minmax(0, 1fr) minmax(0, .7fr) minmax(0, .85fr) minmax(0, 1fr) 36px; grid-template-areas: "tag name name name name rm" "price price count size unit unit"; }
}
@container (min-width: 680px) {
  .up-row { grid-template-columns: 32px minmax(0, 1.25fr) minmax(0, 1.05fr) minmax(0, .75fr) minmax(0, .9fr) minmax(0, 1.1fr) 36px; grid-template-areas: "tag name price count size unit rm"; }
}
.big-letters { height: 54px; }
.big-letters input { font-family: var(--f-mono); font-size: 1.35rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; }
.hsearch input:not(:placeholder-shown) + kbd { display: none; }
.foot details summary { cursor: pointer; color: var(--fh); font-weight: 600; }
.foot pre { white-space: pre-wrap; font-family: var(--f-mono); font-size: .75rem; color: var(--ft); max-width: 70ch; margin: 12px auto 0; text-align: left; }

.demo .row { grid-template-columns: 28px minmax(0, 1fr) minmax(0, 1fr) minmax(74px, .8fr) !important; gap: 8px; padding: 10px; }
.demo .inp input, .demo .inp select { padding: 0 8px; }
.demo .inp .ad { padding-left: 8px; }
.demo .rowtag { width: 28px; height: 28px; }
.days { display: flex; flex-wrap: wrap; gap: 6px; }
.day { min-width: 48px; height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-weight: 700; font-size: .88rem; cursor: pointer; }
.day[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }

.regbtn { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 700; font-size: .9rem; color: var(--ink); white-space: nowrap; max-width: 46vw; }
.regbtn:hover { border-color: var(--ink-3); }
.regbtn .rl { overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.regbtn .rs { display: none; }
.regbtn .dot { color: var(--ink-3); }
@media (max-width: 760px) { .regbtn { margin-left: auto; } .regbtn .rl { display: none; } .regbtn .rs { display: inline; } }
.drawer.to-right { justify-content: flex-end; }
.drawer .sheet.right { width: min(420px, 94vw); padding: calc(env(safe-area-inset-top, 0px) + 18px) max(18px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 24px) 18px; }
.sample { font-variant-numeric: tabular-nums; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface); border: 1px dashed var(--line); color: var(--ink-2); }
.linkbtn { border: 0; background: none; padding: 0 0 0 6px; color: var(--accent); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* engine controls */
.inp .usel { align-self: stretch; display: flex; border-left: 1px solid var(--line); flex: none; max-width: 52%; }
.inp .usel select { padding: 0 6px 0 10px; color: var(--ink-2); font-size: .9rem; background: var(--surface-2); border-radius: 0 var(--r-sm) var(--r-sm) 0; cursor: pointer; max-width: 100%; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 360px; }
.fh { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.fh .seg span { padding: 5px 10px; font-size: .82rem; }
.sbar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--sunk); }
.sbar i, .legend i.s0, .legend i.s1, .legend i.s2, .legend i.s3 { display: inline-block; }
.sbar i { height: 100%; }
.s0 { background: var(--accent); }
.s1 { background: var(--ticket-line); }
.s2 { background: var(--good); }
.s3 { background: var(--ink-3); }
.legend i.s0, .legend i.s1, .legend i.s2, .legend i.s3 { width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.mono { font-family: var(--f-mono); font-size: .88rem; overflow-wrap: anywhere; }
.outbox { font-family: var(--f-mono); font-size: .9rem; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 10px 12px; overflow-wrap: anywhere; white-space: pre-wrap; }
.outrow { display: grid; grid-template-columns: minmax(70px, auto) minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.outrow:last-child { border-bottom: 0; }
.outrow .lbl2 { font-size: .8rem; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }

/* category colours (mapped onto shared hues) */
:root { --c-finance: var(--h1); --c-business: var(--h2); --c-health: var(--h4); --c-fitness: var(--h5); --c-math: var(--h6); --c-transport: var(--h9); --c-everyday: var(--h3); --c-geometry: var(--h8); --c-trig: var(--h7); --c-stats: var(--h1); --c-physics: var(--h9); --c-data: var(--h2); --c-crypto: var(--h4); }

/* home: popular + categories */
.pop { display: flex; flex-wrap: wrap; gap: 8px; }
.pill .dot, .nav-others .dot { width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; flex: none; display: inline-block; }
.cats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.catcard { display: grid; grid-template-columns: 40px minmax(0, 1fr); grid-template-rows: auto auto; gap: 2px 12px; align-items: center; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s; }
.catcard:hover { border-color: var(--cat); transform: translateY(-1px); }
.catcard .mark { grid-row: 1 / span 2; width: 40px; height: 40px; }
.catcard .cn { font-family: var(--f-display); font-weight: 750; font-stretch: 90%; font-size: 1.08rem; line-height: 1.2; }
.catcard .cc { font-size: .82rem; color: var(--ink-3); }
.catcard .ce { grid-column: 1 / -1; font-size: .82rem; color: var(--ink-2); margin-top: 8px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cat-h { display: flex; gap: 16px; align-items: center; margin: 8px 0 22px; }
.cat-h h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 800; font-stretch: 82%; line-height: 1.05; }
.cat-h p { color: var(--ink-2); margin-top: 4px; }
.mark.big { width: 56px; height: 56px; border-radius: 14px; }
.mark.big .icon { width: 28px; height: 28px; }
.tools-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.toolcard { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); text-decoration: none; color: var(--ink); }
.toolcard:hover { border-color: var(--cat); }
.toolcard:hover .tn { color: var(--cat); }
.toolcard .tn { font-weight: 700; }
.toolcard .td { font-size: .88rem; color: var(--ink-3); line-height: 1.4; }

/* sidebar & drawer groups */
.nav-cat .cnt, .nav-group .cnt { margin-left: auto; font-size: .78rem; color: var(--ink-3); font-weight: 400; padding-left: 8px; }
.nav-others h3 { margin-left: 8px; }
.nav-others a { display: flex; align-items: center; padding-left: 12px; }
.nav-cat a { display: flex; align-items: baseline; }
.nav-group { border-bottom: 1px solid var(--line-2); }
.nav-group summary { display: flex; align-items: center; gap: 8px; padding: 12px 6px; cursor: pointer; font-weight: 700; list-style: none; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group .nav-cat { margin-bottom: 10px; }
.nav-group a.all { color: var(--accent); font-weight: 700; }

/* scientific calculator */
.calc-box { height: 58px; }
.calc-in { font-family: var(--f-mono) !important; font-size: 1.15rem !important; }
.keys { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.key { height: 46px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); font-family: var(--f-mono); font-size: .98rem; cursor: pointer; color: var(--ink); }
.key:hover { border-color: var(--ink-3); }
.key.num { background: var(--surface); font-weight: 600; }
.key.fn { color: var(--bad); font-family: var(--f-body); font-weight: 700; }
.key.eq { grid-column: span 3; background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 1.15rem; }

/* currency converter */
:root { --chart-line: #2443C8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --chart-line: #6E8BFA; } }
:root[data-theme="dark"] { --chart-line: #6E8BFA; }
.fx-pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: end; }
.fx-swap { height: 44px; width: 44px; padding: 0; border-radius: 50%; }
@media (max-width: 480px) { .fx-pair { grid-template-columns: minmax(0, 1fr); } .fx-swap { justify-self: center; transform: rotate(90deg); } }
.fx-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.fx-stats div { background: var(--surface-2); border-radius: var(--r-sm); padding: 8px 10px; }
.fx-stats span { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 700; }
.fx-stats b { font-variant-numeric: tabular-nums; }
.fx-wrap { position: relative; outline-offset: 4px; }
.fxchart { display: block; max-width: 100%; touch-action: pan-y; }
.fx-wrap { min-height: 200px; }
.fx-grid { stroke: var(--line-2); stroke-width: 1; }
.fx-base { stroke: var(--line); stroke-width: 1; }
.fx-ax { fill: var(--ink-3); font-size: 12px; font-family: var(--f-body); font-variant-numeric: tabular-nums; }
.fx-line { fill: none; stroke: var(--chart-line); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.fx-area { fill: color-mix(in srgb, var(--chart-line) 12%, transparent); stroke: none; }
.fx-end { fill: var(--chart-line); stroke: var(--surface); stroke-width: 2; }
.fx-cross { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.fx-tip { position: absolute; transform: translate(-50%, -100%); background: var(--ink); color: var(--bg); padding: 6px 10px; border-radius: 8px; font-size: .82rem; pointer-events: none; white-space: nowrap; display: flex; flex-direction: column; align-items: center; line-height: 1.3; }
.fx-tip strong { font-variant-numeric: tabular-nums; }
.fx-tip[hidden] { display: none !important; }
.fx-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 4px 20px; }
.fx-data { margin-top: 10px; }
/* home: tabbed quick card + markets strip */
.tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line-2); margin: -4px 0 16px; }
.tabs [role="tab"] { appearance: none; background: none; border: 0; border-bottom: 2.5px solid transparent; margin-bottom: -1px; padding: 6px 0 10px; font: inherit; font-family: var(--f-display); font-stretch: 90%; font-weight: 750; font-size: 1.08rem; color: var(--ink-3); cursor: pointer; }
.tabs [role="tab"]:hover { color: var(--ink); }
.tabs [role="tab"][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tabpanel:focus { outline: none; }
.hfx { display: grid; gap: 12px; }
.hfx .ticket .big { font-size: clamp(2rem, 5vw, 2.6rem); }
.hfx-more { display: inline-block; margin-top: 12px; font-size: .92rem; font-weight: 700; text-decoration: none; }
.hfx .hfx-more { margin-top: 0; }
.hfx-more:hover { text-decoration: underline; text-underline-offset: 3px; }
.hdemo .hint-l { color: var(--ink-2); font-size: .92rem; margin: 0 0 10px; }
.hdemo .rows + div { margin-top: 14px; }
.mkts-wrap { margin: 36px 0 24px; }
.mkts-wrap .dir-h { flex-wrap: wrap; }
.mkts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 820px) { .mkts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.mkt { display: flex; flex-direction: column; min-width: 0; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); padding: 14px 14px 12px; text-decoration: none; color: var(--ink); transition: border-color .15s; }
.mkt:hover { border-color: var(--accent); }
.mkt .mn { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-weight: 700; font-size: .95rem; }
.mkt .mn small { color: var(--ink-3); font-weight: 400; font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mkt .mp { font-family: var(--f-display); font-weight: 820; font-stretch: 78%; font-size: 1.7rem; line-height: 1.1; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.mkt .mp.long { font-size: 1.3rem; }
.mkt .mc { font-size: .85rem; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.mkt .mc.up { color: var(--good); } .mkt .mc.down { color: var(--bad); } .mkt .mc.flat { color: var(--ink-2); }
.mkt .mc span { color: var(--ink-3); font-weight: 400; }
.spark { position: relative; height: 34px; margin-top: 10px; }
.spark svg { display: block; width: 100%; height: 100%; overflow: visible; }
.spark path { fill: none; stroke: var(--chart-line); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.spark i { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--chart-line); box-shadow: 0 0 0 2px var(--surface); transform: translate(-50%, -50%); }
.mkt .mt { font-size: .76rem; color: var(--ink-3); margin-top: 8px; line-height: 1.3; }
@media (max-width: 480px) { .mkt { padding: 12px 12px 10px; } .mkt .mp { font-size: 1.4rem; } .mkt .mp.long { font-size: 1.12rem; } }
@media (max-width: 480px) { .hfx .fx-pair { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; } .hfx .fx-swap { transform: none; width: 40px; height: 40px; margin-bottom: 2px; } .hfx .inp select { padding-left: 8px; padding-right: 2px; } }
.mkts-g + .mkts-g { margin-top: 18px; }
.mkts-sub { font-family: var(--f-body); font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 8px; }
.mkts-wrap > .hfx-more { margin-top: 14px; }

/* about block (also the crawlable explanation on each tool page) */
.about { margin-top: 36px; max-width: 46em; }
.about h2 { font-size: 1.1rem; font-stretch: 92%; }
.about p { color: var(--ink-2); margin-top: 8px; font-size: .95rem; }

/* language links */
.langs { display: flex; flex-wrap: wrap; gap: 6px 16px; width: 100%; padding-top: 14px; margin-top: 6px; border-top: 1px solid var(--line-2); }
.langs a { color: var(--ink-2); text-decoration: none; font-size: .9rem; }
.langs a:hover, .langs a[aria-current="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.langs a[aria-current="true"] { font-weight: 700; }
.langlist .btn { justify-content: flex-start; }
#lang-btn { margin-left: 0; }
@media (max-width: 440px) { .regbtn { padding: 0 10px; gap: 0; } .regbtn > .icon, .regbtn .rs, .regbtn .dot { display: none; } .top-in { gap: 8px; } }
