/* KPI strip */
.kpi-bar { display: flex; gap: 10px; flex: none; overflow-x: auto; scrollbar-width: thin; }
.kpis { display: contents; }
.kpi { flex: 1 1 132px; min-width: 132px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 14px 12px; }
.kpi.wide { flex: 2 1 270px; min-width: 270px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; align-items: center; }
.kpi .lbl { font-size: 11px; color: var(--muted); font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }   /* wraps: a cut-off label hides the unit or the comparison */
.kpi .val { font-size: 24px; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; margin-top: 5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kpi .val.dim { color: var(--muted); }
.kpi .val.txt { font-size: 17px; line-height: 1.7; letter-spacing: -.01em; }
.kpi.wide .val { font-size: 30px; line-height: 1.1; }
.kpi .val small { font-size: 12px; font-weight: 500; color: var(--ink-2); letter-spacing: 0; margin-left: 4px; }
.kpi .sub { font-size: 11.5px; color: var(--ink-2); margin-top: 4px; line-height: 1.35; overflow-wrap: anywhere; }
.kpi .sub .badge { margin-top: 0; }
.kpi .vrow { display: flex; align-items: center; gap: 10px; margin-top: 5px; }
.kpi .vrow .val { margin-top: 0; }
.kpi .vrow .badge { margin-top: 2px; }
.kpi .sub .m { color: var(--muted); }
.kpi.wide > div:first-child { min-width: 0; }
.kpi svg.spark { width: 104px; height: 44px; flex: none; }
.kpi.empty-kpi { flex: 3 1 300px; display: flex; align-items: center; color: var(--ink-2); font-size: 13px; }
.badge { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 1px 7px 1px 5px; border-radius: 10px; margin-top: 4px; }
.badge svg { width: 10px; height: 10px; }
.badge.ok { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good-ink); }
.badge.warn { background: color-mix(in srgb, var(--warning) 20%, transparent); color: var(--warning-ink); }
.badge.info { background: var(--surface-2); color: var(--ink-2); }
.up { color: var(--ink); } .down { color: var(--ink); }

.details { margin-top: 12px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; font-size: 12.5px; }
.kv > span:nth-child(odd) { color: var(--muted); }
.kv > span:nth-child(even) { font-variant-numeric: tabular-nums; }
.status-list { margin-top: 10px; display: flex; flex-direction: column; gap: 3px; }
.status-list:empty { display: none; }
.progress { position: absolute; top: 52px; left: 0; right: 0; height: 3px; z-index: 1002; overflow: hidden; }
.progress .bar { height: 100%; width: 0; background: var(--accent); transition: width .3s; }
/* "This week" operations cards */
.op-card { padding: 11px 0 12px; border-top: 1px solid var(--line); }
.op-card:first-of-type { border-top: none; padding-top: 2px; }
.op-card:empty { display: none; }
.op-h { font-size: 11px; font-weight: 650; color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; display: flex; gap: 8px; align-items: baseline; }
.op-h .note { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 11px; }
.op-h.sm { margin-top: 10px; font-size: 10.5px; }
.op-main { display: flex; align-items: center; gap: 8px; margin: 6px 0 4px; flex-wrap: wrap; }
.op-main .big { font-size: 26px; font-weight: 650; letter-spacing: -.02em; line-height: 1.1; }
.op-main .unit { color: var(--ink-2); font-size: 12px; font-weight: 550; }
.op-main .sub2 { color: var(--muted); font-size: 11.5px; flex-basis: 100%; margin-top: -2px; }
.op-main .badge { margin-top: 0; }
.op-main svg.spark { margin-left: auto; width: 120px; height: 34px; }
.op-main.dim .big { color: var(--muted); }
.calc { font-size: 12px; color: var(--ink-2); line-height: 1.5; margin-top: 4px; font-variant-numeric: tabular-nums; }
.op-card .note { margin-top: 5px; font-size: 11px; line-height: 1.4; }
.op-card .note a { color: var(--accent); }
.op-card .row { margin-top: 10px; }
.alerts { list-style: none; margin: 7px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.alerts li { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 5px 8px; border-radius: 6px; background: var(--surface-2); }
.alerts li.warn { background: color-mix(in srgb, var(--warning) 16%, var(--surface-2)); }
.alerts li .t { flex: 1; min-width: 0; color: var(--ink-2); }
.alerts li .t b { color: var(--ink); font-weight: 600; }
.alerts li .d { color: var(--muted); font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.alerts li.none { color: var(--muted); }
.ai { width: 14px; height: 14px; flex: none; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 10px; line-height: 1; }
.ai.frost::before { content: "❄"; color: var(--s1); }
.ai.heat::before { content: "▲"; color: var(--s8); font-size: 9px; }
.ai.rain::before { content: "●"; color: var(--s7); font-size: 8px; }
.sws { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-top: 6px; }
.sw { display: flex; flex-direction: column; align-items: center; padding: 4px 0; border-radius: 6px; background: color-mix(in srgb, var(--good) 13%, var(--surface-2));
  font-size: 10.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.sw b { font-weight: 600; color: var(--ink); font-size: 10.5px; }
.sw.no { background: var(--surface-2); color: var(--muted); }
svg.smoke { width: 100%; height: 14px; margin-top: 7px; display: block; }
.setgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin-top: 8px; }
.setf { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--ink-2); font-weight: 550; }
.setf .inp { position: relative; display: flex; }
.setf input { font: inherit; width: 100%; height: 30px; padding: 0 44px 0 8px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: var(--raised); color: var(--ink); font-variant-numeric: tabular-nums; }
.setf em { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--muted); font-size: 11px; font-weight: 400; pointer-events: none; }

/* Wind (ops/wind.js) */
.wa { width: 14px; height: 14px; flex: none; }
.sw.wd { background: var(--surface-2); color: var(--ink-2); gap: 1px; }
.sw.wd span { font-size: 10px; white-space: nowrap; }

/* A card with nothing to act on right now (out of season): one quiet line */
.op-quiet { display: flex; gap: 8px; align-items: baseline; font-size: 12px; color: var(--muted); }
.op-quiet b { color: var(--ink-2); font-weight: 600; white-space: nowrap; }

/* Tabs in the insights column: only the cards whose data-tab names the chosen tab are shown */
.seg.tabs { display: flex; position: sticky; top: 0; z-index: 2; margin: 10px 12px 0; }
.seg.tabs label { flex: 1; text-align: center; }
.seg.tabs span { padding: 5px 6px; white-space: nowrap; }
html:not(.print-layout) #insights[data-tab="week"] [data-tab]:not([data-tab~="week"]),
html:not(.print-layout) #insights[data-tab="around"] [data-tab]:not([data-tab~="around"]),
html:not(.print-layout) #insights[data-tab="site"] [data-tab]:not([data-tab~="site"]),
html:not(.print-layout) #insights[data-tab="water"] [data-tab]:not([data-tab~="water"]),
html:not(.print-layout) #insights[data-tab="weather"] [data-tab]:not([data-tab~="weather"]) { display: none; }
html.print-layout #insightTabs { display: none; }
#insights[data-tab="around"] #opsAround { border-top: none; padding-top: 2px; }
