/* ===== Design tokens — bold editorial direction ===== */
:root {
  --bg: #ECE7DC;
  --bg-deep: #E4DDCB;
  --bg-elev: #F3EFE5;
  --paper: #FBF8F1;
  --ink: #141210;
  --ink-2: #2B2621;
  --ink-3: #4D463D;
  --muted: #7A7064;
  --muted-2: #A89E8E;
  --line: #D6CDB8;
  --line-2: #C0B599;
  --accent: #C94A25;
  --accent-2: #6B7A3A;
  --accent-soft: #F3E3D5;
  --accent-ink: #8A2E14;
  --dark: #141210;
  --dark-ink: #F3EFE5;
  --dark-muted: #8B8275;
  --success: #5A7A3A;
  --radius: 4px;
  --radius-lg: 8px;
  --font-sans: 'Rubik', -apple-system, sans-serif;
  --font-display: 'Rubik', sans-serif;
  --font-mono: 'Rubik', -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  direction: rtl;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(circle at 20% 0%, #F0EBDD 0%, transparent 40%),
    radial-gradient(circle at 80% 100%, #E8E1CC 0%, transparent 50%);
}

button {
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
input, textarea, select { font-family: inherit; }

::selection { background: var(--ink); color: var(--paper); }

/* ===== Marquee top strip ===== */
.marquee {
  background: var(--ink);
  color: var(--paper);
  padding: 9px 0;
  overflow: hidden;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  position: sticky;
  top: 0;
  z-index: 90;
}
.marquee-track {
  display: flex;
  white-space: nowrap;
  animation: scroll 60s linear infinite;
  gap: 32px;
}
.marquee-track span { display: inline-flex; align-items: center; gap: 32px; }
.marquee-track span::after {
  content: '✦';
  color: var(--accent);
  font-size: 10px;
}
@keyframes scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(50%); }
}

/* ===== Layout ===== */
.app {
  display: grid;
  grid-template-columns: 280px 1fr;
  max-width: 1480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ===== Sidebar ===== */
.sidebar {
  position: sticky;
  top: 38px;
  height: calc(100vh - 38px);
  height: calc(100dvh - 38px);
  border-inline-start: 1px solid var(--line);
}
.sidebar-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 32px 28px;
  overflow-y: auto;
}
.brand {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px dashed var(--line-2);
}
.brand-mark {
  width: 44px;
  height: 44px;
  background: var(--ink);
  color: var(--paper);
  display: grid;
  place-items: center;
  border-radius: 0;
  position: relative;
}
.brand-mark::after {
  content: '';
  position: absolute;
  inset-inline-start: -6px;
  top: -6px;
  width: 100%;
  height: 100%;
  border: 1px solid var(--ink);
  z-index: -1;
}
.brand-title { font-weight: 700; font-size: 16px; letter-spacing: -0.02em; line-height: 1; }
.brand-sub {
  font-size: 10px;
  color: var(--muted);
  margin-top: 5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 500;
}

.progress-block {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px dashed var(--line-2);
}
.progress-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.progress-label {
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.progress-pct {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.04em;
  line-height: 1;
}
.progress-bar {
  height: 2px;
  background: var(--line);
  overflow: hidden;
  margin-bottom: 10px;
}
.progress-fill {
  height: 100%;
  background: var(--ink);
  transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
.save-indicator { display: flex; align-items: center; gap: 6px; color: var(--success); }
.save-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
}
.nav-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border: none;
  background: transparent;
  text-align: start;
  color: var(--ink-3);
  transition: color 0.15s;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  position: relative;
}
.nav-item::before {
  content: '';
  position: absolute;
  inset-inline-end: -28px;
  top: 50%;
  width: 12px;
  height: 1px;
  background: var(--ink);
  transform: translateY(-50%) scaleX(0);
  transform-origin: inline-end;
  transition: transform 0.2s;
}
.nav-item:hover { color: var(--ink); }
.nav-item.active { color: var(--ink); font-weight: 600; }
.nav-item.active::before { transform: translateY(-50%) scaleX(1); }
.nav-num {
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.05em;
  min-width: 22px;
}
.nav-item.active .nav-num { color: var(--accent); }
.nav-title { flex: 1; letter-spacing: -0.01em; }
.nav-status { font-size: 10px; color: var(--muted); font-weight: 600; letter-spacing: 0.05em; }
.nav-item.done .nav-status { color: var(--success); }
.nav-check {
  display: inline-grid;
  place-items: center;
  width: 14px; height: 14px;
  background: var(--success);
  color: white;
  font-size: 9px;
  border-radius: 50%;
}

.sidebar-foot {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
  padding-top: 20px;
  border-top: 1px dashed var(--line-2);
  margin-top: 20px;
}

/* Mobile-only pieces — hidden on desktop */
.mobile-bar { display: none; }
.sidebar-backdrop { display: none; }
.sidebar-preview-btn { display: none; }

/* ===== Main ===== */
.main { padding: 64px 72px 96px; max-width: 920px; }

/* ===== Hero ===== */
.intro { margin-bottom: 100px; }
.intro-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 20px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--ink);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 600;
}
.intro-meta-right { color: var(--accent); }
.intro-title {
  font-family: var(--font-display);
  font-size: clamp(64px, 9vw, 120px);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 0.92;
  margin: 0 0 28px;
  color: var(--ink);
}
.intro-title .decor {
  color: var(--accent);
  font-style: italic;
  font-weight: 400;
  font-size: 0.7em;
  display: inline-block;
  transform: translateY(-0.08em);
  margin-inline-end: 0.08em;
  font-family: 'Times New Roman', serif;
}
.intro-subtitle {
  font-size: 18px;
  color: var(--ink-3);
  line-height: 1.55;
  max-width: 560px;
  margin: 0 0 40px;
  font-weight: 400;
}
.intro-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-block: 1px solid var(--ink);
  padding: 20px 0;
}
.intro-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 20px;
  border-inline-start: 1px solid var(--line-2);
}
.intro-stat:first-child { border-inline-start: none; padding-inline-start: 0; }
.intro-stat-val {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.035em;
  line-height: 1;
}
.intro-stat-label {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 600;
}

