/* ── Planning layer: biomassa badges ─────────────────────────────────────── */
.biomassa-badge-on {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: hsl(20, 80%, 92%);
    color: hsl(20, 80%, 28%);
    border: 1px solid hsl(20, 70%, 68%);
    border-radius: 6px;
    padding: 0.2rem 0.6rem;
    font-weight: 700;
    font-size: 0.9rem;
}

.biomassa-badge-off {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--accent-tint-12);
    color: var(--accent);
    border: 1px solid rgba(201, 164, 92, 0.25);
    border-radius: 6px;
    padding: 0.2rem 0.6rem;
    font-weight: 700;
    font-size: 0.9rem;
}

/* ── Results table: conflict rows ────────────────────────────────────────── */
#results-table tbody tr.tr-conflict {
    background: rgba(248, 113, 113, 0.08);
    border-left: 3px solid var(--danger);
}

#results-table tbody tr.tr-conflict td {
    color: var(--danger);
}

/* ── Decision step label in results table ────────────────────────────────── */
.decision-step-badge {
    font-size: 0.72rem;
    color: hsl(205, 60%, 65%);
    font-style: italic;
    white-space: nowrap;
}

/* ── Buffer fill mini progress bar ──────────────────────────────────────── */
.buffer-fill-bar {
    height: 5px;
    border-radius: 3px;
    background: var(--border-hover);
    margin-top: 3px;
    overflow: hidden;
}

.buffer-fill-bar-inner {
    height: 100%;
    border-radius: 3px;
    background: var(--accent-mid);
    transition: width 0.3s ease;
}

.buffer-fill-bar-inner.buffer-critical {
    background: var(--danger);
}

.formula-box {
    background: var(--surface);
    border: 2px solid rgba(201, 164, 92, 0.25);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: center;
}

.formula-box h4 {
    color: var(--accent);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.formula {
    font-family: var(--font-mono, 'Courier New', monospace);
    font-size: 1.1rem;
    color: var(--accent);
    background: var(--bg-card);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    display: inline-block;
    border: 1px solid var(--border-hover);
}

.calculation-step {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    margin: 1rem 0;
}

.calculation-step h4 {
    color: var(--accent);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.calculation-step h4 i {
    color: var(--accent-mid);
}

.step-result {
    background: var(--accent-tint-08);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    color: var(--accent);
    display: inline-block;
    margin-top: 0.5rem;
}

/* Compact result card — matches the shared dark-surface style (green accent
   number on a dark card) so the value reads clearly instead of a low-contrast
   light number on a bright green fill. */
.final-result {
    background: linear-gradient(135deg, var(--header-from), var(--header-to));
    border: 1px solid rgba(201, 164, 92, 0.2);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 1.1rem 1.25rem;
    text-align: center;
    margin: 1.25rem 0;
}

.final-result h3 {
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
    color: var(--text-secondary);
}

.final-result .value {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--accent);
}

.final-result .unit {
    font-size: 1rem;
    color: var(--text-secondary);
}

.final-result .description {
    margin-top: 0.6rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.input-sections-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
    .input-sections-row {
        grid-template-columns: 1fr;
    }
}

/* Heat emission calculator: one input block on the left, the result on the
   right, so the whole tool fits without scrolling. The result column is fixed
   at 280px because the number is short — the inputs get the rest. */
.heat-calc-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 1.5rem;
    align-items: start;
    margin-bottom: 1.5rem;
}

/* The card's own vertical margin would push it out of line with the input
   block it sits beside. */
.heat-calc-row .final-result {
    margin: 0;
}

.heat-calc-row .action-row {
    margin-top: 0.75rem;
}

@media (max-width: 900px) {
    .heat-calc-row {
        grid-template-columns: 1fr;
    }
}

.input-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 0;
}

