:root {
  color-scheme: dark;
  --bg: #0b0f0d;
  --bg-2: #0f1512;
  --surface: rgba(18, 25, 22, 0.82);
  --surface-solid: #121916;
  --surface-high: #1b2520;
  --surface-higher: #243129;
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(170, 255, 216, 0.30);
  --text: #edf5ef;
  --muted: #b9c9bf;
  --dim: #819088;
  --primary: #aaffd8;
  --primary-2: #62dcad;
  --primary-ink: #062418;
  --blue: #9ccaff;
  --gold: #ffdf7a;
  --red: #ffb4ab;
  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(98, 220, 173, 0.16), transparent 34rem),
    radial-gradient(circle at 80% 8%, rgba(156, 202, 255, 0.11), transparent 30rem),
    linear-gradient(180deg, #0b0f0d 0%, #0f1512 48%, #080b09 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

code {
  padding: 0.12rem 0.38rem;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: rgba(255, 255, 255, 0.06);
  color: var(--primary);
}

.hidden {
  display: none !important;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 44vw;
  height: 44vw;
  border-radius: 999px;
  filter: blur(70px);
  opacity: 0.18;
  pointer-events: none;
}

.ambient-a {
  top: 14vh;
  left: -20vw;
  background: var(--primary-2);
}

.ambient-b {
  right: -22vw;
  bottom: 10vh;
  background: var(--blue);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
  padding: max(14px, env(safe-area-inset-top)) clamp(16px, 4vw, 32px) 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 15, 13, 0.78);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(170, 255, 216, 0.35);
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(170, 255, 216, 0.95), rgba(98, 220, 173, 0.72));
  color: var(--primary-ink);
  font-weight: 950;
  letter-spacing: -0.08em;
  box-shadow: 0 0 34px rgba(98, 220, 173, 0.22);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  max-width: 58vw;
  overflow: hidden;
  font-size: 0.98rem;
  font-weight: 860;
  letter-spacing: -0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand small {
  margin-top: 0.08rem;
  color: var(--dim);
  font-size: 0.74rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.icon-button,
.ghost-button,
.soft-button,
.segment,
.chip,
.favorite-button,
.card-action {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease, opacity 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

.icon-button:active,
.ghost-button:active,
.soft-button:active,
.segment:active,
.chip:active,
.favorite-button:active,
.card-action:active {
  transform: scale(0.96);
}

.icon-button:focus-visible,
.ghost-button:focus-visible,
.soft-button:focus-visible,
.segment:focus-visible,
.chip:focus-visible,
.favorite-button:focus-visible,
.card-action:focus-visible,
.search-field:focus-within {
  outline: 2px solid rgba(170, 255, 216, 0.62);
  outline-offset: 2px;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  color: var(--muted);
}

.ghost-button,
.soft-button {
  padding: 0 1rem;
  color: var(--muted);
  font-weight: 760;
}

.soft-button {
  background: rgba(170, 255, 216, 0.08);
  color: var(--primary);
}

.shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 18px clamp(14px, 4vw, 28px) calc(36px + var(--safe-bottom));
}

.hero-card,
.control-card,
.empty-state,
.detail-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-card {
  position: relative;
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 1rem;
  overflow: hidden;
  padding: clamp(20px, 5vw, 36px);
}

.hero-card::before {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(170, 255, 216, 0.13), transparent 34%),
    linear-gradient(315deg, rgba(156, 202, 255, 0.11), transparent 45%);
  content: "";
  pointer-events: none;
}

.hero-copy,
.hero-metrics {
  position: relative;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 840;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 18px rgba(170, 255, 216, 0.75);
  content: "";
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 11ch;
  margin-bottom: 0.8rem;
  font-size: clamp(2.35rem, 10vw, 5.1rem);
  font-weight: 950;
  letter-spacing: -0.08em;
  line-height: 0.9;
}

.hero-copy p {
  max-width: 60ch;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  line-height: 1.55;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  align-self: end;
}

.metric-card {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(7, 10, 8, 0.38);
}

.metric-label {
  display: block;
  margin-bottom: 0.65rem;
  color: var(--dim);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: clamp(1.55rem, 4.6vw, 2.35rem);
  font-weight: 910;
  letter-spacing: -0.06em;
}

.metric-card small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.control-card {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1rem;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 52px;
  padding: 0 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--dim);
  transition: outline 160ms ease, border-color 160ms ease;
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search-field input::placeholder {
  color: var(--dim);
}

.segmented {
  display: inline-flex;
  overflow: hidden;
  min-height: 52px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.20);
}

.segment {
  min-height: 42px;
  padding: 0 0.85rem;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 770;
}

.segment.active {
  background: var(--primary);
  color: var(--primary-ink);
}

.chip-row,
.day-tabs {
  display: flex;
  grid-column: 1 / -1;
  gap: 0.55rem;
  overflow-x: auto;
  padding-bottom: 0.08rem;
  scrollbar-width: none;
}

.chip-row::-webkit-scrollbar,
.day-tabs::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 0.92rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 760;
  white-space: nowrap;
}

.chip.active {
  border-color: rgba(170, 255, 216, 0.45);
  background: rgba(170, 255, 216, 0.15);
  color: var(--primary);
}

.day-tab {
  flex: 0 0 auto;
  width: 96px;
  min-height: 64px;
  padding: 0.72rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.day-tab strong,
.day-tab small {
  display: block;
}

.day-tab strong {
  color: var(--text);
  font-size: 0.93rem;
}

.day-tab small {
  margin-top: 0.28rem;
  color: var(--dim);
  font-size: 0.75rem;
}

.day-tab.active {
  border-color: rgba(170, 255, 216, 0.55);
  background: linear-gradient(180deg, rgba(170, 255, 216, 0.18), rgba(170, 255, 216, 0.07));
  box-shadow: inset 0 0 24px rgba(98, 220, 173, 0.09);
}

.results-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 0 0.8rem;
}

