:root {
  --ink: #171512;
  --paper: #f5f0e6;
  --acid: #c8ff3d;
  --blue: #3157ff;
  --amber: #c77700;
  --muted: #746f66;
  --line: #cfc7b8;
  --white: #fffdf8;
}

* { box-sizing: border-box; }

html { background: var(--paper); color: var(--ink); font-family: Arial, sans-serif; }
body { margin: 0; min-width: 320px; }
button, input { font: inherit; }
button, label { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.masthead, main, .site-footer { width: min(920px, calc(100% - 32px)); margin-inline: auto; }
.masthead { display: flex; align-items: baseline; justify-content: space-between; padding: 30px 0 20px; border-bottom: 2px solid var(--ink); }
.brand { color: var(--ink); font: 900 31px/1 "Arial Black", Arial, sans-serif; letter-spacing: -2px; text-decoration: none; }
.brand span { color: var(--blue); }
.masthead p { margin: 0; color: var(--muted); font-size: 14px; font-weight: 700; }

main { padding: 48px 0 72px; }
.workbench { position: relative; }
.mode-row, .browse-row, .drawer-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.segmented { display: inline-flex; padding: 4px; border: 1.5px solid var(--ink); border-radius: 999px; }
.segmented button { min-height: 36px; padding: 0 18px; border: 0; border-radius: 999px; color: var(--ink); background: transparent; cursor: pointer; font-weight: 800; }
.segmented button.active { color: var(--paper); background: var(--ink); }
.star, .text-button, .retry-button { min-height: 44px; border: 0; color: var(--ink); background: transparent; cursor: pointer; font-weight: 800; }
.star span { font-size: 24px; vertical-align: -2px; }
.star.active span { color: var(--blue); }
.candidate-stage { min-height: 264px; display: flex; flex-direction: column; justify-content: center; padding: 28px 0 18px; border-bottom: 8px solid var(--blue); }
.eyebrow { margin: 0 0 8px; color: var(--muted); font-size: 12px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.candidate-stage h1, .result-header h2 { overflow-wrap: anywhere; margin: 0; font: 900 clamp(64px, 14vw, 132px)/.86 "Arial Black", Arial, sans-serif; letter-spacing: -.075em; }
.gloss { max-width: 580px; margin: 18px 0 0; font-size: 18px; color: var(--muted); }
.candidate-stage.swapping { animation: swap .18s ease-out; }
@keyframes swap { from { opacity: .35; transform: translateY(6px); } }
.browse-row { padding: 16px 0 32px; }
.text-button:disabled { cursor: default; opacity: .35; }
.next-button { min-height: 48px; padding: 0 22px; border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); background: var(--acid); cursor: pointer; font-weight: 900; }
.next-button:active, .check-button:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.key-hint { margin: 0; color: var(--muted); font-size: 12px; }
kbd { padding: 2px 6px; border: 1px solid var(--line); border-radius: 3px; background: var(--white); font: inherit; }
fieldset { min-width: 0; margin: 0 0 28px; padding: 0; border: 0; }
legend { margin-bottom: 12px; font-size: 13px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.tier-options, .tld-options, .scope-options { display: grid; gap: 8px; }
.tier-options { grid-template-columns: repeat(3, 1fr); }
.tld-options { grid-template-columns: repeat(5, 1fr); }
.scope-options { grid-template-columns: repeat(3, 1fr); margin-bottom: 10px; }
.tier-options label, .tld-options label, .scope-options label { cursor: pointer; }
.tier-options input, .tld-options input, .scope-options input { position: absolute; opacity: 0; pointer-events: none; }
.tier-options span, .tld-options span { display: grid; place-items: center; min-height: 48px; border: 1.5px solid var(--line); background: var(--white); font-weight: 800; }
.scope-options span { display: flex; min-width: 0; min-height: 76px; flex-direction: column; justify-content: center; gap: 5px; padding: 13px 16px; border: 1.5px solid var(--line); background: var(--white); }
.scope-options strong { font-size: 17px; }
.scope-options small, .scope-note { color: var(--muted); font-size: 12px; line-height: 1.35; }
.scope-options small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scope-note { margin: 0 0 16px; }
.tier-options input:checked + span, .tld-options input:checked + span, .scope-options input:checked + span { border-color: var(--ink); box-shadow: inset 0 -4px 0 var(--blue); }
.tier-options input:focus-visible + span, .tld-options input:focus-visible + span, .scope-options input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 3px; }
.check-button { width: 100%; min-height: 64px; border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); color: white; background: var(--blue); cursor: pointer; font-size: 19px; font-weight: 900; }
.check-button:disabled { cursor: wait; opacity: .55; }
.field-error { margin: 12px 0 0; color: #a12b20; font-weight: 700; }
.bookmark-manager { display: grid; gap: 14px; margin: 0 0 16px; padding: 16px; border: 1.5px solid var(--ink); background: var(--white); }
.bookmark-search { color: var(--muted); font-size: 11px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.bookmark-search input { display: block; width: min(340px, 100%); min-height: 44px; margin-top: 6px; padding: 0 12px; border: 1.5px solid var(--ink); background: var(--paper); }
.bookmark-help { margin: -6px 0 0; color: var(--muted); font-size: 12px; }
.bookmark-label { margin: 0 0 8px; font-size: 11px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.bookmark-suggestions, .bookmark-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.bookmark-suggestion, .bookmark-chip { min-height: 44px; max-width: 100%; overflow-wrap: anywhere; padding: 0 12px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; font-weight: 800; }
.bookmark-suggestion[aria-pressed="true"], .bookmark-chip { border-color: var(--ink); background: var(--blue); color: white; }
.bookmark-chip.unavailable { border-color: var(--amber); background: var(--paper); color: var(--ink); }
.bookmark-empty { color: var(--muted); font-size: 13px; line-height: 44px; }

.results-section { margin-top: 54px; scroll-margin-top: 20px; }
.result-card { min-height: 400px; padding: clamp(22px, 5vw, 42px); border: 2px solid var(--ink); border-radius: 2px; background: var(--white); box-shadow: 10px 10px 0 var(--acid); }
.result-header { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(220px, .8fr); align-items: end; gap: 24px; padding-bottom: 30px; border-bottom: 2px solid var(--ink); }
.result-header h2 { font-size: clamp(52px, 9vw, 92px); }
.result-gloss { margin: 0; color: var(--muted); line-height: 1.45; }
.summary-outcome { padding: 28px 0 18px; }
.summary-outcome strong { display: block; overflow-wrap: anywhere; font: 900 clamp(30px, 6vw, 54px)/1.02 "Arial Black", Arial, sans-serif; letter-spacing: -.045em; }
.summary-outcome p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.summary-counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 22px; }
.summary-counts div { min-width: 0; padding: 12px; border: 1.5px solid var(--line); background: var(--paper); }
.summary-counts dt { color: var(--muted); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.summary-counts dd { overflow-wrap: anywhere; margin: 5px 0 0; font-size: 20px; font-weight: 900; }
.lead-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 26px; }
.lead-grid span { display: grid; min-height: 48px; place-items: center; overflow-wrap: anywhere; padding: 8px; border: 1.5px solid var(--ink); background: var(--acid); text-align: center; font-size: 13px; font-weight: 900; }
@keyframes pulse { to { opacity: .2; } }
.result-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 18px; padding-top: 18px; border-top: 1.5px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.progress-wrap { margin-top: 24px; text-align: center; }
.progress-track { height: 4px; background: var(--line); }
.progress-track span { display: block; width: 0; height: 100%; background: var(--blue); transition: width .2s ease; }
#lookup-status { min-height: 20px; color: var(--muted); font-size: 13px; }
.retry-button { text-decoration: underline; }
.run-actions { display: flex; justify-content: center; gap: 18px; }
.result-tools { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-top: 34px; }
.status-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.status-filters button { min-height: 44px; padding: 0 12px; border: 1.5px solid var(--line); background: var(--white); cursor: pointer; font-weight: 800; }
.status-filters button.active { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.status-filters span { margin-left: 4px; font-size: 11px; }
.result-search { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.result-search input { display: block; width: min(260px, 100%); min-height: 44px; margin-top: 6px; padding: 0 12px; border: 1.5px solid var(--ink); background: var(--white); }
.result-list { display: grid; gap: 6px; margin-top: 14px; }
.result-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: center; gap: 8px; min-height: 58px; width: 100%; padding: 6px 8px 6px 14px; border: 1.5px solid var(--line); background: var(--white); color: var(--ink); text-align: left; }
.result-main { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(100px, .4fr) minmax(160px, .8fr); align-items: center; gap: 14px; min-width: 0; min-height: 44px; padding: 3px 6px 3px 0; border: 0; background: transparent; color: inherit; text-align: left; }
button.result-main { cursor: pointer; }
.result-row strong, .result-row small { overflow-wrap: anywhere; }
.result-bookmark { width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: var(--ink); cursor: pointer; font-size: 25px; }
.result-bookmark[aria-pressed="true"] { color: var(--blue); }
.result-row .row-status { font-size: 12px; font-weight: 900; text-transform: uppercase; }
.result-row small { color: var(--muted); }
.result-row.no-record { border-color: var(--ink); background: var(--acid); }
.result-row.unverified { border-color: var(--amber); }
.result-row.checking .row-status::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: var(--blue); animation: pulse .8s infinite alternate; }
.show-more { display: block; min-height: 48px; margin: 14px auto 0; padding: 0 20px; border: 1.5px solid var(--ink); background: var(--white); cursor: pointer; font-weight: 900; }

.detail-drawer { margin-top: 28px; padding: clamp(22px, 5vw, 36px); border: 2px solid var(--ink); background: var(--white); scroll-margin-top: 20px; }
.drawer-heading { align-items: flex-start; padding-bottom: 22px; border-bottom: 1.5px solid var(--line); }
.drawer-heading h2 { margin: 0; font-size: clamp(26px, 4vw, 40px); }
.drawer-heading p:last-child { margin: 4px 0 0; color: var(--muted); }
.drawer-heading button { min-height: 44px; border: 0; background: transparent; cursor: pointer; font-weight: 800; }
.detail-drawer dl { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 28px; margin: 24px 0; }
.detail-drawer dl div { padding: 13px 0; border-bottom: 1px solid var(--line); }
.detail-drawer dt { color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.detail-drawer dd { overflow-wrap: anywhere; margin: 5px 0 0; line-height: 1.4; }
.notice { color: var(--muted); font-size: 12px; line-height: 1.45; }
.source-link { color: var(--blue); font-weight: 900; }
.accuracy-note { display: flex; gap: 22px; margin-top: 58px; padding-top: 28px; border-top: 2px solid var(--ink); }
.burst { display: grid; place-items: center; flex: 0 0 48px; height: 48px; background: var(--acid); font-size: 25px; }
.accuracy-note h2 { margin: 0 0 8px; font-size: 20px; }
.accuracy-note p { max-width: 720px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 22px 0 36px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.site-footer p { margin: 0; }
[hidden] { display: none !important; }

@media (max-width: 680px) {
  .masthead { padding-top: 22px; }
  main { padding-top: 30px; }
  .candidate-stage { min-height: 235px; }
  .key-hint { display: none; }
  .browse-row { align-items: stretch; }
  .text-button, .next-button { flex: 1; }
  .tld-options { grid-template-columns: repeat(2, 1fr); }
  .tld-options label:last-child { grid-column: span 2; }
  .scope-options { grid-template-columns: 1fr; }
  .bookmark-search input { width: 100%; }
  .result-card { min-height: 0; padding: 22px 16px; box-shadow: 6px 6px 0 var(--acid); }
  .result-header { grid-template-columns: 1fr; gap: 14px; padding-bottom: 22px; }
  .summary-counts { grid-template-columns: repeat(2, 1fr); }
  .lead-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-tools { align-items: stretch; flex-direction: column; }
  .result-search input { width: 100%; }
  .result-main { grid-template-columns: minmax(0, 1fr) auto; }
  .result-main small { grid-column: 1 / -1; }
  .detail-drawer dl { grid-template-columns: 1fr; }
  .result-footer { flex-direction: column; }
  .site-footer { flex-direction: column; }
}

@media (max-width: 390px) {
  .lead-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
