:root {
  --hub-ok: #2ecc71;
  --hub-watch: #f5a623;
  --hub-alert: #ff5a36;
  --hub-info: #4b96ff;
}

.hero-primary-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  max-width: 980px;
  margin: 24px auto 0;
}
.hero-primary-actions a {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  text-align: center;
}
.hero-primary-actions a:first-child { border-color: var(--accent); }
.hero-more { margin-top: 12px; }
.hero-more summary {
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}
.hero-more summary::-webkit-details-marker { display: none; }
.hero-more summary::after { content: " +"; color: var(--accent2); }
.hero-more[open] summary::after { content: " -"; }

.right-now-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.status-source {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  line-height: 1.35;
}
.source-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--hub-watch); flex: 0 0 auto; }
.source-dot.ok { background: var(--hub-ok); }
.source-dot.bad { background: var(--hub-alert); }
.source-dot.unknown { background: var(--muted); }

.area-console {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent2);
  background: var(--surface);
  border-radius: 8px;
  padding: 18px;
}
.area-console-grid { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr); gap: 18px; align-items: start; }
.area-summary { color: var(--muted); font-size: 13px; }
.area-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.area-links a { color: var(--text); text-decoration: none; border: 1px solid var(--border); border-radius: 6px; padding: 7px 10px; font-size: 12px; font-weight: 700; }
.area-save-note { min-height: 20px; margin-top: 8px; color: var(--hub-ok); font-size: 11px; }
.neighborhood-briefing { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; }
.briefing-heading { display: flex; justify-content: space-between; gap: 12px; color: var(--text); }
.briefing-heading span { color: var(--muted); font: 10px 'DM Mono', monospace; }
.briefing-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; margin-top: 10px; }
.briefing-item { border: 1px solid var(--border); border-radius: 6px; background: var(--surface2); padding: 10px; }
.briefing-item span { display: block; color: var(--muted); font: 9px 'DM Mono', monospace; text-transform: uppercase; }
.briefing-item a { display: block; margin-top: 5px; color: var(--text); text-decoration: none; font-size: 12px; font-weight: 700; }

