/* Nationwide concept. Loaded after site.css. */

/* Shared glass barcode. The SVG is translucent, so the homepage must not paint a solid card behind it. */
body.home .site-logo {
  background: transparent;
  padding: 0;
  box-shadow: none;
}
.site-logo img {
  filter: drop-shadow(0 1px 1px rgba(42, 20, 12, 0.45)) drop-shadow(0 3px 5px rgba(7, 32, 51, 0.28));
}

.state-panel {
  width: min(1040px, 100%);
  background: rgba(255, 253, 249, 0.96);
  color: var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 253, 249, 0.7);
  padding: 22px 22px 18px;
}

.state-panel h2 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  color: var(--bay-ink);
}

.state-legend {
  margin: 0 0 14px;
  max-width: 68ch;
}

.change-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin-left: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: #ffd100;
  color: #072033;
  font-weight: 800;
  font-size: 14px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.change-state:hover,
.change-state:focus-visible {
  background: #ffe56a;
  color: #072033;
}

body.map-page .change-state {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

@media (max-width: 859px) {
  .site-header { flex-wrap: nowrap; min-width: 0; }
  .site-header > .site-logo,
  body.home .site-header > .site-logo {
    order: 1;
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    max-width: calc(100% - 196px);
    margin-left: 0;
  }
  .site-header > .change-state {
    order: 2;
    flex: 0 0 auto;
    margin-left: 8px;
  }
  .site-header > .nav-toggle {
    order: 3;
    flex: 0 0 auto;
    margin-left: 8px;
  }
  .site-header > .site-logo img,
  body.home .site-header > .site-logo img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 48px;
  }
}

.state-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin: 0 0 12px;
}

.state-filter-label {
  font-weight: 700;
  color: var(--bay-ink);
}

.state-filter {
  width: min(320px, 100%);
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.state-status,
.state-empty {
  margin: 0 0 12px;
  min-height: 1.4em;
  font-weight: 700;
  color: var(--brown-800);
}

.state-resume {
  margin: 12px 0 0;
  font-weight: 700;
}

.state-resume a {
  color: var(--bay);
}

.state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
}

.state-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
  width: 100%;
  min-height: 96px;
  margin: 0;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #D8C3A5;
  color: var(--ink);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

button.state-tile {
  appearance: none;
}

.state-tile:hover,
.state-tile:focus,
.state-tile:focus-visible,
.state-tile:active {
  background: #C4AE8C;
}

.state-tile.is-open {
  border-color: var(--deal);
  background: var(--deal-soft);
}

.state-tile.is-test {
  border-color: var(--tan-400);
  background: #fff8ee;
}

.state-tile.is-soon {
  background: var(--tan-100);
  color: var(--ink-soft);
}

.state-tile.is-last {
  box-shadow: 0 0 0 3px var(--bay-ink);
}

.state-code {
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--bay-ink);
}

.state-name {
  font-weight: 700;
  line-height: 1.25;
}

.state-status-label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.state-tile.is-open .state-status-label { color: var(--deal); }
.state-tile.is-test .state-status-label { color: var(--brown-700); }

.hero-copy .notice,
.hero-copy .draft-banner {
  text-align: left;
  margin-top: 14px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brown-700);
}

.draft-flag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.draft-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--danger-soft);
  color: var(--ink);
  font-weight: 700;
}

.co-map {
  height: 420px;
  width: 100%;
  margin: 0 0 16px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--foam);
}

.soon-block {
  margin: 16px 0;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--tan-100);
  border: 1px solid var(--tan-300);
}

.soon-block h2 {
  margin: 0 0 6px;
  border: 0;
  padding: 0;
  font-size: 1.35rem;
}

.portal .portal-mark {
  display: block;
  width: auto;
  max-width: none;
  height: 72px;
  max-height: 72px;
  filter: none;
}

/* Homepage cards shrink to their text and icons. The photo stays visible around them. */
/* Start under the header. Centering in the leftover viewport left a band of
   photo above the title, so a state page looked scrolled down on open. */
