/* Moss Sales Tax. Same look as the help desk and moss-seal.com: black band with the full logo,
   black/white/grey plus Moss gold #f2c522, green kept for "no tax / ok" states. Manrope headings,
   Inter body. Single dark theme; the site has no light mode. */
:root {
  --bg: #000000; --surface: #151515; --surface-2: #1f1f1f; --fg: #ffffff; --muted: #999999; --line: #2e2e2e;
  --accent: #f2c522; --accent-ink: #202020; --accent-text: #f2c522; --gold-soft: #2a2208;
  --ok: #5ec47a; --ok-soft: #0f2416; --warn: #f2c522; --warn-soft: #2a2208; --bad: #e0675f; --bad-soft: #2a1210;
  --display: "Manrope", "Segoe UI", Helvetica, Arial, sans-serif; --body: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: Consolas, "Cascadia Mono", monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 15px; line-height: 1.5; padding-inline: 16px; padding-block: 0 32px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent-text); }
.wrap { max-width: 1240px; margin: 0 auto; }

/* Header band + nav */
.band { background: #000; margin-inline: -16px; padding-inline: 16px; }
header.top { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 18px 14px; }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; flex-wrap: wrap; }
.mark { height: 48px; width: auto; display: block; flex: none; }
.brand .sep { width: 1px; height: 28px; background: #3b3b3b; flex: none; }
.brand h1 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 24px; line-height: 1; letter-spacing: -.02em; }
.brand h1 small { display: block; font-family: var(--body); font-weight: 400; font-size: 12px; color: var(--muted); margin-top: 5px; }
nav.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
nav.tabs a { color: var(--muted); text-decoration: none; padding: 8px 12px; font-weight: 500; border-bottom: 2px solid transparent; }
nav.tabs a:hover { color: var(--fg); }
nav.tabs a.active { color: var(--accent-text); border-bottom-color: var(--accent); }
.adminbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); padding: 10px 0 0; }
.adminbar b { color: var(--accent-text); font-weight: 600; }
.linkbtn { background: none; border: 0; color: var(--accent-text); cursor: pointer; padding: 0; font-size: 13px; text-decoration: underline; }
.linkbtn[disabled] { opacity: .5; cursor: not-allowed; }

/* Notices and gate */
.notice { margin-top: 16px; padding: 10px 14px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 14px; }
.notice.alert { background: var(--gold-soft); border-color: var(--accent); color: var(--fg); }
.notice.bad { background: var(--bad-soft); border-color: var(--bad); color: var(--fg); }
.gate { max-width: 420px; margin: 48px auto 0; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--accent); padding: 22px 20px 24px; display: grid; gap: 14px; }
.gate h2 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -.03em; }
.gate p { margin: 0; color: var(--muted); font-size: 14px; }
.gate form { padding: 0; }

