/* Ride Weather. Paper and ink, one yellow, big numerals. Verdicts always carry a word and an icon, never colour alone.
   Same family as the other cyclingtools.cc apps. */
:root {
  --ink: #101418; --paper: #f4f2ec; --surface: #fff; --raised: #fbfaf7; --line: #ddd9cf; --line-strong: #bdb8aa;
  --muted: #59616a; --yellow: #ffd60a; --yellow-ink: #3a2f00; --route: #d6006f; --focus: #1a5fd0;
  --go: #17794a; --go-bg: #dff3e7; --care: #8a5300; --care-bg: #fff0c2; --rethink: #a13d00; --rethink-bg: #ffe3cf;
  --stop: #b3261e; --stop-bg: #fde2df; --unk-bg: #e8ebef;
  --font: "Bahnschrift", "Segoe UI Variable Text", "Segoe UI", "SF Pro Text", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Bahnschrift", "DIN Alternate", "Roboto Condensed", "Franklin Gothic Medium", "Arial Narrow", system-ui, sans-serif;
  --r: 14px; --r-sm: 10px; --shadow: 0 1px 2px rgba(16,20,24,.06), 0 4px 14px rgba(16,20,24,.05);
}
@media (prefers-color-scheme: dark) {
  :root { --ink: #f1efe8; --paper: #0e1114; --surface: #171b20; --raised: #1c2127; --line: #2b3239; --line-strong: #46505a;
          --muted: #a2abb4; --route: #ff4fa3; --focus: #7fb0ff; --go: #5fd491; --go-bg: #12301f; --care: #ffc857; --care-bg: #352a0a;
          --rethink: #ffa466; --rethink-bg: #3a2010; --stop: #ff8a80; --stop-bg: #3a1714; --unk-bg: #232a31; --shadow: none; }
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--muted); } .small { font-size: .875rem; } .right { text-align: right; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.01em; line-height: 1.15; margin: 0 0 8px; }
h1 { font-size: clamp(1.6rem, 1.2rem + 2vw, 2.3rem); } h2 { font-size: 1.2rem; } h3 { font-size: 1rem; }
.eyebrow { margin: 0 0 4px; font: 700 .72rem/1 var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.site-head { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.brand { font: 700 1.15rem var(--display); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.brand i { width: 22px; height: 22px; border-radius: 50%; background: var(--yellow); border: 2px solid var(--ink); display: inline-block; }
.toggle { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; }
.toggle a { padding: 0 14px; min-height: 40px; display: inline-flex; align-items: center; text-decoration: none; font-weight: 700; font-size: .9rem; }
.toggle a[aria-current="true"] { background: var(--ink); color: var(--paper); }
main { padding: 20px 0 120px; }
.site-foot { border-top: 1px solid var(--line); padding: 20px 0 100px; color: var(--muted); font-size: .875rem; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 8px; }
.site-foot a { min-height: 32px; display: inline-flex; align-items: center; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.card > :last-child { margin-bottom: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px; border: 1px solid var(--ink);
  border-radius: var(--r-sm); background: var(--ink); color: var(--paper); font: 700 1rem var(--font); cursor: pointer; text-decoration: none; }
.btn:hover { opacity: .9; } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.alt { background: var(--surface); color: var(--ink); } .btn.block { width: 100%; } .btn.small { min-height: 44px; padding: 0 14px; font-size: .9rem; }
.btn.danger { background: transparent; color: var(--stop); border-color: var(--line-strong); }
.chip { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 16px; border: 1px solid var(--line-strong);
  border-radius: 999px; background: var(--surface); color: var(--ink); font: 600 .95rem var(--font); cursor: pointer; text-decoration: none; }
.chip[aria-pressed="true"], .chip[aria-current="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.scroll-x { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.scroll-x > * { flex: none; }
input[type=text], input[type=number], input[type=date], select { min-height: 48px; padding: 0 12px; border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font: 1rem var(--font); }
label { font-weight: 600; font-size: .9rem; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; } .row.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.err { color: var(--stop); font-weight: 600; } .ok { color: var(--go); font-weight: 600; }
.notice { border: 1px solid var(--line-strong); background: var(--raised); border-radius: var(--r-sm); padding: 12px 14px; font-size: .92rem; }
.notice.warn { background: var(--care-bg); border-color: var(--care); }

/* home */
.drop { border: 2px dashed var(--line-strong); border-radius: var(--r); padding: 28px 18px; text-align: center; background: var(--surface); }
.drop.over { border-color: var(--ink); background: var(--raised); }
.drop .btn { min-height: 60px; font-size: 1.1rem; padding: 0 30px; }
.spin { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.spin:first-child { border-top: 0; }
.spin h3 { margin: 0; } .spin .meta { color: var(--muted); font-size: .9rem; grid-column: 1; }
.spin .actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }

/* map */
.map { height: 300px; border-radius: var(--r); border: 1px solid var(--line); overflow: hidden; background: var(--unk-bg); }
.map.tall { height: 360px; }
.maplibregl-popup-content { color: #101418; font: 14px/1.4 var(--font); }
.pin { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #fff; display: grid; place-items: center; font: 800 14px var(--font);
  color: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.5); cursor: pointer; padding: 0; }
.pin.high, .pin.red { background: #b3261e; } .pin.medium, .pin.orange, .pin.amber { background: #c45800; } .pin.low, .pin.yellow { background: #8a6d00; }

/* time strip */
.strip { position: relative; display: flex; align-items: flex-end; gap: 3px; overflow-x: auto; padding: 8px 2px 4px; min-height: 130px; scrollbar-width: thin; }
.slot { flex: none; width: 48px; min-height: 48px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px;
  border: 0; background: transparent; padding: 0; cursor: pointer; color: var(--ink); font: 600 .72rem var(--font); }
.slot .bar { width: 100%; border-radius: 6px 6px 2px 2px; min-height: 8px; border: 2px solid transparent; }
.slot .num { font-weight: 800; font-size: .8rem; }
.slot[aria-pressed="true"] .bar { border-color: var(--ink); outline: 2px solid var(--paper); }
.slot[aria-pressed="true"] { outline: 0; }
.slot.dark { opacity: .45; } .slot.dark .bar { background-image: repeating-linear-gradient(45deg, rgba(0,0,0,.25) 0 4px, transparent 4px 8px); }
.slot .best { font-size: .65rem; color: var(--go); font-weight: 800; }
.mark { flex: none; align-self: stretch; width: 44px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; font-size: .66rem;
  color: var(--muted); border-left: 2px dotted var(--line-strong); padding-left: 2px; text-align: center; line-height: 1.15; }
.v-go { background: var(--go); } .v-care { background: #d9a900; } .v-rethink { background: #d9660b; } .v-stop { background: var(--stop); }

/* verdict */
.verdict { border-radius: var(--r); padding: 18px; border: 2px solid; display: grid; grid-template-columns: auto 1fr auto; gap: 4px 14px; align-items: center; }
.verdict .icon { font-size: 2.4rem; line-height: 1; } .verdict .word { font: 800 clamp(1.8rem, 1.2rem + 3vw, 2.6rem)/1 var(--display); }
.verdict .score { font: 800 2.4rem/1 var(--display); text-align: right; } .verdict .score small { display: block; font: 600 .7rem var(--font); }
.verdict .sub { grid-column: 1 / -1; font-size: .95rem; }
.verdict.go { background: var(--go-bg); border-color: var(--go); color: var(--go); }
.verdict.care { background: var(--care-bg); border-color: var(--care); color: var(--care); }
.verdict.rethink { background: var(--rethink-bg); border-color: var(--rethink); color: var(--rethink); }
.verdict.stop { background: var(--stop-bg); border-color: var(--stop); color: var(--stop); }
.verdict .sub, .verdict .sub a { color: var(--ink); }
.limits { margin: 10px 0 0; padding-left: 20px; } .limits li { margin: 2px 0; }

.warn-banner { border: 2px solid; border-radius: var(--r); padding: 12px 14px; margin-bottom: 12px; background: var(--surface); }
.warn-banner.red { border-color: var(--stop); background: var(--stop-bg); } .warn-banner.orange, .warn-banner.amber { border-color: var(--rethink); background: var(--rethink-bg); }
.warn-banner.yellow { border-color: var(--care); background: var(--care-bg); }
.warn-banner .lvl { font: 800 .72rem var(--font); letter-spacing: .1em; text-transform: uppercase; }
.warn-banner details { margin-top: 6px; } .warn-banner summary { cursor: pointer; min-height: 32px; font-weight: 600; }
.warn-banner pre { white-space: pre-wrap; font: inherit; margin: 6px 0 0; }

.points { margin: 0; padding: 0; list-style: none; }
.points li { padding: 10px 0 10px 28px; position: relative; font-size: 1.05rem; border-top: 1px solid var(--line); }
.points li:first-child { border-top: 0; } .points li::before { content: ""; position: absolute; left: 4px; top: 18px; width: 10px; height: 10px; border-radius: 50%; background: var(--yellow); border: 2px solid var(--ink); }
.headline { font: 700 1.3rem/1.2 var(--display); margin-bottom: 6px; }

.chart { width: 100%; height: auto; display: block; } .chart text { fill: var(--muted); font: 11px var(--font); }
table.data { width: 100%; border-collapse: collapse; font-size: .85rem; } table.data th, table.data td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; }
table.data th:first-child, table.data td:first-child { text-align: left; } .tablewrap { overflow-x: auto; max-height: 340px; }
.kit li { margin: 4px 0; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .8rem; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }

.sharebar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); z-index: 20; }
.sharebar .wrap { display: flex; gap: 10px; padding: 0; } .sharebar .btn { flex: 1; }
dialog { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; background: var(--surface); color: var(--ink); max-width: min(94vw, 460px); }
dialog::backdrop { background: rgba(0,0,0,.55); } dialog img { width: 100%; height: auto; border-radius: 8px; display: block; }
.skeleton { height: 120px; border-radius: var(--r); background: linear-gradient(90deg, var(--unk-bg), var(--raised), var(--unk-bg)); background-size: 200% 100%; animation: sh 1.4s infinite; }
@keyframes sh { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media (min-width: 720px) { .map { height: 380px; } .map.tall { height: 440px; } }
