:root {
  --ink: #18231f;
  --muted: #63706a;
  --paper: #fbfcf8;
  --card: #ffffff;
  --line: #dfe6df;
  --forest: #184f3a;
  --forest-dark: #103b2b;
  --mint: #dcefe3;
  --amber: #fff1cf;
  --danger: #9b2c2c;
  --shadow: 0 18px 55px rgba(24, 50, 38, 0.09);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
a { color: var(--forest); }
button, input, textarea { font: inherit; }

.respondent-page {
  background:
    radial-gradient(circle at 100% 0%, rgba(190, 221, 202, 0.55), transparent 34rem),
    var(--paper);
}

.respondent-shell { width: min(100%, 660px); margin: 0 auto; padding: 22px 18px 48px; }
.study-header { display: flex; align-items: center; gap: 11px; padding: 4px 2px 22px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: white; background: var(--forest); font-weight: 800; }
.kicker, .step-label { margin: 0; text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; font-weight: 800; color: var(--forest); }
.study-name { margin: 2px 0 0; font-size: .93rem; font-weight: 700; }
.mode-badge { margin-left: auto; border-radius: 999px; padding: 6px 10px; background: var(--amber); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }

.panel, .owner-card, .stat-card { background: var(--card); border: 1px solid rgba(210, 221, 213, .9); border-radius: 24px; box-shadow: var(--shadow); }
.panel { padding: clamp(24px, 6vw, 44px); }
h1 { margin: 9px 0 16px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 8vw, 3.15rem); line-height: 1.02; letter-spacing: -.035em; }
h2 { margin: 7px 0 12px; font-size: 1.22rem; }
.lead { font-size: 1.08rem; line-height: 1.65; color: #46524d; }
.time-note { display: flex; gap: 8px; align-items: center; margin: 22px 0; font-weight: 700; }
.privacy-note { margin: 24px 0; padding: 18px; border-radius: 16px; background: #f3f7f3; }
.privacy-note h2 { font-size: .92rem; }
.privacy-note p, .supporting-text, .small-note { margin: 0; color: var(--muted); font-size: .91rem; line-height: 1.55; }

.button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; padding: 12px 18px; border-radius: 13px; border: 1px solid transparent; font-weight: 800; text-decoration: none; cursor: pointer; }
.button-primary { background: var(--forest); color: white; }
.button-primary:hover { background: var(--forest-dark); }
.button-primary:disabled { background: #a8b5ae; cursor: not-allowed; }
.button-secondary { background: white; color: var(--forest); border-color: #b9c9c0; }
.button-danger { background: white; color: var(--danger); border-color: #e8b9b9; }
.button-full { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

.progress { height: 5px; margin: -6px 0 30px; background: #e7ece8; border-radius: 99px; overflow: hidden; }
.progress span { height: 100%; display: block; background: var(--forest); border-radius: inherit; }
.question-card { min-width: 0; margin: 24px 0; padding: 0; border: 0; }
.question-card legend { width: 100%; margin-bottom: 13px; font-size: 1.04rem; line-height: 1.45; font-weight: 750; }
.question-help { margin: -7px 0 13px; color: var(--muted); font-size: .86rem; line-height: 1.45; }
.optional { margin-left: 5px; color: var(--muted); font-size: .75rem; font-weight: 500; }
.choice-list { display: grid; gap: 9px; }
.choice { position: relative; display: flex; gap: 12px; align-items: center; min-height: 52px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--forest); background: #eff8f2; }
.choice input { width: 19px; height: 19px; accent-color: var(--forest); }
.other-response { margin: 12px 0 0 31px; }
textarea, .text-input { width: 100%; border: 1px solid #cbd6cf; border-radius: 12px; padding: 13px; color: var(--ink); background: white; }
textarea:focus, .text-input:focus { outline: 3px solid rgba(24, 79, 58, .14); border-color: var(--forest); }
.field-error { margin: 7px 0 0; color: var(--danger); font-size: .86rem; font-weight: 700; }
.has-error { padding: 12px; margin-inline: -12px; border-radius: 12px; background: #fff4f4; }

.concept-image { width: 100%; max-height: 240px; object-fit: cover; border-radius: 16px; margin: 18px 0 22px; }
.concept-eyebrow { margin: 0; color: var(--forest); font-weight: 800; font-size: .86rem; }
.timer-note { margin: 10px 0 0; text-align: center; color: var(--muted); font-size: .8rem; }
.stage-concept { overflow: hidden; }
.stage-concept .respondent-shell { height: 100dvh; display: flex; flex-direction: column; padding-bottom: 12px; }
.stage-concept .study-header { flex: 0 0 auto; padding-bottom: 10px; }
.stage-concept .concept-panel { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 12px; }
.stage-concept .progress { flex: 0 0 auto; margin: 0 0 10px; }
.stimulus-frame { display: block; width: 100%; flex: 1 1 auto; min-height: 0; border: 1px solid var(--line); border-radius: 14px; background: #f7f4ea; }
.exposure-status { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 9px 4px 0; color: var(--muted); font-size: .78rem; }
.exposure-status strong { min-width: 44px; color: var(--forest); font-size: 1rem; }
.currency-input { position: relative; }
.currency-input > span { position: absolute; z-index: 1; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 800; }
.currency-input .text-input { padding-left: 30px; }
.completion-panel { text-align: center; padding-block: 64px; }
.completion-icon { width: 64px; height: 64px; display: grid; place-items: center; margin: 0 auto 22px; border-radius: 50%; color: white; background: var(--forest); font-size: 1.8rem; }
.preview-note { margin: 24px 0 0; padding: 12px; border-radius: 12px; background: var(--amber); font-size: .85rem; }

.flash-stack { position: fixed; z-index: 10; top: 14px; left: 50%; transform: translateX(-50%); width: min(calc(100% - 28px), 680px); }
.flash { padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); font-weight: 700; background: white; border: 1px solid var(--line); }
.flash-error { color: var(--danger); background: #fff4f4; border-color: #eccaca; }
.flash-success { color: var(--forest); background: #eff8f2; }

.owner-page { background: #f4f7f3; }
.owner-shell { width: min(1240px, calc(100% - 32px)); margin: 0 auto; padding: 38px 0 70px; }
.owner-header, .section-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; }
.owner-header h1 { font-size: clamp(2rem, 4vw, 3.4rem); }
.quiet-link { color: var(--muted); }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 20px 0; }
.stat-card { padding: 22px; }
.stat-card span { display: block; color: var(--muted); font-size: .85rem; font-weight: 700; }
.stat-card strong { display: block; margin-top: 6px; font-size: 2rem; }
.owner-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.owner-card { padding: 24px; border-radius: 18px; box-shadow: 0 8px 24px rgba(24, 50, 38, .05); }
.launch-card { display: grid; grid-template-columns: 1fr 180px; gap: 24px; }
.destination { display: block; max-width: 680px; overflow-wrap: anywhere; font-weight: 700; }
.inline-warning { padding: 10px 12px; border-radius: 10px; background: var(--amber); font-size: .84rem; }
.share-status { margin: 12px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.qr-wrap img { width: 180px; height: 180px; }
.response-section { margin-top: 18px; }
.table-wrap { margin-top: 18px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; min-width: 900px; font-size: .84rem; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { position: sticky; top: 0; background: #f5f8f5; color: #4d5a54; }
.table-badge { display: inline-block; padding: 4px 7px; border-radius: 99px; font-size: .7rem; font-weight: 800; text-transform: uppercase; }
.table-badge-live { color: #12452f; background: var(--mint); }
.table-badge-preview { color: #6b4c00; background: var(--amber); }
.danger-zone { margin-top: 18px; }
.danger-zone summary { cursor: pointer; color: var(--danger); font-weight: 800; }
.clear-form { display: grid; gap: 12px; max-width: 520px; margin-top: 18px; }
.text-label { display: block; margin: 14px 0 7px; font-weight: 700; }
.login-shell { width: min(calc(100% - 32px), 480px); margin: 12vh auto; }

@media (max-width: 760px) {
  .respondent-shell { padding: 16px 12px 36px; }
  .panel { border-radius: 20px; }
  .owner-shell { width: min(100% - 20px, 1240px); padding-top: 24px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .owner-grid, .launch-card { grid-template-columns: 1fr; }
  .qr-wrap { order: -1; }
  .qr-wrap img { width: 150px; height: 150px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
