:root {
  --bg: #0b0e13;
  --panel: #131820;
  --panel2: #1a212c;
  --line: #26303e;
  --text: #e8edf4;
  --dim: #8fa1b5;
  --green: #1db954;
  --yellow: #f5b301;
  --red: #e5484d;
  --amber: #ff9f43;
  font-family: "Helvetica Neue", Arial, system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body, #app { height: 100%; background: var(--bg); color: var(--text); }
#app { display: flex; flex-direction: column; }

#topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; letter-spacing: 2px; font-size: 18px; }
.brand span { color: var(--amber); }
#event-tabs { display: flex; gap: 6px; }
#event-tabs button {
  background: var(--panel2); color: var(--dim); border: 1px solid var(--line);
  padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600;
}
#event-tabs button.active { color: var(--text); border-color: var(--amber); }
.clock { font-variant-numeric: tabular-nums; font-size: 14px; color: var(--dim); }
.clock b { color: var(--text); }
.spacer { flex: 1; }
.feed-ages { display: flex; gap: 8px; font-size: 11px; color: var(--dim); }
.feed-ages .badge {
  padding: 3px 8px; border-radius: 4px; background: var(--panel2); border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.feed-ages .badge.stale { background: #3a2a12; color: var(--amber); border-color: var(--amber); }
.audio-btn {
  padding: 7px 14px; border-radius: 6px; border: 1px solid var(--line);
  cursor: pointer; font-weight: 700; font-size: 12px;
}
.audio-btn.disarmed { background: #3a2a12; color: var(--amber); border-color: var(--amber); }
.audio-btn.armed { background: #0f2d1a; color: var(--green); border-color: var(--green); }

#layout { flex: 1; display: flex; min-height: 0; }
#map-pane { flex: 3; position: relative; min-width: 0; }
#map { height: 100%; background: #0a0d11; }
#radar-ctl {
  position: absolute; bottom: 14px; left: 14px; z-index: 800;
  display: flex; align-items: center; gap: 10px;
  background: rgba(11,14,19,0.85); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 6px; font-size: 13px;
}
#radar-ctl button { background: none; border: none; color: var(--text); font-size: 16px; cursor: pointer; }
#radar-time { font-variant-numeric: tabular-nums; color: var(--dim); }

#side-pane {
  flex: 2; max-width: 520px; min-width: 380px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px; padding: 10px;
  background: var(--bg);
}
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.card h3 { font-size: 11px; letter-spacing: 1.5px; color: var(--dim); margin-bottom: 8px; }

.posture { border-radius: 8px; padding: 18px 16px; text-align: center; transition: background .3s; }
.posture.green { background: linear-gradient(160deg, #0f2d1a, #123822); border: 2px solid var(--green); }
.posture.yellow { background: linear-gradient(160deg, #3a2f08, #4a3c0a); border: 2px solid var(--yellow); }
.posture.red { background: linear-gradient(160deg, #3d1113, #521619); border: 2px solid var(--red); }
.posture.stale { border-style: dashed; border-color: var(--dim) !important; }
.posture-label { font-size: 46px; font-weight: 900; letter-spacing: 6px; }
.posture.green .posture-label { color: var(--green); }
.posture.yellow .posture-label { color: var(--yellow); }
.posture.red .posture-label { color: var(--red); }
.posture-sub { margin-top: 6px; font-size: 14px; color: var(--text); min-height: 20px; }
.posture-hold { margin-top: 4px; font-size: 13px; color: var(--dim); font-variant-numeric: tabular-nums; }
.posture-note { margin-top: 10px; font-size: 10px; color: var(--dim); }
.stale-tag { display: inline-block; margin-left: 8px; padding: 2px 8px; font-size: 11px;
  background: #3a2a12; color: var(--amber); border-radius: 4px; vertical-align: middle; }

.override-row { margin-top: 12px; display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.override-row select {
  background: var(--panel2); color: var(--text); border: 1px solid var(--line);
  border-radius: 5px; padding: 5px 8px; font-size: 12px;
}
.ov { padding: 6px 10px; border-radius: 5px; border: 1px solid var(--line);
  background: var(--panel2); color: var(--dim); font-size: 11px; font-weight: 700; cursor: pointer; }
.ov-y:hover { color: var(--yellow); border-color: var(--yellow); }
.ov-r:hover { color: var(--red); border-color: var(--red); }
.ov-g:hover { color: var(--green); border-color: var(--green); }

.obs-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.obs-cell { background: var(--panel2); border-radius: 6px; padding: 8px; text-align: center; }
.obs-cell .v { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.obs-cell .k { font-size: 10px; color: var(--dim); letter-spacing: 1px; margin-top: 2px; }
.obs-cell.tier-yellow .v { color: var(--yellow); }
.obs-cell.tier-red .v { color: var(--red); }
.obs-text { grid-column: 1 / -1; font-size: 13px; color: var(--dim); text-align: center; padding-top: 4px; }

.alert-item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 6px;
  border-bottom: 1px solid var(--line); }
.alert-item:last-child { border-bottom: none; }
.alert-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex: none; }
.alert-dot.red { background: var(--red); box-shadow: 0 0 8px var(--red); }
.alert-dot.yellow { background: var(--yellow); }
.alert-dot.info { background: var(--dim); }
.alert-body { flex: 1; min-width: 0; }
.alert-title { font-size: 13px; font-weight: 600; }
.alert-meta { font-size: 11px; color: var(--dim); margin-top: 2px; }
.ack-btn { flex: none; padding: 4px 10px; font-size: 11px; font-weight: 700;
  border-radius: 5px; border: 1px solid var(--line); background: var(--panel2);
  color: var(--dim); cursor: pointer; }
.ack-btn:hover { color: var(--text); border-color: var(--amber); }
.acked { color: var(--green); font-size: 11px; font-weight: 700; padding: 4px 6px; }
.no-alerts { color: var(--dim); font-size: 13px; padding: 6px; }

.hourly-strip { display: flex; gap: 4px; overflow-x: auto; }
.hour-cell { flex: 1; min-width: 34px; text-align: center; background: var(--panel2);
  border-radius: 5px; padding: 6px 2px; }
.hour-cell .h { font-size: 10px; color: var(--dim); }
.hour-cell .t { font-size: 13px; font-weight: 700; margin: 2px 0; }
.hour-cell .p { font-size: 10px; color: #4ea1ff; font-variant-numeric: tabular-nums; }
.hour-cell .w { font-size: 10px; color: var(--dim); }
.hour-cell.wet { outline: 1px solid #2a4a6e; }
.hour-cell .w.tier-yellow { color: var(--yellow); }
.hour-cell .w.tier-red { color: var(--red); }

#disclaimer { padding: 6px 16px; font-size: 10px; color: #5a6a7d;
  background: var(--panel); border-top: 1px solid var(--line); }

/* login */
.login-wrap { height: 100%; display: flex; align-items: center; justify-content: center; }
.login-box { background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 36px; width: 340px; text-align: center; }
.login-box .brand { font-size: 26px; margin-bottom: 18px; }
.login-box input { width: 100%; padding: 10px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--panel2); color: var(--text); font-size: 15px; margin-bottom: 12px; }
.login-box button { width: 100%; padding: 10px; border-radius: 6px; border: none;
  background: var(--amber); color: #111; font-weight: 800; font-size: 14px; cursor: pointer; }
.login-err { color: var(--red); font-size: 12px; margin-top: 10px; min-height: 16px; }

/* broadcast */
.broadcast #map { position: fixed; inset: 0; }
.bcast-stamp { position: fixed; top: 18px; right: 18px; z-index: 900;
  background: rgba(11,14,19,0.8); padding: 8px 16px; border-radius: 6px;
  font-size: 15px; font-variant-numeric: tabular-nums; }
.bcast-attr { position: fixed; bottom: 10px; right: 12px; z-index: 900;
  font-size: 10px; color: #cfd8e3; background: rgba(11,14,19,0.6); padding: 3px 8px; border-radius: 4px; }

/* planning */
.plan-wrap { max-width: 1100px; margin: 0 auto; padding: 20px; }
.plan-wrap h1 { font-size: 20px; margin-bottom: 4px; }
.plan-venue { color: var(--dim); font-size: 13px; margin-bottom: 16px; }
.day-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 24px; }
.day-card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.day-card .n { font-size: 12px; font-weight: 700; color: var(--dim); }
.day-card .t { font-size: 24px; font-weight: 800; margin: 4px 0; }
.day-card .s { font-size: 12px; }
.day-card .m { font-size: 11px; color: var(--dim); margin-top: 4px; }
.day-card .p { color: #4ea1ff; }
.plan-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.plan-table th, .plan-table td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.plan-table th { color: var(--dim); font-size: 11px; letter-spacing: 1px; }
