:root {
  --bg: #f3f6fa;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --line: #d7e0ea;
  --line-strong: #b9c8d8;
  --text: #17212f;
  --muted: #647184;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #eaf2ff;
  --green: #18794e;
  --green-soft: #e9f8f0;
  --amber: #9a5b13;
  --amber-soft: #fff5e5;
  --red: #a33a32;
  --red-soft: #fff0ee;
  --shadow: 0 12px 30px rgba(26, 43, 67, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid #9ec1ff;
  outline-offset: 2px;
}

.site-header,
main,
footer {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: var(--radius);
  background: linear-gradient(145deg, #2563eb, #53a2ec);
  color: white;
  font-size: 1.15rem;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
  letter-spacing: 0;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22a06b;
  box-shadow: 0 0 0 4px #dff6e9;
}

.search-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(480px, 1.1fr);
  gap: 48px;
  align-items: center;
  min-height: 590px;
  padding: 36px 0 56px;
}

.search-intro {
  max-width: 530px;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--blue-dark);
  font-size: 0.79rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  max-width: 520px;
  margin: 0;
  font-size: clamp(2.6rem, 6vw, 4.7rem);
  line-height: 0.98;
}

h2 {
  margin: 0;
  font-size: 1.75rem;
}

.lead {
  max-width: 580px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.trust-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}

.notice,
.weather-context {
  display: flex;
  align-items: center;
  gap: 8px;
}

.trust-button svg,
.notice svg,
.weather-context svg {
  width: 17px;
  height: 17px;
}

.trust-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  color: #405066;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 750;
}

.trust-button:hover {
  border-color: #9bb3cc;
  background: white;
}

.trust-button[aria-expanded="true"] {
  border-color: #a9c5f7;
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.trust-button .trust-chevron {
  width: 15px;
  height: 15px;
  transition: transform 160ms ease;
}

.trust-button[aria-expanded="true"] .trust-chevron {
  transform: rotate(180deg);
}

.trust-explainers {
  margin-top: 10px;
}

.trust-explainer {
  padding: 13px 14px;
  border-left: 3px solid var(--blue);
  border-radius: 0 6px 6px 0;
  background: rgba(255, 255, 255, 0.68);
}

.trust-explainer strong {
  font-size: 0.88rem;
}

.trust-explainer p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.play-visual {
  width: min(100%, 520px);
  aspect-ratio: 3.2 / 1;
  margin-top: 28px;
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(17, 33, 53, 0.05), rgba(17, 33, 53, 0)),
    url("/static/indoor-play-space.webp") center 48% / cover no-repeat;
  box-shadow: inset 0 0 0 1px rgba(39, 57, 80, 0.14);
}

.search-panel {
  display: grid;
  gap: 18px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.field {
  display: grid;
  min-width: 0;
  gap: 7px;
  margin: 0;
  padding: 0;
  border: 0;
}

.field label,
.field legend {
  color: #435269;
  font-size: 0.85rem;
  font-weight: 750;
}

.field input {
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: white;
  color: var(--text);
}

.field input:hover {
  border-color: #8da4bb;
}

.form-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  gap: 12px;
}

.input-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.icon-button,
.secondary-button,
.primary-button,
.result-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 750;
}

.icon-button {
  width: auto;
  height: 46px;
  padding: 0 13px;
  border: 1px solid #a9d9be;
  background: #effaf4;
  color: var(--green);
  white-space: nowrap;
}

.icon-button svg,
.secondary-button svg,
.primary-button svg,
.result-action svg {
  width: 18px;
  height: 18px;
}