body.home .hero {
  width: auto;
  max-width: calc(100% - 12px);
  margin-inline: auto;
  padding: 6px 0 10px;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
}
body.home .hero-copy {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.85);
  border: 0;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(7, 32, 51, 0.16);
  text-align: center;
}
body.home .hero-copy h1 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.2;
}
body.home .hero-copy p {
  width: fit-content;
  max-width: 100%;
  margin: 0;
}
body.home .hero-copy .intro {
  font-size: 0.9rem;
  line-height: 1.3;
  text-align: center;
}
body.home .eyebrow,
body.home .hero-cta,
body.home .updated { display: none; }
body.home .portals {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: flex-start;
  width: fit-content;
  max-width: 100%;
  gap: 8px;
}
body.home .portal {
  display: inline-flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: fit-content;
  min-width: 0;
  min-height: 0;
  gap: 4px;
  padding: 8px 10px;
  background: #D8C3A5;
  border: 0;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(7, 32, 51, 0.16);
}
body.home .portal:hover,
body.home .portal:focus,
body.home .portal:focus-visible,
body.home .portal:active {
  background: #C4AE8C;
}
body.home .portal img,
body.home .portal .portal-mark {
  display: block;
  width: auto;
  height: 72px;
  max-width: none;
  max-height: 72px;
  filter: none;
}
body.home .portal .cap {
  display: block;
  width: max-content;
  max-width: none;
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.15;
  text-align: center;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
body.nation-home .hero { justify-content: flex-start; }
body.nation-home .state-panel {
  width: fit-content;
  max-width: calc(100% - 4px);
  margin-inline: auto;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
body.nation-home .state-panel h2 {
  width: fit-content;
  margin: 0 auto 8px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 8px rgba(7, 32, 51, 0.16);
  font-size: 1.05rem;
}
body.nation-home .state-tools {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 8px rgba(7, 32, 51, 0.16);
}
body.nation-home .state-filter {
  width: min(200px, 68vw);
  min-height: 0;
  padding: 6px 10px;
}
body.nation-home .state-status:empty { display: none; }
body.nation-home .state-grid {
  width: fit-content;
  max-width: 100%;
  justify-content: center;
  grid-template-columns: repeat(6, max-content);
  gap: 8px;
}
body.nation-home .state-tile,
body.nation-home .state-tile.is-open,
body.nation-home .state-tile.is-test,
body.nation-home .state-tile.is-soon {
  width: fit-content;
  min-height: 0;
  gap: 0;
  padding: 6px 8px;
  border: 0;
  border-radius: 10px;
  background: #D8C3A5;
  box-shadow: 0 2px 6px rgba(7, 32, 51, 0.14);
}
body.nation-home .state-tile:is(:hover, :focus, :focus-visible, :active),
body.nation-home .state-tile.is-open:is(:hover, :focus, :focus-visible, :active),
body.nation-home .state-tile.is-test:is(:hover, :focus, :focus-visible, :active),
body.nation-home .state-tile.is-soon:is(:hover, :focus, :focus-visible, :active) {
  background: #C4AE8C;
}
body.nation-home .state-status-label { display: none; }
body.nation-home .state-code { font-size: 0.72rem; }
body.nation-home .state-name { max-width: 9rem; font-size: 0.8rem; line-height: 1.15; }
body.nation-home .state-group-title {
  justify-self: start;
  width: fit-content;
  margin: 4px 0 0;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
}

@media (max-width: 900px) {
  body.nation-home .state-grid { grid-template-columns: repeat(4, max-content); }
}
@media (max-width: 760px) {
  body.home .hero { padding-top: 4px; gap: 8px; }
  body.home .hero-copy { padding: 8px 10px; }
  body.home .hero-copy h1 { font-size: 1.05rem; }
  body.home .hero-copy .intro { font-size: 0.82rem; text-align: center; }
  body.home .portals { gap: 6px; }
  body.home .portal { padding: 8px; }
  body.home .portal img,
  body.home .portal .portal-mark { height: 56px; max-height: 56px; }
  body.home .portal .cap { font-size: 0.68rem; }
}
@media (max-width: 560px) {
  body.nation-home .state-panel,
  body.nation-home .state-grid {
    width: 100%;
    max-width: 100%;
  }
  body.nation-home .state-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.nation-home .state-tile { width: 100%; }
  body.nation-home .state-name { max-width: 100%; }
}

.state-group-title {
  grid-column: 1 / -1;
  margin: 12px 0 0;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--bay-ink);
}

html:has(body[data-state="co"]:not(.map-page))::before {
  background-color: #002868;
  background-image: url("../img/backgrounds/co.svg");
  background-position: center bottom;
  background-size: cover;
}

html:has(body.map-page.state-template) {
  height: 100%;
}

.state-map-panel {
  position: fixed;
  z-index: 4000;
  top: calc(var(--chrome) + 8px);
  left: 10px;
  display: flex;
  flex-direction: column;
  width: min(340px, calc(100vw - 20px));
  max-height: calc(100dvh - var(--chrome) - 20px);
  overflow: hidden;
  background: #fff;
  color: #1c1917;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  font-size: 14px;
  line-height: 1.35;
}

.state-map-panel.is-min .smp-body { display: none; }

.smp-head,
.smp-body { padding: 10px 12px; }

.smp-head {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #002868;
  color: #fff;
  font-weight: 700;
}

.smp-head button,
.smp-actions button,
.smp-route button,
.smp-locate {
  font: inherit;
  cursor: pointer;
}

.smp-head button {
  margin-left: auto;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  min-height: 32px;
  padding: 0 10px;
}

.smp-deals {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff4cc;
  color: #3f2e04;
  font-weight: 800;
}

body.map-page .leaflet-popup-content {
  font-size: 13px;
}

.bd-offer {
  display: block;
  margin-top: 4px;
  color: #444;
  font-weight: 500;
}

.bd-yes {
  color: #1a9641;
  font-weight: 800;
}

.bd-checked {
  color: #777;
  font-size: 10px;
  font-weight: 500;
}

.smp-count,
.smp-source,
.smp-route-status,
.smp-route-result,
.smp-cost-out { margin: 0 0 8px; }

.smp-body label {
  display: block;
  margin: 0 0 8px;
  font-weight: 700;
}

.smp-body input,
.smp-body select {
  display: block;
  width: 100%;
  min-height: 36px;
  margin-top: 4px;
  padding: 6px 8px;
  border: 1px solid #d6d3d1;
  border-radius: 8px;
  font: inherit;
}

.smp-list-wrap {
  overflow: auto;
  max-height: 28vh;
  margin: 0 0 8px;
  border: 1px solid #e7e5e4;
  border-radius: 8px;
}

.smp-list-wrap ul { list-style: none; margin: 0; padding: 0; }

.smp-list-wrap li {
  padding: 8px;
  border-bottom: 1px solid #f5f5f4;
}

.smp-list-wrap li.is-start { background: #fff8db; }
.smp-list-wrap li.is-stop { background: #fff1f2; }

.smp-zoom {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: #002868;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.smp-addr { display: block; color: #44403c; font-size: 13px; line-height: 1.35; }
.smp-addr .store-phone,
.smp-addr .store-web { font-size: 12px; }

.smp-actions { display: flex; gap: 6px; margin-top: 6px; }

.smp-actions button,
.smp-route button {
  border: 1px solid #002868;
  border-radius: 6px;
  background: #fff;
  color: #002868;
  min-height: 32px;
  padding: 0 8px;
}

.smp-route button:disabled { opacity: 0.45; cursor: not-allowed; }

.smp-source { color: #57534e; font-size: 12px; }

@media (max-width: 700px) {
  .state-panel { padding: 16px 14px; }
  .co-map { height: 280px; }
  .state-map-panel { max-height: 48dvh; }
  .smp-list-wrap { max-height: 16vh; }
}

/* Alaska map chrome for every state-template map.
   Scoped so nationwide/ak/map keeps the inline copy of the live map. */
body.state-template #sw-title {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  max-width: calc(100vw - 330px);
  text-align: center;
}
body.state-template #sw-title h1 { margin: 0; }
body.state-template #sw-title .sw-reg {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
}
body.state-template #sw-title select { cursor: pointer; touch-action: manipulation; }
body.state-template #sw-title .sw-access {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
body.state-template #sw-title .sw-access button {
  border: 1px solid #cbd5e0;
  background: #fff;
  color: #1a202c;
  border-radius: 999px;
  padding: 2px 8px;
  font: 12px Arial, Helvetica, sans-serif;
  cursor: pointer;
  touch-action: manipulation;
}
body.state-template #sw-title .sw-access button[aria-pressed="true"] {
  background: #072033;
  color: #fff;
  border-color: #072033;
}
@media (max-width: 719px) {
  body.state-template #sw-title {
    left: 52px;
    right: 54px;
    transform: none;
    max-width: none;
  }
}
body.state-template #sw-legend {
  position: fixed;
  left: 10px;
  z-index: 9999;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
