:root {
  color-scheme: dark;
  --background: #0a0a0a;
  --panel: #111;
  --white: #f5f5f5;
  --muted: #999;
  --line: #303030;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--white);
  background: var(--background);
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 5px; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--white); outline-offset: 5px; }
p, h1, h2, h3 { margin: 0; }
.page { width: min(1120px, calc(100% - 96px)); margin: 0 auto; }
.site-header { display: flex; justify-content: space-between; align-items: center; padding: 32px 0; border-bottom: 1px solid var(--line); }
.wordmark { font-size: 28px; letter-spacing: -2px; font-weight: 800; }
.wordmark span { margin: 0 3px; }
.wordmark .wordmark-dot { margin: 0; color: var(--muted); }
.site-header nav { display: flex; gap: 32px; font-size: 13px; }
.site-header nav span { margin-left: 6px; }
.intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; padding: 64px 0 60px; }
.eyebrow, .edition { font-family: monospace; font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; line-height: 1.8; }
.eyebrow { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.status-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
h1 { font-size: clamp(72px, 9vw, 120px); line-height: .93; letter-spacing: -.075em; font-weight: 700; margin: 27px 0 0 -5px; }
h1 > span { color: var(--muted); }
.intro-aside { padding-bottom: 5px; max-width: 300px; }
.edition { display: block; color: var(--muted); margin-bottom: 22px; }
.intro-aside p { font-size: 19px; line-height: 1.6; letter-spacing: -.4px; }
.text-link { display: inline-flex; gap: 34px; font-size: 13px; margin-top: 27px; }
.solver { border: 1px solid var(--line); background: var(--panel); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px 32px; border-bottom: 1px solid var(--line); }
.panel-heading h2, .operations legend { font-size: 13px; font-weight: 400; }
.section-number { color: var(--muted); font-family: monospace; font-size: 11px; margin-right: 12px; }
.text-button { background: transparent; color: var(--white); border: 0; padding: 4px 0; font-size: 12px; }
.text-button span { margin-left: 8px; }
.text-button:hover { color: var(--muted); }
.puzzle-layout { display: grid; grid-template-columns: 1.2fr 1fr; }
.puzzle-inputs { min-width: 0; padding: 32px; }
.digits { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.digit-card { position: relative; display: flex; flex-direction: column; align-items: center; background: var(--white); color: #111; border-radius: 3px; padding: 8px 0 20px; touch-action: pan-x; }
.digit-step { border: 0; background: transparent; color: #666; width: 100%; padding: 4px 0; font-size: 17px; line-height: 1; min-height: 26px; }
.digit-step:hover { color: #000; }
.digit-step:focus-visible, .digit-input:focus-visible { outline-color: #111; outline-offset: -4px; }
.digit-input { width: 100%; min-width: 0; padding: 8px 0; font-size: clamp(48px, 6vw, 76px); font-weight: 600; line-height: 1.05; letter-spacing: -.06em; text-align: center; border: none; border-radius: 0; background: transparent; color: #111; cursor: grab; caret-color: #111; }
.digit-input::selection { color: var(--white); background: #111; }
.digit-card.dragging, .digit-card.dragging input { cursor: grabbing; user-select: none; }
.digit-index { position: absolute; bottom: 6px; font-family: monospace; font-size: 8px; color: #888; }
.hint { font-size: 11px; line-height: 1.6; color: var(--muted); margin-top: 14px; }
.operations { border: none; padding: 0; margin: 30px 0 26px; }
.operations legend { padding: 0; margin-bottom: 15px; }
.operator-options { display: flex; gap: 8px; }
.operator { position: relative; flex: 1; min-width: 0; cursor: pointer; }
.operator input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.operator > span { display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); height: 46px; color: #aaa; font-size: 24px; border-radius: 2px; transition: background .15s, color .15s; }
.operator input:checked + span { color: var(--white); background: #272727; border-color: #666; }
.operator input:hover + span { border-color: var(--white); }
.operator input:focus-visible + span { outline: 2px solid var(--white); outline-offset: 4px; }
.parentheses { margin-left: 10px; }
.parentheses > span { font-size: 20px; }
.solve-button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; background: var(--white); color: #111; border: 1px solid var(--white); font-size: 14px; font-weight: 600; border-radius: 2px; transition: background .15s; }
.solve-button:hover { background: #ccc; }
.solve-button span { font-size: 21px; line-height: 1; }
.result-panel { display: flex; flex-direction: column; justify-content: space-between; min-width: 0; border-left: 1px solid var(--line); padding: 32px; background: #0e0e0e; }
.result-topline { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.result-topline h2 { font-size: 12px; font-weight: 400; color: var(--muted); }
.result-status { border: 1px solid #444; padding: 5px 9px; font-family: monospace; font-size: 9px; letter-spacing: .5px; text-transform: uppercase; }
.result-body { padding: 32px 0; }
.result-mark { color: #666; font-size: 29px; line-height: 1; }
.expression { margin-top: 22px; font-family: monospace; font-size: clamp(17px, 2vw, 24px); line-height: 1.5; overflow-wrap: anywhere; }
.answer { font-size: 112px; font-weight: 600; letter-spacing: -.08em; line-height: 1.1; margin-left: -5px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.answer-dot { color: #555; }
.result-panel[data-state="closest"] .answer { font-size: clamp(34px, 5vw, 64px); margin-top: 12px; }
.result-panel[data-state="invalid"] .answer { color: #555; }
.result-note { border-top: 1px solid var(--line); padding-top: 18px; font-size: 11px; color: var(--muted); line-height: 1.7; }
.rules { display: grid; grid-template-columns: 1fr 1.2fr; gap: 60px; padding: 72px 0; }
.rules-heading h2 { font-size: 30px; line-height: 1.25; letter-spacing: -1.1px; margin-top: 19px; font-weight: 500; }
.rules ol { margin: 0; padding: 0; list-style: none; }
.rules li { display: flex; gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.rules li:first-child { padding-top: 0; }
.rules li:last-child { border: 0; padding-bottom: 0; }
.rule-index { padding-top: 3px; color: var(--muted); font-family: monospace; font-size: 10px; }
.rules h3 { font-size: 14px; font-weight: 500; margin-bottom: 8px; }
.rules li p { color: var(--muted); font-size: 12px; line-height: 1.8; }
.site-footer { display: flex; justify-content: space-between; align-items: center; gap: 24px; border-top: 1px solid var(--line); padding: 26px 0 32px; font-size: 10px; color: var(--muted); line-height: 1.6; }
.site-footer .status-dot { margin-right: 6px; }
.site-footer a { color: var(--white); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -100px; padding: 12px; background: var(--white); color: #111; z-index: 2; }
.skip-link:focus { top: 16px; }
.noscript { padding: 24px 32px; border-top: 1px solid var(--line); line-height: 1.6; }
@media (min-width: 1400px) { .intro { padding-top: 80px; padding-bottom: 72px; } }
@media (max-width: 900px) {
  .page { width: calc(100% - 48px); }
  .intro { gap: 24px; }
  .intro-aside p { font-size: 16px; }
  .edition { font-size: 9px; }
  .puzzle-inputs, .result-panel { padding: 24px; }
  .panel-heading { padding: 22px 24px; }
  .digits { gap: 8px; }
  .digit-input { font-size: 56px; }
  .rules { gap: 32px; }
}
@media (max-width: 640px) {
  .page { width: calc(100% - 32px); }
  .site-header { padding: 22px 0; }
  .wordmark { font-size: 25px; }
  .site-header nav { gap: 22px; font-size: 12px; }
  .intro { display: block; padding: 38px 0; }
  .intro .eyebrow { font-size: 8px; letter-spacing: .7px; }
  h1 { font-size: 82px; margin-top: 20px; }
  .intro-aside { margin-top: 28px; max-width: none; }
  .edition, .desktop-break { display: none; }
  .intro-aside p { font-size: 15px; }
  .text-link { margin-top: 16px; }
  .puzzle-layout { grid-template-columns: 1fr; }
  .panel-heading { padding: 20px; }
  .puzzle-inputs { padding: 24px 20px; }
  .digit-input { font-size: clamp(48px, 15vw, 76px); }
  .hint { font-size: 10px; }
  .operations { margin-top: 25px; }
  .result-panel { border-left: none; border-top: 1px solid var(--line); padding: 24px 20px; }
  .result-body { padding: 24px 0; }
  .expression { margin-top: 14px; font-size: 21px; }
  .answer { font-size: 88px; }
  .result-panel[data-state="closest"] .answer { font-size: 48px; }
  .rules { grid-template-columns: 1fr; gap: 32px; padding: 48px 4px; }
  .rules-heading .eyebrow { font-size: 9px; }
  .rules-heading h2 { font-size: 28px; }
  .site-footer { flex-wrap: wrap; gap: 12px; padding: 22px 0; }
  .site-footer p:nth-child(2) { order: 3; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
