:root {
  --bg: #f5f4ef; --card: #ffffff; --ink: #172e31; --muted: #526769; --faint: #7d8f90; --line: #d7e1dc;
  --soft: #e7eeea; --active: #173f38; --on: #ffffff;
  --alert: #ad531c; --alert-soft: #f7e3d6; --near: #8a6212; --near-soft: #f6ecd2;
  --prob: #286fa5; --prob-fill: rgba(40, 111, 165, .12);
  --ifs: #6a55a8; --icon: #ad531c; --gfs: #2d7d6f; --past: rgba(23, 46, 49, .05); --ridge: #7a7064;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131c20; --card: #1b272c; --ink: #e7efed; --muted: #b1c2c1; --faint: #829596; --line: #3a4b4c;
    --soft: #263c38; --active: #b7dccc; --on: #132b23;
    --alert: #edaa78; --alert-soft: #3d2a1d; --near: #e8c768; --near-soft: #352d12;
    --prob: #83bfea; --prob-fill: rgba(131, 191, 234, .14);
    --ifs: #b9a6ee; --icon: #edaa78; --gfs: #7fcfbf; --past: rgba(255, 255, 255, .045); --ridge: #a89b8c;
  }
}
:root[data-theme="dark"] {
  --bg: #131c20; --card: #1b272c; --ink: #e7efed; --muted: #b1c2c1; --faint: #829596; --line: #3a4b4c;
  --soft: #263c38; --active: #b7dccc; --on: #132b23;
  --alert: #edaa78; --alert-soft: #3d2a1d; --near: #e8c768; --near-soft: #352d12;
  --prob: #83bfea; --prob-fill: rgba(131, 191, 234, .14);
  --ifs: #b9a6ee; --icon: #edaa78; --gfs: #7fcfbf; --past: rgba(255, 255, 255, .045); --ridge: #a89b8c;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { max-width: 1120px; margin: 0 auto; padding: 20px 16px 56px; }
@media (min-width: 700px) { main { padding: 24px 32px 64px; } }
a { color: var(--ink); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--prob); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
button, select, input { font: inherit; color: inherit; }

.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 20px; }
.logo { font-size: 28px; font-weight: 650; letter-spacing: -.03em; line-height: 1; }
.loc { color: var(--muted); font-size: .85rem; margin-left: 8px; }
.top a { min-height: 44px; display: inline-flex; align-items: center; }
.eyebrow { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
h1 { font-size: clamp(1.75rem, 4.5vw, 2.3rem); line-height: 1.15; letter-spacing: -.02em; font-weight: 650; margin: 6px 0 10px; }
h2 { font-size: 1.35rem; font-weight: 650; margin: 36px 0 12px; }
h3 { font-size: 1.05rem; font-weight: 650; margin: 0 0 4px; }

.verdict p { margin: 0; }
.verdict-big { font-size: clamp(1.2rem, 3vw, 1.4rem); font-weight: 600; line-height: 1.3; max-width: 46ch; padding-left: 12px;
  border-left: 4px solid var(--faint); }
.verdict.alert .verdict-big { border-left-color: var(--alert); }
.verdict.near .verdict-big { border-left-color: var(--near); }
.verdict.low .verdict-big { border-left-color: var(--prob); }
.verdict .verdict-small { color: var(--muted); margin-top: 8px; max-width: 70ch; }
.meta { color: var(--muted); font-size: .85rem; margin: 10px 0 0; }
.tag { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; background: var(--card); font-size: .78rem; }
.safe { background: var(--soft); border-radius: 10px; padding: 12px 16px; font-size: .88rem; margin-top: 14px; }

.days { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 20px 0; }
@media (max-width: 560px) { .days { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.day { text-align: left; display: grid; gap: 2px; align-content: start; padding: 12px 14px; min-height: 112px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.day[aria-pressed="true"] { background: var(--active); border-color: var(--active); color: var(--on); }
.day .when { font-size: .8rem; }
.day .big { font-size: 1.55rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }
.day .status { font-size: .85rem; font-weight: 600; }
.day .sub { font-size: .76rem; opacity: .85; }
.day .status.alert { color: var(--alert); } .day .status.near { color: var(--near); }
.day[aria-pressed="true"] .status { color: inherit; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
@media (min-width: 700px) { .panel { padding: 20px; } }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; flex-wrap: wrap; }
.check { display: inline-flex; gap: 8px; align-items: center; min-height: 44px; font-size: .88rem; cursor: pointer; }
.check input { width: 18px; height: 18px; }
#chart { width: 100%; display: block; touch-action: pan-y; cursor: pointer; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .8rem; color: var(--muted); margin-top: 6px; }
.legend svg { vertical-align: middle; margin-right: 6px; }
.foot { color: var(--muted); font-size: .82rem; margin: 8px 0 0; }
.chartbox { position: relative; }
.tip { position: absolute; pointer-events: none; background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; font-size: .82rem; box-shadow: 0 4px 16px rgba(0, 0, 0, .12); min-width: 150px; display: none;
  font-variant-numeric: tabular-nums; z-index: 2; }
.tip b { display: block; margin-bottom: 2px; }
.tip .r { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }
.tip .r.main { color: var(--ink); font-weight: 600; }

.hourbar { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; }
.hourbar button, .switch button { min-height: 44px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); cursor: pointer; }
.hourbar button:disabled { opacity: .45; cursor: default; }
.hourbar strong { text-align: center; font-size: 1.05rem; }
.range { width: 100%; min-height: 44px; accent-color: var(--active); margin: 4px 0 0; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 10px; }
@media (max-width: 480px) { .facts { grid-template-columns: 1fr 1fr; } }
.facts span { display: block; color: var(--muted); font-size: .8rem; }
.facts strong { font-size: 1.2rem; font-weight: 600; font-variant-numeric: tabular-nums; }

.grid2 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
@media (max-width: 820px) { .grid2 { grid-template-columns: 1fr; } }
.sub-meta { color: var(--muted); font-size: .82rem; margin: 0 0 6px; }
#meteo { width: 100%; display: block; touch-action: pan-y; cursor: pointer; }
#map { width: 100%; max-width: 300px; display: block; margin: 8px auto 4px; }
.factors { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 12px; }
.factors li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; }
.mark { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .9rem; }
.mark.yes { background: var(--alert-soft); color: var(--alert); }
.mark.no { background: var(--past); color: var(--faint); }
.mark.none { border: 1px dashed var(--faint); color: var(--faint); }
.factors .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.factors .why { color: var(--muted); font-size: .85rem; }

details { border-bottom: 1px solid var(--line); padding: 12px 2px; }
summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; justify-content: space-between; gap: 12px; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--muted); font-weight: 400; }
details[open] > summary::after { content: "–"; }
details p, details table { color: var(--muted); max-width: 72ch; margin: 8px 0 2px; }
.panel details { border-bottom: 0; padding-bottom: 0; }
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 6px 12px 6px 0; border-bottom: 1px solid var(--line); }
th { color: var(--ink); font-weight: 600; }
.hours { width: 100%; }
.hours td, .hours th { text-align: right; padding: 6px; }
.hours td:first-child, .hours th:first-child { text-align: left; }
.hours tr.sel td { background: var(--soft); color: var(--ink); font-weight: 600; }
caption { text-align: left; color: var(--muted); font-size: .82rem; padding-bottom: 4px; }

.switch { display: inline-flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.switch button[aria-pressed="true"] { background: var(--active); color: var(--on); border-color: var(--active); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 8px 0 12px; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 440px) { .steps { grid-template-columns: 1fr; } }
.step { padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.step p { margin: 0; color: var(--muted); font-size: .9rem; }
.lead { color: var(--muted); max-width: 68ch; }
.warn { padding: 14px 16px; border-left: 4px solid var(--alert); background: var(--card); border-radius: 10px; }
footer { margin-top: 40px; color: var(--muted); font-size: .8rem; border-top: 1px solid var(--line); padding-top: 12px; }
footer p { margin: 4px 0; }
.nodata .needs-data { display: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