.field-note {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.segmented-control label {
  position: relative;
  cursor: pointer;
}

.segmented-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-control span {
  display: grid;
  height: 38px;
  place-items: center;
  border-radius: 5px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.segmented-control input:checked + span {
  background: white;
  color: var(--blue-dark);
  box-shadow: 0 1px 5px rgba(29, 78, 216, 0.13);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
}

.toggle-row strong,
.toggle-row small {
  display: block;
}

.toggle-row strong {
  font-size: 0.88rem;
}

.toggle-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.77rem;
}

.toggle-row input {
  width: 42px;
  height: 23px;
  appearance: none;
  border-radius: 999px;
  background: #c8d2df;
  cursor: pointer;
  transition: background 160ms ease;
}

.toggle-row input::after {
  display: block;
  width: 17px;
  height: 17px;
  margin: 3px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  content: "";
  transition: transform 160ms ease;
}

.toggle-row input:checked {
  background: var(--blue);
}

.toggle-row input:checked::after {
  transform: translateX(19px);
}

.notice {
  align-items: flex-start;
  padding: 11px 12px;
  border: 1px solid #f1d39e;
  border-radius: 6px;
  background: var(--amber-soft);
  color: #74430d;
  font-size: 0.8rem;
  line-height: 1.45;
}

.demo-notice {
  border-color: #b9cef8;
  background: var(--blue-soft);
  color: #274b86;
}

.primary-button {
  min-height: 48px;
  border: 1px solid var(--blue);
  background: var(--blue);
  color: white;
}

.primary-button:hover {
  background: var(--blue-dark);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.search-state {
  align-items: center;
  gap: 15px;
  margin-bottom: 32px;
  padding: 18px 20px;
  border: 1px solid #bfd2f7;
  border-radius: var(--radius);
  background: var(--blue-soft);
  color: #173b7a;
}

.search-state:not([hidden]) {
  display: flex;
}

.search-state p {
  margin: 4px 0 0;
  color: #4d6284;
  line-height: 1.45;
}

.search-state.error {
  border-color: #e3b7b2;
  background: var(--red-soft);
  color: var(--red);
}

.search-state.error .progress-spinner {
  display: none;
}

.search-state.error p {
  color: #7d4944;
}

.progress-spinner {
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  border: 3px solid #b9cef8;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.results-section {
  padding: 18px 0 52px;
}

.results-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.muted {
  color: var(--muted);
}

.results-heading .muted {
  margin: 7px 0 0;
}

.secondary-button {
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  background: white;
  color: #314157;
}

.weather-context {
  margin-bottom: 14px;
  padding: 13px 15px;
  border: 1px solid #cbd8e8;
  border-radius: var(--radius);
  background: #f7fbff;
  color: #40536b;
  line-height: 1.5;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.summary-item {
  position: relative;
  min-width: 0;
  padding: 14px 16px;
  border: 0;
  background: white;
  color: var(--text);
  text-align: left;
}

.summary-item strong,
.summary-item span {
  display: block;
}

.summary-item strong {
  font-size: 1.25rem;
}

.summary-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
}

.summary-button {
  cursor: pointer;
}

.summary-button:hover {
  background: #f7faff;
}

.summary-button[aria-expanded="true"] {
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.summary-button > svg {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  transition: transform 160ms ease;
}

.summary-button[aria-expanded="true"] > svg {
  transform: translateY(-50%) rotate(180deg);
}

.summary-detail {
  margin: -6px 0 18px;
  padding: 17px;
  border: 1px solid #bcd0f4;
  border-radius: var(--radius);
  background: #f7faff;
}

.summary-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.summary-detail-head > div > strong {
  font-size: 1rem;
}

.summary-detail-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.summary-detail-list {
  display: grid;
  gap: 1px;
  overflow: hidden;
  margin-top: 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--line);
}

.summary-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 12px;
  background: white;
}

.summary-detail-row strong,
.summary-detail-row span {
  display: block;
}

.summary-detail-row strong {
  font-size: 0.86rem;
}

.summary-detail-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.75rem;
}

.summary-detail-meta {
  flex: 0 0 auto;
  min-width: 105px;
  text-align: right;
}

.summary-detail-empty {
  margin: 0;
  padding: 12px;
  background: white;
  color: var(--muted);
  font-size: 0.82rem;
}

.result-list {
  display: grid;
  gap: 12px;
}

.result-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  padding: 20px;
  border: 1px solid var(--line);
  border-left: 4px solid #91a4ba;
  border-radius: var(--radius);
  background: white;
  box-shadow: 0 4px 16px rgba(32, 48, 70, 0.04);
}

.result-card.confirmed {
  border-left-color: var(--green);
}

.result-card.candidate-time-found,
.result-card.hours-only {
  border-left-color: #d08a27;
}

.result-topline,
.result-meta,
.result-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.result-card h3 {
  margin: 9px 0 5px;
  font-size: 1.16rem;
}

.result-address {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.confidence-badge,
.slot-badge,
.meta-chip,
.count-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 800;
}

