/* Ecoventure instructor allocation.
   Colours are taken from the Ecoventure logo: forest #286140, leaf #44ab35,
   sky #24b9da, amber #f69e15, orange #eb6b3b. Every text colour below meets
   WCAG AA (4.5:1) on the surface it is used on; icons meet 3:1. Typeface: Co
   Headline (Dalton Maag), served from this server, with a system fallback. */

@font-face {
  font-family: "Co Headline";
  src: url("fonts/co-headline-light.woff") format("woff");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Co Headline";
  src: url("fonts/co-headline-regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Co Headline";
  src: url("fonts/co-headline-bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f5f7f6;
  --surface: #ffffff;
  --sunk: #f1f4f2;
  --line: #e3e8e5;
  --line-strong: #cfd8d3;
  --ink: #17211b;
  --mute: #5b6760;
  --faint: #66716b;
  --forest: #286140;
  --forest-hover: #1f4e33;
  --leaf: #44ab35;
  --leaf-icon: #3a9a2e;
  --leaf-badge: #2f8a3c;
  --mint: #eef6f0;
  --mint-2: #e1efe5;
  --mint-line: #cfe5d5;
  --peach: #fff4ed;
  --peach-2: #fde7da;
  --peach-line: #f6cdb5;
  --orange: #eb6b3b;
  --orange-badge: #e0612f;
  --orange-ink: #a3401b;
  --orange-deep: #8f3412;
  --amber-soft: #fff1d6;
  --amber-ink: #7a4a00;
  --sky-soft: #e0f5fa;
  --sky-ink: #0a5f74;
  --red: #c4321f;
  --red-soft: #fef1f0;
  --red-line: #f5c7c1;
  --red-ink: #a3190f;
  --blue-soft: #ecf3fb;
  --blue-line: #c9daee;
  --blue-ink: #1f4f82;
  --focus: #44ab35;
  --shadow-sm: 0 1px 2px rgba(23, 33, 27, 0.05);
  --shadow: 0 1px 2px rgba(23, 33, 27, 0.05), 0 8px 24px rgba(23, 33, 27, 0.05);
  --radius: 14px;
  --radius-m: 12px;
  --radius-s: 10px;
  --font: "Co Headline", "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
b, strong { font-weight: 700; }
a { color: var(--forest); text-underline-offset: 3px; }
a:hover { color: var(--forest-hover); }
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 700; }
p { margin: 0 0 0.6em; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0; }
code { font-family: var(--mono); font-size: 0.86em; background: var(--sunk); padding: 1px 5px; border-radius: 5px; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

.icon {
  width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.18em;
}
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }
.muted { color: var(--mute); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.dot-sep { margin: 0 9px; color: var(--line-strong); }

/* ---- header -------------------------------------------------------------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-sm); position: relative; z-index: 20; }
.topbar-inner, .foot-inner { max-width: 1240px; margin: 0 auto; padding: 0 28px; }
.topbar-inner { display: flex; align-items: center; gap: 18px; min-height: 70px; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--mute); text-decoration: none; min-width: 0; }
.brand:hover { color: var(--ink); }
.brand-logo { height: 26px; width: auto; display: block; }
.brand-emblem { display: none; height: 38px; width: 38px; }
.brand-divider { width: 1px; height: 26px; background: var(--line-strong); }
.brand-product { font-size: 16px; color: var(--mute); white-space: nowrap; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a {
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 15px;
  padding: 9px 16px; border-radius: var(--radius-s); line-height: 1.2;
}
.nav a:hover { background: var(--mint); color: var(--forest); }
.nav a[aria-current="page"] { background: var(--forest); color: #fff; }
.mode {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700;
  padding: 6px 12px; border-radius: 999px; white-space: nowrap;
}
.mode-on { background: var(--mint); color: var(--forest); }
.mode-off { background: var(--sunk); color: var(--mute); }
.mode-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.mode-on .mode-dot { background: var(--leaf); }

.account { position: relative; }
.account > summary { list-style: none; }
.account > summary::-webkit-details-marker { display: none; }
.avatar {
  display: flex; align-items: center; gap: 2px; cursor: pointer; padding: 3px 6px 3px 3px;
  border-radius: 999px; color: var(--forest);
}
.avatar > .icon { width: 38px; height: 38px; padding: 9px; border-radius: 50%; background: var(--mint-2); }
.avatar-chevron .icon { width: 18px; height: 18px; color: var(--mute); }
.avatar:hover > .icon { background: var(--mint-line); }
.account-menu {
  position: absolute; right: 0; top: calc(100% + 10px); width: 280px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: 0 16px 40px rgba(23, 33, 27, 0.14);
  padding: 14px; z-index: 40;
}
.account-title { font-weight: 700; margin: 0 0 2px; }
.account-line { font-size: 13.5px; color: var(--mute); margin: 0 0 6px; }
.account-link {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; margin-top: 4px;
  border-radius: var(--radius-s); color: var(--ink); text-decoration: none; font: 700 14.5px var(--font);
  background: none; border: 0; cursor: pointer; text-align: left;
}
.account-link:hover { background: var(--mint); color: var(--forest); }
.account form { margin: 0; }

/* ---- page ---------------------------------------------------------------- */
.page { width: 100%; max-width: 1240px; margin: 0 auto; padding: 26px 28px 72px; flex: 1; }
.narrow { max-width: 760px; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--faint); margin: 0 0 12px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumb-sep { color: var(--line-strong); }
.page-head { margin: 0 0 22px; }
.page-head h1 { font-size: 34px; letter-spacing: -0.015em; margin: 0 0 8px; }
.head-split { display: flex; gap: 18px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.head-text { min-width: 0; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.head-actions form { margin: 0; }
.meta { color: var(--mute); font-size: 14.5px; }
.lede { color: var(--mute); max-width: 72ch; font-size: 16px; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px 26px; margin: 0 0 20px;
}
.card.flush { padding: 0; overflow: hidden; }
.card-title { font-size: 18px; margin: 0 0 12px; }
.card-head { display: flex; gap: 14px; align-items: flex-start; margin: 0 0 20px; }
.card-head h2 { font-size: 20px; margin: 2px 0 2px; }
.step {
  flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--mint-2); color: var(--forest);
  font-weight: 700; font-size: 17px; display: grid; place-items: center;
}
.step .icon { width: 20px; height: 20px; }
.step-danger { background: var(--red-soft); color: var(--red-ink); }
.layout-split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }

/* ---- forms --------------------------------------------------------------- */
.field { margin: 0 0 18px; position: relative; }
.field.grow { flex: 1; min-width: 240px; margin: 0; }
.field-label, .label { display: block; font-weight: 700; font-size: 14px; color: var(--ink); margin: 0 0 8px; }
.label { font-size: 13px; color: var(--mute); }
input[type="password"], input[type="search"], input[type="text"], select {
  width: 100%; height: 46px; padding: 0 14px; font: 400 15px var(--font); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-s);
}
input::placeholder { color: var(--faint); }
select {
  appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6760' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6.5 9.5 5.5 5.5 5.5-5.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
}
select.listbox { height: auto; padding: 6px; background-image: none; font-size: 14.5px; }
select.listbox option { padding: 7px 10px; border-radius: 6px; }
select.listbox optgroup { font-style: normal; font-weight: 700; color: var(--faint); font-size: 12.5px; }
input:focus, select:focus { outline: 3px solid rgba(68, 171, 53, 0.35); outline-offset: 0; border-color: var(--forest); }
.search-field input { padding-left: 42px; }
.search-icon { position: absolute; left: 14px; bottom: 13px; color: var(--faint); }
.search-icon .icon { width: 19px; height: 19px; }
.hint { font-size: 13.5px; color: var(--mute); margin: 7px 0 0; }
.check {
  display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.45;
  color: var(--ink); margin: 0 0 12px; cursor: pointer;
}
.check input { width: 19px; height: 19px; margin: 1px 0 0; accent-color: var(--forest); flex: none; }
.check-must { background: var(--peach); border: 1px solid var(--peach-line); color: var(--orange-deep); border-radius: var(--radius-s); padding: 11px 14px; }
.check-must input { accent-color: var(--orange-ink); }
.row-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.quiet-link { font-size: 14.5px; font-weight: 700; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }

/* ---- buttons ------------------------------------------------------------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font: 700 15px/1 var(--font); height: 46px; padding: 0 20px; border-radius: var(--radius-s);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  text-decoration: none; cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-sm);
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.button .icon { width: 19px; height: 19px; }
.button:hover { background: var(--mint); border-color: var(--forest); color: var(--forest); }
.button-primary { background: var(--forest); border-color: var(--forest); color: #fff; }
.button-primary:hover { background: var(--forest-hover); border-color: var(--forest-hover); color: #fff; }
.button-danger { background: var(--surface); border-color: var(--red); color: var(--red-ink); }
.button-danger:hover { background: var(--red-soft); border-color: var(--red); color: var(--red-ink); }
.button-big { height: 50px; padding: 0 24px; font-size: 15.5px; }
.button-small { height: 36px; padding: 0 14px; font-size: 14px; }
.button-small .icon { width: 16px; height: 16px; }
.row-action { text-align: right; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dry-run {
  display: inline-flex; align-items: center; gap: 7px; margin: 0 0 8px; padding: 5px 12px; border-radius: 999px;
  background: var(--blue-soft); color: var(--blue-ink); font-size: 13.5px; font-weight: 700;
}
.dry-run .icon { width: 16px; height: 16px; }
.button-wide { width: 100%; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* ---- week cards ---------------------------------------------------------- */
.weeks { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin: 0 0 20px; }
.week-slot { display: flex; flex-direction: column; min-width: 0; }
.week-slot > .week { flex: 1; }
/* An open plan hangs off the bottom of its week's card. */
.week-slot.has-plan > .week { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.week-slot.has-plan > .week:hover { transform: none; }
.week-plan {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px;
  font-size: 13.5px; font-weight: 700; color: var(--forest); text-decoration: none;
  background: var(--mint); border: 1px solid var(--line); border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
}
.week-slot > .week-next + .week-plan { border: 2px solid var(--forest); border-top: 0; }
.week-plan:hover { background: var(--mint-2); text-decoration: underline; }
.week-plan .icon { width: 16px; height: 16px; flex: none; }
.week {
  text-align: left; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 16px;
  cursor: pointer; display: flex; flex-direction: column; gap: 6px; min-height: 160px; box-shadow: var(--shadow-sm);
  transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s;
}
.week:hover { border-color: var(--forest); box-shadow: 0 8px 24px rgba(40, 97, 64, 0.14); transform: translateY(-1px); }
.week-top { display: flex; align-items: center; gap: 10px; }
.week-icon { width: 32px; height: 32px; border-radius: 9px; background: var(--mint); color: var(--leaf-icon); display: grid; place-items: center; }
.week-icon .icon { width: 18px; height: 18px; }
.week-when { font-size: 13px; font-weight: 700; color: var(--mute); text-transform: uppercase; letter-spacing: 0.06em; }
.week-dates { font-size: 19px; font-weight: 700; line-height: 1.3; margin-top: 4px; }
.week-file { font-size: 13px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.week-go { margin-top: auto; padding-top: 12px; font-weight: 700; font-size: 14.5px; color: var(--forest); display: inline-flex; gap: 6px; align-items: center; }
.week-next { border: 2px solid var(--forest); background: linear-gradient(180deg, var(--mint) 0%, var(--surface) 75%); }
.week-next .week-icon { background: var(--forest); color: #fff; }
.week-next .week-when { color: var(--forest); }
.week-next .week-go { align-self: flex-start; background: var(--forest); color: #fff; padding: 9px 14px; border-radius: var(--radius-s); margin-top: auto; }

.disclose { border-top: 1px solid var(--line); padding-top: 16px; }
.disclose > summary { cursor: pointer; font-weight: 700; color: var(--forest); list-style: none; display: inline-flex; gap: 8px; align-items: center; }
.disclose > summary::-webkit-details-marker { display: none; }
.disclose:not([open]) > summary .trip-gaps-chevron { transform: rotate(-90deg); }
.disclose-body { padding-top: 16px; }
.recent { list-style: none; padding: 0; }
.card-title-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }
.card-title-row .card-title { margin-bottom: 0; }
.recent li { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--line); }
.recent li:last-child { border-bottom: 0; padding-bottom: 0; }
.recent-icon { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--mint-2); color: var(--forest); display: grid; place-items: center; }
.recent-icon .icon { width: 16px; height: 16px; }
.recent-undone { background: var(--sunk); color: var(--mute); }
.recent-text { display: flex; flex-direction: column; min-width: 0; }
.recent-text a { font-weight: 700; text-decoration: none; }
.recent-text .muted { font-size: 13.5px; }

/* ---- banners and alerts -------------------------------------------------- */
.banner {
  display: flex; gap: 16px; align-items: center; border-radius: var(--radius);
  padding: 18px 22px; margin: 0 0 22px; border: 1px solid; box-shadow: var(--shadow-sm);
}
.banner-badge {
  flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff;
}
.banner-badge .icon { width: 22px; height: 22px; stroke-width: 2.6; }
.banner-body { flex: 1; min-width: 0; color: var(--mute); }
.banner-title { font-weight: 700; font-size: 18px; margin: 0 0 3px; line-height: 1.3; }
.banner ul { padding-left: 20px; margin: 6px 0 8px; }
.banner-body a { color: inherit; font-weight: 700; }
.banner-action {
  flex: none; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14.5px;
  padding: 10px 16px; border-radius: var(--radius-s); text-decoration: none; border: 1px solid; background: var(--surface);
}
.banner-good { background: var(--mint); border-color: var(--mint-line); }
.banner-good .banner-badge { background: var(--leaf-badge); }
.banner-good .banner-title { color: var(--forest); }
.banner-good .banner-action { color: var(--forest); border-color: var(--mint-line); }
.banner-warn { background: var(--peach); border-color: var(--peach-line); }
.banner-warn .banner-badge { background: var(--orange-badge); }
.banner-warn .banner-title { color: var(--orange-deep); }
.banner-warn .banner-action { color: var(--orange-ink); border-color: var(--peach-line); background: #fffaf6; }
.banner-warn .banner-action:hover { background: var(--peach-2); }
.banner-bad { background: var(--red-soft); border-color: var(--red-line); }
.banner-bad .banner-badge { background: var(--red); }
.banner-bad .banner-title { color: var(--red-ink); }
.banner-bad .banner-body { color: var(--red-ink); }
.banner-info { background: var(--blue-soft); border-color: var(--blue-line); }
.banner-info .banner-badge { background: var(--blue-ink); }
.banner-info .banner-title { color: var(--blue-ink); }
.banner-info .banner-action { color: var(--blue-ink); border-color: var(--blue-line); }
.alert { border-radius: var(--radius-s); padding: 12px 15px; margin: 12px 0 0; font-size: 14.5px; border: 1px solid transparent; }
.alert-bad { background: var(--red-soft); color: var(--red-ink); border-color: var(--red-line); }
.alert-warn { background: var(--peach); color: var(--orange-deep); border-color: var(--peach-line); }
.alert-good { background: var(--mint); color: var(--forest); border-color: var(--mint-line); }
.alert-info { background: var(--blue-soft); color: var(--blue-ink); border-color: var(--blue-line); }
.alert a { color: inherit; font-weight: 700; }
.technical { margin-top: 10px; font-size: 13.5px; }
.technical summary { cursor: pointer; font-weight: 700; }
.technical pre { white-space: pre-wrap; word-break: break-word; background: var(--surface); color: var(--ink); padding: 12px; border-radius: 8px; border: 1px solid var(--line); font: 12.5px/1.5 var(--mono); }

/* ---- metrics ------------------------------------------------------------- */
.metrics {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0 0 26px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.metric { display: flex; gap: 12px; align-items: flex-start; padding: 20px 20px; min-width: 0; }
.metric + .metric { border-left: 1px solid var(--line); }
.metric-icon {
  flex: none; width: 30px; height: 30px; color: var(--leaf-icon); display: grid; place-items: center; margin-top: 1px;
}
.metric-icon .icon { width: 28px; height: 28px; stroke-width: 1.7; }
.metric-icon-warn { color: var(--orange); }
.metric-icon-solid { background: var(--leaf-badge); color: #fff; border-radius: 50%; }
.metric-icon-solid .icon { width: 18px; height: 18px; stroke-width: 2.8; }
.metric-icon-grey { background: var(--sunk); color: var(--mute); }
.mismatch-head .metric-icon, .empty .metric-icon { width: 40px; height: 40px; border-radius: 11px; background: var(--peach); }
.empty .metric-icon { background: var(--mint); }
.mismatch-head .metric-icon .icon, .empty .metric-icon .icon { width: 22px; height: 22px; }
.metric-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.metric-label { font-size: 14px; color: var(--mute); }
.metric-value { font-size: 30px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); line-height: 1.1; }
.metric-value small { font-size: 18px; color: var(--mute); font-weight: 400; }
.value-warn { color: var(--orange-ink); }
.metric-foot { font-size: 13px; color: var(--mute); }
.bar { width: 100%; height: 7px; margin: 8px 0 2px; }
.bar-track { fill: var(--mint-2); }
.bar-fill { fill: var(--leaf); }

/* ---- tabs ---------------------------------------------------------------- */
.tabs { margin: 0 0 26px; }
.tab-radio { position: absolute; opacity: 0; pointer-events: none; }
.tablist { display: flex; gap: 30px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; }
.tab {
  margin: 0; padding: 12px 2px 13px; font-size: 15.5px; color: var(--mute); cursor: pointer;
  border-bottom: 3px solid transparent; white-space: nowrap; display: flex; align-items: center; gap: 9px;
}
.tab:hover { color: var(--ink); }
.count {
  display: inline-grid; place-items: center; min-width: 26px; height: 24px; padding: 0 8px;
  border-radius: 999px; background: var(--mint-2); color: var(--forest); font-size: 13px; font-weight: 700;
}
.count-quiet { background: var(--sunk); color: var(--mute); }
.tabpanel { display: none; padding: 22px 0 0; }
#tab-attention:checked ~ .tablist label[for="tab-attention"],
#tab-sheet:checked ~ .tablist label[for="tab-sheet"],
#tab-people:checked ~ .tablist label[for="tab-people"],
#tab-changes:checked ~ .tablist label[for="tab-changes"],
#tab-notes:checked ~ .tablist label[for="tab-notes"] { color: var(--forest); font-weight: 700; border-bottom-color: var(--forest); }
#tab-attention:checked ~ .panel-attention,
#tab-sheet:checked ~ .panel-sheet,
#tab-people:checked ~ .panel-people,
#tab-changes:checked ~ .panel-changes,
#tab-notes:checked ~ .panel-notes { display: block; }
/* Focus ring for keyboard users only: a mouse click on a tab focuses its radio too. */
.kbd #tab-attention:focus-visible ~ .tablist label[for="tab-attention"],
.kbd #tab-sheet:focus-visible ~ .tablist label[for="tab-sheet"],
.kbd #tab-people:focus-visible ~ .tablist label[for="tab-people"],
.kbd #tab-changes:focus-visible ~ .tablist label[for="tab-changes"],
.kbd #tab-notes:focus-visible ~ .tablist label[for="tab-notes"] { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.panel-intro { margin-bottom: 14px; }

/* ---- needs attention ----------------------------------------------------- */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 18px; }
.reason-summary { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-flex; align-items: center; font-size: 14px; padding: 7px 15px; border-radius: 999px; }
.chip-reason { background: var(--peach); border: 1px solid var(--peach-line); color: var(--orange-ink); }
.sort { display: inline-flex; align-items: center; gap: 12px; font-size: 14px; color: var(--mute); }
.sort select { width: auto; min-width: 230px; height: 42px; font-size: 14.5px; }
.empty { padding: 30px; text-align: center; color: var(--mute); }
.empty .metric-icon { margin: 0 auto 12px; }
.good-empty {
  display: flex; gap: 14px; align-items: center; justify-content: center; color: var(--forest);
  background: var(--mint); border: 1px solid var(--mint-line); border-radius: var(--radius);
}
.good-empty .banner-badge { background: var(--leaf-badge); }

.trip-gaps { margin: 0 0 18px; }
.trip-gaps-head {
  cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; list-style: none;
  padding: 13px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m);
  box-shadow: var(--shadow-sm);
}
.trip-gaps-head::-webkit-details-marker { display: none; }
.trip-gaps-chevron { display: inline-grid; place-items: center; color: var(--forest); transition: transform 0.15s; }
.trip-gaps-chevron .icon { width: 20px; height: 20px; }
.trip-gaps:not([open]) > .trip-gaps-head .trip-gaps-chevron { transform: rotate(-90deg); }
.trip-gaps[open] > .trip-gaps-head { margin-bottom: 16px; }
.trip-gaps-name { font-weight: 700; font-size: 18px; color: var(--forest); letter-spacing: 0.01em; }
.trip-gaps-why { font-size: 14px; color: var(--mute); }
.pill { display: inline-flex; align-items: center; font-weight: 700; font-size: 13.5px; padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
.pill-warn { background: var(--peach-2); color: var(--orange-ink); }

.gaps { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.gap-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px 18px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow);
}
.gap-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 14px; }
.gap-when { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.gap-when .icon { color: var(--forest); width: 18px; height: 18px; }
.gap-when span { color: var(--ink); }
.gap-where { color: var(--faint); font-size: 13.5px; }
.gap-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.gap-title { font-size: 22px; letter-spacing: -0.005em; }
.gap-why { color: var(--mute); font-size: 15px; margin: 0; }
.gap-why b { color: var(--ink); }
.cover { background: #f3f9f4; border: 1px solid var(--mint-line); border-radius: var(--radius-m); padding: 14px 16px; }
.cover-head { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 12px; }
.cover-none .cover-head { margin: 0; }
.cover-icon { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--leaf-badge); color: #fff; display: grid; place-items: center; margin-top: 1px; }
.cover-icon .icon { width: 15px; height: 15px; stroke-width: 2.8; }
.cover-icon-warn { background: var(--orange-badge); }
.cover-title { font-weight: 700; margin: 0; color: var(--ink); }
.cover-text { font-size: 13.5px; color: var(--mute); margin: 1px 0 0; }
.cover-none { background: var(--peach); border-color: var(--peach-line); }
.name-chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 7px; }
.name-chips li {
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 9px;
  padding: 5px 11px; font-size: 13.5px; font-weight: 700; color: var(--ink);
}
.name-chips li.chip-more { font-weight: 400; color: var(--mute); }
.name-chips li.chip-reserve { border-style: dashed; color: var(--mute); }
.name-chips .muted { font-weight: 400; }
.gap-details > summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 7px;
  font-weight: 700; font-size: 14.5px; color: var(--forest); margin-top: 2px;
}
.gap-details > summary::-webkit-details-marker { display: none; }
.gap-details > summary .icon { transition: transform 0.15s; }
.gap-details[open] > summary .icon { transform: rotate(90deg); }
.gap-details-body { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.detail-title { font-weight: 700; font-size: 14px; margin: 0 0 6px; }
.detail-note { font-size: 13px; color: var(--mute); margin: -2px 0 6px; }
.priority-line { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13.5px; margin: 6px 0 0; }
.priority-line b { font-weight: 700; }
.detail-list { list-style: none; padding: 0; margin: 0 0 12px; }
.detail-list li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 14px; border-bottom: 1px solid var(--sunk); }
.detail-list li span { color: var(--mute); text-align: right; }
.issue-list { padding-left: 18px; }
.issue-list li { margin: 6px 0; font-size: 14.5px; }
.cellref { display: inline-block; font-family: var(--mono); font-size: 12.5px; color: var(--mute); background: var(--sunk); padding: 1px 6px; border-radius: 5px; }

.mismatch { border-left: 4px solid var(--orange); }
.mismatch-head { display: flex; gap: 14px; align-items: flex-start; }
.mismatch-head .card-title { margin-bottom: 6px; }
.mismatch-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 16px; }

/* ---- the week grids (timetable view, by instructor) ------------------------ */
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; font-size: 14px; color: var(--mute); margin: 0 0 16px; }
.key { display: inline-block; width: 15px; height: 15px; border-radius: 4px; margin-right: -10px; vertical-align: -2px; border: 1px solid var(--line-strong); }
.key-full { background: var(--mint-2); border-color: var(--mint-line); }
.key-gap { background: var(--peach-2); border-color: var(--orange); }
.key-empty { background: repeating-linear-gradient(135deg, var(--surface), var(--surface) 3px, var(--sunk) 3px, var(--sunk) 5px); }
.trip { margin: 0 0 30px; }
.trip-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 10px; min-height: 36px; }
.trip-people:not(.has-overflow) .trip-head { display: none; } /* no title, so no row without arrows */
.trip-name { font-size: 17px; color: var(--forest); margin: 0; }
.trip-name .muted { font-weight: 400; }
.scroll-nav { display: flex; gap: 6px; }
.scroll-button {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--forest); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-sm); padding: 0;
}
.scroll-button .icon { width: 18px; height: 18px; stroke-width: 2.2; }
.scroll-button:hover:not([disabled]) { background: var(--mint); border-color: var(--forest); }
.scroll-button[disabled] { opacity: 0.35; cursor: default; box-shadow: none; }