body.state-template #sw-legend.dragging,
body.state-template #sw-legend.dragging #sw-legend-handle { cursor: grabbing; }
body.state-template #sw-legend-handle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin: 0 0 4px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: grab;
  touch-action: none;
}
body.state-template #sw-legend a { display: inline-block; margin-top: 2px; }
body.state-template .sw-dot-key {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 4px;
  border-radius: 50%;
  vertical-align: middle;
}
body.state-template .sw-dot-deal { background: #1a9641; }
body.state-template .sw-dot-none { background: #2b6cb0; }
body.state-template .sw-dot-med { background: #6b3fa0; }
body.state-template #sw-access-key { margin: 4px 0; font-size: 12px; line-height: 1.35; }
body.state-template .bd-med { color: #6b3fa0; font-size: 11px; }
body.state-template #bd-deals-panel {
  position: fixed;
  left: 54px;
  z-index: 31000;
  background: #fff;
  cursor: grab;
  touch-action: manipulation;
  user-select: none;
}
body.state-template #bd-deals-panel.hidden { display: none !important; }
body.state-template #bd-deals-panel.dragging,
body.state-template #bd-deals-panel.dragging .bd-head { cursor: grabbing; }
body.state-template #bd-deals-panel .bd-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  color: #fff;
  cursor: grab;
  font-weight: 700;
  font-size: 13px;
}
body.state-template #bd-deals-panel .bd-grip { opacity: 0.9; letter-spacing: -1px; font-size: 14px; line-height: 1; }
body.state-template #bd-deals-panel .bd-btns { margin-left: auto; display: flex; gap: 4px; }
body.state-template #bd-deals-panel .bd-btns button {
  background: rgba(255, 255, 255, 0.2);
  border: 0;
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  cursor: pointer;
  font: bold 14px/22px Arial, Helvetica, sans-serif;
  padding: 0;
}
body.state-template #bd-deals-panel .bd-body {
  display: flex;
  flex-direction: column;
  padding: 8px 10px 10px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
body.state-template #bd-deals-panel.minimized .bd-body { display: none; }
body.state-template #bd-deals-panel.minimized,
body.state-template #bd-deals-panel.minimized .bd-head { border-radius: 8px; }
body.state-template #bd-deals-panel ul { list-style: none; margin: 0; padding: 0; }
body.state-template #bd-deals-panel li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid #eee;
}
body.state-template #bd-deals-panel .bd-cbcol {
  flex: 0 0 30px;
  width: 30px;
  display: flex;
  justify-content: center;
}
body.state-template #bd-deals-panel li input.bd-check,
body.state-template #bd-deals-panel li input.bd-start {
  flex: 0 0 auto;
  margin: 3px 0 0;
  width: 15px;
  height: 15px;
  cursor: pointer;
}
body.state-template #bd-deals-panel li input.bd-check { accent-color: #1a9641; }
body.state-template #bd-deals-panel li input.bd-start { accent-color: #1d4ed8; }
body.state-template #bd-deals-panel .bd-colhead {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 0 0 3px;
  background: #fff;
  border-bottom: 1px solid #ddd;
  font-size: 10px;
  font-weight: 700;
  color: #666;
  text-transform: uppercase;
}
body.state-template #bd-deals-panel .bd-colhead .bd-colstart { color: #1d4ed8; }
body.state-template #bd-deals-panel .bd-colhead .bd-colvisit { color: #1a9641; }
body.state-template #bd-deals-panel .bd-colhead .bd-colrest {
  flex: 1 1 auto;
  font-weight: 400;
  text-transform: none;
  color: #999;
}
body.state-template #bd-deals-panel li.bd-is-start {
  background: #eef3fe;
  box-shadow: inset 3px 0 0 #1d4ed8;
}
body.state-template #bd-deals-panel .bd-start-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 8px;
  background: #1d4ed8;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  vertical-align: 1px;
}
body.state-template #bd-deals-panel li .bd-row { flex: 1 1 auto; min-width: 0; }
body.state-template #bd-deals-panel .bd-name { font-weight: 700; cursor: pointer; }
body.state-template #bd-deals-panel .bd-name:hover { text-decoration: underline; }
body.state-template #bd-deals-panel .bd-addr { color: #666; font-size: 11px; margin-top: 1px; }
body.state-template #bd-deals-panel .bd-offer { color: #444; margin-top: 2px; }
body.state-template #bd-deals-panel .bd-phone,
body.state-template #bd-deals-panel .bd-fb { font-size: 11px; margin-top: 2px; }
body.state-template #bd-deals-panel .bd-phone a,
body.state-template #bd-deals-panel .bd-fb a { font-weight: 700; color: #0b5ea8; text-decoration: none; }
body.state-template #bd-deals-panel .bd-filter { padding: 0 0 6px; font-size: 11px; color: #333; }
body.state-template #bd-deals-panel .bd-filter input { vertical-align: -2px; accent-color: #1a9641; }
body.state-template #bd-deals-panel li.bd-grp {
  display: block;
  padding: 6px 0 3px;
  border-bottom: 1px solid #cfe3d5;
  font-weight: 700;
  color: #0f5a2a;
  font-size: 12px;
  background: #fff;
}
body.state-template #bd-deals-panel li.bd-grp span { font-weight: 400; color: #777; font-size: 10px; }
body.state-template #bd-deals-panel li.bd-grp-region {
  font-size: 13px;
  color: #fff;
  background: #1a9641;
  padding: 4px 6px;
  margin-top: 6px;
  border-radius: 4px;
  border: 0;
}
body.state-template #bd-deals-panel li.bd-grp-region span { color: #e6f5ea; }
body.state-template #bd-deals-panel.sw-one li.bd-grp-region,
body.state-template #bd-deals-panel li.sw-hide { display: none !important; }
body.state-template #bd-deals-panel .bd-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e5e5e5;
}
body.state-template #bd-deals-panel .bd-route-btn,
body.state-template #bd-deals-panel .bd-map-start-btn,
body.state-template #bd-deals-panel .bd-clear-route,
body.state-template #bd-deals-panel .bd-cancel-geo {
  border-radius: 5px;
  padding: 7px 10px;
  font: 700 12px Arial, Helvetica, sans-serif;
  cursor: pointer;
}
body.state-template #bd-deals-panel .bd-route-btn { background: #1a9641; color: #fff; border: 0; }
body.state-template #bd-deals-panel .bd-route-btn:disabled { background: #9bbfa6; cursor: not-allowed; }
body.state-template #bd-deals-panel .bd-map-start-btn { background: #0b5ea8; color: #fff; border: 0; }
body.state-template #bd-deals-panel .bd-map-start-btn:disabled { background: #9db6cc; cursor: not-allowed; }
body.state-template #bd-deals-panel .bd-clear-route {
  background: #f0f0f0;
  color: #333;
  border: 1px solid #ccc;
  font-weight: 400;
}
body.state-template #bd-deals-panel .bd-cancel-geo {
  background: #fff3e0;
  color: #8a4b00;
  border: 1px solid #e0a85c;
  font-weight: 400;
}
body.state-template #bd-deals-panel .bd-status {
  width: 100%;
  font-size: 11px;
  color: #555;
  margin-top: 6px;
  min-height: 32px;
  line-height: 1.3;
}
body.state-template #bd-deals-panel .bd-status.err { color: #b00020; }
body.state-template #bd-deals-panel .bd-status.ok { color: #145a2a; }
body.state-template #bd-deals-panel .bd-route-sum {
  display: none;
  flex: 0 0 auto;
  max-height: 45vh;
  overflow: auto;
  margin-top: 8px;
  padding: 8px;
  background: #f6faf7;
  border: 1px solid #d7ebdd;
  border-radius: 6px;
  font-size: 11px;
  user-select: text;
}
body.state-template #bd-deals-panel .bd-route-sum.show { display: block; }
body.state-template #bd-deals-panel .bd-route-sum ol { margin: 4px 0 0 18px; padding: 0; }
body.state-template #bd-deals-panel .bd-route-sum .bd-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 6px;
}
body.state-template #bd-deals-panel .bd-link-row { display: inline-flex; align-items: center; gap: 4px; }
body.state-template #bd-deals-panel .bd-ext-link {
  display: inline-block;
  padding: 4px 8px;
  border: 1px solid #9cc3e6;
  border-radius: 4px;
  background: #fff;
  color: #0b5ea8;
  font-weight: 700;
  text-decoration: none;
}
body.state-template #bd-deals-panel .bd-newtab-link { font-size: 10px; color: #0b5ea8; }
body.state-template #bd-deals-panel .bd-copy-btn {
  padding: 4px 7px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #f6f6f6;
  color: #333;
  font: 11px Arial, Helvetica, sans-serif;
  cursor: pointer;
  min-width: 52px;
}
body.state-template #bd-deals-panel .bd-copy-btn.ok { background: #e3f4e8; border-color: #7cc292; color: #145a2a; }
body.state-template #bd-deals-panel .bd-url-box {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  font: 11px monospace;
  padding: 4px;
}
body.state-template #bd-deals-panel .bd-links-note { color: #888; font-size: 10px; margin-top: 4px; }
body.state-template #bd-reopen-btn {
  display: none;
  position: fixed;
  left: 54px;
  z-index: 10000;
  color: #fff;
  border: 0;
  padding: 10px 14px;
  font: bold 13px Arial, Helvetica, sans-serif;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  cursor: pointer;
}
body.state-template #bd-reopen-btn.show { display: block; }
body.state-template #bd-pick-banner {
  display: none;
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10001;
  color: #fff;
  padding: 10px 16px;
  font: bold 14px/1.3 Arial, Helvetica, sans-serif;
  text-align: center;
  max-width: min(420px, calc(100vw - 24px));
  pointer-events: none;
}
body.state-template.bd-pick-start #bd-pick-banner { display: block; }
body.state-template.bd-pick-start,
body.state-template.bd-pick-start .leaflet-container { cursor: crosshair !important; }
body.state-template .leaflet-div-icon.sw-dot,
body.state-template .leaflet-div-icon.bd-stop-icon {
  background: transparent;
  border: 0;
}

