/* Daywindow / 하루틈 — local synthetic demo. System fonts only, no external assets.
   Design system: warm off-white paper, deep teal + ink, amber only for "over limit" and the demo label.
   Spacing scale 8 / 12 / 16 / 24 / 32. Body text 16px; meta 14px. Touch targets ≥ 44px. */
:root {
  --paper: #faf7f1; --surface: #fffdf9; --surface-2: #f4efe6;
  --ink: #1d2a2f; --ink-2: #34444a; --muted: #5b686c; --line: #e6dfd2; --line-2: #cfc5b3;
  --teal: #0f5c5a; --teal-dark: #0a4341; --teal-50: #eaf4f1; --teal-100: #d2e8e3;
  --amber: #b86e10; --amber-100: #fbe9c8; --amber-50: #fdf5e4; --over-bg: #fbe4cf; --over-ink: #7d3705;
  --err: #a4261d; --err-bg: #fbe9e6;
  --focus: #f2a516;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px;
  --shadow: 0 1px 2px rgba(29, 42, 47, .05), 0 12px 32px -24px rgba(29, 42, 47, .35);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Hiragino Sans", "Yu Gothic UI", "Malgun Gothic", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--paper);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-bottom: 96px; }
body { margin: 0; background: var(--paper); overflow-wrap: anywhere; }
a { color: var(--teal); text-underline-offset: 3px; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; color: var(--ink); }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.meta { font-size: 14px; color: var(--muted); line-height: 1.45; }
.label { display: block; font-weight: 600; margin: 0 0 8px; }
.eyebrow { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: .01em; }

/* ---------- header ---------- */
.site-header {
  background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 24px;
  padding: 4px max(16px, calc((100% - 1200px) / 2));
}
.site-header .bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0 16px; }
.brand { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 800; font-size: 18px; letter-spacing: -.01em; color: var(--ink); text-decoration: none; }
.brand::before { content: ""; width: 28px; height: 28px; background: url(/tools/weather/assets/icon.svg) center / contain no-repeat; flex: 0 0 auto; }
.nav, .langs { list-style: none; display: flex; flex-wrap: wrap; gap: 0 12px; margin: 0; padding: 0; }
.nav a, .langs a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; color: var(--ink-2); text-decoration: none; }
.nav a:hover, .langs a:hover { text-decoration: underline; }
.nav a[aria-current="page"], .langs a[aria-current="true"] { font-weight: 700; color: var(--teal); text-decoration: underline; text-decoration-thickness: 2px; }

