/* Reusable components: form fields, period bar, cards, hero panel, buttons, table, chips. */

/* ── Form fields (the login form) ── */
.field{ display:flex; flex-direction:column; gap:6px; margin-bottom:14px; }
.field label{ font-size:12px; font-weight:600; color:var(--gray-600); }
.field input{
  background:var(--gray-25); border:1px solid var(--border); color:var(--text-primary);
  padding:9px 11px; border-radius:var(--radius-sm); font-size:13px; font-family:inherit; width:100%;
}
.field input:focus{ outline:none; border-color:var(--slt-blue-500); box-shadow:0 0 0 3px var(--focus-ring); }

/* ── Report period bar (page header) ──
 * Dark segmented bar — ‹ › · Present · span menu · date · calendar — modelled
 * on the Web Portal's chart period control, plus a timezone select beside it. */
.period-controls{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.period-bar{
  position:relative; display:flex; align-items:stretch; height:34px;
  background:var(--slt-navy-600); border-radius:var(--radius-sm); box-shadow:var(--shadow-sm);
}
.pb-btn{
  display:flex; align-items:center; gap:6px; padding:0 12px; border:none; background:transparent;
  color:#fff; font-size:13px; font-weight:600; cursor:pointer; white-space:nowrap;
}
.pb-btn:first-child{ border-radius:var(--radius-sm) 0 0 var(--radius-sm); }
.pb-btn:hover:not(:disabled){ background:rgba(255,255,255,.12); }
.pb-btn:disabled{ color:rgba(255,255,255,.35); cursor:default; }
.pb-btn:focus-visible, .pb-cal-btn:focus-visible{ outline:2px solid var(--slt-blue-500); outline-offset:-2px; }
.pb-step{ padding:0 11px; font-size:18px; line-height:1; }
.pb-chevron{ width:12px; height:12px; }
.pb-span{ position:relative; display:flex; }

/* Sized to its label (periodPicker.js sets --label-ch), which runs from
 * "27/9/2026" up to a zoom's "27/9 22:00 – 28/9/2026 04:00". */
.pb-date{
  width:max(128px, calc(var(--label-ch, 10) * 1ch + 24px)); min-width:0;
  border:none; padding:0 12px; background:#fff; color:var(--text-primary);
  font-size:13px; font-family:inherit; cursor:pointer;
}
.pb-date:focus{ outline:none; box-shadow:inset 0 0 0 2px var(--slt-blue-500); }
.pb-cal-btn{
  display:flex; align-items:center; justify-content:center; width:36px; border:none; cursor:pointer;
  background:var(--slt-navy-700); color:#fff; border-radius:0 var(--radius-sm) var(--radius-sm) 0;
}
.pb-cal-btn:hover{ background:var(--slt-navy-800); }
.pb-cal-btn svg{ width:16px; height:16px; }

.pb-menu, .pb-calendar{
  position:absolute; top:calc(100% + 6px); z-index:50;
  background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius-md);
  box-shadow:var(--shadow-md);
}
.pb-menu[hidden], .pb-calendar[hidden]{ display:none; }
.pb-menu{ left:0; min-width:130px; margin:0; padding:6px 0; list-style:none; }
.pb-menu li{
  position:relative; padding:8px 16px 8px 34px; font-size:13px; color:var(--text-primary);
  cursor:pointer; white-space:nowrap;
}
.pb-menu li:hover, .pb-menu li:focus-visible{ background:var(--gray-100); outline:none; }
.pb-menu li[aria-selected="true"]::before{
  content:'✓'; position:absolute; left:14px; color:var(--slt-navy-700); font-weight:700;
}

