/* ============================================================
   Forecast panel — styles (DOM renderer)
   ------------------------------------------------------------
   One view, always expanded. "Cartographic instrument" skin:
   hairlines · tracked caps · tabular figures · thin-stroke icons
   ============================================================ */

:root {
  --ink: 11, 13, 17;
  --mist: #eaeef3;
  --haze: #9aa6b2;
  --faint: #626c76;
  --ember: #d8a95c;
  --ice: #98b2c7;
  --rain-text: #86a6bd;
  --good: #8fbf9a;
  --bad: #c98a8a;
  --line: rgba(200, 214, 228, 0.10);
  --line-soft: rgba(200, 214, 228, 0.06);
  --display: "Bahnschrift SemiLight SemiCondensed", "Bahnschrift", "Segoe UI Variable Display", "Inter", "Roboto", "Noto Sans", "DejaVu Sans", system-ui, sans-serif;
  --body: "Segoe UI Variable Display", "Segoe UI", "Inter", "Roboto", "Noto Sans", "DejaVu Sans", system-ui, sans-serif;
  --panel-alpha: 0.86;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; background: #06090f; font-family: var(--body); color: var(--mist); user-select: none; }
body { display: flex; align-items: flex-start; justify-content: flex-start; overflow: auto; }

.wi { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; flex: none; }
.fig { font-family: var(--display); font-weight: 300; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.caps { font-size: 10px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); }

/* ============================================================ panel */
#forecast {
  /* chart geometry: must match CONFIG.geometry in data.js */
  --dayw: 106px; --gutl: 34px; --gutr: 40px;
  --cw: 816px;   /* content width, set by app.js */
  position: relative;
  padding: 16px 20px 10px;
  flex: none;
  background: rgba(var(--ink), var(--panel-alpha));
  border: 1px solid var(--line);
}
#forecast > * { width: var(--cw); }

/* ---------- header ---------- */
#forecast .fc-current { display: flex; align-items: center; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
#forecast .cur-left { display: flex; align-items: center; gap: 12px; }
#forecast .cur-icon { color: #aebbca; line-height: 0; }
#forecast .cur-icon .wi { width: 34px; height: 34px; stroke-width: 1.3; }
#forecast .cur-temp { font-size: 44px; line-height: 1; }
#forecast .cur-temp .deg { font-size: 24px; font-weight: 300; color: var(--haze); }
#forecast .cur-right { flex: 1; min-width: 0; }
#forecast .cur-place { font-size: 10px; font-weight: 600; letter-spacing: 0.26em; text-transform: uppercase; color: var(--haze); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#forecast .cur-cond { font-size: 15px; color: #c3cedb; margin: 3px 0 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#forecast .cur-meta { display: flex; gap: 14px; font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); white-space: nowrap; }
#forecast .cur-meta b { color: #c3cedb; font-weight: 500; font-variant-numeric: tabular-nums; }
#forecast .head-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
#forecast .gear { background: none; border: 1px solid transparent; color: var(--faint); cursor: pointer; padding: 2px 5px; line-height: 0; opacity: 0.5; transition: opacity 0.3s ease; }
#forecast:hover .gear { opacity: 1; }
#forecast .gear:hover { color: var(--mist); }
#forecast .gear[aria-expanded="true"] { color: var(--mist); border-color: rgba(200, 214, 228, 0.24); background: rgba(200, 214, 228, 0.06); }
#forecast .gear .wi { width: 13px; height: 13px; }
#forecast .fc-clock { text-align: right; }
#forecast .fc-clock[hidden] { display: none; }
#forecast .clock-time { font-size: 30px; line-height: 1; }
#forecast .clock-time .secs { font-size: 15px; color: var(--haze); font-weight: 300; }
#forecast .clock-date { letter-spacing: 0.26em; margin-top: 4px; color: var(--haze); }

