:root {
  --bg: #f4f1eb;
  --paper: rgba(255, 255, 255, 0.88);
  --paper-strong: #ffffff;
  --ink: #1f2430;
  --muted: #6d7280;
  --line: rgba(31, 36, 48, 0.1);
  --accent: #8f7350;
  --accent-soft: #d7c29b;
  --purple: #6d28d9;
  --purple-soft: #a855f7;
  --red: #ef4444;
  --shadow: 0 20px 50px rgba(18, 24, 39, 0.08);
  --ttp-ink: #172033;
  --ttp-muted: #556273;
  --ttp-blue: #2563eb;
  --ttp-teal: #0f766e;
  --ttp-wide: 1180px;
  --ttp-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(215, 194, 155, 0.22), transparent 30%),
    linear-gradient(180deg, #faf8f3 0%, var(--bg) 100%);
  color: var(--ink);
  font-family: "Source Sans 3", sans-serif;
}

body {
  padding: 0;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ttp-site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(99, 116, 139, 0.14);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
}

.ttp-header-inner {
  width: min(100% - 32px, var(--ttp-wide));
  min-height: 86px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.ttp-brand {
  min-width: 0;
}

.ttp-site-logo-link {
  display: inline-flex;
  align-items: center;
  max-width: min(442px, 42vw);
}

.ttp-site-logo-img {
  display: block;
  width: min(360px, 44vw);
  max-height: 70px;
  object-fit: contain;
  filter: drop-shadow(0 7px 12px rgba(15, 23, 42, 0.14));
}

.ttp-site-navigation {
  display: flex;
  align-items: center;
}

.ttp-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
  min-width: 0;
}

.ttp-primary-menu,
.ttp-footer-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ttp-primary-menu {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ttp-primary-menu a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 999px;
  color: #273244;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.ttp-primary-menu a:hover,
.ttp-primary-menu a:focus {
  color: var(--ttp-blue);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.10), rgba(15, 118, 110, 0.10));
  transform: translateY(-1px);
}

