/* KiloNord web app (dashboard.kilonord.ca): the pieces the website doesn't have.
 *
 * Loaded after site.css and built only from its tokens (--bg, --surface, --accent, --personal, --passenger, the
 * KNSpacing and KNRadius scales), so light and dark mode come for free. No inline styles anywhere: bar widths and
 * the route are SVG attributes drawn on the server. Category colours: business = --accent, personal = --personal,
 * passenger = --passenger, as in the app.
 */

/* ---------- Shell: header with the app navigation ---------- */

.app-header {
  row-gap: 0;
  border-bottom: 1px solid var(--separator);
  background: color-mix(in srgb, var(--surface) 55%, var(--bg));
}
.app-header .brand { margin-right: auto; }

.app-nav {
  display: flex;
  gap: var(--s-xs);
}
.site-header .app-nav a {
  position: relative;
  padding-inline: var(--s-m);
  border-radius: 999px;
}
.site-header .app-nav a:hover { background: var(--surface-2); }
.site-header .app-nav a[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-tint);
  text-decoration: none;
  font-weight: 600;
}

.signout-form { margin: 0; }

/* A button that reads like a quiet link (sign out in the header). */
.link-button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--s-xs);
  border: 0;
  background: none;
  color: var(--text-2);
  font: inherit;
  font-size: .9375rem;
  font-weight: 500;
  cursor: pointer;
}
.link-button:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

/* Phones: brand and sign out on the first line, the four sections as an even segmented bar under them. */
@media (max-width: 719px) {
  .app-header { padding-block: var(--s-s) var(--s-m); }
  .site-header .app-nav {
    order: 3;
    flex: 1 0 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    padding: 3px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--separator);
  }
  .site-header .app-nav a {
    justify-content: center;
    min-height: 40px;
    padding-inline: 2px;
    font-size: .9375rem;
  }
  .site-header .app-nav a[aria-current="page"] {
    background: var(--surface);
    box-shadow: var(--shadow);
  }
}
@media (max-width: 359px) {
  .site-header .app-nav a { font-size: .8125rem; }
}

.app-page { padding-top: var(--s-xxl); }

/* ---------- Page title row ---------- */

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-m) var(--s-xl);
  margin-bottom: var(--s-xl);
}
.page-head h1 {
  margin: 0;
  font-size: clamp(1.875rem, 1.5rem + 1.6vw, 2.5rem);
}
.page-head p { margin: var(--s-xs) 0 0; color: var(--text-2); }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin-bottom: var(--s-xs);
  font-weight: 600;
  text-decoration: none;
}
.back-link::before {
  content: "";
  width: 8px;
  height: 8px;
  border: solid currentColor;
  border-width: 0 0 2px 2px;
  transform: rotate(45deg);
}

/* ---------- Forms ---------- */

.field { display: grid; gap: 6px; min-width: 0; }
.field > span,
.field-label {
  color: var(--text-2);
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .02em;
}

.app select,
.app input[type="date"],
.app input[type="month"],
.app input[type="number"] {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--separator);
  border-radius: var(--r-s);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}
.app select {
  appearance: none;
  padding-right: 36px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-3) 50%),
    linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.app select:hover,
.app input:hover { border-color: var(--text-3); }

.button.small { min-height: 44px; padding: 8px 20px; }
.button-icon { display: inline-grid; place-items: center; }
.button-icon svg { width: 20px; height: 20px; }
.button.quiet {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--separator);
}
.button.quiet:hover { border-color: var(--text-3); filter: none; }
.button.danger { background: var(--warning-tint); color: var(--warning); }

/* Trip filters: a row of selects on wide screens, two columns on phones. */
.filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-m);
  align-items: end;
  margin-bottom: var(--s-xl);
  padding: var(--s-l);
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: var(--r-l);
  box-shadow: var(--shadow);
}
.filters .actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-s) var(--s-l);
}
.filters .actions .button { flex: 1 1 auto; }
.filters .actions a { font-size: .9375rem; }
@media (min-width: 720px) {
  .filters .actions .button { flex: 0 0 auto; }
}
@media (min-width: 960px) {
  .filters { grid-template-columns: 7rem repeat(3, minmax(0, 1fr)) auto; padding: var(--s-l) var(--s-xl); }
  .filters .actions { grid-column: auto; flex-wrap: nowrap; }
}

