/* SAFTY FOR YOU — visual polish layer
   Kept separate from style.css so the monitoring logic and legacy layout
   remain easy to audit. */
:root{
  --bg:#050a12;
  --bg2:rgba(8,15,27,.9);
  --card:#0d1726;
  --surface:#0b1422;
  --surface2:#101d2f;
  --line:#1d2c40;
  --line-hi:#2c405a;
  --fg:#edf5ff;
  --dim:#91a4ba;
  --dim2:#61758c;
  --ok:#38d996;
  --warn:#f5c451;
  --err:#ff5e68;
  --acc:#4cc9ff;
  --acc2:#7b8cff;
  --sea:#07111f;
  --land:#18263a;
  --coast:#4b688b;
  --border:#354c69;
  --adm:#2d415b;
  --radius:14px;
  --shadow:0 18px 50px rgba(0,0,0,.26);
}

@media (prefers-color-scheme:light){
  :root{
    --bg:#e9f0f7;
    --bg2:rgba(247,251,255,.9);
    --card:#fff;
    --surface:#f9fcff;
    --surface2:#eef5fb;
    --line:#d3dfeb;
    --line-hi:#b8cada;
    --fg:#122033;
    --dim:#576b80;
    --dim2:#8294a7;
    --sea:#d9eaf7;
    --land:#f4f1e7;
    --coast:#8ba1b7;
    --border:#b9c9d8;
    --adm:#cfdae5;
    --shadow:0 18px 44px rgba(37,62,87,.12);
  }
}

html{scroll-behavior:smooth}
body{
  min-height:100vh;
  background:
    radial-gradient(circle at 12% -8%,rgba(76,201,255,.1),transparent 28rem),
    radial-gradient(circle at 88% 8%,rgba(123,140,255,.08),transparent 24rem),
    var(--bg);
  font-size:14px;
}
body::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:-1;
  opacity:.16;
  pointer-events:none;
  background-image:
    linear-gradient(rgba(145,164,186,.06) 1px,transparent 1px),
    linear-gradient(90deg,rgba(145,164,186,.06) 1px,transparent 1px);
  background-size:48px 48px;
  mask-image:linear-gradient(to bottom,#000,transparent 70%);
}
button,select,input{font:inherit}
button:focus-visible,select:focus-visible,input:focus-visible{
  outline:2px solid var(--acc);
  outline-offset:2px;
}
.wrap{max-width:1320px;padding-inline:22px}