.ttp-header-search {
  display: flex;
  align-items: center;
  width: clamp(118px, 10vw, 158px);
  min-height: 36px;
  padding: 3px;
  border: 1px solid rgba(99, 116, 139, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
}

.ttp-header-search input {
  min-width: 0;
  width: 100%;
  height: 28px;
  padding: 0 8px 0 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  outline: 0;
}

.ttp-header-search button {
  min-width: 34px;
  min-height: 28px;
  padding: 0 9px;
  border: 0;
  border-radius: 999px;
  background: #172033;
  color: #fffdf7;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.ttp-bundy-main {
  width: min(100% - 32px, 1480px);
  margin: 32px auto;
}

.ttp-site-footer {
  border-top: 1px solid rgba(99, 116, 139, 0.14);
  background:
    linear-gradient(135deg, rgba(23, 32, 51, 0.98), rgba(15, 118, 110, 0.94)),
    #172033;
  color: rgba(255, 255, 255, 0.82);
}

.ttp-footer-inner {
  width: min(100% - 32px, var(--ttp-wide));
  margin: 0 auto;
  padding: 36px 0;
  display: grid;
  gap: 18px;
}

.ttp-footer-brand strong {
  display: block;
  color: #fff;
  font-size: 22px;
  line-height: 1.1;
}

.ttp-footer-brand span {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 14px;
}

.ttp-footer-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ttp-footer-menu a {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
}

.ttp-footer-menu a:hover,
.ttp-footer-menu a:focus {
  color: #fff;
  background: rgba(255, 255, 255, 0.10);
}

.ttp-footer-credit {
  margin: 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 13px;
}

.app-shell {
  display: grid;
  gap: 24px;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: rgba(250, 248, 243, 0.86);
  backdrop-filter: blur(10px);
  transition: opacity 180ms ease, visibility 180ms ease;
}

.loading-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-card {
  width: min(420px, calc(100vw - 32px));
  padding: 28px 26px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(31, 36, 48, 0.08);
  box-shadow: 0 20px 50px rgba(18, 24, 39, 0.12);
  text-align: center;
}

.loading-card__eyebrow {
  margin: 0 0 14px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
}

.loading-card__progress {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
}

.vw-loader {
  width: 100%;
}

.vw-loader__svg {
  width: 100%;
  height: auto;
  display: block;
}

.vw-loader__fill {
  fill: #b79261;
}

.vw-loader__body {
  fill: rgba(255, 252, 245, 0.4);
  stroke: #7d6547;
  stroke-width: 3.8;
}

.vw-loader__chrome {
  fill: none;
  stroke: rgba(125, 101, 71, 0.92);
  stroke-width: 3.1;
  stroke-linecap: round;
}

.vw-loader__bumper {
  fill: none;
  stroke: rgba(110, 118, 131, 0.9);
  stroke-width: 4.2;
  stroke-linecap: round;
}

.vw-loader__window {
  fill: #f3ece1;
  stroke: #7d6547;
  stroke-width: 3;
}

.vw-loader__divider {
  fill: none;
  stroke: rgba(125, 101, 71, 0.8);
  stroke-width: 2.5;
}

.vw-loader__hood {
  fill: none;
  stroke: rgba(125, 101, 71, 0.72);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.vw-loader__fender {
  fill: none;
  stroke: rgba(125, 101, 71, 0.58);
  stroke-width: 2.4;
  stroke-linecap: round;
}

.vw-loader__wheel {
  fill: #4b5563;
}

.vw-loader__hub {
  fill: #cbd5e1;
}

.vw-loader__headlight {
  fill: #f2d27b;
  stroke: rgba(142, 116, 82, 0.9);
  stroke-width: 1.5;
}

.vw-loader__vw-ring {
  fill: none;
  stroke: rgba(246, 239, 226, 0.95);
  stroke-width: 2.3;
}

.vw-loader__vw-mark {
  fill: none;
  stroke: rgba(246, 239, 226, 0.95);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero,
.controls-panel,
.map-stage,
.inspector {
  background: var(--paper);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(19, 17, 14, 0.18);
  backdrop-filter: blur(2px);
}

.tutorial-highlight {
  position: fixed;
  z-index: 1201;
  border-radius: 22px;
  border: 2px solid rgba(255, 246, 204, 0.96);
  box-shadow: 0 0 0 9999px rgba(19, 17, 14, 0.12), 0 0 0 8px rgba(255, 255, 255, 0.12), 0 18px 40px rgba(24, 15, 3, 0.22);
  pointer-events: none;
  transition: left 180ms ease, top 180ms ease, width 180ms ease, height 180ms ease;
}

.tutorial-card {
  position: relative;
  z-index: 1202;
  width: min(460px, 100%);
  max-height: min(80vh, 760px);
  overflow: auto;
  padding: 26px 24px 22px;
  border-radius: 28px;
  border: 1px solid rgba(117, 92, 44, 0.18);
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(252, 248, 240, 0.98));
  box-shadow: 0 28px 80px rgba(36, 26, 11, 0.24);
}

.tutorial-card--reference {
  max-height: min(82vh, 820px);
}

.tutorial-card__close {
  position: absolute;
  top: 14px;
  right: 16px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.tutorial-card__eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent);
}

.tutorial-card__step {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.tutorial-card h2 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: clamp(2rem, 3vw, 2.8rem);
}

.tutorial-card__intro {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.tutorial-card__content {
  display: grid;
  gap: 16px;
}

.reference-list {
  display: grid;
  gap: 12px;
  color: var(--muted);
  line-height: 1.65;
}

.reference-list p {
  margin: 0;
}

.tutorial-card__footer {
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.tutorial-card__remember {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--muted);
}

.tutorial-card__remember input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.tutorial-card__actions {
  display: flex;
  gap: 10px;
}

.hero {
  border-radius: 28px;
  padding: 22px 24px;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.8fr) minmax(260px, 360px);
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
}

.hero h1 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: clamp(2.4rem, 4vw, 4rem);
  line-height: 1;
}

.lede {
  margin: 10px 0 0;
  max-width: 760px;
  font-size: 0.98rem;
  color: var(--muted);
}

.hero-card {
  padding: 18px 20px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(31, 36, 48, 0.96), rgba(71, 51, 24, 0.92));
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.hero-card__label,
.hero-card__subtext {
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
}

.hero-card__label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
}

.hero-card__value {
  margin: 8px 0 6px;
  font-size: 1.55rem;
  font-weight: 700;
}

.hero-card__help {
  align-self: flex-start;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

.hero-card__help:hover {
  color: #fff;
}

.hero-card__help-group {
  margin-top: 10px;
  display: grid;
  justify-items: start;
  gap: 6px;
}

.controls-panel {
  border-radius: 24px;
  padding: 18px 20px;
  display: grid;
  gap: 14px;
}

.mode-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper-strong);
  font-weight: 600;
  cursor: pointer;
}