.source-health-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface2);
  color: var(--muted);
  font-size: 11px;
}
.source-health-list { display: flex; gap: 10px; flex-wrap: wrap; }
.source-health-item { white-space: nowrap; }
.hub-view-controls { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.hub-view-controls button, .traffic-map-actions button, .camera-header-actions button, .report-lifecycle button { border: 1px solid var(--border); border-radius: 6px; background: var(--surface2); color: var(--text); padding: 8px 11px; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.hub-view-controls button:hover, .traffic-map-actions button:hover, .camera-header-actions button:hover, .report-lifecycle button:hover { border-color: var(--accent2); color: var(--accent2); }
.hub-view-controls span { margin-left: auto; color: var(--muted); font-size: 10px; }
.hub-library-hidden { display: none !important; }

.drive-signal-row { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; margin-top: 12px; }
.drive-signal { border: 1px solid var(--border); border-radius: 6px; padding: 9px; background: var(--surface2); }
.drive-signal strong { display: block; color: var(--text); font-size: 12px; }
.drive-signal span { color: var(--muted); font-size: 10px; }
.drive-disclaimer { margin-top: 10px; color: var(--muted); font-size: 11px; }

.traffic-panel { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 18px; }
.traffic-panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 12px; }
.traffic-panel-header h3 { color: var(--text); font-family: 'Bebas Neue', sans-serif; font-size: 25px; letter-spacing: .04em; line-height: 1.1; }
.traffic-panel-header p { max-width: 760px; margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.traffic-live-badge { flex: 0 0 auto; border: 1px solid rgba(46,204,113,.45); border-radius: 999px; padding: 6px 9px; background: rgba(46,204,113,.08); color: var(--hub-ok); font: 10px 'DM Mono', monospace; text-transform: uppercase; }
.traffic-map-wrap { position: relative; width: 100%; height: 420px; overflow: hidden; border: 1px solid var(--border); border-radius: 6px; background: #090b0f; }
.traffic-map-wrap iframe { position: relative; z-index: 1; display: block; width: 100%; height: 100%; border: 0; background: #090b0f; }
.traffic-map-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.traffic-map-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.traffic-map-actions a { border: 1px solid var(--border); border-radius: 6px; padding: 9px 12px; color: var(--text); font-size: 12px; font-weight: 700; text-decoration: none; }
.traffic-map-actions a:hover { border-color: var(--accent2); color: var(--accent2); }
.traffic-map-note { margin-top: 10px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.traffic-map-loading.is-error { color: var(--hub-alert); }
.traffic-map-loading[hidden] { display: none; }
.traffic-map-actions button { min-height: 36px; }

.camera-header-actions { display: flex; align-items: center; gap: 8px; }
.camera-grid.camera-grid-compact .camera-card:nth-child(n+4) { display: none; }
.report-lifecycle { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.report-lifecycle span { color: var(--muted); font-size: 10px; margin-right: auto; }

.admin-health-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; margin-top: 10px; }
.admin-health-item { border: 1px solid var(--border); border-radius: 6px; padding: 8px; background: var(--surface2); font-size: 11px; }
.admin-health-item strong { display: block; color: var(--text); }
.admin-health-item span { color: var(--muted); }

body.low-data-mode iframe { display: none !important; }
body.low-data-mode .traffic-map-wrap, body.low-data-mode .lazy-frame-shell { min-height: 120px; height: 120px; }
body.low-data-mode .traffic-map-loading { display: grid !important; }
body.low-data-mode .traffic-map-loading::after { content: " Use Open in Waze or Google Traffic when needed."; }

.report-filter-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: thin; }
.report-filter-row button { flex: 0 0 auto; border: 1px solid var(--border); border-radius: 999px; background: var(--surface2); color: var(--muted); padding: 7px 11px; font-weight: 700; cursor: pointer; }
.report-filter-row button.active { color: #fff; border-color: var(--accent); background: rgba(232,71,26,.16); }

.lazy-frame-shell { position: relative; min-height: 230px; background: #090b0f; }
.lazy-frame-shell::before {
  content: "Camera loads when this section is viewed";
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--muted); font-size: 12px; text-align: center; padding: 20px;
}
.lazy-frame-shell.loaded::before { display: none; }

.focus-page { background: var(--bg); color: var(--text); min-height: 100vh; }
.focus-main { width: min(1100px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0 90px; }
.focus-hero { padding: 24px 0 30px; border-bottom: 1px solid var(--border); }
.focus-hero h1 { font-family: 'Bebas Neue', sans-serif; font-size: clamp(42px, 7vw, 72px); letter-spacing: 0; line-height: 1; }
.focus-hero p { color: var(--muted); max-width: 720px; margin-top: 10px; }
.focus-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; margin-top: 24px; }
.focus-card { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); padding: 18px; }
.focus-card h2 { font-family: 'Bebas Neue', sans-serif; letter-spacing: .04em; font-size: 23px; }
.focus-card p { color: var(--muted); font-size: 13px; margin: 6px 0 14px; }
.focus-links { display: flex; flex-wrap: wrap; gap: 8px; }
.focus-links a { color: var(--text); text-decoration: none; border: 1px solid var(--border); border-radius: 6px; padding: 8px 11px; font-size: 12px; font-weight: 700; }
.focus-links a:hover { border-color: var(--accent2); color: var(--accent2); }
.trust-line { color: var(--muted); font: 10px 'DM Mono', monospace; margin-top: 12px; }
.focus-alert { border-color: var(--accent); }

@media (max-width: 760px) {
  .hero-primary-actions { grid-template-columns: 1fr 1fr; }
  .right-now-grid { grid-template-columns: 1fr 1fr; }
  .area-console-grid, .focus-grid { grid-template-columns: 1fr; }
  .briefing-grid { grid-template-columns: 1fr 1fr; }
  .drive-signal-row { grid-template-columns: 1fr; }
  .traffic-panel-header { display: block; }
  .traffic-live-badge { display: inline-block; margin-top: 10px; }
  .traffic-map-wrap { height: 330px; }
  .traffic-map-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .traffic-map-actions a { display: flex; align-items: center; justify-content: center; min-height: 44px; text-align: center; }
  #float-chat-btn { width: 48px; height: 48px; padding: 0; border-radius: 50%; bottom: 14px; right: 14px; }
  #float-chat-label { display: none; }
  #float-chat-btn { display: none !important; }
  .status-actions { display: none !important; }
  .hub-view-controls { align-items: stretch; flex-wrap: wrap; }
  .hub-view-controls button { flex: 1 1 160px; min-height: 44px; }
  .hub-view-controls span { width: 100%; margin-left: 0; }
  .admin-health-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) {
  .hero-primary-actions { grid-template-columns: 1fr; }
  .right-now-grid { grid-template-columns: 1fr; }
  .weather-strip { overflow: hidden; }
  #nws-strip-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .briefing-grid, .admin-health-grid { grid-template-columns: 1fr; }
}

#float-chat-btn {
  width: 50px !important;
  height: 50px !important;
  min-width: 50px;
  padding: 0 !important;
  border-radius: 50% !important;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease, background .15s ease !important;
}
#float-chat-label { display: none !important; }
body.hub-chat-ready #float-chat-btn { opacity: 1; pointer-events: auto; transform: translateY(0); }