/* ---------- Numbers ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-m);
  margin-bottom: var(--s-xl);
}
.stat {
  min-width: 0;
  padding: var(--s-l) var(--s-xl);
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: var(--r-l);
  box-shadow: var(--shadow);
}
.stat-value,
.hero-number {
  display: block;
  font-family: var(--font-rounded);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.1;
  color: var(--text);
}
.stat-value { font-size: clamp(1.375rem, 1.1rem + 1.2vw, 2rem); }
.stat-value small,
.hero-number small {
  font-family: var(--font);
  font-size: .5em;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text-2);
}
.stat-value.accent,
.hero-number.accent { color: var(--accent); }
.stat-label { display: block; margin-top: 2px; color: var(--text-2); font-size: .9375rem; }
.stat-note { display: block; margin-top: var(--s-xs); color: var(--text-2); font-size: .8125rem; }
@media (max-width: 479px) {
  .stats { gap: var(--s-s); }
  .stat { padding: var(--s-m); border-radius: var(--r-m); }
  .stat-label { font-size: .8125rem; line-height: 1.3; }
}

/* ---------- Category chip ---------- */

.cat {
  --cat: var(--text-2);
  --cat-tint: var(--surface-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px 2px 8px;
  border-radius: 999px;
  background: var(--cat-tint);
  color: var(--cat);
  font-size: .8125rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.cat::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.cat.business { --cat: var(--accent); --cat-tint: var(--accent-tint); }
.cat.personal { --cat: var(--personal); --cat-tint: var(--personal-tint); }
.cat.passenger { --cat: var(--passenger); --cat-tint: var(--passenger-tint); }
.cat.unclassified { --cat: var(--warning); --cat-tint: var(--warning-tint); }

.pro-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  vertical-align: middle;
}
.pro-tag.free { background: var(--personal-tint); color: var(--personal); }

/* ---------- Trips list ---------- */

.trip-list {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: var(--r-l);
  box-shadow: var(--shadow);
  overflow: hidden;
  font-size: .9375rem;
  line-height: 1.4;
}
.trip-list caption { text-align: left; }
.trip-list th,
.trip-list td {
  padding: 12px var(--s-m);
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--separator);
}
.trip-list th:first-child,
.trip-list td:first-child { padding-left: var(--s-xl); }
.trip-list th:last-child,
.trip-list td:last-child { padding-right: var(--s-xl); }
.trip-list tbody tr:last-child > * { border-bottom: 0; }
.trip-list thead th {
  background: var(--surface-2);
  color: var(--text-2);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.trip-list tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.trip-list .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.trip-list .when strong { display: block; white-space: nowrap; }
.trip-list .when span { color: var(--text-2); font-size: .8125rem; white-space: nowrap; }
.trip-list .route a {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.trip-list .route a:hover { color: var(--accent); text-decoration: underline; }
.trip-list .route .to { display: block; font-weight: 500; color: var(--text-2); }
.trip-list .route .arrow { color: var(--text-3); }
.trip-list .purpose { color: var(--text-2); }
.trip-list .vehicle { color: var(--text-2); white-space: nowrap; }
.trip-list .km { font-weight: 600; }

/* Phones and small tablets: each trip becomes a card-like row. */
@media (max-width: 859px) {
  .trip-list,
  .trip-list tbody { display: block; }
  .trip-list thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .trip-list tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "when km"
      "route route"
      "meta meta";
    gap: 4px var(--s-m);
    padding: var(--s-m) var(--s-l);
    border-bottom: 1px solid var(--separator);
  }
  .trip-list tbody tr:last-child { border-bottom: 0; }
  .trip-list td,
  .trip-list td:first-child,
  .trip-list td:last-child { padding: 0; border: 0; }
  .trip-list .when { grid-area: when; }
  .trip-list .when strong,
  .trip-list .when span { display: inline; }
  .trip-list .when span::before { content: " · "; }
  .trip-list .km { grid-area: km; font-size: 1rem; }
  .trip-list .route { grid-area: route; }
  .trip-list .route .to { display: inline; }
  .trip-list .category,
  .trip-list .purpose,
  .trip-list .vehicle { grid-area: meta; }
  .trip-list .meta-row { display: contents; }
  .trip-list td.meta {
    grid-area: meta;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px var(--s-s);
    color: var(--text-2);
    font-size: .8125rem;
  }
}
/* On wide screens the combined meta cell is hidden and the separate columns show. */
@media (min-width: 860px) {
  .trip-list td.meta { display: none; }
}
@media (max-width: 859px) {
  .trip-list td.category,
  .trip-list td.purpose,
  .trip-list td.vehicle { display: none; }
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-m);
  margin-top: var(--s-l);
  color: var(--text-2);
  font-size: .9375rem;
}
.pager .button { min-height: 44px; padding: 8px 18px; }
.pager .disabled { visibility: hidden; }

