:root {
  --ink: #1a2421;
  --ink-soft: #4a5852;
  --paper: #f2eee6;
  --panel: rgba(250, 247, 240, 0.94);
  --line: rgba(26, 36, 33, 0.12);
  --accent: #245c4b;
  --accent-2: #b85a2a;
  --danger: #8f2f2f;
  --ok: #245c4b;
  --shadow: 0 16px 40px rgba(26, 36, 33, 0.1);
  --font: "Noto Sans SC", "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: var(--font); color: var(--ink); background: var(--paper); }
[hidden], .is-hidden { display: none !important; }

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(800px 420px at 8% -8%, rgba(36, 92, 75, 0.18), transparent 60%),
    radial-gradient(640px 380px at 100% 0%, rgba(184, 90, 42, 0.12), transparent 55%),
    linear-gradient(180deg, #ebe4d7, #f4f0e8 50%, #e8e2d6);
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 247, 240, 0.8);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand { display: flex; align-items: center; gap: 12px; }
.mark {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--ink); color: #f4f0e8;
  font-weight: 700; font-size: 13px;
}
.brand strong { display: block; }
.muted { color: var(--ink-soft); font-size: 13px; }

.progress-wrap { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ink-soft); }
.progress-bar {
  width: 120px; height: 6px; border-radius: 999px;
  background: rgba(26, 36, 33, 0.08); overflow: hidden;
}
.progress-bar i {
  display: block; height: 100%; width: 0;
  background: var(--accent); border-radius: inherit;
  transition: width 0.25s ease;
}

.shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.75fr);
  gap: 18px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
}

#view { min-height: 360px; animation: rise 0.35s ease both; }
.eyebrow {
  margin: 0 0 8px;
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); font-weight: 600;
}
h1, h2 { margin: 0 0 10px; letter-spacing: -0.02em; }
h1 { font-size: clamp(1.45rem, 3vw, 1.9rem); }
.lede { margin: 0 0 18px; color: var(--ink-soft); line-height: 1.65; }

.q-title { font-size: 1.15rem; font-weight: 700; margin: 0 0 14px; line-height: 1.4; }
.hint { font-size: 13px; color: var(--ink-soft); margin: -6px 0 14px; }

.options { display: grid; gap: 10px; }
.opt {
  text-align: left;
  width: 100%;
  border: 1px solid var(--line);
  background: #fffdf8;
  border-radius: 14px;
  padding: 14px 16px;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.opt:hover { border-color: var(--accent); transform: translateY(-1px); }
.opt.selected { border-color: var(--accent); background: rgba(36, 92, 75, 0.08); font-weight: 600; }

.field { display: grid; gap: 8px; margin-bottom: 12px; font-size: 14px; font-weight: 500; }
.field input, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font: inherit; background: #fffdf8;
}
.field input:focus, .field textarea:focus {
  outline: 2px solid rgba(36, 92, 75, 0.3); border-color: var(--accent);
}

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.btn {
  border: 0; border-radius: 999px; padding: 12px 18px;
  font: inherit; font-weight: 600; cursor: pointer;
}
.btn.primary { background: var(--accent); color: #f4f0e8; }
.btn.primary:hover { background: #1b4639; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink-soft); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.pill {
  display: inline-block; font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(36, 92, 75, 0.1); color: var(--accent); margin-bottom: 10px;
}

.end-box {
  background: rgba(36, 92, 75, 0.06);
  border: 1px solid rgba(36, 92, 75, 0.15);
  border-radius: 14px; padding: 14px; margin-top: 12px;
  font-size: 14px; line-height: 1.55; color: var(--ink-soft);
}

.guard h2 { font-size: 1.05rem; }
.guard .rules { margin: 12px 0 0; padding-left: 18px; color: var(--ink-soft); font-size: 13px; line-height: 1.55; }
.metrics { display: grid; gap: 8px; margin-top: 12px; }
.metric {
  background: rgba(26, 36, 33, 0.04); border-radius: 12px; padding: 10px 12px;
}
.metric .label { display: block; font-size: 11px; color: var(--ink-soft); }
.metric .value { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.foot {
  max-width: 980px; margin: 0 auto;
  padding: 8px 24px 28px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: 13px; color: var(--ink-soft);
}

.err { color: var(--danger); font-size: 13px; margin-top: 8px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; padding: 16px 14px; }
  .top { padding: 14px; flex-direction: column; align-items: flex-start; }
  .progress-bar { width: 160px; }
}
