:root {
  --brand: #1650e6;
  --brand-dark: #0d3dbd;
  --brand-soft: #e6edfd;
  --ink: #111111;
  --muted: #555b66;
  --line: #e4e1d8;
  --border: #111111;
  --bg: #fcfaf3;
  --surface: #ffffff;
  --panel: #e8edec;
  --done: #15803d;
  --done-soft: #e3f3e8;
  --upcoming: #f1efe8;
  --next: #b06a12;
  --next-dark: #8f540c;
  --next-soft: #f7ecdd;
  --error: #c2410c;
  --radius: 12px;
  --heading: "Figtree", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --offset: 5px 5px 0 var(--border);
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-family: var(--heading); font-weight: 800; letter-spacing: -.025em; }
.accent { color: var(--brand); }
.muted { color: var(--muted); margin: 6px 0 0; }

.tag {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  font-family: var(--heading);
  font-weight: 700;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 4px;
}

/* Buttons */
.btn {
  font: inherit;
  font-family: var(--heading);
  font-weight: 700;
  border-radius: 8px;
  padding: 14px 20px;
  cursor: pointer;
  transition: transform .1s, box-shadow .1s, background .15s;
}
.btn-primary {
  width: 100%;
  background: var(--brand);
  color: #fff;
  border: 2px solid var(--border);
  box-shadow: 4px 4px 0 var(--border);
  font-size: 16px;
}
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--border); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  padding: 8px 14px;
  border: 2px solid var(--border);
  box-shadow: 3px 3px 0 var(--border);
  font-size: 14px;
}
.btn-ghost:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--border); }

/* Auth */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: 8px 8px 0 var(--brand);
}
.auth-logo { height: 40px; display: block; margin-bottom: 28px; }
.auth-card h1 { font-size: 30px; line-height: 1.1; }
#auth-form { margin-top: 24px; display: grid; gap: 16px; }
.field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.field input {
  width: 100%;
  font: inherit;
  font-size: 16px;
  font-weight: 400;
  padding: 13px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: box-shadow .15s;
}
.field input:focus { box-shadow: 0 0 0 3px var(--brand-soft); border-color: var(--brand); }

.password-wrap { position: relative; }
.password-wrap input { padding-right: 52px; }
.eye-btn {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
}
.eye-btn:hover { color: var(--brand); background: var(--brand-soft); }
.eye-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.eye-btn svg { width: 22px; height: 22px; }
.eye-btn .icon-hide { display: none; }
.eye-btn[aria-pressed="true"] .icon-show { display: none; }
.eye-btn[aria-pressed="true"] .icon-hide { display: block; }

.field-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.forgot-link { font-size: 13px; font-weight: 600; color: var(--brand); text-decoration: none; }
.forgot-link:hover { text-decoration: underline; }
.forgot-link[hidden], #auth-form[hidden], .field[hidden] { display: none; }
.form-success { color: var(--done); font-size: 14px; font-weight: 600; margin: 0; }
.form-success:empty { display: none; }
.form-error { color: var(--error); font-size: 14px; font-weight: 500; margin: 0; }
.form-error:empty { display: none; }
.auth-switch[hidden] { display: none; }
.auth-accepted #auth-title { color: var(--done); }
.auth-accepted #auth-title::before {
  content: "✓";
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--done);
  color: #fff;
  font-size: 18px;
}
.auth-waiting #auth-title::before {
  content: "";
  display: block;
  width: 14px;
  height: 14px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--next);
  box-shadow: 0 0 0 6px var(--next-soft);
}
.auth-switch { text-align: center; color: var(--muted); font-size: 14px; margin: 24px 0 0; }
.auth-switch a { color: var(--brand); font-weight: 700; text-decoration: none; margin-left: 4px; }
.auth-switch a:hover { text-decoration: underline; }

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 40px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-logo { height: 34px; display: block; }
.topbar-user { display: flex; align-items: center; gap: 14px; font-size: 14px; font-weight: 500; color: var(--muted); }