.input-section h3 {
    color: var(--accent);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-section h3 i {
    color: var(--accent-mid);
}

.results-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

.results-section h3 {
    color: var(--accent);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* A schedule built on invented prices is a scenario. Said here, above the cash
   summary, because that is what a grower acts on — and because a toast is gone
   by the time anyone reads the euros. */
.wkk-assumed-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin: -0.5rem 0 1.25rem;
    padding: 0.7rem 0.9rem;
    border: 1px solid #d97706;
    border-left-width: 4px;
    border-radius: 8px;
    background: rgba(217, 119, 6, 0.08);
    color: var(--text-primary);
    font-size: 0.86rem;
    line-height: 1.45;
}
.wkk-assumed-banner[hidden] { display: none; }
.wkk-assumed-banner i { color: #d97706; margin-top: 0.15rem; }

.elec-dev-note {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Hover tooltip + empty state + a11y helpers (Phase 6A) */
.elec-chart-tooltip {
    position: absolute;
    pointer-events: none;
    background: rgba(13, 17, 23, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 8px 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-primary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    min-width: 180px;
    z-index: 5;
}

.elec-chart-tooltip .elec-tt-hour {
    font-weight: 600;
    font-size: 12px;
    margin-bottom: 6px;
    /* Not var(--accent) — this tooltip stays dark by design (see the
       .elec-chart-tooltip override in modern-neutral.css), and --accent
       resolves to a dark green in the light theme, which is unreadable on a
       dark surface. --dash-accent-text is the one token this codebase keeps
       light on purpose for exactly this: text sitting on a dark surface. */
    color: var(--dash-accent-text, #f0fdf4);
}

.elec-chart-tooltip .elec-tt-row {
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.5;
}

.elec-chart-tooltip .elec-tt-swatch {
    display: inline-block;
    width: 10px;
    height: 3px;
    border-radius: 2px;
    flex-shrink: 0;
}

.elec-chart-tooltip .elec-tt-label {
    flex: 1;
    color: rgba(255, 255, 255, 0.7);
}

.elec-chart-tooltip .elec-tt-value {
    font-weight: 600;
    /* Not var(--text-primary) — that variable meant "near-white" when this
       rule was written (theme.css's original --text-primary: #e2e8f0) and now
       means "near-black" for the light-themed page. This tooltip itself
       stayed dark on purpose, so its own value text has to stay fixed-light
       too, the same way the label and unit beside it already are. */
    color: #ffffff;
    text-align: right;
}

.elec-chart-tooltip .elec-tt-delta {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed rgba(255, 255, 255, 0.15);
}

.elec-chart-tooltip .elec-tt-delta--pos .elec-tt-value { color: #ef4444; }
.elec-chart-tooltip .elec-tt-delta--neg .elec-tt-value { color: #22c55e; }

/* Inline subscript flagging that a tooltip value is a 1-hour average
   (shown for 15-min PTU series like imbalance). */
.elec-chart-tooltip .elec-tt-aggnote {
    margin-left: 4px;
    font-size: 0.7em;
    color: rgba(255, 255, 255, 0.5);
}

.elec-chart-tooltip .elec-tt-unit {
    margin-top: 4px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    text-align: right;
}

.elec-chart-empty {
    padding: 3rem 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    background: var(--surface);
    border-radius: 8px;
}

/* Visible focus ring for the chart legend buttons (a11y) */
.hh-chart-legend button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Screen-reader-only content (kept in DOM for assistive tech) */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Live-refresh badge in the chart header (Phase 5) */
.elec-chart-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.elec-chart-header h3 {
    margin-bottom: 0;
}

.elec-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(201, 164, 92, 0.12);
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.4;
    white-space: nowrap;
}

.elec-live-badge::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #c9a45c;
    box-shadow: 0 0 0 2px rgba(201, 164, 92, 0.25);
}

.elec-live-badge--pulse {
    animation: elec-live-pulse 600ms ease;
}

@keyframes elec-live-pulse {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.06); }
    100% { transform: scale(1); }
}

.config-cards-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-start;
    margin-top: 1.5rem;
}
.config-cards-row > .results-section {
    flex: 1;
    min-width: 320px;
    margin-top: 0 !important;
}

.note-box {
    background: rgba(251, 191, 36, 0.07);
    border-left: 4px solid rgba(251, 191, 36, 0.5);
    padding: 1rem 1.25rem;
    border-radius: 0 8px 8px 0;
    margin-top: 1.5rem;
}

.note-box strong {
    color: var(--warning);
}

.price-cell {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
    text-align: center;
    transition: transform 0.2s;
}

.price-cell:hover {
    transform: scale(1.05);
}

.price-cell.current {
    border: 2px solid var(--accent-mid);
    background: var(--accent-tint-08);
}

.price-cell.low {
    background: var(--accent-tint-06);
    border-color: var(--border-accent);
}

.price-cell.high {
    background: rgba(248, 113, 113, 0.07);
    border-color: rgba(248, 113, 113, 0.3);
}

.price-cell .hour {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.price-cell .price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
}

.price-cell.high .price {
    color: var(--danger);
}

.price-cell.low .price {
    color: var(--accent-mid);
}

.loading-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* Electricity tab — day rows */
.electricity-day-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.electricity-day-label {
    flex-shrink: 0;
    width: 80px;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
    padding-top: 0.6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.electricity-day-label i {
    color: var(--accent-mid);
    font-size: 1rem;
}

/* Two-row price grid: 12 columns × 2 rows = 24 prices */
.price-grid--horizontal {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 4px;
    flex: 1;
}

.price-grid--horizontal .price-cell {
    min-width: 0;
    padding: 0.3rem 0.25rem;
}

.price-grid--horizontal .price-cell .hour {
    font-size: 0.68rem;
}

.price-grid--horizontal .price-cell .price {
    font-size: 0.82rem;
}

@media (max-width: 700px) {
    .price-grid--horizontal {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

/* Chart container */
#prices-chart-container {
    width: 100%;
    overflow: hidden;
}

/* The SVG is generated to fit the container width; block + max-width keep it
   from ever forcing its own scrollbar (only the page scrolls). */
#prices-chart-container svg {
    display: block;
    max-width: 100%;
}

/* WKK Optimization Styles */
.wkk-unit-card {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.5rem;
}

.wkk-unit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-hover);
}

.wkk-unit-header h4 {
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wkk-unit-header h4 i {
    color: var(--accent);
}

.remove-wkk-btn {
    background: rgba(248, 113, 113, 0.15);
    color: var(--danger);
    border: 1px solid rgba(248, 113, 113, 0.3);
    padding: 0.35rem 0.75rem;
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.82rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.remove-wkk-btn:hover {
    background: rgba(248, 113, 113, 0.25);
    border-color: rgba(248, 113, 113, 0.5);
}

.input-section h4 {
    color: var(--accent);
    font-size: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.help-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.help-text i {
    color: hsl(200, 60%, 55%);
}

/* Radio Button Group */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--border-hover);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-card);
}

.radio-label:hover {
    border-color: var(--border-accent);
    background: var(--accent-tint-04);
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent);
}

