:root {
  --ink: #152322;
  --muted: #5c6b68;
  --line: #d7e0de;
  --surface: #ffffff;
  --band: #f3f7f6;
  --brand: #176f64;
  --brand-dark: #0e4f48;
  --present: #cfeedd;
  --absent: #ffe0df;
  --excused: #e4e9f7;
  --free: #fff1c8;
}

body {
  background: var(--band);
  color: var(--ink);
  min-height: 100vh;
}

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1030;
  display: flex;
  width: 60px;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  padding: max(8px, env(safe-area-inset-top)) 6px max(8px, env(safe-area-inset-bottom));
  background: var(--brand-dark);
  color: #fff;
}

.sidebar-brand,
.sidebar-link {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  text-decoration: none;
}

.sidebar-brand {
  justify-content: center;
  margin-bottom: 12px;
}

.brand-mark {
  display: grid;
  width: 44px;
  min-width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 11px;
  font-size: .84rem;
  font-weight: 800;
  letter-spacing: .04em;
}

.sidebar-nav {
  display: grid;
  gap: 5px;
}

.sidebar-team-switch {
  padding: 2px 0 5px;
}

.sidebar-team-switch label {
  display: none;
  margin-bottom: 4px;
  color: rgba(255, 255, 255, .72);
  font-size: .75rem;
}

.sidebar-team-switch select {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 7px;
  padding: 4px 2px;
  background: #fff;
  color: var(--ink);
  font-size: .72rem;
}

.sidebar-link {
  justify-content: center;
  padding: 9px;
}

.sidebar-link:hover,
.sidebar-link:focus-visible {
  background: rgba(255, 255, 255, .14);
  color: #fff;
}

.sidebar-link svg {
  width: 25px;
  min-width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-label {
  display: none;
}

.sidebar-account {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, .18);
}

.sidebar-button {
  width: 100%;
  background: transparent;
}

.account-name {
  overflow: hidden;
  margin: 0 10px 6px;
  color: rgba(255, 255, 255, .72);
  font-size: .8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-shell {
  max-width: 1180px;
  padding: 12px;
}

.app-shell.with-sidebar {
  width: calc(100% - 60px);
  max-width: none;
  margin-left: 60px;
  padding-right: max(10px, env(safe-area-inset-right));
  padding-left: 10px;
}

.auth-panel,
.form-panel {
  max-width: 520px;
  margin: 28px auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.stack-form input,
.stack-form select,
.stack-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 46px;
  padding: 8px 10px;
}

.page-head,
.lesson-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
}

.page-head h1,
.lesson-header h1 {
  font-size: 1.65rem;
  margin: 0;
}

