/* GiveMeChange preview styles — Phase 1 signup
   Warm cream + terracotta, coin typography. Not live. */

@font-face {
  font-family: "Cinzel";
  src: url("../fonts/cinzel.woff") format("woff");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces.woff") format("woff");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-italic.woff") format("woff");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Outfit";
  src: url("../fonts/outfit.woff") format("woff");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --terra: #c64526;
  --terra-hot: #db5530;
  --terra-dark: #9c3218;
  --terra-deep: #5c1c0e;
  --terra-soft: #f3d4cb;
  --cream: #fbf6ee;
  --cream-2: #f3e8d6;
  --cream-3: #e8d9c4;
  --paper: #fffdf9;
  --ink: #1c1410;
  --ink-2: #4a3b34;
  --ink-3: #7a6a62;
  --line: #e4d8c8;
  --silver: #c8c4bc;
  --coin: #f2efe8;
  --gold: #b8923a;
  --gold-soft: #f3e4b8;
  --green: #2c6b4f;
  --green-soft: #d7ede0;
  --danger: #9b1c1c;
  --shadow: 0 12px 40px rgba(28, 20, 16, 0.08);
  --shadow-lg: 0 24px 60px rgba(28, 20, 16, 0.14);
  --radius: 16px;
  --radius-sm: 10px;
  --header-h: 72px;
  --banner-h: 40px;
  --font-ui: "Outfit", "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, serif;
  --font-mark: "Cinzel", "Times New Roman", serif;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(198, 69, 38, 0.08), transparent 60%),
    radial-gradient(900px 400px at -10% 20%, rgba(184, 146, 58, 0.08), transparent 55%),
    var(--cream);
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--terra-dark); text-underline-offset: 3px; }
a:hover { color: var(--terra); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.15rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.muted { color: var(--ink-2); }
.fine { color: var(--ink-3); font-size: 0.88rem; }
.kicker {
  font-family: var(--font-mark);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--terra);
  font-weight: 700;
  margin: 0 0 0.6em;
}

.wrap { width: min(var(--max), calc(100% - 40px)); margin-inline: auto; }
.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: #fff; padding: 8px 12px; z-index: 100;
}
.skip:focus { left: 8px; top: 8px; }