.results-head h2 {
  margin-bottom: 0.2rem;
  font-size: clamp(1.55rem, 4vw, 2.2rem);
  font-weight: 890;
  letter-spacing: -0.055em;
}

.results-head p {
  margin-bottom: 0;
  color: var(--muted);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.place-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 270px;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025)),
    rgba(18, 25, 22, 0.74);
  box-shadow: 0 18px 64px rgba(0, 0, 0, 0.26);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.place-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.18);
}

.place-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent, var(--primary));
  content: "";
  opacity: 0.95;
}

.place-card.is-open {
  border-color: rgba(170, 255, 216, 0.24);
  box-shadow: 0 20px 80px rgba(98, 220, 173, 0.07), 0 18px 64px rgba(0, 0, 0, 0.30);
}

.place-card.is-closed {
  opacity: 0.76;
}

.place-card.is-closed::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.10));
  content: "";
  pointer-events: none;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.type-pill,
.status-pill,
.area-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 30px;
  padding: 0 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 790;
  white-space: nowrap;
}

.type-pill {
  border-color: color-mix(in srgb, var(--accent) 38%, transparent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: color-mix(in srgb, var(--accent) 86%, white);
}

.status-pill {
  border-color: color-mix(in srgb, var(--status) 40%, transparent);
  background: color-mix(in srgb, var(--status) 14%, transparent);
  color: color-mix(in srgb, var(--status) 88%, white);
}

.favorite-button {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 0;
  color: var(--dim);
  font-size: 1.1rem;
}

.favorite-button.active {
  border-color: rgba(255, 223, 122, 0.38);
  background: rgba(255, 223, 122, 0.12);
  color: var(--gold);
}

.place-card h3 {
  margin: 1rem 0 0.65rem;
  font-size: clamp(1.22rem, 3vw, 1.64rem);
  font-weight: 880;
  letter-spacing: -0.052em;
  line-height: 1.06;
}

.meta-line,
.note-line,
.next-line {
  display: flex;
  align-items: start;
  gap: 0.5rem;
  margin: 0 0 0.58rem;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.35;
}

.note-line {
  color: var(--gold);
}

.next-line {
  color: var(--primary);
}

.card-spacer {
  flex: 1;
}

.timeline {
  margin-top: 0.75rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.timeline-labels {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.52rem;
  color: var(--dim);
  font-size: 0.76rem;
  font-weight: 780;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.progress-track {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  width: var(--progress, 0%);
}

.progress-dot {
  position: absolute;
  top: 50%;
  left: var(--dot, 0%);
  width: 14px;
  height: 14px;
  border: 2px solid var(--surface-solid);
  border-radius: 999px;
  background: var(--text);
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 65%, transparent);
  transform: translate(-50%, -50%);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}

.card-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 0.85rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 770;
  text-decoration: none;
}

.card-action.primary {
  border-color: rgba(170, 255, 216, 0.35);
  background: rgba(170, 255, 216, 0.12);
  color: var(--primary);
}

.empty-state {
  padding: 2.4rem 1.5rem;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--text);
  font-size: 1.25rem;
}

.empty-state p {
  margin-bottom: 0;
}

.detail-dialog {
  width: min(720px, calc(100vw - 24px));
  max-height: min(760px, calc(100vh - 24px));
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
}

.detail-dialog::backdrop {
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(10px);
}

.detail-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(1rem, 3vw, 1.4rem);
}

.close-dialog {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  background: rgba(0, 0, 0, 0.28);
}

.detail-content {
  padding-right: 3rem;
}

.detail-content h2 {
  max-width: 12ch;
  margin: 0.65rem 0 1rem;
  font-size: clamp(2rem, 8vw, 3.6rem);
  font-weight: 940;
  letter-spacing: -0.075em;
  line-height: 0.92;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 1rem 0;
}

.detail-item {
  min-width: 0;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.18);
}

.detail-item small,
.schedule-list small {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--dim);
  font-size: 0.72rem;
  font-weight: 820;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.detail-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-list {
  margin: 1rem 0 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.18);
}

.schedule-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0;
  color: var(--muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.schedule-row:last-child {
  border-bottom: 0;
}

.schedule-row.active {
  color: var(--primary);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: calc(18px + var(--safe-bottom));
  z-index: 30;
  max-width: min(420px, calc(100vw - 36px));
  padding: 0.85rem 1rem;
  border: 1px solid rgba(170, 255, 216, 0.22);
  border-radius: 18px;
  background: rgba(12, 18, 15, 0.92);
  color: var(--text);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
  backdrop-filter: blur(18px);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 840px) {
  .hero-card {
    grid-template-columns: 1fr;
  }

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

  .control-card {
    grid-template-columns: 1fr;
  }

  .segmented {
    width: 100%;
  }

  .segment {
    flex: 1;
  }

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

@media (max-width: 560px) {
  .app-header {
    min-height: 66px;
  }

  .ghost-button {
    display: none;
  }

  .shell {
    padding-inline: 12px;
  }

  .hero-card,
  .control-card,
  .place-card,
  .empty-state {
    border-radius: 24px;
  }

  h1 {
    max-width: 9ch;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .metric-card {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
  }

  .metric-card strong {
    margin-bottom: 0;
    font-size: 1.55rem;
  }

  .metric-card small {
    display: none;
  }

  .results-head {
    align-items: flex-start;
  }

  .results-head .soft-button {
    display: none;
  }

  .place-card {
    min-height: 0;
  }

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

  .detail-content {
    padding-right: 0;
    padding-top: 2.6rem;
  }

  .detail-content h2 {
    max-width: 10ch;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
  }
}