.demo-badge { display: inline-block; padding: 4px 12px; background: var(--amber-50); border: 1px solid #e3c47f; border-radius: 14px; font-size: 14px; font-weight: 600; line-height: 1.45; color: #5c3d06; }
.demo-tag { display: inline-block; margin-right: 4px; background: var(--amber); color: #fff; border-radius: 4px; padding: 0 6px; font-size: 12px; letter-spacing: .05em; vertical-align: 1px; }
body:has(#app) .site-header .demo-badge { display: none; }

/* ---------- page frame ---------- */
main { max-width: 1232px; margin: 0 auto; padding: 24px 16px 32px; }
main:focus { outline: none; }
h1 { font-size: 26px; line-height: 1.25; letter-spacing: -.015em; margin: 0 12px 8px 0; display: inline-block; vertical-align: middle; }
h1 + .demo-badge { vertical-align: middle; margin-bottom: 8px; }
h2 { font-size: 20px; line-height: 1.3; }
h3 { font-size: 17px; line-height: 1.35; }
h4 { font-size: 16px; line-height: 1.4; }
.intro { color: var(--ink-2); margin: 0 0 24px; max-width: 70ch; }
.hint, .empty { color: var(--muted); }
.card-block, .answer-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow); }

/* ---------- controls ---------- */
fieldset { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
legend { display: block; font-weight: 700; padding: 0; margin: 0 0 8px; }
.field { display: grid; gap: 4px; min-width: 0; }
.field .label { margin: 0; font-size: 14px; color: var(--ink-2); }
input[type="search"], input[type="text"], select {
  font-size: 16px; width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: #fff; color: var(--ink); min-width: 0;
}
input[type="search"]:hover, input[type="text"]:hover, select:hover { border-color: var(--muted); }
select:disabled { background: var(--surface-2); color: var(--muted); }
input[aria-invalid="true"], select[aria-invalid="true"] { border: 2px solid var(--err); }
button { font-size: 16px; min-height: 44px; padding: 8px 16px; border-radius: var(--r-sm); cursor: pointer; border: 1px solid var(--teal); }
button.primary { background: var(--teal); color: #fff; font-weight: 700; min-height: 48px; }
button.primary:hover { background: var(--teal-dark); }
button.secondary, a.button { background: var(--surface); color: var(--teal); border: 1px solid var(--teal); font-weight: 600; }
button.secondary:hover, a.button:hover { background: var(--teal-50); }
button.wide, .cta-bar button.primary { width: 100%; }
button.link-btn { background: none; border: 0; padding: 8px 0; color: var(--teal); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
a.button { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border-radius: var(--r-sm); text-decoration: none; }
button:disabled { opacity: .5; cursor: not-allowed; }
input[type="radio"], input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--teal); flex: 0 0 auto; margin: 0; }
.row { display: flex; gap: 8px; align-items: flex-end; }
.row.wrap { flex-wrap: wrap; }
.field-error { color: var(--err); font-weight: 600; margin: 4px 0 0; }
.field-error:empty { display: none; }

/* segmented (purpose, duration) */
.segmented { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.segmented > legend { float: left; margin: 0 4px 0 0; line-height: 44px; }
.segmented label { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 8px 12px; min-height: 44px; background: #fff; cursor: pointer; white-space: nowrap; }
.segmented label:has(input:checked) { border-color: var(--teal); background: var(--teal-50); color: var(--teal-dark); font-weight: 700; }
#duration > label { flex: 1 1 0; min-width: 0; padding: 8px; gap: 6px; }

/* place search */
.search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; }
.search-row .country { width: 10em; }
#loc-note { margin-top: 8px; }
#search-status:not(:empty) { margin-top: 8px; }
.has-place #loc-note, .has-place #search-status:not(.notice), .has-place .results-list > .meta { display: none; }
#search-results:not([hidden]) + #selected-place { display: none; }
.results-list { margin: 8px 0 0; }
.results-list .meta { margin-bottom: 8px; }
.results-list ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.place-option { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 8px 12px; min-height: 44px; background: #fff; cursor: pointer; }
.place-option:has(input:checked) { border-color: var(--teal); background: var(--teal-50); }
.place-text { display: grid; }
.place-meta { color: var(--muted); font-size: 14px; }
.selected-place { font-weight: 600; margin-top: 8px; }

/* ---------- plan page ---------- */
.plan-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.plan-grid > * { min-width: 0; }
.plan-panel { display: grid; gap: 12px; }
#plan-form #task { margin-bottom: 12px; }
#time { margin-bottom: 8px; }
#time > legend { float: left; margin: 0 12px 4px 0; }
#time-note { margin: 0 0 8px; padding-top: 2px; }
.time-row { clear: both; display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 12px; } /* full width: date + time + UTC offset never clipped in any locale */
.time-row .field { grid-template-columns: 4.5em minmax(0, 1fr); align-items: center; gap: 8px; }
.time-row .field .label { font-size: 16px; color: var(--ink-2); }
#duration { margin: 0; flex-wrap: nowrap; }

/* conditions: collapsed by default, summary always readable */
.cond-details { border-top: 1px solid var(--line); margin: 8px 0 0; }
.cond-details > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-height: 44px; padding: 8px 0; cursor: pointer; list-style: none; }
.cond-details > summary::-webkit-details-marker { display: none; }
.cond-details > summary::before { content: "▸"; color: var(--teal); }
.cond-details[open] > summary::before { content: "▾"; }
.sum-title { font-weight: 700; color: var(--teal); text-decoration: underline; text-underline-offset: 3px; }
.sum-values { flex: 1 1 100%; color: var(--ink-2); padding-left: 20px; }
.cond-details:not([open]) .preset { display: none; }
.cond-details[open] .sum-values { display: none; }
.cond-details > summary .preset { flex: 1 1 100%; padding-left: 20px; }
#conditions { margin: 0 0 8px; }
.cond-grid { display: grid; }
.cond-cell { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px; border-bottom: 1px solid var(--line); }
.cond-cell:last-child { border-bottom: 0; }
.cond-cell > .off-note, .cond-cell > .field-error { grid-column: 1 / -1; }
.cond-head { display: flex; align-items: center; gap: 8px; }
.cond-head label { min-height: 44px; display: flex; align-items: center; font-weight: 600; line-height: 1.3; cursor: pointer; }
.cond-values { display: flex; align-items: center; gap: 8px; justify-self: end; }
.cond-values input { width: 6em; flex: 0 0 auto; }
.cond-cell[data-key="t"] .cond-values input { width: 4.5em; }
.unit { color: var(--muted); min-width: 2.6em; }
.cond-cell.is-off .cond-values { opacity: .55; }
.off-note { margin: 0 0 4px; color: var(--muted); font-size: 14px; font-style: italic; }
.cta-bar { margin: 8px -16px -16px; padding: 12px 16px 16px; border-top: 1px solid var(--line); background: var(--surface); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.cta-bar .field-error { margin: 0 0 8px; }

/* ---------- answer panel ---------- */
.answer-panel { padding: 16px 16px 24px; }
.results-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 8px; }
.results-head h2 { font-size: 18px; color: var(--ink-2); }
.units { margin: 0; }
.unit-row { display: flex; flex-wrap: wrap; gap: 8px; }
.unit-field { display: flex; align-items: center; gap: 4px; }
.unit-field select { width: auto; min-width: 88px; padding-right: 28px; }
.context-line { color: var(--ink-2); margin-bottom: 12px; }
#load-status.notice { margin-bottom: 12px; }
#results-body { display: grid; gap: 16px; }
#results-body > *, .timeline > *, .answer-panel { min-width: 0; }
#results-body > .demo-badge { justify-self: start; }

.empty-state { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 32px 16px; border: 1px dashed var(--line-2); border-radius: var(--r-md); background: var(--paper); color: var(--ink-2); }
.empty-state .icon { width: 56px; height: 56px; color: var(--teal); }
.empty-state p { max-width: 44ch; }

.cards { display: grid; gap: 12px; }
.card { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.card.answer { padding: 16px 20px 16px; border: 2px solid var(--teal); background: linear-gradient(180deg, var(--teal-50), var(--surface) 70%); display: grid; gap: 4px; }
.card-time .time { display: block; font-size: 40px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--teal-dark); }
.fits { font-size: 18px; font-weight: 700; color: var(--ink); }
.meets { color: var(--teal-dark); font-weight: 600; }
.lower-rain { color: var(--ink-2); }
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin: 8px 0 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.metrics > div { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; }
.metrics dt { flex: 1 1 100%; font-size: 14px; color: var(--muted); line-height: 1.35; }
.metrics dd { margin: 0; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.delta { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }

.cond-summary { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.cond-summary li { background: var(--surface-2); border-radius: 999px; padding: 2px 12px; color: var(--ink-2); }
.cond-summary li.off { color: var(--muted); font-style: italic; }

/* timeline */
.timeline { display: grid; gap: 12px; padding-top: 8px; border-top: 1px solid var(--line); }
.tl-head { display: grid; gap: 4px; }
.tl-scroll { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
table.tl { border-collapse: separate; border-spacing: 0; width: 100%; min-width: max-content; }
.tl th, .tl td { padding: 8px; text-align: center; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; min-width: 72px; }
.tl tbody tr:last-child th, .tl tbody tr:last-child td { border-bottom: 0; }
.tl .row-head { text-align: left; font-weight: 600; color: var(--ink-2); position: sticky; left: 0; background: var(--surface); min-width: 120px; z-index: 1; }
.tl thead th { font-weight: 700; color: var(--ink-2); }
.tl thead th.in-sel { background: var(--teal); color: #fff; }
.tl td { position: relative; }
.tl td.in-sel { box-shadow: inset 2px 0 0 var(--teal), inset -2px 0 0 var(--teal); }
.tl .track { display: flex; align-items: flex-end; justify-content: center; height: 36px; margin-bottom: 4px; }
.tl .bar { width: 20px; border-radius: 4px 4px 0 0; background: var(--teal); }
.tl .val { display: block; }
.tl td.st-ok { background: var(--surface); }
.tl td.st-over { background: var(--over-bg); color: var(--over-ink); font-weight: 700; }
.tl td.st-over .bar { background: var(--amber); }
.tl td.st-nodata { background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, var(--surface) 6px 12px); color: var(--muted); font-style: italic; }
.tl td.st-off { color: var(--muted); }
.tl .row-off .row-head { color: var(--muted); }
.tl .row-status td { font-weight: 700; }
.tl .row-status td.st-ok { color: var(--teal-dark); background: var(--teal-50); }
.tl-sel { font-weight: 600; color: var(--teal-dark); }
.win-chooser { display: flex; flex-wrap: wrap; gap: 8px; }
.win-btn { display: grid; justify-items: start; gap: 0; text-align: left; background: #fff; color: var(--ink); border: 1px solid var(--line-2); padding: 6px 12px; min-width: 128px; }
.win-btn .win-range { font-weight: 700; font-variant-numeric: tabular-nums; }
.win-btn .win-state { font-size: 14px; color: var(--muted); }
.win-btn.ws-rejected .win-state { color: var(--over-ink); }
.win-btn.ws-unevaluable { background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, #fff 6px 12px); }
.win-btn[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: #fff; }
.win-btn[aria-pressed="true"] .win-state { color: #e3f1ee; }
.win-btn.ws-rejected[aria-pressed="true"] { background: var(--over-ink); border-color: var(--over-ink); }
.win-btn.ws-unevaluable[aria-pressed="true"] { background: var(--ink-2); border-color: var(--ink-2); }
.window-detail { border-left: 4px solid var(--teal); background: var(--surface-2); border-radius: 0 var(--r-sm) var(--r-sm) 0; padding: 12px 16px; display: grid; gap: 8px; }
.window-detail.ws-rejected { border-left-color: var(--amber); background: var(--amber-50); }
.window-detail.ws-unevaluable { border-left-color: var(--muted); }
.detail-why { font-weight: 600; }
.detail-list { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.state-tag { font-weight: 700; }

/* alternatives */
.alts { display: grid; gap: 12px; }
.alt-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card.alt { padding: 12px 16px; display: grid; gap: 4px; align-content: start; }
.card.alt .card-time .time { font-size: 26px; color: var(--ink); }

/* notices */
.notice { border-radius: var(--r-sm); padding: 12px 16px; border: 1px solid var(--line-2); background: var(--teal-50); }
.notice p + p { margin-top: 8px; }
.notice.error { background: var(--err-bg); border-color: var(--err); }
.notice.error > p:first-child::before { content: "⚠ "; font-weight: 700; }
.notice.warn { background: var(--amber-50); border-color: var(--amber); }
.notice.info { border-color: var(--teal); }
.notice.dirty { background: var(--teal-50); border-color: var(--teal); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.warn-text { color: var(--over-ink); }

details.others > summary, details.about > summary, .dev > summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; color: var(--teal); }
.table-wrap { overflow-x: auto; }
.others table { border-collapse: collapse; width: 100%; }
.others th, .others td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; vertical-align: top; }
.others th { font-size: 14px; color: var(--muted); }
.others td ul { margin: 0; padding-left: 16px; }
.source { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 4px; }
.limits { color: var(--ink-2); }
.about p { color: var(--ink-2); margin-bottom: 4px; }
.share { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 16px; }
.share-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.share-row .meta { flex: 1 1 240px; }
#share-out:not(:empty) { display: grid; gap: 8px; margin-top: 12px; }
.dev { margin-top: 32px; border: 1px dashed var(--line-2); border-radius: var(--r-md); padding: 4px 16px 12px; background: var(--surface); }
.dev .row { margin: 8px 0; }
.dev .hint { margin: 4px 0 8px; }

/* ---------- home ---------- */
.home-grid { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.home-main { display: grid; gap: 12px; }
.task-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.task-cards > legend { font-size: 18px; margin-bottom: 12px; }
.task-card { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--line-2); border-radius: var(--r-md); background: #fff; cursor: pointer; min-height: 88px; }
.task-card:has(input:checked) { border: 2px solid var(--teal); background: var(--teal-50); padding: 15px; }
.task-card .icon { width: 40px; height: 40px; color: var(--teal); }
.task-text { display: grid; gap: 2px; }
.task-desc { color: var(--ink-2); }
.sample-row { display: grid; gap: 8px; }
.home-own { font-size: 18px; margin-top: 8px; }
.home-preview { display: grid; gap: 12px; }
.preview-body { display: grid; gap: 8px; }
.preview-time { font-size: 40px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; color: var(--teal-dark); font-variant-numeric: tabular-nums; }
.mini-strip { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.mini-hour { position: relative; display: grid; gap: 4px; justify-items: center; padding: 6px 0; border-radius: var(--r-sm); }
.mini-hour.in-sel { background: var(--teal-50); box-shadow: inset 0 0 0 2px var(--teal); }
.mini-track { display: flex; align-items: flex-end; height: 64px; }
.mini-bar { display: block; width: 18px; background: var(--teal); border-radius: 4px 4px 0 0; }
.mini-hour.st-over .mini-bar { background: var(--amber); }
.mini-label { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.icon { display: block; }

/* ---------- footer & static pages ---------- */
.site-footer { max-width: 1232px; margin: 0 auto; padding: 24px 16px 40px; color: var(--muted); border-top: 1px solid var(--line); display: grid; gap: 8px; }
.site-footer a { display: inline-flex; align-items: center; min-height: 44px; }
main > ol.steps, main > ul.data-list, main > ul { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 16px 16px 40px; margin: 0 0 16px; max-width: 80ch; box-shadow: var(--shadow); }
.steps li, .data-list li, main > ul li { margin-bottom: 8px; }
main > h2 { margin: 24px 0 12px; }
main > p { margin-bottom: 12px; max-width: 80ch; }
main > .demo-badge { margin-bottom: 16px; }
.xdefault .lang-choice { list-style: none; padding: 0; display: grid; gap: 8px; max-width: 560px; background: none; border: 0; box-shadow: none; }
.xdefault .lang-choice a { display: block; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.xdefault .lang-choice .suggested a { border: 2px solid var(--teal); }

/* ---------- responsive ---------- */
@media (min-width: 960px) {
  .plan-grid { grid-template-columns: 440px minmax(0, 1fr); gap: 24px; }
  .intro { max-width: none; }
  .home-grid { grid-template-columns: minmax(0, 1fr) 400px; gap: 32px; }
  .answer-panel { padding: 20px 24px 24px; }
  .card.answer { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 24px; }
  .card.answer > .eyebrow, .card.answer > .card-time, .card.answer > .fits, .card.answer > .meets, .card.answer > .lower-rain { grid-column: 1; }
  .card.answer > .metrics { grid-column: 2; grid-row: 1 / span 5; align-self: center; margin: 0; padding: 0 0 0 24px; border-top: 0; border-left: 1px solid var(--line); }
  .card.answer > .meta { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  main { padding-top: 16px; }
  h1 { font-size: 22px; }
  .search-row { grid-template-columns: minmax(0, 1fr) auto; }
  .search-row #city-q { grid-column: 1 / -1; }
  .search-row .country { max-width: none; }
  .segmented > legend { float: none; line-height: 1.5; margin: 0 0 8px; width: 100%; }
  .segmented label { flex: 1 1 auto; padding: 8px 10px; }
  /* r8: phones keep one duration row while it fits, and wrap (instead of widening the page) under wider glyphs/scrollbar */
  #duration { flex-wrap: wrap; }
  #duration > label { min-width: auto; padding: 8px 4px; gap: 4px; }
  .cond-cell { grid-template-columns: 1fr; }
  .cond-values { justify-self: start; padding: 0 0 8px 28px; }
  .card-time .time, .preview-time { font-size: 34px; }
  .tl .row-head { min-width: 88px; }
  .tl th, .tl td { min-width: 64px; padding: 8px 6px; }
  .card.answer { padding: 16px; }
  .task-card { min-height: 72px; }
}

/* ---------- r7: mobile answer-first ---------- */
.plan-summary { display: none; }
.units-details > summary { display: none; }
@media (max-width: 959px) {
  /* after a computed result the inputs fold into a one-line plan summary; the same controls return on "Change" */
  .plan-summary:not([hidden]) { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 16px; box-shadow: var(--shadow); }
  .plan-summary-text { font-weight: 700; color: var(--ink); }
  .plan-collapsed .plan-panel { display: none; }
  main:has(#app.plan-collapsed) .intro { display: none; }
  .units-details > summary { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; color: var(--teal); font-weight: 600; }
  .units-details[open] > summary { margin-bottom: 8px; }
  .results-head { align-items: flex-start; }
}
@media (max-width: 600px) {
  /* header in two rows: brand + languages, then the main menu (all links stay, 44px targets) */
  /* r8: room budget for 360px minus a 15px classic scrollbar (≈345px): 8px padding, 16px brand with a 22px icon,
     no column gap (the free space between brand and languages is the gap) → languages get ≥ 12px slack */
  .site-header { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 0; padding: 0 8px; }
  .site-header .bar { display: contents; }
  .site-header .brand { grid-column: 1; grid-row: 1; justify-self: start; font-size: 16px; gap: 5px; }
  .site-header .brand::before { width: 22px; height: 22px; }
  /* r8: pages without the tool (guide, data) keep the header DEMO badge — its own full-width row under the menu,
     so it can no longer widen the brand column and squeeze the languages into extra rows */
  .site-header .demo-badge { grid-column: 1 / -1; grid-row: 3; justify-self: start; margin: 0 0 8px; }
  .site-header nav:has(.langs) { grid-column: 2; grid-row: 1; justify-self: end; }
  .site-header nav:has(.nav) { grid-column: 1 / -1; grid-row: 2; }
  .langs { gap: 0 4px; flex-wrap: wrap; justify-content: flex-end; } /* wraps (never overflows) if a wider system font needs it */
  .langs a { font-size: 0; padding: 0; }
  .langs a::after { font-size: 16px; }
  .langs a[data-locale="en"]::after { content: "EN"; }
  .langs a[data-locale="ja"]::after { content: "日本語"; }
  .langs a[data-locale="ko"]::after { content: "한국어"; }
  .langs a[data-locale="zh-Hans"]::after { content: "中文"; }
  .nav { gap: 0 8px; }
}

/* ---------- r9: live forecast mode ---------- */
.demo-badge.live-badge { background: var(--teal-50); border-color: var(--teal-100); color: var(--teal-dark); }
.demo-tag.live-tag { background: var(--teal); }
.quick-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; margin: 4px 0 0; }
.quick-row .quick-btn { min-height: 44px; min-width: 44px; padding: 8px 4px; }
.how-list { margin: 0 0 12px; padding-left: 22px; display: grid; gap: 8px; }
.quick-row[hidden] { display: none; }