/* ===== Section ===== */
.section {
  margin-bottom: 120px;
  scroll-margin-top: 60px;
  position: relative;
}
.section-head {
  margin-bottom: 48px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: start;
}
.section-num {
  font-family: var(--font-display);
  font-size: 180px;
  font-weight: 800;
  line-height: 0.8;
  letter-spacing: -0.07em;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--ink);
  margin-inline-end: 8px;
  align-self: start;
}
.section-title-wrap {
  padding-top: 24px;
  position: relative;
}
.section-eyebrow {
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.section-eyebrow::before {
  content: '◆';
  font-size: 8px;
}
.section-title {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
  margin: 0 0 14px;
}
.section-subtitle {
  font-size: 16px;
  color: var(--ink-3);
  margin: 0;
  max-width: 480px;
  line-height: 1.55;
}

.section[data-id="design"] .f-mood {
  border-color: var(--line-2);
}

/* ===== Question shell ===== */
.q-shell {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 28px 32px;
  margin-bottom: 12px;
  transition: border-color 0.2s, transform 0.2s;
  position: relative;
}
.q-shell:hover { border-color: var(--ink-3); }
.q-shell:focus-within { border-color: var(--ink); }
.q-shell.answered { background: var(--bg-elev); }
.q-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}
.q-num {
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--accent);
  padding-top: 4px;
  min-width: 36px;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.q-text { flex: 1; }
.q-label {
  display: block;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
  line-height: 1.35;
  letter-spacing: -0.015em;
}
.q-req { color: var(--accent); margin-inline-start: 4px; }
.q-help {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.55;
  font-style: italic;
}
.q-check {
  display: inline-grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--success);
  color: white;
  font-size: 11px;
  font-weight: 600;
}
.q-body { padding-inline-start: 54px; }