.pb-calendar{ right:0; width:262px; padding:12px; }
.cal-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.cal-title{ font-size:13.5px; font-weight:600; color:var(--text-primary); }
.cal-nav{
  width:28px; height:28px; border:1px solid var(--border-strong); border-radius:var(--radius-sm);
  background:#fff; color:var(--gray-600); font-size:16px; line-height:1; cursor:pointer;
}
.cal-nav:hover:not(:disabled){ background:var(--gray-100); }
.cal-nav:disabled{ opacity:.4; cursor:default; }
.cal-grid{ display:grid; grid-template-columns:repeat(7, 1fr); gap:2px; }
.cal-wd{ text-align:center; font-size:11.5px; font-weight:600; color:var(--gray-600); padding:4px 0; }
.cal-day{
  height:32px; border:none; border-radius:var(--radius-sm); background:transparent;
  font-size:13px; font-family:inherit; color:var(--text-primary); cursor:pointer;
}
.cal-day:hover:not(:disabled){ background:var(--gray-100); }
.cal-day.is-muted{ color:var(--text-muted); }
.cal-day.is-in-period{ background:var(--slt-blue-100); }
.cal-day.is-today{ font-weight:700; }
.cal-day.is-selected, .cal-day.is-selected:hover{ background:var(--slt-navy-700); color:#fff; }
.cal-day:disabled{ color:var(--gray-300); cursor:default; }
.cal-hint{ margin:10px 2px 0; font-size:11.5px; color:var(--text-muted); text-align:center; }

.pb-tz{
  height:34px; padding:0 10px; border:1px solid var(--border-strong); border-radius:var(--radius-sm);
  background:#fff; color:var(--text-primary); font-size:13px; font-family:inherit; cursor:pointer;
}
.pb-tz:focus{ outline:none; border-color:var(--slt-blue-500); box-shadow:0 0 0 3px var(--focus-ring); }

/* A report reloading for a new period: the old one stays in place, dimmed
 * and inert, instead of the page collapsing and jumping back. */
#resultsWrap.is-loading{ opacity:.55; pointer-events:none; transition:opacity .15s ease; }

/* ── Download bar ── */
.download-bar{ display:flex; gap:10px; justify-content:flex-end; margin-bottom:16px; flex-wrap:wrap; }
.btn-dl{
  background:#fff; color:var(--gray-600); border:1px solid var(--border);
  padding:8px 16px; border-radius:var(--radius-sm); font-size:12.5px; font-weight:600; cursor:pointer;
}
.btn-dl:hover{ color:var(--text-primary); border-color:var(--border-strong); background:var(--gray-50); }
.btn-dl:disabled{ opacity:.45; cursor:default; }

/* ── Export menu: one button, formats in a dropdown (monochrome icons) ── */
.export-menu{ position:relative; }
.btn-export{ display:inline-flex; align-items:center; gap:8px; color:var(--text-primary); }
.btn-export[aria-expanded="true"]{ border-color:var(--border-strong); background:var(--gray-50); }
.em-icon{ width:16px; height:16px; flex-shrink:0; }
.em-chevron{ width:12px; height:12px; transition:transform .15s ease; }
[aria-expanded="true"] > .em-chevron{ transform:rotate(180deg); }
.export-list{
  position:absolute; right:0; top:calc(100% + 6px); z-index:50; min-width:196px; padding:6px;
  background:#fff; border:1px solid var(--border); border-radius:var(--radius-md); box-shadow:var(--shadow-md);
  font-weight:400; /* a chart's menu sits inside its bold title row */
}
.export-list[hidden]{ display:none; }
.export-item{
  display:flex; align-items:center; gap:10px; width:100%; padding:8px 10px; border:none; background:transparent;
  border-radius:var(--radius-sm); color:var(--text-primary); font-family:inherit; font-size:13px; text-align:left; cursor:pointer;
}
.export-item:hover, .export-item:focus-visible{ background:var(--gray-100); outline:none; }
.em-label{ font-weight:600; }
.em-hint{ margin-left:auto; font-size:12px; color:var(--text-secondary); }

/* ── Summary panels (after the Web Portal's "Solar production" card): KPIs,
 * each label on top, figure, short note; the first one leads. Savings is
 * orange, Energy blue (.hero-blue). The panel sizes from its own width
 * (container query), so a narrow window can't squeeze the labels into
 * wrapping beside their figures. ── */
.hero-panel{
  --hero-bg:var(--slt-orange-bg); --hero-border:var(--slt-orange-border);
  --hero-title:var(--slt-orange-600); --hero-label:var(--slt-orange-700);
  container-type:inline-size;
  background:var(--hero-bg); border:1px solid var(--hero-border);
  border-radius:var(--radius-lg); padding:16px 22px 18px; margin-bottom:18px;
}
.hero-blue{
  --hero-bg:var(--slt-blue-100); --hero-border:var(--slt-blue-200);
  --hero-title:var(--slt-blue-600); --hero-label:var(--slt-blue-700);
}
.hero-head{ display:flex; align-items:center; gap:10px; margin-bottom:14px; }
.hero-icon{
  display:flex; align-items:center; justify-content:center; width:32px; height:32px; flex-shrink:0;
  border:1px solid var(--hero-border); border-radius:8px; background:#fff; color:var(--hero-title);
}
.hero-icon svg{ width:20px; height:20px; }
.hero-title{ font-size:14px; font-weight:700; color:var(--hero-title); }
.hero-period{ font-weight:500; color:var(--text-secondary); font-variant-numeric:tabular-nums; white-space:nowrap; }
/* A caveat under a panel's KPIs (summary.js: grid export isn't counted). */
.hero-footnote{
  display:flex; align-items:flex-start; gap:6px; margin:14px 0 0; padding-top:10px;
  border-top:1px solid var(--hero-border); font-size:12px; line-height:1.4; color:var(--text-secondary);
}
.hero-footnote svg{ width:14px; height:14px; flex-shrink:0; margin-top:1px; color:var(--hero-label); }
/* The lead KPI is a little wider; the rest share what is left, however many. */
.hero-kpis{ display:grid; grid-template-columns:1.35fr; grid-auto-flow:column; grid-auto-columns:1fr; }
.kpi{ min-width:0; padding:0 18px; border-left:1px solid var(--hero-border); }
.kpi:first-child{ padding-left:0; border-left:none; }
.kpi-label{ font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.05em; color:var(--hero-label); }
.kpi-value{
  margin-top:4px; font-size:20px; font-weight:700; line-height:1.2; color:var(--text-primary);
  font-variant-numeric:tabular-nums; white-space:nowrap;
}
.kpi-lead .kpi-value{ font-size:26px; }
.kpi-value small{ margin-left:2px; font-size:12px; font-weight:600; color:var(--text-secondary); }
.kpi-note{ display:block; margin-top:3px; font-size:12px; color:var(--text-secondary); }
.kpi-note.good{ font-weight:600; color:var(--status-good-text); }
.kpi-note.bad{ font-weight:600; color:var(--status-bad-text); }

/* ── Energy summary: the lead KPIs (consumption, self-sufficiency), then one
 * row per asset (PV, grid, battery). Each row's label carries the asset's
 * chart colour (--dot) so a figure can be matched to its line below; the KPI
 * columns line up across rows. ── */
.energy-lead{ display:flex; padding-bottom:14px; }
.energy-group{
  display:grid; grid-template-columns:150px minmax(0,1fr); align-items:start;
  padding:12px 0; border-top:1px solid var(--hero-border);
}
.energy-group:last-child{ padding-bottom:0; }
.eg-label{ display:flex; align-items:center; gap:8px; font-size:13px; font-weight:700; color:var(--hero-title); }
.eg-dot{ width:9px; height:9px; flex-shrink:0; border-radius:50%; background:var(--dot); }
.eg-extra{ font-weight:500; color:var(--text-secondary); }
.eg-kpis{ display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); }