.confidence-badge {
  gap: 5px;
  padding: 5px 8px;
  background: var(--green-soft);
  color: var(--green);
}

.confidence-badge.candidate {
  background: var(--amber-soft);
  color: var(--amber);
}

.slot-badge {
  padding: 5px 8px;
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.result-meta {
  margin-top: 14px;
}

.meta-chip {
  gap: 5px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: #415169;
}

.meta-chip svg,
.confidence-badge svg {
  width: 14px;
  height: 14px;
}

.result-note {
  margin: 13px 0 0;
  color: #55657a;
  font-size: 0.82rem;
  line-height: 1.5;
}

.booking-handoff-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 10px 0 0;
  color: var(--green);
  font-size: 0.76rem;
  line-height: 1.45;
}

.booking-handoff-note svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin-top: 1px;
}

.result-side {
  display: grid;
  min-width: 156px;
  align-content: space-between;
  justify-items: end;
  gap: 14px;
}

.drive-time {
  text-align: right;
}

.drive-time strong,
.drive-time span {
  display: block;
}

.drive-time strong {
  font-size: 1.45rem;
}

.drive-time span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.75rem;
}

.result-action {
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid var(--blue);
  background: var(--blue);
  color: white;
  text-decoration: none;
}

.result-action.secondary {
  border-color: var(--line-strong);
  background: white;
  color: #314157;
}

.empty-state {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  text-align: center;
}

.empty-state h3 {
  margin: 0 0 8px;
}

.empty-state p {
  max-width: 600px;
  margin: 0 auto;
  color: var(--muted);
  line-height: 1.55;
}

.unavailable-panel {
  margin-top: 20px;
  border-top: 1px solid var(--line);
}

.unavailable-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 2px;
  cursor: pointer;
  color: #47586e;
  font-weight: 750;
}

.count-badge {
  padding: 4px 8px;
  background: #e7ecf2;
  color: #536276;
}

.unavailable-list {
  display: grid;
  gap: 8px;
  padding-bottom: 8px;
}

.unavailable-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.unavailable-row strong,
.unavailable-row span {
  display: block;
}

.unavailable-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.unavailable-row a {
  align-self: center;
  color: var(--blue-dark);
  font-size: 0.82rem;
  font-weight: 750;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 25px 0 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
}

footer strong {
  color: var(--text);
}

[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .search-layout {
    grid-template-columns: 1fr;
    gap: 26px;
    min-height: 0;
    padding: 24px 0 40px;
  }

  .search-intro {
    max-width: 680px;
  }

  h1 {
    font-size: clamp(2.5rem, 10vw, 4rem);
  }

  .summary-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .summary-detail-row {
    align-items: flex-start;
  }
}

@media (max-width: 620px) {
  .site-header,
  main,
  footer {
    width: min(100% - 22px, 1180px);
  }

  .header-status {
    display: none;
  }

  .search-layout {
    padding-top: 14px;
  }

  .lead {
    margin-top: 15px;
  }

  .trust-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
    margin-top: 18px;
  }

  .trust-button {
    width: 100%;
    justify-content: flex-start;
  }

  .trust-button .trust-chevron {
    margin-left: auto;
  }

  .play-visual {
    margin-top: 20px;
  }

  .search-panel {
    gap: 16px;
    padding: 17px;
  }

  .input-action {
    grid-template-columns: 1fr;
  }

  .icon-button {
    width: 100%;
  }

  .form-grid {
    grid-template-columns: 1fr 1fr;
  }

  .form-grid .field:first-child {
    grid-column: 1 / -1;
  }

  .results-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 40px;
    align-items: flex-start;
  }

  .secondary-button {
    width: 40px;
    padding: 0;
  }

  .secondary-button span {
    display: none;
  }

  .result-card {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 17px;
  }

  .summary-detail {
    padding: 13px;
  }

  .summary-detail-row {
    display: grid;
    gap: 8px;
  }

  .summary-detail-meta {
    display: flex;
    min-width: 0;
    gap: 12px;
    text-align: left;
  }

  .result-side {
    grid-template-columns: 1fr auto;
    min-width: 0;
    align-items: center;
    justify-items: stretch;
  }

  .drive-time {
    text-align: left;
  }

  .result-action {
    justify-self: end;
  }

  footer {
    display: grid;
  }
}
