/* Compact scale: 90% of the browser's font size (still follows the user's zoom setting). */
html { font-size: 90%; }
/* Phones zoom into inputs smaller than 16px, and need comfortable tap targets. */
@media (pointer: coarse) { .form-control, .form-select { font-size: 16px; } }
.badge { font-size: .75em; margin: 0.75rem 0;}

body { font-family: Figtree, system-ui, -apple-system, "Segoe UI", sans-serif; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
.container-narrow { width: 100%; max-width: 864px; margin-inline: auto; padding-inline: 1rem; }
.card { border-radius: .5rem; }
.form-card { max-width: 378px; }
.site-logo { max-height: 29px; vertical-align: middle; }

.h5, h5 { font-size: 1.1rem; }

/* Status colours: text, background tint, border */
.tone-ok    { --tone: #16a34a; --tint: rgba(22, 163, 74, .08);  --edge: rgba(22, 163, 74, .3); }
.tone-warn  { --tone: #d97706; --tint: rgba(217, 119, 6, .09);  --edge: rgba(217, 119, 6, .3); }
.tone-bad   { --tone: #dc2626; --tint: rgba(220, 38, 38, .08);  --edge: rgba(220, 38, 38, .3); }
.tone-info  { --tone: #2563eb; --tint: rgba(37, 99, 235, .08);  --edge: rgba(37, 99, 235, .3); }
.tone-muted { --tone: #6b7280; --tint: rgba(107, 114, 128, .08); --edge: rgba(107, 114, 128, .3); }
.tone-text, .overall .status-icon { color: var(--tone); }
.status-icon { display: inline-flex; align-items: center; justify-content: center; width: 1.25em; height: 1.25em; border: 2px solid currentColor; border-radius: 50%; font-size: .85em; line-height: 1; vertical-align: -.2em; }
.status-icon-lg { font-size: 1.4rem; width: 2rem; height: 2rem; }
.card.overall { border: 1px solid var(--tone); }
.card.tinted { background: var(--tint); border-color: var(--edge); }

.banner { padding: .7rem 1rem; border-radius: .5rem; border: 1px solid rgba(37, 99, 235, .3); background: rgba(37, 99, 235, .08); color: var(--bs-info-text-emphasis); }
.nav-underline .nav-link { color: var(--bs-secondary-color); }
.nav-underline .nav-link.active { color: var(--bs-body-color); }
.service-row { padding-block: .7rem; font-size: .95rem; }
.incident-card { border-left: 4px solid var(--bs-body-color); }
.incident-card.is-open { border-color: #dc2626; }
.maintenance-card { border-left: 4px solid var(--bs-border-color); }
.maintenance-card.is-in_progress { border-color: #f59e0b; }
.maintenance-card.is-scheduled { border-color: #2563eb; }
.pre-line { white-space: pre-line; font-size: .9rem;}
.stat { background: var(--bs-tertiary-bg); }

.chart { position: relative; min-height: 198px; color: var(--bs-secondary-color); font-size: .85rem; }
.chart svg { display: block; touch-action: pan-y; }
.chart text { fill: var(--bs-secondary-color); font-size: 10.5px; }
.chart .grid { stroke: var(--bs-border-color); stroke-dasharray: 3 3; }
.chart .line { fill: none; stroke: #3b82f6; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: #3b82f6; }
.chart-tip { position: absolute; top: 0; right: 0; padding: .2rem .5rem; border: 1px solid var(--bs-border-color); border-radius: .25rem; background: var(--bs-body-bg); pointer-events: none; }
.picker { max-height: 18rem; overflow-y: auto; }
.nav-item .badge {margin: 0;}

/* Keep the three public tabs on one line on narrow screens. */
@media (max-width: 575px) {
    .nav-underline { flex-wrap: nowrap; --bs-nav-underline-gap: .25rem; }
    .nav-underline .nav-link { padding-inline: .4rem !important; white-space: nowrap; }
}

/* Tab switching: the spinner appears only when a load is not instant. */
#tab-content { position: relative; min-height: 8rem; }
#tab-content.is-loading > * { opacity: .4; pointer-events: none; }
#tab-content .loader { position: absolute; top: 2.5rem; left: calc(50% - 1rem); opacity: 1; z-index: 1; }

/* Incident progress steps and result strip */
.stages { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; list-style: none; padding: 0; }
.stages li { display: flex; align-items: center; gap: .5rem; flex: 1 1 auto; }
.stages li:last-child { flex: 0 0 auto; }
.stages li:not(:last-child)::after { content: ""; flex: 1; min-width: .5rem; border-top: 1px solid var(--bs-border-color); }
.stages li.done::after { border-top-color: var(--bs-body-color); }
.stages span { padding: .3rem .8rem; border-radius: 2rem; white-space: nowrap; background: var(--bs-tertiary-bg); color: var(--bs-secondary-color); }
.stages .current span { background: var(--bs-emphasis-color); color: var(--bs-body-bg); font-weight: 600; }
.card.result { border: 1px solid var(--tone); }
@media (max-width: 575px) { .stages li { flex: 0 0 auto; } .stages li::after { display: none; } }
