:root {
  color-scheme: dark light;
  --paper: #16202A;
  --surface: #171f24;
  --surface-2: #1e282e;
  --ink: #F2EFE8;
  --ink-2: #bcc8c9;
  --muted: #8b9b9f;
  --rule: #2c3940;
  --cold: #79bcd6;
  --warm: #ef987e;
  --flag: #e59aa6;
  --radius: 12px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: light) {
  :root {
    --paper: #F2EFE8; --surface: #ffffff; --surface-2: #eef1ef;
    --ink: #16202A; --ink-2: #3d4a51; --muted: #64747b; --rule: #d5dcd9;
    --cold: #24657f; --warm: #a4391b; --flag: #8d2f3f;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); }
body { font-size: 17px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
.page {
  max-width: 34rem; margin: 0 auto;
  padding: max(1rem, env(safe-area-inset-top)) 1rem calc(3rem + env(safe-area-inset-bottom));
}
h1 { font-size: 1.55rem; letter-spacing: -0.02em; margin: 0.6rem 0 1.1rem; }
.tagline { color: var(--ink-2); margin: -0.75rem 0 1.1rem; }
h2 { font-size: 1.1rem; margin: 0 0 0.4rem; }
h3 { font-size: 0.76rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.6rem; font-weight: 600; }
p { margin: 0 0 0.7rem; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

.card {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 1rem; margin-bottom: 0.85rem;
}
.field { display: block; margin-bottom: 0.85rem; }
.field[hidden] { display: none; }
.field > span { display: block; font-size: 0.85rem; color: var(--ink-2); margin-bottom: 0.3rem; }
.field small { display: block; margin-top: 0.3rem; font-size: 0.8rem; }
.location-field { border: 0; padding: 0; min-width: 0; }
.location-field legend { display: block; width: 100%; font-size: 0.85rem; color: var(--ink-2); margin-bottom: 0.3rem; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }

select, input[type="datetime-local"], input[type="number"], input[type="text"], input[type="search"], input[type="password"], textarea {
  width: 100%; padding: 0.7rem 0.6rem; font: inherit; font-size: 1rem;
  color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--rule); border-radius: 9px;
}
textarea { min-height: 5rem; resize: vertical; }
input[type="range"] { width: 100%; accent-color: var(--cold); }
output { color: var(--cold); font-variant-numeric: tabular-nums; }

button { font: inherit; cursor: pointer; }
.primary {
  width: 100%; padding: 0.95rem; font-size: 1.05rem; font-weight: 600;
  color: var(--paper); background: var(--ink); border: 0; border-radius: 10px;
}
.primary:disabled { opacity: 0.55; }
.general-feedback-button {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 0.65rem 0.9rem; margin-bottom: 0.6rem;
  color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--rule); border-radius: 9px; text-decoration: none;
}
.general-feedback-button:hover { text-decoration: underline; }
.general-feedback-button:focus-visible { outline: 2px solid var(--cold); outline-offset: 3px; }
.general-feedback-address { overflow-wrap: anywhere; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: 0.5rem 0; }
.danger { color: var(--flag); display: block; }
.check { display: flex; gap: 0.55rem; align-items: flex-start; margin: 0.8rem 0; font-size: 0.9rem; }
.check input { margin-top: 0.3rem; }
.recovery-code { overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.option {
  display: block; width: 100%; text-align: left; padding: 0.75rem 0.85rem;
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--rule); border-radius: 9px; margin-bottom: 0.4rem;
}
.stack { margin: 0.6rem 0; }
.location-search { display: grid; grid-template-columns: 1fr auto; gap: 0.45rem; align-items: end; }
.location-search .field { margin: 0; }
.location-search button { min-height: 2.9rem; padding: 0.65rem 0.85rem; }
.location-status { margin: 0.55rem 0; font-size: 0.88rem; }
.location-list { list-style: none; padding: 0; margin: 0.5rem 0; }
.location-result { width: 100%; text-align: left; margin-bottom: 0.45rem; padding: 0.7rem; color: var(--ink); background: var(--surface-2); border: 1px solid var(--rule); border-radius: 9px; }
.location-result strong, .selected-location strong { display: block; }
.location-detail { display: block; margin-top: 0.15rem; color: var(--muted); font-size: 0.82rem; line-height: 1.35; overflow-wrap: anywhere; }
.location-confirm, .selected-location { padding: 0.75rem; margin: 0.55rem 0; border: 1px solid var(--rule); border-radius: 9px; background: var(--surface-2); }
.location-confirm .primary { margin-top: 0.6rem; }
.recent-location { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.45rem; align-items: stretch; margin-bottom: 0.45rem; }
.recent-location .location-result { margin: 0; }
.recent-location .link { padding: 0.5rem; }
.location-attribution { margin-top: 0.7rem; }
@media (max-width: 22rem) {
  .location-search { grid-template-columns: 1fr; }
  .location-search button { width: 100%; }
}
/* Five equal columns, deliberately. "Just right" must be exactly as easy to
   tap as the other four, or F overshoots: riders report when something is
   wrong and stay quiet when it is fine. A wrapped or narrower neutral option
   is a thumb on the scale. */
.slider { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.35rem; margin-bottom: 0.8rem; }
.chip {
  padding: 0.6rem 0.2rem; font-size: 0.78rem; line-height: 1.2; text-align: center;
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--rule); border-radius: 999px;
}
.chip.on { background: var(--cold); border-color: var(--cold); color: var(--paper); }
.label { font-size: 0.85rem; color: var(--ink-2); margin-bottom: 0.35rem; }
.done { color: var(--cold); }

.advanced summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; padding: 0.4rem 0 0.7rem; }