/* Preview / demo banners */
.preview-banner, .demo-banner {
  position: sticky; top: 0; z-index: 50;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.preview-banner {
  background: var(--ink);
  color: var(--cream);
  min-height: var(--banner-h);
  display: block;
  text-align: center;
  padding: 8px 16px;
}
.preview-banner strong { color: var(--gold-soft); font-weight: 700; }
.demo-banner {
  background: #24180f;
  color: #f8e7b0;
  padding: 0;
}
.demo-banner a { color: #fff; }
.demo-banner .demo-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 16px;
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding: 8px 0;
}
.demo-banner .demo-label {
  font-family: var(--font-mark);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: #f8e7b0;
}
.demo-banner .phase-switch { display: flex; flex-wrap: wrap; gap: 6px; }
.demo-banner .phase-switch button {
  background: transparent;
  border: 1px solid rgba(248, 231, 176, 0.35);
  color: #f8e7b0;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}
.demo-banner .phase-switch button[aria-current="true"],
.demo-banner .phase-switch button.active {
  background: var(--gold-soft);
  color: #24180f;
  border-color: var(--gold-soft);
}
.demo-banner .phase-switch button:hover { border-color: #fff; }
.cta-real {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--terra); color: #fff !important; text-decoration: none;
  border-radius: 999px; padding: 5px 12px; font-size: 0.78rem; font-weight: 700;
}
.cta-real:hover { background: var(--terra-hot); }

/* Header */
.site-header {
  position: sticky; top: var(--banner-h); z-index: 40;
  background: rgba(251, 246, 238, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  min-height: var(--header-h); gap: 16px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink);
}
.brand img { width: 44px; height: 44px; border-radius: 50%; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.brand .wordmark {
  font-family: var(--font-mark);
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 0.95rem;
  line-height: 1.1;
}
.brand .wordmark span { display: block; font-size: 0.62rem; letter-spacing: 0.18em; color: var(--terra); font-weight: 600; }
nav.primary { display: flex; align-items: center; gap: 4px; }
nav.primary a {
  text-decoration: none; color: var(--ink-2);
  padding: 8px 12px; border-radius: 999px; font-weight: 500; font-size: 0.95rem;
}
nav.primary a:hover, nav.primary a[aria-current="page"] { color: var(--ink); background: var(--cream-2); }
.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px;
  padding: 12px 22px;
  font-weight: 650; font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s ease, background .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-terra { background: var(--terra); color: #fff; }
.btn-terra:hover { background: var(--terra-hot); color: #fff; }
.btn-x {
  background: #0f0f0f; color: #fff;
  box-shadow: var(--shadow);
}
.btn-x:hover { background: #222; color: #fff; }
.btn-x svg { width: 16px; height: 16px; fill: currentColor; }
.btn-ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--ink-2); background: var(--paper); color: var(--ink); }
.btn-gold { background: var(--gold-soft); color: var(--ink); }
.btn-sm { padding: 8px 14px; font-size: 0.9rem; }
.btn[disabled], .btn.is-disabled {
  opacity: 0.5; cursor: not-allowed; transform: none;
}

/* Hero */
.hero { padding: 48px 0 24px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}
.hero .tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  color: var(--ink-2);
  margin: 0 0 1.1em;
}
.hero-coin {
  display: flex; justify-content: center;
  position: relative;
}
.hero-coin img {
  width: min(420px, 100%);
  filter: drop-shadow(0 28px 40px rgba(92, 28, 14, 0.25));
  animation: floaty 7s ease-in-out infinite;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-coin img { animation: none; }
  html { scroll-behavior: auto; }
}

/* Cards & panels */
.card, .panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel { padding: 28px; }
.card { padding: 20px; }

/* Counter */
.counter {
  margin: 8px 0 56px;
}
.counter-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
}
.stat {
  padding: 28px;
}
.stat .num {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5vw, 3.6rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1;
}
.stat .num small { font-size: 0.45em; color: var(--ink-3); font-weight: 500; }
.bar {
  height: 10px; background: var(--cream-2); border-radius: 999px;
  overflow: hidden; margin: 14px 0 8px;
}
.bar > span {
  display: block; height: 100%; background: var(--terra);
  border-radius: inherit;
}
.avatars { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--cream-2); color: var(--ink-2);
  font-weight: 650; font-size: 0.75rem;
  border: 2px solid var(--paper);
}
.avatar.more { background: var(--ink); color: var(--cream); font-size: 0.65rem; }

/* Steps / timeline */
.steps, .tiers, .timeline {
  display: grid; gap: 16px;
}
.steps { grid-template-columns: repeat(4, 1fr); }
.tiers { grid-template-columns: repeat(3, 1fr); }
.timeline { grid-template-columns: repeat(3, 1fr); }
.step, .tier, .time-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.step .n {
  font-family: var(--font-mark);
  color: var(--terra);
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
}
.tier .cap {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 650;
  margin: 4px 0;
}
.tier dt { color: var(--ink-3); font-size: 0.8rem; }
.tier dd { margin: 0 0 8px; font-weight: 600; }
.time-card .when { color: var(--terra); font-weight: 700; font-size: 0.9rem; }

section.band { padding: 28px 0 8px; }
section.band h2 { margin-bottom: 8px; }
section.band .lead { color: var(--ink-2); max-width: 640px; margin-bottom: 24px; }

/* Forms */
.form-row { margin-bottom: 16px; }
label.lbl, .lbl {
  display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 6px;
}
.hint { display: block; color: var(--ink-3); font-size: 0.82rem; margin-top: 4px; }
input[type="text"], input[type="url"], input[type="number"], select, textarea {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible, .btn:focus-visible {
  outline: 3px solid var(--gold-soft);
  outline-offset: 2px;
}
textarea { min-height: 110px; resize: vertical; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices label {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 500;
}
.choices input { accent-color: var(--terra); }
.choices label:has(input:checked) {
  border-color: var(--terra);
  background: var(--terra-soft);
}
.check {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 10px 0;
}
.check input { margin-top: 4px; accent-color: var(--terra); flex-shrink: 0; }
.err { color: var(--danger); font-size: 0.88rem; margin-top: 6px; display: none; }
.err.show { display: block; }

/* Modal */
.modal-back {
  position: fixed; inset: 0; background: rgba(28, 20, 16, 0.55);
  display: none; align-items: center; justify-content: center;
  z-index: 80; padding: 20px;
}
.modal-back.open { display: flex; }
.modal {
  background: var(--paper);
  border-radius: 20px;
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 28px;
  box-shadow: var(--shadow-lg);
}
.modal h2 { font-size: 1.6rem; }

/* Success / signed-in */
.signed-bar {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.92rem;
}
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--cream-2);
  color: var(--ink-2);
}
.pill.gold { background: var(--gold-soft); color: var(--ink); }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.terra { background: var(--terra); color: #fff; }
.pill.danger { background: #f8d4d4; color: var(--danger); }
.pill.silver { background: #ececec; color: #444; }

/* Legal */
.legal { padding: 40px 0 80px; }
.legal-doc {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 48px);
  box-shadow: var(--shadow);
  max-width: 800px;
  margin: 0 auto 40px;
}
.legal-doc h1 { font-size: 2.1rem; }
.legal-doc h2 { margin-top: 1.6em; font-size: 1.4rem; }
.legal-doc h3 { margin-top: 1.2em; }
.legal-doc table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: 0.95rem; }
.legal-doc th, .legal-doc td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.legal-doc th { background: var(--cream-2); }
.legal-doc blockquote {
  margin: 1em 0;
  padding: 14px 16px;
  background: #fff6e8;
  border-left: 4px solid var(--gold);
  border-radius: 0 10px 10px 0;
}
.draft-note {
  background: #fff6e8;
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 16px 0 28px;
}

/* Footer */
.site-footer {
  margin-top: 64px;
  border-top: 1px solid var(--line);
  background: #f3ece1;
  padding: 36px 0 28px;
  color: var(--ink-2);
  font-size: 0.92rem;
}
.site-footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 24px; }
.site-footer .wordmark { color: var(--ink); margin-bottom: 8px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0 0 6px; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--terra); text-decoration: underline; }
.copy { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 0.82rem; color: var(--ink-3); }

