/* Loop Launchpad. Brand: Midnight #062B31, Old Gold #C8A063, Pearl #FAFAF7, League Spartan. */
:root {
  --midnight: #062B31;
  --midnight-2: #0E3A41;
  --gold: #C8A063;
  --pearl: #FAFAF7;
  --white: #FFFFFF;
  --line: #E4E4DC;
  --line-strong: #C9D3D2;
  --muted: #4F666A;
  --track: #E6E7E1;
  --error: #9B1C1C;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--pearl); color: var(--midnight); font-family: 'League Spartan', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 17px; line-height: 1.35; }
h1 { margin: 0; font-size: 2rem; font-weight: 700; letter-spacing: -0.8px; line-height: 1.1; }
h2 { margin: 0; font-size: 1.05rem; font-weight: 700; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.boot { padding: 3rem 1.5rem; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.pad { padding: 1rem 1.1rem; }
.check { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* Buttons and inputs */
.btn { min-height: 44px; padding: 0 1rem; border-radius: 10px; border: 1px solid var(--midnight); background: var(--pearl); color: var(--midnight); font-weight: 600; cursor: pointer; }
.btn { white-space: nowrap; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--midnight); color: var(--pearl); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--pearl); }
.btn-block { width: 100%; }
.btn-small { min-height: 44px; padding: 0 0.8rem; font-size: 0.95rem; white-space: nowrap; }
.link { min-height: 44px; padding: 0 0.25rem; border: 0; background: none; color: var(--midnight); font-weight: 600; text-decoration: underline; cursor: pointer; }
.small-input, .field input { min-height: 44px; padding: 0 0.7rem; border: 1px solid var(--midnight); border-radius: 8px; background: var(--white); min-width: 0; }
.field { display: flex; flex-direction: column; gap: 0.35rem; font-weight: 600; margin-bottom: 0.9rem; }
.field input { width: 100%; font-weight: 400; }
.form-msg { min-height: 1.4em; font-size: 0.95rem; color: var(--muted); margin: 0.5rem 0; }
.form-msg:empty { display: none; }
.form-msg.is-error { color: var(--error); font-weight: 600; }

/* Sign-in */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; background: var(--midnight); }
.auth-inner { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 1.75rem; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; text-align: center; color: var(--pearl); }
.auth-logo { width: 190px; height: 90px; }
.eyebrow { font-size: 0.8rem; font-weight: 700; letter-spacing: 3px; color: var(--gold); }
.auth-welcome { font-size: 1.15rem; line-height: 1.3; max-width: 20rem; }
.auth-card { background: var(--pearl); border-radius: 16px; padding: 1.5rem; display: flex; flex-direction: column; gap: 0.75rem; }
.auth-card h1 { font-size: 1.6rem; }
.auth-links { display: flex; flex-direction: column; align-items: flex-start; }

/* Shell */
.topbar { background: var(--midnight); color: var(--pearl); display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.6rem 1.25rem; }
.brand { display: flex; align-items: center; gap: 0.9rem; color: var(--pearl); text-decoration: none; font-size: 1.2rem; font-weight: 700; letter-spacing: -0.4px; }
.brand img { width: 76px; height: 36px; }
.brand span { white-space: nowrap; }
.topbar-user { display: flex; align-items: center; gap: 0.9rem; }
.user-name { font-size: 0.95rem; color: var(--line-strong); }
.mainnav { background: var(--midnight); display: flex; gap: 0.25rem 1.5rem; padding: 0 1.25rem; border-top: 1px solid var(--midnight-2); }
.nav-item { min-height: 48px; display: flex; align-items: center; color: var(--line-strong); text-decoration: none; font-weight: 500; }
.nav-item.is-current { color: var(--pearl); font-weight: 700; box-shadow: inset 0 -3px 0 var(--gold); }
.content { max-width: 1280px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.view > div { display: flex; flex-direction: column; gap: 1rem; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.75rem 1rem; }
.week-nav { display: flex; align-items: center; gap: 0.5rem; }
.week-nav-label { min-width: 9.5rem; text-align: center; font-weight: 700; }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid var(--midnight); background: var(--pearl); color: var(--midnight); cursor: pointer; }
.icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.section-title { margin-top: 0.5rem; font-size: 1rem; letter-spacing: 0.3px; }
.section-title .muted { font-weight: 400; font-size: 0.9rem; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.card.error { padding: 1.1rem; display: flex; flex-direction: column; gap: 0.6rem; align-items: flex-start; border-color: var(--error); }
.stack { display: flex; flex-direction: column; gap: 0.5rem; }

/* My week: progress ring */
.hero { display: flex; align-items: center; gap: 1.25rem; background: var(--midnight); color: var(--pearl); border-radius: 16px; padding: 1.1rem 1.4rem; }
.ring { position: relative; width: 96px; height: 96px; flex-shrink: 0; }
.ring svg { display: block; }
.ring-track { fill: none; stroke: var(--midnight-2); stroke-width: 8; }
.ring-fill { fill: none; stroke: var(--gold); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 0.4s ease; }
.ring-number { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1.35rem; font-weight: 700; }
.hero-title { font-size: 1.6rem; letter-spacing: -0.5px; line-height: 1.1; }
.hero-sub { color: var(--line-strong); margin-top: 0.25rem; }
.hero.is-complete { box-shadow: inset 0 0 0 3px var(--gold); }
.hero.is-complete .hero-title { color: var(--gold); }
.view .form-msg { margin: 0; text-align: right; }
.goal-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }
@media (min-width: 900px) { .goal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; } }
@keyframes goal-hit { 0% { box-shadow: 0 0 0 0 rgba(200, 160, 99, 0.9); } 100% { box-shadow: 0 0 0 14px rgba(200, 160, 99, 0); } }
.goal.just-hit { animation: goal-hit 0.9s ease-out; border-color: var(--gold); }
@media (prefers-reduced-motion: reduce) { .goal.just-hit { animation: none; } .ring-fill, .progress-fill { transition: none; } }