/* Hub */
.hub { max-width: 1200px; margin: 0 auto; padding: 40px 32px 64px; display: grid; gap: 32px; }
.hub-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hub-head > div:first-child { min-width: 0; }
.hub-head h1 { font-size: 44px; line-height: 1.05; margin-top: 16px; }
.program-picker { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 14px; font-size: 17px; color: var(--muted); }
.program-picker label { font-weight: 500; }
.select-wrap { position: relative; }
.select-wrap::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-family: var(--heading);
  font-weight: 800;
  font-size: 17px;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 8px;
  box-shadow: 3px 3px 0 var(--border);
  padding: 7px 38px 7px 12px;
  cursor: pointer;
}
.select-wrap select:focus-visible { outline: 3px solid var(--brand-soft); border-color: var(--brand); }
.program-range { font-size: 14px; }
.day-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
  padding: 9px 18px;
  border: 1.5px solid var(--brand);
  border-radius: 999px;
}
.day-badge.is-upcoming { border-color: var(--border); }
.day-badge.is-upcoming::before { background: #b9bdbd; box-shadow: 0 0 0 4px var(--upcoming); }
.day-badge::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.panel {
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .25);
}
.panel-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 20px; gap: 12px; }
.panel-head h2 { font-size: 26px; }
.progress-label { color: var(--muted); font-size: 14px; font-weight: 600; }