/* ---------- Empty states ---------- */

.empty {
  display: grid;
  justify-items: center;
  gap: var(--s-s);
  padding: var(--s-huge) var(--s-xl);
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--separator);
  border-radius: var(--r-l);
}
.empty .icon { margin: 0 0 var(--s-s); }
.empty h2 { font-size: 1.25rem; margin: 0; }
.empty p { margin: 0; max-width: 30rem; color: var(--text-2); }
.empty .button { margin-top: var(--s-m); }

/* ---------- Trip detail ---------- */

.trip-layout {
  display: grid;
  gap: var(--s-xl);
  align-items: start;
}
@media (min-width: 900px) {
  .trip-layout { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--s-xxl); }
}

.trip-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s-s) var(--s-l);
  margin-bottom: var(--s-xl);
}
.trip-hero .hero-number { font-size: clamp(2.5rem, 2rem + 2vw, 3.5rem); }

.route-card {
  margin: 0;
  padding: var(--s-s);
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: var(--r-l);
  box-shadow: var(--shadow);
}
.route-card figcaption {
  padding: var(--s-s) var(--s-m) var(--s-xs);
  color: var(--text-2);
  font-size: .8125rem;
}
.route-map {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r-m);
  background: var(--surface-2);
  color: var(--accent);
}
.route-map .grid-line { stroke: var(--separator); }
.route-map .route-casing { stroke: var(--surface); }
.route-map .route-line { stroke: currentColor; }
.route-map .route-straight { stroke: var(--text-3); }
.route-map .route-start { fill: var(--surface); stroke: currentColor; }
.route-map .route-end { fill: currentColor; stroke: var(--surface); }
.route-map .route-label { fill: var(--text-2); font-family: var(--font); font-size: 13px; font-weight: 600; }
.route-map.business { color: var(--accent); }
.route-map.personal { color: var(--personal); }
.route-map.passenger { color: var(--passenger); }

/* Start → end with a dotted line between, like the app's route header. */
.stops {
  list-style: none;
  margin: 0;
  padding: 0;
}
.stops li {
  position: relative;
  padding: 0 0 var(--s-l) 28px;
}
.stops li:last-child { padding-bottom: 0; }
.stops li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: .35em;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  background: var(--surface);
}
.stops li:last-child::before { background: var(--accent); }
.stops li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 9px;
  top: calc(.35em + 16px);
  bottom: 4px;
  border-left: 2px dotted var(--text-3);
}
.stops strong { display: block; }
.stops span { color: var(--text-2); font-size: .9375rem; }

/* Key–value rows inside a card (trip details, account). */
.kv { margin: 0; }
.kv > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px var(--s-l);
  padding: var(--s-m) 0;
  border-top: 1px solid var(--separator);
}
.kv > div:first-child { border-top: 0; padding-top: 0; }
.kv > div:last-child { padding-bottom: 0; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; font-weight: 600; text-align: right; min-width: 0; }
.kv dd .muted { display: block; font-weight: 400; font-size: .875rem; }
.kv dd.text { flex: 1 1 100%; text-align: left; font-weight: 400; white-space: pre-line; }