/* Layout */
main.bench { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 24px; margin-top: 24px; align-items: start; }
main.bench.one { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 900px) { main.bench { grid-template-columns: minmax(0, 1fr); } }
.panel { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--accent); overflow: hidden; min-width: 0; }
.panel h2 { margin: 0; padding: 16px 18px 0; font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -.03em; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.panel h2 .count { font-size: 15px; color: var(--muted); font-weight: 500; }
.panel .inner { padding: 14px 18px 18px; display: grid; gap: 12px; }
.panel p.lead { margin: 0; color: var(--muted); font-size: 14px; }
form { padding: 14px 18px 18px; display: grid; gap: 12px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.field input, .field select, .field textarea, .cell input, .cell select, .cell textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line); background: var(--bg); border-radius: 0; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: none; }
.field .hint { font-size: 12px; color: var(--muted); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .row2, .row3 { grid-template-columns: 1fr; } }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice input { position: absolute; opacity: 0; width: 0; height: 0; }
.choice label.opt { display: block; padding: 10px 12px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; font-size: 14px; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--fg); }
.choice label.opt small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; margin-top: 2px; }
.choice input:checked + label.opt { border-color: var(--accent); background: var(--gold-soft); }
.choice input:focus-visible + label.opt { outline: 2px solid var(--accent); outline-offset: 2px; }
.submit { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 13px 16px; border: 0; cursor: pointer; border-radius: 0; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 16px; }
.submit:hover { filter: brightness(1.06); }
.submit[disabled] { opacity: .55; cursor: not-allowed; }
.btn { padding: 7px 12px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; font-size: 14px; font-weight: 500; border-radius: 0; color: var(--fg); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.danger { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.btn.small { padding: 4px 9px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.formmsg { font-size: 14px; min-height: 1.2em; color: var(--muted); }
.formmsg.ok { color: var(--ok); font-weight: 500; }
.formmsg.err { color: var(--bad); font-weight: 500; }
details.adv summary { cursor: pointer; color: var(--muted); font-size: 13px; }
details.adv .row2 { margin-top: 10px; }

/* Decision card */
.decision { display: grid; gap: 14px; }
.verdict { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 16px 18px; border: 1px solid var(--line); border-left: 6px solid var(--accent); background: var(--surface-2); }
.verdict .label { font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: -.03em; line-height: 1.1; }
.verdict .sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.verdict .big { font-family: var(--display); font-weight: 800; font-size: 34px; letter-spacing: -.03em; text-align: right; font-variant-numeric: tabular-nums; }
.verdict .big small { display: block; font-family: var(--body); font-weight: 500; font-size: 13px; color: var(--muted); letter-spacing: 0; }
.verdict.charge { border-left-color: var(--accent); }
.verdict.exempt, .verdict.no-nexus, .verdict.export { border-left-color: var(--ok); }
.verdict.exempt .label, .verdict.no-nexus .label, .verdict.export .label { color: var(--ok); }
.verdict.review { border-left-color: var(--bad); }
.verdict.review .label { color: var(--bad); }
.verdict.charge .label { color: var(--accent-text); }
.steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 8px 10px; background: var(--surface-2); border-left: 2px solid var(--line); font-size: 14px; }
.steps li b { color: var(--accent-text); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; font-weight: 600; padding-top: 2px; }
@media (max-width: 480px) { .steps li { grid-template-columns: 1fr; } }
.warns { margin: 0; padding: 0 0 0 18px; color: var(--fg); font-size: 14px; display: grid; gap: 4px; }
.warns li::marker { color: var(--warn); }
.sources { margin: 0; padding: 0 0 0 18px; font-size: 13px; color: var(--muted); display: grid; gap: 2px; }
h3.sec { margin: 6px 0 0; font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: -.01em; color: var(--muted); text-transform: uppercase; font-size: 12px; letter-spacing: .06em; }

/* Tables */
.tablewrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th { text-align: left; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.grid td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.grid tr:hover td { background: var(--surface-2); }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid td.mono { font-family: var(--mono); font-size: 13px; }
table.grid .cell input, table.grid .cell select { padding: 5px 7px; font-size: 13px; min-width: 70px; }
table.grid .cell input[type=checkbox] { width: auto; }
.chip { display: inline-block; padding: 2px 8px; font-size: 12px; font-weight: 600; letter-spacing: .02em; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.chip.ok, .chip.exempt, .chip.no-nexus, .chip.export, .chip.no-expiry { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.charge, .chip.expiring, .chip.pending { background: var(--gold-soft); color: var(--accent-text); border-color: transparent; }
.chip.review, .chip.expired, .chip.revoked, .chip.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chip.yes { background: var(--gold-soft); color: var(--accent-text); border-color: transparent; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; padding: 12px 18px 0; }
.filters .field { min-width: 160px; }
.filters .field.grow { flex: 1; }
.empty { padding: 16px; border: 1px dashed var(--line); color: var(--muted); font-size: 14px; }
.stat { display: grid; gap: 2px; padding: 10px 12px; background: var(--surface-2); border-left: 3px solid var(--accent); }
.stat b { font-family: var(--display); font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.stat span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.progress { height: 8px; background: var(--surface-2); border: 1px solid var(--line); }
.progress div { height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.small { font-size: 13px; color: var(--muted); }
.mapping { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.mapping .field label { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--fg); }
pre.code { margin: 0; padding: 10px 12px; background: var(--surface-2); font-family: var(--mono); font-size: 12px; overflow-x: auto; white-space: pre; color: var(--muted); }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; overflow: auto; }
.modal .box { width: min(640px, 100%); background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--accent); padding: 18px 18px 20px; display: grid; gap: 12px; max-height: calc(100vh - 32px); overflow: auto; }
.modal h3 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -.03em; }
.modal form { padding: 0; }
.modal .actions { justify-content: flex-end; }
footer.foot { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rulesec { display: grid; gap: 10px; }
.rulesec h3 { margin: 18px 0 0; font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
.rulesec p.help { margin: 0; color: var(--muted); font-size: 13px; }
.setting { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(160px, 220px) auto; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.setting .k { font-weight: 600; }
.setting .k small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; margin-top: 2px; }
@media (max-width: 700px) { .setting { grid-template-columns: 1fr; } }