.toggle-chip input {
  position: static;
  inset: auto;
  opacity: 1;
  width: 18px;
  height: 18px;
  accent-color: var(--purple);
}

.toggle-chip:hover {
  border-color: rgba(109, 40, 217, 0.2);
  background: rgba(168, 85, 247, 0.06);
}

.toggle-chip:has(input:checked) {
  border-color: rgba(109, 40, 217, 0.28);
  background: rgba(168, 85, 247, 0.12);
  color: #4b1fb3;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.filters-grid--compact {
  grid-template-columns: minmax(180px, 210px) minmax(170px, 190px) minmax(170px, 190px) minmax(220px, 1fr) minmax(220px, 1fr);
  align-items: end;
}

.field {
  display: grid;
  gap: 8px;
}

.field--compact {
  max-width: 200px;
}

.field--year {
  max-width: 210px;
}

.field--month,
.field--day {
  max-width: 180px;
}

.field--inline-select {
  display: grid;
  gap: 0;
  min-width: 170px;
  padding-left: 6px;
  align-self: center;
}

.field--inline-select select {
  height: 38px;
  min-width: 170px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--paper-strong);
  padding: 0 12px;
  font: inherit;
}

.route-status {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.context-guide {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(124, 58, 237, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(249, 245, 255, 0.88));
}

.context-guide--embedded {
  margin-bottom: 2px;
}

.context-guide__body {
  display: grid;
  gap: 6px;
}

.context-guide__eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 700;
  color: #6b4f26;
}

.context-guide__text {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.5;
}

.context-guide__dismiss {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  min-height: 34px;
  padding: 0 12px;
  background: rgba(31, 36, 48, 0.06);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.field span {
  font-size: 12px;
  font-weight: 700;
}

.field select,
.field input[type="range"],
.field input[type="text"],
.field input[type="date"] {
  width: 100%;
}

.field select,
.field input[type="text"],
.field input[type="date"] {
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--paper-strong);
  padding: 0 12px;
  font: inherit;
}

.field--range strong {
  color: var(--muted);
  font-size: 0.88rem;
}

.field--compact select {
  min-width: 0;
}

.is-hidden {
  display: none;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.checkbox input {
  width: 18px;
  height: 18px;
}

.button {
  border: 0;
  border-radius: 999px;
  min-height: 38px;
  padding: 0 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.button--ghost {
  background: rgba(31, 36, 48, 0.06);
  color: var(--ink);
}

.button--accent {
  background: linear-gradient(135deg, rgba(185, 149, 99, 0.96), rgba(143, 115, 80, 0.96));
  color: #fff;
  box-shadow: 0 12px 24px rgba(143, 115, 80, 0.22);
}

.button--accent:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(143, 115, 80, 0.26);
}

.custom-case {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
  max-height: 320px;
  opacity: 1;
  transform: translateY(0);
  transition: max-height 220ms ease, opacity 180ms ease, transform 180ms ease, padding 180ms ease, margin 180ms ease, border-color 180ms ease;
}

.custom-case--collapsed {
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  padding-top: 0;
  padding-bottom: 0;
  border-color: transparent;
}

.missing-search {
  display: grid;
  gap: 14px;
  justify-items: start;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(124, 58, 237, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(249, 245, 255, 0.86));
  overflow: visible;
  max-height: 260px;
  opacity: 1;
  transform: translateY(0);
  transition: max-height 220ms ease, opacity 180ms ease, transform 180ms ease, padding 180ms ease, margin 180ms ease, border-color 180ms ease;
}

.missing-search--collapsed {
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  padding-top: 0;
  padding-bottom: 0;
  border-color: transparent;
}

.missing-search__intro {
  margin: 0;
  max-width: 78ch;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.missing-search__grid {
  display: grid;
  grid-template-columns: minmax(240px, 28rem);
  gap: 14px;
  align-items: end;
  width: min(100%, 28rem);
}

.missing-search__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: min(100%, 28rem);
}

.missing-search__status {
  margin: 0;
  width: min(100%, 28rem);
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 600;
}

.missing-search .field {
  width: min(100%, 28rem);
}

.custom-case__intro {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.custom-case__grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(240px, 1.6fr) minmax(160px, 0.7fr);
  gap: 14px;
  align-items: end;
}

.custom-case__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.custom-case__status {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 600;
}

.button--toggle {
  position: relative;
  padding-right: 38px;
  font-weight: 700;
}

.button--toggle::after {
  content: "+";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.05rem;
  line-height: 1;
  opacity: 0.88;
}

.button--toggle.is-open::after {
  content: "−";
}

.controls-summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.suggestion-box {
  position: relative;
}

.suggestion-box__menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 12;
  display: grid;
  gap: 0;
  max-height: 260px;
  overflow: auto;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid rgba(31, 36, 48, 0.12);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 38px rgba(18, 24, 39, 0.14);
}