@container (max-width:720px){
  .hero-kpis{ grid-template-columns:1fr 1fr; grid-auto-flow:row; row-gap:14px; }
  .kpi, .kpi:first-child{ padding:0; border-left:none; }
  .kpi-lead{ grid-column:1 / -1; }
  .energy-lead{ flex-wrap:wrap; gap:12px 28px; }
  .energy-group{ grid-template-columns:1fr; row-gap:10px; }
  .eg-kpis{ grid-template-columns:1fr 1fr; row-gap:12px; }
}

/* ── Plot container ── */
.plot-card{
  position:relative; /* anchors the synced hover line (hoverSync.js) */
  background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius-md);
  padding:10px 12px 4px; margin-bottom:8px; box-shadow:var(--shadow-sm); min-height:120px;
}
/* The Daily / Monthly / Yearly switch, centred at the top of the savings
 * card: a pill track with equal-width buttons and a dark slate highlight
 * (like the active tab) that slides to the picked one. */
.seg-row{ display:flex; justify-content:center; padding:4px 0 6px; }
.seg{
  position:relative; display:grid; grid-template-columns:repeat(3, 1fr); padding:3px;
  background:var(--gray-100); border:1px solid var(--border); border-radius:999px;
}
.seg-thumb{
  position:absolute; top:3px; bottom:3px; left:3px; width:calc((100% - 6px) / 3);
  background:var(--slt-navy-600); border-radius:999px; box-shadow:0 1px 3px rgba(16,24,40,.25);
  transition:transform .28s cubic-bezier(.3,.7,.2,1);
}
.seg[data-active="monthly"] .seg-thumb{ transform:translateX(100%); }
.seg[data-active="yearly"] .seg-thumb{ transform:translateX(200%); }
.seg-btn{
  position:relative; z-index:1; min-width:84px; height:30px; padding:0 16px; border:none; border-radius:999px;
  background:transparent; color:var(--text-secondary); font-family:inherit; font-size:12.5px; font-weight:600;
  cursor:pointer; transition:color .2s ease, background-color .2s ease, transform .12s ease;
}
.seg-btn:hover:not([aria-pressed="true"]):not([aria-disabled="true"]){ color:var(--text-primary); background:rgba(16,24,40,.06); }
.seg-btn:active:not([aria-disabled="true"]){ transform:scale(.96); }
.seg-btn[aria-pressed="true"]{ color:#fff; }
.seg-btn[aria-disabled="true"]{ color:var(--gray-400); cursor:not-allowed; }
.seg-btn:focus-visible{ outline:2px solid var(--slt-blue-500); outline-offset:2px; }
/* A disabled option's reason, on hover or keyboard focus. */
.seg-btn[data-tip]::after{
  content:attr(data-tip); position:absolute; bottom:calc(100% + 8px); left:50%; z-index:5;
  transform:translate(-50%, 4px); padding:6px 10px; border-radius:6px; white-space:nowrap;
  background:var(--slt-navy-700); color:#fff; font-size:11.5px; font-weight:500; box-shadow:var(--shadow-md);
  opacity:0; pointer-events:none; transition:opacity .15s ease, transform .15s ease;
}
.seg-btn[data-tip]:hover::after, .seg-btn[data-tip]:focus-visible::after{ opacity:1; transform:translate(-50%, 0); }
@media (prefers-reduced-motion:reduce){
  .seg-thumb, .seg-btn, .seg-btn[data-tip]::after{ transition:none; }
}
/* A standing line saying what a bar does, under the switch (daily view only). */
.chart-hint{ margin:0 0 4px; font-size:12px; line-height:1.4; color:var(--text-secondary); text-align:center; }
.chart-hint[hidden], .chart-hint:empty{ display:none; }
.chart-hint svg{ display:inline-block; width:14px; height:14px; margin-right:6px; vertical-align:-3px; color:var(--link-ink); }
/* Under a chart: what period its figures cover. */
.chart-note{ margin:2px 0 6px; padding-top:8px; border-top:1px solid var(--gray-100); font-size:11.5px; color:var(--text-secondary); }
.chart-note:empty{ display:none; }

/* A daily bar that opens its day (on a double-click): the pointing hand over its
 * column. Both day plots are double-clicked, so their text must not select. */
.plot.is-pickable .nsewdrag{ cursor:pointer !important; }
#plotDailySavings, #plotDayDetail{ user-select:none; }

/* A chart with a figures panel on its right (the savings charts). The card is the
 * container: under 700px the panel drops below the chart as one row, and
 * under 440px that row wraps into two. */
.chart-with-panel{ container-type:inline-size; }
/* Centred, not stretched: a stretched plot div would grow the chart past its
 * own height (Plotly resizes to fill it) whenever the panel is taller. */
.cwp-body{ display:flex; align-items:center; gap:16px; }
.cwp-body > .plot{ flex:1; min-width:0; }
.chart-panel{
  flex:0 0 196px; display:flex; flex-direction:column; justify-content:center;
  padding:4px 4px 8px 16px; border-left:1px solid var(--border);
}
.cp-item{ padding:9px 0; border-bottom:1px solid var(--gray-100); }
.cp-item:last-child{ border-bottom:none; }
.cp-label{ font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.05em; color:var(--text-secondary); }
.cp-value{ margin-top:3px; font-size:18px; font-weight:700; line-height:1.2; color:var(--text-primary); font-variant-numeric:tabular-nums; white-space:nowrap; }
.cp-value.bad{ color:var(--status-bad-text); }
.cp-note{ margin-top:1px; font-size:11.5px; color:var(--text-secondary); }
/* "View day ›" under the highest / lowest day: a real button into that day's window. */
.cp-link{
  margin-top:6px; padding:3px 10px; border:1px solid var(--border-strong); border-radius:999px; background:#fff;
  color:var(--link-ink); font-family:inherit; font-size:11.5px; font-weight:600; cursor:pointer; white-space:nowrap;
  transition:background-color .15s ease, border-color .15s ease, transform .12s ease;
}
.cp-link:hover{ background:var(--slt-blue-100); border-color:var(--link-ink); }
.cp-link:active{ transform:scale(.96); }
.cp-link:focus-visible{ outline:2px solid var(--slt-blue-500); outline-offset:2px; }
@container (max-width:700px){
  /* Stacked, the chart must stretch to the full width: centred, a column
   * item keeps its last rendered width and spills out of the card. */
  .cwp-body{ flex-direction:column; align-items:stretch; gap:4px; }
  .chart-panel{ flex:none; flex-direction:row; padding:10px 0 8px; border-left:none; border-top:1px solid var(--border); }
  .cp-item{ flex:1; min-width:0; padding:0 12px; border-bottom:none; border-left:1px solid var(--gray-100); }
  .cp-item:first-child{ padding-left:0; border-left:none; }
}
@container (max-width:440px){
  .chart-panel{ flex-wrap:wrap; row-gap:10px; }
  .cp-item{ flex:1 1 40%; }
  .cp-item:nth-child(odd){ padding-left:0; border-left:none; }
}

/* ── Day detail: a day's window above the savings bars ────────────────────
 * Collapsed it takes no room (a grid row of 0fr); opening animates the row to
 * its content's height, so the bars and the page below slide down instead of
 * being covered — and back up on close. The card inside fades and settles
 * into place. It sits to the right, over the bars' own right-hand side, until
 * its header is dragged along the row (dayDetail.js): --dd-pos 0 is the left
 * edge, 0.5 the centre, 1 the right. */
.day-detail{
  display:grid; grid-template-rows:0fr; opacity:0; visibility:hidden;
  scroll-margin-top:calc(var(--pinned-h, 210px) + 8px); /* clear of the topbar + pinned header (stickyHeader.js) */
  transition:grid-template-rows .42s cubic-bezier(.3,.7,.2,1), opacity .3s ease, visibility 0s linear .42s;
}
.day-detail.is-open{
  grid-template-rows:1fr; opacity:1; visibility:visible; transition-delay:0s;
}
.day-detail.is-instant, .day-detail.is-instant .dd-card{ transition:none; }
.dd-clip{ overflow:hidden; min-height:0; padding:0 2px; }
.dd-card{
  width:56%; margin:6px 0 12px calc(44% * var(--dd-pos, 1)); padding:12px 14px 4px; box-sizing:border-box;
  background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius-md); box-shadow:var(--shadow-md);
  transform:translateY(-12px) scale(.985); transform-origin:top right;
  transition:transform .42s cubic-bezier(.3,.7,.2,1);
}
.day-detail.is-open .dd-card{ transform:none; }
.dd-head{ display:flex; align-items:center; justify-content:space-between; gap:10px; cursor:grab; touch-action:pan-y; }
.dd-card.is-dragging .dd-head{ cursor:grabbing; user-select:none; }
.dd-head button{ cursor:pointer; }
.dd-grip{
  display:inline-flex; align-items:center; justify-content:center; width:18px; height:28px; margin:0 -4px 0 -6px; padding:0;
  flex-shrink:0; border-radius:var(--radius-sm); color:var(--gray-400);
}
.dd-grip:hover{ color:var(--text-secondary); background:var(--gray-50); }
.dd-grip:focus-visible{ outline:2px solid var(--slt-blue-500); outline-offset:1px; }
.dd-grip svg{ width:14px; height:14px; }
/* The ⓘ's two instructions (dayDetail.js initHelp): a dark card under it,
 * on hover, keyboard focus, or pinned open by a click / tap. */
