/* AdjustEd marketing site.
   Colours are the Outback Ochre palette (docs/BRAND_PALETTE.md) and match the
   app (web/tailwind.config.js "brand"). */
:root {
  --primary: #b8572e;
  --primary-dark: #3a2214;
  --secondary: #66783a;
  --accent: #e8a81f;
  --bg: #fbf5ee;
  --text: #3a2214;

  --muted: #7a6556;
  --surface: #ffffff;
  --line: rgba(184, 87, 46, 0.18);
  --radius: 20px;
  --shadow: 0 1px 2px rgba(58, 34, 20, 0.06), 0 12px 32px rgba(58, 34, 20, 0.08);
  --max: 1160px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Nunito", ui-sans-serif, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  line-height: 1.2;
  color: var(--primary-dark);
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  font-weight: 900;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.15rem;
  font-weight: 800;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--primary-dark);
}

:focus-visible {
  outline: 3px solid var(--secondary);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  width: min(var(--max), 100% - 40px);
  margin-inline: auto;
}

.narrow {
  width: min(780px, 100% - 40px);
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--primary);
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  z-index: 100;
}

.skip:focus {
  left: 12px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
  border: 2px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-sm {
  padding: 9px 18px;
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 18px rgba(184, 87, 46, 0.28);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-ghost {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: transparent;
}

.btn-accent {
  background: var(--accent);
  color: var(--primary-dark);
  box-shadow: 0 6px 18px rgba(232, 168, 31, 0.35);
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 1.15rem;
  text-decoration: none;
  color: var(--primary-dark);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 900;
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  font-weight: 700;
  color: var(--muted);
}

.nav-links a:hover {
  color: var(--primary-dark);
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(900px 420px at 85% 10%, rgba(232, 168, 31, 0.16), transparent 60%),
    radial-gradient(700px 400px at 0% 100%, rgba(102, 120, 58, 0.1), transparent 60%),
    var(--bg);
  padding: 84px 0 96px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 14px;
}

.lead {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 34em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 18px;
}

.fine {
  font-size: 0.92rem;
  color: var(--muted);
}

/* Product mock */
.mock {
  background: var(--surface);
  border-radius: 24px;
  box-shadow: 0 30px 70px rgba(61, 42, 26, 0.18), 0 2px 6px rgba(58, 34, 20, 0.08);
  overflow: hidden;
  border: 1px solid var(--line);
  transform: rotate(0.6deg);
}

.mock-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}

.mock-logo {
  background: #fff;
  color: var(--primary);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 0.85rem;
}

.mock-search {
  flex: 1;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 600;
  font-size: 0.9rem;
}

.mock-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
}

.mock-body {
  display: grid;
  grid-template-columns: 0.9fr 1.3fr;
  gap: 16px;
  padding: 18px;
  background: var(--bg);
}

.mock-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-content: start;
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px;
  border-radius: 16px;
  background: var(--surface);
  border: 3px solid var(--primary);
  font-weight: 800;
  font-size: 0.9rem;
}

.tile.fav {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 168, 31, 0.25);
}

.avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 900;
  color: #fff;
}

