/* Paychecker: phone first, widened for desktop. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --paper: #E9ECE9;
  --bg: #FFFFFF;
  --surface2: #F3F6F3;
  --border: #D8DEDA;
  --text: #12181C;
  --text2: #47575E;
  --text3: #5F6E74;
  --accent: #0B5F55;
  --accent-wash: #E3EFEC;
  --red: #A8341F;
  --red-wash: #F7E7E2;
  --amber: #8A5A08;
  --amber-wash: #F6ECD9;
  --radius: 14px;
  --tap: 56px;
}

html { background: var(--paper); }

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter Tight', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}
body.no-scroll { overflow: hidden; }

h1 { font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; outline: none; }
h2 { font-size: 22px; line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Layout */
.topbar { border-bottom: 1px solid var(--border); background: var(--bg); padding-top: env(safe-area-inset-top); }
.topbar-in { max-width: 600px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--accent); font-size: 18px; }
.beta { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text3); border: 1px solid var(--border); border-radius: 99px; padding: 3px 10px; }
main { max-width: 600px; margin: 0 auto; padding: 24px 20px 48px; }

.lede { color: var(--text2); margin-top: 10px; }
.hint { color: var(--text3); font-size: 15px; margin-top: 14px; }

/* Buttons */
.btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: var(--tap); padding: 0 20px; border-radius: var(--radius); border: 1.5px solid transparent; font-weight: 600; font-size: 17px; margin-top: 12px; text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:active { filter: brightness(0.92); }
.btn-secondary { background: var(--bg); color: var(--accent); border-color: var(--accent); }
.btn-secondary:active { background: var(--accent-wash); }
.link { display: block; margin: 20px auto 0; background: none; border: 0; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; padding: 0 12px; }
.link-block { text-align: center; }

