/* ToolPunk design system, v3 "app" (25 Nov 2026). Brand: Pantone 294 C navy (#002F6C) + white.
   The site is laid out like an app (references: Google Drive, Adobe, Kalshi, Robinhood):
   a sidebar with "Open a file" on computers, a bottom tab bar on phones, cards with big numbers, quick actions.
   Flat navy is used for actions, selection and the logo only. No gradients, no glows, no glass.
   The app frame (sidebar, tab bar, search, sheets) is built by assets/shell.js; tool pages keep their own markup.
   Fonts: Archivo (variable width + weight) and Geist Mono (numbers, labels, file details), both OFL, self-hosted. */
@font-face { font-family: 'Archivo'; src: url('fonts/archivo-latin-var.woff2') format('woff2'); font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url('fonts/geist-mono-latin-var.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  color-scheme: light dark;
  --font: 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-display: var(--font);
  --mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --rail: #f4f5f7;
  --card: #ffffff;
  --surface: #f3f4f6;
  --hover: #eceef1;
  --text: #0f1115;
  --muted: #676b73;
  --line: #e5e7eb;
  --line-strong: #d2d5db;
  --accent: #002f6c;          /* Pantone 294 C */
  --accent-hover: #0a3f88;
  --accent-text: #1652a8;     /* links and small accents: a lighter step of 294 so it reads next to black text */
  --accent-soft: rgba(0, 47, 108, .07);
  --accent-ink: #ffffff;
  --accent-2: #002f6c;
  --glow: transparent;
  --ok: #0b7a4b;
  --ok-soft: rgba(11, 122, 75, .1);
  --warn: #9a5b00;
  --err: #c4261d;
  --shadow: 0 1px 2px rgba(15, 17, 21, .05);
  --pop: 0 24px 60px -24px rgba(15, 17, 21, .35), 0 2px 6px rgba(15, 17, 21, .06);
  --r: 14px;
  --r-sm: 10px;
  --rail-w: 252px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0d10;
    --bg-soft: #111317;
    --rail: #101216;
    --card: #15171c;
    --surface: #1b1e24;
    --hover: #22262d;
    --text: #f1f2f4;
    --muted: #979ba3;
    --line: #252930;
    --line-strong: #363b44;
    --accent: #1d4f9e;        /* 294 lifted for dark screens; white text still passes contrast (7.6:1) */
    --accent-hover: #2a5fb3;
    --accent-text: #9dbcf0;
    --accent-soft: rgba(80, 140, 235, .13);
    --accent-2: #1d4f9e;
    --ok: #46d39a;
    --ok-soft: rgba(70, 211, 154, .12);
    --warn: #f0b23c;
    --err: #ff7a70;
    --shadow: none;
    --pop: 0 30px 70px -24px rgba(0, 0, 0, .85), 0 0 0 1px #252930;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body { margin: 0; font: 400 15.5px/1.55 var(--font); color: var(--text); background: var(--bg); min-height: 100vh; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
::selection { background: var(--accent); color: var(--accent-ink); }
a { color: var(--accent-text); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.wrap { max-width: 780px; margin: 0 auto; padding: 0 24px; }
.i { width: 20px; height: 20px; flex: none; }

/* ======================= Tool pages (shared components) ======================= */
header.site { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 0 14px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 800 20px/1 var(--font); font-stretch: 125%; letter-spacing: -.035em; text-transform: lowercase; color: var(--text); text-decoration: none; }
.brand::before {
  content: ''; width: 24px; height: 24px; flex: none; background: var(--accent);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><path d='M14 44V14H44M86 56V86H56' fill='none' stroke='black' stroke-width='15'/><rect x='36' y='36' width='28' height='28'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><path d='M14 44V14H44M86 56V86H56' fill='none' stroke='black' stroke-width='15'/><rect x='36' y='36' width='28' height='28'/></svg>") center / contain no-repeat;
}
.pill { display: inline-flex; align-items: center; gap: 8px; font: 500 12px/1 var(--mono); color: var(--muted); white-space: nowrap; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 2px; background: var(--ok); }

h1 { font: 800 clamp(28px, 4.6vw, 40px)/1.05 var(--font); font-stretch: 112%; letter-spacing: -.035em; margin: 28px 0 12px; text-wrap: balance; }
h2, h3 { font-family: var(--font); font-stretch: 108%; letter-spacing: -.02em; }
.lede { color: var(--muted); margin: 0 0 24px; font-size: 16.5px; line-height: 1.5; max-width: 620px; text-wrap: pretty; }
.lede b { color: var(--text); font-weight: 600; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; box-shadow: var(--shadow); }
.unsupported { display: none; border: 1px solid var(--warn); color: var(--warn); background: color-mix(in srgb, var(--warn) 7%, transparent); border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 14px; }

/* Drop zone: the logo's two crop corners frame it and open wider when a file comes near */
.drop {
  --c: var(--accent); --len: 26px; --w: 3px;
  position: relative; display: block; border-radius: var(--r-sm); padding: 92px 16px 32px; text-align: center; cursor: pointer;
  background:
    linear-gradient(var(--c), var(--c)) top left / var(--len) var(--w) no-repeat,
    linear-gradient(var(--c), var(--c)) top left / var(--w) var(--len) no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / var(--len) var(--w) no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / var(--w) var(--len) no-repeat,
    var(--surface);
  transition: background-size .35s var(--ease), background-color .2s;
}
.drop::before { content: ''; position: absolute; top: 32px; left: 50%; width: 44px; height: 44px; margin-left: -22px; border-radius: 12px; background: var(--accent); transition: transform .3s var(--ease); }
.drop::after {
  content: ''; position: absolute; top: 32px; left: 50%; width: 44px; height: 44px; margin-left: -22px; background: var(--accent-ink);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M12 17V6'/><path d='m7 11 5-5 5 5'/></svg>") center / 22px no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M12 17V6'/><path d='m7 11 5-5 5 5'/></svg>") center / 22px no-repeat;
  transition: transform .3s var(--ease);
}
.drop:hover, .drop.over { --len: 60px; background-color: var(--accent-soft); }
.drop.over { --len: 50%; }
.drop:hover::before, .drop:hover::after, .drop.over::before, .drop.over::after { transform: translateY(-3px); }
.drop:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop b { display: block; font: 700 18px/1.25 var(--font); font-stretch: 106%; letter-spacing: -.015em; margin-bottom: 6px; }
.drop span { color: var(--muted); font: 400 12.5px/1.5 var(--mono); }

.file { display: none; margin-top: 14px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--surface); font-size: 15px; }
.file.show { display: block; }
.file .name { font-weight: 600; word-break: break-all; }
.meta { color: var(--muted); font: 400 12.5px/1.5 var(--mono); }

fieldset { border: 0; padding: 0; margin: 22px 0 0; min-width: 0; }
legend { padding: 0; margin-bottom: 10px; font: 500 11.5px/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span { display: inline-flex; align-items: baseline; gap: 7px; border: 1px solid var(--line-strong); background: var(--card); border-radius: 999px; padding: 8px 15px; cursor: pointer; user-select: none; font-size: 14.5px; font-weight: 600; transition: background-color .15s, border-color .15s, color .15s, transform .1s; }
.chip span:hover { border-color: var(--text); }
.chip span:active { transform: scale(.97); }
.chip small { color: var(--muted); font: 400 11.5px/1 var(--mono); }
.chip input:checked + span { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip input:checked + span small { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip input:disabled + span { opacity: .4; cursor: not-allowed; }
:where(input:not([type=radio], [type=checkbox], [type=file], [type=range], [type=color]), select, textarea) {
  font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 9px 12px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input, button, select, progress { accent-color: var(--accent); }
.custom input { width: 96px; font-family: var(--mono); }
.note { font-size: 14px; color: var(--muted); margin: 12px 0 0; min-height: 1.3em; }

.actions { display: flex; gap: 8px; margin-top: 22px; flex-wrap: wrap; }
button, .btn { font: 600 15px/1 var(--font); letter-spacing: -.005em; border-radius: 999px; padding: 14px 22px; border: 1px solid transparent; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .1s, background-color .15s, border-color .15s, color .15s; }
button:active, .btn:active { transform: scale(.98); }
button:focus-visible, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.primary { background: var(--accent); color: var(--accent-ink); }
.primary:hover { background: var(--accent-hover); }
.primary:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.ghost { background: var(--card); color: var(--text); border-color: var(--line-strong); }
.ghost:hover { background: var(--hover); }
a.btn[aria-disabled="true"] { opacity: .4; pointer-events: none; }

.progress { display: none; margin-top: 22px; }
.progress.show { display: block; }
progress { width: 100%; height: 6px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 99px; overflow: hidden; background: var(--surface); }
progress::-webkit-progress-bar { background: var(--surface); }
progress::-webkit-progress-value { background: var(--accent); border-radius: 99px; transition: width .2s; }
progress::-moz-progress-bar { background: var(--accent); }
.status { margin-top: 10px; font: 400 13px/1.5 var(--mono); min-height: 1.4em; }
.status.err { color: var(--err); }
.status.warn { color: var(--warn); }

.result { display: none; margin-top: 24px; border-top: 1px solid var(--line); padding-top: 22px; }
.result.show { display: block; animation: tp-rise .4s var(--ease) both; }
@keyframes tp-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.big { font: 800 clamp(28px, 4.6vw, 40px)/1.05 var(--font); font-stretch: 110%; letter-spacing: -.04em; font-variant-numeric: tabular-nums; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.big .smaller { font: 600 13px/1 var(--mono); letter-spacing: 0; color: var(--ok); background: var(--ok-soft); padding: 7px 10px; border-radius: 999px; }
video { display: block; width: 100%; max-height: 440px; margin-top: 16px; border-radius: var(--r-sm); background: #000; }

.faq { margin-top: 56px; }
.faq h2 { font-size: 22px; margin: 0 0 6px; }
details { border-bottom: 1px solid var(--line); padding: 15px 0; }
summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; font: 400 20px/1 var(--mono); color: var(--muted); transition: transform .25s var(--ease); }
details[open] summary::after { transform: rotate(45deg); }
details p { color: var(--muted); margin: 8px 0 0; }
footer { color: var(--muted); font: 400 12px/1.7 var(--mono); padding: 26px 0 44px; margin-top: 40px; border-top: 1px solid var(--line); }
footer a { color: var(--muted); }

/* ======================= App frame (assets/shell.js) ======================= */
.logo-mark { width: 24px; height: 24px; flex: none; color: var(--accent); }
.icon-btn { width: 40px; height: 40px; padding: 0; border-radius: 999px; background: transparent; color: var(--text); }
.icon-btn:hover { background: var(--hover); }
kbd { font: 500 11px/1 var(--mono); color: var(--muted); border: 1px solid var(--line-strong); border-radius: 5px; padding: 3px 5px; background: var(--card); }

/* Sidebar (computers) */
.rail { display: none; }
@media (min-width: 960px) {
  body.has-shell { padding-left: var(--rail-w); }
  .rail { display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: var(--rail-w); background: var(--rail); border-right: 1px solid var(--line); padding: 18px 14px; z-index: 20; overflow-y: auto; }
}
.rail-brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; font: 800 20px/1 var(--font); font-stretch: 125%; letter-spacing: -.035em; color: var(--text); text-decoration: none; }
.open-btn { width: 100%; justify-content: flex-start; gap: 12px; padding: 15px 18px; border-radius: 16px; background: var(--card); color: var(--text); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(15,17,21,.06), 0 4px 14px -6px rgba(15,17,21,.18); font-size: 15px; margin-bottom: 14px; }
.open-btn .i { color: var(--accent-text); width: 22px; height: 22px; }
.open-btn:hover { background: var(--hover); }
.rail-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border-radius: 999px; border: 0; background: none; color: var(--text); font: 500 14.5px/1.2 var(--font); text-decoration: none; text-align: left; cursor: pointer; justify-content: flex-start; }
.nav-item .i { width: 19px; height: 19px; color: var(--muted); }
.nav-item span { flex: 1; }
.nav-item em { font: 500 11.5px/1 var(--mono); font-style: normal; color: var(--muted); }
.nav-item kbd { padding: 2px 5px; }
.nav-item:hover { background: var(--hover); }
.nav-item.on { background: var(--accent-soft); color: var(--accent-text); font-weight: 650; }
.nav-item.on .i { color: var(--accent-text); }
.nav-item.soon { color: var(--muted); cursor: default; }
.nav-item.soon:hover { background: none; }
.nav-app { flex: none !important; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--accent); }
.nav-app .logo-mark { width: 14px; height: 14px; color: #fff; }
.nav-item.soon .nav-app { background: var(--line-strong); }
.rail-sec { margin: 18px 12px 6px; font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.rail-foot { margin-top: auto; display: flex; gap: 10px; align-items: flex-start; padding: 14px 12px 4px; border-top: 1px solid var(--line); }
.rail-foot b { display: block; font-size: 13px; font-weight: 600; }
.rail-foot span { display: block; font: 400 11.5px/1.4 var(--mono); color: var(--muted); }
.rail-foot .live { flex: none; width: 8px; height: 8px; margin-top: 5px; border-radius: 2px; background: var(--ok); }

/* Tool pages inside the app frame: an app bar with breadcrumbs (computers) or a back arrow (phones) */
.has-shell header.site { position: sticky; top: 0; z-index: 10; background: var(--bg); padding: 14px 0; min-height: 64px; }
.has-shell header.site .brand { display: none; }
.back, .bar-title { display: none; }
.crumbs { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { color: var(--line-strong); }
.crumbs .here { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.search-btn { margin-left: 4px; }
@media (max-width: 959px) {
  .has-shell.is-tool header.site { margin: 0 -24px; padding: 8px 12px; min-height: 56px; gap: 6px; }
  .is-tool .back { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; color: var(--text); flex: none; }
  .is-tool .back:hover { background: var(--hover); }
  .is-tool .bar-title { display: block; flex: 1; min-width: 0; font: 650 16px/1.2 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .is-tool .crumbs, .is-tool header.site .pill { display: none; }
}

/* Dialogs: bottom sheet on phones, centred card on computers */
dialog.sheet { border: 0; padding: 0; background: var(--card); color: var(--text); width: min(520px, calc(100% - 32px)); max-height: min(78vh, 720px); border-radius: 18px; box-shadow: var(--pop); overflow: hidden; display: flex; flex-direction: column; }
dialog.sheet:not([open]) { display: none; }
dialog.sheet.wide { width: min(640px, calc(100% - 32px)); }
dialog.sheet::backdrop { background: rgba(10, 12, 16, .45); }
dialog.sheet[open] { animation: tp-pop .22s var(--ease) both; }
@keyframes tp-pop { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 6px 22px; }
.sheet-head b { font: 700 17px/1.2 var(--font); font-stretch: 106%; }
.sheet-body { padding: 4px 14px 16px; overflow-y: auto; }
.sheet-label { margin: 14px 8px 6px; font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.palette .sheet-head { display: none; }
.palette .sheet-body { padding-top: 14px; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--card); }
.palette-input .i { color: var(--muted); }
.palette-input input { flex: 1; border: 0 !important; outline: 0 !important; padding: 14px 0 !important; font-size: 16px; background: transparent !important; }
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 14px; padding: 10px 10px; border-radius: 12px; color: var(--text); text-decoration: none; }
.row:hover, .row.sel { background: var(--hover); }
.row-ico, .app-ico { flex: none; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--surface); color: var(--text); }
.app-ico { background: var(--accent); }
.app-ico .logo-mark { color: #fff; width: 22px; height: 22px; }
.row.soon { opacity: .6; }
.row-txt { flex: 1; min-width: 0; }
.row-txt b { display: block; font-weight: 600; font-size: 15px; line-height: 1.3; }
.row-txt span { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-cat { font: 500 11.5px/1 var(--mono); color: var(--muted); }
.row-go { color: var(--muted); width: 18px; height: 18px; }
.picked { display: flex; align-items: center; gap: 14px; margin: 6px 8px 4px; padding: 14px; border-radius: 14px; background: var(--surface); }
.picked b { display: block; font-weight: 650; word-break: break-all; }
.picked span { font: 400 12.5px/1.4 var(--mono); color: var(--muted); }
.badge-ext { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; background: var(--accent); color: #fff; font: 600 12px/1 var(--mono); letter-spacing: .02em; }
.empty { color: var(--muted); padding: 14px 8px; font-size: 14px; }

/* Drop anywhere on the home screen */
.drop-veil { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 88%, transparent); opacity: 0; pointer-events: none; transition: opacity .15s; }
.drop-veil.on { opacity: 1; }
.drop-veil > div { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 48px 64px; border-radius: 22px; border: 2px dashed var(--accent); background: var(--card); }
.drop-veil .logo-mark { width: 44px; height: 44px; margin-bottom: 8px; }
.drop-veil b { font: 800 22px/1.2 var(--font); font-stretch: 110%; }
.drop-veil span { font: 400 13px/1.4 var(--mono); color: var(--muted); }

/* Bottom tab bar (phones, home screen) */
.tabbar { display: none; }
@media (max-width: 959px) {
  .has-shell.is-home { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--card); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tab { flex-direction: column; gap: 3px; padding: 6px 0; border-radius: 12px; background: none; color: var(--muted); font: 500 11px/1 var(--font); }
  .tab .i { width: 22px; height: 22px; }
  .tab.on { color: var(--text); font-weight: 650; }
  .tab.open { padding: 0; }
  .fab { display: grid; place-items: center; width: 52px; height: 52px; margin-top: -22px; border-radius: 18px; background: var(--accent); color: #fff; box-shadow: 0 10px 22px -10px rgba(0, 47, 108, .7); }
  .fab .i { width: 26px; height: 26px; }
  dialog.sheet { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 22px 22px 0 0; max-height: 86vh; padding-bottom: env(safe-area-inset-bottom); }
  dialog.sheet[open] { animation: tp-up .28s var(--ease) both; }
  @keyframes tp-up { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
}

/* ======================= Home screen ======================= */
.app-main { max-width: 1160px; margin: 0 auto; padding: 0 32px; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 14px 0; background: var(--bg); }
.top-brand { display: none; }
.topbar .search { flex: 1; max-width: 720px; position: relative; }
.topbar .search input[type=search] { width: 100%; padding: 13px 52px 13px 48px; border-radius: 999px; font-size: 15.5px; background: var(--surface); border: 1px solid transparent; transition: background-color .15s, border-color .15s, box-shadow .15s; }
.topbar .search input[type=search]:focus { background: var(--card); border-color: var(--line-strong); box-shadow: var(--pop); outline: none; }
.topbar .search::before {
  content: ''; position: absolute; left: 18px; top: 50%; width: 18px; height: 18px; margin-top: -9px; background: var(--muted); z-index: 1;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'><circle cx='11' cy='11' r='7'/><path d='m20 20-3.5-3.5'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'><circle cx='11' cy='11' r='7'/><path d='m20 20-3.5-3.5'/></svg>") center / contain no-repeat;
}
.topbar .search kbd { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); }
.topbar .pill { margin-left: auto; }

.eyebrow { display: inline-block; font: 500 12px/1 var(--mono); letter-spacing: .04em; color: var(--muted); }
.grad { color: var(--accent-text); }
.hello { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; align-items: stretch; padding: 22px 0 8px; }
.hello h1 { font-size: clamp(36px, 5.4vw, 60px); line-height: .98; font-stretch: 120%; letter-spacing: -.045em; margin: 14px 0 14px; }
.hello .lede { margin-bottom: 22px; }
.hello-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ticker { display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 28px; border-radius: 20px; background: var(--bg-soft); border-color: var(--line); }
.ticker .what, .device .what { font: 500 12px/1 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.ticker .num { font: 800 clamp(28px, 2.9vw, 42px)/1.05 var(--font); font-stretch: 106%; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.ticker .num s, .ticker .num i { white-space: nowrap; }
.ticker .num s { text-decoration: none; color: var(--muted); font-weight: 500; }
.ticker .num i { font-style: normal; color: var(--muted); font-weight: 400; margin: 0 .16em; }
.ticker .delta { align-self: flex-start; font: 600 14px/1 var(--mono); color: var(--ok); background: var(--ok-soft); padding: 8px 12px; border-radius: 999px; }
.tk-note { font-size: 13px; color: var(--muted); }

.block { margin-top: 40px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.block-head h2 { margin: 0; font-size: 20px; font-weight: 700; }
.count { font: 400 12.5px/1 var(--mono); color: var(--muted); }
.count b { color: var(--text); font-weight: 600; }
.link-btn { padding: 6px 10px; background: none; color: var(--accent-text); font-size: 13.5px; border-radius: 8px; }
.link-btn:hover { background: var(--hover); }

/* Quick actions (like Adobe's) */
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.qa { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; color: var(--text); text-decoration: none; background: var(--card); transition: border-color .2s, transform .2s var(--ease), box-shadow .2s; }
.qa:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--pop); }
.qa-art { display: grid; place-items: center; height: 132px; background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.qa-art svg { width: 160px; height: 96px; }
.qa-txt { padding: 14px 16px 16px; }
.qa-txt b { display: block; font-weight: 650; font-size: 15.5px; }
.qa-txt span { display: block; color: var(--muted); font-size: 13.5px; }
.a-line { fill: var(--card); stroke: var(--line-strong); stroke-width: 2; }
.a-fill { fill: var(--accent); }
.a-stroke { fill: none; stroke: var(--accent-text); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.a-mute { fill: var(--line-strong); }
.a-tag { font: 600 11px var(--mono); fill: var(--muted); }
.a-big { font: 800 17px var(--font); fill: var(--text); letter-spacing: -.02em; }
.a-tag-in { font: 600 11px var(--mono); fill: #fff; }

/* Recent + space saved (like a brokerage home screen) */
.split { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 14px; }
.split .card { border-radius: 20px; padding: 20px 22px; }
.recent .block-head { margin-bottom: 6px; }
.recent-list { display: flex; flex-direction: column; }
.recent-row { display: flex; align-items: center; gap: 14px; padding: 11px 8px; margin: 0 -8px; border-radius: 12px; color: var(--text); text-decoration: none; }
.recent-row:hover { background: var(--hover); }
.recent-num { text-align: right; font-variant-numeric: tabular-nums; }
.recent-num b { display: block; font: 600 14.5px/1.3 var(--mono); }
.recent-num span { font: 500 12px/1.3 var(--mono); color: var(--muted); }
.recent-num .down { color: var(--ok); }
.recent-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 18px 0 6px; }
.recent-empty b { font-weight: 650; }
.recent-empty span { color: var(--muted); font-size: 14px; }
.recent-empty button { margin-top: 10px; padding: 10px 16px; font-size: 14px; }
.device { display: flex; flex-direction: column; gap: 6px; }
.saved { font: 800 44px/1.05 var(--font); font-stretch: 110%; letter-spacing: -.045em; font-variant-numeric: tabular-nums; margin-top: 6px; }
.device .meta { margin-bottom: 14px; }
.bars { margin-top: auto; display: flex; align-items: flex-end; gap: 5px; height: 72px; }
.bars i { flex: 1; border-radius: 4px 4px 2px 2px; background: var(--accent); min-height: 4px; }
.bars i.none { background: var(--surface); }

/* All tools: category chips (like Kalshi) + cards */
.tabs { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 16px; padding-bottom: 2px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; padding: 8px 14px; font-size: 14px; font-weight: 600; background: var(--card); border: 1px solid var(--line-strong); color: var(--text); }
.tabs button:hover { background: var(--hover); }
.tabs button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.tabs button sup { font: 500 10.5px/1 var(--mono); opacity: .6; margin-left: 2px; vertical-align: 3px; }
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.tool { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--text); text-decoration: none; transition: border-color .15s, background-color .15s, transform .15s var(--ease); }
.tool:hover, .tool:focus-visible { border-color: var(--line-strong); background: var(--bg-soft); outline: none; }
.tool:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tool .ico { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); color: var(--text); transition: background-color .15s, color .15s; }
.tool:hover .ico { background: var(--accent); color: var(--accent-ink); }
.tool .ico svg { width: 20px; height: 20px; }
.tool .txt { min-width: 0; }
.tool .txt b { display: block; font: 600 15px/1.3 var(--font); }
.tool .txt span { display: block; color: var(--muted); font-size: 13px; line-height: 1.4; }

.why { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 48px; }
.why div { border: 1px solid var(--line); border-radius: 18px; padding: 20px; background: var(--bg-soft); }
.why b { display: block; font: 700 16px/1.25 var(--font); margin-bottom: 6px; }
.why p { margin: 0; color: var(--muted); font-size: 14px; }
.home .faq { max-width: 780px; }
.home footer { margin-top: 48px; }
.stats { display: none; }

.home > section, .home > .topbar { animation: tp-rise .5s var(--ease) both; }
.home > section:nth-of-type(2) { animation-delay: .04s; } .home > section:nth-of-type(3) { animation-delay: .08s; }
.home > section:nth-of-type(4) { animation-delay: .12s; }

@media (max-width: 1180px) { .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 959px) {
  .app-main { padding: 0 18px; }
  .top-brand { display: inline-flex; }
  .topbar { flex-wrap: wrap; gap: 10px 12px; padding: 12px 0 10px; }
  .topbar .search { order: 3; flex-basis: 100%; max-width: none; }
  .topbar .search kbd { display: none; }
  .hello { grid-template-columns: 1fr; gap: 18px; padding-top: 10px; }
  .split { grid-template-columns: 1fr; }
  .quick { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 18px; margin: 0 -18px; padding: 0 18px 4px; scrollbar-width: none; }
  .quick::-webkit-scrollbar { display: none; }
  .qa { flex: 0 0 72%; scroll-snap-align: start; }
  .tools { grid-template-columns: 1fr; gap: 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
  .tool { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
  .tool:last-child { border-bottom: 0; }
  .why { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .wrap { padding: 0 18px; }
  .has-shell.is-tool header.site { margin: 0 -18px; }
  .card { padding: 18px; }
  .topbar .pill { display: none; }
  .hello-actions .btn, .hello-actions button { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ======================= Credits and ad spaces ======================= */
.credit-pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px 7px 9px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--card); color: var(--text); font: 600 13.5px/1 var(--font); white-space: nowrap; }
.credit-pill .i { width: 17px; height: 17px; color: var(--accent-text); }
.credit-pill .credit-count { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.credit-pill:hover { background: var(--hover); }
.credit-pill.empty { border-color: var(--warn); color: var(--warn); }
.credit-pill.empty .i { color: var(--warn); }
.rail-credits { margin: -4px 0 12px; }
.rail-credits .credit-pill { width: 100%; justify-content: flex-start; padding: 10px 14px; border-radius: 14px; }
.topbar .credit-pill { flex: none; }
.has-shell header.site .credit-pill { margin-left: auto; }
@media (max-width: 520px) { .credit-label { display: none; } }
.credit-toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translate(-50%, 12px); opacity: 0; pointer-events: none; padding: 10px 16px; border-radius: 999px; background: var(--text); color: var(--bg); font: 600 14px/1 var(--font); transition: opacity .2s, transform .25s var(--ease); }
.credit-toast.on { opacity: 1; transform: translate(-50%, 0); }
.is-home .credit-toast { bottom: calc(88px + env(safe-area-inset-bottom)); }
.credits-body { padding: 0 22px 20px; }
.credit-big { display: block; font: 800 52px/1 var(--font); font-stretch: 110%; letter-spacing: -.04em; font-variant-numeric: tabular-nums; margin: 4px 0 10px; }
.credit-big small { font: 600 16px/1 var(--font); letter-spacing: 0; color: var(--muted); }
.credits-why { color: var(--muted); margin: 0; }
.credits-fine { font-size: 12.5px; color: var(--muted); margin: 14px 0 0; }
.sheet-note { font: 400 13px/1.5 var(--mono); color: var(--text); min-height: 1.5em; margin: 10px 0 0; }
.ad-slot { display: block; margin: 28px 0 0; }
.ad-slot .ad-label { display: block; font: 500 10.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.ad-slot .ad-box { display: grid; place-items: center; min-height: 120px; border: 1px dashed var(--line-strong); border-radius: 12px; color: var(--muted); font: 400 13px/1.4 var(--mono); text-align: center; padding: 12px; }
.rail-help { margin-top: 6px; }
.suggest-line { margin: 40px 0 0; font-size: 14px; color: var(--muted); }
.suggest-line a { font-weight: 600; }
.account-box { margin-top: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-soft); }
.account-title { display: block; font-weight: 650; }
.account-sub { display: block; color: var(--muted); font-size: 13px; margin: 2px 0 12px; }
.account-line { display: flex; gap: 10px; align-items: center; }
.account-line .i { color: var(--ok); }
.account-line b { display: block; font-weight: 650; }
.account-line small { display: block; color: var(--muted); font-size: 13px; }
.account-box .actions { margin-top: 12px; }
.ghost.danger { color: var(--err); border-color: color-mix(in srgb, var(--err) 45%, var(--line)); }
.credit-pill.synced .i { color: var(--ok); }

/* Home: categories first (show the breadth), then a compact grid of popular tools */
.h1-accent { color: var(--accent-text); }
.hello { grid-template-columns: minmax(0, 1fr); }
.hello-txt { max-width: 760px; }
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.cat { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s var(--ease), box-shadow .2s; }
.cat:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--pop); }
.cat-ico { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent); color: #fff; }
.cat-ico svg { width: 22px; height: 22px; }
.cat-txt { min-width: 0; }
.cat-txt b { display: block; font: 700 16px/1.25 var(--font); }
.cat-n { display: block; font: 500 12px/1.4 var(--mono); color: var(--accent-text); margin-top: 2px; }
.cat-txt small { display: block; color: var(--muted); font-size: 13px; line-height: 1.4; margin-top: 4px; }
.quick-mini { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; }
.qa-mini { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; border-radius: 16px; color: var(--text); text-decoration: none; text-align: center; font-size: 13px; font-weight: 600; line-height: 1.25; }
.qa-mini:hover { background: var(--hover); }
.qa-mini-ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); }
.qa-mini:hover .qa-mini-ico { background: var(--accent); border-color: var(--accent); color: #fff; }
.qa-mini-ico svg { width: 24px; height: 24px; }
@media (max-width: 1180px) { .quick-mini { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 959px) {
  .cats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cat { flex-direction: column; gap: 10px; padding: 14px; }
  .cat-txt small { display: none; }
  .quick-mini { gap: 4px; }
  .qa-mini { padding: 10px 2px; font-size: 12px; }
}

/* Phone app: clean screens. FAQ, "why us", footers and long intros are for the website (and search engines) only. */
.in-app .faq, .in-app .why, .in-app footer, .in-app .suggest-line, .in-app main > .lede, .in-app header.site .pill, .in-app .lic { display: none !important; }
.in-app main > h1 { margin-bottom: 18px; }
.credits-why { font-size: 15px; }
.recent-empty span { color: var(--muted); }
