:root {
  --ink: #10212d;
  --muted: #62727d;
  --line: #dbe4e8;
  --surface: #ffffff;
  --surface-soft: #f4f8f9;
  --navy: #072a40;
  --teal: #087a78;
  --teal-soft: #e8f6f4;
  --blue-soft: #edf4fb;
  --amber: #a86300;
  --amber-soft: #fff4df;
  --red: #a43a43;
  --red-soft: #fff0f2;
  --shadow: 0 18px 45px rgba(7, 42, 64, .10);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f8fbfc;
  line-height: 1.5;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 999;
  background: var(--navy); color: white; padding: 10px 14px; border-radius: 8px;
}
.skip-link:focus { top: 12px; }

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(248, 251, 252, .92); backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(219, 228, 232, .8);
}
.header-inner {
  max-width: 1180px; margin: 0 auto; min-height: 76px; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.brand { display: inline-flex; gap: 12px; align-items: center; text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px;
  background: linear-gradient(140deg, var(--navy), var(--teal)); color: white; font-weight: 800;
  box-shadow: 0 8px 20px rgba(8, 122, 120, .18);
}
.brand strong { display: block; font-size: 15px; letter-spacing: -.01em; }
.brand small { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.header-actions { display: flex; align-items: center; gap: 10px; }

main { overflow: hidden; }
.hero {
  max-width: 1180px; margin: 0 auto; padding: 70px 24px 38px;
  display: grid; grid-template-columns: 1.22fr .78fr; gap: 48px; align-items: center;
}
.hero-copy { max-width: 710px; }
.eyebrow {
  margin: 0 0 9px; text-transform: uppercase; letter-spacing: .13em; font-size: 11px; font-weight: 800; color: var(--teal);
}
h1, h2, h3 { margin-top: 0; letter-spacing: -.035em; line-height: 1.08; }
h1 { font-size: clamp(44px, 6vw, 74px); margin-bottom: 22px; font-weight: 780; }
h1 span { color: var(--teal); }
h2 { font-size: clamp(28px, 3.2vw, 40px); margin-bottom: 14px; }
h3 { font-size: 19px; margin-bottom: 8px; }
.hero-subtitle { font-size: 18px; color: var(--muted); max-width: 650px; margin: 0; }
.hero-meta { margin-top: 32px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.clock-card { display: grid; grid-template-columns: auto auto; column-gap: 12px; align-items: baseline; }
.clock-card span { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.clock-card strong { font-size: 30px; color: var(--navy); }
.clock-card small { color: var(--muted); }
.hero-note { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.signal-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 5px rgba(8,122,120,.10); }
.hero-panel {
  background: var(--surface); padding: 26px; border-radius: var(--radius-lg); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.hero-panel > label { font-size: 13px; font-weight: 700; display: block; margin-bottom: 8px; }
.search-wrap { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 14px; padding: 0 13px; background: var(--surface-soft); }
.search-wrap:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(8,122,120,.12); }
.search-wrap span { color: var(--muted); font-size: 24px; transform: rotate(-15deg); }
.search-wrap input { width: 100%; border: 0; outline: 0; background: transparent; padding: 14px 10px; color: var(--ink); }
.quick-filters { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chip {
  border: 1px solid var(--line); background: white; padding: 8px 12px; border-radius: 999px; color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 650;
}
.filter-chip:hover, .filter-chip:focus-visible { border-color: var(--teal); color: var(--teal); }
.filter-chip.active { background: var(--navy); border-color: var(--navy); color: white; }
.microcopy { font-size: 12px; color: var(--muted); margin: 16px 0 0; }

.status-summary {
  max-width: 1180px; margin: 0 auto; padding: 0 24px 50px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.status-summary article { padding: 18px 20px; border: 1px solid var(--line); background: rgba(255,255,255,.72); border-radius: 14px; }
.status-summary strong { font-size: 26px; display: block; color: var(--navy); }
.status-summary span { color: var(--muted); font-size: 12px; }

.content-section { max-width: 1180px; margin: 0 auto; padding: 36px 24px 80px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-heading h2 { margin-bottom: 0; }
.sort-wrap { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.sort-wrap select { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: white; color: var(--ink); }
.venue-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.venue-card {
  position: relative; padding: 24px; background: white; border: 1px solid var(--line); border-radius: var(--radius-md);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.venue-card:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(7,42,64,.08); border-color: #c6d6dc; }
.venue-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.venue-kicker { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.venue-card h3 { margin: 0; max-width: 430px; }
.status-pill { flex: 0 0 auto; border-radius: 999px; padding: 6px 10px; font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.status-open { background: var(--teal-soft); color: #05645f; }
.status-close_soon, .status-open_soon { background: var(--amber-soft); color: var(--amber); }
.status-closed { background: var(--red-soft); color: var(--red); }
.status-unknown { background: #eef1f3; color: #59656c; }
.venue-location { margin: 10px 0 17px; color: var(--muted); font-size: 13px; }
.card-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.metric { min-height: 89px; padding: 14px; background: var(--surface-soft); border-radius: 12px; }
.metric-label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.metric strong { display: block; font-size: 15px; }
.metric small { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.crowd-dots { display: flex; gap: 4px; margin-top: 7px; }
.crowd-dot { width: 22px; height: 6px; border-radius: 999px; background: #dbe4e8; }
.crowd-dot.filled { background: var(--teal); }
.demo-badge { font-size: 9px; background: #e9eef8; color: #52627d; border-radius: 999px; padding: 2px 6px; margin-left: 4px; vertical-align: 1px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.source-link { color: var(--teal); font-size: 12px; font-weight: 700; text-decoration: none; }
.source-link:hover { text-decoration: underline; }
.card-actions { display: flex; gap: 8px; }

.primary-btn, .ghost-btn, .danger-btn, .icon-btn {
  border: 0; border-radius: 10px; cursor: pointer; font-weight: 750; transition: transform .1s ease, opacity .15s ease, box-shadow .15s ease;
}
.primary-btn { background: var(--navy); color: white; padding: 11px 15px; box-shadow: 0 6px 16px rgba(7,42,64,.12); }
.primary-btn:hover { transform: translateY(-1px); }
.primary-btn:focus-visible, .ghost-btn:focus-visible, .danger-btn:focus-visible, .icon-btn:focus-visible, .filter-chip:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(8,122,120,.25); outline-offset: 2px; }
.ghost-btn { background: white; color: var(--navy); border: 1px solid var(--line); padding: 10px 14px; }
.danger-btn { background: var(--red-soft); color: var(--red); padding: 10px 14px; }
.compact { padding: 9px 12px; font-size: 13px; }
.full { width: 100%; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; background: transparent; color: var(--muted); font-size: 24px; }
.icon-btn:hover { background: var(--surface-soft); color: var(--ink); }
.small-btn { font-size: 11px; padding: 7px 9px; }

.empty-state { padding: 40px; text-align: center; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); }
.empty-state strong { color: var(--ink); }
.hidden { display: none !important; }

.trust-section {
  background: var(--navy); color: white; padding: 68px max(24px, calc((100vw - 1132px)/2));
}
.trust-section .eyebrow { color: #8de0d5; }
.trust-section > div:first-child { max-width: 700px; }
.trust-section h2 { max-width: 680px; }
.trust-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 28px; }
.trust-grid article { display: flex; gap: 13px; padding: 18px; border: 1px solid rgba(255,255,255,.14); border-radius: 14px; background: rgba(255,255,255,.05); }
.trust-grid article > span { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(141,224,213,.15); color: #8de0d5; font-weight: 900; flex: 0 0 auto; }
.trust-grid p { margin: 4px 0 0; color: #c7d5dc; font-size: 13px; }
.text-link { display: inline-block; margin-top: 22px; color: #8de0d5; font-weight: 750; text-decoration: none; }

footer { max-width: 1180px; margin: 0 auto; padding: 30px 24px 48px; color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; gap: 20px; }
footer p { margin: 0; max-width: 580px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(5, 21, 31, .52); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; }
.modal { width: min(620px, 100%); max-height: min(780px, calc(100vh - 40px)); overflow: auto; background: white; border-radius: 20px; padding: 28px; box-shadow: 0 30px 80px rgba(0,0,0,.24); position: relative; }
.modal-close { position: absolute; top: 12px; right: 12px; }
.modal .muted { color: var(--muted); }
.modal form > label { display: block; font-weight: 700; font-size: 13px; margin: 16px 0 7px; }
.modal form > label span { font-weight: 500; color: var(--muted); }
.modal input[type="text"], .modal input[type="url"], .modal input[type="password"], .modal textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; resize: vertical; }
.rating-fieldset { border: 0; padding: 0; margin: 20px 0 0; }
.rating-fieldset legend { font-size: 13px; font-weight: 700; margin-bottom: 9px; }
.rating-options { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.rating-options label { cursor: pointer; }
.rating-options input { position: absolute; opacity: 0; pointer-events: none; }
.rating-options span { display: grid; place-items: center; min-height: 73px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.rating-options strong { font-size: 20px; }
.rating-options small { font-size: 9px; color: var(--muted); }
.rating-options input:checked + span { border-color: var(--teal); background: var(--teal-soft); box-shadow: 0 0 0 2px rgba(8,122,120,.12); }
.privacy-note { background: var(--blue-soft); padding: 10px 12px; border-radius: 9px; font-size: 11px; color: #52627d; }
.form-message { min-height: 20px; font-size: 12px; margin: 9px 0; color: var(--red); }
.settings-actions { margin-top: 18px; display: flex; justify-content: space-between; gap: 10px; }
.settings-modal hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0 18px; }
.quota-row { display: flex; justify-content: space-between; gap: 16px; }
.detail-list { display: grid; gap: 10px; margin: 18px 0; }
.detail-list div { padding: 12px; background: var(--surface-soft); border-radius: 10px; }
.detail-list span { display: block; color: var(--muted); font-size: 11px; }
.detail-list strong { display: block; margin-top: 3px; }

.chat-panel { position: fixed; z-index: 100; right: 0; top: 0; bottom: 0; width: min(450px, 100vw); background: white; box-shadow: -24px 0 60px rgba(7,42,64,.16); transform: translateX(105%); transition: transform .22s ease; display: flex; flex-direction: column; }
.chat-panel.open { transform: translateX(0); }
.chat-header { padding: 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; }
.chat-header h2 { font-size: 25px; margin-bottom: 0; }
.chat-mode-row { display: flex; gap: 18px; padding: 12px 20px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; background: #f8fbfc; }
.chat-bubble { max-width: 88%; margin-bottom: 12px; padding: 12px 14px; border-radius: 14px; font-size: 13px; white-space: pre-wrap; }
.chat-bubble p { margin: 0 0 8px; }
.chat-bubble p:last-child { margin-bottom: 0; }
.chat-bubble.assistant { background: white; border: 1px solid var(--line); border-bottom-left-radius: 4px; white-space: normal; }
.chat-bubble.user { margin-left: auto; background: var(--navy); color: white; border-bottom-right-radius: 4px; }
.chat-bubble.meta { max-width: 100%; background: transparent; color: var(--muted); padding: 0 2px; font-size: 10px; }
.chat-bubble.meta.chat-sources { margin-top: -4px; }
.chat-bubble.meta.chat-sources a { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }
.chat-bubble.meta.chat-sources a:hover { text-decoration-thickness: 2px; }
.chat-bubble ul, .chat-bubble ol { margin: 4px 0 8px 18px; padding: 0; }
.chat-bubble li { margin: 2px 0; }
.chat-bubble .chat-md-heading { font-weight: 700; margin: 10px 0 4px; }
.chat-bubble table { width: 100%; border-collapse: collapse; margin: 6px 0; font-size: 12px; }
.chat-bubble th, .chat-bubble td { border: 1px solid var(--line); padding: 4px 6px; text-align: left; vertical-align: top; }
.chat-bubble th { background: #f3f8fa; }
.chat-bubble code { background: #eef3f5; padding: 1px 4px; border-radius: 4px; font-size: 12px; }
.chat-bubble a { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }
.chat-compose { padding: 16px; border-top: 1px solid var(--line); }
.chat-compose textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; resize: none; }
.chat-compose-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; }
.chat-compose small { display: block; color: var(--muted); font-size: 10px; margin-top: 8px; }
.chat-scrim { position: fixed; z-index: 90; inset: 0; background: rgba(5,21,31,.35); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; z-index: 150; background: var(--navy); color: white; padding: 10px 15px; border-radius: 999px; font-size: 12px; transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.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; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 48px; gap: 28px; }
  .status-summary { grid-template-columns: repeat(2, 1fr); }
  .venue-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .header-inner { padding: 0 16px; min-height: 66px; }
  .brand small { display: none; }
  .brand strong { font-size: 13px; }
  .header-actions .ghost-btn { display: none; }
  .hero { padding: 38px 16px 28px; }
  h1 { font-size: 44px; }
  .hero-subtitle { font-size: 16px; }
  .status-summary { padding: 0 16px 34px; gap: 8px; }
  .status-summary article { padding: 13px; }
  .content-section { padding: 28px 16px 60px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .venue-card { padding: 18px; }
  .card-metrics { grid-template-columns: 1fr; }
  .card-foot { align-items: flex-start; flex-direction: column; }
  .trust-section { padding: 50px 16px; }
  .trust-grid { grid-template-columns: 1fr; }
  footer { flex-direction: column; padding: 24px 16px 38px; }
  .modal { padding: 24px 18px; border-radius: 16px; }
  .rating-options { gap: 4px; }
  .rating-options span { min-height: 66px; }
  .rating-options small { display: none; }
  .settings-actions { flex-direction: column-reverse; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

.source-state { display:flex; align-items:center; gap:6px; margin:-8px 0 14px; font-size:10px; font-weight:750; color:var(--muted); }
.source-state > span { width:7px; height:7px; border-radius:50%; background:#9aa7ad; flex:0 0 auto; }
.source-state.source-good > span { background:var(--teal); }
.source-state.source-warn > span { background:#c47a00; }
.source-state.source-bad > span { background:var(--red); }
.source-health-summary { margin:16px 0; }
.source-health-card { padding:13px 14px; border-radius:11px; background:var(--surface-soft); display:grid; gap:3px; }
.source-health-card span,.source-health-card small { color:var(--muted); font-size:11px; }
.source-catalog { display:grid; gap:9px; margin-top:14px; }
.source-item { border:1px solid var(--line); border-radius:12px; padding:13px; }
.source-item > div { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.source-item p { margin:7px 0; font-size:12px; color:var(--ink); }
.source-item small { display:block; color:var(--muted); font-size:10px; line-height:1.45; }
.source-item a { display:inline-block; margin-top:8px; font-size:11px; color:var(--teal); font-weight:750; text-decoration:none; }
.source-use { font-size:9px; border-radius:999px; padding:3px 7px; background:#eef1f3; color:#66757b; white-space:nowrap; }
.source-use.used { background:var(--teal-soft); color:#05645f; }
.sources-modal { width:min(760px,100%); }

/* v4 — status-first dashboard */
.dashboard-hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 42px 24px 22px;
}
.dashboard-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
}
.dashboard-heading > div:first-child { max-width: 720px; }
.dashboard-heading h1 {
  font-size: clamp(36px, 4.8vw, 60px);
  margin-bottom: 14px;
}
.live-meta {
  width: min(310px, 100%);
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.8);
  box-shadow: 0 8px 26px rgba(7,42,64,.06);
}
.live-meta .clock-card { margin-bottom: 10px; }
.live-meta .hero-note { align-items: flex-start; line-height: 1.35; }

.priority-shell {
  margin-top: 30px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #eef5f6;
}
.priority-heading-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}
.priority-heading-row h2 { font-size: 25px; margin: 0; }
.priority-grid {
  display: grid;
  grid-template-columns: 1.35fr .825fr .825fr;
  gap: 12px;
}
.priority-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: 0 8px 24px rgba(7,42,64,.055);
  display: flex;
  flex-direction: column;
}
.priority-card-main {
  background: var(--navy);
  color: white;
  border-color: var(--navy);
  box-shadow: 0 16px 36px rgba(7,42,64,.18);
}
.priority-card-head,
.priority-name-row,
.priority-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.priority-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.priority-card-main .priority-label { color: #a9c7d5; }
.priority-name-row { margin-top: 12px; align-items: flex-start; }
.priority-name-row h3 { margin: 0; font-size: 19px; }
.priority-card-main .priority-name-row h3 { font-size: 23px; }
.priority-emphasis {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.11);
  color: #c9e8e4;
  font-size: 9px;
  font-weight: 750;
}
.priority-status-block {
  margin-top: 18px;
  padding: 13px 14px;
  border-radius: 12px;
  background: var(--surface-soft);
}
.priority-card-main .priority-status-block { background: rgba(255,255,255,.09); }
.priority-status-block strong { display: block; font-size: 25px; line-height: 1.05; }
.priority-card-main .priority-status-block strong { font-size: 33px; }
.priority-status-block span { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.priority-card-main .priority-status-block span { color: #c7dbe4; }
.priority-transition {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.priority-card-main .priority-transition { color: #c7dbe4; }
.priority-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
}
.priority-facts span {
  min-width: 0;
  padding: 8px 9px;
  border-radius: 9px;
  background: #f5f8f9;
  color: var(--muted);
  font-size: 10px;
  overflow-wrap: anywhere;
}
.priority-facts b { display: block; margin-bottom: 2px; color: var(--ink); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.priority-card-main .priority-facts span { background: rgba(255,255,255,.07); color: #c7dbe4; }
.priority-card-main .priority-facts b { color: #fff; }
.priority-actions { margin-top: auto; padding-top: 14px; justify-content: flex-end; }
.priority-card-main .ghost-btn { background: rgba(255,255,255,.08); color: white; border-color: rgba(255,255,255,.22); }
.priority-card-main .primary-btn { background: white; color: var(--navy); box-shadow: none; }
.priority-unavailable { border-style: dashed; box-shadow: none; }
.priority-skeleton { min-height: 230px; overflow: hidden; }
.priority-skeleton > div {
  height: 20px;
  margin-bottom: 14px;
  border-radius: 8px;
  background: linear-gradient(90deg, #e5edef, #f7fafa, #e5edef);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}
.priority-card-main.priority-skeleton > div { background: rgba(255,255,255,.12); animation: none; }
.priority-skeleton > div:nth-child(2) { height: 62px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.finder-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 24px 26px;
}
.finder-panel {
  display: grid;
  grid-template-columns: .7fr 1.3fr;
  gap: 24px;
  align-items: center;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}
.finder-copy h2 { margin: 0; font-size: 25px; }
.finder-controls > label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 11px; font-weight: 750; }
.finder-section .status-summary { padding: 12px 0 0; }
.source-microcopy { margin: 10px 4px 0; color: var(--muted); font-size: 10px; }

.header-tool { display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.header-tool span { font-size: 12px; }
button:disabled { cursor: wait; opacity: .62; transform: none !important; }

@media (max-width: 900px) {
  .dashboard-heading { align-items: flex-start; }
  .live-meta { width: 260px; }
  .priority-grid { grid-template-columns: 1fr 1fr; }
  .priority-card-main { grid-column: 1 / -1; }
  .finder-panel { grid-template-columns: 1fr; gap: 12px; }
}

@media (max-width: 640px) {
  .site-header { position: sticky; }
  .header-inner {
    min-height: auto;
    padding: 9px 12px 10px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .brand { width: 100%; gap: 9px; }
  .brand-mark { width: 32px; height: 32px; border-radius: 9px; }
  .brand strong { font-size: 13px; }
  .brand small { display: block; font-size: 9px; }
  .header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
  }
  .header-actions .ghost-btn { display: inline-flex; }
  .header-tool { min-height: 38px; padding: 8px 6px; font-size: 10px; border-radius: 9px; }

  .dashboard-hero { padding: 24px 14px 12px; }
  .dashboard-heading { display: block; }
  .dashboard-heading h1 { font-size: 34px; margin-bottom: 10px; }
  .hero-subtitle { font-size: 14px; line-height: 1.45; }
  .live-meta {
    width: 100%;
    margin-top: 17px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .live-meta .clock-card { margin: 0; min-width: 108px; }
  .clock-card strong { font-size: 24px; }
  .clock-card small { font-size: 10px; }
  .live-meta .hero-note { font-size: 10px; max-width: 190px; }

  .priority-shell { margin-top: 16px; padding: 12px; border-radius: 16px; }
  .priority-heading-row { align-items: center; margin-bottom: 10px; }
  .priority-heading-row h2 { font-size: 18px; }
  .priority-heading-row .eyebrow { margin-bottom: 4px; }
  #refreshStatusBtn { padding: 7px 9px; font-size: 10px; }
  .priority-grid { grid-template-columns: 1fr; gap: 9px; }
  .priority-card-main { grid-column: auto; }
  .priority-card { padding: 14px; border-radius: 13px; }
  .priority-card-main .priority-name-row h3 { font-size: 19px; }
  .priority-name-row h3 { font-size: 16px; }
  .priority-status-block { margin-top: 12px; padding: 10px 11px; }
  .priority-card-main .priority-status-block strong { font-size: 28px; }
  .priority-status-block strong { font-size: 21px; }
  .priority-facts { margin-top: 9px; }
  .priority-actions { padding-top: 10px; }
  .priority-actions .small-btn { flex: 1 1 0; min-height: 36px; }

  .finder-section { padding: 8px 14px 20px; }
  .finder-panel { padding: 14px; border-radius: 14px; }
  .finder-copy h2 { font-size: 21px; }
  .search-wrap input { padding: 12px 8px; font-size: 14px; }
  .quick-filters { gap: 6px; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; scrollbar-width: none; }
  .quick-filters::-webkit-scrollbar { display: none; }
  .filter-chip { flex: 0 0 auto; padding: 7px 10px; font-size: 11px; }
  .finder-section .status-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; padding-top: 8px; }
  .finder-section .status-summary article { padding: 9px 6px; text-align: center; }
  .finder-section .status-summary strong { font-size: 20px; }
  .finder-section .status-summary span { font-size: 9px; line-height: 1.25; }
  .source-microcopy { display: none; }

  .content-section { padding: 20px 14px 52px; }
  .section-heading { margin-bottom: 14px; }
  .section-heading h2 { font-size: 26px; }
  .sort-wrap { width: 100%; justify-content: space-between; }
  .sort-wrap select { min-height: 40px; max-width: 72%; }
  .venue-grid { gap: 11px; }
  .venue-card { padding: 15px; border-radius: 13px; }
  .venue-top { gap: 8px; }
  .venue-card h3 { font-size: 17px; }
  .status-pill { padding: 5px 7px; font-size: 9px; }
  .venue-location { margin: 7px 0 12px; font-size: 11px; }
  .source-state { margin: -5px 0 10px; font-size: 9px; }
  .card-metrics { grid-template-columns: 1fr; gap: 7px; }
  .metric { min-height: auto; padding: 11px; }
  .card-foot { gap: 10px; }
  .card-actions { width: 100%; }
  .card-actions .small-btn { flex: 1 1 0; min-height: 38px; }

  .modal-backdrop { padding: 0; align-items: end; }
  .modal {
    width: 100%;
    max-height: 88dvh;
    border-radius: 20px 20px 0 0;
    padding: 24px 16px calc(18px + env(safe-area-inset-bottom));
  }
  .sources-modal { width: 100%; }
  .settings-actions { flex-direction: column; }
  .settings-actions > * { width: 100%; text-align: center; }
  .chat-panel { width: 100vw; }
  .chat-header { padding: 17px 16px; }
  .chat-header h2 { font-size: 21px; }
  .chat-mode-row { padding: 10px 14px; gap: 12px; flex-wrap: wrap; }
  .chat-messages { padding: 14px; }
  .chat-compose { padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); }
}

@media (max-width: 380px) {
  .header-tool { font-size: 9px; }
  .header-tool span { display: none; }
  .live-meta { align-items: flex-start; }
  .priority-emphasis { display: none; }
  .finder-section .status-summary span { font-size: 8px; }
}

/* v5 — recommendation-first layout, visible countdowns, robust toolbar */
.header-actions,
.header-tool {
  position: relative;
  z-index: 2;
  pointer-events: auto;
}
.header-tool { touch-action: manipulation; }

.dashboard-hero { padding-top: 24px; }
.priority-shell { margin-top: 0; }
.priority-heading-row { align-items: flex-start; }
.priority-heading-row > div:first-child { max-width: 780px; }
.priority-heading-row h1 {
  margin: 0;
  font-size: clamp(31px, 4vw, 48px);
  line-height: 1.04;
  letter-spacing: -.04em;
}
.priority-explainer {
  max-width: 760px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.dashboard-support {
  margin-top: 24px;
  align-items: center;
  padding: 0 2px;
}
.dashboard-support > div:first-child { max-width: 680px; }
.dashboard-support h2 {
  margin: 0 0 8px;
  font-size: clamp(25px, 3.3vw, 38px);
}
.dashboard-support .hero-subtitle { font-size: 15px; }

.priority-time-left,
.time-left {
  letter-spacing: -.025em;
}
.priority-time-left.time-good,
.time-left.time-good { color: var(--teal); }
.priority-card-main .priority-time-left.time-good { color: #ffffff; }
.priority-time-left.time-warn,
.time-left.time-warn { color: var(--amber); }
.priority-card-main .priority-time-left.time-warn { color: #ffd899; }
.time-left.time-neutral { color: var(--ink); }

.reason-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 11px;
}
.reason-chips span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf4f5;
  color: #48616c;
  font-size: 9px;
  font-weight: 750;
  line-height: 1.25;
}
.priority-reasons { margin: 10px 0 0; }
.priority-card-main .reason-chips span {
  background: rgba(255,255,255,.10);
  color: #dcecf2;
}
.metric-time { background: #eef7f6; }
.metric-time .metric-label { color: #4e6e72; }

/* Make modal layers decisively interactive on touch browsers. */
.modal-backdrop { pointer-events: auto; }
.modal { pointer-events: auto; }

@media (max-width: 900px) {
  .dashboard-support { align-items: flex-start; }
}

@media (max-width: 640px) {
  .dashboard-hero { padding: 12px 10px 10px; }
  .priority-shell {
    padding: 10px;
    border-radius: 15px;
  }
  .priority-heading-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 8px;
    margin-bottom: 9px;
  }
  .priority-heading-row h1 {
    font-size: 24px;
    line-height: 1.05;
  }
  .priority-explainer {
    grid-column: 1 / -1;
    font-size: 10px;
    line-height: 1.4;
    margin-top: 6px;
  }
  #refreshStatusBtn {
    min-height: 38px;
    align-self: start;
  }
  .priority-card { padding: 13px; }
  .priority-card-main { order: -1; }
  .priority-name-row { margin-top: 9px; }
  .priority-status-block { margin-top: 10px; }
  .priority-card-main .priority-status-block strong { font-size: 25px; }
  .priority-status-block strong { font-size: 19px; }
  .priority-status-block span { font-size: 10px; }
  .priority-transition { margin-top: 8px; font-size: 10px; }
  .reason-chips { gap: 5px; margin-bottom: 8px; }
  .reason-chips span { min-height: 22px; font-size: 8px; padding: 3px 7px; }

  .dashboard-support {
    margin-top: 14px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .dashboard-support h2 { font-size: 21px; }
  .dashboard-support .hero-subtitle { font-size: 12px; }
  .live-meta { margin-top: 0; }

  .header-actions { position: relative; z-index: 45; }
  .header-tool { pointer-events: auto !important; }

  .venue-card .reason-chips { margin-top: -2px; }
  .metric-time strong { font-size: 17px; }
}

@media (max-width: 380px) {
  .priority-heading-row h1 { font-size: 22px; }
  .priority-explainer { display: none; }
  .header-tool { min-width: 0; }
}

/* v6 — user pins + interaction hardening */
.modal-backdrop.hidden,
.chat-scrim.hidden {
  display: none !important;
  pointer-events: none !important;
}
.modal-backdrop {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overscroll-behavior: contain;
}
.site-header {
  -webkit-backdrop-filter: none;
}
button { touch-action: manipulation; }

.priority-group + .priority-group { margin-top: 18px; }
.priority-subheading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0 2px 9px;
}
.priority-subheading > span {
  color: var(--navy);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.priority-subheading small {
  max-width: 650px;
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}
.priority-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.priority-card-main { grid-column: auto !important; }
.priority-card-pinned:not(.priority-card-main) {
  border-color: #bad9d5;
  box-shadow: 0 10px 28px rgba(8,122,120,.08);
}
.priority-card-pinned:not(.priority-card-main) .priority-label { color: var(--teal); }
.priority-empty {
  grid-column: 1 / -1;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255,255,255,.6);
  font-size: 12px;
}
.pin-btn.is-pinned {
  background: var(--teal-soft);
  border-color: #abd7d1;
  color: #05645f;
}
.priority-card-main .pin-btn.is-pinned {
  background: rgba(255,255,255,.13);
  border-color: rgba(255,255,255,.28);
  color: white;
}
.card-actions,
.priority-actions {
  flex-wrap: wrap;
}
.card-actions .small-btn,
.priority-actions .small-btn {
  white-space: nowrap;
}

@media (max-width: 900px) {
  .priority-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .priority-card-main { grid-column: auto !important; }
}

@media (max-width: 640px) {
  .priority-subheading {
    display: block;
    margin-bottom: 7px;
  }
  .priority-subheading small {
    display: block;
    margin-top: 3px;
    text-align: left;
    line-height: 1.35;
  }
  .priority-grid { grid-template-columns: 1fr; }
  .priority-card-main { grid-column: auto !important; }
  .priority-actions,
  .card-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 6px;
  }
  .priority-actions .small-btn,
  .card-actions .small-btn {
    min-width: 0;
    width: 100%;
    padding-left: 6px;
    padding-right: 6px;
    font-size: 9px;
  }
  .card-foot {
    align-items: stretch;
    flex-direction: column;
  }
}

/* v7 — native dialogs + consistent interactive hover states */
.modal-dialog {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 20px;
  border: 0;
  background: transparent;
  color: inherit;
  overflow: hidden;
}
.modal-dialog[open] {
  display: grid;
  place-items: center;
}
.modal-dialog::backdrop {
  background: rgba(5, 21, 31, .52);
}
.modal-dialog .modal {
  width: min(620px, 100%);
  max-height: min(780px, calc(100dvh - 40px));
  overflow: auto;
  overscroll-behavior: contain;
}
.modal-dialog .sources-modal { width: min(760px, 100%); }
.modal-dialog.dialog-fallback-open {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  background: rgba(5, 21, 31, .52);
}

/* Every clickable control gets a visible hover response on pointer devices. */
@media (hover: hover) and (pointer: fine) {
  .primary-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(7,42,64,.20);
    filter: brightness(1.06);
  }
  .ghost-btn:not(:disabled):hover {
    transform: translateY(-1px);
    border-color: #a9c6cf;
    background: #f1f7f8;
    color: var(--teal);
    box-shadow: 0 7px 18px rgba(7,42,64,.08);
  }
  .danger-btn:not(:disabled):hover {
    transform: translateY(-1px);
    background: #ffe2e6;
    box-shadow: 0 7px 18px rgba(164,58,67,.10);
  }
  .icon-btn:not(:disabled):hover {
    transform: scale(1.06);
    background: #edf4f5;
    color: var(--navy);
  }
  .filter-chip:not(:disabled):hover {
    transform: translateY(-1px);
    border-color: var(--teal);
    background: var(--teal-soft);
    color: #05645f;
    box-shadow: 0 5px 14px rgba(8,122,120,.08);
  }
  .filter-chip.active:not(:disabled):hover {
    background: #0a3850;
    border-color: #0a3850;
    color: #fff;
  }
  .pin-btn.is-pinned:not(:disabled):hover {
    background: #d8f0ed;
    border-color: #7ec5bc;
    color: #045a56;
  }
  .priority-card-main .ghost-btn:not(:disabled):hover {
    background: rgba(255,255,255,.16);
    border-color: rgba(255,255,255,.40);
    color: #fff;
  }
  .priority-card-main .primary-btn:not(:disabled):hover {
    background: #f2fbfa;
    color: var(--navy);
  }
  .rating-options label:hover span {
    transform: translateY(-1px);
    border-color: #9fcac6;
    background: #eef8f7;
    box-shadow: 0 6px 14px rgba(8,122,120,.08);
  }
}

.primary-btn:active,
.ghost-btn:active,
.danger-btn:active,
.icon-btn:active,
.filter-chip:active {
  transform: translateY(0) scale(.98);
}

@media (max-width: 640px) {
  .modal-dialog {
    padding: 0;
    align-items: end;
    justify-items: stretch;
  }
  .modal-dialog .modal {
    width: 100%;
    max-height: 88dvh;
    border-radius: 20px 20px 0 0;
    padding: 24px 16px calc(18px + env(safe-area-inset-bottom));
  }
  .modal-dialog .sources-modal { width: 100%; }
}

/* Project-page links added for the hosted release. */
.footer-links-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-top: 4px;
}
