:root { font-family: system-ui, sans-serif; color: #18314c; background: #f3f6fa; }
* { box-sizing: border-box; }
body { margin: 0; }
header { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; background: #102e4b; padding: 22px 4vw; }
header a { color: white; } nav { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.brand-link { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-weight: 650; }
.brand-logo { display: block; flex: none; height: 40px; width: auto; padding: 8px; background: white; border-radius: 8px; }
.session-card .brand-logo { height: 36px; padding: 0; border-radius: 0; margin: 0 0 20px; }
header nav { color: white; }
main { max-width: 1700px; padding: 24px 4vw; margin: auto; }
a { color: #164aa6; text-underline-offset: 3px; } a.active { font-weight: 700; }
button, select { font: inherit; padding: 9px 14px; border: 1px solid #c3cfe0; background: white; color: #18314c; border-radius: 7px; margin: 4px; }
button { cursor: pointer; } button:disabled { opacity: .6; cursor: wait; }
:focus-visible { outline: 3px solid #638cf6; outline-offset: 3px; }
.preview-label { color: #61428a; } .controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 24px 0; }
.summary-tile { display: grid; gap: 10px; background: white; padding: 12px; border: 1px solid #d9e2ef; border-radius: 8px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 20px; }
.card { background: white; padding: 24px; border-radius: 12px; border: 1px solid #d9e2ef; scroll-margin-top: 20px; }
.card a { margin-right: 12px; }
.badge { display: inline-block; width: fit-content; padding: 5px 10px; margin: 3px; border-radius: 18px; font-size: 13px; font-weight: 600; }
.healthy { background: #dff3e9; color: #006342; } .degraded { background: #fff0cc; color: #805400; }
.unhealthy { background: #ffe4e6; color: #9b1827; } .unknown { background: #eee5fa; color: #61428a; }
.information { background: #e3edff; color: #205299; } .neutral { background: #edf1f7; color: #33445b; }
.history { display: flex; flex-wrap: wrap; gap: 3px; margin: 12px 0; }
.history-block { display: block; width: 10px; height: 24px; border-radius: 3px; margin: 0 !important; border: 1px solid currentColor; }
.history-block.healthy { background: #329b75; } .history-block.degraded { background: #e0ab35; } .history-block.unhealthy { background: #dc6670; }
.gap { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 24px; border: 1px dashed #793d82; background: repeating-linear-gradient(135deg,#f6edf7,#f6edf7 3px,#e5d0e8 3px,#e5d0e8 6px); color: #612469; }
.table-wrap { overflow: auto; } table { width: 100%; border-collapse: collapse; background: white; }
th, td { text-align: left; padding: 14px; border-bottom: 1px solid #d9e2ef; vertical-align: top; font-size: 14px; }
th { background: #eaf0f7; } td:first-child { min-width: 250px; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 440px; overflow: auto; background: #edf1f7; padding: 16px; font: 13px/1.6 Consolas, monospace; }
.measurements { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.measurements div { background: white; padding: 14px; border-radius: 8px; } dt { font-weight: 650; margin-bottom: 8px; } dd { margin: 0; overflow-wrap: anywhere; }
.screenshot { display: block; max-width: 100%; } details { margin: 20px 0; } summary { cursor: pointer; }
.incident-card { margin: 20px 0; }
.incident-attention { color: #805400; font-weight: 650; }
.components-reconnect-hide { display: none; }
.components-reconnect-show, .components-reconnect-failed, .components-reconnect-rejected { display: block; }
.reconnect { position: fixed; inset: 20% 10%; padding: 40px; background: white; border: 3px solid #61428a; z-index: 1000; box-shadow: 0 0 0 100vmax #102e4b99; }
@media(max-width: 600px) { main { padding: 16px 12px; } .cards { grid-template-columns: 1fr; } }

.incident-workflow { margin-top: 1rem; min-width: 22rem; }
.incident-workflow textarea { display: block; width: 100%; box-sizing: border-box; }
.incident-note { white-space: pre-wrap; overflow-wrap: anywhere; }
.incident-audit { border-top: 1px solid #dce4ee; padding: .7rem 0; }
input, textarea { font: inherit; padding: 10px; border: 1px solid #c3cfe0; border-radius: 7px; color: #18314c; max-width: 100%; }
input[readonly] { width: min(100%, 620px); font-family: Consolas, monospace; }
.card > label { display: inline-grid; gap: 6px; margin: 8px 12px 8px 0; }
.card + .card { margin-top: 20px; }
.cards > .card { margin: 0; min-width: 0; display: flex; flex-direction: column; }
.cards > .card h2 { margin-top: 0; }
.card-links { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: auto; padding-top: 16px; }
.card-links a { margin: 0; }
.incident-workflow { min-width: 0; }
.controls select { max-width: 100%; }
.log-viewer { max-height: 65vh; }
.log-nowrap { white-space: pre; overflow-wrap: normal; }
.log-viewer mark { background: #ffe08a; color: #18314c; }
.session-page { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; }
.session-card { width: min(100%, 460px); background: white; border: 1px solid #d9e2ef; border-radius: 16px; padding: clamp(24px, 5vw, 40px); box-shadow: 0 12px 36px #102e4b0d; }
.session-eyebrow { margin: 0 0 16px; color: #52708d; font-size: 14px; font-weight: 650; }
.session-card h1 { margin: 0 0 28px; font-size: 28px; line-height: 1.2; }
.session-card form { display: flex; flex-direction: column; align-items: stretch; }
.session-card label { font-weight: 650; }
.session-help { color: #52677e; font-size: 14px; line-height: 1.6; margin: 8px 0 14px; }
.session-card input { width: 100%; min-height: 46px; }
.session-primary, .session-secondary, .session-button { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 48px; margin: 20px 0 0; padding: 12px 16px; border: 2px solid #164aa6; border-radius: 7px; font: inherit; font-size: 16px; font-weight: 650; line-height: 1.25; text-align: center; text-decoration: none; cursor: pointer; }
.session-primary, .session-button { background: #164aa6; color: white; }
.session-primary:hover, .session-button:hover { background: #103b88; border-color: #103b88; }
.session-secondary { background: white; color: #164aa6; }
.session-secondary:hover { background: #edf3ff; }
.session-primary:focus-visible, .session-secondary:focus-visible, .session-button:focus-visible { outline: 3px solid #102e4b; outline-offset: 3px; }
.session-button .ms-logo { flex: none; }
.session-divider { display: flex; align-items: center; gap: 12px; margin: 24px 0 16px; color: #52677e; font-size: 14px; }
.session-divider::before, .session-divider::after { content: ""; flex: 1; border-top: 1px solid #c3cfe0; }
.session-subheading { margin: 0 0 4px; font-size: 18px; line-height: 1.3; }
.session-privacy { border-top: 1px solid #e3eaf2; padding-top: 20px; margin-top: 24px; }
.general-summary { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); align-items: stretch; }
.general-summary .summary-tile { gap: 8px; padding: 16px; align-content: start; }
.summary-device { display: grid; gap: 3px; line-height: 1.4; }
.summary-device strong { font-size: 17px; }
.summary-device span { font-size: 14px; }
.summary-fleet, .summary-caption { color: #52677e; font-size: 12px; line-height: 1.5; }
.summary-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.summary-badges .badge { margin: 0; }
.general-summary .history { margin: 4px 0 0; gap: 4px; }
.summary-warning { color: #805400; font-size: 13px; font-weight: 600; }
tr:target { outline: 2px solid #638cf6; outline-offset: -2px; background: #eef3ff; }
@media(max-width: 480px) { .general-summary { grid-template-columns: 1fr; } }

/* Administration forms remain usable on narrow screens. */
main > .card label, main > section.card label { display: block; margin: 12px 0; }
main textarea { display: block; width: 100%; box-sizing: border-box; font-family: monospace; }
main .card input:not([type=checkbox]), main .card select { box-sizing: border-box; max-width: 100%; }
.administration label { min-width: 0; max-width: 100%; }
.administration input:not([type]), .administration input[type=text] { display: block; box-sizing: border-box; width: min(100%, 48rem); margin-top: 6px; }
.administration .controls label { flex: 0 1 44rem; }
.administration input.monitor-id { width: min(100%, 42ch); font-family: Consolas, monospace; }
.administration .card select { display: block; width: min(100%, 48rem); margin: 6px 0; }
.skip-link { position: absolute; left: 12px; top: -100px; z-index: 100; padding: 12px; background: white; }
.skip-link:focus { top: 12px; }
.status-summary { display: grid; grid-template-columns: minmax(10rem, 1fr) 3fr; gap: 8px 20px; }
.status-summary dt { font-weight: 650; }
.status-summary dd { margin: 0; overflow-wrap: anywhere; }
.controls > label { max-width: 100%; min-width: 0; }
@media(max-width: 600px) {
    .status-summary { grid-template-columns: 1fr; gap: 4px; }
    .status-summary dd { margin-bottom: 12px; }
    .controls > label { flex-basis: 100%; }
    .controls input:not([type=checkbox]), .controls select { width: 100%; margin-left: 0; margin-right: 0; }
    .card { padding: 16px; }
}

/* Keep disclosure content out of narrow status cells. */
.fleet-table { table-layout: fixed; min-width: 44rem; }
.fleet-table th:first-child { width: 3.5rem; }
.fleet-table th:nth-child(2) { width: 18%; }
.fleet-table th:nth-child(3) { width: 12%; }
.fleet-table th:nth-child(4) { width: 25%; }
.fleet-table td { vertical-align: top; overflow-wrap: anywhere; }
.fleet-details-toggle { display: block; margin: 8px 0 0; padding: 6px 10px; }
.log-inventory td { vertical-align: top; overflow-wrap: anywhere; }
.log-inventory details { margin: 8px 0; }
.selected-log { background: #eef3ff; }

.fleet-detail-drawer { position: fixed; z-index: 1000; inset: 0 0 0 auto; width: min(48rem, 100vw); box-sizing: border-box; overflow-y: auto; background: white; border-left: 1px solid #cbd9ea; box-shadow: -8px 0 28px #12304a26; padding: 20px 28px; }
.fleet-drawer-heading { position: sticky; top: -20px; background: white; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; z-index: 1; border-bottom: 1px solid #dbe4ef; }
.fleet-drawer-heading h2 { margin: 0; }
.fleet-drawer-heading button { flex-shrink: 0; }
.fleet-detail-drawer pre { max-height: 22rem; }
.fleet-detail-drawer h3 { border-top: 1px solid #dbe4ef; padding-top: 20px; }
@media(max-width: 600px) { .fleet-detail-drawer { padding: 12px 16px; } .fleet-drawer-heading { top: -12px; flex-wrap: wrap; } }

.kiosk-history-grid .history { display: grid; grid-template-columns: repeat(auto-fill, minmax(14px, 1fr)); gap: 4px; overflow: visible; }
.kiosk-history-grid .history-block { width: auto; min-width: 0; height: 28px; }
.health-scores { max-width: 42rem; margin-block: 1rem; }
.health-scores th, .health-scores td { padding: 6px 12px; }

.health-scores .health-filter { border: 0; background: transparent; color: inherit; padding: 4px; margin: 0; text-align: left; cursor: pointer; }
.health-scores .selected-health { background: #e4edfa; outline: 2px solid #315fa2; outline-offset: -2px; }
.health-scores .health-filter:hover { text-decoration: underline; }