/* Demo-specific */
.pot-hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: stretch;
  /* margin-block only: do not zero out .wrap's margin-inline: auto */
  margin-block: 28px 36px;
}
.pot-total {
  background: linear-gradient(160deg, #5c1c0e 0%, #9c3218 50%, #c64526 100%);
  color: #fff;
  border-radius: 20px;
  padding: 32px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.pot-total::after {
  content: "";
  position: absolute; right: -40px; bottom: -40px;
  width: 220px; height: 220px;
  background: url("../img/george-256.png") center / contain no-repeat;
  opacity: 0.18;
  pointer-events: none;
}
.pot-total .amt {
  font-family: var(--font-display);
  font-size: clamp(3rem, 6vw, 4.4rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1;
}
.pot-total p { color: rgba(255,255,255,.85); }
.breakdown { list-style: none; margin: 0; padding: 0; }
.breakdown li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}
.schedule-list { list-style: none; margin: 0; padding: 0; }
.schedule-list li {
  display: grid; grid-template-columns: 110px 1fr;
  gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line);
}
.schedule-list strong { color: var(--terra-dark); }

/* Grift cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.grift-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  display: flex; flex-direction: column; gap: 8px;
  position: relative;
}
.grift-card.yours { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.grift-card.mine { border-style: dashed; }
.grift-card h3 { font-size: 1.15rem; margin: 0; }
.who { font-size: 0.88rem; color: var(--ink-3); }
.goal { font-weight: 700; }
.vote-count { font-family: var(--font-display); font-size: 1.6rem; font-weight: 650; }
.ranked { display: flex; flex-direction: column; gap: 10px; }
.ranked-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 14px;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
}
.ranked-row.yours { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.rank-n {
  font-family: var(--font-mark);
  font-size: 1.1rem;
  color: var(--terra);
  font-weight: 700;
  text-align: center;
}
.pick-status {
  background: var(--gold-soft);
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 650;
  margin: 0 0 18px;
}

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 18px; }
.tabs button {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
}
.tabs button.active { background: var(--ink); color: var(--cream); border-color: var(--ink); }

.waterfall { display: flex; flex-direction: column; gap: 8px; margin: 16px 0 28px; }
.wf {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.wf.funded { background: var(--green-soft); border-color: #b7dcc8; }
.wf.bonus { background: var(--gold-soft); border-color: #e0c56a; }
.wf.stopped { background: #f8e6e2; border-color: #e8c0b4; }
.wf.roll { background: var(--cream-2); }

/* Profile */
.profile-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: center;
  margin: 12px 0 28px;
}
.profile-ava {
  width: 88px; height: 88px; border-radius: 50%;
  background: var(--terra);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; font-weight: 700;
}
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.meter {
  height: 12px; background: var(--cream-2); border-radius: 999px; overflow: hidden;
}
.meter > span { display: block; height: 100%; background: var(--terra); }