/* ===== Fields ===== */
.f-text, .f-textarea {
  width: 100%;
  border: none;
  border-bottom: 1.5px solid var(--line-2);
  background: transparent;
  border-radius: 0;
  padding: 10px 0;
  font-size: 17px;
  color: var(--ink);
  transition: border-color 0.15s;
  font-family: inherit;
  font-weight: 500;
}
.f-text::placeholder, .f-textarea::placeholder { color: var(--muted-2); font-weight: 400; }
.f-text:focus, .f-textarea:focus {
  outline: none;
  border-color: var(--ink);
}
.f-textarea { resize: vertical; min-height: 80px; line-height: 1.6; border: 1.5px solid var(--line-2); padding: 14px 16px; background: var(--paper); }
.f-textarea:focus { border-color: var(--ink); }

/* Radio */
.f-radio-group { display: flex; flex-direction: column; gap: 4px; }
.f-radio {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--paper);
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.f-radio:hover { border-color: var(--ink-3); background: var(--bg-elev); }
.f-radio input { display: none; }
.f-radio-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.15s;
}
.f-radio.sel { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.f-radio.sel .f-radio-dot { border-color: var(--paper); }
.f-radio.sel .f-radio-dot::after {
  content: '';
  position: absolute;
  inset: 3px;
  background: var(--accent);
  border-radius: 50%;
}
.f-radio-label { font-size: 15px; font-weight: 500; }

/* Checkbox */
.f-check-group { display: flex; flex-wrap: wrap; gap: 8px; }
.f-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 14px;
  border: 1px solid var(--line);
  background: var(--paper);
  cursor: pointer;
  transition: all 0.15s;
  border-radius: 999px;
}
.f-check:hover { border-color: var(--ink-3); }
.f-check input { display: none; }
.f-check-box {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: transparent;
  font-size: 9px;
  transition: all 0.15s;
}
.f-check.sel { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.f-check.sel .f-check-box { background: var(--accent); border-color: var(--accent); color: white; }
.f-check-label { font-size: 14px; font-weight: 500; }

/* Mood picker */
.f-mood-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.f-mood {
  position: relative;
  border: 1px solid rgba(255,255,255,0.15);
  background: var(--dark);
  padding: 0;
  text-align: start;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  cursor: pointer;
  color: var(--dark-ink);
}
.f-mood:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--accent); }
.f-mood.sel { border-color: var(--accent); box-shadow: 4px 4px 0 var(--accent); }
.f-mood-preview {
  padding: 28px 24px;
  position: relative;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--paper);
  color: var(--ink);
}
.f-mood-swatches { display: flex; gap: 5px; }
.f-mood-swatch {
  width: 18px; height: 18px;
  border: 1px solid rgba(0,0,0,0.08);
}
.f-mood-typo { display: flex; align-items: baseline; gap: 10px; }
.f-mood-big {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.85;
}
.f-mood-small { font-size: 11px; font-weight: 500; letter-spacing: 0.15em; text-transform: uppercase; opacity: 0.7; }
.f-mood-info { padding: 16px 22px 18px; background: var(--dark); color: var(--dark-ink); }
.f-mood-title { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 3px; }
.f-mood-desc { font-size: 12px; color: var(--dark-muted); line-height: 1.5; }
.f-mood-badge {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  width: 28px; height: 28px;
  background: var(--accent);
  color: white;
  display: grid;
  place-items: center;
  font-size: 13px;
  border-radius: 50%;
  z-index: 2;
}

/* Upload */
.f-upload-zone {
  border: 1.5px dashed var(--line-2);
  padding: 36px 20px;
  text-align: center;
  color: var(--muted);
  transition: all 0.15s;
  cursor: pointer;
  background: var(--bg-elev);
  position: relative;
}
.f-upload-zone::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid transparent;
  transition: border-color 0.15s;
  pointer-events: none;
}
.f-upload-zone:hover, .f-upload-zone.drag { border-color: var(--ink); color: var(--ink-2); }
.f-upload-zone:hover::before, .f-upload-zone.drag::before { border-color: var(--line-2); }
.f-upload-zone svg { margin: 0 auto 10px; display: block; color: var(--ink); }
.f-upload-text { font-size: 15px; color: var(--ink-2); font-weight: 500; }
.f-upload-text strong { color: var(--ink); font-weight: 700; border-bottom: 1.5px solid var(--accent); }
.f-upload-hint { font-size: 11px; color: var(--muted); margin-top: 6px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 500; }
.f-upload-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.f-upload-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 13px;
}
.f-upload-name { flex: 1; color: var(--ink); font-weight: 500; }
.f-upload-size { color: var(--muted); font-size: 11px; font-weight: 500; }
.f-upload-list button {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  padding: 0 4px;
}
.f-upload-list button:hover { color: var(--accent); }

