/* PostWise design system.
 * Themes: system (default), light, dark via :root[data-theme]. Accent via [data-accent].
 * Density via [data-density=compact]. Motion via [data-motion=reduce] or the OS setting.
 * Shared by index.html, admin.html and ask.html: keep the token names stable. */

/* ------------------------------------------------------------------ tokens */
:root {
  --accent-l: #4f46e5; --accent-d: #8b85ff;
  --bg: #f7f6f3;
  --surface: #ffffff;
  --surface-2: #f2f1ed;
  --surface-3: #ebe9e3;
  --ink: #16161b;
  --ink-2: #3c3c46;
  --muted: #71707b;
  --line: #e7e5df;
  --line-2: #d6d3ca;
  --accent: var(--accent-l);
  --accent-ink: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 11%, var(--surface));
  --accent-glow: color-mix(in srgb, var(--accent) 35%, transparent);
  --green: #047857; --green-soft: #e1f5ec;
  --amber: #8a5a00; --amber-soft: #fff3d1;
  --red: #b42318; --red-soft: #fdeceb;
  --blue: #0369a1; --blue-soft: #e0f2fe;
  --violet-soft: color-mix(in srgb, var(--accent) 9%, var(--surface));
  --shadow: 0 1px 2px rgba(20, 20, 30, .04), 0 6px 20px rgba(20, 20, 30, .05);
  --shadow-lg: 0 24px 64px rgba(20, 20, 30, .18), 0 4px 12px rgba(20, 20, 30, .06);
  --radius: 14px;
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Instrument Serif', ui-serif, Georgia, serif;
  --mono: ui-monospace, 'SF Mono', Menlo, monospace;
  --row-pad: 11px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e12; --surface: #16161c; --surface-2: #1d1d24; --surface-3: #25252e; --ink: #f3f2ef; --ink-2: #d2d1cc; --muted: #9b9aa5;
    --line: #27272f; --line-2: #35353f; --accent: var(--accent-d); --accent-ink: #0e0e12;
    --green: #4ade9f; --green-soft: #0f2c21; --amber: #fbbf47; --amber-soft: #2f240b; --red: #ff8a80; --red-soft: #371614; --blue: #7dd3fc; --blue-soft: #0c2533;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35); --shadow-lg: 0 24px 64px rgba(0,0,0,.6); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0e12; --surface: #16161c; --surface-2: #1d1d24; --surface-3: #25252e; --ink: #f3f2ef; --ink-2: #d2d1cc; --muted: #9b9aa5;
  --line: #27272f; --line-2: #35353f; --accent: var(--accent-d); --accent-ink: #0e0e12;
  --green: #4ade9f; --green-soft: #0f2c21; --amber: #fbbf47; --amber-soft: #2f240b; --red: #ff8a80; --red-soft: #371614; --blue: #7dd3fc; --blue-soft: #0c2533;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35); --shadow-lg: 0 24px 64px rgba(0,0,0,.6); color-scheme: dark;
}
:root[data-accent="violet"] { --accent-l: #7c3aed; --accent-d: #b69cff; }
:root[data-accent="emerald"] { --accent-l: #047857; --accent-d: #34d399; }
:root[data-accent="ocean"] { --accent-l: #0369a1; --accent-d: #38bdf8; }
:root[data-accent="rose"] { --accent-l: #be123c; --accent-d: #fb7185; }
:root[data-accent="amber"] { --accent-l: #b45309; --accent-d: #fbbf24; }
:root[data-accent="graphite"] { --accent-l: #27272a; --accent-d: #e4e4e7; }
:root[data-density="compact"] { --row-pad: 6px; }
:root[data-text="large"] { font-size: 112.5%; }
:root[data-text="large"] body { font-size: 15.5px; }
:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before, :root[data-motion="reduce"] *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion="full"]) *, :root:not([data-motion="full"]) *::before, :root:not([data-motion="full"]) *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ------------------------------------------------------------------ base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01'; transition: background .3s var(--ease), color .3s var(--ease); }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; letter-spacing: -0.015em; }
h2 { font-size: 17px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0; }
a { color: var(--accent); }
code, kbd { font: 12px var(--mono); background: var(--surface-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; }
kbd { border-bottom-width: 2px; color: var(--ink-2); font-size: 11px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.sr, .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; transition: top .2s; }
.skip:focus { top: 12px; }
.row-gap { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.num, .tnum { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.logo { display: inline-block; width: 26px; height: 26px; border-radius: 8px; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M9 11h14M9 16h9M9 21h6' stroke='%23fff' stroke-width='2.4' stroke-linecap='round'/%3E%3Cpath d='m18.5 21 2.5 2.5 4.5-5' stroke='%23fff' stroke-width='2.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat; box-shadow: 0 4px 14px var(--accent-glow); transition: transform .4s var(--spring); flex: none; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-weight: 650; font-size: 16px; letter-spacing: -0.02em; }
.brand:hover .logo { transform: rotate(-8deg) scale(1.06); }

/* ------------------------------------------------------------------ controls */
button, .btn, .file-btn { font: inherit; cursor: pointer; border-radius: 10px; border: 1px solid transparent; padding: 8px 14px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: background .15s, border-color .15s, color .15s, transform .12s var(--ease), box-shadow .2s; white-space: nowrap; color: inherit; background: none; text-decoration: none; position: relative; overflow: hidden; -webkit-tap-highlight-color: transparent; }
button:active:not(:disabled), .btn:active, .file-btn:active { transform: scale(.97); }
button:disabled { opacity: .5; cursor: not-allowed; }
.primary { background: var(--ink); color: var(--bg); }
.primary:hover:not(:disabled) { background: var(--ink-2); }
.accent { background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 16px var(--accent-glow); }
.accent:hover:not(:disabled) { filter: brightness(1.06); box-shadow: 0 6px 22px var(--accent-glow); }
.glow { box-shadow: 0 0 0 0 var(--accent-glow); animation: glow 3s var(--ease) infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 6px transparent, 0 6px 24px var(--accent-glow); } }
.big { padding: 12px 18px; font-size: 15px; width: 100%; }
.ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.ghost:hover:not(:disabled) { background: var(--surface-2); }
.quiet { color: var(--ink-2); }
.quiet:hover:not(:disabled) { background: var(--surface-2); }
.danger { background: var(--red-soft); color: var(--red); }
.danger:hover:not(:disabled) { filter: brightness(.97); }
.danger.solid { background: var(--red); color: #fff; }
button.small, .btn.small, .file-btn.small { padding: 6px 11px; border-radius: 8px; font-size: 12.5px; }
.link { background: none; border: none; color: var(--accent); padding: 0; font-weight: 500; text-decoration: none; overflow: visible; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link.muted { color: var(--muted); }
.icon-btn { width: 36px; height: 36px; padding: 0; border-radius: 10px; color: var(--ink-2); }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.file-btn input { display: none; }
.ripple-ink { position: absolute; border-radius: 50%; transform: scale(0); background: currentColor; opacity: .22; pointer-events: none; animation: ripple .55s var(--ease) forwards; }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }

input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=url], input:not([type]), input[inputmode], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 12px; width: 100%; outline: none; transition: border-color .15s, box-shadow .2s, background .15s; min-width: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }
textarea { resize: vertical; line-height: 1.55; }
textarea.mono { font: 13px/1.6 var(--mono); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2374737d' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px; cursor: pointer; }
label { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin: 14px 0 6px; }
label.check { display: inline-flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; cursor: pointer; flex: none; }
.error { color: var(--red); font-size: 13px; min-height: 18px; margin: 8px 0 2px; }
.error:empty { min-height: 0; margin: 0; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* switch */
.switch { position: relative; display: inline-flex; width: 40px; height: 24px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--line-2); border-radius: 99px; transition: background .2s; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .3s var(--spring); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* segmented */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; flex-wrap: wrap; position: relative; }
.seg button { padding: 5px 11px; font-size: 13px; color: var(--muted); border-radius: 8px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px var(--line); }
.seg .n { font-size: 11px; margin-left: 5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* chips */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { background: var(--surface); border: 1px solid var(--line-2); color: var(--ink-2); border-radius: 99px; padding: 6px 12px; font-size: 12.5px; font-weight: 500; }
.chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.chip[aria-pressed="true"], .chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .i { width: 14px; height: 14px; }

/* pills and badges */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 99px; white-space: nowrap; line-height: 1.4; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.High { background: var(--green-soft); color: var(--green); }
.pill.Medium { background: var(--violet-soft); color: var(--accent); }
.pill.Low { background: var(--amber-soft); color: var(--amber); }
.pill.Reviewed, .pill.neutral { background: var(--surface-2); color: var(--ink-2); }
.pill.bad { background: var(--red-soft); color: var(--red); }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.pill.nodot::before { display: none; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.badge .i { width: 12px; height: 12px; }
.badge.ai { background: linear-gradient(120deg, var(--accent-soft), color-mix(in srgb, #ec4899 10%, var(--surface))); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.badge.warn { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.badge.bad { background: var(--red-soft); color: var(--red); border-color: transparent; }
.badge.ok { background: var(--green-soft); color: var(--green); border-color: transparent; }
.badge.blue { background: var(--blue-soft); color: var(--blue); border-color: transparent; }
.count { font-size: 11px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); border-radius: 99px; padding: 0 7px; font-variant-numeric: tabular-nums; line-height: 18px; }
.count.hot { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.count:empty { display: none; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 14px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card h2 + p.muted { margin-top: 4px; }

/* ------------------------------------------------------------------ landing */
#landing { overflow-x: clip; }
.lnav { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px; padding: 12px max(16px, calc((100vw - 1200px) / 2)); background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: saturate(1.5) blur(16px); -webkit-backdrop-filter: saturate(1.5) blur(16px); border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.lnav-links { display: flex; gap: 22px; margin-left: 18px; }
.lnav-links a { color: var(--ink-2); text-decoration: none; font-size: 13.5px; font-weight: 500; }
.lnav-links a:hover { color: var(--ink); }
.lnav-cta { margin-left: auto; display: flex; gap: 8px; }
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 56px; align-items: center; max-width: 1200px; margin: 0 auto; padding: 64px 16px 40px; }
.aurora { position: absolute; inset: -120px -20vw auto; height: 640px; z-index: -1; filter: blur(60px); opacity: .55; pointer-events: none; }
.aurora i { position: absolute; border-radius: 50%; mix-blend-mode: multiply; animation: drift 18s ease-in-out infinite alternate; }
.aurora i:nth-child(1) { width: 520px; height: 420px; left: 8%; top: 40px; background: color-mix(in srgb, var(--accent) 45%, transparent); }
.aurora i:nth-child(2) { width: 460px; height: 380px; left: 45%; top: 0; background: #f9a8d4; animation-delay: -6s; animation-duration: 22s; }
.aurora i:nth-child(3) { width: 420px; height: 360px; left: 62%; top: 160px; background: #7dd3fc; animation-delay: -11s; animation-duration: 26s; }
:root[data-theme="dark"] .aurora i { mix-blend-mode: screen; opacity: .5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .aurora i { mix-blend-mode: screen; opacity: .5; } }
@keyframes drift { to { transform: translate(60px, 40px) scale(1.15) rotate(12deg); } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; letter-spacing: .02em; color: var(--accent); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent); padding: 5px 12px 5px 10px; border-radius: 99px; margin-bottom: 20px; }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent-glow); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.display { font-family: var(--serif); font-weight: 400; font-size: clamp(46px, 6.4vw, 84px); line-height: .98; letter-spacing: -0.025em; }
.display em { background: linear-gradient(100deg, var(--accent), #db2777 60%, var(--accent)); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: sheen 6s linear infinite; padding-right: .06em; }
@keyframes sheen { to { background-position: 200% center; } }
.lede { color: var(--ink-2); font-size: 17px; line-height: 1.6; margin: 22px 0 30px; max-width: 560px; }
.hero-proof { display: flex; gap: 28px; flex-wrap: wrap; }
.hero-proof div { display: flex; flex-direction: column; }
.hero-proof b { font-size: 34px; font-weight: 650; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.hero-proof span { font-size: 12.5px; color: var(--muted); max-width: 150px; }
.glass { background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4); }
.demo { max-width: 1000px; margin: 20px auto 0; padding: 0 16px; }
.demo-card { background: #13121c; color: #ecebf5; border-radius: 22px; padding: 16px; box-shadow: 0 40px 100px rgba(20, 16, 60, .35); border: 1px solid rgba(255,255,255,.08); position: relative; overflow: hidden; }
.demo-card::before { content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: linear-gradient(130deg, rgba(139,133,255,.6), transparent 40%, rgba(244,114,182,.5)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.demo-head { display: flex; align-items: center; gap: 12px; font-size: 12.5px; font-weight: 600; padding: 2px 4px 12px; }
.demo-head .pill-soft { margin-left: auto; }
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.dots i:nth-child(2) { background: #febc2e; } .dots i:nth-child(3) { background: #28c840; }
.pill-soft { font-size: 11px; font-weight: 600; background: rgba(255,255,255,.1); padding: 3px 9px; border-radius: 99px; transition: background .3s; }
.pill-soft.done { background: #34d399; color: #062c1f; }
.demo-rows { list-style: none; margin: 0; padding: 0; }
.demo-rows li { display: grid; grid-template-columns: 52px minmax(0, 1.3fr) minmax(0, 1fr) 96px; gap: 12px; align-items: center; font-size: 12.5px; padding: 10px 6px; border-top: 1px solid rgba(255,255,255,.07); min-height: 44px; }
.demo-rows .d { color: #8f8daa; font-variant-numeric: tabular-nums; }
.demo-rows .raw { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); font-size: 11.5px; color: #b6b4d0; transition: color .3s; }
.demo-rows .raw.clean { font-family: var(--font); font-size: 12.5px; color: #fff; font-weight: 600; }
.demo-rows .acct { justify-self: start; display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.08); padding: 3px 9px; border-radius: 7px; font-size: 11.5px; white-space: nowrap; opacity: 0; transform: translateY(6px) scale(.96); transition: opacity .4s var(--ease), transform .5s var(--spring); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.demo-rows .acct.in { opacity: 1; transform: none; }
.demo-rows .acct i { width: 7px; height: 7px; border-radius: 2px; flex: none; }
.demo-rows .acct.q { background: rgba(251,191,71,.16); color: #fcd581; }
.demo-rows .amt { text-align: right; font-variant-numeric: tabular-nums; }
.demo-rows .amt.in { color: #6ee7b7; }
.demo-q { margin-top: 10px; background: rgba(139,133,255,.13); border: 1px solid rgba(139,133,255,.35); border-radius: 14px; padding: 12px 14px; display: flex; gap: 10px 16px; align-items: center; flex-wrap: wrap; font-size: 13px; opacity: .4; transition: opacity .5s; }
.demo-q.live { opacity: 1; }
.demo-q em { font-style: normal; font-size: 12px; padding: 4px 10px; border-radius: 99px; background: rgba(255,255,255,.08); }
.demo-q em.on { background: #8b85ff; color: #0d0c16; font-weight: 600; }
.demo-q-note { color: #b6b3d6; font-size: 12px; margin-left: auto; }
.section-title { font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 4vw, 48px); line-height: 1.05; letter-spacing: -0.02em; text-align: center; max-width: 760px; margin: 0 auto 36px; }
.how, .features, .faq { max-width: 1200px; margin: 0 auto; padding: 96px 16px 0; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 26px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.step-n { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--accent); color: var(--accent-ink); font-weight: 700; margin-bottom: 18px; box-shadow: 0 6px 18px var(--accent-glow); }
.step h3 { font-size: 18px; margin-bottom: 8px; }
.step p { color: var(--ink-2); line-height: 1.6; }
.fgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.fcard { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; transition: transform .35s var(--spring), box-shadow .35s, border-color .3s; }
.fcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.fcard h3 { margin: 14px 0 6px; font-size: 16px; }
.fcard p { color: var(--ink-2); line-height: 1.55; font-size: 13.5px; }
.ficon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.privacy { margin: 96px 16px 0; }
.privacy-inner { max-width: 900px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: 26px; padding: 44px clamp(20px, 5vw, 56px); box-shadow: var(--shadow); }
.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.plain li { position: relative; padding-left: 34px; color: var(--ink-2); line-height: 1.6; font-size: 15px; }
.plain li::before { content: ''; position: absolute; left: 0; top: 2px; width: 22px; height: 22px; border-radius: 7px; background: var(--green-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' stroke='%23059669' stroke-width='2.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat; }
.plain b { color: var(--ink); }
.faq { max-width: 760px; padding-bottom: 40px; }
.faq details { border-bottom: 1px solid var(--line); padding: 18px 4px; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 16px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--muted); font-weight: 400; font-size: 22px; line-height: 1; transition: transform .3s var(--spring); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--ink-2); margin-top: 10px; line-height: 1.6; }
.lfoot { max-width: 1200px; margin: 60px auto 0; padding: 30px 16px 50px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.brand.small { font-size: 14px; } .brand.small .logo { width: 20px; height: 20px; border-radius: 6px; }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease) var(--d, 0s), transform .8s var(--ease) var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }

/* ------------------------------------------------------------------ auth card */
.auth { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 28px 26px 24px; box-shadow: var(--shadow-lg); position: relative; }
.auth h2 { font-size: 24px; font-weight: 650; letter-spacing: -0.025em; }
.auth .sub { margin: 6px 0 8px; font-size: 14px; color: var(--muted); }
.auth form { margin: 0; }
.auth .big { margin-top: 18px; }
.auth-anim { animation: authIn .45s var(--ease); }
@keyframes authIn { from { opacity: 0; transform: translateY(10px) scale(.99); } }
.field-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.field-head label { margin-bottom: 6px; }
.field-head .link { font-size: 12.5px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 62px; }
.pw-eye { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 12px; font-weight: 600; padding: 6px 9px; }
.pw-eye:hover { color: var(--ink); background: var(--surface-2); }
.pw-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 10px; }
.pw-meter i { height: 4px; border-radius: 99px; background: var(--line); transition: background .3s; }
.pw-meter[data-score="1"] i:nth-child(-n+1) { background: var(--red); }
.pw-meter[data-score="2"] i:nth-child(-n+2) { background: var(--amber); }
.pw-meter[data-score="3"] i:nth-child(-n+3) { background: #65a30d; }
.pw-meter[data-score="4"] i { background: var(--green); }
.pw-rules { list-style: none; padding: 0; margin: 8px 0 0; display: flex; gap: 4px 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.pw-rules li::before { content: '○'; margin-right: 5px; }
.pw-rules li.ok { color: var(--green); }
.pw-rules li.ok::before { content: '✓'; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 18px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.switch-line { text-align: center; font-size: 13.5px; color: var(--muted); margin-top: 18px; }
.fine { font-size: 12.5px; color: var(--muted); margin-top: 14px; }
.center { text-align: center; }
.mail-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 14px; animation: bob 2.6s ease-in-out infinite; }
.mail-icon .i { width: 24px; height: 24px; }
@keyframes bob { 50% { transform: translateY(-4px); } }
.codes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.codes input { text-align: center; font-size: 24px; font-weight: 600; padding: 12px 0; font-variant-numeric: tabular-nums; border-radius: 12px; caret-color: var(--accent); }
.codes input.filled { border-color: var(--accent); background: var(--accent-soft); animation: pop .25s var(--spring); }
.codes.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes pop { from { transform: scale(.85); } }
.lock { background: var(--amber-soft); color: var(--amber); border-radius: 12px; padding: 12px 14px; font-size: 13px; margin-top: 14px; }
.lock b { display: block; margin-bottom: 2px; }

/* ------------------------------------------------------------------ app shell */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 14px; padding: 16px 12px; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 55%, var(--bg)); }
.side > .brand { padding: 4px 8px 2px; }
.client-switch { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; text-align: left; justify-content: flex-start; box-shadow: var(--shadow); }
.client-switch:hover { border-color: var(--line-2); }
.client-switch .i { margin-left: auto; color: var(--muted); width: 16px; height: 16px; }
.client-text { display: flex; flex-direction: column; min-width: 0; }
.client-text small { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.client-text b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-avatar { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; flex: none; background: var(--accent); }
.nav { display: flex; flex-direction: column; gap: 1px; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.nav .nav-h { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--ink-2); text-decoration: none; font-weight: 500; position: relative; transition: background .15s, color .15s; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line), var(--shadow); }
.nav a[aria-current="page"] .i { color: var(--accent); }
.nav a .i { color: var(--muted); }
.nav a .count { margin-left: auto; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.cmdk { justify-content: flex-start; gap: 9px; width: 100%; padding: 8px 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 13px; border-radius: 10px; }
.cmdk:hover { color: var(--ink); border-color: var(--line-2); }
.cmdk kbd { margin-left: auto; }
.me { justify-content: flex-start; gap: 10px; width: 100%; padding: 6px 8px; border-radius: 12px; text-align: left; }
.me:hover { background: var(--surface-2); }
.me .i { margin-left: auto; color: var(--muted); width: 16px; height: 16px; }
.me-text { display: flex; flex-direction: column; min-width: 0; }
.me-text b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #ec4899)); flex: none; }
.mtop, .tabbar { display: none; }
.main { min-width: 0; padding: 26px clamp(16px, 3vw, 40px) 120px; outline: none; }
.view-enter { animation: viewIn .4s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 3.4vw, 42px); letter-spacing: -0.02em; line-height: 1.05; }
.page-head p { color: var(--muted); margin-top: 6px; max-width: 680px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ review */
.drop { position: relative; border: 1.5px dashed var(--line-2); border-radius: 24px; background: var(--surface); padding: 56px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); transition: border-color .2s, background .2s, transform .3s var(--spring); overflow: hidden; }
.drop::before { content: ''; position: absolute; inset: 0; background: radial-gradient(500px 220px at 50% 0%, var(--accent-soft), transparent 70%); opacity: .8; pointer-events: none; }
.drop > * { position: relative; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.01); }
.drop-art { width: 72px; height: 72px; border-radius: 20px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--accent); margin-bottom: 10px; animation: bob 3s ease-in-out infinite; }
.drop-art .i { width: 32px; height: 32px; }
.drop-title { font-size: 22px; font-weight: 600; color: var(--ink); letter-spacing: -0.02em; }
.drop-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; justify-content: center; }
.formats { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 18px; }
.onboard { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.onboard div { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; font-size: 13px; color: var(--ink-2); }
.onboard b { display: block; color: var(--ink); margin-bottom: 4px; }
.filebar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.filebar h1 { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; word-break: break-word; font-family: var(--font); }
.filemeta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 5px; color: var(--muted); font-size: 13px; }
.acct-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line-2); font-size: 12.5px; font-weight: 500; color: var(--ink-2); cursor: pointer; }
.acct-chip:hover { border-color: var(--accent); color: var(--accent); }
.stats { display: grid; grid-template-columns: minmax(200px, 1.25fr) repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); transition: transform .3s var(--spring), box-shadow .3s; position: relative; overflow: hidden; }
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat b { display: block; font-size: 26px; font-weight: 650; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat span { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat.ring { display: flex; align-items: center; gap: 14px; }
.ring svg { width: 64px; height: 64px; transform: rotate(-90deg); flex: none; }
.ring circle { fill: none; stroke-width: 7; }
.ring .track { stroke: var(--surface-3); }
.ring .bar { stroke: var(--green); stroke-linecap: round; transition: stroke-dashoffset .9s var(--ease); }
.stat.saved b { background: linear-gradient(90deg, var(--accent), #db2777); -webkit-background-clip: text; background-clip: text; color: transparent; }
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); margin-bottom: 12px; font-size: 13.5px; animation: viewIn .4s var(--ease); flex-wrap: wrap; }
.banner .i { color: var(--accent); }
.banner.warn { background: var(--amber-soft); border-color: transparent; color: var(--amber); }
.banner.warn .i { color: var(--amber); }
.banner.bad { background: var(--red-soft); border-color: transparent; color: var(--red); }
.banner.bad .i { color: var(--red); }
.banner.ok { background: var(--green-soft); border-color: transparent; color: var(--green); }
.banner.ok .i { color: var(--green); }
.banner .grow { flex: 1; min-width: 200px; }
.banner .problems { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; }
.progress { height: 5px; background: var(--surface-3); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #ec4899, var(--accent)); background-size: 200% 100%; animation: sheen 1.4s linear infinite; transition: width .4s var(--ease); border-radius: 99px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid color-mix(in srgb, currentColor 25%, transparent); border-top-color: currentColor; animation: spin .7s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* questions card */
.questions { margin-bottom: 14px; border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); background: linear-gradient(180deg, var(--accent-soft), var(--surface) 80%); position: relative; overflow: hidden; }
.q-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-bottom: 12px; }
.q-head p { color: var(--ink-2); font-size: 13px; }
.q-list { display: grid; gap: 8px; }
.q { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; transition: transform .4s var(--ease), opacity .4s; }
.q.leaving { opacity: 0; transform: translateX(30px) scale(.98); }
.q-num { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.q-meta { font-size: 12px; color: var(--muted); }
.q-other { display: flex; gap: 8px; margin-top: 8px; }
.answered { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; font-size: 12.5px; color: var(--ink-2); align-items: center; }
.answered .badge { font-weight: 500; cursor: pointer; }

/* recurring strip */
.recur { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; margin-bottom: 8px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.recur-card { flex: 0 0 256px; scroll-snap-align: start; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.recur-card h3 { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: 6px; align-items: center; }
.recur-card .meta { font-size: 12px; color: var(--muted); }
.recur-card .row-gap { margin-top: 4px; }
.section-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 6px 0 8px; display: flex; gap: 8px; align-items: center; }

.toolbar { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; margin: 6px 0 12px; }
.toolbar-right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search { position: relative; }
.search .i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.search input { padding: 7px 34px 7px 32px; width: 230px; }
.search kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }

/* the table */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
.tx th { position: sticky; top: 0; z-index: 2; background: var(--surface); text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tx td { padding: var(--row-pad) 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tx tr:last-child td { border-bottom: none; }
.tx tbody tr { transition: background .15s, opacity .3s; }
.tx tbody tr.enter { animation: rowIn .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 16ms); }
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } }
.tx tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.tx tbody tr.cursor { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.tx tbody tr.sel { background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.tx tbody tr.done .payee { color: var(--muted); }
.tx tbody tr.posting { animation: posting 1.2s var(--ease); }
@keyframes posting { 0% { background: transparent; } 30% { background: color-mix(in srgb, var(--green) 18%, transparent); } 100% { background: transparent; } }
.tx tbody tr.thinking td.c-acct { position: relative; }
.tx tbody tr.thinking td.c-acct::after { content: ''; position: absolute; inset: 8px 12px; border-radius: 8px; background: linear-gradient(90deg, var(--surface-2), var(--accent-soft), var(--surface-2)); background-size: 200% 100%; animation: sheen 1.2s linear infinite; }
.c-sel { width: 36px; padding-right: 0 !important; }
.tx td.c-sel { padding-top: calc(var(--row-pad) + 3px); }
.c-date { width: 92px; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 13px; }
.c-amt { width: 112px; text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.amt-in { color: var(--green); }
.c-type { width: 132px; }
.c-acct { width: 270px; }
.c-conf { width: 98px; }
.c-ok { width: 46px; text-align: center; }
.payee { font-weight: 600; word-break: break-word; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.desc { font-size: 11.5px; color: var(--muted); word-break: break-word; font-family: var(--mono); margin-top: 1px; }
.note { font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.note.ask { color: var(--amber); }
.note .edited { color: var(--accent); font-weight: 600; }
.note .client-said { color: var(--blue); font-weight: 600; }
.tx select.type { padding: 6px 26px 6px 9px; font-size: 13px; border-radius: 8px; border-color: var(--line); background-position: right 8px center; }
.why { cursor: help; }
.okbtn { width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 1.5px solid var(--line-2); background: var(--surface); color: transparent; overflow: visible; }
.okbtn:hover { border-color: var(--green); color: var(--green); }
.okbtn[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }
.okbtn.pop { animation: okPop .45s var(--spring); }
@keyframes okPop { 40% { transform: scale(1.25); } }
.okbtn svg { width: 15px; height: 15px; }
.okbtn.pop svg path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw .35s .05s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.row-tools { display: flex; gap: 2px; margin-top: 6px; flex-wrap: wrap; }
.row-tools button { font-size: 11.5px; padding: 3px 8px; border-radius: 6px; color: var(--muted); }
.row-tools button:hover { background: var(--surface-2); color: var(--ink); }
.splits { font-size: 12px; color: var(--ink-2); margin-top: 6px; display: grid; gap: 2px; }
.empty { padding: 48px 24px; text-align: center; color: var(--muted); }
.empty-art { font-size: 44px; margin-bottom: 8px; animation: bob 3s ease-in-out infinite; display: inline-block; }
.empty h3 { color: var(--ink); font-size: 18px; margin-bottom: 4px; }
.zero { padding: 56px 24px; text-align: center; }
.zero .big-check { width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 16px; display: grid; place-items: center; background: var(--green); color: #fff; box-shadow: 0 0 0 10px var(--green-soft), 0 20px 50px color-mix(in srgb, var(--green) 40%, transparent); animation: okPop .7s var(--spring); }
.zero .big-check svg { width: 40px; height: 40px; }
.zero .big-check path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw .6s .25s var(--ease) forwards; }
.zero h3 { font-family: var(--serif); font-weight: 400; font-size: 34px; color: var(--ink); }
.zero p { color: var(--muted); margin-top: 6px; }

/* combobox */
.combo { position: relative; }
.combo input { padding: 6px 28px 6px 10px; font-size: 13px; border-radius: 8px; border-color: var(--line); }
.combo input:hover { border-color: var(--line-2); }
.combo input.blank { background: var(--amber-soft); border-color: transparent; color: var(--amber); }
.combo input.blank::placeholder { color: var(--amber); opacity: .95; }
.combo input.ai { background: linear-gradient(120deg, var(--accent-soft), color-mix(in srgb, #ec4899 7%, var(--surface))); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.combo .caret { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; width: 14px; height: 14px; }
.pop { position: fixed; z-index: 60; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 5px; max-height: 300px; overflow-y: auto; min-width: 220px; animation: popIn .16s var(--ease); }
@keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.pop .opt { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border-radius: 8px; text-align: left; justify-content: flex-start; font-size: 13px; font-weight: 450; color: var(--ink); white-space: normal; }
.pop .opt[aria-selected="true"], .pop .opt:hover { background: var(--accent-soft); color: var(--accent); }
.pop .opt mark { background: none; color: var(--accent); font-weight: 650; }
.pop .opt small { margin-left: auto; color: var(--muted); font-size: 11px; }
.pop .opt.new { color: var(--accent); font-weight: 600; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; margin-top: 4px; }
.pop .group { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 8px 10px 4px; }
.tip { position: fixed; z-index: 70; max-width: 300px; background: var(--ink); color: var(--bg); font-size: 12.5px; line-height: 1.45; padding: 10px 12px; border-radius: 10px; box-shadow: var(--shadow-lg); pointer-events: none; animation: popIn .14s var(--ease); }
.tip b { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; opacity: .7; margin-bottom: 3px; }

/* bulk bar */
.bulkbar { position: fixed; left: calc(50% + 126px); bottom: 22px; transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 8px; background: #16151c; color: #f2f1ee; border-radius: 18px; padding: 8px 8px 8px 16px; box-shadow: var(--shadow-lg); max-width: calc(100vw - 32px); animation: rise .3s var(--spring); }
.bulkbar > span { font-size: 13px; color: #b9b8c2; margin-right: 4px; white-space: nowrap; }
.bulkbar .combo input { width: 220px; background: #26252e; border-color: #34333d; color: #f2f1ee; }
.bulkbar button { background: #26252e; color: #f2f1ee; border: 1px solid #34333d; padding: 7px 13px; font-size: 13px; }
.bulkbar button:hover { background: #312f3a; }
.bulkbar button.go { background: #34d399; color: #062c1f; border-color: transparent; font-weight: 600; }
@keyframes rise { from { transform: translate(-50%, 16px); opacity: 0; } }

/* reconciliation */
.recon { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(200px, 1.3fr); gap: 12px; align-items: end; }
.recon .fig { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; }
.recon .fig small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.recon label { margin-top: 0; }
.tie { border-radius: 14px; padding: 12px 14px; font-weight: 600; display: flex; align-items: center; gap: 10px; transition: background .3s, color .3s; }
.tie.ok { background: var(--green-soft); color: var(--green); }
.tie.off { background: var(--red-soft); color: var(--red); }
.tie.wait { background: var(--surface-2); color: var(--muted); font-weight: 500; }
.tie b { font-size: 20px; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ layers */
.toasts { position: fixed; right: 22px; bottom: 22px; z-index: 80; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; width: min(420px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 14px 16px; display: grid; gap: 8px; animation: toastIn .45s var(--spring); position: relative; overflow: hidden; }
.toast.out { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn { from { transform: translateY(16px) scale(.96); opacity: 0; } }
@keyframes toastOut { to { transform: translateX(30px); opacity: 0; } }
.toast .t-title { font-weight: 650; font-size: 13.5px; display: flex; gap: 8px; align-items: center; }
.toast .t-title::before { content: ''; width: 18px; height: 18px; border-radius: 6px; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' stroke='%23fff' stroke-width='3' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat; flex: none; }
.toast.err .t-title::before { background: var(--red) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 7v6M12 17h.01' stroke='%23fff' stroke-width='3' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") center/12px no-repeat; }
.toast .t-body { font-size: 13px; color: var(--ink-2); }
.toast .t-actions { display: flex; gap: 8px; justify-content: flex-end; }
.toast .t-time { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); animation: ttl linear forwards; opacity: .5; }
@keyframes ttl { from { width: 100%; } to { width: 0; } }
body.bulk-on .toasts { bottom: 90px; }
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(12, 12, 18, .38); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.dialog { position: fixed; z-index: 55; left: 50%; top: 12vh; transform: translateX(-50%); width: min(520px, calc(100vw - 32px)); max-height: 78vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 22px; animation: dlgIn .3s var(--spring); }
.dialog.wide { width: min(1100px, calc(100vw - 32px)); top: 5vh; max-height: 90vh; }
.dialog.mid { width: min(720px, calc(100vw - 32px)); top: 8vh; max-height: 86vh; }
@keyframes dlgIn { from { opacity: 0; transform: translate(-50%, 12px) scale(.97); } }
.dialog h2 { font-size: 19px; margin-bottom: 6px; }
.dialog .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.sheet { position: fixed; z-index: 55; right: 0; top: 0; bottom: 0; width: min(560px, 100vw); background: var(--bg); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg); overflow-y: auto; padding: 22px 24px 60px; animation: sheetIn .35s var(--ease); }
@keyframes sheetIn { from { transform: translateX(40px); opacity: 0; } }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.palette { position: fixed; z-index: 90; left: 50%; top: 12vh; transform: translateX(-50%); width: min(620px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 30px 90px rgba(0,0,0,.35); overflow: hidden; animation: dlgIn .25s var(--spring); }
.palette input { border: none; border-bottom: 1px solid var(--line); border-radius: 0; padding: 16px 18px; font-size: 16px; box-shadow: none !important; }
.palette .list { max-height: 54vh; overflow-y: auto; padding: 6px; }
.palette .opt { display: flex; width: 100%; justify-content: flex-start; gap: 12px; padding: 9px 12px; border-radius: 10px; font-size: 14px; font-weight: 450; text-align: left; }
.palette .opt[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
.palette .opt .i { color: var(--muted); }
.palette .opt[aria-selected="true"] .i { color: var(--accent); }
.palette .opt kbd, .palette .opt small { margin-left: auto; }
.palette .opt small { color: var(--muted); }
.palette .group { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 10px 12px 4px; }
.palette .foot { display: flex; gap: 14px; padding: 9px 14px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.menu { position: fixed; z-index: 60; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 240px; animation: popIn .16s var(--ease); max-height: 70vh; overflow-y: auto; }
.menu button, .menu a { display: flex; width: 100%; justify-content: flex-start; gap: 10px; padding: 8px 10px; border-radius: 9px; font-size: 13.5px; font-weight: 450; color: var(--ink); text-decoration: none; }
.menu button:hover, .menu a:hover, .menu button[aria-current="true"] { background: var(--surface-2); }
.menu hr { border: none; border-top: 1px solid var(--line); margin: 5px 4px; }
.menu .who { padding: 8px 10px 10px; display: flex; gap: 10px; align-items: center; }
.menu .danger-item { color: var(--red); }
.menu .i { color: var(--muted); }
#confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 95; }
.shortcuts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.shortcuts div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; align-items: center; }

/* ------------------------------------------------------------------ settings + other views */
.settings { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
.snav { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 1px; }
.snav .h { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 14px 10px 6px; }
.snav .h:first-child { padding-top: 0; }
.snav a { display: flex; gap: 9px; align-items: center; padding: 7px 10px; border-radius: 9px; color: var(--ink-2); text-decoration: none; font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.snav a:hover { background: var(--surface-2); }
.snav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.snav a[aria-current="page"] .i { color: var(--accent); }
.snav .i { width: 16px; height: 16px; color: var(--muted); }
.spane { max-width: 780px; min-width: 0; }
.spane > .card { margin-bottom: 16px; }
.srow { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.srow:last-child { border-bottom: none; padding-bottom: 0; }
.srow > div:first-child { min-width: 0; }
.srow b { display: block; font-weight: 600; font-size: 13.5px; }
.srow small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.srow .ctl { flex: none; display: flex; gap: 8px; align-items: center; }
.theme-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.theme-card { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 8px 8px 10px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); font-weight: 500; font-size: 13px; }
.theme-card[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); }
.theme-prev { height: 76px; border-radius: 9px; display: grid; grid-template-columns: 30% 1fr; overflow: hidden; border: 1px solid rgba(0,0,0,.06); }
.theme-prev i { display: block; }
.theme-prev.light { background: #f7f6f3; } .theme-prev.light i:first-child { background: #ecebe6; }
.theme-prev.dark { background: #16161c; } .theme-prev.dark i:first-child { background: #0e0e12; }
.theme-prev.system { background: linear-gradient(135deg, #f7f6f3 50%, #16161c 50%); }
.theme-prev .bars { padding: 10px; display: grid; gap: 6px; align-content: start; }
.theme-prev .bars span { height: 6px; border-radius: 4px; background: var(--accent); opacity: .85; }
.theme-prev .bars span:nth-child(2) { width: 70%; background: #a1a1aa; opacity: .5; } .theme-prev .bars span:nth-child(3) { width: 50%; background: #a1a1aa; opacity: .4; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 34px; height: 34px; border-radius: 50%; padding: 0; border: 2px solid var(--surface); box-shadow: 0 0 0 1.5px var(--line-2); transition: transform .3s var(--spring), box-shadow .2s; }
.swatch:hover { transform: scale(1.12); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.list-editor { border: 1px solid var(--line); border-radius: 12px; max-height: 440px; overflow-y: auto; }
.list-editor .li { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 10px; border-bottom: 1px solid var(--line); }
.list-editor .li:last-child { border-bottom: none; }
.list-editor .li input { border-color: transparent; background: transparent; padding: 6px; }
.list-editor .li input:focus { background: var(--surface); }
.list-editor .li .n { font-size: 11px; color: var(--muted); width: 24px; text-align: right; flex: none; }
.gauge { height: 10px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin: 8px 0 4px; }
.gauge i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--green), var(--accent)); transition: width .8s var(--ease); }
.gauge.hot i { background: linear-gradient(90deg, var(--amber), var(--red)); }
.danger-zone { border-color: color-mix(in srgb, var(--red) 30%, var(--line)); }
.danger-zone h2 { color: var(--red); }
.device { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.device:last-child { border-bottom: none; }
.device .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); flex: none; }
.device .grow { flex: 1; min-width: 0; }
.device small { display: block; color: var(--muted); font-size: 12px; }

.grid { width: 100%; }
.grid th { text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.grid td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.grid tr:last-child td { border-bottom: none; }
.grid input, .grid select { padding: 6px 9px; font-size: 13px; border-color: var(--line); }
.grid .num { font-variant-numeric: tabular-nums; font-weight: 600; }
.grid .r { text-align: right; }
.grid .del { color: var(--muted); padding: 6px 8px; }
.grid .del:hover { color: var(--red); background: var(--red-soft); }
.grid .empty-row td { padding: 40px; text-align: center; color: var(--muted); }
.rules { display: grid; gap: 10px; }
.rule { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; grid-template-columns: 28px minmax(0, 2.2fr) 110px 110px minmax(0, 1.4fr) 104px auto; gap: 10px; align-items: start; }
.rule .idx { font-size: 12px; color: var(--muted); padding-top: 26px; font-variant-numeric: tabular-nums; }
.rule input, .rule select { padding: 7px 10px; font-size: 13px; border-color: var(--line); }
.rule .full { grid-column: 2 / -1; }
.rule .tools { display: flex; gap: 2px; padding-top: 20px; }
.rule .tools button { color: var(--muted); padding: 6px 7px; }
.rule .tools button:hover { color: var(--ink); background: var(--surface-2); }
.rule-label { font-size: 10.5px; color: var(--muted); margin: 0 0 4px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.subtabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.subtabs a, .subtabs button { padding: 9px 14px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: 0; text-decoration: none; white-space: nowrap; }
.subtabs [aria-current="page"], .subtabs [aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); }
.kpi span { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi b { display: block; font-size: 26px; font-weight: 650; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.kpi em { font-style: normal; font-size: 12px; color: var(--muted); }
.hbars { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(120px, 220px) minmax(0, 1fr) 110px; gap: 12px; align-items: center; font-size: 13px; }
.hbar .track { height: 12px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.hbar .track i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 50%, #ec4899)); width: 0; transition: width 1s var(--ease); }
.hbar .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.hbar .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vchart { display: flex; align-items: flex-end; gap: 14px; height: 200px; padding: 0 4px 26px; border-bottom: 1px solid var(--line); position: relative; }
.vchart .col { flex: 1; display: flex; align-items: flex-end; gap: 4px; height: 100%; position: relative; }
.vchart .col i { flex: 1; border-radius: 6px 6px 0 0; transform-origin: bottom; animation: grow .9s var(--ease) both; min-height: 2px; }
.vchart .col i.in { background: color-mix(in srgb, var(--green) 70%, transparent); }
.vchart .col i.out { background: var(--accent); }
.vchart .col span { position: absolute; bottom: -22px; left: 0; right: 0; text-align: center; font-size: 11.5px; color: var(--muted); }
@keyframes grow { from { transform: scaleY(0); } }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.change.up { color: var(--red); } .change.down { color: var(--green); }
.check-list { display: grid; gap: 10px; }
.check-item { display: flex; gap: 14px; align-items: center; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; transition: border-color .3s, background .3s; }
.check-item.done { border-color: color-mix(in srgb, var(--green) 35%, var(--line)); background: color-mix(in srgb, var(--green) 5%, var(--surface)); }
.check-dot { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; flex: none; color: transparent; transition: all .35s var(--spring); padding: 0; }
.check-dot svg { width: 16px; height: 16px; }
.check-item.done .check-dot { background: var(--green); border-color: var(--green); color: #fff; }
.check-item .grow { flex: 1; min-width: 0; }
.check-item small { color: var(--muted); display: block; font-size: 12.5px; }
.months { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; scrollbar-width: thin; }
.month { flex: none; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 500; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.month[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.month .mini { width: 64px; height: 4px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.month .mini i { display: block; height: 100%; background: var(--green); }
.timeline { list-style: none; margin: 0; padding: 0; }
.tl { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; align-items: start; }
.tl:last-child { border-bottom: none; }
.tl .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.tl .ic .i { width: 15px; height: 15px; }
.tl .meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.receipts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.rcard { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; animation: viewIn .4s var(--ease) both; }
.rcard .thumb { height: 150px; background: var(--surface-2) center/cover no-repeat; display: grid; place-items: center; color: var(--muted); position: relative; }
.rcard .thumb .badge { position: absolute; top: 10px; left: 10px; }
.rcard .body { padding: 12px 14px; display: grid; gap: 6px; font-size: 13px; }
.rcard .total { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; }
.match { background: var(--green-soft); color: var(--green); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; }
.match.none { background: var(--surface-2); color: var(--muted); }
.side-by-side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; }
.side-by-side .orig { min-height: 60vh; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); overflow: hidden; }
.side-by-side iframe, .side-by-side img { width: 100%; height: 100%; min-height: 60vh; border: none; display: block; object-fit: contain; }
.side-by-side .table-wrap { max-height: 64vh; }
.qsets { display: grid; gap: 12px; }
.qset { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); }
.qset h3 { font-size: 15px; }
.qset .meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.qitems { display: grid; gap: 6px; margin-top: 4px; grid-column: 1 / -1; }
.qitem { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; font-size: 13px; padding: 9px 11px; border-radius: 10px; background: var(--surface-2); }
.qitem .ans { color: var(--blue); font-weight: 500; }
.linkbox { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 6px 6px 6px 12px; font: 12.5px var(--mono); }
.linkbox span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: sheen 1.3s linear infinite; border-radius: 10px; }
.mapper { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.preview-table { font-size: 12px; }
.preview-table td, .preview-table th { padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; text-align: left; }

/* party mode (Konami code) */
body.party .logo { animation: spin 1.2s linear infinite; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat.ring { grid-column: span 3; }
  .rule { grid-template-columns: 24px minmax(0, 1fr) minmax(0, 1fr); }
  .rule .full { grid-column: 2 / -1; }
  .recon { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .recon .tie { grid-column: 1 / -1; }
}
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 36px; }
  .lnav-links { display: none; }
  .steps, .fgrid { grid-template-columns: 1fr; }
  .shell { display: block; }
  .side { display: none; }
  .mtop { display: flex; position: sticky; top: 0; z-index: 30; align-items: center; gap: 8px; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px); border-bottom: 1px solid var(--line); }
  .mtop .client-switch { flex: 1; min-width: 0; padding: 6px 10px; box-shadow: none; }
  .mtop .client-switch b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mtop .client-avatar { width: 24px; height: 24px; font-size: 10.5px; border-radius: 7px; }
  .avatar-btn { padding: 0; border-radius: 50%; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; padding: 6px 6px max(8px, env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: saturate(1.5) blur(18px); -webkit-backdrop-filter: saturate(1.5) blur(18px); border-top: 1px solid var(--line); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; font-size: 10.5px; font-weight: 600; color: var(--muted); text-decoration: none; border-radius: 12px; position: relative; overflow: visible; }
  .tabbar .i { width: 22px; height: 22px; transition: transform .3s var(--spring); }
  .tabbar [aria-current="page"] { color: var(--accent); }
  .tabbar [aria-current="page"] .i { transform: translateY(-1px) scale(1.08); }
  .tabbar .count { position: absolute; top: 0; left: calc(50% + 6px); }
  .main { padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); }
  .settings { grid-template-columns: 1fr; gap: 16px; }
  .snav { position: static; flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 6px; scrollbar-width: none; }
  .snav .h { display: none; }
  .snav a { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 99px; }
  .bulkbar { left: 12px; right: 12px; transform: none; bottom: calc(76px + env(safe-area-inset-bottom)); flex-wrap: wrap; animation: none; }
  .bulkbar .combo { flex: 1; min-width: 160px; }
  .bulkbar .combo input { width: 100%; }
  .toasts { left: 12px; right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); align-items: stretch; }
  .toast { width: auto; }
  body.bulk-on .toasts { bottom: calc(160px + env(safe-area-inset-bottom)); }
  .side-by-side { grid-template-columns: 1fr; }
  .side-by-side .orig, .side-by-side iframe, .side-by-side img { min-height: 40vh; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .lnav { padding: 10px 14px; }
  .lnav-cta .ghost { display: none; }
  .hero { padding: 26px 16px 20px; }
  .lede { font-size: 16px; }
  .hero-proof { gap: 18px; }
  .hero-proof b { font-size: 28px; }
  .demo-rows li { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "raw amt" "acct acct"; gap: 6px 10px; }
  .demo-rows .d { display: none; }
  .demo-rows .raw { grid-area: raw; }
  .demo-rows .acct { grid-area: acct; }
  .demo-rows .amt { grid-area: amt; }
  .demo-q-note { margin-left: 0; }
  .how, .features, .faq { padding-top: 64px; }
  .auth { padding: 22px 18px 18px; border-radius: 20px; }
  .codes { gap: 6px; }
  .codes input { font-size: 22px; padding: 11px 0; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat.ring { grid-column: span 2; }
  .q { grid-template-columns: 1fr; gap: 8px; }
  .onboard { grid-template-columns: 1fr; }
  .search input { width: 100%; }
  .toolbar-right, .search { width: 100%; }
  .seg { width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .seg button { flex: none; }
  .tx thead { display: none; }
  .tx, .tx tbody { display: block; }
  .tx tr { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 6px 10px; padding: 14px; border-bottom: 1px solid var(--line); position: relative; touch-action: pan-y; background: var(--surface); }
  .tx td { display: block; border: none; padding: 0 !important; width: auto; position: relative; z-index: 1; }
  .tx td.c-sel { grid-row: 1; grid-column: 1; padding-top: 3px !important; }
  .tx td.c-main { grid-row: 1; grid-column: 2; }
  .tx td.c-amt { grid-row: 1; grid-column: 3; font-size: 15px; }
  .tx td.c-date { grid-row: 2; grid-column: 2; font-size: 12px; color: var(--muted); }
  .tx td.c-ok { grid-row: 2 / span 2; grid-column: 3; justify-self: end; align-self: center; }
  .tx td.c-type { grid-column: 2; grid-row: 3; }
  .tx td.c-conf { grid-column: 2; grid-row: 4; }
  .tx td.c-acct { grid-column: 1 / -1; grid-row: 5; }
  .tx .combo input { padding: 11px 32px 11px 12px; font-size: 15px; }
  .tx select.type { padding: 8px 26px 8px 10px; font-size: 14px; width: auto; }
  .okbtn { width: 42px; height: 42px; }
  .okbtn svg { width: 18px; height: 18px; }
  .swipe-bg { position: absolute; inset: 0; display: flex; align-items: center; padding: 0 22px; font-weight: 700; color: #fff; z-index: 0; opacity: 0; pointer-events: none; font-size: 14px; gap: 8px; }
  .swipe-bg.ok { background: var(--green); justify-content: flex-start; }
  .swipe-bg.edit { background: var(--accent); justify-content: flex-end; }
  .grid, .grid tbody, .grid tr, .grid td { display: block; width: 100%; }
  .grid thead { display: none; }
  .grid tr { padding: 12px 14px; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
  .grid td { border: none; padding: 0; }
  .grid td.r { text-align: left; }
  .hbar { grid-template-columns: minmax(0, 1fr) 90px; }
  .hbar .track { grid-column: 1 / -1; grid-row: 2; }
  .theme-cards { gap: 8px; }
  .theme-prev { height: 56px; }
  .qset { grid-template-columns: 1fr; }
  .qitem { grid-template-columns: 1fr; }
  .shortcuts { grid-template-columns: 1fr; }
  .srow { flex-wrap: wrap; }
  .recon { grid-template-columns: 1fr 1fr; }
  .dialog, .dialog.wide, .dialog.mid { top: auto; bottom: 0; left: 0; right: 0; transform: none; width: 100%; max-height: 90vh; border-radius: 22px 22px 0 0; padding-bottom: max(22px, env(safe-area-inset-bottom)); animation: sheetUp .35s var(--ease); }
  .dialog::before { content: ''; display: block; width: 40px; height: 5px; border-radius: 99px; background: var(--line-2); margin: -8px auto 14px; }
  .palette { top: 8px; width: calc(100vw - 16px); }
  @keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } }
  .sheet { width: 100vw; }
}

/* swipe layer (phones) */
.tx td.swipe-cell { display: none; }
@media (max-width: 760px) {
  .tx td.swipe-cell { display: block; position: absolute !important; inset: 0; z-index: 0; padding: 0 !important; pointer-events: none; }
  .tx td.swipe-cell .swipe-bg { position: absolute; inset: 0; }
}

/* shared header used by admin.html */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 12px 24px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.top .who { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.top .who .email { color: var(--muted); font-size: 13px; }
#toast.toast { position: fixed; right: 22px; bottom: 22px; z-index: 80; }
.loading { padding: 60px; text-align: center; color: var(--muted); }
/* row tools appear on hover, keyboard cursor or focus (always on phones) */
.row-tools { display: none; }
.tx tbody tr:hover .row-tools, .tx tbody tr.cursor .row-tools, .tx tbody tr:focus-within .row-tools { display: flex; }
@media (max-width: 760px), (hover: none) { .row-tools { display: flex; } }