.card-title {
  margin: 0 0 var(--s-m);
  color: var(--text-2);
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.stack { display: grid; gap: var(--s-l); align-content: start; }
.stack > .card { margin: 0; }
.app .card { padding: var(--s-xl); }

.expense-list { list-style: none; margin: 0; padding: 0; }
.expense-list li {
  display: flex;
  justify-content: space-between;
  gap: var(--s-l);
  padding: var(--s-s) 0;
  border-top: 1px solid var(--separator);
}
.expense-list li:first-child { border-top: 0; padding-top: 0; }
.expense-list .amount { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Summary ---------- */

.year-picker {
  display: flex;
  align-items: end;
  gap: var(--s-s);
}
.year-picker .field { width: 7.5rem; }

.summary-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--s-l) var(--s-3xl);
  margin-bottom: var(--s-xl);
}
.summary-hero .hero-number { font-size: clamp(3rem, 2rem + 5vw, 4.5rem); }
.summary-hero .secondary .hero-number { font-size: clamp(2rem, 1.6rem + 2vw, 2.75rem); }
.summary-hero .caption { display: block; margin-top: var(--s-xs); color: var(--text-2); }
.summary-hero-card { margin-bottom: var(--s-xl); }
.summary-hero-card h2 { font-size: 1.25rem; }
.basis {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: .8125rem;
}
.basis::before {
  content: "i";
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  font-style: normal;
  line-height: 1;
}

.summary-grid {
  display: grid;
  gap: var(--s-l);
  margin-bottom: var(--s-l);
}
@media (min-width: 900px) {
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-grid .wide { grid-column: 1 / -1; }
}
.summary-grid .stats { margin: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Tier bar: a native <progress> (its value is an attribute, so no inline style), drawn like TierProgressBar. */
.tier-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0 var(--s-m);
  margin-bottom: var(--s-s);
}
.tier-head h2 { margin: 0; font-size: 1.125rem; }
.tier-head span { color: var(--text-2); font-variant-numeric: tabular-nums; font-size: .9375rem; }
.tier-track { position: relative; padding-block: 4px; }
.tier-bar {
  display: block;
  width: 100%;
  height: 14px;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--accent);
  overflow: hidden;
}
.tier-bar::-webkit-progress-bar { background: var(--surface-2); border-radius: 999px; }
.tier-bar::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
.tier-bar::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
/* Past the tier, the marker sits at 75 % (TierProgressBar.overflowMarker). */
.tier-track.passed::after {
  content: "";
  position: absolute;
  left: 75%;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  border-radius: 1px;
  background: color-mix(in srgb, var(--text) 55%, transparent);
}
.tier-text { margin: var(--s-s) 0 var(--s-xs); color: var(--text-2); font-size: .9375rem; }
.tier-rates {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0 var(--s-l);
  margin: 0;
  color: var(--text-2);
  font-size: .8125rem;
  font-variant-numeric: tabular-nums;
}

