:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  background: #09111f;
  color: #eef4ff;
  --panel: #15233a;
  --panel-2: #1b2d49;
  --border: #304663;
  --muted: #aec0d7;
  --online: #45d77d;
  --offline: #96a3b4;
  --active: #ff626c;
  --unknown: #e6bb4f;
  --selected: #50bfff;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; padding: 24px; background: radial-gradient(circle at top, #101d31 0, #09111f 42%); }
main { max-width: 1100px; margin: 0 auto; }
h1 { margin: 0 0 5px; font-size: clamp(1.65rem, 4vw, 2.25rem); }
h2 { margin: 0; font-size: 1.02rem; }
.brand-e { color: #4bbcec; text-transform: lowercase; }
.brand-name { margin: -2px 0 2px; color: #d9e8fa; font-size: 1rem; font-weight: 750; }
.powered-by { margin: 0 0 7px; color: #8fc4e5; font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.warning { color: #ffd27a; margin: 0; }
.app-header { margin-bottom: 18px; }
.district-brand{display:grid;justify-items:start;gap:3px}.district-brand-logo{display:block;width:min(390px,88vw);height:132px;object-fit:contain;object-position:left center}.district-brand .brand-name{margin:0;color:#e7f0fa;font-size:.88rem;font-weight:750}.district-brand .brand-name span{color:#64b7e8}.district-brand .brand-name small{margin-left:5px;color:#aab9cb;font-size:.72rem}.district-brand .powered-by{margin:0;color:#8fc4e5}.district-brand .warning{margin-top:3px}@media(max-width:620px){.district-brand-logo{height:96px;width:min(310px,90vw)}.district-brand .brand-name{font-size:.72rem}}
.panel, .session, .summary, .selection-tray, .action-dock { background: var(--panel); border: 1px solid var(--border); border-radius: 13px; padding: 16px; }
.login { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }
.login .sso-button { grid-column: 1 / -1; width: 100%; }
label { display: grid; gap: 6px; color: var(--muted); font-size: .9rem; }
input, select { width: 100%; padding: 11px; border-radius: 9px; border: 1px solid #526b89; background: #0b1525; color: #eef4ff; font: inherit; }
button { min-height: 42px; padding: 10px 17px; border: 1px solid transparent; border-radius: 9px; background: #4bbcec; color: #06121e; font: inherit; font-weight: 750; cursor: pointer; }
button:hover:not(:disabled) { filter: brightness(1.08); }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #9ddcff; outline-offset: 2px; }
button:disabled { cursor: not-allowed; opacity: .55; }
.secondary { background: #263c5e; color: #eef4ff; border-color: #3e5677; }
.session { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; padding: 9px 11px; font-size: .82rem; }
.session #logout { margin-left: auto; }
.session button { min-height: 34px; padding: 6px 11px; font-size: .8rem; }
.role { padding: 4px 9px; border-radius: 999px; background: #263f66; color: #c9e2ff; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.control-state { padding: 6px 10px; border: 1px solid #4bbf78; border-radius: 999px; background: #123922; color: #8ef0ad; font-size: .78rem; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.control-state.suspended { border-color: #e2a73e; background: #45310d; color: #ffd477; }
.suspend-control { background: #9d2d36; border-color: #e55d66; color: #fff; }
.suspend-control.resume { background: #197647; border-color: #4bd084; }
.admin-panel { margin: 16px 0; }
.admin-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.admin-heading h2 { margin-bottom: 5px; font-size: 1.25rem; }
.admin-heading p { margin: 0; color: var(--muted); }
.profile-select { max-width: 420px; margin: 18px 0 12px; }
.action-editor { display: grid; gap: 9px; }
.action-config-row { display: grid; grid-template-columns: 58px minmax(170px, 1fr) 140px 130px 90px; gap: 13px; align-items: center; padding: 11px; border: 1px solid var(--border); border-radius: 11px; background: #101d31; }
.action-config-row.disabled-action { opacity: .62; }
.config-action-icon { width: 54px; height: 54px; object-fit: contain; }
.action-identity { display: grid; gap: 4px; }
.action-identity small { font-size: .78rem; }
.number-field { font-size: .78rem; }
.number-field input { padding: 9px; }
.enabled-field { display: flex; align-items: center; gap: 8px; color: #eef4ff; }
.enabled-field input { width: 19px; height: 19px; accent-color: #4bbcec; }
.order-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.compact { min-height: 36px; padding: 6px 9px; }
.audio-alert-toggle.on { border-color: #43d48f; color: #8ff0bc; }
.audio-alert-toggle.blocked { border-color: #ffbf68; color: #ffd792; }
html.android-app .audio-alert-toggle { display: none !important; }
.admin-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 15px; }
.directory-form { display: grid; grid-template-columns: 140px minmax(220px, 1fr) 180px 180px auto; gap: 10px; align-items: end; margin: 18px 0 4px; }
.directory-form .school-sip-config { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(160px, 1fr)); gap: 10px; padding: 13px; border: 1px solid var(--border); border-radius: 10px; }
.directory-form .school-sip-config legend { padding: 0 6px; color: #eef4ff; font-weight: 800; }
.directory-form .school-local-config { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; min-width: 0; margin: 0; padding: 13px; border: 1px solid #47bb9b; border-radius: 10px; }
.school-local-config legend { padding: 0 6px; color: #94f2d4; font-weight: 800; }
.school-local-config label { flex: 1 1 210px; min-width: 0; }
.school-local-config input { width: 100%; }
.school-local-config p { flex: 3 1 280px; margin: 0; color: #bccde0; font-size: 13px; line-height: 1.5; }
.school-display-setting { grid-column: 1 / -2; align-self: center; padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px; background: #101d31; }
.school-display-setting span { display: grid; gap: 2px; }
.school-display-setting small { color: #9eb1c8; font-size: .72rem; }
.user-form { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 12px; align-items: start; margin: 18px 0 4px; }
.user-form fieldset { grid-column: 1 / -1; padding: 13px; border: 1px solid var(--border); border-radius: 10px; }
.user-form legend { padding: 0 6px; color: #eef4ff; font-weight: 800; }
.support-calls-toggle { grid-column: 1 / -1; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; background: #101d31; }
.support-calls-toggle span { display: grid; gap: 2px; }
.support-calls-toggle small { color: #9eb1c8; font-size: .72rem; }
.user-form .user-sip-config { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 10px; }
.user-form .user-sip-config[hidden] { display: none; }
.role-description { display: block; min-height: 2.8em; color: #9edfc9; line-height: 1.35; }
.role-field{position:relative}.role-field:hover::after{content:attr(data-role-description);position:absolute;z-index:50;top:calc(100% - 2px);left:0;width:min(360px,90vw);padding:9px 11px;border:1px solid #55708f;border-radius:8px;background:#07111f;color:#eef4ff;box-shadow:0 8px 25px #0009;font-size:.78rem;line-height:1.35;pointer-events:none}.role-field:not([data-role-description])::after{display:none}
.sip-password-managed { align-self: end; margin: 0; padding: 10px 12px; border-radius: 8px; background: #10263a; color: #9edfc9; font-size: .78rem; font-weight: 750; }
.inline-check { display: flex; align-items: center; gap: 8px; color: #eef4ff; }
.inline-check input { width: 19px; height: 19px; flex: 0 0 auto; accent-color: #4bbcec; }
.school-access { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 9px; margin-top: 12px; }
.directory-buttons { display: flex; gap: 8px; }
.directory-form .directory-buttons { grid-column: 1 / -1; justify-content: flex-end; flex-wrap: wrap; }
.directory-list { display: grid; gap: 8px; margin-top: 16px; }
.directory-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: #101d31; }
.directory-row > div:first-child { display: grid; gap: 4px; }
.school-interface-status { font-weight: 750; }
.school-interface-status.ready { color: #67ddb1; }
.school-interface-status.offline { color: #ff6675; }
.school-interface-status.missing { color: #ffbf68; }
.row-actions { display: flex; gap: 7px; flex: 0 0 auto; }
.danger { background: #8f2831; border-color: #dc5962; color: #fff; }
.form-error { min-height: 1.3em; margin: 10px 0 0; color: #ff9298; }
.form-success { min-height: 1.3em; margin: 5px 0 0; color: #7de7a4; }
.summary { margin: 8px 0; display: flex; gap: 16px; flex-wrap: wrap; padding: 8px 11px; color: var(--muted); font-size: .78rem; }
.summary span { display: flex; align-items: center; gap: 5px; }
.summary .status-dot { width: 8px; height: 8px; }
.command-notice { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 12px 0; padding: 13px 15px; border: 1px solid #397ca3; border-left: 6px solid #4bbcec; border-radius: 11px; background: #11263d; }
.command-notice > div { display: grid; gap: 3px; }
.command-notice span { color: var(--muted); }
.command-notice.success { border-color: #358a55; border-left-color: var(--online); background: #102d20; }
.command-notice.error { border-color: #a13d45; border-left-color: var(--active); background: #35151a; }
.action-dock { margin: 12px 0; }
.action-dock-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 12px; }
.action-dock-heading h2 { font-size: 1.15rem; }
.action-dock-heading p { margin: 5px 0 0; color: var(--muted); font-size: .88rem; }
.dry-run-chip { flex: 0 0 auto; padding: 5px 9px; border: 1px solid #9e7920; border-radius: 999px; background: #3b2d0c; color: #ffd56a; font-size: .76rem; font-weight: 900; letter-spacing: .06em; }
.dry-run-chip.live { border-color: #ff7078; background: #5a1218; color: #fff; }
.dry-run-chip.suspended { border-color: #e2a73e; background: #45310d; color: #ffd477; }
.global-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 9px; }
.global-action { display: grid; grid-template-columns: 50px 1fr; gap: 3px 9px; align-items: center; min-height: 72px; padding: 9px; text-align: left; background: #101d31; border-color: var(--border); color: #eef4ff; }
.global-action img { grid-row: 1 / 3; width: 50px; height: 50px; object-fit: contain; }
.global-action small { font-size: .73rem; font-weight: 500; }
.status-dot, .legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--unknown); }
.status-dot.ok, .online-dot { background: var(--online); }
.status-dot.bad, .active-dot { background: var(--active); }
.offline-dot { background: var(--offline); }
.toolbar { display: grid; grid-template-columns: auto minmax(220px, 1fr) minmax(150px, auto) auto; gap: 10px; align-items: center; margin: 12px 0 6px; }
.view-switch { display: flex; padding: 3px; border-radius: 10px; background: #101d31; border: 1px solid var(--border); }
.view-switch button { min-height: 36px; padding: 7px 14px; background: transparent; color: var(--muted); }
.view-switch button.active { background: #315075; color: #fff; }
.search-field, .filter-field { display: block; }
.view-note { margin: 8px 0; color: var(--muted); font-size: .85rem; }
.map { position: relative; min-height: 520px; overflow: hidden; border: 1px solid var(--border); border-radius: 15px; background: #d9e0e7; touch-action: none; cursor: grab; overscroll-behavior: contain; }
.map:active { cursor: grabbing; }
.map-tiles { position: absolute; inset: 0; overflow: hidden; background: #d9e0e7; filter: saturate(.35) contrast(.88) brightness(.78); opacity: .62; }
.map-tiles img { position: absolute; width: 256px; height: 256px; max-width: none; user-select: none; }
.map-attribution { position: absolute; z-index: 4; right: 5px; bottom: 4px; padding: 2px 5px; border-radius: 4px; background: rgba(255,255,255,.82); color: #1b2d49; font-size: .65rem; text-decoration: none; }
.map-controls { position: absolute; z-index: 5; top: 12px; right: 12px; display: grid; grid-template-columns: auto 44px 44px; gap: 7px; }
.map-control { min-height: 44px; padding: 7px 12px; border: 1px solid #536b88; background: rgba(9,17,31,.94); color: #fff; font-size: 1.2rem; box-shadow: 0 3px 10px rgba(0,0,0,.25); }
.map-control.fit-control { font-size: .78rem; }
.map-marker { position: absolute; z-index: 2; display: grid; justify-items: center; min-height: 0; padding: 0; background: transparent; border: 0; color: #eef4ff; transform: translate(-50%, -50%); }
.school-page-badge{position:absolute;z-index:5;top:-10px;left:calc(50% + 13px);display:grid;place-items:center;width:30px;height:30px;border:3px solid #07101d;border-radius:50%;font-size:16px;line-height:1;box-shadow:0 3px 12px #0009;pointer-events:none}.school-page-badge.connecting{background:#f4ba35;animation:school-page-pulse 1s infinite}.school-page-badge.receiving{background:#2fd47c;animation:school-page-pulse 1.2s infinite}.school-page-badge.failed{background:#e04455}@keyframes school-page-pulse{50%{transform:scale(1.16);box-shadow:0 0 0 7px #64dca233,0 3px 12px #0009}}
.map-marker:disabled { opacity: 1; }
.map-marker.restricted .pin { filter: grayscale(.8); opacity: .72; }
.map-marker.restricted .marker-label::after { content: 'VIEW ONLY'; display: block; margin-top: 2px; color: #d0d9e5; font-size: .62rem; letter-spacing: .06em; }
.pin { display: grid; place-items: center; width: 46px; height: 46px; border: 4px solid #0b1525; border-radius: 50%; background: var(--unknown); color: #07131f; font-size: .8rem; font-weight: 900; box-shadow: 0 5px 16px rgba(0,0,0,.4); }
.school-pin svg { width: 27px; height: 27px; fill: currentColor; }
.pin.action-pin { width: 58px; height: 58px; overflow: hidden; border: 4px solid #fff; border-radius: 15px; background: #fff; transform: none; }
.pin.action-pin img { display: block; width: 100%; height: 100%; object-fit: contain; }
.map-marker.online .pin { background: var(--online); }
.map-marker.offline .pin { background: var(--offline); }
.map-marker.running .pin:not(.action-pin) { background: var(--active); color: white; }
.map-marker.selected .pin { box-shadow: 0 0 0 4px var(--selected), 0 6px 18px rgba(0,0,0,.5); }
.marker-label { display: grid; max-width: 190px; margin-top: 8px; padding: 5px 8px; border-radius: 7px; background: rgba(7,16,29,.94); color: #fff; font-size: .78rem; font-weight: 750; text-align: center; }
.marker-school { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.marker-alarm { margin-top: 2px; color: #ffafb3; font-size: .82rem; text-transform: uppercase; letter-spacing: .035em; }
.map-legend { position: absolute; z-index: 3; left: 12px; bottom: 12px; display: flex; gap: 13px; flex-wrap: wrap; padding: 8px 10px; border-radius: 9px; background: rgba(7,16,29,.92); color: var(--muted); font-size: .78rem; }
.map-legend span { display: flex; align-items: center; gap: 5px; }
.legend-ring { display: inline-block; width: 13px; height: 13px; border: 3px solid var(--selected); border-radius: 50%; }
.legend-heat{display:inline-block;width:15px;height:15px;border-radius:50%;background:radial-gradient(circle,#ffea70 0 25%,#f52e47 48%,transparent 72%)}
.incident-heat-halo{position:absolute;z-index:-1;top:23px;left:50%;width:var(--heat-size);height:var(--heat-size);border-radius:50%;background:radial-gradient(circle,#fff16b 0 8%,#ff9d2e 25%,#ef2949 48%,transparent 72%);opacity:var(--heat-intensity);transform:translate(-50%,-50%);pointer-events:none;filter:saturate(1.25)}
.site-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 11px; margin-top: 12px; }
.site { display: grid; grid-template-columns: 40px 1fr; gap: 12px; min-height: 145px; padding: 15px; background: var(--panel); border: 1px solid var(--border); border-left: 6px solid var(--unknown); border-radius: 12px; }
.site.online { border-left-color: var(--online); }
.site.offline { border-left-color: var(--offline); }
.site.running { border-left-color: var(--active); }
.site.selected { box-shadow: inset 0 0 0 2px var(--selected); }
.site.restricted { opacity: .78; }
.view-only { display: block; margin-top: 8px; color: #d7c88c; }
.site-select { display: grid; place-items: center; width: 34px; min-height: 34px; height: 34px; padding: 0; border: 2px solid #6b819e; border-radius: 8px; background: #0d1828; color: white; }
.site-select[aria-pressed="true"] { background: #258fc4; border-color: #8ddcff; }
.site-id { display: block; margin: 4px 0 10px; color: var(--muted); font-size: .82rem; }
.state { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; font-size: 1.08rem; font-weight: 800; }
.list-action-icon { width: 42px; height: 42px; flex: 0 0 auto; object-fit: contain; }
small { color: var(--muted); }
.selection-tray { position: sticky; z-index: 5; bottom: 12px; margin-top: 14px; display: flex; justify-content: space-between; align-items: center; gap: 18px; box-shadow: 0 8px 30px rgba(0,0,0,.35); }
.selection-tray[hidden] { display: none; }
.selection-names { margin-top: 5px; color: var(--muted); font-size: .86rem; }
.selection-actions { display: flex; gap: 8px; flex-shrink: 0; }
.simulation-panel { position: sticky; z-index: 6; bottom: 12px; margin-top: 16px; border: 2px solid #b98c27; box-shadow: 0 12px 38px rgba(0,0,0,.55); }
.simulation-panel.live { border-color: #ff626c; box-shadow: 0 0 0 2px rgba(255,98,108,.2), 0 12px 38px rgba(0,0,0,.62); }
.simulation-panel.live .dry-run-banner { color: #ff9da3 !important; }
.back-button { margin-bottom: 11px; }
.dry-run-banner { margin: 0 0 13px; color: #ffd56a !important; font-weight: 800; }
.simulation-choice { display: flex; align-items: center; gap: 13px; font-size: 1.15rem; }
.simulation-choice img { width: 62px; height: 62px; object-fit: contain; }
.target-review { display: grid; gap: 5px; margin: 13px 0; padding: 12px; border-radius: 9px; background: #0c1829; }
.target-review span { color: #ffd56a; font-size: .8rem; font-weight: 900; letter-spacing: .04em; }
.target-review strong { color: #eef4ff; }
.confirm-slider-wrap { display: grid; gap: 8px; }
.confirm-slider-shell { position: relative; height: 58px; overflow: hidden; border: 1px solid #526b89; border-radius: 29px; background: #0b1525; }
.confirm-slider-shell > span { position: absolute; inset: 0; display: grid; place-items: center; color: #c7d6e9; font-weight: 850; pointer-events: none; }
#confirmation-slider { --progress: 0%; position: absolute; inset: 0; height: 58px; margin: 0; padding: 0; border: 0; border-radius: 29px; appearance: none; background: linear-gradient(90deg, rgba(75,188,236,.75) var(--progress), transparent var(--progress)); cursor: grab; }
#confirmation-slider:active { cursor: grabbing; }
#confirmation-slider::-webkit-slider-runnable-track { height: 58px; background: transparent; }
#confirmation-slider::-webkit-slider-thumb { width: 52px; height: 52px; margin-top: 3px; border: 3px solid #dff5ff; border-radius: 50%; appearance: none; background: #4bbcec; box-shadow: 0 2px 9px rgba(0,0,0,.45); }
#confirmation-slider::-moz-range-track { height: 58px; background: transparent; }
#confirmation-slider::-moz-range-progress { height: 58px; background: rgba(75,188,236,.75); }
#confirmation-slider::-moz-range-thumb { width: 48px; height: 48px; border: 3px solid #dff5ff; border-radius: 50%; background: #4bbcec; box-shadow: 0 2px 9px rgba(0,0,0,.45); }
.simulation-message { min-height: 1.4em; color: #c9e2ff; font-weight: 700; }
.simulation-message.success { color: #7de7a4; }
.simulation-message.error { color: #ff9298; }
.empty { padding: 30px; text-align: center; color: var(--muted); }
#error { color: #ff9298; min-height: 1.5em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

@media (max-width: 760px) {
  body { padding: 14px; }
  .login { grid-template-columns: 1fr; }
  .login button { width: 100%; }
  .summary { display: grid; gap: 9px; }
  .command-notice { align-items: stretch; flex-direction: column; }
  .command-notice button { align-self: flex-start; }
  .action-dock-heading { align-items: stretch; flex-direction: column; }
  .dry-run-chip { align-self: flex-start; }
  .global-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; grid-row: 1; }
  .view-switch { width: 100%; }
  .view-switch button { flex: 1; }
  #select-all { width: 100%; }
  .map { height: clamp(520px, 68dvh, 720px); min-height: 520px; }
  .marker-label { max-width: 132px; font-size: .7rem; }
  .map-marker:not(.selected):not(.running):not(.focused) .marker-label { display: none; }
  .map-controls { top: 10px; right: 10px; grid-template-columns: 44px 44px; }
  .map-control.fit-control { grid-column: 1 / -1; }
  .selection-tray { align-items: stretch; flex-direction: column; }
  .selection-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .admin-heading { align-items: stretch; flex-direction: column; }
  .admin-heading button { align-self: flex-start; }
  .action-config-row { grid-template-columns: 54px 1fr; }
  .number-field, .enabled-field, .order-buttons { grid-column: 2; }
  .order-buttons { max-width: 120px; }
  .directory-form, .user-form { grid-template-columns: 1fr 1fr; }
  .directory-buttons, .user-form fieldset { grid-column: 1 / -1; }
  .directory-form .school-sip-config, .user-form .user-sip-config { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 440px) {
  .session button { width: 100%; margin-left: 0; }
  .toolbar { grid-template-columns: 1fr; }
  .search-field { grid-column: auto; grid-row: auto; }
  body { padding: 10px; }
  .map { height: 68dvh; min-height: 500px; border-radius: 12px; }
  .pin { width: 36px; height: 36px; }
  .pin.action-pin { width: 50px; height: 50px; }
  .marker-label { max-width: 108px; }
  .map-legend { right: 10px; gap: 8px; }
  .selection-actions { grid-template-columns: 1fr; }
  .global-actions { grid-template-columns: 1fr; }
  .admin-actions { display: grid; grid-template-columns: 1fr; }
  .directory-form, .user-form { grid-template-columns: 1fr; }
  .directory-buttons, .user-form fieldset { grid-column: auto; }
  .directory-form .school-sip-config, .user-form .user-sip-config { grid-column: 1 / -1; grid-template-columns: 1fr; }
  .directory-row { align-items: stretch; flex-direction: column; }
  .row-actions { width: 100%; }
  .row-actions button { flex: 1; }
}

@media (max-width: 760px) {
  html.android-app body { padding: 8px; }
  html.android-app .app-header { margin-bottom: 10px; }
  html.android-app .app-header h1 { font-size: 1.55rem; }
  html.android-app .brand-name { font-size: .82rem; }
  html.android-app .powered-by { font-size: .62rem; }
  html.android-app .map { height: calc(100dvh - 120px); min-height: 560px; }
}
/* School-control add-on: the district UI is otherwise unchanged. */
.zoom-school{background:#087f91;color:#fff;border:1px solid #087f91;border-radius:8px;padding:9px 14px;font-weight:800;box-shadow:0 4px 12px #087f9130}.zoom-school:hover{background:#066b7a}.zoom-school[hidden]{display:none}

/* Desktop district operations layout. Touch/mobile web and the Android app
   retain the existing layout through the pointer and width guards. */
@media (min-width: 1100px) and (hover: hover) and (pointer: fine) {
  body:not(.operations-fullscreen) { padding: 20px 24px; }
  body:not(.operations-fullscreen) main {
    display: grid;
    grid-template-columns: minmax(270px, 320px) minmax(0, 1fr);
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    column-gap: 16px;
    row-gap: 10px;
    width: 100%;
    max-width: 1600px;
  }
  body:not(.operations-fullscreen) .app-header {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: stretch;
    margin: 0;
    padding: 8px 10px;
  }
  body:not(.operations-fullscreen) .district-brand-logo {
    width: min(310px, 100%);
    height: 112px;
  }
  body:not(.operations-fullscreen) .district-brand .powered-by { font-size: .62rem; }
  body:not(.operations-fullscreen) #login-panel {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
  }
  body:not(.operations-fullscreen) .session {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    margin: 0;
  }
  body:not(.operations-fullscreen) #schools-admin-panel,
  body:not(.operations-fullscreen) #users-admin-panel,
  body:not(.operations-fullscreen) #features-admin-panel,
  body:not(.operations-fullscreen) #diagnostics-panel,
  body:not(.operations-fullscreen) #analytics-panel,
  body:not(.operations-fullscreen) #communications-panel,
  body:not(.operations-fullscreen) #admin-panel,
  body:not(.operations-fullscreen) #error {
    grid-column: 1 / -1;
  }
  body:not(.operations-fullscreen) #status-panel { display: contents; }
  body:not(.operations-fullscreen) #status-panel[hidden] { display: none; }
  body:not(.operations-fullscreen) .summary {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    margin: 0;
    padding: 7px 10px;
  }
  body:not(.operations-fullscreen) .command-notice {
    grid-column: 1 / -1;
    grid-row: 3;
    margin: 0;
  }
  body:not(.operations-fullscreen) .action-dock {
    grid-column: 1;
    grid-row: 4;
    align-self: stretch;
    margin: 0;
    padding: 14px;
  }
  body:not(.operations-fullscreen) .action-dock-heading { margin-bottom: 12px; }
  body:not(.operations-fullscreen) .action-dock-heading p { display: none; }
  body:not(.operations-fullscreen) .global-actions {
    grid-template-columns: 1fr;
    gap: 9px;
  }
  body:not(.operations-fullscreen) .global-action {
    min-height: 68px;
    grid-template-columns: 50px 1fr;
  }
  body:not(.operations-fullscreen) .toolbar {
    grid-column: 1;
    grid-row: 5;
    grid-template-columns: 1fr 1fr;
    margin: 0;
  }
  body:not(.operations-fullscreen) .toolbar .search-field { grid-column: 1 / -1; grid-row: 1; }
  body:not(.operations-fullscreen) .toolbar .view-switch { width: 100%; }
  body:not(.operations-fullscreen) .toolbar .view-switch button { flex: 1; }
  body:not(.operations-fullscreen) #select-all { width: 100%; }
  body:not(.operations-fullscreen) .view-note { display: none; }
  body:not(.operations-fullscreen) #map-panel {
    grid-column: 2;
    grid-row: 4 / span 2;
    min-height: clamp(560px, calc(100vh - 205px), 760px);
    height: 100%;
  }
  body:not(.operations-fullscreen) #list-panel {
    grid-column: 2;
    grid-row: 4 / span 2;
    min-width: 0;
  }
  body:not(.operations-fullscreen) #empty-state {
    grid-column: 2;
    grid-row: 4;
  }
  body:not(.operations-fullscreen) .selection-tray,
  body:not(.operations-fullscreen) .simulation-panel {
    grid-column: 1 / -1;
    grid-row: 6;
  }
}

/* Operations fullscreen keeps alarm selection and the live map in view. */
body.operations-fullscreen{height:100dvh;padding:7px;overflow:hidden;background:#09111f}
body.operations-fullscreen main{display:flex;max-width:none;height:100%;margin:0}
body.operations-fullscreen .app-header,
body.operations-fullscreen #login-panel,
body.operations-fullscreen #schools-admin-panel,
body.operations-fullscreen #users-admin-panel,
body.operations-fullscreen #features-admin-panel,
body.operations-fullscreen #diagnostics-panel,
body.operations-fullscreen #analytics-panel,
body.operations-fullscreen #communications-panel,
body.operations-fullscreen #admin-panel,
body.operations-fullscreen #error,
body.operations-fullscreen .summary,
body.operations-fullscreen .view-note{display:none!important}
body.operations-fullscreen .session{position:fixed;z-index:20;top:9px;right:10px;width:auto;margin:0;padding:0;border:0;background:transparent}
body.operations-fullscreen .session>*:not(#fullscreen-toggle){display:none!important}
body.operations-fullscreen #fullscreen-toggle{min-height:34px;background:rgba(9,17,31,.94);border-color:#607795;box-shadow:0 3px 12px #0008}
body.operations-fullscreen #status-panel{display:flex!important;flex:1;min-width:0;min-height:0;flex-direction:column}
body.operations-fullscreen .action-dock{flex:none;margin:0 0 7px;padding:10px 12px}
body.operations-fullscreen .action-dock-heading{margin-bottom:7px;padding-right:145px}
body.operations-fullscreen .action-dock-heading p{margin-top:2px;font-size:.76rem}
body.operations-fullscreen .global-actions{grid-template-columns:repeat(6,minmax(120px,1fr));gap:6px}
body.operations-fullscreen .global-action{min-height:58px;grid-template-columns:40px 1fr;padding:6px}
body.operations-fullscreen .global-action img{width:40px;height:40px}
body.operations-fullscreen .toolbar{flex:none;margin:0 0 5px}
body.operations-fullscreen #map-panel{flex:1;min-height:0;height:auto;border-radius:10px}
body.operations-fullscreen #list-panel{flex:1;min-height:0;overflow:auto}
body.operations-fullscreen .command-notice{flex:none;margin:0 0 7px;padding:8px 11px}
body.operations-fullscreen .selection-tray,
body.operations-fullscreen .simulation-panel{position:fixed;z-index:18;right:18px;bottom:16px;left:18px;margin:0}
@media(max-width:900px){body.operations-fullscreen .global-actions{grid-template-columns:repeat(3,minmax(0,1fr))}body.operations-fullscreen .action-dock-heading{padding-right:130px}}
.brand-home-link{display:block;width:fit-content;max-width:100%;color:inherit;text-decoration:none}

/* The signed-out webpage uses a full-width brand lockup above the login form.
   Signed-in district, mobile-web, and Android layouts remain unchanged. */
html:not(.android-app) body.logged-out main{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto;gap:18px;width:100%;max-width:1600px}
html:not(.android-app) body.logged-out .app-header{grid-column:1;grid-row:1;width:100%;margin:0;padding:8px 12px}
html:not(.android-app) body.logged-out .district-brand{width:100%;justify-items:center;text-align:center}
html:not(.android-app) body.logged-out .brand-home-link{width:100%;max-width:none}
html:not(.android-app) body.logged-out .district-brand-logo{width:100%;height:clamp(120px,24vw,300px);object-fit:contain;object-position:center}
html:not(.android-app) body.logged-out #login-panel{grid-column:1;grid-row:2;width:min(620px,100%);margin:0 auto}

/* v10.34 mobile-web landscape operations: brand above alarms, map beside it.
   Android retains the tested v18 layout. */
@media (max-width:1099px) and (min-width:700px) and (orientation:landscape) {
  html:not(.android-app) body:not(.logged-out):not(.operations-fullscreen){height:100dvh;padding:8px;overflow:hidden}
  html:not(.android-app) body:not(.logged-out):not(.operations-fullscreen) main{display:grid;grid-template-columns:minmax(230px,32vw) minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto;column-gap:9px;row-gap:7px;width:100%;max-width:none;height:100%;margin:0}
  html:not(.android-app) body:not(.logged-out):not(.operations-fullscreen) .app-header{grid-column:1;grid-row:1;margin:0;padding:3px 8px;min-height:0}
  html:not(.android-app) body:not(.logged-out):not(.operations-fullscreen) .district-brand-logo{width:100%;height:min(15dvh,92px);object-fit:contain;object-position:left center}
  html:not(.android-app) body:not(.logged-out):not(.operations-fullscreen) .district-brand .powered-by{font-size:.58rem}
  html:not(.android-app) body:not(.logged-out):not(.operations-fullscreen) .session{grid-column:2;grid-row:1;justify-self:end;align-self:start;margin:0;max-width:72%;padding:5px 7px;gap:5px}
  html:not(.android-app) body:not(.logged-out):not(.operations-fullscreen) #status-panel{display:contents}
  html:not(.android-app) body:not(.logged-out):not(.operations-fullscreen) #status-panel[hidden]{display:none}
  html:not(.android-app) body:not(.logged-out):not(.operations-fullscreen) .summary{grid-column:2;grid-row:1;justify-self:start;align-self:end;margin:0;padding:4px 7px;max-width:58%;font-size:.66rem}
  html:not(.android-app) body:not(.logged-out):not(.operations-fullscreen) .command-notice{grid-column:1/-1;grid-row:1;margin:0;align-self:end}
  html:not(.android-app) body:not(.logged-out):not(.operations-fullscreen) .action-dock{grid-column:1;grid-row:2;margin:0;padding:8px;min-height:0;overflow:auto}
  html:not(.android-app) body:not(.logged-out):not(.operations-fullscreen) .action-dock-heading{margin-bottom:6px}
  html:not(.android-app) body:not(.logged-out):not(.operations-fullscreen) .action-dock-heading p{display:none}
  html:not(.android-app) body:not(.logged-out):not(.operations-fullscreen) .global-actions{grid-template-columns:1fr 1fr;gap:5px}
  html:not(.android-app) body:not(.logged-out):not(.operations-fullscreen) .global-action{min-height:50px;grid-template-columns:36px 1fr;padding:5px}
  html:not(.android-app) body:not(.logged-out):not(.operations-fullscreen) .global-action img{width:34px;height:34px}
  html:not(.android-app) body:not(.logged-out):not(.operations-fullscreen) .toolbar{grid-column:1;grid-row:3;margin:0;grid-template-columns:1fr 1fr;gap:5px}
  html:not(.android-app) body:not(.logged-out):not(.operations-fullscreen) .toolbar .search-field{grid-column:1/-1}
  html:not(.android-app) body:not(.logged-out):not(.operations-fullscreen) #map-panel,html:not(.android-app) body:not(.logged-out):not(.operations-fullscreen) #list-panel{grid-column:2;grid-row:2/span 2;width:100%;height:100%;min-height:0;margin:0}
  html:not(.android-app) body:not(.logged-out):not(.operations-fullscreen) #empty-state{grid-column:2;grid-row:2}
  html:not(.android-app) body:not(.logged-out):not(.operations-fullscreen) .view-note{display:none}
}
/* v10.37 administrator-only school gateway credential controls. */
.gateway-key-status.ready{color:#55d69a;font-weight:800}.gateway-key-status.missing{color:#ffb45f;font-weight:800}.form-error.success{color:#55d69a}
.district-page-actions{display:flex;gap:.65rem;align-items:center;flex-wrap:wrap;margin-top:.8rem;padding-top:.8rem;border-top:1px solid #36506e}.district-page-actions button{min-width:9rem}.district-page-actions .danger{background:#b42535;border-color:#ef6574}.district-page-actions .end-page{background:#d62032;border:2px solid #ff8792;color:#fff;font-weight:800;position:sticky;bottom:1rem;z-index:20}.district-page-status{color:#ffdc78}.district-page-actions small{color:#aec1d6}
/* v11.2 communication history */
.communication-search{display:flex;gap:12px;align-items:end;flex-wrap:wrap;margin:14px 0;padding:12px;border:1px solid #304663;border-radius:10px}
.communication-search>label:first-child{display:grid;gap:6px;flex:1;min-width:min(220px,100%)}
.communication-search>small{flex-basis:100%;color:#aabbd0}
.communication-list article.message-unread{border-left:4px solid #44bdea}
.communication-list [data-read-message]{justify-self:start;min-height:44px}
/* v11.1 administrative modules */
.module-panel{width:100%;margin-top:16px}.server-settings-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,420px),1fr));gap:14px;margin-top:16px}.settings-card{min-width:0;padding:15px;border:1px solid #304663;border-radius:11px;background:#101d31}.settings-card h3,.group-builder h3{margin:0 0 10px;color:#eef4ff;font-size:1rem}.settings-note{margin:0 0 13px;color:#9fb3cb;line-height:1.45}.feature-options{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:9px;margin:14px 0}.feature-option{padding:12px;border:1px solid #304663;border-radius:9px;background:#13233a}.feature-option span{display:grid;gap:3px}.feature-option small{color:#93a9c1}.identity-grid,.communication-settings-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.identity-grid .identity-mappings{grid-column:1/-1}.identity-grid textarea,.communication-form textarea{width:100%;padding:11px;border:1px solid #526b89;border-radius:9px;background:#0b1525;color:#eef4ff;font:inherit;resize:vertical}.analytics-toolbar{display:flex;align-items:end;gap:10px;flex-wrap:wrap;margin:12px 0}.analytics-toolbar label{display:grid;gap:5px}.analytics-toolbar input{min-width:145px}.button-link{display:inline-flex;align-items:center;justify-content:center;min-height:38px;padding:8px 13px;border-radius:8px;background:#28486e;color:#fff;text-decoration:none;font-weight:800}.analytics-summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px}.analytics-summary article,.incident-list article,.communication-list article,.communication-call-list article{display:grid;gap:4px;padding:12px;margin:8px 0;border:1px solid #304663;border-radius:9px;background:#101d31}.analytics-summary small,.incident-list small,.communication-list small,.communication-list time,.communication-call-list small{color:#93a9c1}.communications-grid{display:grid;grid-template-columns:minmax(0,2fr) minmax(250px,1fr);gap:14px}.communication-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:12px}.communication-form label{display:grid;gap:5px}.communication-form select:not([multiple]){min-height:44px;height:44px}.communication-form select[multiple],.group-builder select[multiple]{min-height:108px;height:108px}.communication-form textarea{min-height:96px}.communication-form #communication-media-label,.communication-actions{grid-column:1/-1}.communication-actions{display:flex;gap:9px}.group-builder{display:grid;align-content:start;gap:10px;padding:13px;border:1px solid #304663;border-radius:10px;background:#101d31}.communication-list p{margin:4px 0;white-space:pre-wrap}.message-media{display:flex;gap:7px;flex-wrap:wrap}.message-media a{color:#8ddcff}.communication-call-list article{border-color:#356783}.communication-call-list button{justify-self:start}.configuration-secret{display:block;margin-top:8px;padding:9px;border-radius:8px;background:#102c25;color:#8ce7bc;overflow-wrap:anywhere}@media(max-width:760px){.login{grid-template-columns:1fr}.identity-grid,.communication-settings-grid,.communications-grid,.communication-form{grid-template-columns:1fr}.communication-form #communication-media-label,.communication-actions,.identity-grid .identity-mappings{grid-column:auto}.module-panel{padding:13px}.feature-options{grid-template-columns:1fr}.analytics-toolbar>*{width:100%}.communication-actions{display:grid}}

/* v11.4: forms keep labels aligned while help text wraps below. */
.user-form>label,.group-builder label,.communications-grid>section{min-width:0}
.user-form>label:not(.inline-check)>input,.user-form>label>select{height:44px}
.communication-form label:has(#communication-body){grid-column:1/-1}
.communication-actions{flex-wrap:wrap}.communication-search{align-items:center}
.message-media figure{margin:0;width:min(240px,100%)}.message-media img,.message-media video{display:block;width:100%;max-height:240px;object-fit:contain;border-radius:8px;background:#07111f}.message-media figcaption{overflow-wrap:anywhere;font-size:.8rem}
.communication-list article{overflow-wrap:anywhere}.moderation-controls{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0}.moderation-controls[hidden]{display:none}

.integration-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:12px;margin:12px 0}.integration-fields label{display:grid;gap:5px;min-width:0}.integration-fields .inline-check{display:flex}.integration-fields .full-field{grid-column:1/-1}.integration-fields textarea{width:100%;resize:vertical;min-height:100px;background:#0b1525;color:#eef4ff;border:1px solid #526b89;border-radius:8px;padding:10px}.settings-card p{overflow-wrap:anywhere}.settings-card>button{margin-top:10px}@media(max-width:600px){.integration-fields{grid-template-columns:1fr}}

.admin-actions{flex-wrap:wrap;min-width:0}.admin-actions>button,.settings-card button{max-width:100%;white-space:normal;overflow-wrap:anywhere}.admin-heading>div{min-width:0}.admin-heading>button{flex-shrink:0}

/* Keep long school names inside the incident filter on narrow displays. */
.analytics-toolbar .analytics-school-filter{min-width:0;width:18rem;max-width:100%}
.analytics-school-filter select{min-width:0;width:100%;max-width:100%}
@media(max-width:760px){.analytics-toolbar .analytics-school-filter{width:100%}}

/* Analytics follows the district status/map section in document order. */
html body main > #analytics-panel{grid-column:1 / -1;grid-row:auto!important;order:20;width:100%;min-width:0;box-sizing:border-box}
.incident-list-details{margin-top:16px;border:1px solid #49627f;border-radius:10px;min-width:0}
.incident-list-details > summary{cursor:pointer;padding:14px 16px;font-weight:700;min-height:48px;box-sizing:border-box;color:#eef4ff}
.incident-list-details > summary:focus-visible{outline:3px solid #47bce5;outline-offset:2px;border-radius:8px}
.incident-list-details[open] > .incident-list{padding:0 16px 16px}

/* Open reports need a scrolling document even in the Android fixed dashboard
   and mobile landscape. Keep the map in normal flow before the report. */
html.analytics-open:root,html.analytics-open:root body{height:auto!important;min-height:100%;overflow-y:auto!important}
html.analytics-open body main{display:block!important;height:auto!important;overflow:visible!important;max-width:1600px!important;margin:0 auto!important}
html.analytics-open body #status-panel:not([hidden]){display:contents!important;position:static!important;inset:auto!important;height:auto!important;overflow:visible!important}
html.analytics-open body #map-panel:not([hidden]){display:block!important;position:relative!important;height:55vh!important;height:55dvh!important;min-height:260px!important;max-height:720px!important;width:100%!important;margin:12px 0!important;box-sizing:border-box}
html.analytics-open body #action-dock:not([hidden]){position:sticky!important;top:0!important;z-index:30;height:auto!important;overflow:visible!important}
html.analytics-open body #global-actions{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:5px!important}
html.analytics-open body #global-actions .global-action{min-height:48px!important;min-width:0!important;padding:5px!important;grid-template-columns:30px minmax(0,1fr)!important}
html.analytics-open body #global-actions .global-action img{width:28px!important;height:28px!important}
html.analytics-open body #global-actions .global-action small{display:none!important}
html.analytics-open body #global-actions .global-action strong{font-size:14px!important;overflow-wrap:anywhere}
@media(min-width:700px),(orientation:landscape){html.analytics-open body #global-actions{grid-template-columns:repeat(6,minmax(0,1fr))!important}}

/* Reports expand in document flow; only wide data tables pan horizontally. */
.analytics-toolbar [hidden],#analytics-panel [hidden]{display:none!important}
.analytics-toolbar label{min-width:0;max-width:100%}
.analytics-toolbar select,.analytics-toolbar input{max-width:100%;min-width:0}
.analytics-toolbar input[type=number]{width:9rem}
.report-table-scroll{max-width:100%;overflow-x:auto;margin:12px 0}
.report-table-scroll table{border-collapse:collapse;width:100%;font-size:.85rem}
.report-table-scroll th,.report-table-scroll td{padding:9px;border:1px solid #405570;text-align:left;vertical-align:top;white-space:nowrap}
.report-table-scroll th{background:#192c45;color:#edf7ff}
.report-table-scroll td{background:#101d31}
.report-table-scroll caption{text-align:left;padding:8px 0;color:#c8d5e5}
.consistency-sort{display:grid;gap:5px;max-width:22rem;margin:12px 0}
.report-link{color:#a5dcff;text-decoration:underline;background:none;padding:2px;border:0;min-height:28px;text-align:left;font:inherit;cursor:pointer}
.response-status{display:inline-block;padding:3px 6px;border-radius:4px;background:#28394e;color:#e3eaf3}
.response-status.on-time{background:#103e32;color:#a2f3c5}.response-status.late{background:#4d360e;color:#ffe39e}.response-status.missed{background:#512330;color:#ffbbcc}
.consistency-floorplan{position:relative;width:100%;border:1px solid #405570;background:#172337;overflow:hidden}
.consistency-floorplan img{display:block;width:100%;height:auto}
.consistency-marker{position:absolute;transform:translate(-50%,-50%);display:grid;place-items:center;min-width:42px;min-height:42px;border-radius:50%;padding:5px;border:2px solid #ffc274;background:#61381edd;color:#fff;font-size:12px;font-weight:800;text-shadow:0 1px #000}
.consistency-marker.no-data{border-color:#c0c8d5;background:#425169dd}.consistency-marker.on-time{border-color:#7deab0;background:#174c37dd}
#analytics-consistency-quality{white-space:pre-line;margin-top:12px}#analytics-timeline{margin-top:16px;border:1px solid #405570;border-radius:10px;padding:14px}#analytics-timeline-content{overflow-wrap:anywhere}