.radio-label input[type="radio"]:checked + span {
    color: var(--accent);
    font-weight: 600;
}

.radio-label span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.radio-label span i {
    color: var(--accent-mid);
}

/* Hourly Input Table */
#hourly-data-table input {
    border: 1px solid var(--border-hover);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
    background: var(--surface);
    color: var(--text-primary);
}

#hourly-data-table input:focus {
    outline: none;
    border-color: var(--accent);
}

/* Results Table */
#results-table tbody tr:hover {
    background: var(--accent-tint-04);
}

#results-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

#results-table tbody tr:nth-child(even):hover {
    background: var(--accent-tint-04);
}

/* Summary Cards */
.input-section[style*="text-align: center"] {
    transition: transform 0.2s, box-shadow 0.2s;
}

.input-section[style*="text-align: center"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Responsive adjustments for WKK cards */
@media (max-width: 900px) {
    .input-sections-row {
        grid-template-columns: 1fr;
    }

    .wkk-unit-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .remove-wkk-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ── Compact config field rows ───────────────────────────────────────────── */
.cfg-fields {
    display: flex;
    flex-direction: column;
}

/* Three-column field: label | input | unit */
.cfg-field {
    display: grid;
    grid-template-columns: 1fr 88px 36px;
    align-items: center;
    gap: 0.3rem;
    padding: 0.22rem 0;
    border-bottom: 1px solid var(--border);
}

.cfg-field:last-child { border-bottom: none; }

/* Two-column field: label | input (no unit column) */
.cfg-field--wide {
    grid-template-columns: 1fr 1fr;
}

.cfg-field--wide > input,
.cfg-field--wide > select {
    grid-column: 2 / 3;
}

.cfg-field > label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    line-height: 1.25;
    margin: 0;
}

.cfg-field > input,
.cfg-field > select {
    padding: 0.18rem 0.35rem;
    font-size: 0.82rem;
    border: 1px solid var(--border-hover);
    border-radius: 4px;
    width: 100%;
    min-width: 0;
    background: var(--bg-card);
    color: var(--text-primary);
}

.cfg-field > input:focus,
.cfg-field > select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(201, 164, 92, 0.15);
}