/* ===== Outro ===== */
.outro { margin-top: 120px; }
.outro-divider {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 48px;
}
.outro-divider-line { flex: 1; height: 1px; background: var(--ink); }
.outro-divider-text {
  font-size: 11px;
  color: var(--ink);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 700;
}

.outro-card {
  margin-bottom: 32px;
  padding: 40px 0;
  border-top: 1px solid var(--ink);
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 40px;
}
.outro-card:last-of-type { border-bottom: 1px solid var(--ink); }
.outro-eyebrow {
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 700;
}
.outro-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
  line-height: 1;
}
.outro-body {
  font-size: 16px;
  color: var(--ink-3);
  line-height: 1.65;
  margin: 0 0 16px;
  max-width: 560px;
}
.outro-range {
  font-size: 14px;
  color: var(--ink-2);
  padding: 16px 20px;
  background: var(--paper);
  border-inline-start: 3px solid var(--accent);
  line-height: 1.6;
  font-weight: 500;
}
.outro-note {
  font-size: 13px;
  color: var(--ink-2);
  background: var(--accent-soft);
  padding: 14px 18px;
  margin-top: 14px;
  line-height: 1.6;
  font-weight: 500;
}

/* ===== Expectations block (redesigned) ===== */
.expect-block {
  margin: 32px 0 0;
  padding: 56px 0 40px;
  position: relative;
}
.expect-head {
  position: relative;
  margin-bottom: 44px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--ink);
  max-width: 600px;
}
.expect-head .outro-eyebrow { color: var(--accent); margin-bottom: 14px; }
.expect-title {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -0.035em;
  margin: 0 0 16px;
  line-height: 0.95;
  color: var(--ink);
}
.expect-intro {
  font-size: 16px;
  color: var(--ink-3);
  line-height: 1.6;
  margin: 0;
  font-weight: 400;
}
.expect-steps {
  position: relative;
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.expect-step {
  position: relative;
  padding: 28px 20px 28px 0;
  border-inline-start: 1px solid var(--line-2);
}
.expect-step:first-child { border-inline-start: none; padding-inline-start: 0; }
.expect-step:not(:first-child) { padding-inline-start: 20px; }
.expect-step::before {
  content: '';
  position: absolute;
  top: 42px;
  inset-inline-start: -5px;
  width: 9px;
  height: 9px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--bg);
}
.expect-step:first-child::before { inset-inline-start: 0; }
.expect-step-num {
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
}
.expect-step-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 8px;
  line-height: 1.2;
}
.expect-step-desc {
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.55;
}
.expect-note {
  position: relative;
  margin-top: 40px;
  padding: 18px 22px;
  background: var(--accent-soft);
  border-inline-start: 3px solid var(--accent);
  font-size: 14px;
  color: var(--ink);
  line-height: 1.55;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-weight: 500;
}
.expect-note-icon { color: var(--accent); font-size: 12px; padding-top: 3px; }

.submit-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 48px 0 24px;
  margin-top: 32px;
}
.submit-hint { font-size: 13px; color: var(--muted); line-height: 1.6; max-width: 360px; }
.submit-btn {
  background: var(--ink);
  color: var(--paper);
  border: none;
  padding: 20px 36px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.submit-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: -1;
}
.submit-btn:hover { background: var(--accent); transform: translateY(-2px); }
.submit-btn svg { width: 18px; height: 18px; }

