/* The Weather for Tomorrow
   Design language after Flighty: white page, soft grey cards, one clear status
   colour per card, quiet dashed chart grids, departure-board rows.
   Motion after Emil Kowalski: short, ease-out, transform/opacity only. */

:root {
  color-scheme: light;
  --bg: #fff;
  --surface: #FAFAFA;
  --surface-2: #F4F4F5;
  --line: #EBEBEB;
  --line-2: #E4E4E7;
  --ink: #0A0A0A;
  --ink-2: #3C3C43;
  --muted: rgba(60, 60, 67, .62);
  --faint: rgba(60, 60, 67, .32);

  --blue: #007AFF;
  --blue-ink: #175CD3;
  --rain: #2E90FA;
  --green: #039855;
  --green-2: #12B76A;
  --orange: #F79009;
  --amber: #FDB022;
  --red: #D92D20;

  --r-card: 16px;
  --r-ctl: 12px;
  --pad: 20px;

  --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --shadow-pop: 0 1px 2px rgba(16, 24, 40, .06), 0 16px 40px -12px rgba(16, 24, 40, .22);
  --shadow-lift: 0 1px 2px rgba(16, 24, 40, .05), 0 10px 28px -12px rgba(16, 24, 40, .18);
  --header-h: 112px;
}
@media (min-width: 760px) {
  :root { --pad: 28px; --header-h: 68px; }
}