.temps { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.25rem; }
.temps span { display: block; }
.note {
  margin: 0.7rem 0 0; padding: 0.6rem 0.75rem;
  background: var(--surface-2); border-left: 3px solid var(--warm);
  border-radius: 0 8px 8px 0; font-size: 0.92rem;
}
.kit { list-style: none; margin: 0; padding: 0; }
.kit li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem;
  padding: 0.5rem 0; border-bottom: 1px solid var(--rule);
}
.kit li:last-child { border-bottom: 0; }
.kit li.kit-optional { align-items: flex-start; flex-direction: column; gap: 0.05rem; }
.kit li.kit-optional .tag { white-space: normal; }
.name { font-size: 1rem; }
.tag { font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; white-space: nowrap; }
.tag-wear { color: var(--cold); }
.tag-wearremovelater { color: var(--warm); }
.tag-optional { color: var(--muted); }
.tag-carry { color: var(--warm); }

.foot dt { font-weight: 600; font-size: 0.9rem; margin-top: 0.6rem; }
.foot dd { margin: 0.15rem 0 0; font-size: 0.88rem; color: var(--ink-2); }
.attribution { margin-top: 1rem; }
.failure { border-left: 3px solid var(--flag); }
.release-identity { margin: 1.2rem 0 0; color: var(--muted); font-size: 0.72rem; text-align: center; }

/* CT02-WP05: images support the stored text; responsive labels stay readable. */
.outfit-art { margin: 0.75rem 0; padding: 0.5rem; background: #f6f5f1; color: #30332f; border-radius: 12px; }
.outfit-art img { display: block; width: 100%; height: auto; object-fit: contain; }
.board-canvas { position: relative; width: 100%; overflow: hidden; }
.outfit-board .board-canvas img { position: absolute; display: block; max-width: none; object-fit: contain; }
.art-fallback, .kit .name { font-size: 1rem; line-height: 1.5; overflow-wrap: anywhere; }
.result-head > h3, .group > h3, .nutrition-coming-soon > h3, .foot > h3 { color: var(--ink); font-size: 1.15rem; font-weight: 700; letter-spacing: 0; text-transform: none; margin-bottom: 0.85rem; }
.kit li, .kit li.kit-optional { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 0.75rem; }
/* Give the full Optional instruction its natural width, with room for the garment.
   At narrow widths or enlarged text it may wrap rather than overflow or shrink. */
.kit li.kit-optional { grid-template-columns: minmax(0, 1fr) fit-content(calc(100% - 4rem)); gap: 0.5rem; }
.kit .tag { white-space: normal; text-align: right; font-size: 1rem; font-weight: 500; text-transform: none; letter-spacing: 0; overflow-wrap: anywhere; }
.weather-condition { display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem 1rem; }
.weather-icon { display: block; flex: 0 0 auto; font-size: 7.2rem; line-height: 1.2; }
.weather-condition-text { flex: 1 1 10rem; min-width: 0; overflow-wrap: anywhere; }
.weather-fact { margin: 0.35rem 0; }
.nutrition-coming-soon { border-left: 4px solid #78816c; }
#planned-rides .option { width: 100%; text-align: left; margin-bottom: 0.5rem; }

/* Approved E identity; wordmark paths stay byte-identical to asset pack 0.1.1. */
.brand-heading { margin: .6rem 0 1.5rem; }
.brand-logo { display: block; width: auto; height: 48px; max-width: 100%; }
.brand-heading picture { display: block; }
:focus-visible { outline: 2px solid var(--cold); outline-offset: 3px; }
input[type="email"] { width: 100%; padding: .7rem .6rem; font: inherit; color: var(--ink); background: var(--surface-2); border: 1px solid var(--rule); border-radius: 9px; }
#ride-action-status:empty { display: none; }

/* WP10: feedback first in both document and visual order. */
.feedback-due { border-left: 4px solid var(--cold); }
.feedback-empty { color: var(--ink-2); margin-bottom: 1rem; }
.ride-card { padding: .8rem 0; border-top: 1px solid var(--rule); }
.ride-card:first-of-type { border-top: 0; }
.ride-card:last-child { padding-bottom: 0; }
.ride-card .ride-title { color: var(--ink); font-size: 1rem; letter-spacing: 0; text-transform: none; margin: 0 0 .2rem; overflow-wrap: anywhere; }
.ride-time { overflow-wrap: anywhere; }
.ride-card button { min-height: 44px; overflow-wrap: anywhere; }
.ride-card .primary { margin-bottom: .5rem; }
#feedback .link { min-height: 44px; padding: .5rem .75rem; }
#feedback .chip { min-height: 44px; }
#form > h2 { margin-bottom: 1rem; }
#result, #feedback { scroll-margin-top: 1rem; }

/* WP10 correction: history cannot displace planning. Native disclosure controls. */
[hidden] { display: none !important; }
.page-nav { display: flex; flex-wrap: wrap; gap: 0.2rem 1rem; margin-bottom: 1rem; font-size: .85rem; }
.page-nav a, #privacy > a, #limitations > a { display: inline-flex; align-items: center; min-height: 44px; }
#planning-heading { font-size: 1.6rem; font-weight: 750; letter-spacing: -.02em; }
#form { border-top: 4px solid var(--cold); scroll-margin-top: 1rem; }
#past-history > summary { font-size: 1.1rem; font-weight: 650; }
.more-feedback > summary, #past-history > summary { min-height: 44px; padding: .5rem 0; cursor: pointer; }
#past-history .card { border: 0; padding: .6rem 0; }
#privacy-heading, #limitations-heading { margin-top: 1rem; }