.cfg-unit {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Small section divider label */
.cfg-section-label {
    font-size: 0.69rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--tracking-uppercase);
    color: var(--accent-mid);
    padding: 0.55rem 0 0.18rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.1rem;
}

/* Inline calculated outputs bar */
.wkk-calc-inline {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    background: var(--accent-tint-06);
    border: 1px solid rgba(201, 164, 92, 0.18);
    border-radius: 6px;
    padding: 0.3rem 0.55rem;
    font-size: 0.78rem;
    margin: 0.35rem 0;
    font-family: var(--font-mono, monospace);
    color: var(--text-secondary);
}

.wkk-calc-inline strong {
    color: var(--accent);
}

/* Compact part-load radio row */
.part-load-radios {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
    padding: 0.25rem 0;
}

.part-load-radios .radio-label {
    flex: 0 0 auto;
    padding: 0.18rem 0.55rem;
    font-size: 0.78rem;
    border-width: 1px;
    border-radius: 5px;
}

/* Gas price stats compact grid */
.gas-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
    margin: 0.5rem 0;
}

.gas-stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.3rem 0.4rem;
    text-align: center;
}

.gas-stat-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.gas-stat-value {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--accent);
}

.gas-stat-value--neg { color: var(--danger); }

/* Gas historical rows */
.gas-history-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.22rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem;
}

.gas-history-row:last-child { border-bottom: none; }

.gas-history-label { color: var(--text-secondary); }
.gas-history-value { font-weight: 600; color: var(--accent-mid); }

/* ── Second config-cards-row: smaller cards ──────────────────────────────── */
.config-cards-row--sm {
    margin-top: 1.5rem;
}
.config-cards-row--sm > .results-section {
    min-width: 200px;
    flex: 1;
    margin-top: 0 !important;
}

/* ── Lighting yes/no toggle ──────────────────────────────────────────────── */
.lighting-toggle {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    border: 1px solid var(--border-accent);
    background: var(--accent-tint-12);
    color: var(--accent);
    letter-spacing: 0.02em;
}
.lighting-toggle[data-on="false"] {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
}

/* ── Electricity date navigation pills ──────────────────────────────────── */
.elec-date-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.elec-date-pills {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    flex: 1;
    justify-content: center;
}

.elec-date-pill {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    border: 1px solid var(--border-hover);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.elec-date-pill:hover {
    border-color: var(--border-accent);
    color: var(--accent);
    background: var(--accent-tint-06);
}

.elec-date-pill--active {
    background: var(--accent-tint-12);
    border-color: var(--border-accent);
    color: var(--accent);
    font-weight: 600;
}

.elec-date-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-hover);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
    font-size: 0.8rem;
}

.elec-date-arrow:hover:not(:disabled) {
    border-color: var(--border-accent);
    color: var(--accent);
    background: var(--accent-tint-06);
}

.elec-date-arrow:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ── Responsive: tablet (700px) and phone (<600px) ────────────────────────
   Energy page started life as desktop-only; these rules let the new
   layered chart + stat boxes work on phone/tablet without horizontal
   scroll or microscopic text. */

@media (max-width: 600px) {
    /* Stat boxes stack to one column under 600px */
    .summary-grid {
        grid-template-columns: 1fr;
    }

    /* Chart title + live badge stack vertically */
    .elec-chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    /* Smaller explanatory note */
    .elec-dev-note {
        font-size: 0.8rem;
    }

    /* Date pills: scroll horizontally instead of wrapping into a tall column */
    .elec-date-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    .elec-date-pill {
        flex: 0 0 auto;
    }

    /* Larger touch targets on the legend buttons (Apple HIG / Material 44px) */
    .hh-chart-legend button {
        min-height: 44px;
        padding: 8px 10px !important;
    }

    /* Tooltip slightly bigger so it stays legible on a phone */
    .elec-chart-tooltip {
        min-width: 160px;
        font-size: 12px;
    }
}

@media (min-width: 600px) and (max-width: 900px) {
    /* Tablet: 2-column stat grid (default), but ensure boxes don't get cramped */
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