.eyebrow,
.page-head p,
.lesson-header p,
.person-main span {
  color: var(--muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e8eeee;
  color: var(--ink);
  font-size: .85rem;
  white-space: nowrap;
}

.status-submitted,
.status-money_received {
  background: #d7edff;
}

.status-tickets_purchased,
.status-closed {
  background: #d7f3df;
}

.status-in_progress {
  background: #fff1c8;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0 14px;
}

.summary-grid div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.summary-grid span {
  display: block;
  color: var(--muted);
  font-size: .8rem;
}

.summary-grid strong {
  display: block;
  font-size: 1.1rem;
  overflow-wrap: anywhere;
}

.section-band {
  margin: 14px 0;
}

.section-band h2 {
  font-size: 1.2rem;
  margin: 0 0 8px;
}

.person-row,
.compact-card,
.buyer-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.person-row.state-present {
  border-color: #87c79d;
  background: var(--present);
}

.person-row.state-unknown {
  border-color: var(--line);
  background: var(--surface);
}

.person-row.state-absent {
  border-color: #eeaaa7;
  background: var(--absent);
}

.person-row.state-excused {
  border-color: #aebbe0;
  background: var(--excused);
}

.attendance-people-grid {
  display: grid;
  gap: 8px;
}

.person-main {
  display: grid;
  gap: 2px;
  margin-bottom: 10px;
}

.button-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.btn-attend {
  width: 100%;
  min-height: 54px;
  font-weight: 700;
  white-space: normal;
}

.btn-present {
  background: #198754;
  color: #fff;
}

.btn-absent {
  background: #b42318;
  color: #fff;
}

.btn-excused {
  background: #4c5a88;
  color: #fff;
}

.btn-free {
  background: #b7791f;
  color: #fff;
}

.attendance-select-label { display: grid; gap: 5px; color: var(--muted); font-size: .85rem; font-weight: 600; }
.attendance-select { min-height: 48px; color: var(--ink); font-size: 1rem; font-weight: 700; }
.attendance-progress { display: flex; gap: 8px; align-items: center; margin: 8px 0 14px; padding: 10px 12px; border: 1px solid #a9d7bd; border-radius: 8px; background: #e7f7ed; }
.attendance-progress.has-unmarked { border-color: #edc56d; background: #fff7df; }
.registration-list { display: grid; gap: 10px; }
.registration-card { display: grid; grid-template-columns: minmax(260px, 1.5fr) minmax(240px, 1fr) auto; gap: 18px; align-items: center; }
.registration-card h2 { margin: 2px 0 5px; font-size: 1.1rem; }
.registration-match { display: grid; gap: 3px; }
.registration-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.status-filter { display: flex; gap: 6px; overflow-x: auto; }
.status-filter a { padding: 8px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.status-filter a.active { background: var(--surface); color: var(--brand); box-shadow: 0 1px 4px rgb(20 40 35 / 10%); }
.nav-section-label { margin: 12px 12px 3px; color: rgb(255 255 255 / 55%); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
.person-main strong a { color: var(--brand); text-decoration: none; }
.person-main strong a:hover { text-decoration: underline; }
.child-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 10px 0 0; }
.child-detail-grid div { padding: 10px; background: var(--band); border-radius: 8px; }
.child-detail-grid dt { color: var(--muted); font-size: .85rem; }
.child-detail-grid dd { margin: 3px 0 0; font-weight: 600; white-space: pre-line; }

.sticky-submit {
  position: sticky;
  bottom: 0;
  padding: 10px 0;
  background: linear-gradient(180deg, rgba(243, 247, 246, 0), var(--band) 28%);
}

.buyer-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}

.buyer-card header,
.compact-card {
  display: grid;
  gap: 4px;
}

.buyer-card dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  margin: 10px 0;
}

.buyer-card dt {
  color: var(--muted);
  font-weight: 500;
}

.buyer-card dd {
  margin: 0;
  text-align: right;
}

.inline-money,
.date-form,
.link-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.responsive-table {
  overflow-x: auto;
}

.roster-search {
  display: flex;
  gap: 8px;
}

.roster-search input {
  max-width: 560px;
}

.roster-table .roster-name {
  font-size: 1.05rem;
  font-weight: 600;
}

.attendance-mini-history {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 3px;
}

.history-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 4px;
  border: 1px solid #cbd5d1;
  border-radius: 999px;
  background: #edf1ef;
  color: #50605a;
  font-size: .72rem;
  font-weight: 700;
}

.history-present { border-color: #70bd8e; background: #dff5e7; color: #17633a; }
.history-absent { border-color: #e39a9a; background: #fde5e5; color: #8b2727; }
.history-other-team { border-color: #e2b85d; background: #fff0c9; color: #76530b; }

.instructor-ticket-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(90px, 140px) auto;
  gap: 10px;
  align-items: center;
}

.instructor-ticket-form > span { grid-column: 1 / -1; }

.attendance-team-status {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.team-completion {
  display: inline-flex;
  padding: 5px 9px;
  border: 1px solid;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
}

.team-completion.is-complete { border-color: #70bd8e; background: #dff5e7; color: #17633a; }
.team-completion.is-incomplete { border-color: #e2b85d; background: #fff0c9; color: #76530b; }

.manager-attendance-head { align-items: end; }
.manager-attendance-head .lesson-picker-form { margin-left: auto; }

.manager-attendance-progress h2,
.manager-attendance-actions h2 {
  margin: 0;
  font-size: 1.15rem;
}

.manager-attendance-count { font-size: 1.05rem; }

.attendance-progress-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eeee;
}

.attendance-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2c9a60;
  transition: width .2s ease;
}

.manager-attendance-action {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
}

.manager-attendance-action + .manager-attendance-action {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.manager-attendance-action p {
  margin: 4px 0 0;
  color: var(--muted);
}

.manager-attendance-controls {
  display: flex;
  gap: 10px;
  align-items: end;
}

.manager-team-picker {
  display: grid;
  grid-template-columns: auto minmax(160px, 220px);
  gap: 8px;
  align-items: center;
}

.lesson-picker-form {
  display: grid;
  grid-template-columns: auto minmax(260px, 380px);
  gap: 10px;
  align-items: center;
}

.team-number-select { min-width: 92px; }

.roster-child-link {
  display: flex;
  min-width: 190px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.roster-child-link span { display: grid; gap: 2px; }
.roster-child-link small { color: var(--muted); font-size: .75rem; font-weight: 500; }
.roster-child-link svg {
  width: 22px;
  min-width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--brand);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.roster-child-link:hover strong,
.roster-child-link:focus-visible strong { color: var(--brand); text-decoration: underline; }

.team-pin {
  min-width: 4.6rem;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: .12em;
}

.pin-reveal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pin-toggle {
  display: inline-grid;
  width: 34px;
  height: 34px;
  padding: 6px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}

.pin-toggle:hover,
.pin-toggle:focus-visible {
  background: var(--band);
  color: var(--brand);
}

.pin-toggle svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.pin-eye-hide,
.pin-toggle[aria-pressed="true"] .pin-eye-show {
  display: none;
}

.pin-toggle[aria-pressed="true"] .pin-eye-hide {
  display: block;
}

.assignment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.assignment-grid h2 {
  font-size: 1.2rem;
}

.message-stack {
  margin-top: 8px;
}

.empty-state {
  padding: 40px 0;
  text-align: center;
}

.purchase-overview table {
  min-width: 820px;
  border: 1px solid var(--line);
}

.purchase-overview thead th {
  padding: 16px 14px;
  background: #8584e5;
  color: #10101a;
  font-size: 1.05rem;
  text-align: center;
}

.purchase-overview tbody tr:nth-child(even) > * {
  background: #f0efff;
}

.purchase-overview td {
  padding: 14px;
  text-align: center;
}

.purchase-overview tfoot th {
  border-top: 2px solid #1c1c25;
  border-bottom: 2px solid #1c1c25;
  font-size: 1.05rem;
  text-align: center;
}

.purchase-overview .team-number,
.purchase-overview .money-value {
  font-size: 1.1rem;
  font-weight: 700;
}

.compact-money-form {
  min-width: 210px;
}

.lesson-number {
  display: inline-flex;
  gap: .45rem;
  align-items: center;
  padding: 7px 12px;
  border-radius: 9px;
  background: #ebe9ff;
  color: #38346f;
}

.race-table table { min-width: 760px; }
.race-table thead th { background: #62d19d; color: #10271d; }
.race-time-input { min-width: 100px; text-align: center; }
.race-best, .race-place { font-size: 1.2rem; font-weight: 800; text-align: center; }

.race-desktop-view { display: none; }
.race-mobile-view { display: block; }

.race-desktop-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
  margin: 8px 0 12px;
}

.money-team-list { display: grid; gap: 8px; }

.money-team-row {
  grid-template-columns: 90px minmax(300px, 1fr) minmax(230px, auto);
  gap: 16px;
  align-items: center;
}

.money-team-row header { display: grid; justify-items: center; }
.money-team-row header span { color: var(--muted); font-size: .76rem; }
.money-team-row header strong { color: var(--brand); font-size: 1.6rem; }

.money-team-row dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(80px, 1fr));
  gap: 10px;
  margin: 0;
}

.money-team-row dl div { padding: 9px 12px; border-radius: 8px; background: var(--band); }
.money-team-row dt { color: var(--muted); font-size: .76rem; font-weight: 600; }
.money-team-row dd { margin: 2px 0 0; font-size: 1.15rem; font-weight: 800; }
.money-team-row .money-team-amount dd { color: var(--brand-dark); }

.money-received-form { display: flex; gap: 8px; align-items: end; }
.money-received-form label { display: grid; gap: 3px; color: var(--muted); font-size: .76rem; font-weight: 600; }
.money-received-form input { width: 120px; }

.race-desktop-heading h2 { margin: 0; font-size: 1.35rem; }
.race-desktop-heading p { max-width: 430px; margin: 0; color: var(--muted); }
.race-desktop-list { display: grid; gap: 8px; }

.race-desktop-columns,
.race-desktop-row {
  grid-template-columns: minmax(190px, 1fr) minmax(100px, 140px) minmax(100px, 140px) 90px 70px auto;
  gap: 12px;
  align-items: center;
}

.race-desktop-columns {
  display: grid;
  padding: 0 16px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 750;
}

.race-desktop-columns span:not(:first-child) { text-align: center; }
.race-desktop-row { padding: 12px 16px; }
.race-desktop-value { text-align: center; }

.race-mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 14px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #e8eeee;
}

.race-mode-tabs a {
  min-width: 0;
  padding: 11px 6px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 750;
  text-align: center;
  text-decoration: none;
}

.race-mode-tabs a.active {
  background: var(--surface);
  color: var(--brand);
  box-shadow: 0 1px 5px rgb(20 40 35 / 14%);
}

.race-mode-heading,
.race-results-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
  margin: 8px 0 12px;
}

.race-mode-heading h2,
.race-results-head h2 {
  margin: 0;
  font-size: 1.35rem;
}

.race-mode-heading p,
.race-results-head p {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
}

.race-entry-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.race-entry-card {
  grid-template-columns: minmax(180px, 1fr) minmax(125px, 160px) auto;
  gap: 10px 12px;
  align-items: end;
}

.race-entry-person {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  align-self: center;
}

.race-entry-person strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.race-entry-number {
  display: grid;
  width: 30px;
  min-width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--band);
  color: var(--muted);
  font-size: .8rem;
  font-weight: 800;
}

.race-time-field {
  display: grid;
  min-width: 0;
  gap: 4px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
}

.race-time-field .race-time-input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  font-size: 1.1rem;
  font-weight: 750;
}