/* Footer is one row on desktop: links, credit, and social on the left,
   the feedback note level with them on the right. Phones stack. */
.site-footer,
body.map-page .site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(352px, 416px);
  column-gap: 28px;
  row-gap: 2px;
  align-items: start;
  padding: 10px 20px 12px;
}
.site-footer > .footer-app {
  grid-column: 1 / -1;
  margin: 0 0 2px;
}
.site-footer > .footer-nav,
.site-footer > .credits,
.site-footer > .footer-social,
.site-footer > .site-feedback {
  min-width: 0;
}
.site-footer > .footer-nav {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
}
.site-footer > .credits {
  grid-column: 1;
  grid-row: 2;
  max-width: none;
}
.site-footer > .footer-social,
body.map-page .site-footer > .footer-social {
  grid-column: 1;
  grid-row: 3;
  margin: 2px 0 0;
}
.site-footer > .site-feedback,
body.map-page .site-footer > .site-feedback {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
  margin: 0;
  max-width: none;
}

@media (max-width: 860px) {
  .site-footer,
  body.map-page .site-footer {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 0;
    padding: 8px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  }
  .site-footer > .footer-app { order: 0; grid-column: 1; grid-row: auto; }
  .site-footer > .footer-nav { order: 1; grid-column: 1; grid-row: auto; gap: 0 12px; }
  .site-footer > .credits { order: 2; grid-column: 1; grid-row: auto; font-size: 0.75rem; line-height: 1.35; }
  .site-footer > .footer-social,
  body.map-page .site-footer > .footer-social { order: 3; grid-column: 1; grid-row: auto; margin: 4px 0 0; }
.site-footer > .site-feedback,
body.map-page .site-footer > .site-feedback {
  order: 4;
  grid-column: 1;
  grid-row: auto;
  align-self: start;
  margin-top: 6px;
  font-size: 0.82rem;
  line-height: 1.35;
}
.site-footer .copy-email-wrap,
body.map-page .site-footer .copy-email-wrap { white-space: normal; }
}