/* Timeline */
.timeline { position: relative; padding-top: 30px; }
.timeline-track { display: flex; gap: 6px; }
.segment {
  flex-basis: 0;
  min-width: 156px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  padding: 14px 12px;
  display: grid;
  gap: 3px;
  overflow: hidden;
  white-space: nowrap;
}
.segment-name { font-family: var(--heading); font-weight: 800; font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.segment-short { display: none; font-family: var(--heading); font-weight: 800; font-size: 12px; text-align: center; }
.segment-dates { font-size: 12px; opacity: .85; overflow: hidden; text-overflow: ellipsis; }
.segment-done { background: var(--done-soft); color: var(--done); }
.segment-current { background: var(--brand); color: #fff; }
.segment-next { background: var(--next-soft); color: var(--next); border-color: var(--next); }
.segment-upcoming { background: var(--surface); color: var(--muted); border-color: #b9bdbd; }

.timeline-today {
  position: absolute;
  top: 0;
  bottom: 38px;
  width: 2px;
  background: var(--ink);
  transform: translateX(-1px);
  pointer-events: none;
}
.timeline-today span {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 4px;
  white-space: nowrap;
}

.timeline-milestones { position: relative; height: 44px; }
.milestone {
  position: absolute;
  top: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  transform: translateX(-14px);
}
/* Little stem connecting the flag up to its day on the track. */
.milestone::before {
  content: "";
  position: absolute;
  left: 13px;
  top: -16px;
  height: 14px;
  border-left: 2px solid var(--border);
}
.milestone-name { font-family: var(--heading); font-weight: 800; }
.milestone-day { color: var(--muted); }
.milestone-done { background: var(--done-soft); color: var(--done); }
.milestone-current { background: var(--brand); color: #fff; }
.milestone-next { background: var(--next-soft); color: var(--next); border-color: var(--next); }
.milestone-current .milestone-day { color: #fff; opacity: .85; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform .15s, box-shadow .15s;
}
.card { cursor: pointer; outline: none; }
.card:hover, .card:focus-visible { transform: translate(-3px, -3px); box-shadow: var(--offset); }
.card:focus-visible { border-color: var(--brand); }
.card:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--border); }

.card-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: var(--heading);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  transition: background .15s, color .15s;
}
.card-cta-arrow { font-size: 18px; line-height: 1; transition: transform .2s; }
.card:hover .card-cta, .card:focus-visible .card-cta { background: var(--ink); color: #fff; }
.card:hover .card-cta-arrow, .card:focus-visible .card-cta-arrow { transform: translateX(5px); }
.card-current .card-cta { background: var(--brand); color: #fff; border-color: var(--border); box-shadow: 3px 3px 0 var(--border); }
.card-current:hover .card-cta, .card-current:focus-visible .card-cta { background: var(--brand-dark); }
.card-next { box-shadow: 6px 6px 0 var(--next); }
.card-next:hover, .card-next:focus-visible { box-shadow: 9px 9px 0 var(--next); }
.card-next .card-cta { border-color: var(--next); color: var(--next); background: var(--next-soft); }
.card-next:hover .card-cta, .card-next:focus-visible .card-cta { background: var(--next); color: #fff; }
.card-current .card-cta-arrow { animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) {
  .card-current .card-cta-arrow { animation: none; }
  .card, .card-cta-arrow { transition: none; }
}
.card-wide { grid-column: span 2; }
.card-current { box-shadow: 6px 6px 0 var(--brand); }
.card-current:hover, .card-current:focus-visible { box-shadow: 9px 9px 0 var(--brand); }
.card-head { display: flex; justify-content: space-between; align-items: center; }
.card-step { font-family: var(--heading); font-weight: 800; color: #b9bdbd; font-size: 15px; }
.card-current .card-step { color: var(--brand); }
.card-next .card-step { color: var(--next); }
.card h3 { font-size: 24px; }
.card-dates { margin: 0; font-size: 14px; color: var(--ink); font-weight: 600; }
.card-goal { margin: 4px 0 0; font-family: var(--heading); font-weight: 700; font-size: 17px; line-height: 1.3; color: var(--ink); }
.card-goal::before {
  content: "Goal";
  display: block;
  margin-bottom: 3px;
  font-family: "Inter", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--brand);
}
.card-next .card-goal::before { color: var(--next); }
.card-done .card-goal::before { color: var(--done); }
.card-blurb { margin: 0 0 8px; font-size: 15px; color: var(--muted); line-height: 1.5; }

.pill { font-family: var(--heading); font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 4px; }
.pill-done { background: var(--done-soft); color: var(--done); }
.pill-current { background: var(--brand); color: #fff; }
.pill-next { background: var(--next); color: #fff; }
.pill-upcoming { background: var(--upcoming); color: var(--muted); }

.bar { height: 8px; background: var(--upcoming); border-radius: 999px; overflow: hidden; margin-top: auto; }
.bar-fill { height: 100%; background: var(--brand); border-radius: inherit; }
.card-done .bar-fill, .bar-fill-full { background: var(--done); }

/* Stage pop-up */
body.modal-open { overflow: hidden; }
.modal {
  width: min(1100px, calc(100vw - 48px));
  height: min(880px, calc(100vh - 48px));
  max-width: none;
  max-height: none;
  padding: 0;
  border: 2px solid var(--border);
  border-radius: 16px;
  background: var(--bg);
  color: var(--ink);
  box-shadow: 10px 10px 0 var(--brand);
}
.modal::backdrop { background: rgba(17, 17, 17, .55); backdrop-filter: blur(3px); }
.modal[open] { animation: modal-in .22s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .modal[open] { animation: none; } }
.modal-inner { height: 100%; overflow-y: auto; padding: 36px 44px 44px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.modal-meta { display: flex; align-items: center; gap: 10px; }
.modal-close {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--border);
  border-radius: 8px;
  box-shadow: 3px 3px 0 var(--border);
  cursor: pointer;
}
.modal-close:hover { background: var(--ink); color: #fff; }
.modal-close:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--border); }
.modal-close svg { width: 20px; height: 20px; }
.modal-title { font-size: 52px; line-height: 1.05; margin-top: 24px; }
.modal[data-status="current"] .modal-title { color: var(--brand); }
.modal[data-status="next"] .modal-title { color: var(--next); }
.modal-dates { font-weight: 600; font-size: 16px; margin: 10px 0 0; }
.modal-call {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  max-width: 560px;
  padding: 14px 14px 14px 16px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--brand);
}
.modal-call[hidden] { display: none; }
.modal-call-icon {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
}
.modal-call-icon svg { width: 24px; height: 24px; }
.modal-call-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.modal-call-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.modal-call-date { font-family: var(--heading); font-weight: 800; font-size: 18px; }
.modal-call-btn { width: auto; flex: none; padding: 11px 18px; font-size: 15px; text-decoration: none; }

.modal-goal { margin: 12px 0 0; font-family: var(--heading); font-weight: 800; font-size: 24px; line-height: 1.25; max-width: 720px; }
.modal-goal[hidden], .modal-blurb[hidden] { display: none; }
.modal-blurb { font-size: 19px; color: var(--muted); line-height: 1.5; margin: 14px 0 0; max-width: 640px; }
.modal-progress { display: flex; align-items: center; gap: 14px; margin-top: 22px; max-width: 520px; font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.modal-progress .bar { flex: 1; margin: 0; height: 10px; background: var(--surface); border: 1.5px solid var(--border); }
.modal[data-status="done"] .bar-fill { background: var(--done); }
.modal-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 36px; }
.modal-section-wide { grid-column: 1 / -1; }
.modal-section {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  min-height: 220px;
}
.modal-section h3 { font-size: 20px; }
.placeholder { color: var(--muted); font-size: 15px; margin: 10px 0 0; }

/* Action items */
.actions-note {
  display: inline-block;
  margin: 10px 0 0;
  padding: 5px 10px;
  border-radius: 4px;
  background: var(--next-soft);
  color: var(--next-dark);
  font-size: 13px;
  font-weight: 700;
}
.action-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.action-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}
.action-check {
  flex: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-family: var(--heading);
  font-weight: 800;
  font-size: 14px;
}
.action-done .action-check { background: var(--done); }
.action-tick {
  border: 2px solid var(--border);
  background: var(--surface);
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  transition: background .15s, transform .1s;
}
.action-tick:hover { background: var(--brand-soft); }
.action-tick:active { transform: scale(.92); }
.action-tick:focus-visible { outline: 3px solid var(--brand-soft); outline-offset: 1px; }
.action-done .action-tick { background: var(--done); border-color: var(--done); }
.action-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.action-text strong { font-family: var(--heading); font-size: 16px; }
.action-text span { font-size: 13px; color: var(--muted); }
.action-done .action-text span { color: var(--done); font-weight: 600; }
.action-btn { width: auto; flex: none; padding: 10px 16px; font-size: 14px; text-decoration: none; text-align: center; }

/* Resources */
.resource-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.resource {
  width: 100%;
  height: 100%;
  font: inherit;
  color: inherit;
  text-align: left;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 12px 12px;
  padding: 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}
.resource-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
}
.resource-icon svg { width: 22px; height: 22px; }
.resource-title { font-family: var(--heading); font-size: 16px; }
.resource > .pill, .resource-open { grid-column: 1 / -1; justify-self: start; }
button.resource { cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s; }
button.resource:hover, button.resource:focus-visible { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--border); background: var(--surface); outline: none; }
button.resource:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--border); }
.resource-open { font-family: var(--heading); font-weight: 700; font-size: 14px; color: var(--brand); }
button.resource:hover .resource-open { text-decoration: underline; }