.dd-info-wrap{ position:relative; display:inline-flex; }
.dd-info{ color:var(--text-secondary); }
.dd-help{
  position:absolute; top:calc(100% + 8px); right:0; z-index:6; width:max-content; max-width:min(300px, 80vw);
  display:flex; flex-direction:column; gap:6px; padding:9px 12px; border-radius:6px;
  background:var(--slt-navy-700); color:#fff; font-size:11.5px; font-weight:400; line-height:1.4; text-align:left;
  box-shadow:var(--shadow-md); cursor:auto;
  opacity:0; visibility:hidden; transform:translateY(-4px);
  transition:opacity .15s ease, transform .15s ease, visibility 0s linear .15s;
}
.dd-help b{ display:block; font-weight:700; }
.dd-help i{ font-style:normal; font-weight:600; }
.dd-info-wrap:hover .dd-help, .dd-info:focus-visible + .dd-help, .dd-help.is-open{
  opacity:1; visibility:visible; transform:none; transition-delay:0s;
}
.dd-nav{ display:flex; align-items:center; gap:6px; min-width:0; }
.dd-actions{ display:flex; align-items:center; gap:8px; flex-shrink:0; }
.dd-title{ margin:0; font-size:15px; font-weight:700; color:var(--text-primary); overflow-wrap:anywhere; }
.dd-btn{
  display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; padding:0; flex-shrink:0;
  border:1px solid var(--border-strong); border-radius:var(--radius-sm); background:#fff; color:var(--text-primary); cursor:pointer;
  transition:background-color .15s ease, transform .12s ease;
}
.dd-btn svg{ width:14px; height:14px; }
.dd-btn:hover:not(:disabled){ background:var(--gray-100); }
.dd-btn:active:not(:disabled){ transform:scale(.94); }
.dd-btn:disabled{ color:var(--gray-400); cursor:not-allowed; background:var(--gray-50); }
.dd-btn:focus-visible, .dd-reset:focus-visible{ outline:2px solid var(--slt-blue-500); outline-offset:2px; }
.dd-reset{
  height:28px; padding:0 10px; border:1px solid var(--border-strong); border-radius:var(--radius-sm); background:#fff;
  color:var(--text-primary); font-family:inherit; font-size:11.5px; font-weight:600; cursor:pointer;
}
.dd-reset:hover{ background:var(--gray-100); }
.dd-reset[hidden]{ display:none; }
.dd-figures{ display:flex; align-items:center; flex-wrap:wrap; gap:6px 22px; padding:10px 0 4px; }
.dd-total{ display:flex; flex-direction:column; }
.dd-total-label{ font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.05em; color:var(--text-secondary); }
.dd-total-value{ font-size:22px; font-weight:700; line-height:1.15; color:var(--text-primary); font-variant-numeric:tabular-nums; }
.dd-total-value.bad{ color:var(--status-bad-text); }
.dd-meta{ display:flex; flex-direction:column; gap:3px; min-width:0; font-size:12px; color:var(--text-secondary); }
.dd-parts{ display:flex; flex-wrap:wrap; gap:2px 14px; color:var(--text-primary); }
.dd-part b{ font-variant-numeric:tabular-nums; }
.dd-story{ margin:2px 0 6px; font-size:12.5px; line-height:1.45; color:var(--text-primary); }
.dd-story:empty{ display:none; }
.dd-dot{ display:inline-block; width:9px; height:9px; margin-right:6px; border-radius:2px; vertical-align:baseline; }
@container (max-width:700px){
  /* Full width: nowhere to move it. */
  .dd-card{ width:100%; margin-left:0; }
  .dd-head{ cursor:auto; }
  .dd-grip{ display:none; }
}
@media (prefers-reduced-motion:reduce){
  .day-detail, .dd-card, .dd-btn, .dd-help{ transition:none; }
}