/* ===== Preview panel ===== */
.preview-toggle {
  position: fixed;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  inset-inline-start: 28px;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  border: none;
  padding: 14px 22px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.4);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
}
.preview-toggle:hover { background: var(--accent); transform: translateY(-2px); }
.preview-toggle svg { width: 16px; height: 16px; }

.preview-panel {
  position: fixed;
  top: 0;
  inset-inline-start: 0;
  height: 100vh;
  height: 100dvh;
  width: 460px;
  max-width: 90vw;
  background: var(--paper);
  border-inline-end: 1px solid var(--ink);
  z-index: 200;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.preview-panel.open { transform: translateX(0); }
.preview-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 32px 32px 24px;
  border-bottom: 1px solid var(--ink);
}
.preview-eyebrow {
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 6px;
  font-weight: 700;
}
.preview-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1;
}
.preview-close {
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  width: 34px; height: 34px;
  border-radius: 50%;
  transition: all 0.15s;
}
.preview-close:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.preview-body { flex: 1; overflow-y: auto; padding: 28px 32px 40px; }
.preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.preview-empty-icon { margin-bottom: 16px; color: var(--muted-2); }
.preview-empty-title { font-size: 17px; font-weight: 700; color: var(--ink-2); margin-bottom: 8px; }
.preview-empty-text { font-size: 13px; line-height: 1.6; max-width: 280px; }

.prev-section { margin-bottom: 32px; }
.prev-section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line-2);
}
.prev-section-num {
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
}
.prev-section-title { font-size: 15px; font-weight: 800; letter-spacing: -0.01em; }
.prev-list { margin: 0; padding: 0; }
.prev-item { margin-bottom: 14px; }
.prev-q { font-size: 11px; color: var(--muted); margin-bottom: 4px; line-height: 1.4; font-weight: 500; letter-spacing: 0.02em; }
.prev-a { font-size: 14px; color: var(--ink); margin: 0; line-height: 1.55; font-weight: 500; }
.prev-empty { color: var(--muted-2); font-weight: 400; font-style: italic; }