/* White cards hug their content. Long text stops at a reading width.
   Tables follow their columns. Phones stay full width with a small inset. */
@media (min-width: 801px) {
  body.guide main,
  body.tutorial main {
    width: fit-content;
    max-width: min(720px, calc(100% - 24px));
    margin-inline: auto;
  }
  body.guide .card p,
  body.guide .card ul,
  body.guide .card ol,
  body.guide .card .lead,
  body.guide nav.toc,
  body.guide .notice,
  body.guide .region {
    max-width: none;
  }
  body.tutorial .step-body { grid-template-columns: 1fr; }
  body.tutorial .shot { position: static; }

  /* Deal sheets grow with the table. Laws and history stay at reading width. */
  body.guide main:has(table):not(:has(.region)):not(:has(ol.tl)) {
    max-width: min(960px, calc(100% - 24px));
  }
  body.guide .card table {
    width: max-content;
    max-width: 100%;
  }
  body.guide .card th,
  body.guide .card td {
    max-width: 34ch;
  }

  /* Merch tiles keep a product size. The sheet wraps that grid. */
  body.guide:has(.merch-grid) main {
    max-width: min(792px, calc(100% - 24px));
  }
  body.guide .merch-grid {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-inline: auto;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr));
  }
}

/* The page canvas is bay, not the browser's white. A sideways overflow
   (the Change state button, a 100vw box plus a Windows scrollbar) cannot
   open a light bar along the bottom. */
