:root {
  color-scheme: dark;
  --bg: #0b0b0b;
  --text: #e8e6e3;
  --muted: #8a8a8a;
  --accent: #ff5a1f;
  --border: #2a2a2a;
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, input, textarea { font: inherit; appearance: none; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }
.muted { color: var(--muted); }
.site-shell { max-width: 808px; margin: 0 auto; padding: 32px 20px 24px; }
.terminal-header { margin-bottom: 36px; border-bottom: 1px solid var(--border); padding-bottom: 24px; }
.terminal-header h1 { font-size: 14px; font-weight: 400; margin: 0; }
.prompt { color: var(--accent); }
.terminal-header p { color: var(--muted); margin: 8px 0 0; }
.category { border: 0; margin: 0 0 28px; padding: 0; min-width: 0; }
.category legend { padding: 0; margin-bottom: 12px; color: var(--muted); }
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  transition: color 100ms linear;
}
.chip:hover { color: var(--text); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.extra-field { margin-top: 36px; }
.field-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.field-heading label { flex: 1; }
.field-heading .muted { font-size: 12px; }
input, textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  padding: 12px;
  font-size: 16px;
  line-height: 1.5;
}
input::placeholder { color: var(--muted); }
.extra-field p { margin: 8px 0 24px; color: var(--muted); font-size: 12px; }
.audit-button {
  width: 100%;
  min-height: 56px;
  padding: 16px 12px;
  border: 1px solid var(--text);
  background: var(--bg);
  color: var(--text);
  text-align: left;
  transition: color 100ms linear;
}
.audit-button:hover { color: var(--accent); }
.audit-button:disabled { border-color: var(--border); color: var(--muted); }
.picker-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 8px; }
.picker-actions > span { font-size: 12px; }
.action {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  transition: color 100ms linear;
}
.action:hover { color: var(--accent); }
.action:disabled { color: var(--muted); }
.site-footer { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--border); padding-top: 20px; margin-top: 40px; color: var(--muted); font-size: 12px; }
.site-footer a:hover { color: var(--text); }
.skip-link { position: absolute; top: -100px; left: 20px; background: var(--bg); padding: 12px; }
.skip-link:focus { top: 8px; }
.notice { border: 1px solid var(--border); padding: 16px; color: var(--accent); overflow-wrap: anywhere; }
.result-screen { max-width: 420px; margin: 0 auto; outline: none; }
.receipt { border: 1px solid var(--border); padding: 24px 20px; transform-origin: top center; }
.receipt p { margin: 0; }
.receipt-header { text-align: center; padding-bottom: 20px; }
.receipt-header h2 { margin: 0 0 8px; font-size: 14px; font-weight: 700; letter-spacing: 1px; }
.receipt-header p { color: var(--muted); font-size: 12px; }
.receipt-meta { border-top: 1px dashed var(--border); padding: 16px 0; font-size: 12px; }
.receipt-meta p + p { margin-top: 4px; }
.receipt-columns { display: flex; justify-content: space-between; border-top: 1px dashed var(--border); padding-top: 16px; margin-bottom: 12px; color: var(--muted); font-size: 12px; }
.receipt-items { list-style: none; padding: 0; margin: 0; }
.receipt-items li { padding-bottom: 20px; }
.line-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.line-name { overflow-wrap: anywhere; }
.line-points { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.receipt-combos { border-top: 1px dashed var(--border); padding-top: 16px; }
.receipt-extra { border-top: 1px dashed var(--border); padding: 16px 0; overflow-wrap: anywhere; font-size: 12px; }
.receipt-total { border-top: 1px dashed var(--border); padding: 20px 0; }
.score-display { color: var(--accent); font-size: clamp(64px, 22vw, 96px); line-height: 1.2; letter-spacing: -6px; font-weight: 700; margin: 4px 0 16px; font-variant-numeric: tabular-nums; }
#tier-name { display: inline-block; border: 2px solid var(--accent); padding: 3px 9px; color: var(--accent); font-weight: 700; transform: rotate(-4deg); transform-origin: center; }
.receipt-total #result-heading { font-size: 12px; margin-top: 16px; overflow-wrap: anywhere; }
.receipt-footer { border-top: 1px dashed var(--border); padding-top: 24px; text-align: center; font-size: 12px; }
.barcode { display: flex; justify-content: center; align-items: stretch; height: 48px; gap: 2px; overflow: hidden; }
.barcode span { display: block; background: var(--text); flex-shrink: 0; }
.receipt-footer p { margin-top: 12px; }
.share-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 14px; margin-top: 16px; }
.share-status { min-height: 21px; font-size: 12px; color: var(--muted); margin: 12px 0 0; overflow-wrap: anywhere; }
textarea { margin-top: 12px; min-height: 140px; font-size: 12px; resize: vertical; }
body[data-phase="printing"] .receipt { animation: receipt-in 300ms ease-out both; }
body[data-phase="printing"] #tier-name { visibility: hidden; }
body[data-phase="stamping"] #tier-name { animation: stamp-in 160ms ease-out both; }
@keyframes receipt-in { from { transform: translateY(-36px) scaleY(.94); opacity: 0; } to { transform: translateY(0) scaleY(1); opacity: 1; } }
@keyframes stamp-in { from { transform: rotate(-9deg) scale(1.4); opacity: 0; } to { transform: rotate(-4deg) scale(1); opacity: 1; } }
@media (min-width: 640px) {
  .site-shell { padding: 64px 32px 32px; }
  .category { display: grid; grid-template-columns: 120px minmax(0, 1fr); column-gap: 24px; margin-bottom: 24px; }
  .category legend { float: left; width: 120px; padding-top: 10px; margin-bottom: 0; }
  .extra-field { border-top: 1px solid var(--border); padding-top: 24px; }
  input { font-size: 14px; }
  .receipt { padding: 28px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  body[data-phase="printing"] #tier-name { visibility: visible; }
}
