:root {
  color-scheme: light;
  --bg: #f5f7f6; --surface: #fff; --surface-soft: #eef3f1; --ink: #10201d;
  --muted: #5b6b67; --line: #d4dedb; --accent: #0c6b5d; --accent-strong: #075448;
  --open: #087f6a; --open-soft: #e5f6f1; --close: #bf493e; --close-soft: #fcede9;
  --focus: #146bdb; --shadow: 0 10px 32px rgba(19, 49, 42, .07); --radius: 18px;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111918; --surface: #182321; --surface-soft: #202e2b; --ink: #f2f7f5;
  --muted: #aabbb6; --line: #344541; --accent: #68d5bf; --accent-strong: #8ce0cf;
  --open: #69d7bd; --open-soft: #173e36; --close: #ff8278; --close-soft: #462824;
  --focus: #79adff; --shadow: 0 14px 36px rgba(0, 0, 0, .18);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.6; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
a { color: var(--accent); }
svg { width: 1.35em; height: 1.35em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.skip-link { position: fixed; left: 12px; top: 12px; z-index: 20; padding: 8px 12px; background: var(--surface); color: var(--ink); transform: translateY(calc(-100% - 24px)); }
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.site-header { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); }
.header-inner { max-width: 760px; margin: auto; min-height: 72px; padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-size: 1.15rem; font-weight: 760; letter-spacing: -.02em; }
.brand svg { width: 27px; height: 27px; stroke-width: 1.5; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-button { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: var(--surface); }
.language-switch { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.language-switch button { min-width: 43px; padding: 5px 10px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: .82rem; font-weight: 700; }
.language-switch button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.app-shell { width: min(100% - 32px, 680px); margin: 0 auto; padding: 48px 0 28px; }
.intro { text-align: center; margin: 0 auto 28px; max-width: 550px; }
.weather-line { margin: 0 0 8px; color: var(--accent); font-size: .9rem; font-weight: 720; letter-spacing: .05em; }
h1 { margin: 0; font-size: clamp(2rem, 9vw, 3.3rem); line-height: 1.15; letter-spacing: -.055em; }
.intro > p:last-child { color: var(--muted); margin: 14px auto 0; }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.location-card { padding: 22px; }
.location-card h2 { margin: 0 0 18px; font-size: 1rem; }
.button { min-height: 50px; border-radius: 11px; border: 1px solid transparent; padding: 11px 18px; font-weight: 760; }
.button-primary { display: inline-flex; align-items: center; justify-content: center; gap: 9px; color: white; background: var(--accent-strong); }
.button-primary:hover { filter: brightness(1.08); }
.button-secondary { color: white; background: var(--ink); }
.button-wide { width: 100%; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); margin: 18px 0; font-size: .8rem; }
.or::before, .or::after { content: ""; height: 1px; flex: 1; background: var(--line); }
label > span, form > label { display: block; margin-bottom: 7px; font-size: .88rem; font-weight: 700; }
.search-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
input, select { min-width: 0; min-height: 48px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--surface); }
input { width: 100%; padding: 11px 13px; }
select { width: 100%; padding: 9px 34px 9px 12px; }
.status-message { margin-top: 16px; padding: 12px 14px; border-radius: 10px; background: var(--surface-soft); color: var(--ink); }
.status-message[data-kind="error"] { background: var(--close-soft); color: var(--close); }
.result-section { margin-top: 28px; }
.result-section:focus { outline: none; }
.place-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.place-line > div { display: flex; align-items: center; gap: 9px; }
.place-copy { display: grid; line-height: 1.35; }
.place-copy span { color: var(--muted); font-size: .78rem; font-weight: 700; }
.place-copy strong { font-size: 1rem; font-weight: 780; }
.text-button { border: 0; padding: 8px; color: var(--accent); background: transparent; font-weight: 700; }
.decision-card { padding: 28px 20px 22px; text-align: center; border-color: color-mix(in srgb, var(--open) 50%, var(--line)); background: linear-gradient(var(--surface), color-mix(in srgb, var(--open-soft) 55%, var(--surface))); }
.decision-card[data-decision="close"] { border-color: color-mix(in srgb, var(--close) 50%, var(--line)); background: linear-gradient(var(--surface), color-mix(in srgb, var(--close-soft) 55%, var(--surface))); }
.decision-kicker { margin: 0; color: var(--open); font-weight: 800; }
[data-decision="close"] .decision-kicker { color: var(--close); }
.decision-card h2 { margin: 3px 0 8px; color: var(--open); font-size: clamp(4rem, 19vw, 6.8rem); line-height: 1; letter-spacing: -.07em; }
[data-decision="close"] h2 { color: var(--close); }
.action-message { margin: 0 0 16px; font-size: clamp(1.35rem, 5vw, 1.8rem); font-weight: 820; letter-spacing: -.025em; }
.score-box { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 12px; max-width: 500px; margin: 0 auto 18px; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--open) 35%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--surface) 80%, transparent); text-align: left; }
[data-decision="close"] .score-box { border-color: color-mix(in srgb, var(--close) 35%, var(--line)); }
.score-label { color: var(--muted); font-size: .82rem; font-weight: 720; }
.score-box strong { grid-row: span 2; font-size: 1.4rem; }
.score-stars { color: var(--open); font-size: 1.15rem; letter-spacing: .08em; }
[data-decision="close"] .score-stars { color: var(--close); }
.score-description { grid-column: 1 / -1; margin-top: 6px; font-size: .88rem; font-weight: 700; }
.recommendation { margin: 0 auto; max-width: 520px; font-weight: 650; }
.next-window { display: flex; align-items: center; gap: 13px; padding: 15px 18px; color: var(--open); }
.result-section[data-decision="close"] .next-window { color: var(--close); }
.next-window svg { width: 32px; height: 32px; flex: 0 0 auto; }
.next-window span { display: block; font-size: .78rem; font-weight: 720; }
.next-window strong { display: block; font-size: 1.25rem; line-height: 1.35; }
.why, .settings { margin-top: 12px; overflow: clip; }
summary { list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
.why summary { padding: 15px 18px; font-weight: 750; }
.why summary::after, .settings summary::after { content: "+"; float: right; color: var(--muted); font-size: 1.35rem; line-height: 1; }
.why[open] summary::after, .settings[open] summary::after { content: "−"; }
#whyContent { border-top: 1px solid var(--line); padding: 12px 18px 18px; color: var(--muted); font-size: .9rem; }
#whyContent h3 { color: var(--ink); font-size: .9rem; margin: 14px 0 5px; }
#whyContent p { margin: 0; }
.detail-metrics { display: grid; grid-template-columns: 1fr 1fr; margin: 0; }
.detail-metrics div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.detail-metrics div:nth-child(odd) { margin-right: 14px; }
.detail-metrics dt { color: var(--muted); }
.detail-metrics dd { margin: 0; color: var(--ink); font-weight: 720; }
.detail-reasons { margin: 5px 0 0; padding-left: 1.25rem; }
.detail-reasons li + li { margin-top: 5px; }
.estimate-note { margin-top: 16px !important; padding-top: 12px; border-top: 1px solid var(--line); }
.updated { margin: 10px 2px 0; text-align: right; color: var(--muted); font-size: .77rem; }
.settings { margin-top: 28px; }
.settings > summary { padding: 17px 20px; font-weight: 780; }
.settings summary small { display: block; color: var(--muted); font-size: .73rem; font-weight: 500; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 2px 20px 16px; }
.settings-note { margin: 0; padding: 13px 20px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
footer { width: min(100% - 32px, 680px); margin: 0 auto; padding: 18px 0 42px; color: var(--muted); font-size: .76rem; text-align: center; }
footer p { margin: 6px 0; }
[hidden] { display: none !important; }
@media (max-width: 500px) {
  .header-inner { padding-inline: 16px; }
  .brand span { font-size: 1rem; }
  .icon-button { width: 38px; height: 38px; }
  .language-switch button { min-width: 38px; padding-inline: 8px; }
  .app-shell { width: min(100% - 24px, 680px); padding-top: 34px; }
  .location-card { padding: 18px; }
  .place-line { align-items: flex-start; }
  .detail-metrics { grid-template-columns: 1fr; }
  .detail-metrics div:nth-child(odd) { margin-right: 0; }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