.a1 { background: #c98b5b; }
.a2 { background: #7c9cc9; }
.a3 { background: #8fae7b; }
.a4 { background: #c7869b; }

.mock-panel {
  background: var(--surface);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.88rem;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-head small {
  display: block;
  color: var(--muted);
}

.star {
  margin-left: auto;
  color: var(--accent);
  font-size: 1.3rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  border: 2px solid var(--primary);
  border-radius: 999px;
  padding: 3px 10px;
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--primary-dark);
}

.chip.on {
  background: var(--primary);
  color: #fff;
}

.slider {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.track {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--line);
}

.fill {
  width: 60%;
  height: 100%;
  border-radius: 999px;
  background: var(--secondary);
}

.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.fields span {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px 10px;
  font-weight: 700;
}

.fields small {
  display: block;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.72rem;
}

.note {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  color: var(--muted);
}

.submit {
  align-self: flex-end;
  background: #16a34a;
  color: #fff;
  font-weight: 800;
  border-radius: 999px;
  padding: 8px 22px;
}

/* Problem strip */
.problem {
  background: var(--primary-dark);
  color: #fff;
  padding: 56px 0;
}

.problem-text {
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  line-height: 1.55;
  margin: 0;
  text-align: center;
  font-weight: 600;
}

/* Sections */
.section {
  padding: 96px 0;
}

.section.alt {
  background: var(--bg);
}

.section-head {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 52px;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}

.feature:hover {
  transform: translateY(-3px);
}

.feature p {
  color: var(--muted);
  margin: 0;
}

.icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 1.35rem;
  margin-bottom: 16px;
}

/* Steps */
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  counter-reset: none;
}

.steps li {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
}

.steps p {
  color: var(--muted);
  margin: 0;
}

.step-num {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--primary-dark);
  font-weight: 900;
  margin-bottom: 16px;
}

/* Two-column audience blocks */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.audience {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: var(--shadow);
}

.audience p {
  color: var(--muted);
}

.ticks {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.ticks li {
  position: relative;
  padding-left: 32px;
  font-weight: 600;
}

.ticks li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 1px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 900;
}

/* NCCD callout */
.callout {
  background: var(--surface);
  border-left: 6px solid var(--accent);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
}

.callout p:last-child {
  margin-bottom: 0;
}

/* Security grid */
.security {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.sec-item {
  border-top: 3px solid var(--primary);
  padding: 22px 4px 0;
}

.sec-item p {
  color: var(--muted);
  margin: 0;
}

/* FAQ */
details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 22px;
  margin-bottom: 12px;
}

summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--primary-dark);
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  font-size: 1.3rem;
  line-height: 1;
  color: var(--primary);
  transition: transform 0.2s ease;
}

details[open] summary::after {
  transform: rotate(45deg);
}

details p {
  margin: 12px 0 0;
  color: var(--muted);
}

/* CTA + footer */
.cta {
  background:
    radial-gradient(600px 260px at 50% 0%, rgba(232, 168, 31, 0.22), transparent 70%),
    var(--primary);
  color: #fff;
  text-align: center;
  padding: 88px 0;
}

.cta h2 {
  color: #fff;
}

.cta p {
  font-size: 1.15rem;
  opacity: 0.92;
  margin-bottom: 28px;
}

.footer {
  background: var(--primary-dark);
  color: rgba(255, 255, 255, 0.85);
  padding: 30px 0;
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer p {
  margin: 0;
}

.disclaimer {
  max-width: 560px;
}

/* Responsive */
@media (max-width: 960px) {
  .hero-grid,
  .split {
    grid-template-columns: 1fr;
  }

  .features,
  .steps,
  .security {
    grid-template-columns: 1fr 1fr;
  }

  .nav-inner {
    flex-wrap: wrap;
  }

  .nav-links {
    gap: 16px;
    overflow-x: auto;
  }

  .mock {
    transform: none;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 16px;
  }

  .hero {
    padding: 56px 0 64px;
  }

  .section {
    padding: 68px 0;
  }

  .features,
  .steps,
  .security {
    grid-template-columns: 1fr;
  }

  .mock-body {
    grid-template-columns: 1fr;
  }

  .audience,
  .callout {
    padding: 26px;
  }
}

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

  .btn,
  .feature {
    transition: none;
  }
}

/* ---------- Tabs ---------- */
.js .tab-panel[hidden] {
  display: none;
}

.nav-links a {
  padding: 6px 2px;
  border-bottom: 3px solid transparent;
}

.nav-links a[aria-selected="true"] {
  color: var(--primary-dark);
  border-bottom-color: var(--accent);
}

.page-hero {
  padding: 72px 0 40px;
  text-align: center;
  background: linear-gradient(180deg, var(--bg), var(--surface));
}