/* Another chart's hover, mirrored here: drawn like Plotly's own spike line
 * (plotlyTheme.js: 1px, dashed, the same soft navy) so both read as one. */
.hover-sync-line{
  position:absolute; width:0; border-left:1px dashed rgba(27,42,73,0.35);
  pointer-events:none; z-index:2;
}
.hover-sync-line[hidden]{ display:none; }
/* A chart's HTML download, sitting right after its title. */
/* Chart download menus open rightwards, from beside the title. */
.chart-export .export-list{ left:0; right:auto; }
.dl-plot-btn{
  display:inline-flex; align-items:center; gap:3px; height:24px; padding:0 6px;
  border:1px solid var(--border-strong); border-radius:4px; background:#fff; color:var(--text-primary);
  font-family:inherit; font-size:11px; font-weight:600; cursor:pointer;
}
.dl-plot-btn .em-icon{ width:13px; height:13px; }
.dl-plot-btn .em-chevron{ width:10px; height:10px; }
.dl-plot-btn[aria-expanded="true"]{ background:var(--gray-50); border-color:var(--gray-400); }
.dl-plot-btn:hover{ background:var(--gray-50); border-color:var(--gray-400); }
.dl-plot-btn:focus-visible{ outline:2px solid var(--slt-blue-500); outline-offset:1px; }