/* ---------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img, svg { display: block; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
[id] { scroll-margin-top: calc(var(--header-h) + 12px); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
input:focus-visible { outline: none; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 760px) { .wrap { padding: 0 24px; } }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px; font-weight: 600; }
.skip:focus { left: 16px; }

.ui-i { width: 18px; height: 18px; flex: none; }
.ui-i.tiny { width: 14px; height: 14px; }
.wi { width: 32px; height: 32px; flex: none; }
.big, .b-temp, .pc-hi, .pc-lo, .d-lo, .d-hi, .mini b, .chip, time { font-variant-numeric: tabular-nums; }

/* ---------- header */
.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.top-in { max-width: 1120px; margin: 0 auto; padding: 10px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.brand { display: flex; align-items: center; gap: 10px; font: 700 17px/1 var(--display); letter-spacing: -.2px; white-space: nowrap; }
.logo { width: 32px; height: 32px; }
.brand-name span { color: var(--muted); }
.top-cta { margin-left: auto; }
.top .search { order: 3; flex: 1 0 100%; }
@media (max-width: 759px) {
  /* Two header rows are too tall to keep pinned on a phone */
  .top { position: relative; }
  :root { --header-h: 0px; }
}
@media (max-width: 519px) {
  .top-cta { width: 36px; padding: 0; justify-content: center; }
  .top-cta span { display: none; }
}
@media (min-width: 520px) { .top-cta .ui-i { display: none; } }
@media (min-width: 760px) {
  .top-in { padding: 14px 24px; flex-wrap: nowrap; }
  .top .search { order: 0; flex: 1 1 auto; max-width: 460px; margin-left: 12px; }
}

/* ---------- search (combobox) */
.search { position: relative; }
.search input {
  width: 100%; height: 40px; padding: 0 52px 0 40px;
  border: 1px solid transparent; border-radius: var(--r-ctl);
  background: var(--surface-2); color: var(--ink);
  font: 500 16px/1 var(--font); /* 16px stops iOS zooming on focus */
  -webkit-appearance: none; appearance: none;
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search input:focus { background: #fff; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0, 122, 255, .12); }
.search .search-i { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font: 600 12px/1 var(--mono); color: var(--muted);
  padding: 4px 6px; border: 1px solid var(--line-2); border-radius: 6px; background: #fff; pointer-events: none;
}
.search input:focus ~ kbd, .search input:not(:placeholder-shown) ~ kbd { display: none; }
@media (hover: none) { .search kbd { display: none; } }
.search.big input { height: 50px; border-radius: 14px; background: #fff; border-color: var(--line-2); padding-left: 44px; }
.search.big .search-i { left: 14px; }
.search.add input { background: #fff; border-color: var(--line-2); border-style: dashed; }
.search.add input:focus { border-style: solid; }

.results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30;
  margin: 0; padding: 6px; list-style: none;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-pop);
  max-height: min(60vh, 420px); overflow-y: auto; overscroll-behavior: contain;
}
.results a { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 10px; }
.results b { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.results span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.results [aria-selected="true"] a { background: var(--surface-2); }
.results .empty { padding: 10px 12px; font-size: 14px; color: var(--muted); }

/* ---------- buttons */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px;
  border: 0; border-radius: 999px; background: var(--surface-2); color: var(--ink);
  font: 600 15px/1 var(--font); white-space: nowrap; cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 150ms ease, color 150ms ease;
  -webkit-user-select: none; user-select: none; touch-action: manipulation;
}
.pill:active { transform: scale(.97); }
.pill.small { height: 32px; padding: 0 12px; font-size: 14px; }
.pill.dark { background: var(--ink); color: #fff; }
.pill.blue { background: var(--blue); color: #fff; }
.pill[aria-pressed="true"] { background: #ECFDF3; color: var(--green); }

/* ---------- breadcrumbs */
.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 8px; list-style: none; margin: 20px 0 10px; padding: 0; font-size: 13px; font-weight: 500; color: var(--muted); }
.crumbs li + li::before { content: "/"; color: var(--faint); margin-right: 8px; }
.crumbs a { color: var(--ink-2); }

/* ---------- place header */
.place-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin: 4px 0 20px; }
.ph-title { font-family: var(--display); }
.ph-kicker { display: block; font: 600 15px/1.3 var(--font); color: var(--muted); letter-spacing: 0; }
.ph-name { display: block; font-size: clamp(38px, 7vw, 56px); line-height: 1.04; font-weight: 700; letter-spacing: -1.6px; overflow-wrap: anywhere; }
.ph-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; font-size: 15px; font-weight: 500; color: var(--muted); }
.ph-now:empty { display: none; }
.ph-now { color: var(--ink-2); }
.ph-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.seg[role="group"] { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); }
.seg[role="group"] button {
  height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent;
  font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}
.seg[role="group"] button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 .5px rgba(0, 0, 0, .05); }

/* Section tabs, as on Flighty's airport pages */
.tabs { display: flex; gap: 2px; width: max-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; padding: 4px; margin: 0 0 16px; background: var(--surface-2); border-radius: 14px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; transition: background-color 150ms ease, color 150ms ease; }
.tabs a[aria-current="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }

.notice { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; padding: 10px 14px; border-radius: 12px; background: #FFFAEB; color: #93370D; font-size: 14px; }

/* ---------- cards */
.card { background: var(--surface); border-radius: var(--r-card); padding: var(--pad); margin-bottom: 16px; }
.row { display: grid; gap: 16px; margin-bottom: 16px; }
.row > .card { margin: 0; min-width: 0; }
@media (min-width: 960px) { .row-verdict { grid-template-columns: 5fr 7fr; } }
@media (min-width: 860px) { .row-two { grid-template-columns: 1fr 1fr; } }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.card-h h2 { font-size: 17px; font-weight: 700; letter-spacing: -.2px; }
.card-aside { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--muted); text-align: right; }
.card-i { width: 20px; height: 20px; color: var(--muted); }
.card-wi { width: 30px; height: 30px; }

/* Status tones, shared by the verdict card and place cards */
.tone-dry       { --tone-bg: #F6FEF9; --tone-line: #D1FADF; --tone-ink: #039855; --tone-ring: rgba(18, 183, 106, .18); }
.tone-mostlydry { --tone-bg: #F6FEF9; --tone-line: #D1FADF; --tone-ink: #067647; --tone-ring: rgba(18, 183, 106, .18); }
.tone-mixed     { --tone-bg: #FFFCF5; --tone-line: #FEF0C7; --tone-ink: #B54708; --tone-ring: rgba(247, 144, 9, .2); }
.tone-wet       { --tone-bg: #F5FAFF; --tone-line: #D1E9FF; --tone-ink: #175CD3; --tone-ring: rgba(46, 144, 250, .2); }
.tone-snow      { --tone-bg: #F5F8FF; --tone-line: #E0EAFF; --tone-ink: #3538CD; --tone-ring: rgba(97, 114, 243, .2); }
.tone-storm     { --tone-bg: #FFFBFA; --tone-line: #FEE4E2; --tone-ink: #D92D20; --tone-ring: rgba(240, 68, 56, .2); }
.status-dot { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--tone-ink, var(--green)); box-shadow: 0 0 0 4px var(--tone-ring, rgba(18, 183, 106, .18)); }

.verdict { display: flex; flex-direction: column; padding: 0; overflow: hidden; background: var(--tone-bg); box-shadow: inset 0 0 0 1px var(--tone-line); }
.v-body { padding: var(--pad); padding-bottom: 8px; flex: 1; }
.v-date { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.v-head { display: flex; align-items: center; gap: 12px; margin: 10px 0 12px; }
.v-head h2 { font: 700 clamp(26px, 4vw, 32px)/1.1 var(--display); letter-spacing: -.8px; color: var(--tone-ink); }
.answer { font-size: 16px; line-height: 1.55; color: var(--ink-2); margin-bottom: 8px; }
.answer strong { color: var(--ink); font-weight: 600; }
.v-rows { list-style: none; margin: 0; padding: 0; }
.v-rows li { display: flex; gap: 12px; padding: 13px 0; border-top: 1px solid var(--tone-line); }
.v-rows li:first-child { border-top: 0; }
.v-i { width: 22px; height: 22px; color: var(--tone-ink); margin-top: 1px; }
.v-rows b { display: block; font-size: 15px; font-weight: 600; }
.v-rows span { display: block; font-size: 14px; color: var(--muted); }
.v-foot { display: flex; align-items: center; justify-content: space-between; padding: 14px var(--pad); border-top: 1px solid var(--tone-line); background: rgba(255, 255, 255, .55); font-size: 14px; font-weight: 600; color: var(--tone-ink); }

.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 600; }
.chip.warm { background: #FFFAEB; color: #B54708; }
.chip.cool { background: #EFF8FF; color: var(--blue-ink); }

/* Stat block: coloured tick, small grey label, big number (Flighty's stat rows) */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; margin-bottom: 22px; }
@media (min-width: 560px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.lbl { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.stat .lbl::before, .lbl.t-near::before { content: ""; width: 3px; height: 12px; border-radius: 2px; background: var(--tick, var(--faint)); }
.t-hi { --tick: var(--orange); }
.t-lo { --tick: var(--rain); }
.t-rain { --tick: #1A66FF; }
.t-wind { --tick: var(--green-2); }
.t-near { --tick: var(--blue); }
.big { display: block; margin: 4px 0 2px; font-size: 36px; line-height: 1.1; font-weight: 600; letter-spacing: -1px; }
.u { margin-left: 3px; font-size: 15px; font-weight: 600; letter-spacing: 0; color: var(--muted); }
.stat small { font-size: 13px; color: var(--muted); }

.bar-label { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.segbar { display: grid; grid-template-columns: repeat(14, 1fr); gap: 3px; height: 10px; }
.segbar .seg { border-radius: 3px; background: #EAECF0; }
.segbar .dry { background: var(--green-2); }
.segbar .wet { background: var(--rain); }

.chart-label { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 22px 0 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.key { display: inline-flex; align-items: center; gap: 5px; font-weight: 500; }
.key i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.key i:not(:first-child) { margin-left: 6px; }
.k-rain { background: var(--rain); }
.k-chance { background: repeating-linear-gradient(45deg, #B2DDFF 0 2px, #EFF8FF 2px 4px); }

/* ---------- charts (server-rendered SVG) */
.chart { width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: #E5E5E5; stroke-width: 1; stroke-dasharray: 3 3; }
.chart .axis { font: 500 12px var(--font); fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .axis.strong { fill: #B54708; font-weight: 600; }
.chart .night { fill: rgba(16, 24, 40, .035); }
.chart .sunline { stroke: var(--amber); stroke-width: 1.25; stroke-dasharray: 2 3; }
.chart .tline { fill: none; stroke: var(--orange); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart .hi-halo { fill: rgba(247, 144, 9, .18); }
.chart .hi-dot { fill: var(--orange); stroke: #fff; stroke-width: 2; }
.chart .lo-halo { fill: rgba(46, 144, 250, .18); }
.chart .lo-dot { fill: var(--rain); stroke: #fff; stroke-width: 2; }
.chart .peak { font: 700 13px var(--font); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; font-variant-numeric: tabular-nums; }
.chart .peak.hi { fill: #B54708; }
.chart .peak.lo { fill: var(--blue-ink); }
.chart .rain { fill: var(--rain); }
.chart .drizzle { fill: #84CAFF; }
.chart .chance { fill: url(#hatch); }

.minis { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 14px 12px; }
.mini .lbl { gap: 4px; }
.mini b { display: block; margin-top: 2px; font-size: 22px; font-weight: 600; letter-spacing: -.4px; }
.ticks { display: flex; align-items: flex-end; gap: 2px; height: 44px; margin: 18px 0; }
.ticks i { flex: 1; border-radius: 2px; background: #D0D5DD; }
.ticks i.fresh { background: #98A2B3; }
.ticks i.strong { background: var(--orange); }

/* ---------- hour-by-hour boards (departure-board rows) */
.boards { display: grid; gap: 0 32px; }
@media (min-width: 860px) { .boards { grid-template-columns: 1fr 1fr; } }
.board { list-style: none; margin: 0; padding: 0; }
.b-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) 30px 46px; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.board:first-child .b-row:first-child { border-top: 0; }
@media (min-width: 860px) { .board .b-row:first-child { border-top: 0; } }
.b-row time { font: 600 14px var(--mono); color: var(--ink); }
.b-main b { display: block; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b-sub { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dot.blue { background: var(--rain); }
.dot.green { background: var(--green-2); }
.b-ic { width: 30px; height: 30px; }
.b-temp { text-align: right; font-size: 20px; font-weight: 600; letter-spacing: -.4px; }
.b-row.approx { opacity: .55; }

/* ---------- next days */
.days { list-style: none; margin: 0; padding: 0; }
.day-row { display: grid; grid-template-columns: 58px 28px 58px 30px minmax(40px, 1fr) 30px; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.day-row:first-child { border-top: 0; }
.d-name { font-size: 15px; font-weight: 600; }
.d-ic { width: 28px; height: 28px; }
.d-rain { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 600; color: var(--blue-ink); white-space: nowrap; }
.d-lo { text-align: right; font-weight: 600; color: var(--muted); }
.d-hi { font-weight: 600; }
.range { position: relative; height: 6px; border-radius: 3px; background: #EAECF0; }
.range i { position: absolute; top: 0; bottom: 0; border-radius: 3px; }

/* ---------- nearby */
.nearby { list-style: none; margin: 0 0 4px; padding: 0; }
.nearby a { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.nearby li:first-child a { border-top: 0; }
.nearby .chip { min-width: 58px; justify-content: center; background: #fff; box-shadow: inset 0 0 0 1px var(--line-2); font-family: var(--mono); }
.nb-name { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nb-name .muted { font-weight: 500; }
.chev { width: 16px; height: 16px; color: var(--faint); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills .pill { background: #fff; box-shadow: inset 0 0 0 1px var(--line-2); font-size: 14px; height: 34px; }
.pills .pill .muted { font-weight: 500; }
.more { display: inline-flex; align-items: center; gap: 4px; margin-top: 18px; font-size: 14px; font-weight: 600; color: var(--blue); }

/* ---------- FAQ */
.faq dl { margin: 0; }
.qa { padding: 16px 0; border-top: 1px solid var(--line); }
.qa:first-child { border-top: 0; padding-top: 0; }
.qa dt { font-size: 16px; font-weight: 600; }
.qa dd { margin: 6px 0 0; font-size: 15px; line-height: 1.6; color: var(--ink-2); }

.source { margin: 24px 0 8px; font-size: 11px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); line-height: 1.7; }

/* ---------- home */
.hero { padding: 36px 0 22px; }
.hero h1 { font: 700 clamp(38px, 7.5vw, 60px)/1.03 var(--display); letter-spacing: -1.8px; }
.lede { margin-top: 12px; max-width: 580px; font-size: 17px; line-height: 1.5; color: var(--muted); }
.lede a { color: var(--blue); }

.near { margin-bottom: 36px; min-height: 92px; }
.near-state[data-state="finding"] { display: flex; align-items: center; gap: 16px; }
.near-state b { display: block; font-size: 16px; font-weight: 600; }
.near-state .muted { display: block; font-size: 14px; }
.pulse { position: relative; width: 12px; height: 12px; flex: none; margin: 0 6px; border-radius: 50%; background: var(--blue); }
.pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--blue); animation: ripple 1.6s var(--ease-out) infinite; }
@keyframes ripple { from { transform: scale(1); opacity: .45; } to { transform: scale(3.2); opacity: 0; } }
.near-off { display: grid; gap: 14px; align-items: center; }
@media (min-width: 860px) { .near-off { grid-template-columns: minmax(0, 220px) minmax(0, 1fr) auto; gap: 20px; } }
.near-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 14px; }
.near-act { display: flex; gap: 8px; margin-left: auto; }
.near .pcard { background: #fff; }

.section { margin-bottom: 40px; }
.section-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 14px; }
.section-h h2 { font: 700 22px/1.2 var(--display); letter-spacing: -.4px; }

.cards { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); } }
.cards:empty { display: none; }

/* Place card */
.pcard {
  position: relative; display: flex; flex-direction: column; gap: 12px; height: 100%;
  padding: 16px; border-radius: var(--r-card); background: #fff; color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: transform 160ms var(--ease-out), box-shadow 200ms ease;
}
.pcard:active { transform: scale(.98); }
.pc-top { display: flex; flex-direction: column; min-width: 0; padding-right: 22px; }
.pc-name { font-size: 17px; font-weight: 700; letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-mid { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pc-ic { width: 44px; height: 44px; }
.pc-temps { display: flex; align-items: baseline; gap: 8px; }
.pc-hi { font-size: 32px; font-weight: 600; letter-spacing: -1px; line-height: 1; }
.pc-lo { font-size: 18px; font-weight: 600; color: var(--muted); }
.pc-head { display: flex; align-items: center; gap: 10px; min-height: 2.6em; font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--tone-ink); }
.pc-head .status-dot { width: 8px; height: 8px; box-shadow: 0 0 0 3px var(--tone-ring); }
.pc-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted); }
.pc-foot > span { display: inline-flex; align-items: center; gap: 4px; }
.pc-date { margin-left: auto; font: 600 11px var(--mono); letter-spacing: .04em; text-transform: uppercase; }
@media (max-width: 639px) {
  .pcard { padding: 14px; gap: 10px; }
  .pc-ic { width: 36px; height: 36px; }
  .pc-hi { font-size: 26px; }
  .pc-lo { font-size: 15px; }
  .pc-date { display: none !important; }
  .pc-foot { gap: 4px 10px; font-size: 12px; }
  .pc-foot .ui-i.tiny { width: 12px; height: 12px; }
}
/* Wide variant for "near you" */
@media (min-width: 760px) {
  .pcard.wide { display: grid; grid-template-columns: minmax(0, 1.2fr) auto minmax(0, 1.4fr) minmax(0, 1fr); align-items: center; gap: 24px; padding: 20px 24px; }
  .pcard.wide .pc-name { font-size: 22px; }
  .pcard.wide .pc-head { min-height: 0; font-size: 16px; }
  .pcard.wide .pc-foot { margin: 0; padding: 0; border: 0; justify-content: flex-end; }
  .pcard.wide .pc-hi { font-size: 40px; }
  .pcard.wide .pc-ic { width: 52px; height: 52px; }
}

.pcard-wrap { position: relative; min-width: 0; }
.pc-x {
  position: absolute; top: 10px; right: 10px; z-index: 1;
  display: grid; place-items: center; width: 28px; height: 28px; padding: 0;
  border: 0; border-radius: 50%; background: var(--surface-2); color: var(--muted); cursor: pointer;
  transition: transform 160ms var(--ease-out), opacity 150ms ease, background-color 150ms ease;
}
.pc-x:active { transform: scale(.92); }
.pc-x .ui-i { width: 14px; height: 14px; }
.pcard.skel { min-height: 196px; pointer-events: none; }
.pcard.skel::before, .pcard.skel::after { content: ""; display: block; border-radius: 6px; background: var(--surface-2); }
.pcard.skel::before { width: 60%; height: 18px; }
.pcard.skel::after { width: 40%; height: 32px; margin-top: 18px; }
.pcard.failed { justify-content: center; color: var(--muted); font-size: 14px; }

/* Cards that arrive after the page loads fade up instead of popping in */
[data-my-cards] .pcard, .near-state[data-state="found"] > * { transition: opacity 240ms var(--ease-out), transform 240ms var(--ease-out); }
@starting-style {
  [data-my-cards] .pcard:not(.skel), .near-state[data-state="found"] > * { opacity: 0; transform: translateY(6px); }
}

.add-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 12px; }
.add-row .search { flex: 1 1 280px; max-width: 440px; }
.add-hint { flex: 1 1 220px; }

/* Tiles and lists */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); list-style: none; margin: 0; padding: 0; }
.tiles.small { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.tile { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px; padding: 16px 18px; border-radius: 14px; background: var(--surface); transition: transform 160ms var(--ease-out), box-shadow 200ms ease; }
.card .tile { background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.tile:active { transform: scale(.98); }
.tile b { font-size: 16px; font-weight: 600; }
.tile .muted { grid-row: 2; font-size: 14px; }
.tile .chev { grid-column: 2; grid-row: 1 / 3; }

.hub-head { margin: 4px 0 20px; }
.hub-head h1 { font: 700 clamp(30px, 5.5vw, 46px)/1.08 var(--display); letter-spacing: -1.2px; }
.linklist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); column-gap: 24px; }
.linklist a { display: block; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.az { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.az a { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); font-size: 14px; font-weight: 600; transition: transform 160ms var(--ease-out); }
.az a:active { transform: scale(.94); }
.az a[aria-current="page"] { background: var(--ink); color: #fff; }

/* Prose pages */
.prose { max-width: 720px; padding-bottom: 24px; }
.prose h1 { margin: 36px 0 16px; font: 700 clamp(32px, 5vw, 42px)/1.1 var(--display); letter-spacing: -1px; }
.prose h2 { margin: 28px 0 8px; font-size: 20px; font-weight: 700; letter-spacing: -.3px; }
.prose p { margin: 0 0 12px; font-size: 16px; line-height: 1.65; color: var(--ink-2); }
.prose a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }

/* ---------- footer */
.foot { margin-top: 48px; padding: 32px 0 40px; border-top: 1px solid var(--line); }
.foot-cols { display: grid; gap: 24px; }
@media (min-width: 760px) { .foot-cols { grid-template-columns: 2fr 1fr 1fr; } }
.foot-h { margin-bottom: 8px; font-size: 14px; font-weight: 700; }
.foot-cols a { display: block; padding: 3px 0; font-size: 14px; color: var(--muted); }
.foot-cols p.muted { font-size: 14px; max-width: 320px; }
.foot-note { margin-top: 28px; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }

/* ---------- toast */
.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 60;
  transform: translateX(-50%); padding: 10px 16px; border-radius: 12px;
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-pop);
  transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out);
}
@starting-style { .toast { opacity: 0; transform: translate(-50%, 10px); } }
.toast.out { opacity: 0; transform: translate(-50%, 6px); }

/* ---------- hover, only where a real pointer can hover */
@media (hover: hover) and (pointer: fine) {
  .pill:hover { background: #EAEAEC; }
  .pill.dark:hover { background: #26262A; }
  .pill.blue:hover { background: #0A6CE6; }
  .pill[aria-pressed="true"]:hover { background: #DCFAE6; }
  .pills .pill:hover { background: var(--surface); }
  .results a:hover { background: var(--surface-2); }
  .pcard:hover { box-shadow: inset 0 0 0 1px #D0D5DD, var(--shadow-lift); }
  .tile:hover { box-shadow: inset 0 0 0 1px #D0D5DD, var(--shadow-lift); }
  .nearby a:hover .nb-name, .linklist a:hover, .crumbs a:hover, .foot-cols a:hover { color: var(--blue); }
  .tabs a:hover { color: var(--ink); }
  .az a:hover { background: #EAEAEC; }
  .az a[aria-current="page"]:hover { background: var(--ink); }
  .pcard-wrap .pc-x { opacity: 0; }
  .pcard-wrap:hover .pc-x, .pc-x:focus-visible { opacity: 1; }
  .pc-x:hover { background: #EAEAEC; color: var(--ink); }
  .v-foot:hover { background: rgba(255, 255, 255, .85); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0ms !important; }
}

@media print {
  .top, .ph-actions, .tabs, .foot, .near, [data-my-places] { display: none !important; }
  .card { break-inside: avoid; }
}

/* Dry-day state in the rain card */
.dry-state { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.dry-state b { display: block; font-size: 15px; font-weight: 600; }
.dry-state .muted { display: block; font-size: 14px; }
.dry-ic { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: #ECFDF3; color: var(--green); box-shadow: 0 0 0 4px rgba(18, 183, 106, .1); }

/* Charts are drawn 640 units wide; on a phone that shrinks the labels to ~6px, so scale them back up */
@media (max-width: 559px) {
  .chart .axis { font-size: 21px; }
  .chart .peak { font-size: 24px; stroke-width: 7px; }
  .chart .tline { stroke-width: 4px; }
}