/* Monthly bars. */
.chart-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-xs) var(--s-l);
  margin-bottom: var(--s-m);
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-xs) var(--s-l);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: .875rem;
  font-weight: 600;
}
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend li::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--accent); }
.legend li.personal::before { background: var(--personal); opacity: .55; }
.chart-unit { color: var(--text-2); font-size: .8125rem; }
.month-chart { --scale-w: 44px; }
.month-chart .plot {
  position: relative;
  height: 180px;
  margin: 8px var(--scale-w) 0 0;
}
.month-chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.month-chart .bar-business { fill: var(--accent); }
.month-chart .bar-personal { fill: var(--personal); opacity: .45; }
.month-chart .faded { opacity: .75; }
.month-chart .axis { stroke: var(--separator); }
.month-chart .gv {
  position: absolute;
  right: calc(-1 * var(--scale-w));
  width: calc(var(--scale-w) - 6px);
  transform: translateY(-50%);
  color: var(--text-3);
  font-size: .75rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.month-chart .gv.top { top: 0; }
.month-chart .gv.mid { top: 50%; }
.month-chart .gv.zero { top: 100%; }
.month-axis {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  margin: 6px var(--scale-w) 0 0;
  padding: 0;
  list-style: none;
  color: var(--text-2);
  font-size: .8125rem;
  text-align: center;
}
.month-axis .current { color: var(--text); font-weight: 700; }
@media (max-width: 479px) {
  .month-chart { --scale-w: 36px; }
  .month-chart .plot { height: 150px; }
}

.month-table { margin-top: var(--s-m); }
.month-table summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
  font-size: .9375rem;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.month-table table { width: 100%; border-collapse: collapse; font-size: .9375rem; font-variant-numeric: tabular-nums; }
.month-table th,
.month-table td { padding: 6px var(--s-s); border-bottom: 1px solid var(--separator); text-align: right; }
.month-table th:first-child,
.month-table td:first-child { text-align: left; padding-left: 0; }
.month-table td:last-child,
.month-table th:last-child { padding-right: 0; }
.month-table thead th { color: var(--text-2); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }

.vehicle-use { list-style: none; margin: 0; padding: 0; }
.vehicle-use li { padding: var(--s-m) 0; border-top: 1px solid var(--separator); }
.vehicle-use li:first-child { border-top: 0; padding-top: 0; }
.vehicle-use li:last-child { padding-bottom: 0; }
.vehicle-use .line { display: flex; justify-content: space-between; gap: var(--s-l); font-size: 1.0625rem; }
.vehicle-use .pct { color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.vehicle-use .detail { color: var(--text-2); font-size: .9375rem; }

.fine {
  margin-top: var(--s-xl);
  color: var(--text-2);
  font-size: .875rem;
  max-width: 46rem;
}
.fine p { margin-bottom: var(--s-s); }

/* ---------- Reports ---------- */

.report-layout {
  display: grid;
  gap: var(--s-xl);
  align-items: start;
}
/* Phones: a free user reads what's free before the forms. */
.report-layout > .plan-card.free { order: -1; }
@media (min-width: 960px) {
  .report-layout { grid-template-columns: minmax(0, 1fr) 20rem; gap: var(--s-xxl); }
  .report-layout > aside { position: sticky; top: var(--s-xl); }
  .report-layout > .plan-card.free { order: 0; }
}
.report-form { display: grid; gap: var(--s-l); }
.report-form fieldset {
  min-width: 0;
  margin: 0;
  padding: var(--s-xl);
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: var(--r-l);
  box-shadow: var(--shadow);
}
.report-form legend {
  float: left;
  width: 100%;
  margin-bottom: var(--s-m);
  padding: 0;
  font-weight: 700;
  font-size: 1.0625rem;
}
.report-form legend + * { clear: both; }
.report-form .hint { margin: 0 0 var(--s-m); color: var(--text-2); font-size: .9375rem; }
.report-form + .report-form { margin-top: var(--s-xl); padding-top: var(--s-xl); border-top: 1px solid var(--separator); }
.section-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-s);
  margin: 0;
  font-size: 1.375rem;
}
.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: var(--s-m);
}
.checks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-s);
  margin-bottom: var(--s-l);
}
.check {
  display: inline-flex;
  align-items: center;
  gap: var(--s-s);
  min-height: 44px;
  padding: 4px 14px 4px 12px;
  border: 1px solid var(--separator);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
}
.check:has(input:checked) { border-color: var(--accent); }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.choice input[type="checkbox"] { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }

/* Radio choices as tappable rows. */
.choices { display: grid; gap: var(--s-s); }
.choices.cols { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: var(--s-m);
  row-gap: var(--s-s);
  align-items: center;
  padding: var(--s-m) var(--s-l);
  border: 1px solid var(--separator);
  border-radius: var(--r-m);
  background: var(--surface);
}
.choice > label { cursor: pointer; }
.choice:hover { border-color: var(--text-3); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); }
.choice:has(input:disabled) { cursor: not-allowed; opacity: .6; }
.choice input[type="radio"] {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--accent);
}
.choice .label { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s-s); font-weight: 600; }
.choice .sub { display: block; color: var(--text-2); font-size: .8125rem; font-weight: 400; }
.choice .extra {
  grid-column: 2;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: var(--s-s);
}
.report-form .submit-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-m) var(--s-l);
}
.report-form .submit-row .button { min-width: 12rem; }
.report-form .submit-row p { margin: 0; color: var(--text-2); font-size: .875rem; }