/* Tabs, segments, pills */
.tabs { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; border-bottom: 1px solid var(--line-strong); }
.tab { min-height: 44px; display: flex; align-items: center; color: var(--muted); text-decoration: none; font-weight: 600; }
.tab.is-current { color: var(--midnight); box-shadow: inset 0 -3px 0 var(--gold); }
.segments { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; background: var(--midnight); border-radius: var(--radius); padding: 4px; max-width: 480px; }
.segment { min-height: 44px; border: 0; border-radius: 9px; background: transparent; color: var(--pearl); font-weight: 600; cursor: pointer; }
.segment.is-on { background: var(--pearl); color: var(--midnight); }
.pills { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.pill { flex-shrink: 0; min-height: 44px; padding: 0 0.9rem; border-radius: 22px; border: 1px solid var(--midnight); background: var(--pearl); font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.pill.is-on { background: var(--midnight); color: var(--pearl); }

/* My week */
.goal { padding: 0.75rem 0.75rem 0.75rem 0.9rem; display: flex; flex-direction: column; gap: 0.5rem; }
.goal-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.goal-text { min-width: 0; }
.goal-name { font-weight: 600; line-height: 1.2; }
.goal-status { font-size: 0.85rem; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.goal-status.is-hit { color: var(--midnight); font-weight: 700; }
.stepper { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.step { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--midnight); background: var(--pearl); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.step-plus { background: var(--midnight); color: var(--pearl); }
.count { display: flex; align-items: baseline; gap: 2px; }
.count-input { width: 3.2rem; min-height: 44px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--white); text-align: center; font-size: 1.4rem; font-weight: 700; padding: 0; -moz-appearance: textfield; appearance: textfield; }
.count-input::-webkit-outer-spin-button, .count-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.count-target { font-size: 0.85rem; color: var(--muted); min-width: 2rem; }
.progress { height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; }
.progress-fill { height: 8px; border-radius: 4px; background: var(--midnight); width: 0; transition: width 0.15s; }
.progress-fill.is-hit { background: var(--gold); }

/* Tiles */
.tiles { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tile { flex: 1 1 100px; background: var(--midnight); color: var(--pearl); border-radius: var(--radius); padding: 0.75rem 0.9rem; display: flex; flex-direction: column; gap: 0.2rem; }
.tile-value { font-size: 1.5rem; font-weight: 700; line-height: 1; color: var(--gold); }
.tile-label { font-size: 0.85rem; line-height: 1.2; }

/* Leaderboard */
.board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.board-row { display: flex; align-items: center; gap: 0.75rem; min-height: 56px; padding: 0.5rem 0.9rem 0.5rem 0.6rem; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.board-row.is-you { border: 2px solid var(--midnight); }
.rank { width: 34px; height: 34px; flex-shrink: 0; border-radius: 17px; display: flex; align-items: center; justify-content: center; font-weight: 700; background: #EEEFE9; }
.rank.is-top { background: var(--gold); }
.board-name { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; font-weight: 600; }
.board-name .small { font-weight: 400; }
.you-tag { margin-left: 8px; font-size: 0.65rem; font-weight: 700; letter-spacing: 1px; background: var(--midnight); color: var(--pearl); border-radius: 4px; padding: 3px 6px 2px; vertical-align: middle; }
.board-value { font-size: 1.4rem; font-weight: 700; }

/* Charts */
.chart { padding: 0.9rem 0.9rem 0.7rem; display: flex; flex-direction: column; gap: 0.5rem; }
.chart-readout { font-size: 0.9rem; color: var(--muted); }
.chart-plot { position: relative; height: 150px; border-bottom: 1px solid var(--line-strong); }
.chart-plot.is-tall { height: 220px; }
.chart-bars { display: grid; gap: 2px; height: 100%; }
.bar { height: 100%; padding: 0 8%; border: 0; background: transparent; cursor: pointer; display: flex; flex-direction: column; justify-content: flex-end; }
.bar-fill { display: block; width: 100%; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--midnight); }
.bar.is-selected .bar-fill { background: var(--gold); }
.chart-target { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--muted); pointer-events: none; }
.chart-target span { position: absolute; right: 0; bottom: 3px; font-size: 0.7rem; font-weight: 600; color: var(--muted); background: var(--white); padding: 0 3px; }
.chart-axis { display: grid; gap: 2px; }
.chart-axis span { font-size: 0.68rem; line-height: 1.15; text-align: center; color: var(--muted); white-space: pre-line; overflow: hidden; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; min-height: 42px; padding: 0 0.9rem; border-bottom: 1px solid #EEEFE9; }
.rows li:last-child { border-bottom: 0; }
.row-value { display: flex; align-items: center; gap: 6px; font-weight: 700; }

/* Admin tables */
.table-scroll { overflow-x: auto; }
.grid-table { min-width: 640px; }
.grid-table.wide { min-width: 940px; }
.grid-head span { hyphens: auto; overflow-wrap: break-word; min-width: 0; }
.grid-row { display: grid; align-items: center; gap: 0.5rem; padding: 0.45rem 1.1rem; border-bottom: 1px solid var(--line); }
.grid-row:last-child { border-bottom: 0; }
.grid-row.is-off { background: #F3F3EE; }
.grid-head { padding: 0.75rem 1.1rem; border-bottom: 1px solid var(--midnight); font-size: 0.78rem; font-weight: 700; letter-spacing: 0; align-items: end; line-height: 1.2; }
.cell { display: flex; align-items: center; gap: 0.3rem; color: var(--muted); }
.cell.is-hit { color: var(--midnight); font-weight: 700; }
.cell-name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.cell-strong { font-weight: 700; }
.cell-email { font-size: 0.9rem; overflow-wrap: anywhere; }
.grid-row .small-input { width: 100%; max-width: 100%; }
.agent-block { border-bottom: 1px solid var(--line); }
.agent-block:last-child { border-bottom: 0; }
.agent-block .grid-row { border-bottom: 0; padding-bottom: 0.25rem; }
.closings-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem; padding: 0 1.1rem 0.7rem; }
.closings-label { font-size: 0.78rem; font-weight: 700; }
.closing { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.closing-form { display: flex; align-items: center; gap: 0.4rem; margin-left: auto; }
.closing-form .date-input { width: 10.5rem; }
.closing-form .price-input { width: 8.5rem; }
.invite-form { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.6rem; }
.invite-form .small-input { flex: 1 1 170px; }
.rows-plain > div { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.5rem 1.1rem; border-bottom: 1px solid var(--line); }
.rows-plain > div:last-child { border-bottom: 0; }
.target-row .cell-name { flex: 1 1 200px; }
.target-row .small-input { width: 6rem; }

/* Phones: navigation moves to the bottom of the screen */
@media (max-width: 720px) {
  body { font-size: 16px; }
  h1 { font-size: 1.75rem; }
  .user-name { display: none; }
  .topbar { padding: 0.5rem 0.9rem; }
  .brand { font-size: 1.05rem; gap: 0.6rem; }
  .brand img { width: 64px; height: 30px; }
  .topbar .btn { min-height: 40px; padding: 0 0.8rem; font-size: 0.9rem; }
  .content { padding: 1rem 0.9rem 5.5rem; }
  .mainnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(max-content, 1fr); overflow-x: auto; gap: 0; padding: 0 0 env(safe-area-inset-bottom); background: var(--white); border-top: 1px solid var(--line); }
  .nav-item { min-height: 58px; justify-content: center; color: var(--muted); font-size: 0.74rem; letter-spacing: -0.2px; padding: 0 5px; white-space: nowrap; }
  .nav-item.is-current { color: var(--midnight); box-shadow: inset 0 3px 0 var(--gold); }
  .week-nav { width: 100%; justify-content: space-between; }
  .hero { padding: 0.9rem 1rem; gap: 0.9rem; }
  .hero-title { font-size: 1.3rem; }
  .segments { max-width: none; }
}

/* ---------- Round 2: photos, podium, streaks, empty screens ---------- */
.avatar { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; border-radius: 50%; object-fit: cover; background: var(--midnight-2); color: var(--pearl); font-weight: 700; line-height: 1; width: 40px; height: 40px; font-size: 0.95rem; }
.avatar-sm { width: 34px; height: 34px; font-size: 0.8rem; }
.avatar-md { width: 54px; height: 54px; font-size: 1.1rem; border: 2px solid var(--line-strong); }
.avatar-lg { width: 68px; height: 68px; font-size: 1.4rem; background: var(--gold); color: var(--midnight); border: 2px solid var(--gold); }
.avatar-xl { width: 112px; height: 112px; font-size: 2.2rem; }
.profile-link { display: flex; align-items: center; gap: 0.5rem; min-height: 44px; color: var(--pearl); text-decoration: none; }
.profile-link .avatar { border: 1px solid var(--line-strong); }
.avatar-slot { display: inline-flex; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--midnight); font-weight: 700; }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

.hero-rank { color: var(--gold); font-weight: 600; margin-top: 0.25rem; }
.streak-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; margin-top: 0.5rem; max-width: 640px; }
.streak { padding: 0.75rem 0.9rem; display: flex; flex-direction: column; gap: 0.25rem; }
.streak.is-gold { border: 2px solid var(--gold); }
.streak-head { display: flex; align-items: baseline; gap: 0.4rem; }
.streak-number { font-size: 1.9rem; font-weight: 700; line-height: 1; }
.streak-unit { font-size: 0.9rem; font-weight: 600; }
.streaks > .muted { margin-top: 0.35rem; }
.goal-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 0.78rem; }
.dots-wrap { display: flex; align-items: center; gap: 0.4rem; }
.dots { display: inline-flex; gap: 4px; }
.dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #9AA9AB; background: var(--white); }
.dot.is-hit { background: var(--midnight); border-color: var(--midnight); }
.goal-best { font-weight: 600; }

.podium { background: var(--midnight); border-radius: 16px; padding: 1.1rem 0.75rem 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; align-items: end; max-width: 560px; }
.podium-step { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; color: var(--pearl); min-width: 0; }
.podium-name { font-size: 0.9rem; font-weight: 600; text-align: center; line-height: 1.15; overflow-wrap: anywhere; }
.podium-name .you-tag { background: var(--pearl); color: var(--midnight); margin-left: 6px; }
.podium-block { width: 100%; border-radius: 10px 10px 0 0; background: var(--midnight-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 74px; }
.podium-value { font-size: 1.45rem; font-weight: 700; line-height: 1; }
.podium-place { font-size: 0.75rem; color: var(--line-strong); }
.is-first .podium-name { font-size: 1rem; font-weight: 700; }
.is-first .podium-block { height: 104px; background: var(--gold); color: var(--midnight); }
.is-first .podium-value { font-size: 1.85rem; }
.is-first .podium-place { color: var(--midnight); font-weight: 700; }
.is-third .podium-block { height: 56px; }
.board { max-width: 560px; }
.board-row .rank { background: transparent; width: 28px; }
.move { display: inline-flex; align-items: center; gap: 4px; }
.move.is-up { color: var(--midnight); font-weight: 600; }

.empty { padding: 1.6rem 1.25rem; display: flex; flex-direction: column; align-items: center; gap: 0.7rem; text-align: center; max-width: 560px; }
.empty h2 { font-size: 1.4rem; letter-spacing: -0.3px; }
.empty p { color: var(--muted); max-width: 22rem; }
.empty.is-dark { background: var(--midnight); border-color: var(--midnight); color: var(--pearl); }
.empty.is-dark p { color: var(--line-strong); }

.profile-card { padding: 1.25rem; display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem; max-width: 640px; }
.profile-text { flex: 1 1 260px; display: flex; flex-direction: column; gap: 0.5rem; }
.profile-text h2 { font-size: 1.3rem; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.file-input:focus-visible + .btn, .file-label:focus-within { outline: 3px solid var(--gold); outline-offset: 2px; }
.file-label { display: inline-flex; align-items: center; cursor: pointer; }

/* ---------- Team: announcements, notifications, calendar ---------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nav-item { position: relative; }
.nav-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); margin-left: 6px; flex-shrink: 0; }
.notify { padding: 1rem 1.1rem; display: flex; flex-direction: column; align-items: flex-start; gap: 0.6rem; max-width: 640px; background: var(--midnight); border-color: var(--midnight); color: var(--pearl); }
.notify.is-on { background: var(--white); border-color: var(--line); color: var(--midnight); }
.notify .form-msg { color: var(--line-strong); text-align: left; }
.notify .form-msg.is-error { color: #FFD5D5; }
.notify.is-on .form-msg.is-error { color: var(--error); }
.steps { margin: 0; padding-left: 1.25rem; display: flex; flex-direction: column; gap: 0.3rem; }
.notes { max-width: 640px; }
.note { padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.4rem; }
.note h2 { font-size: 1.2rem; }
.note-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.month { display: flex; flex-direction: column; gap: 0.5rem; max-width: 640px; }
.event { padding: 0.9rem 1rem; display: flex; gap: 0.9rem; align-items: flex-start; }
.event-date { width: 58px; flex-shrink: 0; border-radius: 10px; background: var(--midnight); color: var(--pearl); display: flex; flex-direction: column; align-items: center; padding: 0.4rem 0 0.35rem; }
.event-weekday { font-size: 0.7rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--gold); }
.event-day { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.event-text { display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; min-width: 0; }
.event-text h3 { margin: 0; font-size: 1.15rem; line-height: 1.2; }
.event-when { font-weight: 600; }
.stack-form { display: flex; flex-direction: column; align-items: stretch; gap: 0.5rem; max-width: 640px; margin-bottom: 0.6rem; }
.stack-form .btn { align-self: flex-start; }
.text-area { padding: 0.6rem 0.7rem; min-height: 5rem; resize: vertical; font: inherit; }
.field-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem; }
.mini-field { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.8rem; font-weight: 600; flex: 1 1 150px; }
.row-actions { display: inline-flex; gap: 0.75rem; }

/* ---------- Commission calculator ---------- */
.calc { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 1rem; align-items: start; }
.calc-inputs .segments { max-width: none; }
.calc-inputs .segment { font-size: 0.95rem; padding: 0 0.3rem; }
.calc-hint { font-weight: 400; }
.calc-fixed { min-height: 44px; display: flex; align-items: center; padding: 0 0.7rem; border: 1px dashed var(--line-strong); border-radius: 8px; background: var(--pearl); font-weight: 700; }
.calc-toggle { display: flex; align-items: flex-start; gap: 0.75rem; min-height: 44px; cursor: pointer; }
.calc-toggle > span { display: flex; flex-direction: column; gap: 0.1rem; }
.calc-toggle-title { font-weight: 600; }
.calc-switch { appearance: none; -webkit-appearance: none; position: relative; width: 56px; height: 32px; margin: 2px 0 0; border-radius: 16px; border: 1px solid var(--midnight); background: var(--track); cursor: pointer; flex-shrink: 0; transition: background 0.15s; }
.calc-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--midnight); transition: transform 0.15s, background 0.15s; }
.calc-switch:checked { background: var(--midnight); }
.calc-switch:checked::after { transform: translateX(24px); background: var(--gold); }
.calc-toggle-state { font-size: 0.9rem; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .calc-switch, .calc-switch::after { transition: none; } }
.calc-result { display: flex; flex-direction: column; gap: 1rem; }
.calc-net { font-size: 2.6rem; font-weight: 700; letter-spacing: -1px; line-height: 1.1; font-variant-numeric: tabular-nums; margin-top: 0.2rem; }
.calc-section { margin: 0; padding: 0.75rem 1.1rem 0.4rem; font-size: 0.78rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.calc-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; gap: 0.25rem 1rem; padding: 0.55rem 1.1rem; border-top: 1px solid var(--line); }
.calc-amt { min-width: 6.5rem; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.calc-row.is-total { border-top: 1px solid var(--midnight); font-weight: 700; font-size: 1.1rem; }
.calc-row.is-total .calc-amt { font-weight: 700; }
@media (max-width: 760px) {
  .calc { grid-template-columns: minmax(0, 1fr); }
  .calc-net { font-size: 2.1rem; }
  .calc-row { grid-template-columns: minmax(0, 1fr) auto; }
  .calc-row > .muted { grid-column: 1; grid-row: 2; }
  .calc-amt { grid-column: 2; grid-row: 1; min-width: 0; }
}

/* ---------- Resources ---------- */
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.75rem; }
.res-card { display: flex; align-items: flex-start; gap: 0.9rem; padding: 1rem; color: var(--midnight); text-decoration: none; min-height: 84px; }
.res-card:hover { border-color: var(--midnight); }
.res-badge { width: 48px; height: 48px; flex-shrink: 0; border-radius: 10px; background: var(--midnight); color: var(--gold); display: flex; align-items: center; justify-content: center; }
.res-icon { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.res-text { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.res-title { font-size: 1.1rem; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.link:disabled { opacity: 0.35; cursor: not-allowed; text-decoration: none; }

/* ---------- Opening animation (plays once after sign-in) ---------- */
.intro { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer;
  background: radial-gradient(circle at 50% 50%, #0E3F47 0, #0A3339 22%, var(--midnight) 55%, #041F24 100%); transition: opacity 0.45s ease; }
.intro.is-leaving { opacity: 0; pointer-events: none; }
.intro-logo { width: min(64vw, 520px); height: auto; overflow: visible; }
.intro-camera { transform-box: view-box; transform-origin: 50% 50%; animation: intro-camera 1.9s cubic-bezier(0.6, 0, 0.2, 1) both; }
.intro-track { fill: none; stroke: #fff; stroke-width: 96; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: intro-draw 0.75s both; }
.intro-track-0 { animation-duration: 0.8s; animation-delay: 0.15s; animation-timing-function: cubic-bezier(0.5, 0, 0.6, 1); }
.intro-track-1 { animation-duration: 0.6s; animation-delay: 0.8s; animation-timing-function: linear; }
.intro-track-2 { animation-duration: 0.85s; animation-delay: 1.25s; animation-timing-function: cubic-bezier(0.3, 0, 0.3, 1); }
.intro-letter { opacity: 0; animation: intro-letter 0.4s ease-out both; }
.intro-shine { animation: intro-shine 0.8s 2.3s ease-in-out both; }
@keyframes intro-camera { from { transform: translate(92%, 14%) scale(3.1); } to { transform: none; } }
@keyframes intro-draw { to { stroke-dashoffset: 0; } }
@keyframes intro-letter { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes intro-shine { from { transform: skewX(-20deg) translateX(0); } to { transform: skewX(-20deg) translateX(2000px); } }
.intro.is-calm .intro-camera, .intro.is-calm .intro-shine { animation: none; }
.intro.is-calm .intro-track { animation: none; stroke-dashoffset: 0; }
.intro.is-calm .intro-letter { animation: none; opacity: 1; }
.intro.is-calm { animation: intro-fade 0.4s ease both; }
@keyframes intro-fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Round 3: Home, phone menu icons, the loop ---------- */
.nav-icon { display: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.nav-icon.is-dots { stroke-width: 3; }
.nav-narrow, .nav-narrow-text { display: none; }
.loop-mark { display: block; width: 100%; height: auto; overflow: visible; }
.loop-line { fill: none; stroke: var(--gold); stroke-width: 46; stroke-linejoin: round; }
.loop-track { fill: none; stroke: var(--midnight-2); stroke-width: 46; stroke-linejoin: round; }
.loop-mark.is-drawn .loop-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: loop-draw 1.4s 0.15s cubic-bezier(0.6, 0, 0.2, 1) forwards; }
@keyframes loop-draw { to { stroke-dashoffset: 0; } }
.hero-loop { width: 132px; flex-shrink: 0; }
.home { max-width: 760px; }
.home-hero { position: relative; overflow: hidden; background: var(--midnight); color: var(--pearl); border-radius: 16px; padding: 1.1rem; display: flex; flex-direction: column; gap: 1rem; }
.home-hero.is-complete { box-shadow: inset 0 0 0 3px var(--gold); }
.home-hero.is-complete .hero-title { color: var(--gold); }
.home-motif { position: absolute; right: -90px; top: -46px; width: 380px; opacity: 0.12; pointer-events: none; }
.home-hero-top { position: relative; display: flex; align-items: center; gap: 1rem; }
.home-loop { width: 120px; flex-shrink: 0; }
.home-log { position: relative; display: flex; align-items: center; justify-content: center; text-decoration: none; font-size: 1.05rem; min-height: 48px; }
.home-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.home-stat { padding: 0.7rem 0.8rem; display: flex; flex-direction: column; gap: 0.15rem; }
.home-stat-value { font-size: 1.7rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.home-label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.8px; color: var(--muted); }
.home-pinned { padding: 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.35rem; border-color: var(--gold); border-width: 2px; }
.home-pin { display: flex; align-items: center; gap: 0.35rem; }
.home-pin-icon { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.home-pinned-text { font-size: 1.1rem; line-height: 1.35; white-space: pre-wrap; overflow-wrap: anywhere; }
.home-link { display: flex; align-items: center; gap: 0.9rem; padding: 0.8rem 1rem; color: var(--midnight); text-decoration: none; }
.home-link:hover { border-color: var(--midnight); }
.home-note { border-left: 4px solid var(--gold); }
.home-link-text { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.home-link-title { font-size: 1.1rem; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.more-list { max-width: 560px; }
.more-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 60px; padding: 0.6rem 1rem; color: var(--midnight); text-decoration: none; border-bottom: 1px solid var(--line); }
.more-row:last-child { border-bottom: 0; }
.more-arrow { font-size: 1.6rem; color: var(--muted); line-height: 1; }
@media (max-width: 720px) {
  .nav-wide, .nav-wide-text { display: none; }
  .nav-narrow { display: flex; }
  .nav-narrow-text { display: inline; }
  .nav-icon { display: block; }
  .mainnav { grid-auto-columns: minmax(0, 1fr); overflow-x: visible; }
  .nav-item { flex-direction: column; gap: 3px; min-height: 60px; font-size: 0.75rem; padding: 0; }
  .nav-dot { position: absolute; top: 9px; left: calc(50% + 9px); margin: 0; }
  .hero-loop { width: 104px; }
  .home-loop { width: 100px; }
}
@media (prefers-reduced-motion: reduce) { .loop-mark.is-drawn .loop-line { animation: none; stroke-dashoffset: 0; } }

/* ---------- Recognition: wins, badges, most improved ---------- */
.wins { max-width: 640px; }
.win { display: flex; align-items: center; gap: 0.9rem; padding: 0.8rem 1rem; }
.win.is-closing { border-left: 4px solid var(--gold); }
.win-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.win-line { font-size: 1.05rem; line-height: 1.25; overflow-wrap: anywhere; }
.win-btn.is-on { background: var(--midnight); color: var(--pearl); }
.best-tag { display: inline-block; margin-left: 0.4rem; padding: 0.1rem 0.4rem; border-radius: 4px; background: var(--gold); color: var(--midnight); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.5px; vertical-align: middle; white-space: nowrap; }
.improved { padding: 0.8rem 1rem; display: flex; flex-direction: column; gap: 0.2rem; border-left: 4px solid var(--gold); max-width: 640px; }
.improved-line { line-height: 1.3; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.6rem; }
.badge { display: flex; align-items: center; gap: 0.8rem; padding: 0.8rem 0.9rem; }
.medal { width: 48px; height: 48px; flex-shrink: 0; border-radius: 50%; border: 2px dashed var(--line-strong); color: var(--muted); display: flex; align-items: center; justify-content: center; }
.medal-icon { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.medal .loop-mark { width: 30px; }
.medal .loop-line { stroke: currentColor; }
.medal.is-earned { border: 0; background: var(--gold); color: var(--midnight); }
.medal-sm { width: 36px; height: 36px; border-width: 1.5px; }
.medal-sm .medal-icon { width: 20px; height: 20px; }
.medal-sm .loop-mark { width: 23px; }
.badge-group { margin: 0.4rem 0 0; font-size: 1rem; }
.badge-group .muted { font-weight: 400; font-size: 0.9rem; }
.home-badges { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.7rem 0.8rem; text-decoration: none; color: var(--midnight); }
.home-badges:hover { border-color: var(--midnight); }
.home-medals { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.badge.is-earned { border-color: var(--gold); }
.badge:not(.is-earned) .badge-title { color: var(--muted); }
.badge-text { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.badge-title { font-weight: 700; line-height: 1.2; }
.badge-progress { font-weight: 600; }
@media (max-width: 720px) { .win { flex-wrap: wrap; } .win-text { flex: 1 1 60%; } .win-btn { flex: 1 1 100%; } }
.auto-card { max-width: none; gap: 1rem; }

/* ---------- Leaderboard icons: streak, most improved, personal best ---------- */
.flair { display: inline-flex; align-items: center; gap: 0.3rem; margin-left: 0.4rem; vertical-align: middle; white-space: nowrap; font-weight: 400; }
.flair-item { display: inline-flex; align-items: center; gap: 0.1rem; font-size: 1rem; line-height: 1; cursor: default; }
.flair-num { font-size: 0.8rem; font-weight: 700; color: var(--midnight); }
.podium-name .flair { display: flex; justify-content: center; margin: 0.15rem 0 0; }
.flair-key { display: flex; flex-wrap: wrap; gap: 0.2rem 1rem; }
.podium-name .flair-num { color: var(--pearl); }
.flair-disc { width: 22px; height: 22px; border-radius: 50%; background: var(--gold); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.flair-shape { width: 15px; height: 15px; fill: var(--midnight); }
.flair-shape.is-rocket { transform: rotate(45deg); }
.flair-item { gap: 0.2rem; }
.flair-key-item { display: inline-flex; align-items: center; gap: 0.35rem; }

/* ---------- Contacts ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.6rem; }
.contact { padding: 0.8rem 1rem; display: flex; flex-direction: column; gap: 0.2rem; }
.contact-name { font-size: 1.1rem; font-weight: 700; line-height: 1.2; }
.contact-links { display: flex; flex-direction: column; gap: 0.1rem; margin-top: 0.25rem; }
.contact-link { display: inline-flex; align-items: center; min-height: 32px; font-weight: 600; overflow-wrap: anywhere; }
.contact-link, .contact-link:visited { color: var(--midnight); }

/* ---------- Training ---------- */
.train { max-width: 760px; display: flex; flex-direction: column; gap: 0.9rem; }
.train .page-head { margin-bottom: 0; }
.back-link { align-self: flex-start; display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-decoration: none; }
.back-link, .back-link:visited { color: var(--midnight); }
.back-link:hover { text-decoration: underline; }
.line-icon { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.train-preview { border-left: 4px solid var(--gold); padding-left: 0.7rem; }
.train-hero { background: var(--midnight); color: var(--pearl); border-radius: 16px; padding: 1.1rem; display: flex; flex-direction: column; gap: 0.3rem; }
.train-hero .home-log { margin-top: 0.7rem; }
.train-hero.is-pass { box-shadow: inset 0 0 0 3px var(--gold); }
.train-hero.is-pass .train-hero-title { color: var(--gold); }
.train-eyebrow { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.8px; color: var(--gold); }
.train-hero-title { font-size: 1.5rem; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.train-path { display: flex; flex-direction: column; }
.train-row { display: flex; gap: 0.8rem; align-items: stretch; }
.train-rail { display: flex; flex-direction: column; align-items: center; width: 36px; flex-shrink: 0; }
.train-dot { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.train-dot.is-now { background: var(--midnight); color: var(--pearl); }
.train-dot.is-done { background: var(--gold); color: var(--midnight); }
.train-dot.is-done svg { width: 18px; height: 18px; }
.train-dot.is-locked { background: var(--track); color: var(--muted); }
.train-line { flex: 1; width: 3px; min-height: 12px; background: var(--track); margin: 4px 0; border-radius: 2px; }
.train-line.is-done { background: var(--gold); }
.train-row:last-child .train-line { visibility: hidden; }
.train-stage { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; padding: 0.8rem 1rem; margin-bottom: 0.7rem; color: var(--midnight); text-decoration: none; }
a.train-stage:hover { border-color: var(--midnight); }
.train-stage.is-now { border-left: 4px solid var(--gold); }
.train-stage.is-locked { background: transparent; border-style: dashed; color: var(--muted); }
.train-stage-name { font-size: 1.25rem; font-weight: 700; line-height: 1.2; }
.train-detail { font-weight: 600; margin-top: 0.2rem; }
.train-bar { height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; margin-top: 0.35rem; max-width: 420px; }
.train-bar-fill { height: 100%; background: var(--gold); border-radius: 4px; }
.train-outcome { background: var(--midnight); color: var(--pearl); border-radius: var(--radius); padding: 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.3rem; line-height: 1.4; }
.train-wait { border-left: 4px solid var(--gold); font-weight: 600; margin: 0; }
.train-state { max-width: 360px; }
.train-section { overflow: hidden; }
.train-section-head { padding: 0.6rem 1rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.8px; color: var(--muted); border-bottom: 1px solid var(--line); }
.train-step { display: flex; align-items: center; gap: 0.8rem; min-height: 60px; padding: 0.6rem 1rem; color: var(--midnight); text-decoration: none; border-bottom: 1px solid var(--line); }
.train-step:last-child { border-bottom: 0; }
.train-step:hover { background: var(--pearl); }
.step-mark { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-strong); flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.step-mark.is-done { border-color: var(--gold); background: var(--gold); color: var(--midnight); }
.step-mark svg { width: 14px; height: 14px; }
.train-step-text { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.train-step-title { font-size: 1.05rem; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.train-step-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin: 0; }
.kind, .exp-tag, .req-tag { display: inline-block; padding: 0.1rem 0.4rem; border-radius: 4px; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.5px; white-space: nowrap; }
.kind { background: var(--track); color: var(--midnight); }
.exp-tag { background: var(--midnight); color: var(--pearl); letter-spacing: 0; }
.req-tag { background: var(--gold); color: var(--midnight); }
.train-quiz { padding: 0.9rem 1rem; display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; }
.train-quiz.is-due { border-color: var(--gold); border-width: 2px; }
.train-part { display: flex; flex-direction: column; gap: 0.5rem; }
.train-part-title { display: flex; align-items: center; gap: 0.5rem; font-size: 1.05rem; margin: 0; }
.part-num { width: 26px; height: 26px; border-radius: 50%; background: var(--midnight); color: var(--pearl); font-size: 0.85rem; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.video-frame { position: relative; aspect-ratio: 16 / 9; background: var(--midnight); border-radius: var(--radius); overflow: hidden; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.train-part p { margin: 0; }
.train-progress { display: flex; flex-direction: column; gap: 0.3rem; color: var(--muted); }
.train-progress .train-bar { max-width: none; margin-top: 0; }
.train-lesson .train-step-meta { margin-top: 0.45rem; }
.train-do { padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem; border: 2px solid var(--gold); }
.train-key { background: var(--midnight); color: var(--pearl); border-radius: var(--radius); padding: 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.3rem; }
.train-key .fmt { font-size: 1.1rem; font-weight: 600; line-height: 1.4; }
.train-key .fmt-ul li::before { background: var(--gold); }
.train-links { padding: 0.8rem 1rem 0.3rem; display: flex; flex-direction: column; }
.train-links .home-label { margin-bottom: 0.5rem; }
.train-link { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; min-height: 48px; padding: 0.35rem 0; border-top: 1px solid var(--line); font-weight: 600; line-height: 1.3; text-decoration: none; overflow-wrap: anywhere; }
.train-link, .train-link:visited { color: var(--midnight); }
.train-link:hover span:first-child { text-decoration: underline; }
.train-out { flex: none; color: var(--muted); font-size: 1.15rem; }
.train-chevron { margin-left: auto; flex: none; color: var(--muted); font-size: 1.4rem; line-height: 1; }
.train-section-head { display: flex; justify-content: space-between; gap: 0.8rem; }
.train-section-head .is-complete { color: var(--midnight); }
.train-done { min-height: 54px; font-size: 1.05rem; align-self: stretch; display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.train-done.is-done { background: var(--white); border: 2px solid var(--gold); cursor: default; }
.train-done-tick { width: 24px; height: 24px; border-radius: 50%; background: var(--gold); color: var(--midnight); display: inline-flex; align-items: center; justify-content: center; }
.train-done-tick svg { width: 14px; height: 14px; }
.train-cheer { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; font-weight: 600; margin-top: -0.4rem; }
.train-cheer:empty { display: none; }
.train-cheer.is-new { animation: train-rise 0.35s ease-out; }
.train-done.is-done .train-done-tick { animation: train-pop 0.35s ease-out; }
@keyframes train-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes train-pop { 0% { transform: scale(0.4); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .train-cheer.is-new, .train-done.is-done .train-done-tick { animation: none; } }
.train-nav { display: flex; justify-content: space-between; gap: 0.6rem; align-items: stretch; }
.train-nav .btn { display: inline-flex; align-items: center; text-decoration: none; min-width: 0; min-height: 54px; }
.train-nav .btn-primary { flex: 1 1 auto; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; padding: 0.4rem 0.9rem; line-height: 1.2; overflow: hidden; }
.train-next-label { font-size: 0.68rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--gold); }
.train-next-title { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Lesson text, laid out from the marks typed in the builder */
.fmt { display: flex; flex-direction: column; gap: 0.85rem; font-size: 1.06rem; line-height: 1.55; overflow-wrap: anywhere; max-width: 64ch; }
.fmt > * { margin: 0; }
.fmt-p { white-space: pre-line; }
.fmt-p.is-lead { margin-bottom: -0.35rem; }
.fmt-h { align-self: flex-start; margin-top: 0.4rem; padding-bottom: 0.2rem; border-bottom: 2px solid var(--gold); font-size: 1.1rem; line-height: 1.3; font-weight: 700; letter-spacing: -0.2px; }
.fmt-ul, .fmt-ol { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.fmt-ul li { position: relative; padding-left: 1.2rem; }
.fmt-ul li::before { content: ''; position: absolute; left: 0.15rem; top: 0.6em; width: 7px; height: 7px; border-radius: 50%; background: var(--midnight); }
.fmt-ol { counter-reset: fmt; gap: 0.6rem; }
.fmt-ol li { counter-increment: fmt; display: flex; gap: 0.7rem; align-items: flex-start; }
.fmt-ol li::before { content: counter(fmt); flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--midnight); font-size: 0.82rem; font-weight: 700; line-height: 1; display: flex; align-items: center; justify-content: center; }
.fmt-say { padding: 0.7rem 0.95rem 0.8rem; background: var(--white); border: 1px solid var(--line-strong); border-radius: 16px 16px 16px 4px; display: flex; flex-direction: column; gap: 0.35rem; }
.card .fmt-say { background: var(--pearl); }
.fmt-say p { margin: 0; font-weight: 500; }
.fmt-say-label, .fmt-key-label { font-size: 0.68rem; line-height: 1.2; font-weight: 700; letter-spacing: 1px; color: var(--muted); }
.fmt-key { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.7rem 0.95rem; background: #F4EBDC; border-radius: 10px; font-weight: 600; }
.fmt-key-label { color: var(--midnight); }
.train-key .fmt-key { background: transparent; padding: 0; }

.build-help { font-weight: 400; margin: -0.2rem 0 0.4rem; }
.build-help summary { cursor: pointer; font-weight: 600; text-decoration: underline; min-height: 32px; }
.build-help ul { margin: 0.3rem 0 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: 0.2rem; }
.build-help code { background: var(--track); border-radius: 4px; padding: 0 0.3rem; font-size: 0.95em; }
.build-preview { display: flex; flex-direction: column; gap: 0.8rem; padding: 0.9rem; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--pearl); font-weight: 400; }
.quiz, .quiz-holder { display: flex; flex-direction: column; gap: 0.8rem; }
.quiz-holder > p { margin: 0; }
.quiz-q { padding: 0.9rem 1rem; margin: 0; display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.quiz-prompt { display: flex; flex-direction: column; gap: 0.15rem; font-size: 1.05rem; font-weight: 700; line-height: 1.3; padding: 0; margin-bottom: 0.4rem; float: left; width: 100%; }
.quiz-opt { clear: both; display: flex; align-items: flex-start; gap: 0.7rem; min-height: 48px; padding: 0.7rem 0.8rem; border: 1px solid var(--line-strong); border-radius: 8px; cursor: pointer; line-height: 1.35; }
.quiz-opt input { width: 20px; height: 20px; margin: 0.05rem 0 0; flex-shrink: 0; accent-color: var(--midnight); }
.quiz-opt:has(input:checked) { border-color: var(--midnight); box-shadow: inset 0 0 0 1px var(--midnight); background: var(--pearl); }
.quiz-miss { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.quiz-miss:last-child { border-bottom: 0; }
.quiz-miss a, .quiz-miss a:visited { color: var(--midnight); font-weight: 600; }

/* ---------- Training: admin progress and builder ---------- */
.train-needs { border-color: var(--gold); border-width: 2px; }
.train-grid-row { align-items: start; padding-top: 0.6rem; padding-bottom: 0.6rem; }
.train-role { display: block; font-weight: 400; }
.train-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 0.3rem; min-width: 0; }
.train-cell-done { font-size: 0.85rem; font-weight: 700; }
.train-cell-warn { font-size: 0.85rem; font-weight: 700; color: var(--error); }
.train-pick { min-height: 36px; font-size: 0.8rem; padding: 0 0.3rem; }
.build { display: flex; flex-direction: column; gap: 0.8rem; max-width: 860px; }
.build-stages { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.build-stages .pill { display: inline-flex; align-items: center; text-decoration: none; color: var(--midnight); }
.build-stages .pill.is-on { color: var(--pearl); }
.build-details summary { font-weight: 700; cursor: pointer; }
.build-details[open] summary { margin-bottom: 0.9rem; }
.build-form { max-width: none; margin: 0; }
.build-form .field { margin-bottom: 0.4rem; }
.build-form .small-input { font-weight: 400; width: 100%; }
.build-hint { font-weight: 400; }
.build-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 0.8rem; }
.build-ticks { display: flex; flex-wrap: wrap; gap: 0.2rem 1.2rem; }
.build-tick { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; font-weight: 600; cursor: pointer; }
.build-check, .field input.build-check { width: 20px; height: 20px; min-height: 0; padding: 0; accent-color: var(--midnight); flex-shrink: 0; }
.build-section { overflow: hidden; }
.build-section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.3rem 0.8rem; padding: 0.5rem 1rem; border-bottom: 1px solid var(--line); background: var(--pearl); }
.build-section-name { flex: 1 1 220px; font-weight: 700; }
.build-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.2rem 0.8rem; padding: 0.4rem 1rem; border-bottom: 1px solid var(--line); }
.build-row-text { display: flex; flex-direction: column; gap: 0.1rem; flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; }
.build-editor { margin: 0.6rem; border-color: var(--midnight); }
.build-add { margin: 0 0.75rem; }
.link:disabled { color: var(--line-strong); cursor: default; text-decoration: none; }
@media (max-width: 720px) {
  .train-hero-title { font-size: 1.3rem; }
  .build-two { grid-template-columns: minmax(0, 1fr); }
}