.muted {
  color: var(--muted);
}

/* ---------- Interactive demo ---------- */
.demo {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.demo-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--primary);
  color: #fff;
}

.demo-search {
  flex: 1;
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 0.9rem;
}

.demo-count {
  font-weight: 800;
  font-size: 0.9rem;
  white-space: nowrap;
}

.demo-body {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 24px;
  padding: 24px;
  background: var(--bg);
}

.demo-students {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  align-content: start;
}

.demo .tile {
  font: inherit;
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
  border: 3px solid var(--primary);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.demo .tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.demo .tile.fav {
  border-color: var(--accent);
}

.demo .tile.sel {
  box-shadow: 0 0 0 3px var(--secondary);
}

.demo-panel,
.demo-empty {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.demo-panel[hidden],
.demo-empty[hidden] {
  display: none;
}

.demo-empty {
  align-items: center;
  justify-content: center;
  color: var(--muted);
  min-height: 240px;
}

.demo-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 700;
  font-size: 0.9rem;
  border: 0;
  padding: 0;
  margin: 0;
}

.demo-field legend {
  padding: 0;
  margin-bottom: 6px;
}

.demo-field input,
.demo-field select,
.demo-field textarea {
  font: inherit;
  font-weight: 400;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px;
  color: var(--text);
  background: var(--surface);
}

.demo-field input[type="range"] {
  padding: 0;
  accent-color: var(--primary);
}

.demo-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.demo .chip {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  background: var(--surface);
}

.demo .chip,
.hist-row .chip {
  border-color: var(--cat, var(--secondary));
  color: var(--text);
}

.demo .chip.on,
.hist-row .chip.on {
  background: var(--cat, var(--secondary));
  color: #2a1a10;
}

.star-btn {
  margin-left: auto;
  border: 0;
  background: none;
  font-size: 1.6rem;
  color: #dccfc2;
  cursor: pointer;
}

.star-btn.on {
  color: var(--accent);
}

.demo-submit {
  align-self: flex-end;
  border: 0;
  border-radius: 999px;
  padding: 10px 28px;
  font: inherit;
  font-weight: 800;
  color: #fff;
  background: #9ca3af;
  cursor: not-allowed;
  transition: background 0.15s, transform 0.15s;
}

.demo-submit.ready {
  background: #16a34a;
  cursor: pointer;
}

.demo-submit.ready:hover {
  transform: translateY(-2px);
}

.demo-history {
  padding: 20px 24px 24px;
  border-top: 1px solid var(--line);
}

.demo-history ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.hist-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.hist-row em {
  flex-basis: 100%;
  color: var(--muted);
}

/* "Adjustment lodged" animation: 1s, plays once per submit. */
.demo-lodged {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: #16a34a;
  font-weight: 800;
  font-size: 1.1rem;
}

.demo-lodged[hidden] {
  display: none;
}

.demo-lodged.play {
  animation: lodged-fade 1s ease-out forwards;
}

.lodged-badge {
  position: relative;
  width: 84px;
  height: 84px;
}

.lodged-ring,
.lodged-circle {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.lodged-ring {
  background: rgba(22, 163, 74, 0.4);
}

.lodged-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #16a34a;
  box-shadow: 0 8px 20px rgba(22, 163, 74, 0.35);
}

.lodged-circle svg {
  width: 44px;
  height: 44px;
  fill: none;
  stroke: #fff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
}

.demo-lodged.play .lodged-ring {
  animation: lodged-ring 0.7s 0.2s ease-out forwards;
}

.demo-lodged.play .lodged-circle {
  animation: lodged-pop 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.demo-lodged.play .lodged-circle svg {
  animation: lodged-draw 0.35s 0.25s ease-out forwards;
}

@keyframes lodged-fade {
  0% { opacity: 0; }
  12% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes lodged-pop {
  0% { transform: scale(0.4); opacity: 0; }
  35% { transform: scale(1.12); opacity: 1; }
  55% { transform: scale(1); }
  100% { transform: scale(1); }
}

@keyframes lodged-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes lodged-ring {
  0% { transform: scale(0.6); opacity: 0.7; }
  100% { transform: scale(1.9); opacity: 0; }
}

/* ---------- Billing ---------- */
.plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: stretch;
}

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.plan.featured {
  border: 2px solid var(--primary);
  transform: translateY(-8px);
}

.plan .ticks {
  flex: 1;
}

.plan-badge {
  position: absolute;
  top: -13px;
  left: 28px;
  background: var(--accent);
  color: var(--primary-dark);
  font-size: 0.8rem;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 999px;
}

.price {
  font-size: 2.6rem;
  font-weight: 900;
  color: var(--primary-dark);
  margin: 0;
  line-height: 1.1;
}

.price span {
  font-size: 1.2rem;
  vertical-align: top;
  margin-right: 2px;
}

.price small {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

/* ---------- About ---------- */
.people {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.person {
  text-align: center;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.avatar.big {
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  font-size: 1.4rem;
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  align-items: start;
}

.contact-form {
  display: grid;
  gap: 16px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.contact-form label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  font-size: 0.9rem;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  font: inherit;
  font-weight: 400;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--text);
}

.form-error {
  color: #b91c1c;
  font-weight: 700;
  margin: 0;
}

@media (max-width: 960px) {
  .demo-body,
  .contact-grid,
  .plans {
    grid-template-columns: 1fr;
  }

  .people {
    grid-template-columns: repeat(2, 1fr);
  }

  .plan.featured {
    transform: none;
  }
}

@media (max-width: 620px) {
  .people {
    grid-template-columns: 1fr;
  }

  .demo-students {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- Demo: mobile / website switch ---------- */
.demo-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin: 0 auto 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}

.seg {
  border: 0;
  border-radius: 999px;
  padding: 8px 20px;
  font: inherit;
  font-weight: 800;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.seg.on {
  background: var(--primary);
  color: #fff;
}

.demo-back {
  display: none;
  align-self: flex-start;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 800;
  color: var(--primary);
  cursor: pointer;
  padding: 0;
}

.chip {
  position: relative;
}

.chip-count {
  margin-left: 6px;
  background: var(--primary-dark);
  color: #fff;
  border-radius: 999px;
  padding: 0 7px;
  font-size: 0.75rem;
}

.demo-types {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  padding: 2px;
}

.type-btn {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: left;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px 12px;
  cursor: pointer;
}

.type-btn:hover {
  border-color: var(--primary);
}

.type-btn.on {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.demo-items {
  display: grid;
  gap: 10px;
}

.demo-items[hidden] {
  display: none;
}

.item-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
}

.item-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.item-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}

.item-title {
  flex: 1;
  display: grid;
  line-height: 1.3;
}

.item-remove {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
}

.item-slider {
  display: grid;
  gap: 2px;
  font-size: 0.85rem;
  font-weight: 700;
}

.item-slider input {
  accent-color: var(--primary);
}

/* Mobile: a phone frame showing one screen at a time. */
.demo-stage[data-view="mobile"] .demo {
  width: min(390px, 100%);
  height: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  border: 10px solid #2a1a10;
  border-radius: 44px;
  box-shadow: var(--shadow), 0 30px 60px rgba(58, 34, 20, 0.25);
}

.demo-stage[data-view="mobile"] .demo-body {
  flex: 1;
  display: block;
  padding: 16px;
  overflow-y: auto;
}

.demo-stage[data-view="mobile"] .demo-students {
  grid-template-columns: repeat(2, 1fr);
}

.demo-stage[data-view="mobile"] .demo-panel,
.demo-stage[data-view="mobile"] .demo-empty {
  border: 0;
  padding: 0;
  background: transparent;
}

.demo-stage[data-view="mobile"] .demo-empty {
  margin-top: 16px;
  min-height: 0;
}

.demo-stage[data-view="mobile"] .demo-back {
  display: block;
}

.demo-stage[data-view="mobile"].in-lodge .demo-students,
.demo-stage[data-view="mobile"].in-lodge .demo-bar .demo-search,
.demo-stage[data-view="mobile"]:not(.in-lodge) .demo-panel {
  display: none;
}

.demo-stage[data-view="mobile"] .demo-bar {
  padding-top: 20px;
}

.demo-stage[data-view="mobile"] .demo-history {
  max-width: 390px;
  margin: 24px auto 0;
  padding: 0;
  border: 0;
}

.demo-stage[data-view="web"] .demo-history {
  margin-top: 24px;
  padding: 0;
  border: 0;
}

/* ---------- Demo: compact sizing so everything fits on one screen ---------- */
#try.section {
  padding-block: 40px;
}

#try .section-head {
  margin-bottom: 16px;
}

#try .section-head h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
}

.demo-switch {
  margin-bottom: 16px;
}

.seg {
  padding: 6px 16px;
  font-size: 0.9rem;
}

.demo-stage {
  --demo-h: clamp(460px, calc(100vh - 300px), 620px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}

.demo {
  font-size: 0.9rem;
}

.demo-stage .demo {
  height: var(--demo-h);
  display: flex;
  flex-direction: column;
}

.demo-stage .demo-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 16px;
  gap: 16px;
}

.demo-stage[data-view="web"] .demo-students,
.demo-stage[data-view="web"] .demo-panel,
.demo-stage[data-view="web"] .demo-empty {
  overflow-y: auto;
  max-height: 100%;
}

.demo-stage[data-view="mobile"] .demo {
  width: min(330px, 100%);
  height: var(--demo-h);
  border-width: 8px;
  border-radius: 36px;
}

.demo-stage[data-view="mobile"] .demo-body {
  overflow-y: auto;
}

.demo-stage[data-view="mobile"] .demo-bar {
  padding-top: 16px;
}

.demo-bar {
  padding: 10px 14px;
}

.demo-panel {
  gap: 10px;
  padding: 14px;
}

.demo-types {
  max-height: 130px;
}

.demo-stage .demo-history,
.demo-stage[data-view="mobile"] .demo-history,
.demo-stage[data-view="web"] .demo-history {
  margin: 0;
  padding: 16px;
  max-width: none;
  height: var(--demo-h);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.demo-history h3 {
  font-size: 1rem;
}

.hist-row {
  padding: 8px 12px;
  font-size: 0.85rem;
}

@media (max-width: 960px) {
  .demo-stage {
    grid-template-columns: 1fr;
  }

  .demo-stage .demo-history {
    height: auto;
    max-height: 260px;
  }

  .demo-stage[data-view="web"] .demo {
    height: auto;
  }

  .demo-stage[data-view="web"] .demo-body {
    overflow: visible;
  }
}

/* ---------- Slimmer home page ---------- */
.hero-solo {
  grid-template-columns: 1fr;
  text-align: center;
}

.hero-solo .hero-copy {
  max-width: 760px;
  margin: 0 auto;
}

.hero-solo .hero-actions {
  justify-content: center;
}

.nav-login {
  white-space: nowrap;
}

/* The lodged overlay lives on .demo itself (not the scrolling body) so it is
   always centred in the visible screen, however far the form is scrolled. */
.demo {
  position: relative;
}

.demo-lodged {
  border-radius: inherit;
}

/* ---------- Legal footer ---------- */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.footer a {
  color: #fff;
  font-weight: 700;
}

.footer-company {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 0.8rem;
  opacity: 0.85;
}

.footer-company p {
  margin: 0;
}

/* Blend the hero's coloured glows into the demo section below (no hard edge). */
.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 140px;
  background: linear-gradient(to bottom, rgba(251, 245, 238, 0), var(--bg));
  pointer-events: none;
}

.hero + #try {
  padding-top: 24px;
}