/* ===== Responsive — tablet & mobile ===== */
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }

  /* Hide floating preview toggle — access preview via the drawer button */
  .preview-toggle { display: none; }

  .marquee { font-size: 10px; padding: 7px 0; }

  /* ===== Mobile top bar ===== */
  .mobile-bar {
    display: flex;
    position: sticky;
    top: 29px;
    z-index: 100;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 10px 16px;
    padding-inline-start: calc(16px + env(safe-area-inset-right, 0px));
    padding-inline-end: calc(16px + env(safe-area-inset-left, 0px));
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .mobile-bar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
  }
  .mobile-bar-mark {
    width: 36px;
    height: 36px;
    background: var(--ink);
    color: var(--paper);
    display: grid;
    place-items: center;
    flex-shrink: 0;
  }
  .mobile-bar-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .mobile-bar-title {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
    line-height: 1.15;
  }
  .mobile-bar-progress {
    font-size: 11px;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: 0.04em;
    display: flex;
    gap: 6px;
  }
  .mobile-bar-pct { color: var(--accent); }
  .mobile-bar-sep { color: var(--muted-2); }

  .mobile-menu-btn {
    width: 44px;
    height: 44px;
    border: 1px solid var(--line-2);
    background: var(--paper);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-radius: 999px;
    transition: background 0.2s, border-color 0.2s;
    flex-shrink: 0;
  }
  .mobile-menu-btn:active { background: var(--bg-elev); }
  .mobile-menu-bar {
    display: block;
    width: 18px;
    height: 1.6px;
    background: var(--ink);
    border-radius: 2px;
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s;
  }
  .mobile-menu-btn.open { background: var(--ink); border-color: var(--ink); }
  .mobile-menu-btn.open .mobile-menu-bar { background: var(--paper); }
  .mobile-menu-btn.open .mobile-menu-bar:nth-child(1) {
    transform: translateY(5.6px) rotate(45deg);
  }
  .mobile-menu-btn.open .mobile-menu-bar:nth-child(2) { opacity: 0; }
  .mobile-menu-btn.open .mobile-menu-bar:nth-child(3) {
    transform: translateY(-5.6px) rotate(-45deg);
  }

  /* ===== Sidebar becomes a modal drawer ===== */
  .sidebar {
    position: fixed;
    inset: 0;
    top: 0;
    height: 100vh;
    height: 100dvh;
    width: 100%;
    z-index: 95;
    border: none;
    pointer-events: none;
  }
  .sidebar.open { pointer-events: auto; }

  .sidebar-backdrop {
    display: block;
    position: absolute;
    inset: 0;
    background: rgba(20, 18, 16, 0.55);
    opacity: 0;
    transition: opacity 0.3s ease;
    touch-action: none;
  }
  .sidebar.open .sidebar-backdrop { opacity: 1; }

  .sidebar-inner {
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    height: 100%;
    width: 340px;
    max-width: 86vw;
    padding: 28px 22px calc(28px + env(safe-area-inset-bottom, 0px));
    background: var(--paper);
    border-inline-end: 1px solid var(--ink);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.2);
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.2, 0.85, 0.2, 1);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .sidebar.open .sidebar-inner { transform: translateX(0); }

  .brand { margin-bottom: 22px; padding-bottom: 18px; }
  .progress-block { margin-bottom: 22px; padding-bottom: 18px; }
  .progress-pct { font-size: 28px; }

  /* Nav items: vertical stack inside the drawer */
  .nav {
    flex-direction: column;
    gap: 0;
    overflow: visible;
    margin: 0;
    padding: 0;
  }
  .nav-item {
    padding: 14px 4px;
    border: none;
    border-bottom: 1px solid var(--line);
    background: transparent;
    border-radius: 0;
    gap: 12px;
    font-size: 14px;
  }
  .nav-item:last-child { border-bottom: none; }
  .nav-item::before { display: none; }
  .nav-item.active {
    background: transparent;
    color: var(--ink);
    font-weight: 700;
  }
  .nav-item.active .nav-num { color: var(--accent); }
  .nav-title { white-space: normal; }

  .sidebar-preview-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: 20px;
    padding: 14px 16px;
    background: var(--ink);
    color: var(--paper);
    border: none;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.01em;
    transition: background 0.2s;
  }
  .sidebar-preview-btn:active { background: var(--accent); }
  .sidebar-preview-btn svg { width: 16px; height: 16px; }

  .sidebar-foot { margin-top: 18px; padding-top: 16px; }

  /* Main column */
  .main { padding: 32px 20px calc(48px + env(safe-area-inset-bottom, 0px)); }

  /* Hero */
  .intro { margin-bottom: 64px; }
  .intro-meta { font-size: 10px; padding-bottom: 14px; margin-bottom: 24px; }
  .intro-title { font-size: clamp(44px, 11vw, 72px); letter-spacing: -0.04em; margin-bottom: 20px; }
  .intro-subtitle { font-size: 15px; margin-bottom: 28px; }
  .intro-stats { padding: 14px 0; }
  .intro-stat { padding: 0 14px; }
  .intro-stat-val { font-size: 22px; }
  .intro-stat-label { font-size: 9px; letter-spacing: 0.12em; }

  /* Sections */
  .section { margin-bottom: 72px; scroll-margin-top: 44px; }
  .section-head { grid-template-columns: 1fr; gap: 14px; margin-bottom: 28px; }
  .section-num { font-size: 96px; -webkit-text-stroke: 1.2px var(--ink); }
  .section-title-wrap { padding-top: 0; }
  .section-title { font-size: 32px; }
  .section-subtitle { font-size: 14px; }

  /* Question cards */
  .q-shell { padding: 18px; }
  .q-head { gap: 12px; margin-bottom: 14px; }
  .q-label { font-size: 15px; }
  .q-help { font-size: 12px; }
  .q-num { font-size: 10px; min-width: 26px; }
  .q-body { padding-inline-start: 0; }

  /* Fields — 16px to stop iOS zoom-on-focus */
  .f-text, .f-textarea { font-size: 16px; }
  .f-textarea { padding: 12px 14px; }
  .f-radio { padding: 12px 14px; }
  .f-radio-label { font-size: 14px; }
  .f-check { padding: 8px 14px 8px 12px; }
  .f-check-label { font-size: 13px; }
  .f-mood-grid { grid-template-columns: 1fr; gap: 10px; }
  .f-mood-preview { min-height: 110px; padding: 20px; }
  .f-mood-big { font-size: 36px; }
  .f-upload-zone { padding: 26px 14px; }

  /* Outro */
  .outro-divider { gap: 12px; margin-bottom: 32px; }
  .outro-divider-text { font-size: 9px; letter-spacing: 0.15em; }
  .outro-card { grid-template-columns: 1fr; gap: 14px; padding: 28px 0; }
  .outro-title { font-size: 28px; }
  .outro-body { font-size: 14px; }
  .outro-range { font-size: 13px; padding: 12px 14px; }

  .expect-block { padding: 32px 0 20px; }
  .expect-head { margin-bottom: 28px; padding-bottom: 20px; }
  .expect-title { font-size: 30px; }
  .expect-intro { font-size: 14px; }
  .expect-steps { grid-template-columns: 1fr; }
  .expect-step {
    border-inline-start: none;
    border-top: 1px dashed var(--line-2);
    padding: 20px 0 20px 22px;
  }
  .expect-step:first-child { border-top: none; padding-top: 8px; }
  .expect-step::before { top: 28px; inset-inline-start: 0; }
  .expect-step:first-child::before { top: 12px; }
  .expect-step-title { font-size: 16px; }
  .expect-note { margin-top: 28px; padding: 14px 16px; font-size: 13px; }

  /* Submit row stacks */
  .submit-row {
    grid-template-columns: 1fr;
    padding: 32px 0 16px;
    gap: 16px;
    text-align: center;
  }
  .submit-hint { max-width: 100%; font-size: 12px; }
  .submit-btn { width: 100%; justify-content: center; padding: 18px 24px; font-size: 15px; }

  /* Preview: floating button becomes an icon, panel fills screen */
  .preview-toggle {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    inset-inline-start: 16px;
    width: 52px;
    height: 52px;
    padding: 0;
    justify-content: center;
    gap: 0;
  }
  .preview-toggle svg { width: 20px; height: 20px; }
  .preview-toggle-label { display: none; }
  .preview-panel { width: 100%; max-width: 100%; }
  .preview-head { padding: 24px 22px 18px; }
  .preview-title { font-size: 22px; }
  .preview-body { padding: 22px 22px 32px; }
}

