/* Contextual help stays collapsed until explicitly requested. */
.metric-heading { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.metric-heading .metric-mini-label { margin: 0; }
.metric-help {
    display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 36px; width: 36px; height: 36px; padding: 0; border: 0;
    border-radius: 50%; background: transparent; color: var(--color-forest-green);
    cursor: pointer; font: inherit; font-size: 19px;
}
.metric-help:hover { background: rgba(25, 79, 47, .08); }
.metric-help:focus-visible, .hourly-legend-button:focus-visible {
    outline: 2px solid var(--color-forest-green); outline-offset: 2px;
}
.analytics-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.analytics-title .card-title { margin: 0; font-size: 15px; }
.analytics-caption { font-size: 12px; line-height: 1.5; color: #59645e; margin: 8px 0 12px; }
.analytics-unit { display: block; font-size: 10px; font-weight: 400; margin-top: 3px; }
.analytics-phase-count { display: block; font-size: 10px; color: #64716a; margin-top: 5px; }
.analytics-phase-table { width: 100%; table-layout: fixed; }
.analytics-phase-table th { font-size: 10px; line-height: 1.4; word-break: normal; }
.analytics-phase-table th:first-child { width: 33%; }
.analytics-phase-table td { font-size: 12px; padding: 10px 3px; }
.analytics-phase-table .table-badge { font-size: 10px; padding: 4px 2px; white-space: normal; overflow-wrap: anywhere; }
.analytics-empty { font-size: 13px; line-height: 1.5; color: #59645e; padding: 24px 8px; text-align: center; }
.hourly-chart-wrapper { height: 250px; }
.hourly-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.hourly-legend-button {
    display: flex; align-items: center; gap: 6px; padding: 8px;
    min-height: 44px; border: 1px solid #ccd7cf; border-radius: 8px;
    font: inherit; font-size: 11px; color: #2a3d30; background: #fff; cursor: pointer;
}
.hourly-legend-button[aria-pressed="false"] { color: #626a65; background: #f3f5f3; }
.hourly-legend-button[aria-pressed="false"] .hourly-swatch { opacity: .3; }
.hourly-swatch { width: 20px; height: 12px; flex-shrink: 0; }
.analytics-help-dialog {
    width: calc(100% - 24px); max-width: 480px; max-height: 82vh; max-height: 82dvh; padding: 0;
    border: 1px solid #d4ded5; border-radius: 18px 18px 10px 10px;
    background: #fff; color: var(--color-ink-text); margin: auto auto 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .18); overflow: auto;
}
.analytics-help-dialog::backdrop { background: rgba(16, 31, 20, .42); }
.analytics-help-header {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 16px 20px; border-bottom: 1px solid #e4e9e5;
}
.analytics-help-header h2 { margin: 0; font-size: 19px; line-height: 1.3; color: var(--color-forest-green); }
.analytics-help-close { border: 0; background: transparent; font-size: 24px; min-width: 44px; min-height: 44px; cursor: pointer; color: #405047; }
.analytics-help-content { padding: 4px 20px 16px; }
.analytics-help-content h3 { font-size: 14px; margin: 18px 0 5px; color: var(--color-forest-green); }
.analytics-help-content p { font-size: 14px; line-height: 1.6; margin: 0; }
.analytics-help-footer { padding: 0 20px 20px; }
.offline-logout-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.offline-logout-actions .btn { min-height: 44px; }
.offline-logout-actions [hidden] { display: none; }
@media (min-width: 768px) { .analytics-help-dialog { margin: auto; border-radius: 16px; } }


.analytics-empty:empty { display: none; }