html {
  background-color: #072033;
  overflow-x: clip;
}
/* The state list is taller than a short desktop window. A state homepage
   usually is not, so Windows drops the scrollbar on the click and the nav
   and centered cards shift by the gutter width. Keep the gutter reserved.
   Phones use overlay scrollbars; reserving a gutter there only adds a gap. */
@media (min-width: 860px) {
  html { scrollbar-gutter: stable; }
}
.site-footer,
body.map-page .site-footer {
  background: #072033;
}
.copy-email {
  appearance: none;
  -webkit-appearance: none;
}

/* White map panels stop above the footer. The page <style> sets a taller
   max-height; this wins so the panel cannot sit on the blue bar. */
body.map-page #bd-deals-panel {
  max-height: calc(100dvh - var(--chrome, 76px) - var(--map-footer, 128px) - 104px) !important;
}
@media (max-width: 719px) {
  body.map-page.map-has-stores #bd-deals-panel {
    height: calc(100dvh - var(--chrome, 76px) - var(--map-footer, 128px) - 104px) !important;
  }
  body.map-page.map-has-stores #bd-deals-panel.minimized {
    height: auto !important;
  }
}
body.map-page #gas-cost-panel:not(.minimized) {
  max-height: calc(100dvh - var(--chrome, 76px) - var(--map-footer, 128px) - 24px);
}

