/* lp-forecast.css: forecast section (js/lp-forecast.js). Keeps the livepow look:
   #2d5886 headers, zebra (day/night) columns, legacy series colours. */

.lp-fc { text-align: left; font-size: 14px; line-height: 1.35; }
.lp-fc .sn { color: #6481c1; }
.lp-fc .rn { color: #009933; }
.lp-fc .hi { color: #cc0000; }
.lp-fc .lo { color: #0000cc; }
.lp-fc .mut { color: #777; }
.lp-fc .warn { color: #cc0000; font-weight: 700; }

/* Model and level chips */
.lp-fc-bar { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.lp-fc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lp-fc-chip, .lp-fc-tog {
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  min-height: 32px; padding: 4px 11px; color: #2d5886; background: #b3cce6;
  border: 0; border-radius: 5px 10px 5px 10px; box-shadow: inset 0 0 5px #2d5886;
}
.lp-fc-chip:hover, .lp-fc-tog:hover { background: #9fbddf; }
.lp-fc-chip.on, .lp-fc-tog.on { background: #2d5886; color: #f2f2f2; box-shadow: inset 0 0 6px #fff; }
.lp-fc-chip.off { background: #eaeaea; color: #aaa; box-shadow: inset 0 0 4px #aaa; cursor: default; }
.lp-fc-chip small { font-weight: 400; font-size: 11px; opacity: .85; }
.lp-fc-chip:focus-visible, .lp-fc-tog:focus-visible, .lp-fc-scroll:focus-visible { outline: 2px solid #336699; outline-offset: 2px; }
.lp-fc-levels .lp-fc-chip { font-size: 12px; min-height: 28px; }
.lp-fc-levels .lp-fc-chip small { font-weight: 700; opacity: 1; }
/* Whistler + GFS: legacy livepow GFS points (scroll sideways on phones instead of wrapping into 4 rows) */
.lp-fc-gfsloc { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 2px 1px 4px; scrollbar-width: thin; }
.lp-fc-gfsloc .lp-fc-chip { font-size: 12px; min-height: 28px; white-space: nowrap; flex: none; }
@media (min-width: 720px) { .lp-fc-gfsloc { flex-wrap: wrap; overflow-x: visible; } }

.lp-fc-info { font-size: 12px; color: #555; margin: 2px 0 4px; }
/* "Model at 1,411 m – updated 3 h ago" + the (i) button */
.lp-fc-mline { display: flex; align-items: center; gap: 6px; min-height: 26px; }
.lp-fc-ibtn {
  flex: none; width: 26px; height: 26px; padding: 0; margin: 0; border: 0; background: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; color: var(--lp-accent, #2d5886);
}
.lp-fc-ibtn span {
  display: block; width: 18px; height: 18px; box-sizing: border-box; border: 1.5px solid currentColor; border-radius: 50%;
  font: italic 700 12px/15px Georgia, 'Times New Roman', serif; text-align: center;
}
.lp-fc-ibtn:hover span { background: var(--lp-accent, #2d5886); color: var(--lp-surface, #fff); border-color: var(--lp-accent, #2d5886); }
.lp-fc-ibtn:focus-visible { outline: 2px solid #336699; outline-offset: 0; border-radius: 50%; }
.lp-fc-elev { font-weight: 700; color: #222; }
.lp-fc-table .lp-fc-at b { font-weight: 700; font-size: 11px; }
.lp-fc-point { color: var(--lp-accent, #2d5886); }
/* Attribution at the bottom of the panel */
.lp-fc-foot { margin-top: 10px; }
.lp-fc-foot:empty { display: none; }
.lp-fc-credit { font-size: 11px; color: #777; }

/* Info dialog: model facts (tabs per model), this location, day/night hours */
.lp-fc-dlg {
  position: fixed; inset: 0; margin: auto; width: min(440px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 48px));
  height: fit-content; overflow: auto; box-sizing: border-box; padding: 14px 16px 16px; border: 0; border-radius: 10px;
  background: var(--lp-surface, #fff); color: var(--lp-text, #222); box-shadow: 0 8px 32px rgba(0,0,0,.35);
  font-size: 14px; line-height: 1.45; text-align: left; z-index: 1000;
}
.lp-fc-dlg:not([open]) { display: none; }
.lp-fc-dlg::backdrop { background: rgba(10, 20, 35, .45); }
.lp-fc-dlg-top { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.lp-fc-dlg-h { flex: 1; margin: 2px 0 0; font-size: 16px; color: var(--lp-accent, #2d5886); }
.lp-fc-dlg-x {
  flex: none; width: 32px; height: 32px; margin: -6px -8px 0 0; border: 0; border-radius: 50%; background: none; cursor: pointer;
  font-size: 24px; line-height: 30px; color: var(--lp-muted, #666);
}
.lp-fc-dlg-x:hover, .lp-fc-dlg-x:focus-visible { background: var(--lp-surface-2, #f2f4f7); color: var(--lp-text, #222); }
.lp-fc-dlg-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; border-bottom: 1px solid var(--lp-border, #e3e3e3); padding-bottom: 8px; }
.lp-fc-dlg-tab {
  font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; min-height: 30px; padding: 3px 10px; border: 0;
  border-radius: 5px 10px 5px 10px; background: var(--lp-blue-3, #b3cce6); color: var(--lp-on-blue-3, #2d5886);
}
.lp-fc-dlg-tab.na { opacity: .6; }
.lp-fc-dlg-tab.on { background: var(--lp-blue, #2d5886); color: #fff; opacity: 1; }
.lp-fc-dlg-tab:focus-visible { outline: 2px solid #336699; outline-offset: 2px; }
.lp-fc-dlg-b:focus { outline: none; }
.lp-fc-dlg-b p { margin: 0 0 6px; }
.lp-fc-dlg-lead { font-size: 14px; }
.lp-fc-dlg-facts { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 6px 0 4px; font-size: 13px; }
.lp-fc-dlg-facts dt { font-weight: 700; color: var(--lp-muted, #5f6670); }
.lp-fc-dlg-facts dd { margin: 0; }
.lp-fc-dlg-h4 { margin: 12px 0 4px; font-size: 13px; color: var(--lp-accent, #2d5886); }
.lp-fc-dlg .mut { color: var(--lp-muted, #5f6670); font-size: 12px; }
@media (max-width: 400px) { .lp-fc-dlg-facts { grid-template-columns: 1fr; gap: 0; } .lp-fc-dlg-facts dd { margin-bottom: 4px; } }

/* Free-account button: outside the panel, above the forecast section (renderCta) */
.lp-fc-cta-wrap { display: flex; justify-content: center; margin: 0 0 16px; }
.lp-fc-cta-wrap[hidden] { display: none; }
.lp-fc-cta {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%; box-sizing: border-box; padding: 9px 16px;
  border-radius: var(--lp-radius, 5px 10px 5px 10px); background: var(--lp-blue, #2d5886); color: #fff !important;
  box-shadow: var(--lp-glow, 0 0 5px #2d5886), inset 0 0 6px rgba(255,255,255,.45); font-weight: 700; font-size: 14px; line-height: 1.3;
  text-decoration: none; text-align: left;
}
.lp-fc-cta:hover { background: #24476d; }
.lp-fc-cta:focus-visible { outline: 2px solid #336699; outline-offset: 2px; }
.lp-fc-cta-ico { font-size: 16px; }
html[data-theme=dark] .lp-fc-cta { background: var(--lp-blue-2, #4a78aa); }
html[data-theme=dark] .lp-fc-cta:hover { background: var(--lp-blue-2h, #5b8bc0); }
.lp-fc-totals { display: flex; flex-wrap: wrap; column-gap: 14px; row-gap: 2px; font-size: 13px; margin: 2px 0 8px; }
.lp-fc-totals { min-width: 0; max-width: 100%; }
/* Each total stays on one line where it fits; on narrow phones (320 px) it may wrap between its parts. */
.lp-fc-totals .w { white-space: nowrap; max-width: 100%; }
.lp-fc-totals .w > span { white-space: nowrap; }
@media (max-width: 400px) { .lp-fc-totals .w { white-space: normal; } }
.lp-fc-totals b { font-weight: 700; color: #333; margin-right: 2px; }
.lp-fc-tools { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.lp-fc-units { margin-left: auto; }
.lp-fc-tools[hidden] { display: none; }
/* the units toggle in the "Detailed charts" heading row, left of the chevron (renderTools) */
.lp-fc-hourly .lp-col-t { position: relative; }
.lp-fc-tog.lp-fc-units-h { position: absolute; right: 32px; top: 50%; transform: translateY(-50%); margin: 0; }
.lp-fc-loading, .lp-fc-note { color: #666; font-size: 13px; margin: 10px 0; }
.lp-fc-loading::before {
  content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px;
  border: 2px solid #b3cce6; border-top-color: #2d5886; border-radius: 50%; animation: lp-fc-spin .8s linear infinite;
}
@keyframes lp-fc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .lp-fc-loading::before { animation: none; } }
.lp-fc-small { font-size: 11px; color: #666; margin: 4px 0 0; }
.lp-fc-h { font-size: 14px; color: #2d5886; margin: 12px 0 4px; }

/* Table: scrolls inside its own box with a sticky label column. */
.lp-fc-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; overscroll-behavior-x: contain; }
.lp-fc-table { border-collapse: separate; border-spacing: 0; font-size: 12px; text-align: center; white-space: nowrap; }
.lp-fc-table th, .lp-fc-table td { padding: 2px 3px; border-right: 1px solid rgba(0,0,0,.08); border-bottom: 1px solid rgba(0,0,0,.08); }
.lp-fc-table td { min-width: var(--lp-fc-cw, 46px); max-width: var(--lp-fc-cw, 52px); width: var(--lp-fc-cw, 52px); background: #f2f2f2; }
/* --lp-fc-cw: forecast columns widen (JS, fitTable) so the table opens with only the Historical bar left of them. */
.lp-fc-table td.n { background: #e2e6ec; }
.lp-fc-sky td.now { box-shadow: inset 0 3px 0 #cc0000; }
.lp-fc-table td.now { background: #fff6dc; }
.lp-fc-table td.n.now { background: #ece6d2; }
.lp-fc-table thead th { background: #2d5886; color: #f2f2f2; font-weight: 700; padding: 5px 3px; border-right-color: rgba(255,255,255,.35); }
.lp-fc-table tbody th, .lp-fc-table .lp-fc-time th {
  position: sticky; left: 0; z-index: 1; background: #fff; text-align: left; font-weight: 700;
  font-size: 11px; line-height: 1.2; min-width: 44px; padding-left: 5px; box-shadow: 1px 0 0 rgba(0,0,0,.12);
}
.lp-fc-table thead th:first-child { position: sticky; left: 0; z-index: 2; font-size: 10px; font-weight: 400; line-height: 1.15; }
.lp-fc-table th small, .lp-fc-table td small { font-size: 10px; font-weight: 400; color: #666; }
/* Day header: full day name over the date ("Dec 1"), smaller and not bold */
.lp-fc-table thead .lp-fc-dt { display: block; font-size: 10px; font-weight: 400; line-height: 1.2; opacity: .9; }
/* A slightly thicker line between whole days (td/th.de = the last column of a date) */
.lp-fc-table td.de { border-right: 2px solid rgba(0,0,0,.26); }
.lp-fc-table thead th.de { border-right: 2px solid rgba(255,255,255,.7); }
html[data-theme=dark] .lp-fc-table td.de { border-right-color: rgba(255,255,255,.28); }
html[data-theme=dark] .lp-fc-table thead th.de { border-right-color: rgba(255,255,255,.55); }
.lp-fc-time td { font-size: 10px; color: #555; }
.lp-fc-sky img { display: block; margin: 0 auto; width: 40px; height: 34px; }
.lp-fc-temp b { font-size: 13px; }
.lp-fc-frz span { font-size: 11px; }
/* Snow / rain row: as tall as its contents. Every cell holds the same text lines (snow and/or rain, whichever the
   table uses; line-height in em so larger text grows the row) and a bar area of --lp-fc-pcb (tableHtml: the
   tallest snow + rain stack), so the bars share one baseline and nothing spills out of the cell. */
.lp-fc-precip td { vertical-align: top; padding: 2px 1px; }
.lp-fc-pc { display: flex; flex-direction: column; align-items: center; font-size: 10px; font-weight: 700; line-height: 1.3; }
.lp-fc-pc > span { display: block; max-width: 100%; letter-spacing: -.01em; }
.lp-fc-bars { flex: none; height: var(--lp-fc-pcb, 0px); width: 38px; max-width: 100%; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; }
.lp-fc-bars i { display: block; width: 100%; }
.lp-fc-bars i.sn { background: #7491d1; }
.lp-fc-bars i.rn { background: #009933; }
.lp-fc-wind span { font-weight: 700; line-height: 1.15; }
.lp-fc-day td { background: #fff; font-size: 11px; font-weight: 700; white-space: normal; line-height: 1.25; }

/* Past forecast columns (left of the striped "Historical" bar) */
.lp-fc-table td.p { background: #e8e8e8; color: #555; min-width: 46px; width: 52px; max-width: 52px; }
.lp-fc-table td.p.n { background: #d8dbe1; }
.lp-fc-table thead th.p { background: repeating-linear-gradient(135deg, rgba(255,255,255,0) 0 5px, rgba(255,255,255,.16) 5px 10px) #5f7898; }
.lp-fc-table td.p img { opacity: .8; }
.lp-fc-table .lp-fc-hdiv {
  width: 22px; min-width: 22px; max-width: 22px; padding: 0; text-align: center; vertical-align: middle;
  background: repeating-linear-gradient(135deg, #2d5886 0 5px, #b3cce6 5px 10px); border-right: 0;
}
.lp-fc-table thead th.lp-fc-hdiv { background: repeating-linear-gradient(135deg, #2d5886 0 5px, #b3cce6 5px 10px); }
.lp-fc-harr, .lp-fc-hv { display: block; margin: 0 auto; background: rgba(255,255,255,.94); color: #2d5886; font-weight: 700; }
.lp-fc-harr { width: 18px; height: 18px; line-height: 17px; border-radius: 50%; font-size: 13px; margin-bottom: 6px; }
.lp-fc-hv {
  writing-mode: vertical-rl; transform: rotate(180deg); width: 16px; padding: 8px 0; border-radius: 3px;
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase; line-height: 16px;
}
.lp-fc-pastnote { margin: 3px 0 0; }

/* Long-range lock (gate tier basic: doc.trimmed) */
.lp-fc-table .lp-fc-lockh { background: #5f7898; font-size: 11px; }
.lp-fc-table td.lp-fc-lock {
  width: 124px; min-width: 124px; max-width: 132px; white-space: normal; vertical-align: middle;
  background: repeating-linear-gradient(135deg, #f3f6fb 0 8px, #e6ecf5 8px 16px);
}
.lp-fc-lockin { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 6px; font-size: 12px; font-weight: 700; color: #2d5886; line-height: 1.3; }
.lp-fc-lockico { font-size: 22px; }
.lp-fc-lockbtn {
  display: inline-block; padding: 6px 10px; border-radius: 5px 10px 5px 10px; background: #2d5886; color: #f2f2f2 !important;
  text-decoration: none; font-size: 12px; box-shadow: inset 0 0 6px #fff;
}
.lp-fc-lockbtn:hover { background: #24476d; }

/* "Detailed charts" sub-section (LP.collapsible "fc-hourly", or the <details> fallback) */
.lp-fc-hourly { margin: 6px 0 0; }
.lp-fc-hourly[hidden] { display: none; }
/* The model buttons again under the detailed charts */
.lp-fc-botbar { margin: 8px 0 2px; }
.lp-fc-botbar[hidden] { display: none; }
.lp-fc-det > summary { cursor: pointer; font-weight: 700; color: #2d5886; font-size: 14px; padding: 6px 0; }
.lp-fc-det > summary:focus-visible { outline: 2px solid #336699; outline-offset: 2px; }

/* Charts: headings sit tight on the plots (legend above the temperature/precip plot) */
.lp-fc-charts[hidden] { display: none; }
.lp-fc-h.lp-fc-ch { margin: 2px 0 0; line-height: 1.2; }
.lp-fc-chart + .lp-fc-h.lp-fc-ch { margin-top: 4px; }
.lp-fc-lgtop .uplot { display: flex; flex-direction: column; }
.lp-fc-lgtop .u-legend { order: -1; margin: 0 0 1px; }
.lp-fc-chart .u-legend .u-series > * { padding: 1px 2px; }
.lp-fc-chart .u-legend tr { line-height: 1.25; }
.lp-fc-chart { width: 100%; min-height: 60px; overflow: hidden; }
/* Sideways scrolling: a native scroller whose sticky viewport holds the plot; the scroll position sets the time window. */
.lp-fc-cscroll { overflow-x: hidden; overflow-y: hidden; max-width: 100%; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.lp-fc-cscroll.on { overflow-x: auto; }
.lp-fc-cscroll:focus-visible { outline: 2px solid #336699; outline-offset: 2px; }
.lp-fc-ctrack { position: relative; }
.lp-fc-cview { position: sticky; left: 0; }
/* The "now" marker over the plot, pulsing */
.lp-fc-now {
  position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; pointer-events: none; z-index: 2;
  background: #cc0000; border-radius: 1px; animation: lp-fc-pulse 2.2s ease-in-out infinite;
}
@keyframes lp-fc-pulse {
  0%, 100% { opacity: .5; box-shadow: 0 0 0 0 rgba(204,0,0,0); }
  50% { opacity: 1; box-shadow: 0 0 5px 2px rgba(204,0,0,.35); }
}
@media (prefers-reduced-motion: reduce) { .lp-fc-now { animation: none; opacity: .85; } }
.lp-fc-chart .u-legend { font-size: 11px; text-align: left; }
.lp-fc-chart .u-legend .u-series { padding: 0 4px; }
.lp-fc-chart .u-legend th { font-weight: 400; }

@media (max-width: 480px) {
  .lp-fc { font-size: 13px; }
  .lp-fc-table td { min-width: 44px; width: 46px; }
  .lp-fc-chip, .lp-fc-tog { padding: 4px 9px; }
  .lp-fc-chart .u-legend { font-size: 10px; }
}

/* Past-forecast lock (gate histTrimmed: no account sees the last 48 h): far left of the past columns */
.lp-fc-table td.lp-fc-hlock {
  width: 116px; min-width: 116px; max-width: 124px; white-space: normal; vertical-align: middle;
  background: repeating-linear-gradient(135deg, #f3f6fb 0 8px, #e6ecf5 8px 16px);
  border-right: 2px solid #b3cce6;
}
.lp-fc-table thead th.lp-fc-hlockh { background: #5f7898; font-size: 11px; }

/* Model point far below the base, nothing better nearby */
.lp-fc-lowpt { font-size: 12px; color: #8a4b00; background: #fff4e0; border-left: 3px solid #d96c00; padding: 2px 6px; margin: 3px 0 1px; border-radius: 2px; }
html[data-theme=dark] .lp-fc-lowpt { color: #ffcf99; background: rgba(217,108,0,.16); border-left-color: #e08a2c; }
html[data-theme=dark] .lp-fc-dlg { border: 1px solid var(--lp-border-2, #3a4552); }
html[data-theme=dark] .lp-fc-dlg::backdrop { background: rgba(0, 0, 0, .62); }
