:root{font:15px Inter,"Segoe UI",sans-serif;color:#172839;background:#f1f5fb;--navy:#002d62;--muted:#536679;--line:#d8e2ea;--blue:#005a9c;--red:#c8102e}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0;min-width:300px}
header{padding:14px max(20px,calc((100% - 1160px)/2));background:var(--navy);border-bottom:3px solid var(--red);color:white;display:flex;justify-content:space-between;align-items:center;gap:18px}
.brand,#account,.intro,.subheading,.toolbar,.station-heading,.record,.dialog-title,.actions,.row-actions{display:flex;align-items:center;gap:12px;justify-content:space-between}
.brand{justify-content:flex-start;line-height:1.2}
.brand div,.identity,.record>div,.totals div{display:grid;gap:4px}
.brand div span,.identity span{color:#d6e5f7;font-size:.8rem}
.identity{text-align:right}
#account{flex-wrap:wrap}
.header-clock{display:grid;gap:3px;white-space:nowrap;text-align:right;font-variant-numeric:tabular-nums}
.header-clock span{color:#d6e5f7;font-size:.75rem}
.header-clock time{font-size:.9rem;font-weight:700}
@media(max-width:400px){header{flex-wrap:wrap}.header-clock{text-align:left}}
.brand-logo{display:block;width:clamp(96px,15vw,142px);height:auto;background:white;padding:5px 7px;border-radius:6px}
main{max-width:1200px;margin:auto;padding:28px 20px 48px}
.intro{padding:24px 0 28px;gap:24px}
.greeting{color:var(--muted);font-size:.9rem;font-weight:600}
.greeting+.intro{padding-top:8px}
.welcome-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: white;
  color: var(--navy);
}
.welcome-ready { animation: welcome-exit .65s 2s ease-in-out both; }
.welcome-ready::before {
  content: '';
  position: absolute;
  width: min(100vw, 640px);
  height: 240px;
  background:
    radial-gradient(ellipse at 38% 52%, #005a9c24 0%, #005a9c12 28%, #005a9c06 52%, #005a9c00 72%),
    radial-gradient(ellipse at 62% 48%, #c8102e20 0%, #c8102e10 28%, #c8102e05 52%, #c8102e00 72%);
  pointer-events: none;
}
@media (min-width: 681px) {
  .welcome-ready::before {
    width: min(96vw, 960px);
    height: min(85vh, 400px);
    background:
      radial-gradient(ellipse 33% 48% at 38% 50%, #005a9c24, #005a9c12 45%, #005a9c05 75%, #005a9c00 100%),
      radial-gradient(ellipse 33% 48% at 62% 50%, #c8102e20, #c8102e10 45%, #c8102e05 75%, #c8102e00 100%);
  }
}
.welcome-dismiss { animation: welcome-exit .35s ease-in-out both; }
.welcome-screen p {
  position: relative;
  padding: 24px;
  text-align: center;
  font-size: clamp(1.6rem, 5vw, 2.7rem);
  font-weight: 650;
}
.welcome-lines,.welcome-lines::before,.welcome-lines::after {
  position: absolute;
  width: min(110vw, 760px);
  height: 25vh;
  border-top: 2px solid var(--blue);
  border-radius: 50%;
}
.welcome-lines {
  bottom: -8vh;
  right: -22vw;
  transform: rotate(-18deg);
}
.welcome-lines::before,.welcome-lines::after { content: ''; left: -5%; }
.welcome-lines::before { top: 12px; border-color: var(--red); }
.welcome-lines::after { top: 25px; border-color: var(--navy); opacity: .4; }
@keyframes welcome-exit { from { opacity: 1; } to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .welcome-ready,.welcome-dismiss { animation: none; }
}
h1,h2,h3,p{margin:0}
h1{font-size:clamp(2rem,5vw,3.2rem);line-height:1.08;letter-spacing:-.045em;margin:8px 0}
h2{font-size:1.25rem;letter-spacing:-.015em}
h3{font-size:.93rem}
.eyebrow{font-size:.72rem;font-weight:750;letter-spacing:.14em;color:var(--blue)}
.muted{color:var(--muted)}
.small{font-size:.84rem}
.totals{display:flex;gap:10px}
.totals div{min-width:92px;padding:12px 16px;border:1px solid var(--line);border-radius:12px;background:white}
.totals strong{font-size:1.5rem}
.totals span{font-size:.83rem;color:var(--muted)}
nav{display:flex;gap:6px;border-bottom:1px solid var(--line);margin-bottom:20px;overflow:auto}
nav button{display:flex;gap:8px;align-items:center;white-space:nowrap;border:0;border-bottom:3px solid transparent;background:transparent;border-radius:0}
nav button[aria-current]{color:var(--blue);border-bottom-color:var(--red)}
button,input,select{font:inherit}
button{border:1px solid var(--line);background:#fff;color:inherit;border-radius:7px;padding:8px 12px;cursor:pointer;font-size:.85rem;font-weight:650}
button:hover{border-color:#7a9ab4}
button:disabled{opacity:.55;cursor:wait}
button.primary{background:var(--blue);border-color:var(--blue);color:#fff}
button.quiet{padding:5px 8px;background:transparent}
header button.quiet{border-color:#587083}
:focus-visible{outline:3px solid #4389bb;outline-offset:2px}
a{color:var(--blue);font-weight:650}
input:not([type=checkbox]),select{min-width:0;border:1px solid #b6c8d8;border-radius:7px;background:#fff;padding:8px 10px;color:inherit}
.toolbar{margin-bottom:14px}
.station-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,360px),1fr));gap:16px;align-items:start}
.panel{background:white;border:1px solid var(--line);border-radius:13px;box-shadow:0 2px 5px #203d5110;overflow:hidden}
.station-heading{padding:16px 18px;background:#f8fafc;border-bottom:1px solid var(--line)}
.station-heading h2{margin-bottom:4px}
.station-section{padding:14px 18px}
.station-section+.station-section{border-top:1px solid var(--line)}
.pill{display:inline-block;white-space:nowrap;padding:4px 8px;border-radius:20px;font-size:.72rem;font-weight:700;background:#eaf0f5;color:#42566b}
.green{background:#def1e8;color:#155d46}
.amber{background:#fff0d4;color:#774917}
.blue{background:#dfedf7;color:var(--blue)}
.records{list-style:none;padding:0;margin:8px 0 0}
.record{border-top:1px solid var(--line);padding:10px 0;align-items:start;overflow-wrap:anywhere}
.record .right{text-align:right;justify-items:end}
.record .row-actions,.row-actions{display:flex;gap:5px;flex-wrap:wrap;justify-content:flex-end}
.record.contact{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;justify-content:stretch;gap:3px 10px;padding:8px 0}
.record.reorderable-contact{position:relative;padding-left:30px}
.reorder-handle{position:absolute;left:0;top:6px;width:26px;min-height:44px;padding:0;border:0;background:transparent;color:var(--muted);font-size:1.25rem;cursor:grab;touch-action:none;user-select:none}
.contact-dragging{opacity:.6}
.contact-dragging .reorder-handle{cursor:grabbing}
.contact-drop-target{background:#edf5fc}
.contact .call-status,.contact-phone{justify-self:end}
.contact-phone{white-space:nowrap;font-size:.88rem}
.contact-availability,.contact-actions{grid-column:1/-1}
.contact-availability summary{width:fit-content;cursor:pointer;color:var(--blue);padding:4px 0}
.contact-availability>div{padding:2px 0 2px 14px}
.outside-call-hours{margin-top:8px;border-top:1px solid var(--line)}
.outside-call-hours>summary{cursor:pointer;color:var(--blue);padding:8px 0;font-size:.84rem;font-weight:650}
.contact .contact-actions{margin-top:2px}
.contact-actions button.quiet{padding:3px 7px}
.other-stations{margin-top:16px}
.other-stations .station-grid{gap:0 20px}
.other-stations .record{align-items:center}
.shift{flex-wrap:wrap}
.assignment-name{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.dispatcher-profile-link{border:0;padding:0;background:transparent;color:var(--blue);text-decoration:underline;font-size:inherit;text-align:left}
.dispatcher-profile{display:grid;gap:6px;margin-top:16px}
.empty{padding:12px 0;color:var(--muted);font-size:.9rem}
.inset{padding:16px 18px}
.stack{display:grid;gap:14px}
.auth{max-width:475px;margin:5vh auto 0;padding:26px}
.auth h1{font-size:2rem}
form{display:grid;gap:12px;margin-top:16px}
.field{display:grid;gap:5px;font-weight:650;font-size:.89rem}
.field input,.field select{width:100%;font-weight:400}
fieldset{margin:0;border:1px solid var(--line);border-radius:7px}
legend{font-size:.85rem}
.checks{display:flex;flex-wrap:wrap;gap:8px}
.checks label{display:flex;align-items:center;gap:3px;font-size:.84rem}
.pair{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.actions{justify-content:flex-end}
.error{color:#972c32;font-size:.88rem}
dialog{max-width:min(520px,calc(100% - 28px));max-height:85dvh;overflow:auto;width:100%;border:1px solid var(--line);border-radius:13px;padding:20px;color:inherit;box-shadow:0 16px 50px #0004}
dialog::backdrop{background:#13233488}
#status{position:fixed;bottom:16px;right:16px;background:var(--navy);color:white;padding:10px 14px;border-radius:8px;display:none}
#status.visible{display:block}
@media(max-width:560px){.intro{display:block;padding-top:6px}.totals{margin-top:15px}.identity{display:none}.toolbar input{max-width:55%}.record{flex-wrap:wrap}.record .right{text-align:left;justify-items:start}}

@media (max-width: 680px) {
  .station-manager-view header {
    display: grid;
    gap: 6px;
    padding: calc(10px + env(safe-area-inset-top)) 14px 6px;
  }
  .station-manager-view .brand-logo { width: 104px; }
  .station-manager-view #account { gap: 8px; justify-content: flex-end; }
  .station-manager-view .identity { display: none; }
  .station-manager-view .header-clock { margin-right: auto; text-align: left; }
  .station-manager-view main { padding: 16px 12px calc(82px + env(safe-area-inset-bottom)); }
  .station-manager-view .intro { display: none; }
  .station-manager-view .greeting { margin-bottom: 12px; }
  .station-manager-view nav {
    position: fixed;
    z-index: 2;
    inset: auto 0 0;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0;
    margin: 0;
    padding: 4px env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    border: 0;
    border-top: 1px solid var(--line);
    background: #fff;
    box-shadow: 0 -4px 16px #002d6212;
  }
  .station-manager-view nav button { justify-content: center; gap: 4px; padding: 0 2px; font-size: .8rem; }
  .station-manager-view nav button[aria-current] { background: #edf5fc; }
  .station-manager-view nav .pill { padding: 2px 5px; }
  .station-manager-view nav button { flex-wrap: wrap; align-content: center; row-gap: 2px; }
  .station-manager-view button,
  .station-manager-view .contact-phone { min-height: 44px; }
  .station-manager-view .contact-phone { display: inline-flex; align-items: center; }
  .station-manager-view .contact-availability summary,
  .station-manager-view .outside-call-hours>summary { min-height: 44px; padding: 12px 8px 12px 0; }
  .station-manager-view .station-grid { grid-template-columns: minmax(0, 1fr); }
  .station-manager-view .station-heading,
  .station-manager-view .subheading { flex-wrap: wrap; }
  .station-manager-view .station-heading,
  .station-manager-view .station-section,
  .station-manager-view .inset { padding: 12px; }
  .station-manager-view input:not([type=checkbox]),
  .station-manager-view select { font-size: 16px; }
  .station-manager-view dialog {
    width: 100%;
    max-width: 100%;
    max-height: 85dvh;
    margin: auto 0 0;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
    border-radius: 16px 16px 0 0;
  }
  .station-manager-view #status { bottom: calc(58px + env(safe-area-inset-bottom)); z-index: 3; }
}
@media (max-width: 380px) {
  .station-manager-view nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .station-manager-view main { padding-bottom: calc(122px + env(safe-area-inset-bottom)); }
  .station-manager-view #status { bottom: calc(102px + env(safe-area-inset-bottom)); }
}