.race-save-button { min-height: 48px; }

.race-entry-summary {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
  gap: 18px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .82rem;
}

.race-entry-summary strong { color: var(--ink); }

.race-results-list {
  display: grid;
  gap: 8px;
}

.race-result-row {
  grid-template-columns: 62px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.race-result-place {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  background: #dff7eb;
  color: var(--brand-dark);
  font-size: 1.25rem;
  font-weight: 850;
}

.race-result-place small {
  font-size: .55rem;
  font-weight: 650;
  text-transform: uppercase;
}

.race-result-person {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.race-result-person strong { overflow-wrap: anywhere; }
.race-result-person span { color: var(--muted); font-size: .82rem; }
.race-result-best { display: grid; justify-items: end; }
.race-result-best span { color: var(--muted); font-size: .72rem; }
.race-result-best strong { font-size: 1.25rem; }

.race-podium-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.podium-card h2 { margin-bottom: 12px; }
.podium-card ol { display: grid; gap: 8px; margin: 0; padding-left: 28px; }
.podium-card li { padding: 8px; }
.podium-card li::marker { font-weight: 800; }
.podium-card li span { display: inline-flex; flex-direction: column; width: calc(100% - 70px); }
.podium-card li > strong { float: right; }
.podium-card small { color: var(--muted); }

.team-day-info {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(180px, 1fr);
  gap: 14px;
}

.schedule-text {
  margin-top: 8px;
  line-height: 1.65;
  white-space: pre-line;
}

.lunch-card strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
}

.race-window-list {
  display: grid;
  gap: 10px;
}

.race-window-row {
  display: grid;
  gap: 12px;
}

.race-window-team {
  font-size: 1.05rem;
}

.race-window-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.race-window-field {
  display: grid;
  min-width: 0;
  gap: 5px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
}

.race-window-field input {
  width: 100%;
  min-height: 46px;
  color: var(--ink);
  font-size: 1rem;
}

.race-window-save {
  min-height: 46px;
  white-space: nowrap;
}

.season-matrix table { min-width: max-content; }
.season-matrix th, .season-matrix td { min-width: 150px; text-align: center; }
.season-matrix th:first-child { position: sticky; left: 0; z-index: 2; background: var(--surface); }
.season-matrix thead th { background: #dff7eb; }
.season-matrix thead a { display: grid; color: inherit; text-decoration: none; }
.season-matrix thead small { color: var(--muted); font-weight: 500; }

.price-setting-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.price-setting-card { display: grid; gap: 10px; }
.price-setting-card label { display: grid; grid-template-columns: 1fr 110px; gap: 8px; align-items: center; }
.lesson-settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.team-setting-card { display: grid; gap: 12px; }
.team-setting-card h3 { font-size: 1.1rem; margin: 0; }
.team-setting-card legend { font-size: .9rem; font-weight: 700; }
.lift-check-grid { display: grid; gap: 6px; }

.team-tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  border-radius: 12px;
  background: var(--band);
}

.team-tabs a {
  flex: 1;
  padding: 10px 14px;
  border-radius: 9px;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.team-tabs a.active { background: var(--surface); color: var(--brand); box-shadow: 0 1px 4px rgb(20 40 35 / 10%); }
.race-admin-controls { display: flex; justify-content: space-between; gap: 16px; align-items: end; }

.team-picker {
  display: grid;
  grid-template-columns: minmax(150px, auto) minmax(240px, 1fr);
  gap: 16px;
  align-items: center;
}

.team-overview-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.team-overview-head h2 { margin: 0; }

.team-members-grid,
.person-team-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.member-link-list { display: grid; gap: 8px; }
.member-link-list p { margin: 0; }

.member-link-list a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}

.member-link-list a:hover { border-color: var(--brand); color: var(--brand); }
.member-link-list a strong { min-width: 0; overflow-wrap: anywhere; }
.member-link-list a span { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.team-change-card { position: sticky; top: 16px; }

@media (max-width: 640px) {
  .instructor-ticket-form { grid-template-columns: 1fr; }
  .instructor-ticket-form > span { grid-column: auto; }

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

  .page-head,
  .lesson-header {
    display: grid;
  }

  .date-form,
  .inline-money {
    display: grid;
  }

  .race-admin-controls { display: grid; align-items: stretch; }
  .race-admin-controls form .btn { width: 100%; min-height: 48px; }
  .race-window-fields { grid-template-columns: 1fr; }
  .race-window-save { width: 100%; }
  .race-podium-grid { grid-template-columns: 1fr; }

  .assignment-grid {
    grid-template-columns: 1fr;
  }

  .roster-search {
    display: grid;
  }

  .team-day-info {
    grid-template-columns: 1fr;
  }

  .registration-card { grid-template-columns: 1fr; }
  .registration-actions { justify-content: space-between; }

  .team-picker,
  .team-members-grid,
  .person-team-layout { grid-template-columns: 1fr; }

  .team-overview-head { display: grid; }
  .team-change-card { position: static; }
  .lesson-picker-form { grid-template-columns: 1fr; width: 100%; }
  .lesson-picker-form select { width: 100%; min-height: 48px; }
  .manager-attendance-head .lesson-picker-form { margin-left: 0; }
  .manager-attendance-action,
  .manager-attendance-controls { display: grid; align-items: stretch; }
  .manager-team-picker { grid-template-columns: 1fr; }
  .manager-attendance-action form .btn { width: 100%; min-height: 48px; }
  .member-link-list a { min-height: 52px; align-items: center; }
  .member-link-list a span { display: none; }

  .money-team-row { grid-template-columns: 58px minmax(0, 1fr); gap: 10px; padding: 12px; }
  .money-team-row header { align-self: stretch; align-content: center; border-right: 1px solid var(--line); }
  .money-team-row header span { font-size: .68rem; }
  .money-team-row header strong { font-size: 1.5rem; }
  .money-team-row dl { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .money-team-row dl div { padding: 8px 6px; text-align: center; }
  .money-team-row dt { font-size: .68rem; }
  .money-team-row dd { font-size: 1rem; white-space: nowrap; }
  .money-received-form { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .money-received-form input { width: 100%; min-height: 44px; }

  .race-mode-tabs {
    position: sticky;
    top: 0;
    z-index: 5;
  }

  .race-mode-heading,
  .race-results-head {
    display: grid;
  }

  .race-entry-grid { grid-template-columns: minmax(0, 1fr); }

  .race-entry-card {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 12px;
  }

  .race-entry-person { grid-column: 1 / -1; }
  .race-entry-summary { justify-content: space-between; gap: 8px; }

  .race-result-row {
    grid-template-columns: 54px minmax(0, 1fr);
    padding: 12px;
  }

  .race-result-best {
    grid-column: 2;
    justify-items: start;
    padding-top: 7px;
    border-top: 1px solid var(--line);
  }
}

@media (min-width: 641px) and (max-width: 1199px) {
  .race-podium-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
  .race-window-row {
    grid-template-columns: minmax(130px, .6fr) minmax(360px, 1.6fr) auto;
    gap: 18px;
    align-items: end;
  }

  .race-window-team { align-self: center; }
}

@media (min-width: 680px) {
  .app-sidebar {
    width: 220px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .app-shell.with-sidebar {
    width: calc(100% - 220px);
    margin-left: 220px;
    padding: 16px 20px;
  }

  .sidebar-brand,
  .sidebar-link {
    justify-content: flex-start;
  }

  .sidebar-brand {
    padding: 0 4px;
  }

  .sidebar-link {
    padding: 10px 12px;
  }

  .nav-label {
    display: block;
    min-width: 0;
    overflow: hidden;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar-team-switch {
    overflow: visible;
    padding: 4px 8px 8px;
    white-space: normal;
  }

  .sidebar-team-switch label {
    display: block;
  }

  .sidebar-team-switch select {
    padding: 6px 8px;
    font-size: 1rem;
  }

}

@media (min-width: 820px) {
  .attendance-people-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

@media (min-width: 1000px) {
  .race-desktop-view { display: block; }
  .race-mobile-view { display: none; }
}

@media (min-width: 1280px) {
  .app-sidebar {
    width: 248px;
  }

  .app-shell.with-sidebar {
    width: calc(100% - 248px);
    max-width: 1500px;
    margin-left: 248px;
    padding: 18px 28px;
  }
}