/* ── Battery-unit toggle chips ── */
.batt-toggle-wrap{ display:none; flex-wrap:wrap; gap:6px; padding:2px 4px 10px; }
.batt-toggle-wrap.has-items{ display:flex; }
.batt-toggle-btn{
  font-size:11px; padding:4px 10px; border-radius:999px; border:1px solid currentColor;
  background:#fff; cursor:pointer; opacity:.55;
}
.batt-toggle-btn:hover{ opacity:.85; }
.batt-toggle-btn.is-on{ opacity:1; background:currentColor; color:#fff !important; }
.batt-toggle-btn.is-on::after{ content:''; }

/* ── Data table (Statistics tab) ── */
.stats-card{
  max-width:760px; padding:6px 24px 14px;
  background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius-md); box-shadow:var(--shadow-sm);
}
.stats-table{ width:100%; border-collapse:collapse; font-size:13px; }
.stats-table th, .stats-table td{ padding:9px 0; border-bottom:1px solid var(--gray-100); vertical-align:baseline; }
.stats-table tbody:last-child tr:last-child > *{ border-bottom:none; }
.stats-table th[scope="row"]{ text-align:left; font-weight:500; color:var(--text-primary); }
.stats-table .row-note{ display:block; margin-top:1px; font-size:11.5px; font-weight:400; color:var(--text-secondary); }
.stats-table td.num{ text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; color:var(--text-primary); }
.stats-table td.num.wide{ white-space:normal; }
.stats-table td.share{ width:84px; text-align:right; font-size:12px; font-variant-numeric:tabular-nums; color:var(--text-secondary); }
.stats-table td.share .good{ color:var(--status-good-text); font-weight:600; }
.stats-table td.share .bad{ color:var(--status-bad-text); font-weight:600; }
.stats-table tr.key > *{ font-weight:700; }
/* Group titles: small caps above their rows, set off by space, not lines. */
.stats-table tr.group th{
  padding:20px 0 6px; border-bottom:1px solid var(--border-strong); text-align:left;
  font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--text-secondary);
}