@media (max-width: 480px) {
  /* Drawer takes full width on small phones */
  .sidebar-inner {
    width: 100%;
    max-width: 100%;
    border-inline-end: none;
  }
  .intro-title { font-size: 38px; }
  .intro-stats { grid-template-columns: 1fr 1fr; }
  .intro-stat:nth-child(3) {
    grid-column: span 2;
    border-inline-start: none;
    border-top: 1px solid var(--line-2);
    padding: 12px 0 0;
    margin-top: 12px;
  }
  .section-num { font-size: 72px; }
  .section-title { font-size: 26px; }
  .outro-title { font-size: 24px; }
  .expect-title { font-size: 26px; }
}

@media (max-width: 360px) {
  .mobile-bar { padding: 8px 14px; }
  .mobile-bar-mark { width: 32px; height: 32px; }
  .mobile-bar-title { font-size: 13px; }
  .main { padding-inline: 16px; }
  .intro-title { font-size: 32px; }
  .section-num { font-size: 56px; }
  .section-title { font-size: 22px; }
  .q-shell { padding: 14px; }
  .f-mood-preview { padding: 16px; min-height: 96px; }
  .f-mood-big { font-size: 30px; }
}

@media print {
  .sidebar, .preview-toggle, .submit-row, .marquee { display: none; }
  .app { display: block; }
  .main { max-width: 100%; padding: 40px; }
  .q-shell { break-inside: avoid; border: 1px solid #ddd; }
}