.plan-card {
  padding: var(--s-xxl);
  border-radius: var(--r-l);
  background: var(--accent-tint);
}
.plan-card h2 { font-size: 1.25rem; margin-bottom: var(--s-s); }
.plan-card p { color: var(--text-2); }
.plan-card .checklist li { font-size: .9375rem; }
.plan-card > :last-child { margin-bottom: 0; }
.plan-card.free { background: var(--surface); border: 1px solid var(--separator); }

.inline-notice {
  display: flex;
  gap: var(--s-m);
  align-items: flex-start;
  padding: var(--s-m) var(--s-l);
  border-radius: var(--r-m);
  background: var(--warning-tint);
  color: var(--text);
  font-size: .9375rem;
}
.inline-notice > :last-child { margin-bottom: 0; }

/* ---------- Account ---------- */

.account-grid {
  display: grid;
  gap: var(--s-l);
  max-width: 46rem;
}
.account-grid .actions { display: flex; flex-wrap: wrap; gap: var(--s-m); margin-top: var(--s-l); }
.account-grid form { margin: 0; }
.account-grid h2:not(.card-title) { font-size: 1.25rem; margin-bottom: var(--s-s); }
.account-grid .card p { color: var(--text-2); }
.steps-inline { padding-left: 1.3em; color: var(--text-2); }
.steps-inline li { margin-bottom: var(--s-xs); }

/* ---------- Errors and sign-in (also used by the platform pages) ---------- */

.center-card,
.message,
.signin {
  max-width: 34rem;
  margin: var(--s-3xl) auto;
  text-align: center;
}
.center-card .icon { margin-inline: auto; }
.center-card .button { margin-top: var(--s-s); }
.center-card h1,
.message h1,
.signin h1 { font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.375rem); }
.message p,
.signin p { color: var(--text-2); }
.message,
.signin {
  padding: var(--s-3xl) var(--s-xxl);
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
}
.message > :last-child,
.signin > :last-child { margin-bottom: 0; }
.signin::before {
  /* the app icon above the heading, like the website's closing section */
  content: "";
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 auto var(--s-xl);
  border-radius: 17px;
  background: url("/assets/icon.png") center / cover;
  box-shadow: var(--shadow-lifted);
}

/* Sign in with Apple, per Apple's guidelines: black, the Apple logo, "Sign in with Apple", rounded rectangle. */
.apple-signin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 15rem;
  min-height: 50px;
  padding: 10px 28px;
  border-radius: 12px;
  background: #000;
  color: #fff;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -.01em;
  text-decoration: none;
}
.apple-signin:hover { text-decoration: none; background: #1d1d1f; }
.apple-signin-logo { width: 19px; height: 19px; flex: none; margin-top: -3px; }
@media (prefers-color-scheme: dark) {
  .apple-signin { box-shadow: 0 0 0 1px #3a3a3c; }
}
@media (max-width: 380px) {
  .message,
  .signin { padding: var(--s-xxl) var(--s-l); }
  .apple-signin { min-width: 0; width: 100%; }
}

/* ---------- Small screens ---------- */

@media (max-width: 380px) {
  .app .card { padding: var(--s-l); }
  .filters { padding: var(--s-m); }
  .report-form fieldset { padding: var(--s-l); }
  .choice { padding: var(--s-m); }
  .plan-card { padding: var(--s-xl); }
}

@media print {
  .app-nav, .signout-form, .filters, .pager { display: none; }
  .trip-list { box-shadow: none; }
}

.card-note { margin: var(--s-m) 0 0; color: var(--text-2); font-size: .875rem; }
.kv dd { overflow-wrap: anywhere; }