.suggestion-box__menu:empty {
  display: none;
}

.suggestion-box__item {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.suggestion-box__item:hover {
  background: rgba(31, 36, 48, 0.05);
}

.suggestion-box__title {
  font-weight: 700;
}

.suggestion-box__meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.stat__label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat__value {
  font-size: 1.75rem;
  line-height: 1;
  font-weight: 700;
}

.stat__value--small {
  font-size: 0.95rem;
  line-height: 1.3;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 430px);
  gap: 20px;
}

.map-stage {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  min-height: 760px;
  background:
    radial-gradient(circle at top right, rgba(220, 232, 239, 0.55), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(244, 241, 235, 0.82));
}

.map-canvas {
  width: 100%;
  min-height: 760px;
}

.legend {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 5;
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(31, 36, 48, 0.08);
  box-shadow: 0 14px 34px rgba(18, 24, 39, 0.14);
}

.legend strong {
  display: block;
  margin-bottom: 8px;
}

.legend div {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.legend__dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  display: inline-block;
}

.legend__dot--bundy {
  background: #c81e1e;
}

.legend__dot--missing {
  background: var(--purple);
}

.legend__dot--grouped {
  background: #b89a72;
}

.legend__dot--missing-grouped {
  background: var(--purple-soft);
}

.legend__line {
  display: inline-block;
  width: 20px;
  height: 3px;
  background: var(--red);
  border-radius: 999px;
}

.inspector {
  border-radius: 28px;
  padding: 16px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 760px;
}

.inspector__tabs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.inspector__tab {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-strong);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.inspector__tab.is-active {
  background: rgba(143, 115, 80, 0.18);
  border-color: rgba(143, 115, 80, 0.3);
  color: #5c472f;
}

.inspector__panel {
  display: none;
  overflow: auto;
  padding: 8px 4px 4px;
}

.inspector__panel.is-active {
  display: block;
}

.empty-state h2,
.record-stack h2 {
  margin-top: 0;
  font-family: "Fraunces", serif;
  font-size: 1.7rem;
}

.empty-state p,
.record-stack p,
.streetview-message {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.record-stack {
  display: grid;
  gap: 14px;
}

.record-stack--popup {
  gap: 8px;
}

.record-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  padding: 16px;
}

.record-card--compact {
  padding: 12px 14px;
}

.record-card__media {
  margin: 0 0 12px;
  display: grid;
  gap: 8px;
}

.record-card__image {
  display: block;
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid rgba(31, 36, 48, 0.08);
  background: rgba(31, 36, 48, 0.04);
}

.record-card__media--feature {
  margin: 0 0 14px;
}

.record-card__image--feature {
  max-height: 180px;
  object-fit: contain;
  object-position: center top;
  background: rgba(244, 241, 235, 0.92);
}

.popup-summary {
  display: block;
}

.popup-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.popup-header__meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 600;
}

.popup-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.popup-nav__button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(31, 36, 48, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.popup-nav__button:hover {
  background: rgba(31, 36, 48, 0.06);
}

.popup-nav__button--text {
  font-size: 0.92rem;
}

.popup-summary--with-media {
  display: grid;
  grid-template-columns: minmax(112px, 136px) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.popup-summary--with-media .record-card__media--feature {
  margin: 0;
}

.popup-summary--with-media .record-card__image--feature {
  max-height: 144px;
}

.record-card__caption,
.record-card__credit {
  margin: 0;
  text-align: left;
}

.record-card__caption {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.5;
}

.record-card__credit {
  color: var(--muted);
  font-size: 0.88rem;
}

.record-card__eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
}

.record-card h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.record-card__action {
  margin: 14px 0 0;
}

.record-card__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(31, 36, 48, 0.1);
  background: rgba(31, 36, 48, 0.03);
  color: #3a4050;
  font-weight: 600;
  font-size: 0.94rem;
  text-decoration: none;
}

.record-card__link:hover {
  background: rgba(31, 36, 48, 0.07);
}