#ag-gate .ag-card {
  width: fit-content;
  max-width: min(340px, calc(100vw - 32px));
}
@media (max-width: 800px) {
  #ag-gate .ag-card {
    width: 100%;
    max-width: none;
  }
}

/* Nationwide homepage. Solid bay, no photo fade. */
html:has(body.nation-home) { background-color: #072033; }
html:has(body.nation-home)::before { background-image: none; opacity: 1; }
body.nation-home .site-header {
  background: #072033;
  border-bottom: 0;
}
body.nation-home .hero {
  width: min(1080px, calc(100% - 16px));
  max-width: none;
  margin: 0 auto;
  padding: 8px 0 28px;
  gap: 16px;
  align-items: stretch;
}
body.nation-home .home-intro { color: #fffdf9; text-align: left; padding: 4px 4px 0; }
body.nation-home .home-intro h1 {
  margin: 0 0 6px;
  font-size: clamp(1.35rem, 4.6vw, 2rem);
  line-height: 1.2;
  color: #fffdf9;
}
body.nation-home .home-intro p { margin: 0; color: #e8d4a8; font-size: 1rem; }
body.nation-home .home-map {
  background: #f4ead6;
  border-radius: 16px;
  padding: 8px 8px 4px;
}
body.nation-home .us-map { display: block; width: 100%; height: auto; }
body.nation-home .us-map path {
  fill: #8aa4bc;
  stroke: #072033;
  stroke-width: 0.8;
  stroke-linejoin: round;
}
body.nation-home .us-map a.is-rec path { fill: #D8C3A5; }
body.nation-home .us-map a.is-med path { fill: #6FBF9A; }
body.nation-home .us-map a:hover path,
body.nation-home .us-map a:focus path,
body.nation-home .us-map a:focus-visible path { fill: #C4AE8C; }
body.nation-home .us-map a.is-med:hover path,
body.nation-home .us-map a.is-med:focus path,
body.nation-home .us-map a.is-med:focus-visible path { fill: #5AA888; }
body.nation-home .us-map a:focus { outline: none; }
body.nation-home .us-map a:focus-visible path { stroke: #072033; stroke-width: 2; }
body.nation-home .home-map .map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 4px 6px 6px;
  color: #3a2212;
  font-size: 0.86rem;
  font-weight: 700;
}
body.nation-home .map-legend .key { display: inline-flex; align-items: center; gap: 6px; }
body.nation-home .map-legend .swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid #072033;
}
body.nation-home .map-legend .swatch.rec { background: #D8C3A5; }
body.nation-home .map-legend .swatch.med { background: #6FBF9A; }
body.nation-home .map-legend .swatch.none { background: #8aa4bc; }
body.nation-home .state-tile.is-med,
body.nation-home .state-tile.is-med.is-open {
  background: #6FBF9A;
  color: #1c1612;
}
body.nation-home .state-tile.is-med:is(:hover, :focus, :focus-visible, :active),
body.nation-home .state-tile.is-med.is-open:is(:hover, :focus, :focus-visible, :active) {
  background: #5AA888;
}
body.nation-home .state-tile.is-other,
body.nation-home .state-tile.is-other.is-open {
  background: #8aa4bc;
  color: #072033;
}
body.nation-home .state-tile.is-other:is(:hover, :focus, :focus-visible, :active) {
  background: #7593ad;
}
body.nation-home .home-news h2,
body.nation-home .state-panel h2 {
  margin: 0 0 8px;
  color: #fffdf9;
  background: transparent;
  box-shadow: none;
  padding: 0;
  width: auto;
  font-size: 1.15rem;
}
body.nation-home .home-news-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
@media (min-width: 760px) {
  body.nation-home .home-news-list { grid-template-columns: 1fr 1fr; }
}
body.nation-home .home-news-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #D8C3A5;
  color: #1c1612;
  text-decoration: none;
}
body.nation-home .home-news-item:hover,
body.nation-home .home-news-item:focus-visible { background: #C4AE8C; }
body.nation-home .home-news-kicker { font-size: 0.75rem; font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase; }
body.nation-home .home-news-item strong { font-size: 0.98rem; line-height: 1.25; }
body.nation-home .home-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 4px;
}
body.nation-home .home-row > a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  background: #D8C3A5;
  color: #1c1612;
  font-weight: 800;
  text-decoration: none;
}
body.nation-home .home-row > a:hover,
body.nation-home .home-row > a:focus-visible { background: #C4AE8C; }
body.nation-home .home-row .copy-email-wrap { color: #fffdf9; }