/* ── Toasts (toast.js): top right under the top bar; across the top on a phone ── */
.toast-stack{
  position:fixed; top:68px; right:16px; z-index:100; display:flex; flex-direction:column; gap:10px;
  width:min(360px, calc(100vw - 32px)); pointer-events:none;
}
.toast{
  position:relative; display:flex; align-items:flex-start; gap:10px; padding:12px 36px 12px 14px;
  background:#fff; border:1px solid var(--border); border-left:4px solid var(--status-bad);
  border-radius:var(--radius-md); box-shadow:var(--shadow-md); pointer-events:auto;
  opacity:0; transform:translateX(16px); transition:opacity .2s ease, transform .2s ease;
}
.toast.is-visible{ opacity:1; transform:none; }
.toast-icon{ display:flex; flex-shrink:0; color:var(--status-bad-text); }
.toast-icon svg{ width:18px; height:18px; }
.toast-title{ font-size:13px; font-weight:700; color:var(--text-primary); }
.toast-msg{ margin-top:2px; font-size:12.5px; line-height:1.45; color:var(--text-secondary); }
.toast-close{
  position:absolute; top:8px; right:8px; width:22px; height:22px; padding:0; border:none; border-radius:4px;
  background:transparent; color:var(--text-secondary); font-size:18px; line-height:1; cursor:pointer;
}
.toast-close:hover{ background:var(--gray-100); color:var(--text-primary); }
.toast-close:focus-visible{ outline:2px solid var(--slt-blue-500); outline-offset:1px; }
@media (prefers-reduced-motion:reduce){ .toast{ transition:none; } }