/* The frame draws the border and clips the corners; the scroller inside moves. */
.scroll-shell {
  position: relative; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden;
}
/* "More this way" fade at the right edge, shown only while there is more. */
.scroll-shell::after {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 32px; pointer-events: none; z-index: 6;
  background: linear-gradient(to left, rgba(23, 33, 27, 0.11), rgba(23, 33, 27, 0)); opacity: 0; transition: opacity 0.15s;
}
.can-right .scroll-shell::after { opacity: 1; }
.trip-people .scroll-shell::after { display: none; } /* the pinned Total column marks that edge */
.scroller { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: #c3cec7 transparent; }
.scroller::-webkit-scrollbar { height: 11px; }
.scroller::-webkit-scrollbar-track { background: transparent; }
.scroller::-webkit-scrollbar-thumb { background: #c3cec7; border-radius: 999px; border: 3px solid var(--surface); }
.scroller:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; border-radius: var(--radius); }

table.sheet, table.people {
  border-collapse: separate; border-spacing: 0; table-layout: fixed; width: max-content; min-width: 100%;
  font-size: 13px;
}
table.sheet { --pin: 132px; }
table.people { --pin: 172px; }
table.sheet col.col-head { width: 132px; }
table.sheet col.col-slot { width: 150px; }
table.people col.col-head { width: 172px; }
table.people col.col-half { width: 136px; }
table.people col.col-total { width: 92px; }
table.sheet th, table.sheet td, table.people th, table.people td {
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0; vertical-align: top;
}
table.sheet tr > :last-child, table.people tr > :last-child { border-right: 0; }
table.sheet tbody tr:last-child > *, table.people tbody tr:last-child > * { border-bottom: 0; }
/* Heavier rule between days, as in the workbook. */
table.sheet .day-end, table.people .day-end { border-right: 2px solid #c3cec7; }

/* header */
table.sheet thead th, table.people thead th {
  background: #f7f9f8; font-size: 12.5px; font-weight: 700; color: var(--mute);
  padding: 9px 12px; text-align: left; white-space: nowrap;
}
table.sheet thead th.day, table.people thead th.day {
  text-align: center; color: var(--forest); background: var(--mint); letter-spacing: 0.05em;
  text-transform: uppercase; border-right: 2px solid #c3cec7;
}
/* While a day is partly scrolled under the pinned column, its name stays in view. */
.day-label { position: sticky; left: calc(var(--pin) + 14px); display: inline-block; }
table.sheet thead tr.slots th, table.people thead tr.slots th { font-weight: 400; color: var(--ink); }
table.people thead tr.slots th { text-align: center; color: var(--mute); font-weight: 700; font-size: 12px; letter-spacing: 0.04em; }
.half { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; padding: 2px 6px; border-radius: 4px; margin-right: 7px; vertical-align: 1px; }
.half-am { background: var(--amber-soft); color: var(--amber-ink); }
.half-pm { background: var(--sky-soft); color: var(--sky-ink); }

/* pinned first column */
table.sheet th.corner, table.sheet th.rowhead, table.people th.corner, table.people th.rowhead {
  position: sticky; left: 0; z-index: 3; background: #f7f9f8; text-align: left; padding: 12px 14px;
  border-right: 1px solid var(--line-strong); transition: box-shadow 0.15s;
}
table.sheet thead th.corner, table.people thead th.corner { z-index: 4; vertical-align: bottom; color: var(--mute); }
.is-scrolled th.corner, .is-scrolled th.rowhead { box-shadow: 10px 0 12px -10px rgba(23, 33, 27, 0.3); }
.rowhead-label { display: block; font-size: 14px; font-weight: 700; color: var(--ink); white-space: normal; }
th.rowhead small { display: block; font-size: 12px; font-weight: 400; color: var(--faint); margin-top: 3px; white-space: normal; }

/* timetable cells */
table.sheet td.cell { background: var(--surface); padding: 10px 10px 9px; transition: background 0.1s; }
table.sheet td.cell:hover { background: #fafcfb; }
.act { font-size: 13.5px; line-height: 1.3; font-weight: 700; color: var(--ink); margin: 0 0 7px; }
.who {
  padding: 5px 9px; border-radius: 7px; background: var(--mint-2); color: var(--forest);
  font-size: 12.5px; line-height: 1.35; min-height: 28px; word-break: break-word;
}
.need {
  display: flex; align-items: center; gap: 5px; margin-top: 6px; padding: 4px 8px; border-radius: 7px;
  background: var(--peach-2); color: var(--orange-ink); border: 1px dashed var(--orange); font-size: 12px; font-weight: 700;
}
.need .icon { width: 13px; height: 13px; color: var(--orange); stroke-width: 2.2; }
.ref { margin-top: 7px; font-family: var(--mono); font-size: 10.5px; color: var(--faint); letter-spacing: 0.02em; }
table.sheet td.cell-gap { background: #fffaf7; }
table.sheet td.cell-gap:hover { background: #fff4ec; }
table.sheet td.cell-none { background: repeating-linear-gradient(135deg, var(--surface), var(--surface) 6px, #f6f8f7 6px, #f6f8f7 8px); }

/* by-instructor cells */
table.people td.slot { background: var(--surface); padding: 8px 9px; }
table.people td.slot-free { background: #fcfdfc; }
.rota { font-size: 11.5px; color: var(--faint); margin: 0 0 6px; overflow-wrap: anywhere; }
.task {
  background: var(--mint-2); color: var(--forest); border-radius: 7px; padding: 5px 8px; margin: 0 0 5px;
  font-size: 12px; line-height: 1.3; font-weight: 700;
}
.task span { display: block; font-weight: 400; font-size: 11.5px; margin-top: 1px; }
tr.idle th.rowhead .rowhead-label { color: var(--mute); }
tr.idle td.slot { background: #fbfcfb; }
/* pinned Total column */
table.people th.total, table.people td.total {
  position: sticky; right: 0; z-index: 3; background: #f7f9f8; text-align: right; padding: 10px 14px;
  box-shadow: -1px 0 0 #c3cec7; transition: box-shadow 0.15s;
}
table.people thead th.total { z-index: 4; vertical-align: bottom; }
table.people td.total b { display: block; font-size: 16px; }
table.people td.total small { display: block; font-weight: 400; color: var(--faint); }
.can-right table.people .total { box-shadow: -1px 0 0 #c3cec7, -10px 0 12px -10px rgba(23, 33, 27, 0.3); }

/* ---- lists and badges ---------------------------------------------------- */
.table-card { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.table-card-flush { border: 0; border-radius: 0; box-shadow: none; }
table.list { border-collapse: collapse; width: 100%; font-size: 14.5px; }
table.list th { text-align: left; padding: 12px 16px; background: #f7f9f8; font-size: 13px; font-weight: 700; color: var(--mute); border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr:hover { background: #fafcfb; }
td.was { color: var(--mute); }
td.becomes { font-weight: 700; }
.strong-link { font-weight: 700; text-decoration: none; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.badge .icon { width: 14px; height: 14px; stroke-width: 2.6; }
.badge-fill { background: var(--mint-2); color: var(--forest); }
.badge-update, .badge-add { background: var(--blue-soft); color: var(--blue-ink); }
.badge-gap { background: var(--peach-2); color: var(--orange-ink); }
.badge-replace { background: var(--red-soft); color: var(--red-ink); }
.badge-clear { background: var(--sunk); color: var(--mute); }

/* ---- notes --------------------------------------------------------------- */
.note-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); margin: 0 0 10px; box-shadow: var(--shadow-sm); }
.note-group > summary { cursor: pointer; padding: 14px 18px; display: flex; align-items: center; gap: 12px; list-style: none; }
.note-group > summary::-webkit-details-marker { display: none; }
.note-group:not([open]) > summary .trip-gaps-chevron { transform: rotate(-90deg); }
.note-title { font-weight: 700; flex: 1; }
.note-group ul { padding: 0 18px 14px 50px; }
.note-group li { border-top: 1px solid var(--line); padding: 9px 0; color: var(--ink); font-size: 14.5px; }
.note-warning { border-left: 4px solid var(--orange); }
.note-info { border-left: 4px solid var(--line-strong); }
.plain { list-style: none; padding: 0; }

/* ---- apply --------------------------------------------------------------- */
.apply { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 28px; align-items: start; }
.apply > .apply-intro { grid-column: 1; }
.apply-intro { display: flex; gap: 16px; align-items: flex-start; }
.apply-intro h2 { font-size: 21px; margin: 4px 0 4px; }
.apply-form { display: contents; }
.apply-checks { grid-column: 1; padding-left: 56px; margin-top: 16px; }
.apply-confirm { grid-column: 2; grid-row: 1 / span 2; border-left: 1px solid var(--line); padding-left: 28px; align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.apply-row { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; }
.apply-row input { flex: 1 1 170px; height: 50px; min-width: 0; }
.apply-row .button { flex: 0 1 auto; }
.probe-row { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.apply-solo { display: block; }
.undo-card { border-color: var(--red-line); }

/* ---- setup and help ------------------------------------------------------ */
.checks { list-style: none; padding: 0; }
.check-item { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.check-item:first-child { padding-top: 0; }
.check-item:last-child { border-bottom: 0; padding-bottom: 0; }
.check-mark { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.check-mark .icon { width: 16px; height: 16px; stroke-width: 2.8; }
.check-ok .check-mark { background: var(--leaf-badge); }
.check-bad .check-mark { background: var(--red); }
.check-warn .check-mark { background: var(--orange-badge); }
.check-info .check-mark { background: var(--blue-ink); }
.check-title { font-weight: 700; margin: 3px 0 2px; }
.check-text { margin: 0; overflow-wrap: anywhere; color: var(--mute); }
.steps-list { padding-left: 22px; }
.steps-list li { margin: 8px 0; padding-left: 4px; }
.help-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.glossary dt { font-weight: 700; margin-top: 12px; }
.glossary dd { margin: 2px 0 0; color: var(--mute); }
.ticks { list-style: none; padding: 0; }
.ticks li { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; }
.ticks .icon { color: var(--leaf-icon); margin-top: 3px; stroke-width: 2.6; }

/* ---- sign in ------------------------------------------------------------- */
.is-login .topbar { display: none; }
.login { display: grid; place-items: center; padding: 6vh 0 20px; }
.login-card { width: 100%; max-width: 440px; padding: 36px 36px 32px; text-align: left; }
.login-logo { width: 250px; height: auto; display: block; margin: 0 0 6px; }
.login-product { color: var(--mute); font-size: 15px; margin: 0 0 26px; }
.login-card h1 { font-size: 28px; margin: 0 0 8px; }
.login-card .lede { margin: 0 0 22px; font-size: 15px; }

/* ---- footer -------------------------------------------------------------- */
.foot { border-top: 1px solid var(--line); background: var(--surface); }
.foot-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 16px; padding-bottom: 18px; }
.foot-brand { display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--mute); flex-wrap: wrap; }
.foot-brand img { height: 18px; width: auto; }
.foot-links { display: flex; gap: 22px; font-size: 14px; }
.foot-links a { color: var(--mute); text-decoration: none; }
.foot-links a:hover { color: var(--forest); text-decoration: underline; }

/* ---- busy overlay -------------------------------------------------------- */
.busy { position: fixed; inset: 0; background: rgba(23, 33, 27, 0.4); display: grid; place-items: center; z-index: 100; padding: 20px; }
.busy-card { position: relative; background: var(--surface); color: var(--ink); border-radius: 18px; padding: 30px 32px 24px; width: 100%; max-width: 400px; text-align: center; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22); }
.busy-emblem { position: absolute; left: 50%; top: 36px; width: 38px; height: 38px; margin-left: -19px; }
.spinner { display: inline-block; width: 58px; height: 58px; border-radius: 50%; border: 4px solid var(--mint-2); border-top-color: var(--forest); animation: spin 0.9s linear infinite; }
.busy-title { font-weight: 700; font-size: 18px; margin: 14px 0 4px; }
.busy-text { color: var(--mute); font-size: 14.5px; min-height: 2.6em; }
.busy-time { color: var(--faint); font-size: 13px; margin: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } .week, .trip-gaps-chevron, .gap-details > summary .icon { transition: none; } }

/* ---- responsive ---------------------------------------------------------- */
@media (max-width: 1120px) {
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric:nth-child(4) { border-left: 0; }
  .metric:nth-child(n + 4) { border-top: 1px solid var(--line); }
}
/* The header gives way in steps as the window narrows. */
@media (max-width: 1100px) {
  .brand-divider, .brand-product { display: none; }
}
@media (max-width: 900px) {
  .mode { display: none; }
}
@media (max-width: 960px) {
  .layout-split { grid-template-columns: 1fr; }
  .apply { grid-template-columns: 1fr; }
  .apply-checks { padding-left: 0; }
  .apply-confirm { grid-column: 1; grid-row: auto; border-left: 0; padding-left: 0; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
  .help-grid { grid-template-columns: 1fr; }
  .mismatch-cols { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .topbar-inner { gap: 10px; padding: 0 16px; min-height: 62px; }
  .brand-divider, .brand-product, .mode { display: none; }
  .nav a { padding: 8px 11px; font-size: 14px; }
  .page { padding: 20px 16px 56px; }
  .foot-inner { padding-left: 16px; padding-right: 16px; }
  .page-head h1 { font-size: 26px; }
  .card { padding: 18px 16px; }
  .banner { flex-wrap: wrap; padding: 16px; }
  .banner-action { width: 100%; justify-content: center; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { padding: 16px; }
  .metric:nth-child(n) { border-left: 0; border-top: 1px solid var(--line); }
  .metric:nth-child(-n + 2) { border-top: 0; }
  .metric:nth-child(even) { border-left: 1px solid var(--line); }
  .metric-value { font-size: 25px; }
  .gaps { grid-template-columns: 1fr; }
  .sort, .sort select { width: 100%; }
  .head-actions { width: 100%; }
  .head-actions .button, .head-actions form { flex: 1 1 auto; }
  .head-actions form .button { width: 100%; }
  .tablist { gap: 22px; }
}
@media (max-width: 760px) {
  /* On a phone the pinned columns must leave room for the days. */
  table.sheet { --pin: 98px; }
  table.sheet col.col-head { width: 98px; }
  table.sheet col.col-slot { width: 140px; }
  table.people { --pin: 116px; }
  table.people col.col-head { width: 116px; }
  table.people col.col-half { width: 124px; }
  table.sheet th.corner, table.sheet th.rowhead, table.people th.corner, table.people th.rowhead { padding: 10px 10px; }
  .rowhead-label { font-size: 13px; }
  table.people th.total, table.people td.total { position: static; box-shadow: none; }
  .trip-people .scroll-shell::after { display: block; }
}
@media (max-width: 760px) {
  /* Plans and History read as one card per row on a phone, so the action
     button is never scrolled out of reach. */
  table.history thead { display: none; }
  table.history, table.history tbody, table.history tr, table.history td { display: block; width: 100%; }
  table.history tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  table.history tr:last-child { border-bottom: 0; }
  table.history td { padding: 2px 0; border: 0; text-align: left; white-space: normal; }
  table.history td:first-child { font-size: 16px; padding-bottom: 6px; }
  table.history td[data-label]::before { content: attr(data-label) ": "; color: var(--mute); }
  table.history td.row-action { padding-top: 10px; }
  table.history td.row-action:empty { display: none; }
  table.history td.row-action .button, table.history td.row-action form { width: 100%; justify-content: center; }
}
@media (max-width: 560px) {
  /* Phones: the menu takes its own row under the logo. */
  .topbar-inner { flex-wrap: wrap; row-gap: 2px; padding-bottom: 8px; }
  .account { margin-left: auto; }
  .nav { order: 3; width: 100%; margin-left: 0; justify-content: space-between; }
}
@media (max-width: 480px) {
  .brand-logo { display: none; }
  .brand-emblem { display: block; }
  .metric-icon { display: none; }
  .apply-row { flex-direction: column; }
  .apply-row input { flex: none; }
}
