:root {
  color-scheme: light;
  --ink: #13201c;
  --muted: #52615c;
  --paper: #f7f8f4;
  --panel: #ffffff;
  --line: #d7ddd8;
  --brand: #b3263a;
  --brand-dark: #761525;
  --gold: #a86e16;
  --coral: #d24a3a;
  --sky: #1f6f95;
  --soft-green: #f8ecee;
  --soft-gold: #fff5de;
  --soft-red: #fff0eb;
  --soft-blue: #eaf4fb;
  --shadow: 0 18px 44px rgba(19, 32, 28, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); overflow-x: hidden; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p, li, label, span, strong, a, td, th { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(2rem, 5vw, 4.1rem); line-height: 0.98; letter-spacing: 0; max-width: 820px; }
h2 { margin: 0; font-size: clamp(1.55rem, 3vw, 2.15rem); line-height: 1.1; letter-spacing: 0; }
h3 { margin: 0 0 12px; font-size: 1.02rem; color: var(--brand-dark); }
p { line-height: 1.55; }
a { color: var(--brand-dark); font-weight: 800; }

.topbar {
  min-height: min(78vh, 760px);
  display: grid;
  align-content: end;
  gap: 26px;
  padding: clamp(20px, 2.2vw, 34px);
  color: #fff;
  background:
    linear-gradient(90deg, rgba(28, 4, 12, 0.94) 0%, rgba(86, 11, 28, 0.76) 42%, rgba(86, 11, 28, 0.3) 72%, rgba(28, 4, 12, 0.18) 100%),
    linear-gradient(180deg, rgba(28, 4, 12, 0.16), rgba(28, 4, 12, 0.54)),
    url("assets/vegas-help-finder-social.png") center / cover no-repeat;
}
.topbar .eyebrow { color: #ffe7a6; }
.lede { max-width: 760px; margin: 14px 0 0; font-size: 1.08rem; color: #f4fbf8; }
.top-actions { display: flex; gap: 10px; flex-wrap: wrap; max-width: 420px; }

.app-shell { max-width: 1180px; margin: 18px auto 0; padding: 0 14px 48px; position: relative; }
.notice, .verify-banner, .emergency-banner {
  border-radius: 8px;
  padding: 14px;
  border: 1px solid #ead6a7;
  background: var(--soft-gold);
  color: #634710;
  box-shadow: var(--shadow);
}
.emergency-banner {
  margin-bottom: 14px;
  border-color: #e9b5a8;
  background: var(--soft-red);
  color: #6e2b1d;
  font-weight: 850;
}
.tabbar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}
.tab-scroll-hint { display: none; }
.tab, .primary-button, .ghost-button {
  min-height: 48px;
  border-radius: 8px;
  font-weight: 900;
}
.tab {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  padding: 10px 8px;
}
.tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.primary-button { border: 0; background: var(--brand); color: #fff; padding: 12px 16px; }
.primary-button:hover { background: var(--brand-dark); }
.ghost-button { border: 1px solid #d7b8bd; background: #fff; color: var(--brand-dark); padding: 11px 14px; }
.ghost-button:hover { background: var(--soft-green); }
.full { width: 100%; margin-top: 10px; }

.section {
  display: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}
.section.active { display: block; }
.section-heading { margin-bottom: 16px; max-width: 780px; }
.section-heading p:not(.eyebrow) { margin: 8px 0 0; color: var(--muted); }
.eyebrow { margin: 0 0 8px; color: var(--brand); font-size: 0.76rem; font-weight: 950; text-transform: uppercase; letter-spacing: 0; }

.form-panel, .tool-panel, .content-list article, .plan-column, .resource-card, .metric-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.form-panel { padding: 14px; margin-bottom: 16px; }
.form-panel.compact { background: #fbfcfa; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
label { display: grid; gap: 7px; color: #31413b; font-size: 0.92rem; font-weight: 850; }
input, select, textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #c8d3cd;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px;
}
textarea { resize: vertical; min-height: 96px; }
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: 3px solid rgba(179, 38, 58, 0.24);
  outline-offset: 2px;
}
.button-row { display: grid; grid-template-columns: 1.2fr 1fr; gap: 10px; margin-top: 14px; }

.results-grid, .resource-grid, .plan-grid, .tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.metric-card { padding: 16px; min-height: 126px; }
.metric-card strong { display: block; font-size: 1.45rem; line-height: 1.1; color: var(--brand-dark); }
.metric-card span { display: block; margin-top: 7px; color: var(--muted); font-weight: 750; }
.metric-card.warning { background: var(--soft-gold); border-color: #ead6a7; }
.metric-card.alert { background: var(--soft-red); border-color: #e9b5a8; }
.metric-card.calm { background: var(--soft-green); border-color: #bdd7ca; }

.verify-banner { margin-bottom: 14px; box-shadow: none; font-weight: 850; }
.resource-note {
  margin: 0 0 14px;
  border: 1px solid #bbd7e8;
  border-radius: 8px;
  background: var(--soft-blue);
  color: #164e6d;
  padding: 12px;
  font-weight: 800;
  line-height: 1.45;
}
.resource-card { display: grid; gap: 10px; padding: 16px; align-content: start; align-items: start; }
.verified-pill, .provider-pill, .category-pill {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  justify-self: start;
  align-self: start;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.78rem;
  font-weight: 950;
}
.verified-pill { background: var(--soft-gold); color: #6b4d11; border: 1px solid #ead6a7; }
.provider-pill { background: var(--soft-green); color: var(--brand-dark); border: 1px solid #e0b8c0; }
.category-pill { background: var(--soft-blue); color: #164e6d; border: 1px solid #bbd7e8; }
.resource-card dl { display: grid; gap: 7px; margin: 0; }
.resource-card div { min-width: 0; }
.resource-card dt { font-size: 0.78rem; color: var(--muted); font-weight: 950; text-transform: uppercase; }
.resource-card dd { margin: 2px 0 0; color: #2d3d37; line-height: 1.45; }
.card-note { margin: 0; color: var(--muted); font-size: 0.9rem; font-weight: 750; }
.card-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.card-actions a { display: grid; place-items: center; min-height: 42px; border-radius: 8px; text-decoration: none; background: var(--brand); color: #fff; padding: 8px; text-align: center; }
.card-actions a.secondary { background: #fff; color: var(--brand-dark); border: 1px solid #d7b8bd; }
.prep-panel {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.prep-panel strong {
  color: var(--brand-dark);
  font-size: 0.9rem;
}
.prep-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.prep-actions button {
  min-height: 42px;
  border: 1px solid #e7c0c7;
  border-radius: 8px;
  background: #fff4f6;
  color: var(--brand-dark);
  font-weight: 900;
  padding: 8px;
}
.prep-actions button:hover { background: #ffe8ed; }

.plan-column { padding: 16px; background: #fbfcfa; }
.plan-column h3 { color: var(--ink); }
.checklist { display: grid; gap: 9px; padding: 0; margin: 0; list-style: none; }
.checklist li { display: grid; grid-template-columns: 24px 1fr; gap: 9px; align-items: start; line-height: 1.45; color: #33443e; }
.checklist input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand); }

.tool-panel { padding: 16px; }
.tool-panel.wide { margin-top: 14px; }
.panel-title-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.tracker { display: grid; gap: 10px; }
.tracker-row { display: grid; grid-template-columns: 1fr 150px 140px 1.4fr 42px; gap: 8px; align-items: start; }
.tracker-row button { min-height: 42px; border-radius: 8px; border: 1px solid #e0b7ad; background: var(--soft-red); color: #7d2e1d; font-weight: 950; }
.content-list { display: grid; gap: 12px; }
.content-list article { padding: 16px; }
.content-list p { color: var(--muted); margin: 0; }

.print-sheet { display: none; }
.print-item { border-top: 1px solid #ccd5cf; padding: 12px 0; }
.site-footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 14px 36px;
  color: var(--muted);
}
.site-footer p { margin: 0 0 8px; }

@media (min-width: 761px) and (max-width: 1023px) {
  .topbar {
    min-height: 62vh;
    padding: 22px;
    gap: 22px;
  }
  .app-shell {
    margin-top: 16px;
    padding-inline: 16px;
  }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tabbar { gap: 6px; }
  .tab { padding-inline: 6px; }
  .section { padding: 16px; }
}

@media (min-width: 1200px) {
  .topbar {
    min-height: clamp(520px, 60vh, 680px);
    gap: 18px;
    background-position: center 58%;
  }

  h1 { font-size: clamp(3.2rem, 3.7vw, 4rem); }
  .lede { max-width: 700px; }
  .app-shell { margin-top: 16px; }
}

@media (min-width: 1600px) {
  .topbar {
    min-height: clamp(500px, 54vh, 640px);
  }
}

@media (max-width: 760px) {
  .topbar {
    min-height: auto;
    align-content: start;
    gap: 18px;
    padding: 20px 16px 24px;
  }
  h1 { font-size: clamp(2rem, 12vw, 3rem); line-height: 1.02; }
  h2 { font-size: clamp(1.45rem, 8vw, 1.85rem); }
  .lede { font-size: 1rem; }
  .top-actions { max-width: none; }
  .top-actions .primary-button { width: 100%; }
  .app-shell { margin-top: 12px; padding: 0 10px 36px; }
  .notice, .verify-banner, .emergency-banner { padding: 12px; }
  .tabbar {
    display: flex;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    gap: 8px;
    padding: 0 28px 6px 0;
    margin-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }
  .tabbar::after {
    content: "";
    position: sticky;
    right: -28px;
    flex: 0 0 28px;
    width: 28px;
    margin-left: -28px;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(247, 248, 244, 0), var(--paper));
  }
  .tab-scroll-hint {
    display: block;
    margin: -2px 0 12px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
  }
  .tab {
    flex: 0 0 auto;
    min-width: 124px;
    min-height: 44px;
    scroll-snap-align: start;
  }
  .form-grid, .results-grid, .resource-grid, .plan-grid, .tool-grid, .button-row { grid-template-columns: 1fr; }
  .card-actions { grid-template-columns: 1fr; }
  .prep-actions { grid-template-columns: 1fr; }
  .tracker-row { grid-template-columns: 1fr; }
  .section { padding: 14px; }
  .form-panel, .tool-panel, .content-list article, .plan-column, .resource-card, .metric-card { min-width: 0; }
  input, select, textarea { min-height: 44px; }
  .primary-button, .ghost-button { min-height: 44px; }
  .site-footer { padding-inline: 10px; }
}

@media print {
  body { background: #fff; }
  .topbar, .notice, .tabbar, .section { display: none !important; }
  .app-shell { margin: 0; max-width: none; padding: 0; }
  .print-sheet { display: block; padding: 24px; }
}