/* ---------- settings strip ---------- */
#forecast .settings { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--haze); }
#forecast .settings[hidden] { display: none; }
#forecast .settings label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
#forecast .settings input[type="text"], #forecast .settings select { background: rgba(200, 214, 228, 0.05); border: 1px solid rgba(200, 214, 228, 0.18); color: var(--mist); font: inherit; letter-spacing: 0.04em; text-transform: none; padding: 3px 7px; min-width: 0; }
#forecast .settings input[type="text"] { width: 170px; }
#forecast .settings select option { background: #0b0d11; }
#forecast .settings input[type="checkbox"] { accent-color: var(--ember); }
#forecast .settings button { margin-left: auto; background: rgba(200, 214, 228, 0.06); border: 1px solid rgba(200, 214, 228, 0.24); color: var(--mist); font: inherit; letter-spacing: 0.16em; padding: 3px 10px; cursor: pointer; }

/* ---------- nowcast ---------- */
#forecast .fc-nowcast { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
#forecast .fc-nowcast .nc-ic { width: 16px; height: 16px; color: var(--rain-text); }
#forecast .nc-body { flex: 1; min-width: 0; }
#forecast .nc-label { letter-spacing: 0.16em; color: var(--haze); }
#forecast .nc-label span { color: #c3cedb; }
#forecast .nc-strip { display: flex; align-items: flex-end; gap: 2px; height: 20px; margin-top: 5px; border-bottom: 1px solid rgba(200, 214, 228, 0.2); }
#forecast .nc-strip i { flex: 1; background: rgba(127, 168, 201, 0.45); min-height: 1px; }
#forecast .nc-axis { display: flex; justify-content: space-between; font-size: 8.5px; margin-top: 2px; letter-spacing: 0.06em; }

/* ---------- day columns ---------- */
#forecast .days { display: flex; padding: 12px var(--gutr) 0 var(--gutl); }
#forecast .day { flex: 0 0 var(--dayw); width: var(--dayw); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 7px 6px 9px; text-align: center; position: relative; opacity: 0.8; }
#forecast .day + .day { border-left: 1px solid var(--line-soft); }
#forecast .day.today { opacity: 1; }
#forecast .day.today::before { content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 15px; height: 1px; background: var(--ember); }
#forecast .day.today::after { content: ""; position: absolute; top: -1px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; background: var(--ember); }
#forecast .d-name { font-size: 10px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: #c3cedb; }
#forecast .day:not(.today) .d-name { color: var(--haze); font-weight: 400; }
#forecast .d-date { font-size: 9px; margin-top: -2px; letter-spacing: 0.14em; }
#forecast .d-icon { color: #aebbca; line-height: 0; margin: 3px 0 1px; }
#forecast .d-icon .wi { width: 22px; height: 22px; stroke-width: 1.4; }
#forecast .day:not(.today) .d-icon { color: var(--haze); }
#forecast .d-temps { font-size: 14px; line-height: 1.25; }
#forecast .d-max { color: var(--ember); }
#forecast .d-min { color: var(--ice); font-size: 12px; margin-left: 4px; }
#forecast .d-rain { margin-top: 3px; align-self: stretch; font-size: 10px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--rain-text); padding: 0 8px 3px; border-bottom: 2px solid rgba(127, 168, 201, var(--pp, 0.06)); white-space: nowrap; }
#forecast .d-rain.dry { color: #8b9aab; }
#forecast .d-rain small { font-size: 8.5px; font-weight: 400; opacity: 0.85; margin-left: 3px; }

