:root {
  color-scheme: light;
  --bg: #edf2f4;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #17202a;
  --muted: #5d6878;
  --line: #d8e0e7;
  --accent: #126c70;
  --accent-strong: #0a4e52;
  --accent-soft: #d9eff0;
  --danger: #b23a48;
  --danger-soft: #f8dfe3;
  --shadow: 0 18px 55px rgba(23, 32, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background:
    linear-gradient(145deg, rgba(18, 108, 112, 0.12), transparent 34%),
    linear-gradient(215deg, rgba(178, 58, 72, 0.08), transparent 38%),
    var(--bg);
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0;
}

.hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 7vw, 5rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(96px, 1fr));
  gap: 10px;
  min-width: 230px;
}

.stats div {
  padding: 14px 16px;
  border: 1px solid rgba(216, 224, 231, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(14px);
}

.stats span {
  display: block;
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1;
}

.stats small {
  color: var(--muted);
  font-weight: 700;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(96px, 1fr));
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 30px rgba(23, 32, 42, 0.06);
}

.segmented label {
  display: block;
  min-width: 0;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
  transition:
    background 150ms ease,
    color 150ms ease,
    box-shadow 150ms ease;
}

.segmented input:checked + span {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 10px 20px rgba(18, 108, 112, 0.22);
}

.segmented input:focus-visible + span,
button:focus-visible {
  outline: 3px solid rgba(18, 108, 112, 0.28);
  outline-offset: 3px;
}

.question-card {
  min-height: 430px;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid rgba(216, 224, 231, 0.92);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.88)),
    var(--surface);
  box-shadow: var(--shadow);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-height: 34px;
}

.pill,
.category {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 800;
}

.pill {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.category {
  color: #65421a;
  background: #f6ead8;
}

.question {
  max-width: 900px;
  min-height: 150px;
  margin: 36px 0;
  font-size: clamp(1.65rem, 4vw, 3.35rem);
  font-weight: 850;
  line-height: 1.08;
  letter-spacing: 0;
}

.answer-panel {
  margin: 0 0 28px;
  padding: 22px 24px;
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: var(--surface-soft);
}

.answer-label {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

#answer {
  margin: 0;
  color: #273241;
  font-size: 1.08rem;
  line-height: 1.65;
}

.empty-state {
  margin: 44px 0;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1.5;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

button {
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  font-weight: 850;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.primary {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 12px 22px rgba(18, 108, 112, 0.22);
}

.primary:hover:not(:disabled) {
  background: var(--accent-strong);
}

.secondary {
  color: var(--text);
  background: #eef3f5;
}

.secondary:hover:not(:disabled) {
  background: #e0e8ec;
}

.secondary.danger {
  color: var(--danger);
  background: var(--danger-soft);
}

.secondary.danger:hover:not(:disabled) {
  background: #f0c9d0;
}

.link-button {
  min-height: 42px;
  padding: 0 4px;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
}

.link-button:hover:not(:disabled) {
  color: var(--danger);
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 24px, 1040px);
    padding: 22px 0;
  }

  .hero,
  .controls {
    align-items: stretch;
    flex-direction: column;
  }

  .stats {
    min-width: 0;
  }

  .segmented {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .segmented span {
    min-height: 46px;
  }

  .question-card {
    min-height: 500px;
  }

  .question {
    min-height: 170px;
    margin: 28px 0;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}