.record-card__inline-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.probability-summary {
  display: grid;
  gap: 0;
  border: 1px solid rgba(31, 36, 48, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  overflow: hidden;
}

.probability-summary__row {
  display: grid;
  grid-template-columns: minmax(96px, 112px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 8px 12px;
  border-top: 1px solid rgba(31, 36, 48, 0.08);
}

.probability-summary__row:first-child {
  border-top: 0;
}

.probability-summary__row span {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.probability-summary__row strong {
  text-align: left;
}

.probability-summary__row--wide strong {
  line-height: 1.45;
}

.probability-badge {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.01em;
  width: fit-content;
}

.probability-badge--high {
  color: #116149;
  background: rgba(16, 185, 129, 0.16);
}

.probability-badge--medium {
  color: #8a5a00;
  background: rgba(245, 158, 11, 0.18);
}

.probability-badge--low {
  color: #9b1c1c;
  background: rgba(239, 68, 68, 0.14);
}

.probability-badge--impossible {
  color: #5b21b6;
  background: rgba(124, 58, 237, 0.16);
}

.record-meta {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.record-meta--inline .record-meta__row {
  display: grid;
  grid-template-columns: minmax(118px, 132px) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.record-meta--inline .record-meta__row span,
.record-meta--inline .record-meta__row strong {
  min-width: 0;
  flex: none;
}

.inline-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: -2px;
  align-items: center;
}

.inline-nav__button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(31, 36, 48, 0.1);
  border-radius: 999px;
  background: rgba(31, 36, 48, 0.04);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.inline-nav__button:hover {
  background: rgba(31, 36, 48, 0.08);
}

.inline-nav__status {
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
  white-space: nowrap;
}

.record-meta__row {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(31, 36, 48, 0.08);
  text-align: left;
}

.record-meta__row span {
  color: var(--muted);
  min-width: 110px;
  flex: 0 0 110px;
}

.record-meta__row strong {
  flex: 1 1 220px;
  text-align: left;
}

.streetview-canvas {
  width: 100%;
  min-height: 420px;
  border-radius: 22px;
  overflow: hidden;
  background: rgba(31, 36, 48, 0.06);
  border: 1px solid rgba(31, 36, 48, 0.08);
}

.gm-style iframe + div[style*="position: absolute"] {
  border-radius: 16px;
}

.map-stage .gm-style {
  font-family: "Source Sans 3", sans-serif;
}

.map-stage .gm-style .gm-style-mtc,
.map-stage .gm-style .gm-bundled-control,
.map-stage .gm-style .gm-fullscreen-control {
  margin: 16px !important;
}

.map-stage .gm-style .gm-style-mtc button,
.map-stage .gm-style .gm-control-active,
.map-stage .gm-style .gm-fullscreen-control {
  border-radius: 14px !important;
  border: 1px solid rgba(31, 36, 48, 0.1) !important;
  box-shadow: 0 10px 24px rgba(18, 24, 39, 0.12) !important;
}

.map-stage .gm-style .gm-style-mtc button {
  min-width: 76px !important;
  font-weight: 700 !important;
}

.map-stage .gm-style .gm-bundled-control .gm-control-active {
  background: rgba(255, 255, 255, 0.96) !important;
}

.map-stage .gm-style .gm-bundled-control .gm-control-active + .gm-control-active {
  margin-top: 8px !important;
}

@media (max-width: 1160px) {
  .hero,
  .workspace {
    grid-template-columns: 1fr;
  }

  .filters-grid,
  .stats-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters-grid--compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .ttp-header-inner {
    min-height: 76px;
  }

  .ttp-site-logo-link {
    max-width: min(300px, 64vw);
  }

  .ttp-site-logo-img {
    width: min(300px, 64vw);
    max-height: 58px;
  }

  .ttp-header-actions {
    display: none;
  }

  .ttp-bundy-main {
    width: min(100% - 24px, 1480px);
    margin: 18px auto;
  }

  .hero,
  .controls-panel,
  .map-stage,
  .inspector {
    border-radius: 22px;
  }

  .hero {
    padding: 18px;
  }

  .controls-panel {
    padding: 16px;
  }

  .filters-grid,
  .stats-strip {
    grid-template-columns: 1fr;
  }

  .mode-switch,
  .meta-row {
    display: grid;
  }

  .field--inline-select {
    padding-left: 0;
  }

  .custom-case__grid {
    grid-template-columns: 1fr;
  }

  .legend {
    left: 16px;
    right: 16px;
  }

  .popup-summary--with-media {
    grid-template-columns: 1fr;
  }

  .popup-header {
    flex-direction: column;
  }
}