/* ---------- hourly chart ---------- */
#forecast .chart { position: relative; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
#forecast .chart[hidden] { display: none; }
#forecast .c-svg { display: block; }
#forecast .c-grid { stroke: rgba(232, 238, 246, 0.06); stroke-width: 1; }
#forecast .c-base { stroke: rgba(232, 238, 246, 0.2); stroke-width: 1; }
#forecast .c-sep { stroke: rgba(200, 214, 228, 0.12); stroke-width: 1; }
#forecast .c-now { stroke: #aebbca; stroke-width: 1.2; stroke-dasharray: 5 4; }
#forecast .c-ax { font-size: 9.5px; font-weight: 500; font-family: inherit; font-variant-numeric: tabular-nums; }
#forecast .c-ax.t { fill: var(--ember); text-anchor: end; }
#forecast .c-ax.p { fill: var(--rain-text); text-anchor: start; opacity: 0.9; }
#forecast .c-ax.w { fill: #8b9aab; text-anchor: start; }
#forecast .c-unit { font-size: 8.5px; font-weight: 600; font-family: inherit; fill: var(--faint); letter-spacing: 0.1em; }
#forecast .c-cross { position: absolute; top: 10px; width: 1px; background: rgba(232, 238, 246, 0.55); pointer-events: none; }
#forecast .c-cross[hidden] { display: none; }
#forecast .c-tip { position: absolute; min-width: 148px; padding: 8px 11px; background: rgba(8, 13, 20, 0.96); border: 1px solid rgba(200, 214, 228, 0.16); font-size: 11px; line-height: 1.65; pointer-events: none; z-index: 5; white-space: nowrap; }
#forecast .c-tip[hidden] { display: none; }
#forecast .c-tip b { font-variant-numeric: tabular-nums; float: right; margin-left: 14px; font-weight: 500; }
#forecast .c-tip .tt-when { color: var(--haze); font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: 3px; }
#forecast .c-tip .tt-row { color: #aebbca; }
#forecast .c-tip .tt-row .wi { width: 12px; height: 12px; margin-right: 6px; }
#forecast .c-tip .tt-temp .wi, #forecast .c-tip .tt-temp b { color: var(--ember); }
#forecast .c-tip .tt-rain .wi, #forecast .c-tip .tt-rain b { color: var(--rain-text); }
#forecast .c-tip .tt-wind b { color: #c4d2e0; }
#forecast .c-tip .tt-dir { display: inline-block; font-weight: 400; }
#forecast .c-legend { display: flex; gap: 16px; justify-content: center; margin-top: 4px; font-size: 9.5px; color: var(--faint); letter-spacing: 0.04em; }
#forecast .c-legend i { display: inline-block; width: 14px; height: 2px; margin-right: 5px; vertical-align: middle; }

/* ---------- sun & moon ---------- */
#forecast .sky { display: grid; grid-template-columns: 1.35fr 1.2fr 0.8fr; margin-top: 10px; border-top: 1px solid var(--line); }
#forecast .sky-cell { display: flex; align-items: center; gap: 12px; padding: 12px 10px 10px; min-width: 0; }
#forecast .sky-cell + .sky-cell { border-left: 1px solid var(--line-soft); }
#forecast .sky-text { min-width: 0; }
#forecast .sky-title { font-size: 8px; letter-spacing: 0.2em; }
#forecast .sky-main { font-size: 13px; color: #c3cedb; margin-top: 2px; white-space: nowrap; }
#forecast .sky-main b { font-weight: 500; color: var(--mist); font-variant-numeric: tabular-nums; }
#forecast .sky-main span { color: var(--haze); font-size: 11px; }
#forecast .sky-sub { font-size: 8.5px; margin-top: 3px; letter-spacing: 0.14em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#forecast .sun-arc { width: 132px; height: 44px; flex: none; }
#forecast .moon-disc { width: 44px; height: 44px; flex: none; }
#forecast .sky-next .sky-main { font-size: 20px; line-height: 1; color: var(--mist); }

/* ---------- environment row ---------- */
#forecast .extras { display: grid; grid-template-columns: repeat(5, 1fr); margin-top: 0; border-top: 1px solid var(--line); }
#forecast .ex-tile { padding: 10px 4px 8px; text-align: center; color: var(--haze); min-width: 0; overflow: hidden; }
#forecast .ex-tile + .ex-tile { border-left: 1px solid var(--line-soft); }
#forecast .ex-tile .wi { width: 17px; height: 17px; }
#forecast .ex-val { font-size: 13px; color: var(--mist); margin-top: 4px; white-space: nowrap; }
#forecast .ex-val small { font-size: 9px; color: var(--haze); font-weight: 400; margin-left: 4px; }
#forecast .ex-val small.good, #forecast .good { color: var(--good); }
#forecast .ex-val small.bad, #forecast .bad { color: var(--bad); }
#forecast .ex-name { font-size: 8px; letter-spacing: 0.2em; margin-top: 2px; white-space: nowrap; }

/* ---------- footer ---------- */
#forecast .panel-foot { display: flex; justify-content: space-between; align-items: baseline; padding-top: 9px; margin-top: 2px; border-top: 1px solid var(--line-soft); font-size: 9.5px; letter-spacing: 0.14em; color: var(--faint); white-space: nowrap; }
#forecast .updated { font-weight: 600; }
#forecast .updated.stale { color: var(--bad); }

@media (prefers-reduced-motion: reduce) { #forecast * { transition: none !important; } }