.resource-link-form { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.resource-link-hint { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.resource-link-form input {
  min-width: 0;
  font: inherit;
  font-size: 14px;
  padding: 9px 11px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  outline: none;
}
.resource-link-form input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.resource-link-form .btn { width: auto; padding: 9px 14px; font-size: 14px; }
.resource-link-form .form-error { grid-column: 1 / -1; margin: 0; }
.resource-link-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; }
.resource-link-open { width: auto; padding: 8px 14px; font-size: 14px; text-decoration: none; }

/* Boxed resources (e.g. ad scripts) */
.resource-sections { flex: 1; overflow: auto; padding: 24px 32px 32px; background: var(--bg); }
.resource-sections[hidden] { display: none; }
.section-note { margin: 0; color: var(--muted); font-size: 15px; }
.section-group { font-size: 18px; margin: 24px 0 12px; }
.section-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.section-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
}
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.section-label { font-family: var(--heading); font-weight: 800; font-size: 15px; color: var(--brand); }
.section-copy {
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
}
.section-copy:hover:not(:disabled) { background: var(--ink); color: #fff; }
.section-copy:disabled { opacity: .35; cursor: default; }
.section-text { margin: 0; font-size: 15px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.section-empty { color: var(--muted); font-style: italic; }
.section-input {
  width: 100%;
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
  padding: 10px 12px;
  border: 1.5px solid var(--brand);
  border-radius: 8px;
  resize: vertical;
  outline: none;
  background: var(--surface);
}
.section-input:focus { box-shadow: 0 0 0 3px var(--brand-soft); }

/* Loom video pop-up */
.modal.video-modal { height: fit-content; max-height: calc(100vh - 48px); background: var(--surface); }
.video-frame {
  aspect-ratio: 16 / 9;
  background: #16181d;
  border-radius: 0 0 14px 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.video-frame iframe { width: 100%; height: 100%; border: 0; }
.video-link { padding: 16px 28px; border-bottom: 2px solid var(--border); background: var(--bg); }
.video-link[hidden] { display: none; }
.video-link label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.video-link label span { font-weight: 500; color: var(--muted); }
.video-link-row { display: flex; gap: 10px; }
.video-link-row input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 15px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  outline: none;
}
.video-link-row input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.video-link-row .btn { width: auto; padding: 10px 18px; font-size: 14px; }
.video-link .form-error { margin-top: 8px; }
.video-empty { color: #c9ccd3; font-family: var(--heading); font-weight: 700; font-size: 20px; margin: 0; }

/* Resource viewer */
.resource-modal { background: var(--surface); }
.resource-shell { height: 100%; display: flex; flex-direction: column; }
.resource-head { display: flex; align-items: center; gap: 14px; padding: 22px 28px; border-bottom: 2px solid var(--border); }
.resource-heading { flex: 1; min-width: 0; }
.resource-kind { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); }
.resource-heading h2 { font-size: 28px; line-height: 1.15; }
.resource-copy, .resource-edit { width: auto; padding: 10px 18px; font-size: 14px; }
.resource-edit { padding: 8px 16px; }
.is-editing .resource-edit { background: var(--done); color: #fff; }
.resource-editor { display: block; width: 100%; border: 0; resize: none; outline: none; }
.resource-editor[hidden], .resource-body[hidden] { display: none; }
.resource-body-doc.resource-editor { box-shadow: inset 0 0 0 3px var(--brand-soft); }
.resource-body-code.resource-editor { box-shadow: inset 0 0 0 3px rgba(22, 80, 230, .5); }
.resource-body {
  flex: 1;
  margin: 0;
  overflow: auto;
  padding: 28px 32px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.resource-body:focus-visible { outline: 3px solid var(--brand-soft); outline-offset: -3px; }
.resource-body-doc { font-family: "Inter", sans-serif; font-size: 17px; line-height: 1.7; color: var(--ink); background: var(--surface); }
.resource-body-code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.65;
  color: #e6e6e6;
  background: #16181d;
  white-space: pre;
  overflow-wrap: normal;
  border-radius: 0 0 14px 14px;
}

/* Onboarding form (Typeform-style) */
.form-modal {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--bg);
  color: var(--ink);
}
.form-modal::backdrop { background: var(--bg); }
.form-modal[open] { animation: form-in .25s ease-out; }
@keyframes form-in { from { opacity: 0; } to { opacity: 1; } }
.form-shell { height: 100%; display: flex; flex-direction: column; }
.form-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 28px; background: var(--surface); }
.form-logo { height: 30px; display: block; }
.form-progress { height: 6px; background: var(--line); }
.form-progress[hidden] { display: none; }
.form-progress-fill { height: 100%; width: 0; background: var(--brand); transition: width .35s ease; }
.form-stage { flex: 1; overflow-y: auto; display: grid; place-items: center; padding: 32px 24px; }

.fq { width: 100%; max-width: 720px; }
.fq-up { animation: fq-up .35s ease-out; }
.fq-down { animation: fq-down .35s ease-out; }
@keyframes fq-up { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
@keyframes fq-down { from { opacity: 0; transform: translateY(-40px); } to { opacity: 1; transform: none; } }
.fq-label { font-size: 32px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; }
.fq-num { color: var(--brand); font-size: 18px; margin-right: 12px; vertical-align: 4px; white-space: nowrap; }
.fq-input {
  width: 100%;
  margin-top: 28px;
  font: inherit;
  font-size: 26px;
  color: var(--brand);
  background: transparent;
  border: 0;
  border-bottom: 2px solid rgba(22, 80, 230, .3);
  padding: 8px 0;
  outline: none;
  resize: none;
}
.fq-input:focus { border-bottom-color: var(--brand); }
.fq-input::placeholder { color: rgba(22, 80, 230, .35); }
.fq-links { display: grid; gap: 18px; margin-top: 18px; }
.fq-link { display: grid; gap: 2px; }
.fq-link-label { font-size: 14px; font-weight: 600; color: var(--muted); }
.fq-links .fq-input { margin-top: 0; font-size: 22px; }
.fq-actions { display: flex; align-items: center; gap: 14px; margin-top: 24px; }
.fq-ok { width: auto; padding: 11px 22px; }
.fq-hint { font-size: 13px; color: var(--muted); margin: 0; }
.fq-options { display: grid; gap: 10px; margin-top: 28px; max-width: 460px; }
.fq-option {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  font: inherit;
  font-size: 18px;
  color: var(--brand-dark);
  background: rgba(22, 80, 230, .06);
  border: 1.5px solid rgba(22, 80, 230, .4);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background .12s;
}
.fq-option:hover { background: rgba(22, 80, 230, .14); }
.fq-option:focus-visible { outline: 3px solid var(--brand-soft); border-color: var(--brand); }
.fq-option[aria-checked="true"] { background: var(--brand); color: #fff; border-color: var(--brand); }
.fq-key {
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  border: 1.5px solid currentColor;
  border-radius: 4px;
  background: var(--surface);
  color: var(--brand);
}
.fq-option[aria-checked="true"] .fq-key { background: #fff; color: var(--brand); border-color: #fff; }
.fq-options + .fq-hint { margin-top: 14px; }
.fq-scale { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 8px; margin-top: 28px; max-width: 640px; }
.fq-scale-btn {
  aspect-ratio: 1;
  font: inherit;
  font-family: var(--heading);
  font-weight: 800;
  font-size: 20px;
  color: var(--brand-dark);
  background: rgba(22, 80, 230, .06);
  border: 1.5px solid rgba(22, 80, 230, .4);
  border-radius: 8px;
  cursor: pointer;
  transition: background .12s, transform .1s;
}
.fq-scale-btn:hover { background: rgba(22, 80, 230, .14); }
.fq-scale-btn:active { transform: scale(.94); }
.fq-scale-btn:focus-visible { outline: 3px solid var(--brand-soft); border-color: var(--brand); }
.fq-scale-btn[aria-checked="true"] { background: var(--brand); color: #fff; border-color: var(--brand); }
.fq-scale-ends { display: flex; justify-content: space-between; max-width: 640px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.fq-scale + .fq-scale-ends + .fq-hint { margin-top: 12px; }
.fq-error { color: var(--error); font-weight: 600; font-size: 14px; margin: 14px 0 0; min-height: 1em; }
.fq-error:empty { display: none; }

.form-nav { display: flex; justify-content: flex-end; align-items: center; gap: 14px; padding: 18px 28px; }
.form-nav[hidden] { display: none; }
.form-count { font-size: 14px; font-weight: 600; color: var(--muted); }
.form-arrows { display: flex; gap: 2px; }
.form-arrow {
  width: 40px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  border: 0;
  cursor: pointer;
}
.form-arrow:first-child { border-radius: 6px 0 0 6px; }
.form-arrow:last-child { border-radius: 0 6px 6px 0; }
.form-arrow:disabled { opacity: .4; cursor: default; }
.form-arrow svg { width: 18px; height: 18px; }

.fa { width: 100%; max-width: 760px; align-self: start; }
.fa-title { font-size: 40px; margin-top: 16px; }
.fa-sub { color: var(--muted); margin: 6px 0 0; }
.fa-list { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 12px; }
.fa-item {
  display: flex;
  gap: 16px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
}
.fa-num { font-family: var(--heading); font-weight: 800; color: var(--brand); font-size: 15px; padding-top: 1px; }
.fa-body { min-width: 0; }
.fa-q { margin: 0; font-size: 14px; color: var(--muted); font-weight: 500; }
.fa-a { margin: 4px 0 0; font-size: 17px; font-weight: 600; white-space: pre-wrap; overflow-wrap: anywhere; }
.fa-link-label { color: var(--muted); font-weight: 500; }
.fa-link a { color: var(--brand); }
.fa-actions { display: flex; justify-content: flex-end; gap: 12px; margin: 24px 0 8px; }
.fa-done { width: auto; padding: 11px 26px; }

@media (prefers-reduced-motion: reduce) {
  .fq-up, .fq-down, .form-modal[open] { animation: none; }
}

/* Staff view of a client's page */
.staff-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  padding: 10px 40px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
}
.staff-banner span { opacity: .75; }
.topbar-user .btn-ghost[hidden] { display: none; }
.topbar-user a.btn { text-decoration: none; }

/* Staff board */
.admin-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-tabs .tag { text-decoration: none; border: 2px solid var(--brand); }
.admin-tabs .tag-ghost { background: var(--surface); color: var(--brand); }
.admin-tabs .tag-ghost:hover { background: var(--brand-soft); }
.admin .hub-head .muted { max-width: 720px; }
.templates-panel .resource-list { margin-top: 0; }
.resource.resource-shared { background: var(--next-soft); border-color: var(--next); }
.resource-shared .resource-icon { background: var(--surface); color: var(--next); }
.resource-shared .resource-open { color: var(--next-dark); }
button.resource.resource-shared:hover, button.resource.resource-shared:focus-visible { background: var(--next-soft); box-shadow: 4px 4px 0 var(--next); }
.resource-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.resource-open-btn { font: inherit; font-family: var(--heading); font-weight: 700; font-size: 14px; background: none; border: 0; padding: 0; cursor: pointer; }
.resource-open-btn:hover { text-decoration: underline; }
.resource-prompt-btn {
  font: inherit;
  font-family: var(--heading);
  font-weight: 700;
  font-size: 13px;
  padding: 6px 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  box-shadow: 2px 2px 0 var(--border);
  cursor: pointer;
}
.resource-prompt-btn:hover { background: var(--ink); color: #fff; }
.resource-prompt-btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--border); }
.resource-shared-label { grid-column: 1 / -1; font-size: 12px; font-weight: 700; color: var(--next-dark); }
.resource-note { margin: 0; padding: 10px 32px; font-size: 14px; font-weight: 600; background: var(--upcoming); color: var(--muted); border-bottom: 1.5px solid var(--line); }
.resource-note[hidden] { display: none; }
.resource-note-shared { background: var(--next-soft); color: var(--next-dark); }
.resource-edit[hidden] { display: none; }
.staff-chip { font-family: var(--heading); font-weight: 800; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); background: var(--upcoming); padding: 5px 9px; border-radius: 4px; }
.verify-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-family: var(--heading);
  font-weight: 800;
  font-size: 14px;
  color: var(--error);
  background: #fdecec;
  border: 2px solid #d42a2a;
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  animation: verify-in .3s ease-out;
}
.verify-btn[hidden] { display: none; }
.verify-btn:hover { background: #fbdcdc; }
.verify-dot { width: 10px; height: 10px; border-radius: 50%; background: #e02424; animation: pulse 1.6s ease-in-out infinite; }
.verify-count { min-width: 22px; height: 22px; display: grid; place-items: center; border-radius: 999px; background: #e02424; color: #fff; font-size: 12px; padding: 0 6px; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(224, 36, 36, .5); } 50% { box-shadow: 0 0 0 6px rgba(224, 36, 36, 0); } }
@keyframes verify-in { from { transform: scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }

.admin-empty { color: var(--muted); font-size: 16px; }
.cohort + .cohort { margin-top: 36px; }
.cohort-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.cohort-head h2 { font-size: 26px; }
.cohort-when { font-family: var(--heading); font-weight: 700; font-size: 12px; padding: 4px 9px; border-radius: 4px; }
.cohort-current { background: var(--brand); color: #fff; }
.cohort-upcoming { background: var(--next-soft); color: var(--next-dark); }
.cohort-past { background: var(--upcoming); color: var(--muted); }
.cohort-count { color: var(--muted); font-size: 14px; font-weight: 600; }
.client-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.client-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s;
}
.client-card:hover, .client-card:focus-visible { transform: translate(-3px, -3px); box-shadow: 5px 5px 0 var(--brand); outline: none; }
.client-avatar {
  flex: none;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-family: var(--heading);
  font-weight: 800;
}
.client-body { display: grid; gap: 2px; flex: 1; min-width: 0; }
.client-name { font-family: var(--heading); font-size: 18px; }
.client-niche { font-weight: 600; font-size: 14px; color: var(--ink); }
.client-niche-empty { color: var(--muted); font-weight: 500; font-style: italic; }
.client-email { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-arrow { font-size: 20px; color: var(--brand); transition: transform .2s; }
.client-card:hover .client-arrow { transform: translateX(4px); }

.modal.verify-modal { width: min(620px, calc(100vw - 32px)); height: fit-content; max-height: calc(100vh - 48px); background: var(--surface); }
.verify-list { list-style: none; margin: 0; padding: 16px 28px 24px; display: grid; gap: 12px; overflow: auto; }
.verify-item { display: flex; align-items: center; gap: 16px; padding: 16px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--bg); }
.verify-info { display: grid; gap: 2px; flex: 1; min-width: 0; }
.verify-info strong { font-family: var(--heading); font-size: 18px; }
.verify-email { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.verify-time { font-size: 13px; font-weight: 600; }
.verify-actions { display: flex; gap: 8px; }
.verify-yes, .verify-no { width: auto; padding: 9px 18px; font-size: 15px; border: 2px solid var(--border); box-shadow: 3px 3px 0 var(--border); }
.verify-yes { background: var(--done); color: #fff; }
.verify-no { background: var(--surface); color: var(--error); }
.verify-yes:active, .verify-no:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--border); }
.verify-yes:disabled, .verify-no:disabled { opacity: .5; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 50;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  border-radius: 10px;
  box-shadow: 4px 4px 0 var(--brand);
}
.toast[hidden] { display: none; }

.videos-panel { margin-top: 40px; }
.video-settings { display: grid; gap: 12px; }
.video-setting {
  display: grid;
  grid-template-columns: 220px 1fr auto;
  grid-template-areas: "label input save" ". status status";
  align-items: center;
  gap: 6px 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
}
.video-setting-label { grid-area: label; display: grid; }
.video-setting-label strong { font-family: var(--heading); font-size: 16px; }
.video-setting-label span { font-size: 13px; color: var(--muted); }
.video-setting input {
  grid-area: input;
  min-width: 0;
  font: inherit;
  font-size: 15px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  outline: none;
}
.video-setting input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.video-setting .btn { grid-area: save; width: auto; padding: 10px 18px; font-size: 14px; }
.video-status { grid-area: status; font-size: 13px; color: var(--muted); }
.video-status-set { color: var(--done); font-weight: 700; }
.video-status-error { color: var(--error); font-weight: 600; }

/* Responsive */
@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .client-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .segment { min-width: 80px; }
  .segment-dates { display: none; }
  .hub-head h1 { font-size: 36px; }
}
@media (max-width: 640px) {
  .topbar { padding: 12px 16px; }
  .topbar-logo { height: 28px; }
  #user-name { display: none; }
  .hub { padding: 24px 16px 48px; gap: 24px; }
  .hub-head h1 { font-size: 30px; }
  .panel { padding: 20px 14px; }
  .panel-head h2 { font-size: 20px; }
  .cards { grid-template-columns: 1fr; gap: 18px; }
  .client-grid { grid-template-columns: 1fr; }
  .video-setting { grid-template-columns: 1fr auto; grid-template-areas: "label label" "input save" "status status"; }
  .staff-banner { padding: 10px 16px; }
  .verify-item { flex-wrap: wrap; }
  .verify-list { padding: 14px 16px 20px; }
  .staff-chip { display: none; }
  .card-wide { grid-column: auto; }
  .modal { width: calc(100vw - 20px); height: calc(100vh - 20px); box-shadow: 5px 5px 0 var(--brand); }
  .modal-inner { padding: 22px 18px 32px; }
  .modal-title { font-size: 34px; }
  .modal-body { grid-template-columns: 1fr; }
  .modal-section { min-height: 0; }
  .resource-list { grid-template-columns: 1fr; }
  .resource-head { flex-wrap: wrap; padding: 16px; }
  .resource-heading h2 { font-size: 22px; }
  .resource-body { padding: 18px 16px; }
  .resource-sections { padding: 18px 16px 24px; }
  .modal-call { flex-wrap: wrap; }
  .action-item { flex-wrap: wrap; }
  .action-btn { width: 100%; }
  .form-top, .form-nav { padding: 14px 16px; }
  .fq-label { font-size: 24px; }
  .fq-input { font-size: 20px; }
  .fq-scale { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .fa-title { font-size: 30px; }
  .modal-call-btn { width: 100%; text-align: center; }
  .auth-card { padding: 28px 22px; box-shadow: 6px 6px 0 var(--brand); }
  .timeline-track { gap: 3px; }
  .segment { min-width: 40px; padding: 10px 2px; }
  .segment-name { display: none; }
  .segment-short { display: block; font-size: 11px; }
}
