@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-grotesque-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --bg: #14161f;
  --surface: #1d2030;
  --text: #eceae4;
  --muted: #a9a6b8;
  --accent: #f2b544;
  --on-accent: #14161f;
  --line: #2c3044;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --radius-btn: 10px;
  --radius-card: 12px;
  --focus-ring: 2px solid var(--accent);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f5f8;
    --surface: #ffffff;
    --text: #1a1c26;
    --muted: #5b5f73;
    --accent: #8a5d00;
    --on-accent: #ffffff;
    --line: #d9dce5;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 17px;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
}

body.is-hidden {
  overflow: hidden;
}

.banner {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: var(--space-2) var(--space-3);
  font-size: 15px;
  margin-bottom: var(--space-2);
}

.shell {
  max-width: 30rem;
  margin: 0 auto;
  padding: var(--space-3);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  gap: var(--space-2);
}

.top-row .spacer {
  flex: 1;
}

.btn-icon {
  font: inherit;
  color: var(--text);
  background: none;
  border: none;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  cursor: pointer;
  border-radius: var(--radius-btn);
}

.btn-icon:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

.btn-hide {
  font-size: 15px;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: var(--space-2) var(--space-3);
  min-height: 44px;
}

.btn-help {
  font-size: 15px;
  color: var(--muted);
  border: 1px solid var(--line);
  min-width: 44px;
  justify-content: center;
}

h1 {
  font-size: 22px;
  line-height: 1.25;
  font-weight: 600;
  margin: var(--space-4) 0 var(--space-2);
}

h2 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: var(--space-4) 0 var(--space-2);
}

p {
  margin: 0 0 var(--space-3);
}

.muted {
  color: var(--muted);
  font-size: 15px;
}

.progress {
  font-size: 15px;
  color: var(--muted);
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  margin-top: auto;
  padding: var(--space-2) var(--space-3);
  font: inherit;
  font-weight: 600;
  color: var(--on-accent);
  background: var(--accent);
  border: none;
  border-radius: var(--radius-btn);
  cursor: pointer;
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

.btn-text {
  display: block;
  width: 100%;
  min-height: 44px;
  line-height: 44px;
  text-align: center;
  font: inherit;
  color: var(--text);
  background: none;
  border: none;
  text-decoration: underline;
  cursor: pointer;
}

.btn-text:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

.check-row {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  min-height: 44px;
  margin: var(--space-2) 0 var(--space-3);
}

.check-row input {
  width: 24px;
  height: 24px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.scale-row {
  padding: var(--space-3) 0;
  border-top: 1px solid var(--line);
}

.scale-row:first-of-type {
  border-top: none;
}

.scale-row b {
  display: block;
  font-weight: 600;
}

.scale-row .sub {
  font-size: 15px;
  color: var(--muted);
}

fieldset.answer {
  border: 0;
  padding: 0;
  margin: 0 0 var(--space-3);
  min-width: 0;
}

fieldset.answer legend {
  padding: 0;
  margin-bottom: var(--space-2);
  font-size: 15px;
  color: var(--muted);
}

.seg {
  display: flex;
  gap: 0;
}

.seg .group {
  display: flex;
  flex: 1;
}

.seg .group + .group {
  margin-left: var(--space-2);
}

.seg label {
  flex: 1;
  min-height: 48px;
  border: 1px solid var(--line);
  font-size: 15px;
  line-height: 1.1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2px;
  cursor: pointer;
  position: relative;
}

.seg .group:first-child label:first-child {
  border-radius: var(--radius-btn) 0 0 var(--radius-btn);
}

.seg .group:first-child label:last-child {
  border-radius: 0 var(--radius-btn) var(--radius-btn) 0;
}

.seg .group:last-child label:first-child {
  border-radius: var(--radius-btn) 0 0 var(--radius-btn);
}

.seg .group:last-child label:last-child {
  border-radius: 0 var(--radius-btn) var(--radius-btn) 0;
}

.seg label + label {
  border-left: 0;
}

.seg input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.seg input:focus-visible + span {
  outline: var(--focus-ring);
  outline-offset: -2px;
}

.seg label:has(input:checked) {
  border: 2px solid var(--accent);
  font-weight: 600;
}

.seg label:has(input:checked)::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-bottom: 2px;
}

.row-clear {
  font-size: 15px;
  color: var(--muted);
  background: none;
  border: none;
  text-decoration: underline;
  min-height: 44px;
  padding: 0;
  cursor: pointer;
}

.row-clear:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

.result-row {
  padding: var(--space-3) 0;
  border-top: 1px solid var(--line);
}

.result-row button {
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  min-height: 44px;
}

.result-row button:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

.result-row .hint {
  font-size: 15px;
  color: var(--muted);
}

.safety {
  font-size: 15px;
  border-left: 3px solid var(--accent);
  padding-left: var(--space-3);
  margin-top: var(--space-2);
}

.core-ask {
  margin-top: var(--space-2);
  font-size: 15px;
}

.core-ask label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  margin-right: var(--space-3);
}

.not-you summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--muted);
  font-size: 15px;
}

.not-you summary:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

.hide-cover {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
}

.hide-cover button {
  font: inherit;
  font-size: 17px;
  color: var(--muted);
  background: none;
  border: none;
  min-height: 44px;
  min-width: 44px;
  cursor: pointer;
}

.hide-cover button:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

.flow-gap {
  margin-top: var(--space-3);
}

.btn-primary.in-flow {
  margin-top: var(--space-3);
}

.center {
  text-align: center;
}

h1.focus:focus {
  outline: var(--focus-ring);
  outline-offset: 4px;
}

.share-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 48px;
  padding: var(--space-2) 0;
  border-top: 1px solid var(--line);
}

.share-row .sub {
  display: block;
  font-size: 15px;
  color: var(--muted);
}

.share-row input {
  flex: none;
  width: 24px;
  height: 24px;
  accent-color: var(--accent);
}

.qr {
  display: flex;
  justify-content: center;
  margin: var(--space-3) 0;
}

.qr img {
  width: 220px;
  height: 220px;
  image-rendering: pixelated;
  background: #ffffff;
  padding: var(--space-2);
  border-radius: var(--radius-card);
}

.status {
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}

.manual-copy {
  display: block;
  margin-bottom: var(--space-3);
}

.manual-copy span {
  display: block;
  font-size: 15px;
  color: var(--muted);
  margin-bottom: var(--space-2);
}

.manual-copy textarea,
.paste-input {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-btn);
  padding: var(--space-2) var(--space-3);
}

.paste-input {
  min-height: 48px;
  margin-top: var(--space-2);
}

.manual-copy textarea:focus-visible,
.paste-input:focus-visible,
.share-row input:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

.paste-block {
  border-top: 1px solid var(--line);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
}

/* D16: only the reveal card moves; instant under reduced motion */
@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.card-enter {
  animation: card-in 220ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .card-enter {
    animation: none;
  }
}

.why {
  margin: var(--space-3) 0;
}

.why summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--muted);
  font-size: 15px;
}

.why summary:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

.match-figure {
  font-size: 32px;
  font-weight: 600;
  margin: var(--space-4) 0 var(--space-2);
}

.pick-wrap {
  border-top: 1px solid var(--line);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
}

fieldset.pick {
  border: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}

fieldset.pick legend {
  font-weight: 600;
  padding: 0;
}

.pick-option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  padding: var(--space-2) 0;
}

.pick-option input {
  flex: none;
  width: 24px;
  height: 24px;
  accent-color: var(--accent);
}

.pick-option input:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}