.notice {
  border-radius: 12px;
  padding: 12px 16px;
  margin: 0 0 18px;
  background: var(--cream-2);
  border: 1px solid var(--line);
}
.notice.ok { background: var(--green-soft); border-color: #b7dcc8; }
.notice.warn { background: #fff6e8; border-color: var(--gold); }
.notice.alert { background: #f8e6e2; border-color: #e8c0b4; }

/* Sample watermark for data */
.sample-tag {
  font-family: var(--font-mark);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}

/* FAQ */
.faq details {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
  margin: 0 0 10px;
}
.faq summary { cursor: pointer; font-weight: 650; }

/* Utility */
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.hide { display: none !important; }
.center { text-align: center; }

@media (max-width: 860px) {
  .hero-grid, .counter-grid, .pot-hero, .split, .site-footer .wrap,
  .steps, .tiers, .timeline { grid-template-columns: 1fr; }
  .schedule-list li { grid-template-columns: 1fr; gap: 2px; }
  .hero { padding-top: 28px; }
  .hero-coin { order: -1; }
  .hero-coin img { width: min(260px, 70vw); }
  nav.primary {
    display: none;
    position: absolute; right: 16px; top: calc(var(--banner-h) + var(--header-h));
    flex-direction: column; align-items: stretch;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px;
    box-shadow: var(--shadow);
    min-width: 200px;
  }
  nav.primary.open { display: flex; }
  .nav-toggle { display: inline-flex; }
  .site-header { top: var(--banner-h); }
  .wf { grid-template-columns: 24px 1fr auto; }
  .wf .goal-col { display: none; }
  .ranked-row { grid-template-columns: 36px 1fr; }
  .ranked-row .vote-count { grid-column: 2; }
  body { font-size: 16px; }
  .wrap { width: min(var(--max), calc(100% - 28px)); }
}


/* ----- QA fixes ----- */
.sticky-chrome {
  position: sticky;
  top: 0;
  z-index: 50;
}
.preview-banner, .demo-banner, .site-header {
  position: relative;
  top: auto;
}
.site-header { top: auto; }
.brand { flex-shrink: 0; }
.brand .wordmark {
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.05;
}
.brand .wordmark span { display: block; }
nav.primary a { white-space: nowrap; }
.signed-bar { white-space: nowrap; flex-shrink: 0; }
.signed-bar .btn { white-space: nowrap; }
#header-cta { flex-shrink: 0; }
.schedule-list li { grid-template-columns: 9.5rem 1fr; }
.grift-card { min-height: 100%; }
.cards { align-items: stretch; }
.grift-card .row-actions:last-of-type { margin-top: auto; }
section[id], #pledge, #bar, #how { scroll-margin-top: 120px; }
.modal code { word-break: break-all; }
.hero h1 { line-height: 1.05; }

@media (max-width: 1180px) {
  body[data-page]:not([data-page="signup"]):not([data-page="legal"]) .nav-toggle,
  .demo-root .nav-toggle { display: inline-flex; }
  body[data-page]:not([data-page="signup"]):not([data-page="legal"]) nav.primary,
  .demo-root nav.primary {
    display: none;
    position: absolute; right: 16px; top: 100%;
    flex-direction: column; align-items: stretch;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px;
    box-shadow: var(--shadow);
    min-width: 200px;
    z-index: 60;
  }
  body[data-page]:not([data-page="signup"]):not([data-page="legal"]) nav.primary.open,
  .demo-root nav.primary.open { display: flex; }
}

@media (max-width: 860px) {
  .demo-banner .demo-row { padding: 6px 0; }
  .demo-banner .fine { display: none; }
  .demo-banner .phase-switch {
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .demo-banner .phase-switch button { flex: 0 0 auto; }
  #header-cta { display: none; }
  nav.primary .mobile-account {
    display: block;
    border-top: 1px solid var(--line);
    margin-top: 6px;
    padding-top: 8px;
  }
  .schedule-list li { grid-template-columns: 1fr; }
  .preview-banner { font-size: 0.75rem; line-height: 1.3; }
}

@media (min-width: 861px) {
  nav.primary .mobile-account { display: none; }
}

.demo-row-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.demo-row-phases { padding-top: 0 !important; }
@media (max-width: 860px) {
  .demo-row-phases { width: 100%; }
  .demo-row-phases .phase-switch { width: 100%; }
}

.preview-banner { display: block !important; text-align: center; }

/* Mobile results + ranked vote layout */
@media (max-width: 860px) {
  .wf {
    grid-template-columns: 24px 1fr;
    align-items: start;
  }
  .wf .goal-col { display: none; }
  .wf > strong {
    grid-column: 2;
    justify-self: start;
    margin-top: 4px;
  }
  .ranked-row {
    grid-template-columns: 36px 1fr auto;
    align-items: start;
  }
  .ranked-row .vote-count {
    grid-column: auto;
    font-size: 1.35rem;
  }
}

.modal code {
  display: block;
  margin: 6px 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 0.88em;
}
@media (max-width: 860px) {
  .profile-head { min-width: 0; gap: 14px; }
  .profile-head > div { min-width: 0; }
  .profile-head h1 {
    font-size: 1.55rem;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .profile-ava { width: 72px; height: 72px; font-size: 1.45rem; }
}