/* A span not offered yet (v1.1.0): greyed out, with a badge saying when. */
.pb-menu li[aria-disabled="true"]{ color:var(--text-muted); cursor:not-allowed; }
.pb-menu li[aria-disabled="true"]:hover{ background:transparent; }
.pb-soon{
  margin-left:8px; padding:1px 6px; border-radius:999px; background:var(--gray-100);
  font-size:10.5px; font-weight:600; color:var(--text-secondary);
}

/* ── What the controller has (controllerAssets.js), and debug mode ────────
 * Blocks tagged data-needs="pv" / "battery" / "pv battery" disappear when the
 * controller lacks one of them. With neither, the report gives way to one notice:
 * no tabs' content, no export. Blocks tagged "debug" (the DEV badge) show in
 * debug mode only (main.js). */
body.no-pv [data-needs~="pv"],
body.no-battery [data-needs~="battery"],
body.no-debug [data-needs~="debug"]{ display:none !important; }

.no-assets-notice{ display:none; }
body.no-assets .no-assets-notice{
  display:flex; align-items:center; gap:16px; margin-top:8px; padding:22px 24px;
  background:var(--slt-orange-bg); border:1px solid var(--slt-orange-border); border-radius:var(--radius-lg);
}
body.no-assets #tab-savings,
body.no-assets #tab-energy,
body.no-assets #tab-statistics,
body.no-assets .download-bar{ display:none !important; }
.no-assets-icon{
  display:flex; align-items:center; justify-content:center; width:40px; height:40px; flex-shrink:0;
  border:1px solid var(--slt-orange-border); border-radius:10px; background:#fff; color:var(--slt-orange-600);
}
.no-assets-icon svg{ width:24px; height:24px; }
.no-assets-title{ margin:0 0 4px; font-size:18px; font-weight:700; color:var(--text-primary); }
.no-assets-text{ margin:0; font-size:13px; line-height:1.5; color:var(--text-secondary); }