/* Start */
.start h1 { font-size: 34px; }
.drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; margin-top: 26px; padding: 34px 20px; background: var(--accent-wash); border: 2px dashed var(--accent); border-radius: 18px; color: var(--accent); text-align: center; }
.drop:active { background: #d4e6e2; }
.drop-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.drop:focus-within { outline: 3px solid var(--accent); outline-offset: 3px; }
.drop-icon { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: var(--accent); color: #fff; margin-bottom: 8px; }
.drop-t { font-size: 22px; font-weight: 700; }
.drop-s { color: var(--text2); font-size: 15px; }
.only-mouse { display: none; }
@media (hover: hover) and (pointer: fine) { .only-touch { display: none; } .only-mouse { display: inline; } }

.gives { list-style: none; margin-top: 28px; display: grid; gap: 12px; }
.gives li { position: relative; padding-left: 32px; color: var(--text); }
.gives li::before { content: '✓'; position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-wash); color: var(--accent); font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.privacy { margin-top: 26px; padding: 14px 16px; background: var(--surface2); border-radius: var(--radius); font-size: 15px; color: var(--text2); }
.privacy strong { color: var(--text); }

/* Reading */
.reading { text-align: center; padding-top: 48px; }
.spinner { width: 48px; height: 48px; margin: 0 auto 22px; border-radius: 50%; border: 4px solid var(--accent-wash); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.bar { height: 8px; border-radius: 99px; background: var(--accent-wash); margin: 22px auto 0; max-width: 320px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 6%; background: var(--accent); border-radius: 99px; transition: width 0.3s; }

/* Result */
.demo-banner { background: var(--amber-wash); color: var(--amber); font-weight: 600; font-size: 15px; padding: 10px 14px; border-radius: 10px; margin-bottom: 18px; text-align: center; }
.hero { padding: 4px 0 18px; }
.eyebrow { color: var(--text3); font-weight: 600; font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; }
.hero-amt { font-size: 52px; line-height: 1.05; font-weight: 700; letter-spacing: -0.03em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.hero-meta { color: var(--text2); margin-top: 8px; }
.freq-note { margin-top: 8px; color: var(--text2); font-size: 15px; }
.link-inline { background: none; border: 0; padding: 8px 4px; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.btn-big { min-height: 64px; font-size: 19px; }

.verdict { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: var(--radius); }
.verdict.clear { background: var(--accent-wash); }
.verdict.warn  { background: var(--red-wash); }
.verdict.info  { background: var(--amber-wash); }
.verdict-mark { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 19px; }
.clear .verdict-mark { background: var(--accent); }
.warn .verdict-mark { background: var(--red); }
.info .verdict-mark { background: var(--amber); }
.verdict-title { font-size: 20px; font-weight: 700; line-height: 1.2; }
.verdict-text { color: var(--text2); margin-top: 4px; font-size: 16px; }

.finding { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 68px; margin-top: 10px; padding: 12px 16px; text-align: left; background: var(--bg); border: 1.5px solid var(--red); border-radius: var(--radius); }
.finding-info { border-color: var(--amber); }
.finding:active { background: var(--surface2); }
.finding-body { flex: 1; display: grid; gap: 2px; }
.finding-title { font-weight: 700; }
.finding-sub { color: var(--text2); font-size: 15px; }
.finding-go { font-size: 28px; color: var(--text3); line-height: 1; }

.strip { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 18px; border: 1px solid var(--border); border-radius: var(--radius); }
.strip > div { padding: 14px 10px; text-align: center; display: grid; gap: 2px; }
.strip > div + div { border-left: 1px solid var(--border); }
.strip-k { color: var(--text3); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.strip-v { font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.notice { margin-top: 16px; padding: 16px; background: var(--amber-wash); border-radius: var(--radius); font-size: 16px; }
.notice .btn { margin-top: 12px; background: var(--bg); }

.lines { margin-top: 20px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.lines > summary { min-height: var(--tap); padding: 0 16px; display: flex; align-items: center; justify-content: space-between; font-weight: 600; cursor: pointer; list-style: none; }
.lines summary::-webkit-details-marker { display: none; }
.lines summary { list-style: none; cursor: pointer; }
.lines > summary::after { content: '+'; font-size: 24px; color: var(--accent); margin-left: 10px; }
.lines[open] > summary::after { content: '−'; }
.lines > summary { min-height: 64px; }
.lines > summary .count { margin-left: auto; color: var(--text3); font-weight: 500; font-size: 15px; }
.sum-main { display: grid; gap: 1px; }
.sum-s { color: var(--text3); font-weight: 400; font-size: 14px; }
.group { padding: 10px 16px; background: var(--surface2); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text2); border-top: 1px solid var(--border); }
.line { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 56px; padding: 10px 16px; background: var(--bg); border: 0; border-top: 1px solid var(--border); text-align: left; }
button.line:active { background: var(--surface2); }
.line.flagged { background: var(--red-wash); }
.line-main { display: grid; gap: 1px; min-width: 0; flex: 1; }
.line-name { font-weight: 500; }
.line-code { font-size: 13px; color: var(--text3); letter-spacing: 0.03em; }
.line-go { flex: none; width: 14px; text-align: right; color: var(--text3); font-size: 24px; line-height: 1; }
.amt { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amt.minus { color: var(--text2); }
.amt.flag { color: var(--red); }

.footer { max-width: 600px; margin: 0 auto; padding: 0 20px 32px; font-size: 14px; line-height: 1.5; color: var(--text2); }

.card { margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.card-t { padding: 12px 16px; background: var(--surface2); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text2); }
.flow-row { display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.flow-row span:last-child { font-weight: 600; white-space: nowrap; }
.flow-head { border-top: 0; font-weight: 600; }
.flow-total { background: var(--accent-wash); font-weight: 700; font-size: 18px; }
.flow-muted { color: var(--text2); font-size: 15px; }
.callout { margin-top: 16px; padding: 16px; background: var(--accent-wash); border-radius: var(--radius); }

/* Sheets */
.sheet-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(18,24,28,0.5); display: flex; align-items: flex-end; justify-content: center; animation: fade 0.15s; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: relative; width: 100%; max-width: 600px; max-height: 90dvh; overflow-y: auto; background: var(--bg); border-radius: 22px 22px 0 0; padding: 10px 20px calc(24px + env(safe-area-inset-bottom)); outline: none; animation: rise 0.22s ease-out; }
@keyframes rise { from { transform: translateY(40px); } }
.sheet-handle { display: block; width: 40px; height: 5px; border-radius: 99px; background: var(--border); margin: 4px auto 6px; }
.sheet-close { position: absolute; top: 10px; right: 10px; width: 48px; height: 48px; border: 0; background: none; font-size: 32px; color: var(--text2); line-height: 1; }
.sheet-body { padding-top: 10px; }
.tag { display: inline-block; padding: 4px 12px; border-radius: 99px; font-size: 13px; font-weight: 700; background: var(--red-wash); color: var(--red); margin-bottom: 10px; }
.tag-info { background: var(--amber-wash); color: var(--amber); }
.sheet-lede { margin-top: 10px; color: var(--text2); }
.working { margin-top: 18px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.working-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; font-size: 16px; font-variant-numeric: tabular-nums; }
.working-row + .working-row { border-top: 1px solid var(--border); }
.working-row.result { background: var(--surface2); font-weight: 700; }
.cite { margin: 16px 0 8px; font-size: 14px; color: var(--text3); }
.cite strong { display: block; color: var(--text2); margin-bottom: 2px; }
.code-chip { display: inline-block; margin-top: 14px; font-family: ui-monospace, Menlo, monospace; font-size: 14px; background: var(--surface2); border-radius: 8px; padding: 4px 10px; color: var(--text2); }

/* Fix form */
.fix form { margin-top: 22px; }
.field { display: block; margin-bottom: 16px; }
.field-l { display: block; font-weight: 600; margin-bottom: 6px; }
.field-l em { font-weight: 400; color: var(--text3); font-style: normal; }
.field input, .field select { width: 100%; min-height: var(--tap); padding: 0 14px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--bg); font-size: 18px; }
.field input:focus, .field select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-wash); }
.form-error { color: var(--red); font-weight: 600; min-height: 0; }
.form-error:not(:empty) { margin-bottom: 4px; }

/* Toast */
#toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); width: max-content; max-width: calc(100% - 32px); background: var(--text); color: #fff; padding: 14px 18px; border-radius: 12px; font-size: 16px; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 80; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Drag and drop veil (computers) */
.drop-veil { position: fixed; inset: 0; z-index: 90; display: none; align-items: center; justify-content: center; background: rgba(11,95,85,0.92); color: #fff; font-size: 26px; font-weight: 700; text-align: center; padding: 24px; }
body.dragging .drop-veil { display: flex; }

/* Computers: a little more room and a calmer page */
@media (min-width: 700px) {
  html { background: var(--paper); }
  body { background: var(--paper); }
  .topbar { background: transparent; border: 0; }
  main { margin-top: 8px; background: var(--bg); border-radius: 20px; padding: 40px 44px 48px; box-shadow: 0 18px 50px rgba(18,24,28,0.10); max-width: 640px; }
  .sheet-overlay { align-items: center; }
  .sheet { border-radius: 22px; max-width: 520px; }
  .sheet-handle { display: none; }
  .hero-amt { font-size: 58px; }
  .footer { max-width: 640px; padding: 20px 44px 40px; }
}

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Very small phones */
@media (max-width: 360px) { h1 { font-size: 26px; } .hero-amt { font-size: 44px; } .strip-v { font-size: 15px; } }

/* What happened this pay */
.story-intro { padding: 14px 16px 16px; border-top: 1px solid var(--border); }
.story-bar { display: flex; gap: 2px; height: 12px; margin-top: 12px; border-radius: 99px; overflow: hidden; background: var(--surface2); }
.story-bar i { display: block; height: 100%; min-width: 3px; }
.story { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 12px 16px; background: var(--bg); border: 0; border-top: 1px solid var(--border); text-align: left; color: var(--text); font: inherit; }
.story:active { background: var(--surface2); }
.story-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; }
.story-main { flex: 1; display: grid; gap: 2px; min-width: 0; }
.story-t { font-weight: 600; }
.story-s { color: var(--text2); font-size: 14px; }
.story-amt { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.story-amt.minus { color: var(--red); }
.working-day { margin-top: 16px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text2); }
.working-day + .working { margin-top: 6px; }
.working-row small { display: block; color: var(--text3); font-size: 13px; }
.working-row small.inline { display: inline; }
.working-row small.check { color: var(--accent); font-weight: 600; }
.check-badge { margin-top: 14px; padding: 10px 14px; border-radius: 12px; background: var(--accent-wash); color: var(--accent); font-weight: 600; font-size: 15px; }
.more { margin-top: 18px; }
.more summary { min-height: var(--tap, 44px); display: flex; align-items: center; color: var(--accent); font-weight: 600; cursor: pointer; list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: '+'; margin-left: 8px; font-size: 20px; }
.more[open] summary::after { content: '−'; }

/* Line list */
.group { display: flex; align-items: center; gap: 8px; padding: 18px 16px 8px; background: var(--bg); text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--text); border-top: 1px solid var(--border); }
.group-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.group + .line { border-top: 0; }
.sect > summary.group { min-height: var(--tap); padding: 14px 16px; }
.sect > summary.group::after { content: '›'; margin-left: auto; flex: none; width: 14px; text-align: right; font-size: 24px; line-height: 1; color: var(--text3); transition: transform 0.15s; }
.sect[open] > summary.group::after { transform: rotate(90deg); }
.sect[open] > summary.group { padding-bottom: 8px; }
.line { min-height: 60px; padding: 12px 16px 12px 34px; }
.line-name { font-weight: 500; line-height: 1.3; }
.line-code { font-size: 14px; color: var(--text3); letter-spacing: 0; line-height: 1.35; margin-top: 2px; }
.line-back .line-name { color: var(--text2); }
.line-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.line-top .amt { flex: none; }
.line-means { font-size: 14px; color: var(--text2); line-height: 1.35; margin-top: 3px; }
.line-means + .line-code { margin-top: 1px; }
.working-row > span:last-child { white-space: nowrap; flex: none; }
.app-version { text-transform: none; letter-spacing: 0.02em; margin-left: 4px; font-variant-numeric: tabular-nums; }
