/* GST Notice Tool — design system. No external fonts or inline styles (strict CSP). */
:root {
  --brand: #1d4ed8;
  --brand-600: #1e40af;
  --brand-50: #eff4ff;
  --brand-100: #dbe6ff;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --bg: #f6f8fc;
  --card: #ffffff;
  --ok: #047857; --ok-bg: #ecfdf5; --ok-line: #a7f3d0;
  --bad: #b91c1c; --bad-bg: #fef2f2; --bad-line: #fecaca;
  --warn: #92400e; --warn-bg: #fffbeb; --warn-line: #fde68a;
  --accent: #f59e0b;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .06);
  --shadow-lg: 0 10px 40px rgba(15, 23, 42, .12);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; margin: 0; font: 16px/1.6 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
svg { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 .5rem; }
h1 { font-size: 1.75rem; font-weight: 750; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 .9rem; }
code { font-size: .9em; background: #f1f5f9; padding: .1em .35em; border-radius: 5px; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 10; background: rgba(255, 255, 255, .9); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.top .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); font-weight: 750; font-size: 1.05rem; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand small { display: block; font-size: .68rem; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; margin-top: -2px; }
.nav { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.nav a, .nav .link { white-space: nowrap; color: var(--ink-2); font-weight: 550; font-size: .95rem; padding: .45rem .7rem; border-radius: 8px; }
.nav a:hover, .nav .link:hover { background: #f1f5f9; text-decoration: none; }
.nav a.btn { color: #fff; padding: .5rem 1rem; margin-left: .25rem; }
.nav a.btn:hover { background: var(--brand-600); }
.nav a.active { color: var(--brand); background: var(--brand-50); }
.nav .who { display: inline-flex; align-items: center; gap: .5rem; margin-left: .5rem; padding-left: .9rem; border-left: 1px solid var(--line); font-size: .88rem; color: var(--muted); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-100); color: var(--brand-600); font-weight: 700; font-size: .8rem; }
form.inline { display: inline; margin: 0; }

/* ---------- layout ---------- */
main { padding: 32px 0 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin: .25rem 0 0; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.stack > * + * { margin-top: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.card-head h2 { margin: 0; }
.narrow { max-width: 460px; margin: 0 auto; }
.muted, .hint { color: var(--muted); font-size: .9rem; }
.small { font-size: .85rem; }

/* ---------- forms ---------- */
label { display: block; font-weight: 600; font-size: .9rem; color: var(--ink-2); margin: 0 0 1rem; }
input[type=text], input[type=email], input[type=password], input:not([type]) {
  display: block; width: 100%; margin-top: .35rem; padding: .65rem .8rem; font: inherit; font-weight: 400; color: var(--ink);
  background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius-sm); transition: border-color .15s, box-shadow .15s;
}
input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(29, 78, 216, .12); }
input::placeholder { color: #94a3b8; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 16px; }
.check { display: flex; gap: .65rem; align-items: flex-start; font-weight: 450; color: var(--ink-2); font-size: .92rem; margin: .6rem 0; }
.check input { margin-top: .3rem; width: 16px; height: 16px; accent-color: var(--brand); flex: none; }
.check small { display: block; color: var(--muted); font-size: .82rem; }
details.more { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .2rem 1rem; margin: 1rem 0; background: #fcfdff; }
details.more summary { cursor: pointer; font-weight: 650; padding: .7rem 0; color: var(--ink-2); list-style: none; display: flex; align-items: center; justify-content: space-between; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: "+"; font-size: 1.2rem; color: var(--muted); }
details.more[open] summary::after { content: "–"; }
details.more[open] { padding-bottom: .5rem; }

/* ---------- buttons ---------- */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font: inherit; font-weight: 650; font-size: .95rem;
  padding: .7rem 1.15rem; border-radius: 10px; border: 1px solid transparent; cursor: pointer; text-decoration: none;
  background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(29, 78, 216, .3); transition: background .15s, transform .05s;
}
button:hover, .btn:hover { background: var(--brand-600); text-decoration: none; }
button:active, .btn:active { transform: translateY(1px); }
.btn-lg { padding: .9rem 1.5rem; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line-2); box-shadow: none; }
.btn-ghost:hover { background: #f8fafc; }
.btn-danger, button.danger { background: #fff; color: var(--bad); border-color: var(--bad-line); box-shadow: none; }
.btn-danger:hover, button.danger:hover { background: var(--bad-bg); }
button.link { background: none; border: 0; box-shadow: none; padding: .45rem .7rem; color: var(--ink-2); font-weight: 550; }
button.link:hover { background: #f1f5f9; }

/* ---------- alerts & badges ---------- */
.alert { display: flex; gap: .7rem; align-items: flex-start; padding: .85rem 1rem; border-radius: var(--radius-sm); border: 1px solid; margin: 0 0 1rem; font-size: .93rem; }
.alert svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.error { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); }
.notice { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.error pre { white-space: pre-wrap; font-size: .82rem; color: var(--ink-2); margin: .5rem 0 0; background: rgba(255, 255, 255, .6); padding: .6rem .75rem; border-radius: 7px; max-height: 260px; overflow: auto; }
.badge { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.done { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.badge.failed { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-line); }
.badge.running, .badge.queued { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.badge.deleted { color: var(--muted); background: #f8fafc; border-color: var(--line); }
.badge.role { color: var(--brand-600); background: var(--brand-50); border-color: var(--brand-100); }
.badge.role::before { display: none; }

/* ---------- dropzone ---------- */
.dropzone { position: relative; display: block; border: 2px dashed var(--line-2); border-radius: var(--radius); background: #fbfcff; padding: 28px 20px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; margin: 0; font-weight: 400; }
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--brand-50); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.dropzone .icon { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto .75rem; color: var(--brand); background: #fff; border: 1px solid var(--brand-100); border-radius: 14px; }
.dropzone .icon svg { width: 26px; height: 26px; }
.dropzone strong { display: block; font-size: 1.02rem; color: var(--ink); }
.dropzone .muted { display: block; margin-top: .25rem; }
.dropzone .chosen { display: none; margin-top: .75rem; font-weight: 650; color: var(--brand-600); }
.dropzone.has-files .chosen { display: block; }
.filetypes { display: flex; justify-content: center; gap: .4rem; flex-wrap: wrap; margin-top: .75rem; }
.filetypes span { font-size: .75rem; font-weight: 650; color: var(--ink-2); background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: .1rem .5rem; }
.privacy-note { display: flex; gap: .55rem; align-items: center; color: var(--muted); font-size: .85rem; margin-top: .9rem; }
.privacy-note svg { width: 16px; height: 16px; color: var(--ok); flex: none; }
.form-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.25rem; }

/* ---------- tables & lists ---------- */
.table-wrap { overflow-x: auto; margin: 0 -24px; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: .55rem 10px; border-bottom: 1px solid var(--line); background: #fafbfd; }
td { padding: .8rem 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th:first-child, td:first-child { padding-left: 24px; }
th:last-child, td:last-child { padding-right: 24px; }
tr:last-child td { border-bottom: 0; }
td .muted { display: block; font-size: .8rem; }
td.nowrap { white-space: nowrap; }
table.jobs td:last-child { text-align: right; font-weight: 650; }
.empty { text-align: center; padding: 28px 10px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; color: var(--line-2); margin-bottom: .4rem; display: inline-block; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 4px; }
.stat { background: #fafbfd; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .8rem .9rem; }
.stat b { display: block; font-size: 1.45rem; font-weight: 750; letter-spacing: -.02em; }
.stat span { font-size: .78rem; color: var(--muted); font-weight: 600; }

/* ---------- job page ---------- */
.job-status { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.25rem; }
.job-status .ring { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.job-status .ring svg { width: 26px; height: 26px; }
.ring.done { background: var(--ok-bg); color: var(--ok); }
.ring.failed { background: var(--bad-bg); color: var(--bad); }
.ring.deleted { background: #f1f5f9; color: var(--muted); }
.ring.running, .ring.queued { background: var(--brand-50); }
.spinner { width: 26px; height: 26px; border: 3px solid var(--brand-100); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress { height: 6px; background: var(--brand-50); border-radius: 99px; overflow: hidden; margin: .5rem 0 1rem; }
.progress span { display: block; height: 100%; width: 40%; background: var(--brand); border-radius: 99px; animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.downloads { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 1rem 0; padding: 0; list-style: none; }
.download { display: flex; gap: .8rem; align-items: center; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.download:hover { border-color: var(--brand); box-shadow: var(--shadow); text-decoration: none; }
.download .ft { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: .72rem; color: #fff; flex: none; }
.ft.xlsx { background: #15803d; } .ft.docx { background: #1d4ed8; } .ft.json { background: #475569; }
.download b { display: block; font-size: .95rem; color: var(--ink); }
.download small { display: block; font-size: .8rem; color: var(--muted); }
.meta-row > span { display: inline-flex; align-items: center; gap: .45rem; }
.meta-row svg { width: 16px; height: 16px; }
.meta-row { display: flex; gap: 1.25rem; flex-wrap: wrap; color: var(--muted); font-size: .88rem; border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1.25rem; align-items: center; justify-content: space-between; }

/* ---------- auth ---------- */
.auth { min-height: calc(100vh - 64px - 140px); display: grid; place-items: center; padding: 16px 0; }
.auth .card { width: 100%; max-width: 440px; padding: 32px; box-shadow: var(--shadow-lg); }
.auth h1 { font-size: 1.5rem; }
.auth .sub { color: var(--muted); margin-bottom: 1.5rem; }
.auth .alt { text-align: center; margin: 1.25rem 0 0; color: var(--muted); font-size: .92rem; }

/* ---------- landing ---------- */
.hero { padding: 40px 0 24px; }
.hero .container { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.eyebrow svg { width: 15px; height: 15px; }
.eyebrow { display: inline-flex; align-items: center; gap: .5rem; font-size: .8rem; font-weight: 700; color: var(--brand-600); background: var(--brand-50); border: 1px solid var(--brand-100); padding: .3rem .75rem; border-radius: 999px; margin-bottom: 1rem; }
.hero h1 { font-size: clamp(2rem, 4.2vw, 3.05rem); letter-spacing: -.03em; line-height: 1.08; margin-bottom: 1rem; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero .lead { font-size: 1.12rem; color: var(--ink-2); max-width: 34rem; margin-bottom: 1.5rem; }
.cta { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.trust { display: flex; gap: .4rem 1rem; flex-wrap: wrap; margin-top: 1.5rem; color: var(--muted); font-size: .85rem; }
.trust span { display: inline-flex; align-items: center; gap: .4rem; }
.trust svg { width: 16px; height: 16px; color: var(--ok); }
.mock { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; }
.mock-bar { display: flex; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: #fafbfd; align-items: center; }
.mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: #e2e8f0; }
.mock-bar b { margin-left: 8px; font-size: .78rem; color: var(--muted); font-weight: 600; }
.mock-body { padding: 16px 18px 18px; }
.mock-row { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; padding: .6rem 0; border-bottom: 1px dashed var(--line); font-size: .85rem; }
.mock-row:last-child { border-bottom: 0; }
.mock-row .m { font-weight: 700; color: var(--ink-2); }
.mock-row .r { color: var(--ink-2); }
.mock-row .r small { display: block; color: var(--muted); font-size: .75rem; }
.mock-row .amt { font-variant-numeric: tabular-nums; font-weight: 700; }
.amt.pos { color: var(--bad); } .amt.zero { color: var(--ok); }
.mock-foot { display: flex; justify-content: space-between; align-items: center; margin-top: .8rem; padding: .7rem .8rem; background: var(--brand-50); border-radius: 10px; font-size: .82rem; color: var(--brand-600); font-weight: 650; }
section.band { padding: 56px 0; }
section.band.alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 2rem; }
.section-head h2 { font-size: 1.75rem; letter-spacing: -.02em; }
.section-head p { color: var(--muted); font-size: 1.02rem; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.step { position: relative; padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.step::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: #fff; font-weight: 800; margin-bottom: .9rem; }
.step p { color: var(--muted); margin: 0; font-size: .95rem; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature { padding: 22px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--line); }
.feature .fi { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); margin-bottom: .8rem; }
.feature .fi svg { width: 22px; height: 22px; }
.feature p { color: var(--muted); margin: 0; font-size: .93rem; }
.security { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: .7rem; align-items: flex-start; padding: .55rem 0; color: var(--ink-2); }
.checklist svg { width: 20px; height: 20px; color: var(--ok); flex: none; margin-top: 2px; }
.cta-band { background: linear-gradient(135deg, #1e3a8a, #1d4ed8 55%, #2563eb); color: #fff; border-radius: 20px; padding: 40px; display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.cta-band h2 { font-size: 1.6rem; margin-bottom: .3rem; }
.cta-band p { margin: 0; color: #dbe6ff; }
.cta-band .btn { background: #fff; color: var(--brand-600); }
.cta-band .btn:hover { background: #eff4ff; }

/* ---------- docs ---------- */
article.doc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 40px 48px; max-width: 820px; margin: 0 auto; }
article.doc h1 { font-size: 2rem; margin-bottom: 1rem; }
article.doc h2 { font-size: 1.5rem; margin: 2rem 0 .6rem; }
article.doc h3 { font-size: 1.1rem; margin: 1.5rem 0 .4rem; }
article.doc li { margin: .3rem 0; }
article.doc blockquote { border-left: 4px solid var(--accent); margin: 1rem 0; padding: .7rem 1rem; background: var(--warn-bg); border-radius: 0 8px 8px 0; color: var(--warn); }

/* ---------- footer ---------- */
footer.site { border-top: 1px solid var(--line); background: #fff; padding: 28px 0; color: var(--muted); font-size: .86rem; }
footer.site .container { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center; }
footer.site nav { display: flex; gap: 1.1rem; }
footer.site a { color: var(--ink-2); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero .container, .security, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .steps, .features { grid-template-columns: 1fr; }
  .hero { padding-top: 24px; }
}
@media (max-width: 640px) {
  .top .container { height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
  .nav .who { display: none; }
  .nav a[href^="/#"] { display: none; }
  .top .container.public { flex-wrap: nowrap; }
  .top .container.public .nav { flex-wrap: nowrap; gap: .15rem; }
  .brand > span { white-space: nowrap; }
  .nav a.btn { padding: .45rem .8rem; font-size: .9rem; }
  .brand small { display: none; }
  .card { padding: 18px; border-radius: 12px; }
  .table-wrap { margin: 0 -18px; }
  th:first-child, td:first-child { padding-left: 18px; }
  th:last-child, td:last-child { padding-right: 18px; }
  .filetypes span { font-size: .7rem; }
  .col-hide { display: none; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .cta-band { padding: 28px; }
  article.doc { padding: 24px; }
  .auth .card { padding: 24px; }
}