/* Header / command bar */
header{
  background:var(--bg2);
  border-color:rgba(76,201,255,.13);
  padding:8px 0;
  box-shadow:0 8px 34px rgba(0,0,0,.18);
  backdrop-filter:blur(18px) saturate(155%);
}
header .wrap{position:relative}
.bar{min-height:42px;gap:11px;flex-wrap:nowrap}
.brand{display:flex;align-items:center;gap:10px;min-width:max-content}
.brandmark{
  position:relative;
  width:30px;
  height:30px;
  flex:none;
  border:1px solid rgba(76,201,255,.45);
  border-radius:10px;
  background:linear-gradient(145deg,rgba(76,201,255,.18),rgba(123,140,255,.08));
  box-shadow:inset 0 1px rgba(255,255,255,.12),0 0 24px rgba(76,201,255,.08);
}
.brandmark::before,.brandmark::after,.brandmark i{
  content:"";
  position:absolute;
  left:50%;
  top:50%;
  border:1px solid var(--acc);
  border-radius:50%;
  transform:translate(-50%,-50%);
}
.brandmark::before{width:18px;height:18px;opacity:.32}
.brandmark::after{width:10px;height:10px;opacity:.65}
.brandmark i{width:3px;height:3px;background:var(--acc);box-shadow:0 0 8px var(--acc)}
.brandcopy{display:flex;flex-direction:column;line-height:1.05}
h1{
  font-size:14px;
  letter-spacing:.13em;
  background:linear-gradient(90deg,var(--fg),#a8e7ff);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}
.brandline{font-size:8px;color:var(--dim2);letter-spacing:.17em;margin-top:5px;white-space:nowrap}
.status{
  min-height:30px;
  padding:4px 7px 4px 9px;
  gap:7px;
  border:1px solid var(--line);
  border-radius:999px;
  background:rgba(255,255,255,.025);
  color:var(--dim);
  font-size:11px;
}
.dot{width:7px;height:7px}
.dot.on{box-shadow:0 0 0 4px rgba(56,217,150,.12),0 0 13px rgba(56,217,150,.45)}
.dot.wait{box-shadow:0 0 0 4px rgba(245,196,81,.1)}
.dot.off{box-shadow:0 0 0 4px rgba(255,94,104,.1)}
.feedrail{display:flex;gap:3px;margin-left:1px}
.feedrail i{
  display:grid;
  place-items:center;
  width:18px;
  height:18px;
  border-radius:50%;
  border:1px solid var(--line);
  color:var(--dim2);
  font:700 8px/1 ui-monospace,SFMono-Regular,Menlo,monospace;
  font-style:normal;
  transition:.25s ease;
}
.feedrail i.up{
  color:#062219;
  border-color:var(--ok);
  background:var(--ok);
  box-shadow:0 0 10px rgba(56,217,150,.24);
}
.bar-actions{display:flex;align-items:center;gap:6px;margin-left:auto}
.btn{
  min-height:30px;
  padding:5px 10px;
  border-color:var(--line);
  border-radius:9px;
  background:rgba(255,255,255,.025);
  transition:background .18s,border-color .18s,transform .18s,box-shadow .18s;
}
.btn:hover{
  border-color:var(--line-hi);
  background:rgba(76,201,255,.07);
  transform:translateY(-1px);
}
.btn:active{transform:translateY(0)}
.btn.act{
  color:#03131e;
  background:linear-gradient(135deg,var(--acc),#7ee0ff);
  border-color:transparent;
  box-shadow:0 6px 18px rgba(76,201,255,.16);
}
.btn.danger{background:linear-gradient(135deg,var(--err),#ff7d68);border-color:transparent}
.settings-btn{font-size:14px;width:32px;padding-inline:0}
.clock{
  position:relative;
  margin-left:2px;
  padding-left:13px;
  font:650 14px/1 ui-monospace,SFMono-Regular,Menlo,monospace;
  letter-spacing:.02em;
}
.clock::before{
  content:"";
  position:absolute;
  left:0;
  top:-3px;
  width:1px;
  height:20px;
  background:var(--line);
}
.clock small{letter-spacing:.12em}
.audiobar{
  margin-top:8px;
  padding:11px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:linear-gradient(135deg,rgba(76,201,255,.045),rgba(123,140,255,.025));
  box-shadow:inset 0 1px rgba(255,255,255,.03);
}
#bWake.wake-pending{border-color:rgba(245,196,81,.55);color:var(--warn)}
#bWake.wake-released{border-color:rgba(245,196,81,.55);color:var(--warn)}
#bWake.wake-error{border-color:rgba(248,81,73,.65);color:var(--err)}
#bWake:disabled{cursor:not-allowed;opacity:.56}
.live-section .eta-note{color:var(--dim2);font-size:11px}

/* Map is the hero product surface */
.stage{padding:0}
.mapbox{
  border-bottom-color:rgba(76,201,255,.15);
  box-shadow:var(--shadow);
  isolation:isolate;
}
.mapbox::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:1;
  pointer-events:none;
  background:
    radial-gradient(circle at 50% 46%,transparent 45%,rgba(2,7,14,.2) 100%),
    linear-gradient(to bottom,rgba(76,201,255,.03),transparent 22%);
}
#map{height:min(67vh,620px)}
.mapframe{position:absolute;inset:10px;z-index:3;pointer-events:none}
.mapframe i{position:absolute;width:22px;height:22px;opacity:.45}
.mapframe i:nth-child(1){left:0;top:0;border-left:1px solid var(--acc);border-top:1px solid var(--acc)}
.mapframe i:nth-child(2){right:0;top:0;border-right:1px solid var(--acc);border-top:1px solid var(--acc)}
.mapframe i:nth-child(3){right:0;bottom:0;border-right:1px solid var(--acc);border-bottom:1px solid var(--acc)}
.mapframe i:nth-child(4){left:0;bottom:0;border-left:1px solid var(--acc);border-bottom:1px solid var(--acc)}
.topstack{left:20px;right:20px;top:16px;gap:9px;z-index:4}
.maphud{
  padding:5px 10px 5px 9px;
  border:1px solid rgba(76,201,255,.15);
  border-radius:8px;
  background:rgba(4,11,20,.72);
  color:#d9edff;
  box-shadow:0 8px 24px rgba(0,0,0,.14);
  backdrop-filter:blur(12px);
}
.maphud::before{content:"MONITOR";color:var(--ok);font:700 8px/1 ui-monospace,monospace;letter-spacing:.12em;margin-right:9px}
.mapctl{
  gap:7px;
  padding:4px;
  border:1px solid rgba(255,255,255,.1);
  border-radius:12px;
  background:rgba(4,11,20,.5);
  backdrop-filter:blur(12px);
  opacity:.88;
}
.mapbox:hover .mapctl{opacity:1}
.mapctl .btn{background:rgba(11,21,35,.85);border-color:rgba(255,255,255,.1)}
.mapctl .btn.act{background:linear-gradient(135deg,var(--acc),#77ddff)}
.replaybadge{
  left:20px;
  right:20px;
  top:16px;
  z-index:8;
  min-height:52px;
  transform:none;
  align-items:center;
  justify-content:center;
  padding:10px 18px;
  border:2px solid #ffd45c;
  border-radius:12px;
  background:linear-gradient(115deg,rgba(155,33,36,.98),rgba(218,57,52,.98));
  box-shadow:0 12px 36px rgba(0,0,0,.38),0 0 0 4px rgba(255,212,92,.14);
  color:#fff;
  font-size:clamp(15px,2vw,22px);
  font-weight:900;
  letter-spacing:.08em;
  line-height:1.3;
  text-align:center;
}
body.replaying .replaybadge{display:flex}
body.replaying .replaybadge::before{
  content:"●";
  margin-right:.65em;
  color:#ffe47f;
  text-shadow:0 0 12px rgba(255,228,127,.92);
  animation:replay-warning-pulse 1s ease-in-out infinite;
}
body.replaying .topstack{top:82px}
@keyframes replay-warning-pulse{50%{opacity:.35}}
.alertstrip{
  padding:10px 13px;
  border-color:rgba(255,255,255,.13);
  border-left-width:4px;
  border-radius:12px;
  background:rgba(5,12,22,.86);
  box-shadow:0 16px 42px rgba(0,0,0,.34);
}
.alertstrip.warn,.eew.warn{animation:none}
.alertstrip.warn::after{
  content:"";
  width:8px;
  height:8px;
  margin-left:auto;
  border-radius:50%;
  background:var(--err);
  box-shadow:0 0 0 5px rgba(255,94,104,.12),0 0 18px rgba(255,94,104,.5);
  animation:signal-pulse 1.35s ease-in-out infinite;
}
@keyframes signal-pulse{50%{opacity:.42;transform:scale(.78)}}
.alertstrip .sh{border-radius:9px}
.waveoverlay{
  z-index:2;
  background:linear-gradient(to bottom,transparent,rgba(3,9,17,.78) 18%,rgba(3,9,17,.94));
}
#wave{height:126px}
.wavefoot{
  padding:3px 20px 9px;
  color:#8da2b9;
  letter-spacing:.01em;
}
.wleg{padding:2px 7px;border:1px solid rgba(255,255,255,.08);border-radius:999px;background:rgba(0,0,0,.18)}

/* Content / cards */
.content{padding-top:10px;padding-bottom:30px}
.data-section{position:relative}
.live-section h2{margin-top:16px}
.live-section #live{gap:8px}
.live-section .eew-head{padding:7px 10px}
.live-section .eew-body{gap:11px;padding:8px 10px;flex-wrap:nowrap}
.live-section .shindo{width:72px;height:72px;border-radius:12px}
.live-section .shindo .val{font-size:32px}
.live-section .place{font-size:19px;margin-bottom:4px}
.live-section .nums{gap:14px}
.live-section .num b{font-size:17px}
.live-section .times{margin-top:5px}
.live-section .eta{padding:6px 10px}
.live-section .eta .cnt{font-size:21px}
.live-section .areas{padding:5px 10px;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}
.live-section .areas::-webkit-scrollbar{display:none}
.live-section .areas .a{flex:none}
.live-section .areas .more{color:var(--warn);font-weight:750}
h2{
  display:flex;
  align-items:center;
  gap:9px;
  margin:24px 0 10px;
  color:var(--dim);
  font-size:11px;
  font-weight:700;
  letter-spacing:.14em;
}
h2::before{
  content:"";
  width:3px;
  height:13px;
  border-radius:9px;
  background:linear-gradient(to bottom,var(--acc),var(--acc2));
  box-shadow:0 0 13px rgba(76,201,255,.26);
}
#live:empty::after{
  padding:30px 14px;
  border-color:var(--line);
  border-style:solid;
  background:
    radial-gradient(circle at 50% 0,rgba(76,201,255,.055),transparent 60%),
    var(--card);
  box-shadow:inset 0 1px rgba(255,255,255,.025);
}
.eew{
  border-color:var(--line);
  background:linear-gradient(135deg,rgba(76,201,255,.035),transparent 38%),var(--card);
  box-shadow:0 12px 34px rgba(0,0,0,.13);
}
.eew-head{padding:10px 13px;background:rgba(255,255,255,.018)}
.tag{background:var(--surface);border-color:var(--line)}
.shindo{box-shadow:inset 0 1px rgba(255,255,255,.28),0 10px 28px rgba(0,0,0,.18)}
.place{letter-spacing:-.02em}
.tblwrap{
  border-color:var(--line);
  background:linear-gradient(145deg,rgba(76,201,255,.025),transparent 32%),var(--card);
  box-shadow:0 10px 32px rgba(0,0,0,.1);
}
table{font-size:12.5px}
th{
  color:var(--dim);
  letter-spacing:.04em;
  text-transform:uppercase;
}
td{border-color:rgba(145,164,186,.12)}
tbody tr:nth-child(even) td{background:rgba(255,255,255,.012)}
tr.clickable:hover td{background:rgba(76,201,255,.075)}
.tabs{
  display:inline-flex;
  padding:4px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--surface);
}
.tabs .btn{border-color:transparent;background:transparent}
.tabs .btn.act{background:linear-gradient(135deg,var(--acc),#70dcff)}
.lower-grid{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(280px,.45fr);gap:18px}
.lower-grid .data-section{min-width:0}
.agency-card{height:calc(100% - 40px)}
.agnote{
  margin-top:12px;
  padding:11px 12px;
  border:1px solid rgba(245,196,81,.2);
  border-radius:9px;
  background:rgba(245,196,81,.045);
  color:var(--dim);
}
.log-card{height:calc(100% - 40px)}
.log{max-height:280px;color:var(--dim);line-height:1.75}
footer{
  margin-top:32px;
  padding:18px 19px;
  border:1px solid var(--line);
  border-radius:14px;
  background:rgba(255,255,255,.018);
  color:var(--dim2);
}
footer b{color:var(--warn);font-weight:650}
footer a{color:var(--acc);text-underline-offset:3px}

@media (prefers-color-scheme:light){
  header{box-shadow:0 8px 28px rgba(38,64,90,.08)}
  .brandmark{background:linear-gradient(145deg,rgba(43,154,201,.18),rgba(91,106,210,.08))}
  .mapbox::before{background:radial-gradient(circle at 50% 46%,transparent 52%,rgba(63,91,117,.08) 100%)}
  .maphud{background:rgba(248,252,255,.83);color:#203348}
  .mapctl{background:rgba(247,251,255,.67);border-color:rgba(22,45,67,.12)}
  .mapctl .btn{background:rgba(255,255,255,.86);border-color:rgba(22,45,67,.12);color:#122033}
  .alertstrip{background:rgba(255,255,255,.9)}
  .waveoverlay{background:linear-gradient(to bottom,transparent,rgba(246,250,253,.76) 18%,rgba(246,250,253,.94))}
  .wleg{background:rgba(255,255,255,.45);border-color:rgba(22,45,67,.1)}
}

@media (max-width:1040px){
  .bar{flex-wrap:wrap}
  .bar-actions{order:3;width:100%;margin-left:40px;overflow-x:auto;padding-bottom:1px;scrollbar-width:none}
  .bar-actions::-webkit-scrollbar{display:none}
  .clock{margin-left:auto}
  .lower-grid{grid-template-columns:1fr}
  .agency-card,.log-card{height:auto}
}

@media (max-width:680px){
  .wrap{padding-inline:12px}
  header{padding:6px 0}
  .brandline{display:none}
  .brandmark{width:28px;height:28px}
  .status{margin-left:auto}
  .feedrail{display:none}
  .clock{font-size:12px}
  .bar-actions{margin-left:0}
  .btn{min-height:42px}
  .audiobar{
    position:absolute;
    left:12px;
    right:12px;
    top:calc(100% + 7px);
    max-height:min(68vh,520px);
    overflow:auto;
    margin-top:0;
    padding:13px;
    background:rgba(8,17,30,.96);
    box-shadow:0 22px 56px rgba(0,0,0,.44);
    backdrop-filter:blur(20px);
  }
  #map{height:59vh;min-height:400px}
  .topstack{left:10px;right:10px;top:10px}
  .replaybadge{left:10px;right:10px;top:10px;min-height:48px;padding:9px 12px;font-size:14px}
  body.replaying .topstack{top:68px}
  .mapframe{inset:6px}
  .mapctl{max-width:calc(100vw - 20px);overflow-x:auto;flex-wrap:nowrap;scrollbar-width:none}
  .mapctl::-webkit-scrollbar{display:none}
  .mapctl select.btn{min-width:220px;max-width:220px}
  .alertstrip .pl,.alertstrip .mg{font-size:16px}
  .alertstrip .sm{font-size:10.5px}
  .wavefoot{padding-inline:10px}
  .tblwrap{padding:9px}
  .live-section h2{margin:9px 0 5px;font-size:10px}
  .live-section .eew-head{gap:4px;padding:4px 7px}
  .live-section .tag{padding:1px 5px;font-size:9.5px}
  .live-section .ago{font-size:9.5px}
  .live-section .eew-body{gap:8px;padding:6px 7px}
  .live-section .shindo{width:54px;height:54px;border-radius:10px}
  .live-section .shindo .lbl{font-size:7.5px;margin-bottom:2px}
  .live-section .shindo .val{font-size:25px}
  .live-section .meta{min-width:0}
  .live-section .place{font-size:15px;line-height:1.15;margin-bottom:3px}
  .live-section .nums{gap:9px;flex-wrap:nowrap}
  .live-section .num b{font-size:13px}
  .live-section .num span{font-size:8px}
  .live-section .num:nth-child(3),.live-section .times{display:none}
  .live-section .eta{gap:5px;padding:4px 7px;font-size:10px}
  .live-section .eta .cnt{font-size:14px}
  .live-section .eta-note{font-size:8px;white-space:nowrap}
  .live-section .areas{gap:4px;padding:4px 7px;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}
  .live-section .areas::-webkit-scrollbar{display:none}
  .live-section .areas .a{flex:none;font-size:9.5px;padding:1px 5px}
  footer{padding:15px}
}

@media (min-width:681px) and (max-height:820px){
  #map{height:55vh}
  .live-section .eta{padding-block:3px}
  .live-section .eta .cnt{font-size:16px}
  .live-section .eta-note{font-size:9px;white-space:nowrap}
}

@media (min-width:681px) and (min-height:821px) and (max-height:960px){
  #map{height:60vh}
}

/* 9:16 streaming frame */
body.portrait::before{display:none}
body.portrait header{position:sticky}
body.portrait .bar{min-height:0;gap:7px;flex-wrap:wrap}
body.portrait .brandmark{width:27px;height:27px}
body.portrait .brandcopy{max-width:132px}
body.portrait .brandline{display:none}
body.portrait .status{margin-left:auto}
body.portrait .feedrail{display:none}
body.portrait .clock{font-size:11.5px;margin-left:0}
body.portrait .bar-actions{
  order:3;
  width:100%;
  margin-left:0;
  overflow-x:auto;
  flex-wrap:nowrap;
  scrollbar-width:none;
}
body.portrait .bar-actions::-webkit-scrollbar{display:none}
body.portrait .bar-actions .btn{flex:none}
body.portrait .btn{min-height:38px}
body.portrait .audiobar{
  position:absolute;
  left:8px;
  right:8px;
  top:calc(100% + 6px);
  max-height:62vh;
  overflow:auto;
  margin-top:0;
  padding:11px;
  background:rgba(8,17,30,.97);
  box-shadow:0 20px 52px rgba(0,0,0,.48);
  backdrop-filter:blur(20px);
}
body.portrait #map{height:55vh;min-height:0}
body.portrait .topstack{left:9px;right:9px;top:9px;gap:6px}
body.portrait .replaybadge{left:9px;right:9px;top:9px;min-height:46px;padding:8px 10px;font-size:13px;letter-spacing:.04em}
body.portrait.replaying .topstack{top:63px}
body.portrait .mapframe{inset:6px}
body.portrait .mapctl{max-width:100%;overflow-x:auto;flex-wrap:nowrap;scrollbar-width:none}
body.portrait .mapctl::-webkit-scrollbar{display:none}
body.portrait .mapctl select.btn{min-width:190px;max-width:190px}
body.portrait #wave{height:92px}
body.portrait .wavefoot{padding:2px 9px 6px}
body.portrait .content{padding-top:2px}
body.portrait .live-section h2{margin:9px 0 5px;font-size:10px}
body.portrait .live-section .eew-head{gap:4px;padding:4px 7px}
body.portrait .live-section .tag{padding:1px 5px;font-size:9.5px}
body.portrait .live-section .ago{font-size:9.5px}
body.portrait .live-section .eew-body{gap:8px;padding:6px 7px;flex-wrap:nowrap}
body.portrait .live-section .shindo{width:54px;height:54px;border-radius:10px}
body.portrait .live-section .shindo .lbl{font-size:7.5px;margin-bottom:2px}
body.portrait .live-section .shindo .val{font-size:25px}
body.portrait .live-section .meta{min-width:0}
body.portrait .live-section .place{font-size:15px;line-height:1.15;margin-bottom:3px}
body.portrait .live-section .nums{gap:9px;flex-wrap:nowrap}
body.portrait .live-section .num b{font-size:13px}
body.portrait .live-section .num span{font-size:8px}
body.portrait .live-section .num:nth-child(3),body.portrait .live-section .times{display:none}
body.portrait .live-section .eta{gap:5px;padding:4px 7px;font-size:10px}
body.portrait .live-section .eta .cnt{font-size:14px}
body.portrait .live-section .eta-note{font-size:8px;white-space:nowrap}
body.portrait .live-section .areas{gap:4px;padding:4px 7px;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}
body.portrait .live-section .areas::-webkit-scrollbar{display:none}
body.portrait .live-section .areas .a{flex:none;font-size:9.5px;padding:1px 5px}
body.portrait .lower-grid{grid-template-columns:1fr;gap:0}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important}
}
