:root {
  color-scheme: light;
  --maroon: #8a1538;
  --maroon-dark: #4e1221;
  --ink: #211d1d;
  --muted: #6b625b;
  --paper: #f7f2e8;
  --surface: #fffaf1;
  --surface-strong: #ffffff;
  --line: #e2d5c2;
  --gold: #d6a85c;
  --green: #1f6b5b;
  --copper: #bb6d3f;
  --sky: #517b86;
  --shadow: 0 20px 45px rgba(33, 29, 29, 0.12);
  --soft-shadow: 0 12px 28px rgba(33, 29, 29, 0.08);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Arial, "Noto Sans Arabic", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(138, 21, 56, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(31, 107, 91, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 34px 34px;
}

body[dir="rtl"] {
  font-family:
    "Noto Sans Arabic", Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(247, 242, 232, 0.88);
  border-bottom: 1px solid rgba(226, 213, 194, 0.82);
  backdrop-filter: blur(18px);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}

.brand-symbol {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #fff;
  background:
    linear-gradient(135deg, var(--maroon), var(--maroon-dark) 56%, var(--green));
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 8px;
  box-shadow: 0 10px 22px rgba(138, 21, 56, 0.22);
  font-weight: 800;
}

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

.brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand-wordmark {
  width: clamp(104px, 13vw, 148px);
  height: auto;
  max-height: 28px;
  object-fit: contain;
  object-position: left center;
}

body[dir="rtl"] .brand-wordmark {
  object-position: right center;
}

.brand-title {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.1;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.icon-button,
.text-button,
.primary-button,
.secondary-button,
.ghost-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease,
    border-color 150ms ease;
}

.icon-button {
  width: 40px;
  padding: 0;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  color: var(--ink);
}

.text-button,
.secondary-button,
.ghost-button {
  padding: 0 14px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  color: var(--ink);
}

.primary-button {
  padding: 0 16px;
  color: #fff;
  background: var(--maroon);
  box-shadow: 0 10px 24px rgba(138, 21, 56, 0.22);
}

.secondary-button {
  color: var(--maroon-dark);
  background: #fff6e9;
  border-color: #e5c892;
}

.ghost-button {
  color: var(--muted);
  background: transparent;
}

.icon-button:hover,
.text-button:hover,
.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.icon-button:focus-visible,
.text-button:focus-visible,
.primary-button:focus-visible,
.secondary-button:focus-visible,
.ghost-button:focus-visible,
.chip:focus-visible,
.mode-card:focus-visible,
.stop-card:focus-visible {
  outline: 3px solid rgba(214, 168, 92, 0.62);
  outline-offset: 2px;
}

.hero {
  position: relative;
  min-height: calc(82vh - 69px);
  display: grid;
  align-items: end;
  overflow: hidden;
  background: var(--ink);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(180deg, rgba(33, 29, 29, 0.08) 0%, rgba(33, 29, 29, 0.72) 70%, rgba(33, 29, 29, 0.92) 100%),
    var(--hero-image);
  background-size: cover;
  background-position: center;
  transform: scale(1.015);
}

.hero-inner {
  position: relative;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(48px, 8vh, 82px) clamp(18px, 5vw, 52px) clamp(22px, 4vh, 40px);
  color: #fff;
}

.hero-kicker {
  width: fit-content;
  margin: 0 0 14px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #f7e2b7;
  font-size: 0.82rem;
  line-height: 1.25;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.1rem, 5vw, 4.25rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero p {
  max-width: 640px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 660px;
  margin-top: 24px;
}

.metric-tile {
  min-height: 86px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  backdrop-filter: blur(16px);
}

.metric-value {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.1;
}

.metric-label {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.78rem;
  line-height: 1.3;
}

.page {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: clamp(22px, 4vw, 40px) clamp(16px, 4vw, 40px) 56px;
}

.page.compact {
  max-width: 980px;
}

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

.section-heading h2,
.section-heading h1 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  line-height: 1.08;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.section-heading p,
.muted {
  color: var(--muted);
}

.section-heading p {
  max-width: 560px;
  margin: 8px 0 0;
  line-height: 1.55;
}

.notice {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid #e5c892;
  background: #fff6e9;
  color: #5f4320;
  border-radius: 8px;
  line-height: 1.5;
}

.grid {
  display: grid;
  gap: 14px;
}

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

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

.mode-card,
.stop-card,
.panel,
.source-card,
.admin-card,
.answer-box {
  border: 1px solid var(--line);
  background: rgba(255, 250, 241, 0.92);
  border-radius: var(--radius);
  box-shadow: var(--soft-shadow);
}

.mode-card {
  min-height: 132px;
  padding: 18px;
  text-align: inherit;
  color: var(--ink);
}

.mode-card.active {
  border-color: rgba(138, 21, 56, 0.55);
  background: #fff3f0;
  box-shadow: 0 15px 32px rgba(138, 21, 56, 0.12);
}

.mode-card h3,
.panel h3,
.admin-card h3,
.source-card h3 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.25;
}

.mode-card p,
.source-card p,
.admin-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--ink);
  border-radius: 8px;
}

.chip.active {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

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

.stop-card {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  min-height: 132px;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
}

.stop-card img {
  width: 118px;
  height: 100%;
  object-fit: cover;
}

.stop-copy {
  padding: 14px 16px;
  min-width: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--maroon);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0;
}

body[dir="rtl"] .eyebrow {
  text-transform: none;
}

.stop-copy h3 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.25;
}

.stop-copy p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.42;
}

.stop-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  gap: 22px;
  align-items: start;
}

.media-panel {
  position: sticky;
  top: 86px;
}

.media-panel img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.audio-panel {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
}

.custom-player {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.play-toggle {
  width: 42px;
  height: 42px;
  color: #fff;
  background: var(--ink);
  border-radius: 8px;
  font-weight: 800;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  background: #e5dccd;
  border-radius: 8px;
}

.progress-fill {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--maroon), var(--green));
  border-radius: 8px;
}

.player-time {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
  direction: ltr;
  unicode-bidi: isolate;
}

.hidden-audio {
  display: none;
}

.transcript {
  padding: 20px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

.transcript h1 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.45rem);
  line-height: 1.08;
}

.transcript p {
  color: #3b3530;
  line-height: 1.85;
}

.prompt {
  padding: 14px;
  border-inline-start: 4px solid var(--gold);
  background: #fff7e8;
  border-radius: 8px;
  color: #59411f;
  line-height: 1.55;
}

.question-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 14px;
}

.field,
textarea.field {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

textarea.field {
  min-height: 94px;
  resize: vertical;
}

.answer-box {
  margin-top: 12px;
  padding: 14px;
  line-height: 1.55;
}

.completion {
  min-height: calc(100vh - 69px);
  display: grid;
  align-items: center;
}

.completion-card {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 5vw, 46px);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.rating-row {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}

.rating-button {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.rating-button.active {
  color: #fff;
  background: var(--maroon);
  border-color: var(--maroon);
}

.admin-shell {
  min-height: calc(100vh - 69px);
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
}

.admin-nav {
  position: sticky;
  top: 69px;
  height: calc(100vh - 69px);
  padding: 18px;
  border-inline-end: 1px solid var(--line);
  background: rgba(255, 250, 241, 0.78);
  overflow: auto;
}

.admin-nav button {
  width: 100%;
  justify-content: flex-start;
  margin-bottom: 7px;
}

body[dir="rtl"] .admin-nav button {
  justify-content: flex-end;
}

.admin-nav button.active {
  color: #fff;
  background: var(--maroon);
  border-color: var(--maroon);
}

.admin-main {
  padding: clamp(18px, 4vw, 36px);
  overflow: hidden;
}

.admin-card {
  padding: 16px;
}

.admin-card.strong {
  background: #fff;
  box-shadow: var(--shadow);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 8px;
  font-size: 0.77rem;
  line-height: 1.2;
  font-weight: 800;
}

.status-published {
  color: #145346;
  background: #dff4ee;
}

.status-draft {
  color: #674015;
  background: #fff0cf;
}

.status-review {
  color: #563152;
  background: #f4e1f0;
}

.status-approved {
  color: #1f4f69;
  background: #e1f1f5;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  /* Table is wider than narrow viewports (min-width below); this inset
     shadow hints there's more to scroll on either edge. */
  box-shadow: inset -16px 0 12px -12px rgba(0, 0, 0, 0.14), inset 16px 0 12px -12px rgba(0, 0, 0, 0.14);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: start;
  vertical-align: middle;
  line-height: 1.35;
}

th {
  color: var(--muted);
  background: #fbf4e7;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

body[dir="rtl"] th {
  text-transform: none;
}

tr:last-child td {
  border-bottom: 0;
}

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

.bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.2fr) 52px;
  gap: 10px;
  align-items: center;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  background: #eadfce;
  border-radius: 8px;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--maroon), var(--green));
  border-radius: 8px;
}

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

.qr-preview {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.qr-matrix {
  width: 140px;
  height: 140px;
  display: grid;
  grid-template-columns: repeat(21, 1fr);
  grid-template-rows: repeat(21, 1fr);
  padding: 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.qr-cell {
  border-radius: 1px;
}

.qr-cell.on {
  background: var(--ink);
}

.qr-cell.off {
  background: #fff;
}

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

.small {
  font-size: 0.82rem;
  line-height: 1.45;
}

.divider {
  height: 1px;
  margin: 18px 0;
  background: var(--line);
}

.footer-pad {
  height: 26px;
}

@media (max-width: 920px) {
  .hero-stats,
  .grid.three,
  .provider-grid {
    grid-template-columns: 1fr;
  }

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

  .media-panel {
    position: relative;
    top: auto;
  }

  .admin-shell {
    grid-template-columns: 1fr;
    /* Without an explicit row track, the implicit "auto" nav row shares
       leftover space from min-height via default grid stretch, ballooning
       the tab bar's height on pages whose main content is short (e.g.
       Settings). Pin the nav row to its content size and let main absorb
       all remaining height instead. */
    grid-template-rows: auto 1fr;
  }

  .admin-nav {
    position: static;
    height: auto;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    border-inline-end: 0;
    border-bottom: 1px solid var(--line);
  }

  .admin-nav button {
    width: auto;
    white-space: nowrap;
    margin: 0;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .brand-mark {
    flex: 1 1 100%;
  }

  .brand-subtitle {
    max-width: calc(100vw - 96px);
  }

  .top-actions {
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .text-button,
  .secondary-button,
  .primary-button,
  .ghost-button {
    padding: 0 11px;
  }

  .hero {
    min-height: calc(82vh - 75px);
  }

  .hero-inner {
    padding-top: 54px;
  }

  .section-heading h1 {
    max-width: 300px;
    font-size: 1.42rem;
    line-height: 1.16;
  }

  .stop-card {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .stop-card img {
    width: 92px;
  }

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

  .qr-preview {
    grid-template-columns: 1fr;
  }

  .section-heading {
    display: block;
  }
}

/* Visitor redesign: warm, guided, mobile-first experience. */
:root {
  --cream: #fff7eb;
  --peach: #ffd6b8;
  --coral: #e66f4d;
  --sun: #ffc94c;
  --sage: #d8eadb;
  --teal: #176f63;
  --blue: #427f97;
  --plum: #8a1538;
  --brown: #352820;
}

body {
  background:
    linear-gradient(90deg, rgba(138, 21, 56, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(23, 111, 99, 0.035) 1px, transparent 1px),
    var(--cream);
}

.topbar {
  background: rgba(255, 247, 235, 0.9);
}

.brand-symbol {
  background: var(--plum);
  box-shadow: 0 10px 24px rgba(138, 21, 56, 0.18);
}

.primary-button {
  min-height: 48px;
  padding: 0 20px;
  background: var(--plum);
  font-weight: 800;
}

.secondary-button,
.ghost-button,
.text-button,
.icon-button {
  background: rgba(255, 255, 255, 0.82);
}

.visitor-home,
.setup-screen,
.listening-screen {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 4vw, 42px);
}

.welcome-band {
  display: grid;
  grid-template-columns: minmax(0, 0.98fr) minmax(320px, 0.72fr);
  gap: clamp(18px, 4vw, 42px);
  align-items: center;
  min-height: calc(86vh - 80px);
}

.welcome-copy {
  min-width: 0;
  max-width: 700px;
}

.soft-kicker {
  width: fit-content;
  margin: 0 0 12px;
  padding: 7px 11px;
  color: var(--plum);
  background: #ffe7dc;
  border: 1px solid #f3bea6;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.2;
}

.welcome-copy h1,
.setup-hero h1,
.listen-copy h1 {
  margin: 0;
  color: var(--brown);
  font-size: clamp(2.8rem, 7vw, 6.3rem);
  line-height: 0.94;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.welcome-copy p,
.setup-hero p {
  max-width: 640px;
  margin: 20px 0 0;
  color: #5c4d43;
  font-size: clamp(1.06rem, 2vw, 1.25rem);
  line-height: 1.72;
  overflow-wrap: break-word;
}

.hero-actions {
  margin-top: 28px;
}

.visit-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
  min-height: 540px;
  border: 1px solid rgba(138, 21, 56, 0.18);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 28px 70px rgba(53, 40, 32, 0.16);
}

.visit-card img {
  width: 100%;
  height: 330px;
  object-fit: cover;
}

.visit-card-copy {
  padding: 20px;
}

.visit-card-copy span,
.stop-number {
  color: var(--plum);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

body[dir="rtl"] .visit-card-copy span,
body[dir="rtl"] .stop-number {
  text-transform: none;
}

.visit-card-copy strong {
  display: block;
  margin-top: 8px;
  color: var(--brown);
  font-size: 1.45rem;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.visit-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 20px 20px;
}

.visit-pills span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #e8d6c3;
  background: #fff7eb;
  border-radius: 8px;
  color: #5c4d43;
  font-size: 0.86rem;
  font-weight: 800;
}

.journey-section {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 4vw, 34px) 0 70px;
}

.journey-section.standalone {
  padding: clamp(24px, 5vw, 54px);
}

.journey-section .section-heading {
  align-items: end;
}

.journey-section .section-heading h1,
.journey-section .section-heading h2 {
  max-width: 760px;
  color: var(--brown);
  font-size: clamp(1.75rem, 3.7vw, 3.15rem);
}

.stop-list {
  gap: 16px;
}

.stop-card {
  grid-template-columns: 154px minmax(0, 1fr);
  min-height: 150px;
  background: rgba(255, 255, 255, 0.9);
  border-color: #ead7c4;
  box-shadow: 0 16px 34px rgba(53, 40, 32, 0.09);
}

.stop-card:hover {
  transform: translateY(-2px);
  border-color: #e7aa91;
}

.stop-card img {
  width: 154px;
}

.stop-copy {
  display: grid;
  align-content: center;
  padding: 18px 22px;
}

.stop-copy h3 {
  margin-top: 8px;
  color: var(--brown);
  font-size: clamp(1.08rem, 2vw, 1.42rem);
}

.stop-copy p {
  max-width: 680px;
  color: #68584c;
  font-size: 1rem;
}

.listen-link {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--plum);
  font-size: 0.9rem;
  font-weight: 850;
  line-height: 1.2;
}

.listen-link span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--brown);
  border-radius: 8px;
  font-size: 0.7rem;
  line-height: 1;
}

.setup-screen {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.1fr);
  gap: clamp(18px, 4vw, 42px);
  align-items: start;
  padding-bottom: 110px;
}

.setup-hero {
  position: sticky;
  top: 100px;
  padding: 28px;
  border: 1px solid #ead7c4;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(53, 40, 32, 0.1);
}

.setup-hero h1 {
  font-size: clamp(2rem, 4.2vw, 3.8rem);
}

.setup-stack {
  display: grid;
  gap: 16px;
}

.choice-block {
  padding: 18px;
  border: 1px solid #ead7c4;
  background: rgba(255, 255, 255, 0.84);
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(53, 40, 32, 0.08);
}

.chip {
  min-height: 44px;
  background: #fff;
  font-weight: 750;
}

.chip.active {
  background: var(--teal);
}

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

.mode-card {
  min-height: 150px;
  background: #fffaf4;
  border-color: #ead7c4;
  box-shadow: none;
}

.mode-card:nth-child(2) {
  background: #fff0e7;
}

.mode-card:nth-child(3) {
  background: #edf7ef;
}

.mode-card:nth-child(4) {
  background: #edf5fb;
}

.mode-card.active {
  border-color: var(--plum);
  box-shadow: 0 14px 32px rgba(138, 21, 56, 0.13);
}

.start-dock {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 30;
  width: min(680px, calc(100vw - 32px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  color: #6b5b50;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #ead7c4;
  border-radius: 8px;
  box-shadow: 0 18px 46px rgba(53, 40, 32, 0.18);
  transform: translateX(-50%);
  backdrop-filter: blur(14px);
}

.start-dock span {
  font-size: 0.84rem;
  line-height: 1.35;
}

.listening-screen {
  padding-bottom: 80px;
}

.listen-hero {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1fr);
  gap: clamp(18px, 4vw, 42px);
  align-items: center;
  min-height: calc(76vh - 80px);
}

.media-panel {
  position: static;
}

.media-panel img {
  aspect-ratio: 1 / 1;
  border: 1px solid #ead7c4;
  box-shadow: 0 28px 70px rgba(53, 40, 32, 0.15);
}

.audio-panel {
  background: #fff;
  border-color: #ead7c4;
  box-shadow: 0 14px 30px rgba(53, 40, 32, 0.08);
}

.listen-copy {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.listen-copy h1 {
  font-size: clamp(2.25rem, 5vw, 5.25rem);
}

.listen-copy > p {
  max-width: 600px;
  font-size: clamp(1.04rem, 2vw, 1.22rem);
  line-height: 1.7;
}

.prompt {
  max-width: 600px;
  margin-top: 22px;
  background: #fff0d1;
  border-inline-start-color: var(--sun);
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 640px;
  margin-top: 16px;
}

.trust-row span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  color: #5c4d43;
  background: #fff;
  border: 1px solid #ead7c4;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 800;
}

.listen-body {
  width: min(820px, 100%);
  margin: 0 auto;
}

.transcript {
  background: rgba(255, 255, 255, 0.92);
  border-color: #ead7c4;
}

.transcript h2 {
  color: var(--brown);
}

.transcript p {
  font-size: 1.05rem;
}

.source-note {
  padding: 16px;
  background: #eff8f5;
  border: 1px solid #d9e9e5;
  border-radius: 8px;
}

.source-note strong {
  display: block;
  color: var(--teal);
  font-size: 1rem;
  line-height: 1.35;
}

.source-note p {
  margin: 8px 0 0;
  color: #4d635e;
  font-size: 0.95rem;
  line-height: 1.55;
}

.custom-player {
  grid-template-columns: 56px minmax(0, 1fr) auto;
}

.play-toggle {
  width: 56px;
  height: 56px;
  background: var(--brown);
}

.progress-track {
  height: 12px;
  background: #eadfce;
}

@media (max-width: 920px) {
  .welcome-band,
  .setup-screen,
  .listen-hero {
    grid-template-columns: 1fr;
  }

  .welcome-band {
    min-height: auto;
  }

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

  .setup-hero {
    position: static;
  }
}

@media (max-width: 640px) {
  .visitor-home,
  .setup-screen,
  .listening-screen,
  .journey-section.standalone {
    padding: 18px;
  }

  .welcome-copy h1 {
    font-size: 3.15rem;
  }

  .setup-hero {
    overflow: hidden;
  }

  .setup-hero h1 {
    max-width: 290px;
    font-size: 1.58rem;
    line-height: 1.08;
    overflow-wrap: anywhere;
  }

  .welcome-copy p {
    font-size: 1rem;
  }

  .visit-card img {
    height: 220px;
  }

  .stop-card {
    grid-template-columns: 104px minmax(0, 1fr);
    min-height: 126px;
  }

  .stop-card img {
    width: 104px;
  }

  .stop-copy {
    padding: 13px 14px;
  }

  .stop-copy h3 {
    font-size: 1rem;
  }

  .stop-copy p {
    font-size: 0.88rem;
  }

  .listen-link {
    margin-top: 10px;
    font-size: 0.82rem;
  }

  .listen-link span {
    width: 24px;
    height: 24px;
  }

  .mode-strip {
    grid-template-columns: 1fr;
  }

  .start-dock {
    position: static;
    width: auto;
    display: grid;
    transform: none;
    margin-top: 16px;
  }

  .start-dock .primary-button {
    width: 100%;
  }

  .listen-copy h1 {
    max-width: none;
    font-size: 2.45rem;
  }

  .custom-player {
    grid-template-columns: 52px minmax(0, 1fr) auto;
  }

  .play-toggle {
    width: 52px;
    height: 52px;
  }
}

@media (max-width: 640px) {
  :root {
    --mobile-column: clamp(0px, calc(100vw - 36px), 340px);
  }

  html,
  body,
  .app-shell {
    max-width: 100%;
    overflow-x: hidden;
  }

  .visitor-home {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .welcome-band,
  .welcome-copy,
  .visit-card {
    width: var(--mobile-column) !important;
    max-width: var(--mobile-column) !important;
    min-width: 0;
    margin-left: 0 !important;
    margin-right: auto !important;
  }

  .welcome-band {
    display: flex;
    flex-direction: column;
  }

  .welcome-copy p,
  .welcome-copy h1,
  .visit-card-copy strong {
    width: var(--mobile-column) !important;
    max-width: var(--mobile-column) !important;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .visit-card img {
    width: var(--mobile-column) !important;
  }

  body[dir="rtl"] .topbar,
  body[dir="rtl"] .brand-mark,
  body[dir="rtl"] .top-actions {
    direction: ltr;
  }
}

/* Reference-app pass: visual discovery, focused listening, and mobile app navigation. */
.visitor-home,
.setup-screen,
.listening-screen,
.journey-section.standalone,
.completion {
  padding-bottom: 118px;
}

.topbar {
  min-height: 68px;
  background: rgba(255, 248, 238, 0.84);
}

.discovery-hero {
  grid-template-columns: minmax(0, 0.86fr) minmax(360px, 0.82fr);
  min-height: calc(82vh - 68px);
}

.discovery-hero .welcome-copy h1 {
  max-width: 780px;
  font-size: clamp(3.2rem, 8.2vw, 7.4rem);
  line-height: 0.9;
}

.discovery-hero .welcome-copy p {
  max-width: 560px;
}

.discovery-card {
  min-height: 590px;
  display: grid;
  grid-template-rows: minmax(330px, 1fr) auto auto;
  background: #fff;
}

.art-stack {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 201, 76, 0.24), rgba(23, 111, 99, 0.2)),
    #fff2dd;
}

.visit-card .art-stack-image {
  position: absolute;
  width: 68%;
  height: 76%;
  object-fit: cover;
  border: 1px solid rgba(73, 54, 43, 0.16);
  border-radius: 8px;
  box-shadow: 0 24px 58px rgba(53, 40, 32, 0.18);
}

.visit-card .art-stack-image.image-1 {
  left: 9%;
  top: 13%;
  z-index: 3;
}

.visit-card .art-stack-image.image-2 {
  right: -9%;
  top: 6%;
  z-index: 2;
  transform: rotate(3deg);
}

.visit-card .art-stack-image.image-3 {
  left: -15%;
  bottom: -6%;
  z-index: 1;
  transform: rotate(-4deg);
}

.visit-card-copy {
  padding: 22px 24px 14px;
}

.visit-card-copy p {
  margin: 10px 0 0;
  color: #66574c;
  line-height: 1.55;
}

.visit-pills {
  padding: 0 24px 24px;
}

.stop-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stop-card {
  grid-template-columns: 154px minmax(0, 1fr);
  min-height: 178px;
  background: #fffdf8;
  border-color: rgba(226, 198, 166, 0.95);
}

.stop-art {
  position: relative;
  display: block;
  min-height: 100%;
  overflow: hidden;
}

.stop-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stop-art span {
  position: absolute;
  left: 10px;
  top: 10px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #fff;
  background: rgba(53, 40, 32, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 900;
  backdrop-filter: blur(12px);
}

body[dir="rtl"] .stop-art span {
  left: auto;
  right: 10px;
}

.stop-copy {
  gap: 3px;
}

.stop-overline,
.stop-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.stop-overline {
  margin-bottom: 3px;
}

.stop-overline span,
.stop-meta-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 3px 8px;
  border: 1px solid rgba(138, 21, 56, 0.14);
  background: rgba(255, 247, 235, 0.78);
  border-radius: 8px;
  color: #735241;
  font-size: 0.75rem;
  font-weight: 850;
  line-height: 1.2;
}

.stop-overline span:first-child {
  color: var(--plum);
  background: rgba(138, 21, 56, 0.08);
}

.stop-meta-row {
  margin-top: 10px;
}

.stop-meta-row span {
  border-color: rgba(23, 111, 99, 0.16);
  background: rgba(216, 234, 219, 0.55);
  color: #315c50;
}

.stop-meta-row b {
  font-size: 0.78rem;
  line-height: 1;
}

.listen-link {
  padding: 6px 9px 6px 6px;
  border: 1px solid rgba(138, 21, 56, 0.18);
  background: #fff7eb;
  border-radius: 8px;
}

body[dir="rtl"] .listen-link {
  padding: 6px 6px 6px 9px;
}

.now-playing-screen {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: none;
  overflow: hidden;
}

.now-playing-screen::before {
  content: "";
  position: absolute;
  inset: -80px 0 auto;
  z-index: -2;
  height: 560px;
  background:
    linear-gradient(180deg, rgba(255, 247, 235, 0.06), var(--cream) 84%),
    var(--listen-image);
  background-size: cover;
  background-position: center;
  filter: blur(42px) saturate(0.9);
  transform: scale(1.08);
  opacity: 0.36;
}

.now-playing-stage {
  width: min(1120px, 100%);
  margin: 0 auto;
  grid-template-columns: minmax(280px, 0.84fr) minmax(0, 1.06fr);
}

.now-art img {
  aspect-ratio: 1 / 1;
  background: #fff;
  border: 1px solid rgba(226, 198, 166, 0.96);
  border-radius: 8px;
  box-shadow: 0 34px 90px rgba(53, 40, 32, 0.22);
}

.now-copy {
  padding: clamp(18px, 4vw, 34px);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(234, 215, 196, 0.92);
  box-shadow: 0 24px 68px rgba(53, 40, 32, 0.11);
  backdrop-filter: blur(16px);
}

.now-copy h1 {
  font-size: clamp(2.5rem, 5.8vw, 5.8rem);
}

.now-controls {
  max-width: 640px;
  margin: 22px 0 0;
  padding: 16px;
  background: #fff;
}

.now-controls .custom-player {
  grid-template-columns: 64px minmax(0, 1fr) auto;
}

.now-controls .play-toggle {
  width: 64px;
  height: 64px;
  background: var(--plum);
  box-shadow: 0 16px 34px rgba(138, 21, 56, 0.22);
}

.listen-body {
  width: min(860px, calc(100% - 36px));
}

.visitor-dock {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 60;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  width: min(520px, calc(100vw - 28px));
  padding: 6px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(226, 198, 166, 0.96);
  border-radius: 8px;
  box-shadow: 0 18px 54px rgba(53, 40, 32, 0.18);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
  direction: ltr;
}

.dock-item {
  min-width: 0;
  min-height: 54px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 6px 4px;
  color: #65574c;
  background: transparent;
  border-radius: 8px;
}

.dock-item span {
  font-size: 1.05rem;
  line-height: 1;
}

.dock-item strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dock-item.active {
  color: #fff;
  background: var(--brown);
}

@media (max-width: 1080px) {
  .stop-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .discovery-hero,
  .now-playing-stage {
    grid-template-columns: 1fr;
  }

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

  .now-copy {
    order: -1;
  }
}

@media (max-width: 640px) {
  :root {
    --mobile-column: min(calc(100vw - 72px), 320px);
  }

  .topbar {
    position: sticky;
    min-height: 120px;
  }

  .visitor-home,
  .setup-screen,
  .listening-screen,
  .journey-section.standalone,
  .completion {
    padding: 18px 18px 112px;
  }

  .discovery-hero,
  .welcome-copy,
  .discovery-card,
  .now-playing-stage,
  .now-copy,
  .now-art,
  .listen-body {
    width: var(--mobile-column) !important;
    max-width: var(--mobile-column) !important;
    min-width: 0;
    margin-left: 0 !important;
    margin-right: auto !important;
  }

  .discovery-hero .welcome-copy h1 {
    width: auto !important;
    max-width: 100% !important;
    font-size: clamp(2.55rem, 15vw, 3.55rem);
    line-height: 0.92;
  }

  .discovery-hero .welcome-copy p {
    width: auto !important;
    max-width: 100% !important;
  }

  .soft-kicker {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .art-stack {
    min-height: 246px;
  }

  .visit-card .art-stack-image {
    width: 73%;
    height: 76%;
  }

  .visit-card-copy,
  .visit-pills {
    padding-inline: 18px;
  }

  .visit-card-copy strong {
    width: auto !important;
    max-width: 100% !important;
    font-size: 1.28rem;
  }

  .stop-card {
    grid-template-columns: 112px minmax(0, 1fr);
    min-height: 148px;
  }

  .stop-copy {
    padding: 14px;
  }

  .stop-copy h3 {
    font-size: 1.02rem;
  }

  .stop-copy p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .listen-link {
    width: auto;
    max-width: 100%;
  }

  .now-copy {
    padding: 18px;
  }

  .now-copy h1 {
    font-size: clamp(2rem, 11vw, 2.85rem);
  }

  .now-controls .custom-player {
    grid-template-columns: 54px minmax(0, 1fr) auto;
  }

  .now-controls .play-toggle {
    width: 54px;
    height: 54px;
  }

  .visitor-dock {
    bottom: 12px;
    width: min(320px, calc(100vw - 52px));
  }
}

@media (min-width: 761px) and (max-width: 980px) {
  .visitor-home,
  .setup-screen,
  .listening-screen,
  .journey-section.standalone {
    width: min(920px, 100%);
    padding: 30px 34px 118px;
  }

  .welcome-band.discovery-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(286px, 348px);
    gap: 26px;
    align-items: start;
    width: 100%;
    min-height: 0;
    padding: 34px 0 64px;
  }

  .discovery-hero .welcome-copy {
    max-width: none;
  }

  .discovery-hero .welcome-copy h1 {
    max-width: 470px;
    font-size: clamp(3.3rem, 7vw, 4.45rem);
    line-height: 0.92;
  }

  .discovery-hero .welcome-copy p {
    max-width: 470px;
    margin-top: 18px;
  }

  .discovery-card {
    min-height: 512px;
    grid-template-rows: 306px auto auto;
    align-self: start;
  }

  .art-stack {
    min-height: 306px;
  }

  .visit-card-copy {
    padding: 18px 18px 12px;
  }

  .visit-card-copy strong {
    font-size: 1.24rem;
  }

  .visit-card-copy p {
    font-size: 0.92rem;
  }

  .visit-pills {
    padding: 0 18px 18px;
  }

  .journey-section {
    width: 100%;
    padding-top: 0;
  }

  .visitor-dock {
    display: none;
  }

  .listen-hero.now-playing-stage {
    display: grid;
    grid-template-columns: minmax(270px, 320px) minmax(0, 1fr);
    gap: 28px;
    align-items: center;
    width: 100%;
    min-height: calc(100vh - 176px);
  }

  .now-copy {
    order: 0;
    width: auto;
    padding: 26px;
  }

  .now-copy h1 {
    font-size: clamp(2.55rem, 5vw, 3.7rem);
  }

  .now-art {
    width: auto;
  }

  .now-art img {
    width: 100%;
  }

  .now-controls {
    max-width: none;
  }

  .listen-body {
    width: min(760px, 100%);
  }
}

@media (min-width: 761px) {
  .visitor-dock {
    display: none;
  }

  .visitor-home,
  .setup-screen,
  .listening-screen,
  .journey-section.standalone,
  .completion {
    padding-bottom: 64px;
  }
}

/* Dark mode: tuned for dim gallery spaces and full-app use. */
body[data-theme="dark"] {
  --maroon: #d64b72;
  --maroon-dark: #ff8faf;
  --ink: #f8efe6;
  --muted: #c9baad;
  --paper: #080706;
  --surface: #15100e;
  --surface-strong: #211815;
  --line: rgba(244, 216, 183, 0.18);
  --gold: #e4b864;
  --green: #68bda7;
  --copper: #d99364;
  --sky: #78aebc;
  --cream: #0b0908;
  --peach: #4a261f;
  --coral: #ef8a6b;
  --sun: #e7b94a;
  --sage: #182621;
  --teal: #74c7b2;
  --blue: #8dbccc;
  --plum: #d64b72;
  --brown: #f7eee4;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
  --soft-shadow: 0 14px 40px rgba(0, 0, 0, 0.34);
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 12%, rgba(138, 21, 56, 0.22), transparent 28%),
    radial-gradient(circle at 84% 4%, rgba(23, 111, 99, 0.18), transparent 26%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    var(--paper);
  background-size: auto, auto, 34px 34px, 34px 34px, auto;
}

body[data-theme="dark"] html,
html:has(body[data-theme="dark"]) {
  background: #080706;
}

body[data-theme="dark"] .topbar {
  background: rgba(10, 8, 7, 0.78);
  border-bottom-color: rgba(244, 216, 183, 0.14);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}

body[data-theme="dark"] .brand-symbol {
  background:
    linear-gradient(135deg, #d64b72, #6e1730 58%, #176f63);
  border-color: rgba(255, 255, 255, 0.18);
}

body[data-theme="dark"] .brand-wordmark {
  filter: invert(1);
}

body[data-theme="dark"] .brand-subtitle,
body[data-theme="dark"] .section-heading p,
body[data-theme="dark"] .muted,
body[data-theme="dark"] .player-time,
body[data-theme="dark"] .mode-card p,
body[data-theme="dark"] .source-card p,
body[data-theme="dark"] .admin-card p,
body[data-theme="dark"] .welcome-copy p,
body[data-theme="dark"] .setup-hero p,
body[data-theme="dark"] .visit-card-copy p,
body[data-theme="dark"] .stop-copy p,
body[data-theme="dark"] .listen-copy > p {
  color: var(--muted);
}

body[data-theme="dark"] .icon-button,
body[data-theme="dark"] .text-button,
body[data-theme="dark"] .secondary-button,
body[data-theme="dark"] .ghost-button,
body[data-theme="dark"] .chip,
body[data-theme="dark"] .rating-button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.065);
  border-color: var(--line);
}

body[data-theme="dark"] .theme-button {
  color: #ffd76d;
  background: rgba(255, 215, 109, 0.12);
}

body[data-theme="dark"] .primary-button,
body[data-theme="dark"] .admin-nav button.active,
body[data-theme="dark"] .rating-button.active {
  color: #fff;
  background: #b01646;
  border-color: #c93a64;
  box-shadow: 0 18px 38px rgba(176, 22, 70, 0.34);
}

body[data-theme="dark"] .soft-kicker,
body[data-theme="dark"] .hero-kicker {
  color: #ffd8c9;
  background: rgba(214, 75, 114, 0.14);
  border-color: rgba(239, 138, 107, 0.34);
}

body[data-theme="dark"] .welcome-copy h1,
body[data-theme="dark"] .setup-hero h1,
body[data-theme="dark"] .listen-copy h1,
body[data-theme="dark"] .journey-section .section-heading h1,
body[data-theme="dark"] .journey-section .section-heading h2,
body[data-theme="dark"] .transcript h1,
body[data-theme="dark"] .transcript h2,
body[data-theme="dark"] .visit-card-copy strong,
body[data-theme="dark"] .stop-copy h3,
body[data-theme="dark"] .mode-card h3,
body[data-theme="dark"] .panel h3,
body[data-theme="dark"] .admin-card h3,
body[data-theme="dark"] .source-card h3,
body[data-theme="dark"] .completion-card h1 {
  color: var(--ink);
}

body[data-theme="dark"] .visit-card,
body[data-theme="dark"] .discovery-card,
body[data-theme="dark"] .mode-card,
body[data-theme="dark"] .stop-card,
body[data-theme="dark"] .panel,
body[data-theme="dark"] .source-card,
body[data-theme="dark"] .admin-card,
body[data-theme="dark"] .answer-box,
body[data-theme="dark"] .transcript,
body[data-theme="dark"] .completion-card,
body[data-theme="dark"] .choice-block,
body[data-theme="dark"] .setup-hero,
body[data-theme="dark"] .now-copy,
body[data-theme="dark"] .audio-panel,
body[data-theme="dark"] .qr-matrix {
  color: var(--ink);
  background: rgba(24, 18, 15, 0.88);
  border-color: var(--line);
  box-shadow: var(--soft-shadow);
}

body[data-theme="dark"] .table-wrap {
  color: var(--ink);
  background: rgba(24, 18, 15, 0.88);
  border-color: var(--line);
  box-shadow:
    var(--soft-shadow),
    inset -16px 0 12px -12px rgba(0, 0, 0, 0.4),
    inset 16px 0 12px -12px rgba(0, 0, 0, 0.4);
}

body[data-theme="dark"] .discovery-card,
body[data-theme="dark"] .now-copy,
body[data-theme="dark"] .visitor-dock {
  background: rgba(20, 15, 13, 0.84);
  backdrop-filter: blur(18px);
}

body[data-theme="dark"] .art-stack {
  background:
    linear-gradient(135deg, rgba(228, 184, 100, 0.18), rgba(104, 189, 167, 0.16)),
    #15100e;
}

body[data-theme="dark"] .visit-card .art-stack-image,
body[data-theme="dark"] .stop-art img,
body[data-theme="dark"] .media-panel img,
body[data-theme="dark"] .now-art img {
  border-color: rgba(244, 216, 183, 0.2);
  filter: brightness(0.78) saturate(0.9);
}

body[data-theme="dark"] .stop-card {
  background: rgba(255, 255, 255, 0.045);
}

body[data-theme="dark"] .stop-card:hover {
  border-color: rgba(239, 138, 107, 0.58);
}

body[data-theme="dark"] .listen-link,
body[data-theme="dark"] .visit-pills span,
body[data-theme="dark"] .trust-row span,
body[data-theme="dark"] .status-pill,
body[data-theme="dark"] .stop-overline span,
body[data-theme="dark"] .stop-meta-row span {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
}

body[data-theme="dark"] .stop-overline span:first-child,
body[data-theme="dark"] .stop-meta-row span {
  color: #f7d9ad;
}

body[data-theme="dark"] .listen-link span,
body[data-theme="dark"] .play-toggle,
body[data-theme="dark"] .now-controls .play-toggle,
body[data-theme="dark"] .dock-item.active {
  color: #fff;
  background: #b01646;
}

body[data-theme="dark"] .prompt {
  color: #ffe8bd;
  background: rgba(231, 185, 74, 0.14);
  border-inline-start-color: var(--sun);
}

body[data-theme="dark"] .source-note {
  background: rgba(104, 189, 167, 0.12);
  border-color: rgba(104, 189, 167, 0.26);
}

body[data-theme="dark"] .source-note strong {
  color: #9be0cf;
}

body[data-theme="dark"] .source-note p {
  color: #c5ded7;
}

body[data-theme="dark"] .progress-track,
body[data-theme="dark"] .bar-track {
  background: rgba(255, 255, 255, 0.12);
}

body[data-theme="dark"] .progress-fill,
body[data-theme="dark"] .bar-fill {
  background: linear-gradient(90deg, #d64b72, #68bda7);
}

body[data-theme="dark"] .field,
body[data-theme="dark"] textarea.field,
body[data-theme="dark"] select.field {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
}

body[data-theme="dark"] .field::placeholder,
body[data-theme="dark"] textarea.field::placeholder {
  color: rgba(248, 239, 230, 0.54);
}

body[data-theme="dark"] .divider {
  background: var(--line);
}

body[data-theme="dark"] .admin-shell,
body[data-theme="dark"] .admin-nav {
  background: rgba(11, 9, 8, 0.62);
}

body[data-theme="dark"] .admin-nav {
  border-inline-end-color: var(--line);
}

body[data-theme="dark"] th {
  color: #daccc0;
  background: rgba(255, 255, 255, 0.055);
}

body[data-theme="dark"] td,
body[data-theme="dark"] th {
  border-bottom-color: var(--line);
}

body[data-theme="dark"] .status-published {
  color: #baf4e5;
  background: rgba(31, 107, 91, 0.35);
}

body[data-theme="dark"] .status-draft {
  color: #ffe3a4;
  background: rgba(214, 168, 92, 0.22);
}

body[data-theme="dark"] .status-review {
  color: #ffd0ec;
  background: rgba(138, 21, 56, 0.35);
}

body[data-theme="dark"] .status-approved {
  color: #c6eaf3;
  background: rgba(81, 123, 134, 0.34);
}

body[data-theme="dark"] .visitor-dock {
  border-color: rgba(244, 216, 183, 0.18);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.42);
}

body[data-theme="dark"] .dock-item {
  color: #cdbfb2;
}

body[data-theme="dark"] .now-playing-screen::before {
  opacity: 0.22;
}

body[data-theme="dark"] .notice {
  color: #ffe3bd;
  background: rgba(214, 168, 92, 0.12);
  border-color: rgba(214, 168, 92, 0.28);
}

/* Reference-led visitor refinements. */
.quick-entry {
  width: min(620px, 100%);
  margin-top: 24px;
  padding: 12px;
  color: var(--brown);
  background: rgba(255, 253, 248, 0.72);
  border: 1px solid rgba(226, 198, 166, 0.78);
  border-radius: 8px;
  box-shadow: 0 22px 58px rgba(53, 40, 32, 0.12);
  backdrop-filter: blur(18px);
}

.quick-entry-title {
  display: block;
  padding: 4px 6px 10px;
  color: var(--brown);
  font-size: 0.88rem;
  font-weight: 900;
  line-height: 1.25;
}

.quick-entry-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.quick-entry-actions button {
  min-width: 0;
  min-height: 96px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  padding: 14px;
  color: var(--brown);
  text-align: start;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(226, 198, 166, 0.88);
  border-radius: 8px;
}

.quick-entry-actions button:hover {
  transform: translateY(-1px);
  border-color: rgba(138, 21, 56, 0.34);
}

.quick-entry-actions strong {
  overflow-wrap: anywhere;
  font-size: 0.98rem;
  line-height: 1.14;
}

.quick-entry-actions span {
  color: #74665b;
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.3;
}

.route-proof {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 0 24px 16px;
}

.route-proof span {
  min-width: 0;
  padding: 12px;
  background: #fff7eb;
  border: 1px solid rgba(226, 198, 166, 0.92);
  border-radius: 8px;
}

.route-proof strong,
.route-proof small {
  display: block;
  overflow-wrap: anywhere;
}

.route-proof strong {
  color: var(--brown);
  font-size: 1.1rem;
  line-height: 1.1;
}

.route-proof small {
  margin-top: 4px;
  color: #74665b;
  font-size: 0.74rem;
  font-weight: 850;
  line-height: 1.2;
}

.mobile-visual-strip {
  display: none;
}

.mobile-now-art {
  display: none;
}

.setup-onboarding {
  overflow: hidden;
}

.setup-visual {
  position: relative;
  height: clamp(190px, 26vw, 290px);
  margin: -12px -12px 22px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 201, 76, 0.28), rgba(23, 111, 99, 0.18)),
    #fff2dd;
  border-radius: 8px;
}

.setup-visual-image {
  position: absolute;
  width: 64%;
  height: 72%;
  object-fit: cover;
  border: 1px solid rgba(73, 54, 43, 0.16);
  border-radius: 8px;
  box-shadow: 0 20px 48px rgba(53, 40, 32, 0.16);
}

.setup-visual-image.image-1 {
  left: 18%;
  top: 18%;
  z-index: 3;
}

.setup-visual-image.image-2 {
  right: -8%;
  top: 8%;
  z-index: 2;
  transform: rotate(4deg);
}

.setup-visual-image.image-3 {
  left: -12%;
  bottom: -10%;
  z-index: 1;
  transform: rotate(-5deg);
}

.setup-proof,
.source-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.setup-proof span,
.source-chip-row span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  color: #5c4d43;
  background: #fff7eb;
  border: 1px solid rgba(226, 198, 166, 0.92);
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1.2;
}

.guide-workspace {
  width: min(1120px, calc(100% - 36px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.62fr);
  gap: 18px;
  align-items: start;
}

.transcript-card,
.guide-panel {
  min-width: 0;
}

.guide-panel {
  padding: clamp(18px, 3vw, 26px);
  color: var(--brown);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #ead7c4;
  border-radius: 8px;
  box-shadow: 0 16px 38px rgba(53, 40, 32, 0.1);
}

.guide-panel h2 {
  margin: 0;
  color: var(--brown);
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  line-height: 1.08;
}

.guide-panel > .muted {
  margin: 12px 0 0;
  line-height: 1.55;
}

.guide-next {
  padding: 14px;
  background: #fff0d1;
  border: 1px solid rgba(231, 185, 74, 0.4);
  border-radius: 8px;
}

.guide-next span,
.guide-next strong {
  display: block;
}

.guide-next span {
  color: var(--plum);
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

body[dir="rtl"] .guide-next span {
  text-transform: none;
}

.guide-next strong {
  margin-top: 6px;
  color: var(--brown);
  line-height: 1.35;
}

body[data-theme="dark"] .quick-entry,
body[data-theme="dark"] .quick-entry-actions button,
body[data-theme="dark"] .route-proof span,
body[data-theme="dark"] .setup-proof span,
body[data-theme="dark"] .source-chip-row span,
body[data-theme="dark"] .guide-panel {
  color: var(--ink);
  background: rgba(24, 18, 15, 0.82);
  border-color: var(--line);
  box-shadow: var(--soft-shadow);
}

body[data-theme="dark"] .quick-entry-title,
body[data-theme="dark"] .quick-entry-actions strong,
body[data-theme="dark"] .route-proof strong,
body[data-theme="dark"] .guide-panel h2,
body[data-theme="dark"] .guide-next strong {
  color: var(--ink);
}

body[data-theme="dark"] .quick-entry-actions span,
body[data-theme="dark"] .route-proof small {
  color: var(--muted);
}

body[data-theme="dark"] .setup-visual {
  background:
    linear-gradient(135deg, rgba(228, 184, 100, 0.18), rgba(104, 189, 167, 0.16)),
    #15100e;
}

body[data-theme="dark"] .setup-visual-image {
  border-color: rgba(244, 216, 183, 0.2);
  filter: brightness(0.78) saturate(0.9);
}

body[data-theme="dark"] .guide-next {
  background: rgba(231, 185, 74, 0.14);
  border-color: rgba(231, 185, 74, 0.28);
}

body[data-theme="dark"] .guide-next span {
  color: #ffe8bd;
}

@media (max-width: 920px) {
  .quick-entry-actions,
  .guide-workspace {
    grid-template-columns: 1fr;
  }

  .quick-entry-actions button {
    min-height: 78px;
  }
}

@media (max-width: 640px) {
  :root {
    --mobile-column: min(calc(100vw - 28px), 362px);
  }

  .visitor-home,
  .setup-screen,
  .listening-screen,
  .journey-section.standalone,
  .completion {
    width: 100%;
    max-width: 100vw;
    padding: 16px 14px 112px;
  }

  .discovery-hero,
  .welcome-copy,
  .discovery-card,
  .setup-hero,
  .setup-stack,
  .now-playing-stage,
  .now-copy,
  .now-art,
  .listen-body,
  .guide-workspace {
    width: var(--mobile-column) !important;
    max-width: var(--mobile-column) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .quick-entry {
    width: 100%;
    margin-top: 20px;
    margin-bottom: 92px;
  }

  .mobile-visual-strip {
    position: relative;
    display: block;
    height: 118px;
    margin: 0 0 18px;
    overflow: hidden;
    background:
      linear-gradient(135deg, rgba(255, 201, 76, 0.2), rgba(23, 111, 99, 0.16)),
      #15100e;
    border: 1px solid rgba(244, 216, 183, 0.16);
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
  }

  .mobile-visual-image {
    position: absolute;
    width: 56%;
    height: 78%;
    object-fit: cover;
    border: 1px solid rgba(244, 216, 183, 0.2);
    border-radius: 8px;
    filter: brightness(0.82) saturate(0.9);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.26);
  }

  .mobile-visual-image.image-1 {
    left: 22%;
    top: 12%;
    z-index: 3;
  }

  .mobile-visual-image.image-2 {
    right: -8%;
    top: 6%;
    z-index: 2;
    transform: rotate(4deg);
  }

  .mobile-visual-image.image-3 {
    left: -11%;
    bottom: -8%;
    z-index: 1;
    transform: rotate(-5deg);
  }

  .mobile-now-art {
    display: block;
    margin: 0 0 16px;
  }

  .mobile-now-art img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border: 1px solid rgba(244, 216, 183, 0.18);
    border-radius: 8px;
    filter: brightness(0.82) saturate(0.9);
  }

  .quick-entry-actions {
    grid-template-columns: 1fr;
  }

  .quick-entry-actions button {
    min-height: 72px;
  }

  .route-proof {
    grid-template-columns: 1fr;
    padding: 0 18px 14px;
  }

  .setup-screen {
    display: grid;
    grid-template-columns: 1fr;
  }

  .setup-proof {
    gap: 6px;
  }

  .guide-workspace {
    display: grid;
    gap: 14px;
  }

  .guide-panel {
    padding: 18px;
  }

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

.route-tools {
  display: grid;
  gap: 14px;
  margin: 0 0 18px;
  padding: 16px;
  color: var(--ink);
  background: rgba(255, 250, 241, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

.route-tools-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.route-tools-header h2 {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  line-height: 1.12;
}

.route-result-count {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  color: var(--maroon-dark);
  background: #fff6e9;
  border: 1px solid #e5c892;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 850;
  white-space: nowrap;
}

.route-search-wrap {
  min-height: 52px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.route-search-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--muted);
}

.route-search-icon::before,
.route-search-icon::after {
  content: "";
  position: absolute;
  display: block;
}

.route-search-icon::before {
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-radius: 50%;
  transform: translate(-2px, -2px);
}

.route-search-icon::after {
  width: 8px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  transform: translate(6px, 7px) rotate(45deg);
}

.route-search-input {
  width: 100%;
  min-width: 0;
  height: 48px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

.route-search-input::placeholder {
  color: color-mix(in srgb, var(--muted) 74%, transparent);
}

.route-clear {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border-radius: 8px;
  font-size: 1.35rem;
  line-height: 1;
}

.route-clear:hover {
  color: var(--ink);
  background: rgba(138, 21, 56, 0.08);
}

.route-clear.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

.route-filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.route-filter-row::-webkit-scrollbar {
  display: none;
}

.route-filter-row .chip {
  flex: 0 0 auto;
}

.route-stop-list .stop-card[hidden],
.route-empty-state[hidden] {
  display: none;
}

.route-empty-state {
  padding: 22px;
  text-align: center;
  background: rgba(255, 250, 241, 0.9);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.route-empty-state strong,
.route-empty-state p {
  display: block;
  margin: 0;
}

.route-empty-state p {
  margin-top: 6px;
  color: var(--muted);
}

body[data-theme="dark"] .route-tools,
body[data-theme="dark"] .route-empty-state {
  color: var(--ink);
  background: rgba(24, 18, 15, 0.82);
  border-color: var(--line);
  box-shadow: var(--soft-shadow);
}

body[data-theme="dark"] .route-tools-header h2,
body[data-theme="dark"] .route-empty-state strong {
  color: var(--ink);
}

body[data-theme="dark"] .route-result-count {
  color: #ffe8bd;
  background: rgba(231, 185, 74, 0.12);
  border-color: rgba(231, 185, 74, 0.26);
}

body[data-theme="dark"] .route-search-wrap {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(244, 216, 183, 0.16);
}

body[data-theme="dark"] .route-search-input {
  color: var(--ink);
}

body[data-theme="dark"] .route-search-input::placeholder,
body[data-theme="dark"] .route-search-icon,
body[data-theme="dark"] .route-clear,
body[data-theme="dark"] .route-empty-state p {
  color: var(--muted);
}

body[data-theme="dark"] .route-clear:hover {
  color: var(--ink);
  background: rgba(244, 216, 183, 0.1);
}

@media (max-width: 640px) {
  .route-tools {
    width: var(--mobile-column);
    max-width: var(--mobile-column);
    margin-left: auto;
    margin-right: auto;
    padding: 14px;
  }

  .route-tools-header {
    align-items: start;
    flex-direction: column;
    gap: 10px;
  }

  .route-result-count {
    align-self: flex-start;
  }
}

@media (max-width: 640px) {
  .topbar {
    min-height: 58px;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 10px 14px;
  }

  .brand-mark {
    flex: 1 1 auto;
    min-width: 0;
    gap: 8px;
  }

  .brand-copy {
    min-width: 0;
    overflow: hidden;
  }

  .brand-symbol {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
  }

  .brand-wordmark {
    width: 112px;
    max-height: 24px;
  }

  .brand-title {
    display: block;
    max-width: 76px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem;
  }

  .brand-subtitle {
    display: none;
  }

  .top-actions {
    width: auto;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 6px;
    overflow: visible;
    padding-bottom: 0;
  }

  .icon-button {
    width: 36px;
    min-height: 36px;
    height: 36px;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }

  .hero-actions .primary-button,
  .hero-actions .ghost-button {
    min-width: 0;
    min-height: 46px;
    padding: 0 12px;
    white-space: normal;
  }

  .quick-entry {
    margin-bottom: 24px;
  }

  .journey-section.standalone > .section-heading {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .journey-section.standalone > .section-heading .secondary-button {
    width: fit-content;
    min-height: 38px;
  }

  .route-tools {
    gap: 12px;
  }

  .route-search-wrap {
    min-height: 50px;
    grid-template-columns: 30px minmax(0, 1fr) 30px;
    padding: 0 9px;
  }

  .route-search-icon,
  .route-clear {
    width: 30px;
    height: 30px;
  }

  .route-search-input {
    height: 46px;
    font-size: 0.94rem;
  }

  .route-filter-row {
    margin-inline: -2px;
    padding-bottom: 4px;
  }

  .route-filter-row .chip {
    min-height: 42px;
    padding-inline: 14px;
  }

  .route-stop-list .stop-card {
    grid-template-columns: 112px minmax(0, 1fr);
    min-height: 172px;
  }

  .route-stop-list .stop-card img {
    width: 112px;
  }

  .route-stop-list .stop-copy {
    display: grid;
    align-content: center;
    padding: 14px;
  }

  .route-stop-list .stop-copy h3 {
    font-size: 1rem;
  }

  .route-stop-list .stop-copy p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .visitor-dock {
    width: min(calc(100vw - 28px), 360px);
    bottom: 12px;
    padding: 8px;
  }

  .dock-item {
    min-height: 54px;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .visitor-home,
  .setup-screen,
  .listening-screen,
  .journey-section.standalone,
  .completion {
    padding-left: 24px;
    padding-right: 24px;
  }

  .discovery-hero {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.82fr);
    gap: 24px;
  }

  .welcome-copy h1 {
    font-size: clamp(3.8rem, 8.8vw, 5.8rem);
  }

  .route-tools {
    padding: 18px;
  }

  .route-stop-list .stop-card {
    grid-template-columns: 148px minmax(0, 1fr);
    min-height: 152px;
  }

  .route-stop-list .stop-card img {
    width: 148px;
  }

  .guide-workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-shell > .topbar {
    min-height: 58px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    padding: 10px 14px !important;
  }

  .app-shell > .topbar > .brand-mark {
    width: auto !important;
    max-width: calc(100vw - 156px) !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }

  .app-shell > .topbar .brand-copy {
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .app-shell > .topbar .brand-title {
    max-width: 82px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .app-shell > .topbar .brand-wordmark {
    width: 112px !important;
    max-width: 100% !important;
  }

  .app-shell > .topbar > .top-actions {
    width: auto !important;
    max-width: 132px !important;
    flex: 0 0 auto !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: flex-end !important;
    gap: 6px !important;
    overflow: visible !important;
    padding-bottom: 0 !important;
  }
}

.up-next-card {
  width: min(640px, 100%);
  display: grid;
  gap: 4px;
  margin: 12px 0 0;
  padding: 14px;
  color: var(--ink);
  text-align: start;
  background: rgba(255, 250, 241, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

.up-next-card:hover {
  transform: translateY(-1px);
  border-color: rgba(138, 21, 56, 0.36);
}

.up-next-card span {
  color: var(--maroon);
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.15;
  text-transform: uppercase;
}

body[dir="rtl"] .up-next-card span {
  text-transform: none;
}

.up-next-card strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.22;
}

.up-next-card small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body[data-theme="dark"] .up-next-card {
  color: var(--ink);
  background: rgba(24, 18, 15, 0.86);
  border-color: var(--line);
  box-shadow: var(--soft-shadow);
}

body[data-theme="dark"] .up-next-card span {
  color: #ffd8c9;
}

body[data-theme="dark"] .up-next-card strong {
  color: var(--ink);
}

body[data-theme="dark"] .up-next-card small {
  color: var(--muted);
}

@media (max-width: 920px) {
  .listening-screen.now-playing-screen {
    padding-bottom: 118px !important;
  }

  /* .now-controls docks as a fixed bar in this range; make sure whatever
     follows .listen-hero in the flow (the Companion/transcript drawer)
     always starts clear of it, regardless of how tall the hero's own
     columns render at a given viewport. */
  .listen-hero.now-playing-stage {
    margin-bottom: 150px !important;
  }

  .now-controls {
    position: fixed !important;
    left: 14px !important;
    right: 14px !important;
    bottom: 12px !important;
    z-index: 70 !important;
    width: auto !important;
    max-width: 560px !important;
    margin: 0 auto !important;
    padding: 10px 12px !important;
    background: rgba(255, 250, 241, 0.92) !important;
    border: 1px solid var(--line) !important;
    border-radius: 8px !important;
    box-shadow: 0 18px 54px rgba(0, 0, 0, 0.28) !important;
    backdrop-filter: blur(18px);
  }

  .now-controls .custom-player {
    grid-template-columns: 48px minmax(0, 1fr) auto !important;
    gap: 10px !important;
  }

  .now-controls .play-toggle {
    width: 48px !important;
    height: 48px !important;
  }

  .now-controls .player-time {
    font-size: 0.78rem;
  }

  .now-copy {
    padding-bottom: 18px !important;
    backdrop-filter: none !important;
  }
}

@media (max-width: 640px) {
  .up-next-card {
    width: 100%;
    margin-top: 10px;
    padding: 12px;
  }

  .up-next-card strong {
    font-size: 0.96rem;
  }

  .prompt {
    margin-top: 12px;
  }
}

@media (min-width: 641px) and (max-width: 920px) {
  .now-controls {
    left: 24px !important;
    right: 24px !important;
    bottom: 18px !important;
  }
}

body[data-theme="dark"] .now-controls {
  background: rgba(18, 13, 11, 0.92) !important;
  border-color: rgba(244, 216, 183, 0.18) !important;
}

/* Productized visitor pass: App Store/native reference synthesis. */
body[data-theme="dark"] {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    #080706 !important;
  background-size: 34px 34px, 34px 34px, auto !important;
}

.visitor-home,
.journey-section.standalone,
.listening-screen {
  scroll-behavior: smooth;
}

.topbar,
.topbar .brand-mark,
.topbar .top-actions {
  direction: ltr;
}

.topbar .brand-mark {
  min-width: 0;
}

.topbar .brand-copy {
  min-width: 0;
  overflow: hidden;
}

.visitor-topbar {
  overflow: hidden;
  position: sticky;
}

.visitor-topbar .top-actions {
  position: absolute !important;
  top: 50% !important;
  right: clamp(14px, 4vw, 40px) !important;
  flex: 0 0 auto;
  display: grid !important;
  grid-template-columns: repeat(3, 40px) !important;
  gap: 8px !important;
  width: 136px !important;
  max-width: 136px !important;
  transform: translateY(-50%);
}

.visitor-topbar .brand-mark {
  max-width: calc(100% - 156px);
}

.visitor-language-toggle,
.brand-language-toggle {
  z-index: 4;
  width: 34px;
  height: 30px;
  display: inline-grid;
  flex: 0 0 34px;
  place-items: center;
  color: #fff !important;
  background: #b01646 !important;
  border-color: #c93a64 !important;
  border: 1px solid #c93a64;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(176, 22, 70, 0.28);
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1;
}

.home-listen-card {
  width: min(560px, 100%);
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  padding: 10px;
  color: var(--brown);
  text-align: start;
  background: rgba(255, 253, 248, 0.84);
  border: 1px solid rgba(226, 198, 166, 0.84);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(53, 40, 32, 0.14);
  backdrop-filter: blur(18px);
}

.home-listen-card:hover,
.shelf-card:hover,
.route-featured-stop:hover {
  transform: translateY(-2px);
}

.home-listen-card img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
}

.home-listen-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.home-listen-copy small,
.shelf-card small,
.now-meta-row span,
.route-featured-stop span {
  color: var(--plum);
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

body[dir="rtl"] .home-listen-copy small,
body[dir="rtl"] .shelf-card small,
body[dir="rtl"] .now-meta-row span,
body[dir="rtl"] .route-featured-stop span {
  text-transform: none;
}

.home-listen-copy strong {
  overflow: hidden;
  color: var(--brown);
  font-size: 1.04rem;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-listen-copy em {
  display: -webkit-box;
  overflow: hidden;
  color: #6d5f55;
  font-size: 0.84rem;
  font-style: normal;
  line-height: 1.32;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.home-play-dot {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--plum);
  border-radius: 8px;
  box-shadow: 0 14px 28px rgba(138, 21, 56, 0.24);
}

.today-shelf {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 0 0 clamp(20px, 4vw, 42px);
}

.today-shelf .section-heading {
  margin-bottom: 14px;
}

.shelf-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.shelf-card {
  min-width: 0;
  display: grid;
  gap: 9px;
  padding: 10px;
  color: var(--brown);
  text-align: start;
  background: rgba(255, 253, 248, 0.88);
  border: 1px solid rgba(226, 198, 166, 0.86);
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(53, 40, 32, 0.1);
}

.shelf-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 8px;
}

.shelf-card span {
  color: var(--brown);
  font-size: 1.02rem;
  font-weight: 900;
  line-height: 1.16;
}

.shelf-card small {
  display: -webkit-box;
  overflow: hidden;
  color: #706359;
  font-weight: 750;
  text-transform: none;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.route-hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
  padding: clamp(18px, 3vw, 28px);
  color: var(--brown);
  background: rgba(255, 253, 248, 0.9);
  border: 1px solid rgba(226, 198, 166, 0.9);
  border-radius: 8px;
  box-shadow: 0 20px 56px rgba(53, 40, 32, 0.12);
}

.route-hero-card h1 {
  max-width: 720px;
  margin: 0;
  color: var(--brown);
  font-size: clamp(2rem, 4.4vw, 4.6rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.route-hero-card p {
  max-width: 620px;
  margin: 14px 0 0;
  color: #66584e;
  font-size: 1.03rem;
  line-height: 1.55;
}

.route-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.route-featured-stop {
  min-width: 0;
  display: grid;
  align-content: end;
  gap: 8px;
  padding: 12px;
  color: #fff;
  text-align: start;
  overflow: hidden;
  isolation: isolate;
  position: relative;
  border: 1px solid rgba(226, 198, 166, 0.6);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(53, 40, 32, 0.15);
}

.route-featured-stop::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, transparent 22%, rgba(24, 18, 15, 0.9));
}

.route-featured-stop img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.route-featured-stop span {
  color: #ffe1bf;
}

.route-featured-stop strong {
  font-size: 1.35rem;
  line-height: 1.1;
}

.now-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.now-meta-row span {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  color: #784458;
  background: #fff2e6;
  border: 1px solid rgba(226, 198, 166, 0.9);
  border-radius: 8px;
}

.listen-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.listen-tabs button {
  min-height: 38px;
  padding: 0 12px;
  color: var(--brown);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(226, 198, 166, 0.86);
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 850;
}

.home-explore-row {
  display: flex;
  gap: 8px;
  width: min(560px, 100%);
  margin-top: 18px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.home-explore-row::-webkit-scrollbar {
  display: none;
}

.home-explore-row button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 13px;
  color: var(--brown);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(226, 198, 166, 0.86);
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 850;
}

.home-explore-row button:first-child {
  color: #fff;
  background: var(--plum);
  border-color: var(--plum);
}

.source-start-card,
.source-notebook-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  text-align: start;
  color: var(--brown);
  background: rgba(255, 253, 248, 0.8);
  border: 1px solid rgba(226, 198, 166, 0.84);
  border-radius: 8px;
}

.source-start-card {
  width: min(560px, 100%);
  margin-top: 10px;
  padding: 12px;
  box-shadow: 0 14px 36px rgba(53, 40, 32, 0.1);
}

.source-start-card:hover {
  transform: translateY(-1px);
}

.source-start-card small,
.source-notebook-card strong,
.suggested-questions > span {
  display: block;
  color: var(--plum);
  font-size: 0.74rem;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

body[dir="rtl"] .source-start-card small,
body[dir="rtl"] .source-notebook-card strong,
body[dir="rtl"] .suggested-questions > span {
  text-transform: none;
}

.source-start-card strong {
  display: block;
  margin-top: 3px;
  color: var(--brown);
  font-size: 0.96rem;
  line-height: 1.22;
}

.source-start-icon {
  position: relative;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(138, 21, 56, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(214, 168, 92, 0.28), rgba(31, 107, 91, 0.14)),
    #fff7eb;
}

.source-start-icon::before,
.source-start-icon::after {
  content: "";
  position: absolute;
  border: 2px solid var(--plum);
  border-radius: 3px;
}

.source-start-icon::before {
  width: 17px;
  height: 19px;
  left: 9px;
  top: 11px;
}

.source-start-icon::after {
  width: 17px;
  height: 19px;
  left: 16px;
  top: 8px;
  background: rgba(255, 255, 255, 0.34);
}

.source-notebook-card {
  margin-top: 14px;
  padding: 12px;
}

.source-notebook-card p {
  margin: 4px 0 0;
  color: #6d5f55;
  font-size: 0.88rem;
  line-height: 1.38;
}

.suggested-questions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.suggested-questions > span {
  width: 100%;
}

.suggested-questions button {
  min-height: 36px;
  padding: 0 10px;
  color: var(--brown);
  background: #fff7eb;
  border: 1px solid rgba(226, 198, 166, 0.9);
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 800;
}

body[data-theme="dark"] .home-listen-card,
body[data-theme="dark"] .quick-entry,
body[data-theme="dark"] .quick-entry-actions button,
body[data-theme="dark"] .shelf-card,
body[data-theme="dark"] .route-hero-card,
body[data-theme="dark"] .route-tools,
body[data-theme="dark"] .now-meta-row span,
body[data-theme="dark"] .listen-tabs button,
body[data-theme="dark"] .home-explore-row button,
body[data-theme="dark"] .source-start-card,
body[data-theme="dark"] .source-notebook-card,
body[data-theme="dark"] .suggested-questions button {
  color: var(--ink);
  background: rgba(22, 17, 15, 0.86);
  border-color: rgba(244, 216, 183, 0.16);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.32);
}

body[data-theme="dark"] .home-explore-row button:first-child {
  color: #fff;
  background: #b01646;
  border-color: #c93a64;
}

body[data-theme="dark"] .home-listen-copy strong,
body[data-theme="dark"] .shelf-card span,
body[data-theme="dark"] .route-hero-card h1,
body[data-theme="dark"] .source-start-card strong {
  color: var(--ink);
}

body[data-theme="dark"] .home-listen-copy em,
body[data-theme="dark"] .shelf-card small,
body[data-theme="dark"] .route-hero-card p,
body[data-theme="dark"] .source-notebook-card p {
  color: var(--muted);
}

body[data-theme="dark"] .home-play-dot {
  background: #b01646;
}

body[data-theme="dark"] .home-listen-copy small,
body[data-theme="dark"] .now-meta-row span,
body[data-theme="dark"] .source-start-card small,
body[data-theme="dark"] .source-notebook-card strong,
body[data-theme="dark"] .suggested-questions > span {
  color: #ffd8c9;
}

body[data-theme="dark"] .source-start-icon {
  background:
    linear-gradient(135deg, rgba(228, 184, 100, 0.16), rgba(104, 189, 167, 0.12)),
    rgba(255, 255, 255, 0.06);
  border-color: rgba(244, 216, 183, 0.16);
}

body[data-theme="dark"] .source-start-icon::before,
body[data-theme="dark"] .source-start-icon::after {
  border-color: #ffd8c9;
}

body[data-theme="dark"] .shelf-card img,
body[data-theme="dark"] .home-listen-card img,
body[data-theme="dark"] .route-featured-stop img {
  filter: brightness(0.82) saturate(0.92);
}

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

  .route-featured-stop {
    min-height: 220px;
  }

  .shelf-row {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .shelf-row::-webkit-scrollbar {
    display: none;
  }

  .shelf-card {
    width: min(76vw, 300px);
    flex: 0 0 auto;
    scroll-snap-align: start;
  }
}

@media (min-width: 641px) and (max-width: 820px) {
  .welcome-band.discovery-hero {
    grid-template-columns: 1fr !important;
    min-height: 0;
  }

  .discovery-hero .welcome-copy h1 {
    max-width: 640px;
    font-size: clamp(3rem, 8.8vw, 4.6rem);
  }

  .discovery-card {
    width: min(560px, 100%);
    margin-inline: auto;
  }

  .today-shelf,
  .journey-section {
    width: min(705px, 100%);
  }
}

@media (min-width: 641px) and (max-width: 920px) {
  .quick-entry-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .quick-entry-actions button {
    min-height: 92px;
  }

  .listen-hero.now-playing-stage {
    grid-template-columns: minmax(260px, 300px) minmax(0, 1fr) !important;
    gap: 24px !important;
  }

  .now-copy {
    min-width: 0;
  }

  .now-copy h1 {
    font-size: clamp(2rem, 4.9vw, 2.75rem) !important;
    line-height: 1.02;
  }

  .now-copy > p {
    font-size: 0.96rem;
    line-height: 1.5;
  }
}

@media (max-width: 640px) {
  :root {
    --mobile-column: min(calc(100vw - 28px), 366px) !important;
  }

  .visitor-home,
  .setup-screen,
  .listening-screen,
  .journey-section.standalone,
  .completion {
    width: 100% !important;
    max-width: 100vw !important;
    padding: 14px 14px 112px !important;
  }

  .discovery-hero,
  .welcome-copy,
  .discovery-card,
  .today-shelf,
  .journey-section,
  .route-hero-card,
  .route-tools,
  .stop-list,
  .now-playing-stage,
  .now-copy,
  .now-art,
  .listen-body,
  .guide-workspace {
    width: var(--mobile-column) !important;
    max-width: var(--mobile-column) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .topbar {
    min-height: 58px !important;
  }

  .discovery-hero {
    padding-top: 10px;
  }

  .discovery-hero .welcome-copy h1 {
    font-size: clamp(2.7rem, 13.6vw, 3.8rem) !important;
    line-height: 0.92 !important;
  }

  .discovery-hero .welcome-copy p {
    margin-top: 16px;
    font-size: 1rem;
    line-height: 1.58;
  }

  .home-listen-card {
    grid-template-columns: 64px minmax(0, 1fr) 38px;
    gap: 10px;
    margin-top: 18px;
  }

  .home-explore-row {
    margin-top: 16px;
  }

  .home-listen-card img {
    width: 64px;
    height: 64px;
  }

  .home-play-dot {
    width: 38px;
    height: 38px;
  }

  .quick-entry {
    margin-top: 14px !important;
    margin-bottom: 22px !important;
    padding: 10px;
  }

  .quick-entry-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .quick-entry-actions button {
    min-height: 82px;
    padding: 11px 8px;
  }

  .quick-entry-actions strong {
    font-size: 0.88rem;
  }

  .quick-entry-actions span {
    font-size: 0.72rem;
  }

  .today-shelf {
    padding-bottom: 22px;
  }

  .today-shelf .section-heading {
    display: flex;
    align-items: end;
    gap: 10px;
  }

  .today-shelf .section-heading h2 {
    font-size: 1.25rem;
  }

  .today-shelf .text-button {
    min-height: 36px;
    padding-inline: 10px;
    white-space: nowrap;
  }

  .shelf-card {
    width: 260px;
  }

  .journey-section {
    padding-bottom: 28px;
  }

  .route-hero-card {
    padding: 16px;
    gap: 12px;
  }

  .route-hero-card h1 {
    font-size: clamp(1.72rem, 8.6vw, 2.55rem);
    line-height: 0.98;
  }

  .route-hero-card p {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 10px;
    font-size: 0.95rem;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .route-hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 14px;
  }

  .route-hero-actions .primary-button,
  .route-hero-actions .secondary-button {
    width: 100%;
    min-height: 44px;
    padding-inline: 10px;
    font-size: 0.9rem;
    white-space: normal;
  }

  .route-featured-stop {
    min-height: 132px;
  }

  .route-featured-stop strong {
    font-size: 1.05rem;
  }

  .route-stop-list .stop-card,
  .stop-list .stop-card {
    grid-template-columns: 104px minmax(0, 1fr) !important;
    min-height: 146px;
  }

  .stop-copy {
    padding: 13px !important;
  }

  .listen-link {
    margin-top: 8px;
  }

  .now-meta-row {
    gap: 6px;
  }

  .now-meta-row span {
    min-height: 30px;
    padding-inline: 8px;
    font-size: 0.68rem;
  }

  .listen-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .listen-tabs button {
    min-width: 0;
    padding-inline: 6px;
    font-size: 0.78rem;
  }

  .guide-workspace {
    gap: 14px;
  }

  .now-controls {
    max-width: var(--mobile-column) !important;
  }

  .source-start-card {
    grid-template-columns: 38px minmax(0, 1fr);
    padding: 10px;
  }

  .source-start-icon {
    width: 38px;
    height: 38px;
  }
}

/* Android reference pass: Smartify/Bloomberg/Google Arts/NotebookLM patterns. */
.qr-search-entry {
  width: min(560px, 100%);
  min-height: 58px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 10px 12px;
  color: var(--brown);
  text-align: start;
  background: rgba(255, 253, 248, 0.88);
  border: 1px solid rgba(226, 198, 166, 0.9);
  border-radius: 8px;
  box-shadow: 0 16px 42px rgba(53, 40, 32, 0.12);
  backdrop-filter: blur(18px);
}

.qr-search-entry:hover {
  transform: translateY(-1px);
  border-color: rgba(138, 21, 56, 0.34);
}

.qr-search-entry > span:not(.route-search-icon) {
  min-width: 0;
  color: #594c43;
  font-size: 0.96rem;
  font-weight: 800;
  line-height: 1.25;
}

.qr-search-entry strong {
  min-width: 42px;
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: var(--brown);
  border-radius: 8px;
  font-size: 0.84rem;
  line-height: 1;
}

.route-suggestion-row {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.route-suggestion-row::-webkit-scrollbar {
  display: none;
}

.route-suggestion-row > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

body[dir="rtl"] .route-suggestion-row > span {
  text-transform: none;
}

.route-suggestion-row button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 12px;
  color: var(--brown);
  background: #fff7eb;
  border: 1px solid rgba(226, 198, 166, 0.92);
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 850;
}

.route-suggestion-row button:hover {
  transform: translateY(-1px);
  border-color: rgba(138, 21, 56, 0.34);
}

.onboarding-progress {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin: 0 0 18px;
}

.onboarding-progress span {
  width: 8px;
  height: 8px;
  background: rgba(53, 40, 32, 0.28);
  border-radius: 999px;
}

.onboarding-progress span.active {
  width: 34px;
  background: var(--brown);
}

.custom-player,
.now-controls .custom-player {
  grid-template-columns: 1fr !important;
  gap: 12px;
}

.player-main-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.player-action-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.player-action-row.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.player-action-row button {
  min-width: 0;
  min-height: 42px;
  padding: 0 10px;
  color: var(--brown);
  background: #fff7eb;
  border: 1px solid rgba(226, 198, 166, 0.92);
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 850;
  white-space: normal;
}

/* Seek labels ("+10"/"−10") are LTR numeral+sign tokens; isolate them so
   an RTL document context doesn't flip the sign to the trailing side. */
.player-action-row button[data-action="seek-audio"] {
  direction: ltr;
  unicode-bidi: isolate;
}

.player-action-row button:hover {
  transform: translateY(-1px);
  border-color: rgba(138, 21, 56, 0.34);
}

.now-controls .player-main-row {
  grid-template-columns: 64px minmax(0, 1fr) auto;
}

body[data-theme="dark"] .qr-search-entry,
body[data-theme="dark"] .route-suggestion-row button,
body[data-theme="dark"] .player-action-row button {
  color: var(--ink);
  background: rgba(24, 18, 15, 0.86);
  border-color: rgba(244, 216, 183, 0.16);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.32);
}

body[data-theme="dark"] .qr-search-entry > span:not(.route-search-icon),
body[data-theme="dark"] .route-suggestion-row > span {
  color: var(--muted);
}

body[data-theme="dark"] .qr-search-entry strong,
body[data-theme="dark"] .onboarding-progress span.active {
  color: #fff;
  background: #b01646;
}

body[data-theme="dark"] .onboarding-progress span {
  background: rgba(244, 216, 183, 0.22);
}

body[data-theme="dark"] .player-action-row button:hover,
body[data-theme="dark"] .route-suggestion-row button:hover {
  border-color: rgba(255, 216, 201, 0.34);
}

@media (max-width: 640px) {
  .qr-search-entry {
    min-height: 56px;
    grid-template-columns: 30px minmax(0, 1fr) 38px;
    margin-top: 16px;
    padding: 9px 10px;
  }

  .qr-search-entry > span:not(.route-search-icon) {
    font-size: 0.9rem;
  }

  .qr-search-entry strong {
    min-width: 38px;
    min-height: 32px;
  }

  .route-suggestion-row {
    margin-inline: -2px;
  }

  .route-suggestion-row button {
    min-height: 40px;
    padding-inline: 12px;
  }

  .setup-onboarding {
    padding: 18px;
  }

  .onboarding-progress {
    margin-bottom: 14px;
  }

  .start-dock {
    grid-template-columns: 1fr;
  }

  .player-main-row,
  .now-controls .player-main-row {
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: 9px;
  }

  .player-action-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .player-action-row button {
    min-height: 38px;
    padding-inline: 6px;
    font-size: 0.72rem;
  }
}

@media (max-width: 640px) {
  .visitor-home,
  .setup-screen,
  .listening-screen,
  .journey-section.standalone,
  .completion {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .discovery-hero,
  .today-shelf,
  .journey-section,
  .route-hero-card,
  .route-tools,
  .stop-list,
  .setup-hero,
  .setup-stack,
  .now-playing-stage,
  .now-copy,
  .listen-body,
  .guide-workspace {
    width: calc(100vw - 28px) !important;
    max-width: calc(100vw - 28px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .welcome-copy,
  .discovery-card,
  .mobile-visual-strip,
  .home-explore-row,
  .home-listen-card,
  .source-start-card,
  .quick-entry,
  .qr-search-entry,
  .welcome-copy p,
  .welcome-copy h1 {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .hero-actions {
    width: 100% !important;
    grid-template-columns: 1fr !important;
  }

  .discovery-hero .welcome-copy h1 {
    font-size: clamp(2.35rem, 10.8vw, 3rem) !important;
    line-height: 0.96 !important;
  }

  .route-hero-card h1 {
    font-size: clamp(1.55rem, 7.8vw, 2.1rem) !important;
    line-height: 1.05 !important;
  }

  .route-hero-card p {
    overflow-wrap: anywhere !important;
    -webkit-line-clamp: 4 !important;
  }

  .route-hero-actions {
    grid-template-columns: 1fr !important;
  }

  .visitor-dock {
    width: calc(100vw - 24px) !important;
  }

  .route-hero-card,
  .route-tools,
  .route-stop-list,
  .setup-hero,
  .setup-stack {
    width: calc(100vw - 48px) !important;
    max-width: calc(100vw - 48px) !important;
  }

  .route-stop-list {
    grid-template-columns: 1fr !important;
  }

  .stop-list {
    grid-template-columns: 1fr !important;
  }

  .setup-hero p {
    overflow-wrap: anywhere !important;
  }

  .setup-proof {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .setup-proof::-webkit-scrollbar {
    display: none;
  }

  .setup-proof span {
    flex: 0 0 auto;
  }

  .setup-hero,
  .setup-stack {
    width: min(360px, calc(100vw - 48px)) !important;
    max-width: min(360px, calc(100vw - 48px)) !important;
  }

  .setup-hero p,
  .setup-hero h1 {
    max-width: 100% !important;
  }

  .now-playing-stage,
  .now-copy,
  .listen-body,
  .guide-workspace {
    width: min(360px, calc(100vw - 48px)) !important;
    max-width: min(360px, calc(100vw - 48px)) !important;
  }

  .listen-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .listen-tabs::-webkit-scrollbar {
    display: none;
  }

  .listen-tabs button {
    min-width: 0;
    flex: 1 1 0;
  }

  .now-controls {
    left: 24px !important;
    right: 24px !important;
    max-width: none !important;
  }

  .player-main-row,
  .now-controls .player-main-row {
    grid-template-columns: 52px minmax(0, 1fr) !important;
    grid-template-rows: auto auto;
  }

  .player-main-row .play-toggle {
    grid-row: 1 / span 2;
  }

  .player-main-row .player-time {
    grid-column: 2;
    justify-self: end;
    font-size: 0.72rem;
  }
}

/* Logged-in reference pass: clearer app home and route discovery. */
.home-progress-card {
  width: min(560px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  padding: 14px;
  color: var(--brown);
  text-align: start;
  background:
    linear-gradient(135deg, rgba(255, 201, 76, 0.18), rgba(23, 111, 99, 0.12)),
    rgba(255, 253, 248, 0.9);
  border: 1px solid rgba(226, 198, 166, 0.9);
  border-radius: 8px;
  box-shadow: 0 20px 52px rgba(53, 40, 32, 0.13);
  backdrop-filter: blur(18px);
}

.home-progress-card:hover,
.home-category-tile:hover,
.route-category-tile:hover {
  transform: translateY(-2px);
}

.home-progress-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.home-progress-copy small,
.home-category-tile span,
.route-category-tile span,
.route-program-meta span {
  color: var(--plum);
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

body[dir="rtl"] .home-progress-copy small,
body[dir="rtl"] .home-category-tile span,
body[dir="rtl"] .route-category-tile span,
body[dir="rtl"] .route-program-meta span {
  text-transform: none;
}

.home-progress-copy strong {
  color: var(--brown);
  font-size: 1.12rem;
  line-height: 1.14;
  overflow-wrap: anywhere;
}

.home-progress-copy em {
  display: -webkit-box;
  overflow: hidden;
  color: #6d5f55;
  font-size: 0.86rem;
  font-style: normal;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.home-category-grid,
.route-category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.home-category-grid {
  width: min(620px, 100%);
  margin-top: 16px;
}

.route-category-grid {
  margin: 0 0 18px;
}

.home-category-tile,
.route-category-tile {
  min-width: 0;
  min-height: 116px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  padding: 14px;
  color: var(--brown);
  text-align: start;
  background: rgba(255, 253, 248, 0.88);
  border: 1px solid rgba(226, 198, 166, 0.88);
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(53, 40, 32, 0.1);
}

.home-category-tile strong,
.route-category-tile strong {
  color: var(--brown);
  font-size: 1rem;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.home-category-tile small,
.route-category-tile small {
  display: -webkit-box;
  overflow: hidden;
  color: #706359;
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.home-category-tile span,
.route-category-tile span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--plum);
  border-radius: 8px;
}

.tone-teal span {
  background: var(--teal);
}

.tone-gold span {
  color: #3a2c22;
  background: var(--sun);
}

.tone-blue span {
  background: var(--blue);
}

.route-program-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.route-program-meta span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  color: #784458;
  background: #fff2e6;
  border: 1px solid rgba(226, 198, 166, 0.9);
  border-radius: 8px;
}

body[data-theme="dark"] .home-progress-card,
body[data-theme="dark"] .home-category-tile,
body[data-theme="dark"] .route-category-tile,
body[data-theme="dark"] .route-program-meta span {
  color: var(--ink);
  background: rgba(22, 17, 15, 0.88);
  border-color: rgba(244, 216, 183, 0.16);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.32);
}

body[data-theme="dark"] .home-progress-copy strong,
body[data-theme="dark"] .home-category-tile strong,
body[data-theme="dark"] .route-category-tile strong {
  color: var(--ink);
}

body[data-theme="dark"] .home-progress-copy em,
body[data-theme="dark"] .home-category-tile small,
body[data-theme="dark"] .route-category-tile small {
  color: var(--muted);
}

body[data-theme="dark"] .home-progress-copy small,
body[data-theme="dark"] .route-program-meta span {
  color: #ffd8c9;
}

@media (max-width: 920px) {
  .home-category-grid,
  .route-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .home-progress-card,
  .home-category-grid {
    width: 100% !important;
    max-width: 100% !important;
  }

  .home-progress-card {
    grid-template-columns: minmax(0, 1fr) 42px;
    margin-top: 18px;
    padding: 12px;
  }

  .home-progress-copy strong {
    font-size: 1rem;
  }

  .home-progress-copy em {
    font-size: 0.8rem;
  }

  .home-category-grid,
  .route-category-grid {
    gap: 8px;
  }

  .home-category-tile,
  .route-category-tile {
    min-height: 106px;
    padding: 12px;
  }

  .home-category-tile span,
  .route-category-tile span {
    width: 32px;
    height: 32px;
  }

  .home-category-tile strong,
  .route-category-tile strong {
    font-size: 0.94rem;
  }

  .home-category-tile small,
  .route-category-tile small {
    font-size: 0.72rem;
  }

  .route-program-meta {
    gap: 6px;
  }

  .route-program-meta span {
    min-height: 30px;
    padding-inline: 8px;
    font-size: 0.68rem;
  }

  .app-shell > .visitor-topbar > .top-actions {
    width: 120px !important;
    max-width: 120px !important;
    flex: 0 0 120px !important;
    display: grid !important;
    grid-template-columns: repeat(3, 36px) !important;
    gap: 6px !important;
  }

  .app-shell > .visitor-topbar > .brand-mark {
    max-width: calc(100vw - 176px) !important;
  }

  .app-shell > .visitor-topbar .icon-button {
    width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;
  }

  .now-copy {
    overflow: hidden;
  }

  .now-copy h1 {
    max-width: 100% !important;
    font-size: clamp(1.9rem, 8.8vw, 2.35rem) !important;
    line-height: 1.04 !important;
    overflow-wrap: break-word;
  }

  .now-controls {
    left: 16px !important;
    right: auto !important;
    width: min(360px, calc(100vw - 64px)) !important;
    max-width: min(360px, calc(100vw - 64px)) !important;
    overflow: hidden;
    box-sizing: border-box;
  }

  .player-main-row .player-time {
    max-width: 100%;
    justify-self: start !important;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .player-action-row button {
    font-size: 0.68rem !important;
  }
}

/* Bloomberg/Smartify-inspired visitor map and directions. */
.map-hero-card,
.map-route-card,
.map-stop-row {
  box-sizing: border-box;
  color: var(--brown);
  background: rgba(255, 253, 248, 0.9);
  border: 1px solid rgba(226, 198, 166, 0.9);
  border-radius: 8px;
  box-shadow: 0 20px 56px rgba(53, 40, 32, 0.12);
}

.map-hero-card {
  margin-bottom: 16px;
  padding: clamp(18px, 3vw, 28px);
}

.map-hero-card h1 {
  max-width: 760px;
  margin: 0;
  color: var(--brown);
  font-size: clamp(2rem, 4.4vw, 4.4rem);
  line-height: 0.98;
}

.map-hero-card p {
  max-width: 680px;
  margin: 14px 0 0;
  color: #66584e;
  line-height: 1.55;
}

.map-route-card {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
  padding: 16px;
  overflow: hidden;
}

.map-stage {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  overflow: hidden;
  background:
    linear-gradient(90deg, transparent 0 7%, rgba(138, 21, 56, 0.24) 7% 93%, transparent 93%),
    rgba(255, 247, 235, 0.82);
  background-size: 100% 4px, auto;
  background-position: center, center;
  background-repeat: no-repeat;
  border: 1px solid rgba(226, 198, 166, 0.82);
  border-radius: 8px;
}

.map-node {
  min-width: 0;
  overflow: hidden;
  min-height: 112px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 10px;
  color: var(--brown);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(226, 198, 166, 0.88);
  border-radius: 8px;
}

.map-node span {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--plum);
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 900;
}

.map-node strong {
  max-width: 100%;
  overflow: hidden;
  color: var(--brown);
  font-size: 0.84rem;
  line-height: 1.15;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-node.active {
  border-color: rgba(138, 21, 56, 0.46);
  box-shadow: 0 16px 34px rgba(138, 21, 56, 0.12);
}

.map-note {
  padding: 14px;
  color: #5e5148;
  background: #fff7eb;
  border: 1px solid rgba(226, 198, 166, 0.82);
  border-radius: 8px;
}

.map-note strong {
  display: block;
  color: var(--brown);
  line-height: 1.25;
}

.map-note p {
  margin: 6px 0 0;
  line-height: 1.45;
}

.map-stop-list {
  display: grid;
  gap: 10px;
}

.map-stop-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 12px;
  padding: 10px;
  text-align: start;
}

.map-stop-row:hover {
  transform: translateY(-1px);
  border-color: rgba(138, 21, 56, 0.34);
}

.map-stop-row img {
  width: 74px;
  height: 74px;
  object-fit: cover;
  border-radius: 8px;
}

.map-stop-row span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.map-stop-row small {
  color: var(--plum);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

body[dir="rtl"] .map-stop-row small {
  text-transform: none;
}

.map-stop-row strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--brown);
  font-size: 1rem;
  line-height: 1.18;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.map-stop-row em {
  display: -webkit-box;
  overflow: hidden;
  color: #6d5f55;
  font-size: 0.82rem;
  font-style: normal;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.map-stop-row b {
  color: var(--plum);
  font-size: 1.35rem;
  line-height: 1;
}

body[data-theme="dark"] .map-hero-card,
body[data-theme="dark"] .map-route-card,
body[data-theme="dark"] .map-stop-row,
body[data-theme="dark"] .map-node,
body[data-theme="dark"] .map-note {
  color: var(--ink);
  background: rgba(22, 17, 15, 0.88);
  border-color: rgba(244, 216, 183, 0.16);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.32);
}

body[data-theme="dark"] .map-stage {
  background:
    linear-gradient(90deg, transparent 0 7%, rgba(214, 75, 114, 0.42) 7% 93%, transparent 93%),
    rgba(255, 255, 255, 0.035);
  background-size: 100% 4px, auto;
  background-position: center, center;
  background-repeat: no-repeat;
  border-color: rgba(244, 216, 183, 0.16);
}

body[data-theme="dark"] .map-hero-card h1,
body[data-theme="dark"] .map-node strong,
body[data-theme="dark"] .map-note strong,
body[data-theme="dark"] .map-stop-row strong {
  color: var(--ink);
}

body[data-theme="dark"] .map-hero-card p,
body[data-theme="dark"] .map-note,
body[data-theme="dark"] .map-stop-row em {
  color: var(--muted);
}

body[data-theme="dark"] .map-stop-row small,
body[data-theme="dark"] .map-stop-row b {
  color: #ffd8c9;
}

body[data-theme="dark"] .map-stop-row img {
  filter: brightness(0.82) saturate(0.92);
}

@media (max-width: 920px) {
  .map-stage {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    background:
      linear-gradient(180deg, transparent 0 8%, rgba(138, 21, 56, 0.24) 8% 92%, transparent 92%),
      rgba(255, 247, 235, 0.82);
    background-size: 4px 100%, auto;
    background-position: center, center;
    background-repeat: no-repeat;
  }

  body[data-theme="dark"] .map-stage {
    background:
      linear-gradient(180deg, transparent 0 8%, rgba(214, 75, 114, 0.42) 8% 92%, transparent 92%),
      rgba(255, 255, 255, 0.035);
    background-size: 4px 100%, auto;
    background-position: center, center;
    background-repeat: no-repeat;
  }
}

@media (max-width: 640px) {
  .journey-section.standalone.map-screen {
    width: 100% !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 14px 0 112px !important;
  }

  .map-hero-card,
  .map-route-card,
  .map-stop-list {
    width: calc(100vw - 28px) !important;
    max-width: calc(100vw - 28px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .map-hero-card {
    padding: 16px;
  }

  .map-hero-card h1 {
    font-size: clamp(1.35rem, 6.7vw, 1.85rem);
    line-height: 1.04;
    overflow-wrap: break-word;
  }

  .map-hero-card p {
    width: 100%;
    max-width: 100%;
    font-size: 0.94rem;
    line-height: 1.45;
    overflow-wrap: break-word;
  }

  .map-stage {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
  }

  .map-node {
    min-height: 76px;
    grid-template-columns: 40px minmax(0, 1fr);
    justify-items: start;
    align-content: center;
    padding: 9px;
  }

  .map-node span {
    width: 34px;
    height: 34px;
  }

  .map-node strong {
    text-align: start;
    white-space: normal;
  }

  .map-stop-row {
    grid-template-columns: 64px minmax(0, 1fr) 22px;
    gap: 10px;
    padding: 9px;
  }

  .map-stop-row img {
    width: 64px;
    height: 64px;
  }

  .stop-list,
  .route-stop-list {
    grid-template-columns: 1fr !important;
  }

  .route-stop-list .stop-card,
  .stop-list .stop-card {
    grid-template-columns: 1fr !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .route-stop-list .stop-art,
  .stop-list .stop-art {
    min-height: 138px !important;
    max-height: 154px !important;
  }

  .route-stop-list .stop-card img,
  .stop-list .stop-card img {
    width: 100% !important;
    height: 100% !important;
  }

  .route-stop-list .stop-copy,
  .stop-list .stop-copy {
    min-width: 0 !important;
  }

  .route-stop-list .stop-copy h3,
  .stop-list .stop-copy h3,
  .route-stop-list .stop-copy p,
  .stop-list .stop-copy p {
    overflow-wrap: anywhere;
  }
}

/* Final visitor polish from the full reference-app pass. */
@media (max-width: 640px) {
  .visitor-dock {
    left: 12px !important;
    right: 12px !important;
    bottom: 10px !important;
    width: auto !important;
    max-width: none !important;
    transform: none !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 3px !important;
    padding: 5px !important;
  }

  .dock-item {
    min-height: 58px !important;
    padding: 6px 2px !important;
  }

  .dock-item strong {
    font-size: 0.66rem !important;
  }

  .discovery-hero {
    min-height: auto !important;
    padding-top: 8px !important;
  }

  .discovery-hero .welcome-copy h1 {
    max-width: 330px !important;
    font-size: clamp(2.55rem, 12vw, 3.2rem) !important;
    line-height: 0.96 !important;
  }

  .discovery-hero .welcome-copy p {
    max-width: 350px !important;
    margin-top: 14px !important;
    font-size: 0.98rem !important;
    line-height: 1.55 !important;
  }

  .mobile-visual-strip {
    margin-bottom: 16px !important;
  }

  .home-progress-card,
  .qr-search-entry,
  .home-category-grid {
    width: 100% !important;
    max-width: 100% !important;
  }

  .home-category-grid,
  .route-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .home-category-tile,
  .route-category-tile {
    min-height: 102px !important;
    overflow: hidden;
  }

  .listening-screen.now-playing-screen {
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-bottom: 150px !important;
  }

  .now-playing-stage,
  .now-copy,
  .listen-body,
  .guide-workspace {
    width: calc(100vw - 28px) !important;
    max-width: calc(100vw - 28px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .now-playing-stage {
    display: block !important;
    padding-top: 0 !important;
  }

  .now-copy {
    padding: 16px !important;
    overflow: visible !important;
  }

  .now-copy h1 {
    max-width: 100% !important;
    font-size: clamp(1.72rem, 7.8vw, 2.08rem) !important;
    line-height: 1.06 !important;
    hyphens: auto;
  }

  .now-copy > p {
    font-size: 0.98rem !important;
    line-height: 1.52 !important;
  }

  .mobile-now-art img {
    aspect-ratio: 16 / 11 !important;
    object-fit: cover !important;
  }

  .now-controls {
    left: 14px !important;
    right: 14px !important;
    bottom: 12px !important;
    width: auto !important;
    max-width: none !important;
  }

  .now-controls .custom-player {
    gap: 8px !important;
  }

  .player-action-row {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .player-action-row button {
    min-width: 0 !important;
    padding-inline: 6px !important;
    font-size: 0.74rem !important;
  }

  .map-screen {
    padding-bottom: 108px !important;
  }
}

@media (max-width: 640px) {
  .visitor-dock {
    left: 12px !important;
    right: auto !important;
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    min-width: 0 !important;
    transform: none !important;
    overflow: hidden !important;
  }

  .visitor-dock .dock-item {
    width: auto !important;
    min-width: 0 !important;
  }

  .visitor-dock .dock-item strong {
    font-size: 0.64rem !important;
  }

  .now-playing-stage .now-art {
    display: none !important;
  }

  .now-playing-stage .now-copy {
    display: block !important;
    margin-top: 14px !important;
  }

  .now-playing-stage .mobile-now-art {
    display: block !important;
    margin: 10px 0 16px !important;
  }

  .now-playing-stage .mobile-now-art img {
    width: 100% !important;
    max-height: 220px !important;
    border-radius: 8px !important;
  }

  .now-playing-stage .prompt,
  .now-playing-stage .trust-row {
    display: none !important;
  }
}

/* Final mobile containment guard: keep the visitor app phone-first and overflow-free. */
html,
body,
#app,
.app-shell {
  max-width: 100%;
}

body {
  overflow-x: hidden;
}

@media (max-width: 640px) {
  .app-shell,
  .visitor-home,
  .journey-section.standalone,
  .listening-screen,
  .now-playing-screen,
  .map-screen {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  .visitor-home,
  .journey-section.standalone,
  .listening-screen {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .visitor-dock {
    left: 50% !important;
    right: auto !important;
    display: flex !important;
    width: min(330px, calc(100vw - 24px)) !important;
    max-width: calc(100vw - 24px) !important;
    grid-template-columns: none !important;
    transform: translateX(-50%) !important;
  }

  .visitor-dock .dock-item {
    flex: 1 1 0 !important;
    max-width: none !important;
  }

  .discovery-hero,
  .visitor-home > *,
  .journey-section.standalone > *,
  .home-progress-card,
  .qr-search-entry,
  .home-category-grid,
  .map-hero-card,
  .map-route-card,
  .map-stop-list,
  .now-playing-stage,
  .now-copy,
  .listen-body,
  .guide-workspace,
  .transcript-card,
  .guide-panel {
    width: calc(100vw - 28px) !important;
    max-width: calc(100vw - 28px) !important;
    min-width: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .map-hero-card h1,
  .map-hero-card p,
  .now-copy h1,
  .now-copy p,
  .listen-tabs button,
  .player-action-row button,
  .home-progress-copy strong,
  .home-progress-copy em,
  .qr-search-entry span,
  .up-next-card strong,
  .up-next-card small {
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    white-space: normal !important;
  }

  .now-copy {
    overflow: hidden !important;
  }

  .now-copy h1 {
    font-size: clamp(1.38rem, 6vw, 1.62rem) !important;
    line-height: 1.1 !important;
  }

  .now-controls {
    left: 50% !important;
    right: auto !important;
    width: min(362px, calc(100vw - 28px)) !important;
    max-width: calc(100vw - 28px) !important;
    transform: translateX(-50%) !important;
  }

  .listen-tabs,
  .player-action-row {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .listen-tabs button,
  .player-action-row button {
    min-width: 0 !important;
    white-space: normal !important;
  }

  .visitor-home .hero-actions,
  .visitor-home .hero-actions button,
  .visitor-home .home-progress-card,
  .visitor-home .qr-search-entry,
  .visitor-home .home-category-grid {
    width: calc(100vw - 40px) !important;
    max-width: calc(100vw - 40px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .visitor-home .hero-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .visitor-home .home-progress-copy em,
  .visitor-home .qr-search-entry span {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .visitor-home .qr-search-entry {
    grid-template-columns: 28px minmax(0, 1fr) 34px !important;
  }

  .now-playing-stage,
  .now-copy,
  .listen-tabs,
  .up-next-card,
  .listen-body,
  .guide-workspace,
  .map-hero-card,
  .map-route-card,
  .map-stop-list {
    width: calc(100vw - 40px) !important;
    max-width: calc(100vw - 40px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .mobile-now-art,
  .mobile-now-art img {
    width: 100% !important;
    max-width: 100% !important;
  }

  .now-copy h1 {
    font-size: clamp(1.3rem, 5.6vw, 1.52rem) !important;
  }

  .now-controls {
    width: min(350px, calc(100vw - 40px)) !important;
    max-width: calc(100vw - 40px) !important;
  }

  .now-copy > p.muted,
  .map-hero-card p,
  .up-next-card small {
    max-width: 300px !important;
  }

  .listen-tabs {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .listen-tabs button[data-nav] {
    display: none !important;
  }
}

/* Premium mobile redesign pass: modern AI guide aesthetic. */
:root {
  --ai-bg: #070707;
  --ai-surface: #11100f;
  --ai-surface-2: #171312;
  --ai-card: rgba(23, 19, 18, 0.86);
  --ai-card-strong: rgba(31, 25, 23, 0.94);
  --ai-border: rgba(255, 232, 205, 0.13);
  --ai-border-strong: rgba(255, 232, 205, 0.22);
  --ai-text: #fff7ef;
  --ai-muted: #c6b8aa;
  --ai-soft: #8f8176;
  --ai-rose: #d91f5d;
  --ai-rose-2: #ff5f7f;
  --ai-teal: #54c6b4;
  --ai-gold: #f1c75f;
  --ai-blue: #83c8dd;
}

body[data-theme="dark"] {
  color: var(--ai-text);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(180deg, #050505 0%, #0d0b0a 44%, #070707 100%) !important;
  background-size: 28px 28px, 28px 28px, auto !important;
}

body[data-theme="dark"] .visitor-topbar {
  height: 58px;
  padding: 10px 18px;
  background: rgba(5, 5, 5, 0.76) !important;
  border-bottom: 1px solid rgba(255, 232, 205, 0.1) !important;
  backdrop-filter: blur(22px);
}

body[data-theme="dark"] .brand-wordmark {
  width: 96px;
  filter: brightness(0) invert(1);
}

body[data-theme="dark"] .brand-subtitle {
  display: none;
}

.brand-language-toggle {
  width: 36px !important;
  height: 32px !important;
  color: #fff !important;
  background: linear-gradient(180deg, #db2d63, #b41448) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 8px !important;
  box-shadow: 0 12px 26px rgba(217, 31, 93, 0.3) !important;
  font-size: 0.72rem !important;
}

body[data-theme="dark"] .theme-button {
  position: relative;
  color: transparent !important;
  background: rgba(255, 255, 255, 0.07) !important;
  border-color: rgba(255, 232, 205, 0.16) !important;
  box-shadow: none !important;
}

body[data-theme="dark"] .theme-button::before {
  content: "";
  width: 15px;
  height: 15px;
  display: block;
  border-radius: 50%;
  background: var(--ai-gold);
  box-shadow: 0 0 0 5px rgba(241, 199, 95, 0.12);
}

body[data-theme="dark"] .visitor-home,
body[data-theme="dark"] .journey-section.standalone,
body[data-theme="dark"] .listening-screen {
  color: var(--ai-text);
}

body[data-theme="dark"] .visitor-home {
  width: min(1180px, 100%);
  padding-top: 16px;
}

body[data-theme="dark"] .welcome-band.discovery-hero {
  min-height: auto;
  align-items: stretch;
  gap: 18px;
}

body[data-theme="dark"] .welcome-copy,
body[data-theme="dark"] .route-hero-card,
body[data-theme="dark"] .map-hero-card,
body[data-theme="dark"] .now-copy,
body[data-theme="dark"] .transcript-card,
body[data-theme="dark"] .guide-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.048), rgba(255, 255, 255, 0.018)),
    var(--ai-card) !important;
  border: 1px solid var(--ai-border) !important;
  border-radius: 8px !important;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.36) !important;
  backdrop-filter: blur(18px);
}

body[data-theme="dark"] .welcome-copy {
  padding: clamp(18px, 4vw, 34px);
}

body[data-theme="dark"] .soft-kicker,
body[data-theme="dark"] .eyebrow {
  width: fit-content;
  color: #ffdce5 !important;
  background: rgba(217, 31, 93, 0.13) !important;
  border: 1px solid rgba(255, 95, 127, 0.25) !important;
  border-radius: 8px !important;
  letter-spacing: 0 !important;
}

body[data-theme="dark"] .welcome-copy h1,
body[data-theme="dark"] .route-hero-card h1,
body[data-theme="dark"] .map-hero-card h1,
body[data-theme="dark"] .now-copy h1 {
  color: var(--ai-text) !important;
  letter-spacing: 0 !important;
}

body[data-theme="dark"] .welcome-copy p,
body[data-theme="dark"] .route-hero-card p,
body[data-theme="dark"] .map-hero-card p,
body[data-theme="dark"] .now-copy > p,
body[data-theme="dark"] .muted {
  color: var(--ai-muted) !important;
}

body[data-theme="dark"] .mobile-visual-strip,
body[data-theme="dark"] .art-stack,
body[data-theme="dark"] .setup-visual {
  overflow: hidden;
  border: 1px solid var(--ai-border);
  border-radius: 8px;
  background: #1a1715;
  box-shadow: inset 0 -40px 70px rgba(0, 0, 0, 0.34);
}

body[data-theme="dark"] .mobile-visual-strip img,
body[data-theme="dark"] .art-stack-image,
body[data-theme="dark"] .setup-visual-image,
body[data-theme="dark"] .stop-art img,
body[data-theme="dark"] .route-featured-stop img,
body[data-theme="dark"] .mobile-now-art img,
body[data-theme="dark"] .now-art img {
  filter: saturate(0.82) contrast(1.04) brightness(0.86);
}

body[data-theme="dark"] .primary-button {
  color: #fff !important;
  background: linear-gradient(180deg, #e22662, #b9154b) !important;
  border: 1px solid rgba(255, 118, 148, 0.28) !important;
  box-shadow: 0 16px 34px rgba(217, 31, 93, 0.28) !important;
}

body[data-theme="dark"] .secondary-button,
body[data-theme="dark"] .ghost-button,
body[data-theme="dark"] .text-button {
  color: var(--ai-text) !important;
  background: rgba(255, 255, 255, 0.055) !important;
  border: 1px solid var(--ai-border) !important;
  box-shadow: none !important;
}

body[data-theme="dark"] .home-progress-card,
body[data-theme="dark"] .qr-search-entry,
body[data-theme="dark"] .home-category-tile,
body[data-theme="dark"] .route-category-tile,
body[data-theme="dark"] .stop-card,
body[data-theme="dark"] .shelf-card,
body[data-theme="dark"] .up-next-card,
body[data-theme="dark"] .map-route-card,
body[data-theme="dark"] .map-stop-row,
body[data-theme="dark"] .map-node,
body[data-theme="dark"] .source-notebook-card,
body[data-theme="dark"] .answer-box {
  color: var(--ai-text) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.018)),
    var(--ai-card) !important;
  border: 1px solid var(--ai-border) !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}

body[data-theme="dark"] .home-progress-card:hover,
body[data-theme="dark"] .qr-search-entry:hover,
body[data-theme="dark"] .home-category-tile:hover,
body[data-theme="dark"] .route-category-tile:hover,
body[data-theme="dark"] .stop-card:hover,
body[data-theme="dark"] .map-stop-row:hover {
  border-color: rgba(255, 95, 127, 0.36) !important;
  transform: translateY(-1px);
}

body[data-theme="dark"] .home-progress-copy small,
body[data-theme="dark"] .home-category-tile span,
body[data-theme="dark"] .route-category-tile span,
body[data-theme="dark"] .route-program-meta span,
body[data-theme="dark"] .stop-overline,
body[data-theme="dark"] .now-meta-row span,
body[data-theme="dark"] .up-next-card span,
body[data-theme="dark"] .map-stop-row small,
body[data-theme="dark"] .suggested-questions span {
  color: #ffd6e0 !important;
  letter-spacing: 0 !important;
}

body[data-theme="dark"] .home-progress-copy strong,
body[data-theme="dark"] .home-category-tile strong,
body[data-theme="dark"] .route-category-tile strong,
body[data-theme="dark"] .stop-copy h3,
body[data-theme="dark"] .shelf-card span,
body[data-theme="dark"] .up-next-card strong,
body[data-theme="dark"] .map-stop-row strong,
body[data-theme="dark"] .transcript-card h2,
body[data-theme="dark"] .guide-panel h2 {
  color: var(--ai-text) !important;
}

body[data-theme="dark"] .home-progress-copy em,
body[data-theme="dark"] .home-category-tile small,
body[data-theme="dark"] .route-category-tile small,
body[data-theme="dark"] .stop-copy p,
body[data-theme="dark"] .shelf-card small,
body[data-theme="dark"] .up-next-card small,
body[data-theme="dark"] .map-stop-row em,
body[data-theme="dark"] .transcript-card p,
body[data-theme="dark"] .guide-panel p {
  color: var(--ai-muted) !important;
}

.home-category-tile span,
.route-category-tile span,
.map-node span {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.tone-maroon span,
body[data-theme="dark"] .home-play-dot,
body[data-theme="dark"] .play-toggle,
body[data-theme="dark"] .map-node span {
  background: linear-gradient(180deg, #e34174, #bf174d) !important;
}

.tone-teal span {
  background: linear-gradient(180deg, #71d6c7, #2f9c8d) !important;
}

.tone-gold span {
  color: #231915 !important;
  background: linear-gradient(180deg, #f6d775, #d49b32) !important;
}

.tone-blue span {
  background: linear-gradient(180deg, #92d8ec, #4f9db7) !important;
}

body[data-theme="dark"] .route-search-wrap,
body[data-theme="dark"] .field,
body[data-theme="dark"] .question-form input {
  color: var(--ai-text) !important;
  background: rgba(255, 255, 255, 0.055) !important;
  border-color: var(--ai-border) !important;
}

body[data-theme="dark"] .chip,
body[data-theme="dark"] .route-suggestion-row button,
body[data-theme="dark"] .source-chip-row span,
body[data-theme="dark"] .suggested-questions button {
  color: var(--ai-muted) !important;
  background: rgba(255, 255, 255, 0.052) !important;
  border: 1px solid var(--ai-border) !important;
  border-radius: 8px !important;
}

body[data-theme="dark"] .chip.active,
body[data-theme="dark"] .route-suggestion-row button:hover,
body[data-theme="dark"] .suggested-questions button:hover {
  color: #fff !important;
  background: rgba(217, 31, 93, 0.2) !important;
  border-color: rgba(255, 95, 127, 0.34) !important;
}

body[data-theme="dark"] .visitor-dock {
  height: 64px;
  padding: 5px !important;
  background: rgba(13, 11, 10, 0.9) !important;
  border: 1px solid rgba(255, 232, 205, 0.15) !important;
  border-radius: 8px !important;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.46) !important;
  backdrop-filter: blur(22px);
}

.dock-item {
  position: relative;
  gap: 4px !important;
  color: var(--ai-soft) !important;
  border-radius: 8px !important;
}

.dock-item.active {
  color: #fff !important;
  background: linear-gradient(180deg, rgba(217, 31, 93, 0.95), rgba(177, 20, 72, 0.95)) !important;
}

.dock-icon {
  position: relative;
  width: 18px;
  height: 18px;
  display: block;
  color: currentColor;
  font-size: 0 !important;
}

.dock-icon-home::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 7px;
  width: 10px;
  height: 8px;
  border: 1.8px solid currentColor;
  border-top: 0;
  border-radius: 2px;
}

.dock-icon-home::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 3px;
  width: 9px;
  height: 9px;
  border-left: 1.8px solid currentColor;
  border-top: 1.8px solid currentColor;
  transform: rotate(45deg);
}

.dock-icon-route::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 10px;
  height: 10px;
  border: 1.8px solid currentColor;
  border-radius: 50%;
}

.dock-icon-route::after {
  content: "";
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 7px;
  height: 1.8px;
  background: currentColor;
  border-radius: 1px;
  transform: rotate(45deg);
  transform-origin: center;
}

.dock-icon-listen::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 3px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 10px solid currentColor;
}

.dock-item strong {
  color: currentColor !important;
  font-size: 0.68rem !important;
}

body[data-theme="dark"] .now-controls {
  background: rgba(13, 11, 10, 0.94) !important;
  border: 1px solid rgba(255, 232, 205, 0.16) !important;
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.48) !important;
}

body[data-theme="dark"] .progress-track {
  background: rgba(255, 255, 255, 0.09) !important;
}

body[data-theme="dark"] .progress-fill {
  background: linear-gradient(90deg, var(--ai-rose), var(--ai-gold)) !important;
}

body[data-theme="dark"] .player-time {
  color: var(--ai-muted) !important;
}

body[data-theme="dark"] .player-action-row button {
  color: var(--ai-text) !important;
  background: rgba(255, 255, 255, 0.055) !important;
  border-color: var(--ai-border) !important;
}

@media (max-width: 640px) {
  body[data-theme="dark"] .visitor-home,
  body[data-theme="dark"] .journey-section.standalone,
  body[data-theme="dark"] .listening-screen {
    padding-bottom: 108px !important;
  }

  body[data-theme="dark"] .visitor-home {
    padding-top: 14px !important;
  }

  body[data-theme="dark"] .welcome-band.discovery-hero,
  body[data-theme="dark"] .route-hero-card,
  body[data-theme="dark"] .map-hero-card,
  body[data-theme="dark"] .now-playing-stage {
    width: calc(100vw - 28px) !important;
    max-width: 430px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  body[data-theme="dark"] .welcome-copy {
    padding: 16px !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  body[data-theme="dark"] .mobile-visual-strip {
    height: 156px !important;
    margin: 4px 0 20px !important;
  }

  body[data-theme="dark"] .mobile-visual-strip .image-1 {
    width: 46% !important;
    height: 114px !important;
    left: -4px !important;
    top: 24px !important;
    opacity: 0.72 !important;
  }

  body[data-theme="dark"] .mobile-visual-strip .image-2 {
    width: 74% !important;
    height: 138px !important;
    left: 22% !important;
    top: 8px !important;
    opacity: 1 !important;
  }

  body[data-theme="dark"] .mobile-visual-strip .image-3 {
    width: 40% !important;
    height: 102px !important;
    right: -6px !important;
    top: 36px !important;
    opacity: 0.62 !important;
  }

  body[data-theme="dark"] .discovery-hero .welcome-copy h1 {
    max-width: 340px !important;
    font-size: clamp(2.42rem, 11.2vw, 3.08rem) !important;
    line-height: 0.94 !important;
  }

  body[data-theme="dark"] .discovery-hero .welcome-copy p {
    max-width: 330px !important;
    margin-top: 14px !important;
    font-size: 1rem !important;
    line-height: 1.54 !important;
  }

  body[data-theme="dark"] .hero-actions {
    margin-top: 22px !important;
  }

  body[data-theme="dark"] .primary-button,
  body[data-theme="dark"] .secondary-button,
  body[data-theme="dark"] .ghost-button {
    min-height: 48px !important;
    font-weight: 850 !important;
  }

  body[data-theme="dark"] .home-progress-card,
  body[data-theme="dark"] .qr-search-entry,
  body[data-theme="dark"] .home-category-grid,
  body[data-theme="dark"] .route-category-grid,
  body[data-theme="dark"] .route-tools,
  body[data-theme="dark"] .route-stop-list,
  body[data-theme="dark"] .map-route-card,
  body[data-theme="dark"] .map-stop-list,
  body[data-theme="dark"] .listen-body,
  body[data-theme="dark"] .guide-workspace {
    width: calc(100vw - 28px) !important;
    max-width: 430px !important;
  }

  body[data-theme="dark"] .home-category-grid,
  body[data-theme="dark"] .route-category-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  body[data-theme="dark"] .home-category-tile,
  body[data-theme="dark"] .route-category-tile {
    min-height: 102px !important;
    padding: 12px !important;
  }

  body[data-theme="dark"] .route-hero-card,
  body[data-theme="dark"] .map-hero-card {
    padding: 16px !important;
  }

  body[data-theme="dark"] .route-hero-card h1,
  body[data-theme="dark"] .map-hero-card h1 {
    font-size: clamp(1.95rem, 8.8vw, 2.45rem) !important;
    line-height: 0.98 !important;
  }

  body[data-theme="dark"] .route-program-meta {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  body[data-theme="dark"] .route-program-meta span {
    min-height: 30px !important;
    padding: 7px 9px !important;
    background: rgba(255, 255, 255, 0.045) !important;
    border: 1px solid var(--ai-border) !important;
    border-radius: 8px !important;
  }

  body[data-theme="dark"] .route-featured-stop {
    margin-top: 14px !important;
    min-height: 132px !important;
  }

  body[data-theme="dark"] .stop-card {
    overflow: hidden;
  }

  body[data-theme="dark"] .route-stop-list .stop-card,
  body[data-theme="dark"] .stop-list .stop-card {
    gap: 0 !important;
  }

  body[data-theme="dark"] .stop-copy {
    padding: 14px !important;
  }

  body[data-theme="dark"] .now-playing-stage {
    padding-top: 0 !important;
  }

  body[data-theme="dark"] .now-copy {
    padding: 14px !important;
  }

  body[data-theme="dark"] .mobile-now-art {
    margin: 12px 0 18px !important;
  }

  body[data-theme="dark"] .mobile-now-art img {
    max-height: 220px !important;
    object-fit: cover !important;
  }

  body[data-theme="dark"] .now-copy h1 {
    font-size: clamp(1.85rem, 8vw, 2.22rem) !important;
    line-height: 1.02 !important;
  }

  body[data-theme="dark"] .now-copy > p.muted {
    max-width: 330px !important;
    font-size: 0.98rem !important;
    line-height: 1.48 !important;
  }

  body[data-theme="dark"] .up-next-card {
    margin-top: 16px !important;
  }

  body[data-theme="dark"] .now-controls {
    width: min(362px, calc(100vw - 28px)) !important;
    bottom: 12px !important;
    padding: 10px !important;
  }

  body[data-theme="dark"] .now-controls .player-main-row {
    grid-template-columns: 52px minmax(0, 1fr) auto !important;
  }

  body[data-theme="dark"] .now-controls .play-toggle {
    width: 52px !important;
    height: 52px !important;
  }

  body[data-theme="dark"] .map-stage {
    gap: 8px !important;
    padding: 10px !important;
  }

  body[data-theme="dark"] .map-node {
    min-height: 70px !important;
  }

  body[data-theme="dark"] .visitor-dock {
    width: min(342px, calc(100vw - 24px)) !important;
  }
}

@media (max-width: 640px) {
  body[data-theme="dark"] .route-hero-card,
  body[data-theme="dark"] .map-hero-card,
  body[data-theme="dark"] .now-playing-stage,
  body[data-theme="dark"] .now-copy,
  body[data-theme="dark"] .route-category-grid,
  body[data-theme="dark"] .map-route-card,
  body[data-theme="dark"] .map-stop-list,
  body[data-theme="dark"] .listen-body,
  body[data-theme="dark"] .guide-workspace {
    width: calc(100vw - 56px) !important;
    max-width: 374px !important;
  }

  body[data-theme="dark"] .route-hero-card h1,
  body[data-theme="dark"] .map-hero-card h1 {
    max-width: 310px !important;
    font-size: clamp(1.78rem, 7.6vw, 2.12rem) !important;
    line-height: 1.02 !important;
  }

  body[data-theme="dark"] .now-copy h1 {
    max-width: 306px !important;
    font-size: clamp(1.55rem, 6.8vw, 1.9rem) !important;
    line-height: 1.06 !important;
  }

  body[data-theme="dark"] .now-copy > p.muted,
  body[data-theme="dark"] .map-hero-card p,
  body[data-theme="dark"] .route-hero-card p {
    max-width: 304px !important;
  }

  body[data-theme="dark"] .mobile-now-art img {
    max-height: 196px !important;
  }

  body[data-theme="dark"] .now-controls {
    width: min(334px, calc(100vw - 56px)) !important;
  }

  body[data-theme="dark"] .visitor-dock {
    width: min(318px, calc(100vw - 40px)) !important;
  }
}

/* Taste pass: remove robotic product-demo density from the visitor UI. */
body[data-theme="dark"] .route-suggestion-row,
body[data-theme="dark"] .route-filter-row,
body[data-theme="dark"] .route-result-count,
body[data-theme="dark"] .stop-meta-row,
body[data-theme="dark"] .visit-pills,
body[data-theme="dark"] .route-proof,
body[data-theme="dark"] .trust-row {
  display: none !important;
}

body[data-theme="dark"] .route-tools,
body[data-theme="dark"] .choice-block,
body[data-theme="dark"] .map-note,
body[data-theme="dark"] .source-note,
body[data-theme="dark"] .source-notebook-card {
  background: transparent !important;
  box-shadow: none !important;
}

body[data-theme="dark"] .route-tools-header {
  margin-bottom: 10px !important;
}

body[data-theme="dark"] .route-tools-header h2,
body[data-theme="dark"] .section-heading h2,
body[data-theme="dark"] .transcript-card h2,
body[data-theme="dark"] .guide-panel h2 {
  font-size: clamp(1.25rem, 5vw, 1.6rem) !important;
  letter-spacing: 0 !important;
}

body[data-theme="dark"] .route-search-wrap {
  min-height: 50px !important;
  border-radius: 8px !important;
}

body[data-theme="dark"] .route-search-input {
  color: var(--ai-text) !important;
}

body[data-theme="dark"] .route-search-input::placeholder {
  color: rgba(255, 247, 239, 0.46) !important;
}

body[data-theme="dark"] .stop-overline {
  font-size: 0.7rem !important;
  opacity: 0.82;
}

body[data-theme="dark"] .listen-link {
  width: fit-content;
  margin-top: 10px;
  color: #fff !important;
  background: rgba(217, 31, 93, 0.22) !important;
  border: 1px solid rgba(255, 95, 127, 0.28) !important;
}

body[data-theme="dark"] .suggested-questions,
body[data-theme="dark"] .source-chip-row {
  gap: 8px !important;
}

@media (max-width: 640px) {
  body[data-theme="dark"] .visitor-home {
    padding-bottom: 92px !important;
  }

  body[data-theme="dark"] .welcome-band.discovery-hero {
    padding-top: 6px !important;
  }

  body[data-theme="dark"] .soft-kicker,
  body[data-theme="dark"] .eyebrow {
    margin-bottom: 10px !important;
    padding: 6px 9px !important;
    font-size: 0.72rem !important;
  }

  body[data-theme="dark"] .discovery-hero .welcome-copy h1 {
    max-width: 320px !important;
    font-size: clamp(2.35rem, 10.8vw, 2.95rem) !important;
  }

  body[data-theme="dark"] .discovery-hero .welcome-copy p {
    max-width: 300px !important;
    color: rgba(255, 247, 239, 0.72) !important;
  }

  body[data-theme="dark"] .hero-actions {
    width: min(300px, 100%) !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  body[data-theme="dark"] .hero-actions .primary-button,
  body[data-theme="dark"] .hero-actions .ghost-button {
    width: 100% !important;
    max-width: 100% !important;
  }

  body[data-theme="dark"] .today-shelf {
    width: calc(100vw - 28px) !important;
    max-width: 430px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  body[data-theme="dark"] .section-heading {
    align-items: center !important;
    margin-bottom: 12px !important;
  }

  body[data-theme="dark"] .section-heading h2 {
    margin: 0 !important;
    font-size: 1.35rem !important;
  }

  body[data-theme="dark"] .shelf-row {
    gap: 10px !important;
  }

  body[data-theme="dark"] .shelf-card {
    min-width: 184px !important;
  }

  body[data-theme="dark"] .shelf-card small {
    display: none !important;
  }

  body[data-theme="dark"] .route-category-grid {
    display: none !important;
  }

  body[data-theme="dark"] .route-hero-card,
  body[data-theme="dark"] .map-hero-card {
    padding: 18px !important;
  }

  body[data-theme="dark"] .route-hero-card h1 {
    font-size: clamp(2rem, 8.8vw, 2.42rem) !important;
  }

  body[data-theme="dark"] .route-program-meta {
    margin-top: 14px !important;
  }

  body[data-theme="dark"] .route-program-meta span {
    min-height: 28px !important;
    padding: 6px 8px !important;
    color: rgba(255, 247, 239, 0.76) !important;
    font-size: 0.68rem !important;
  }

  body[data-theme="dark"] .route-hero-actions {
    margin-top: 18px !important;
  }

  body[data-theme="dark"] .route-featured-stop {
    min-height: 116px !important;
  }

  body[data-theme="dark"] .route-tools {
    padding: 4px 0 0 !important;
    border: 0 !important;
  }

  body[data-theme="dark"] .route-tools-header .eyebrow {
    display: none !important;
  }

  body[data-theme="dark"] .route-tools-header h2 {
    font-size: 1.28rem !important;
  }

  body[data-theme="dark"] .stop-card {
    border-color: rgba(255, 232, 205, 0.1) !important;
  }

  body[data-theme="dark"] .stop-copy h3 {
    font-size: 1.05rem !important;
  }

  body[data-theme="dark"] .map-note {
    padding: 0 !important;
    border: 0 !important;
  }

  body[data-theme="dark"] .map-note strong {
    font-size: 0.88rem !important;
  }

  body[data-theme="dark"] .map-note p {
    color: rgba(255, 247, 239, 0.62) !important;
    font-size: 0.88rem !important;
  }

  body[data-theme="dark"] .map-stop-row em {
    display: none !important;
  }

  body[data-theme="dark"] .now-meta-row span:not(:first-child) {
    display: none !important;
  }

  body[data-theme="dark"] .now-copy {
    padding: 16px !important;
  }

  body[data-theme="dark"] .up-next-card small {
    display: none !important;
  }

  body[data-theme="dark"] .transcript-card,
  body[data-theme="dark"] .guide-panel {
    padding: 16px !important;
  }

  body[data-theme="dark"] .source-chip-row {
    display: none !important;
  }
}

/* Final visual taste correction: more native mobile, less boxed prototype. */
@media (max-width: 640px) {
  body[data-theme="dark"] .visitor-home {
    padding-top: 0 !important;
  }

  body[data-theme="dark"] .welcome-band.discovery-hero {
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 0 0 24px !important;
  }

  body[data-theme="dark"] .welcome-copy {
    width: 100vw !important;
    max-width: 100vw !important;
    padding: 0 !important;
  }

  body[data-theme="dark"] .mobile-visual-strip {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 248px !important;
    margin: 0 0 26px !important;
    border-right: 0 !important;
    border-left: 0 !important;
    border-top: 0 !important;
    border-radius: 0 0 8px 8px !important;
  }

  body[data-theme="dark"] .mobile-visual-strip::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.46));
    pointer-events: none;
  }

  body[data-theme="dark"] .soft-kicker,
  body[data-theme="dark"] .discovery-hero .welcome-copy h1,
  body[data-theme="dark"] .discovery-hero .welcome-copy p,
  body[data-theme="dark"] .hero-actions {
    width: calc(100vw - 48px) !important;
    max-width: 360px !important;
    margin-left: 24px !important;
    margin-right: 24px !important;
  }

  body[data-theme="dark"] .discovery-hero .welcome-copy h1 {
    font-size: clamp(2.62rem, 12vw, 3.32rem) !important;
  }

  body[data-theme="dark"] .discovery-hero .welcome-copy p {
    max-width: 316px !important;
  }

  body[data-theme="dark"] .hero-actions {
    max-width: 342px !important;
  }

  body[data-theme="dark"] .today-shelf,
  body[data-theme="dark"] .route-hero-card,
  body[data-theme="dark"] .map-hero-card,
  body[data-theme="dark"] .now-playing-stage,
  body[data-theme="dark"] .now-copy,
  body[data-theme="dark"] .route-tools,
  body[data-theme="dark"] .route-stop-list,
  body[data-theme="dark"] .route-category-grid,
  body[data-theme="dark"] .map-route-card,
  body[data-theme="dark"] .map-stop-list,
  body[data-theme="dark"] .listen-body,
  body[data-theme="dark"] .guide-workspace {
    width: calc(100vw - 32px) !important;
    max-width: 430px !important;
  }

  body[data-theme="dark"] .route-hero-card h1,
  body[data-theme="dark"] .map-hero-card h1 {
    max-width: 330px !important;
  }

  body[data-theme="dark"] .now-copy h1 {
    max-width: 330px !important;
  }

  body[data-theme="dark"] .now-controls {
    width: min(358px, calc(100vw - 32px)) !important;
  }

  body[data-theme="dark"] .visitor-dock {
    width: min(330px, calc(100vw - 32px)) !important;
  }

  body[data-theme="dark"] .visitor-home .soft-kicker {
    display: none !important;
  }

  body[data-theme="dark"] .soft-kicker {
    width: fit-content !important;
    max-width: calc(100vw - 48px) !important;
    margin-left: 24px !important;
    margin-right: 24px !important;
  }

  body[data-theme="dark"] .now-copy .soft-kicker {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  body[data-theme="dark"] .mobile-visual-strip .image-1,
  body[data-theme="dark"] .mobile-visual-strip .image-3 {
    display: none !important;
  }

  body[data-theme="dark"] .mobile-visual-strip .image-2 {
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    opacity: 1 !important;
    object-fit: cover !important;
  }
}

/* Apple-style liquid glass pass: simple, soft, and less verbose. */
:root {
  --lg-bg: #050506;
  --lg-ink: #fffaf5;
  --lg-muted: rgba(255, 250, 245, 0.68);
  --lg-faint: rgba(255, 250, 245, 0.44);
  --lg-glass: rgba(34, 31, 30, 0.48);
  --lg-glass-strong: rgba(44, 39, 38, 0.58);
  --lg-stroke: rgba(255, 255, 255, 0.16);
  --lg-stroke-strong: rgba(255, 255, 255, 0.26);
  --lg-tint: rgba(255, 255, 255, 0.08);
  --lg-pink: #ff2d68;
  --lg-pink-2: #ff6b93;
  --lg-shadow: 0 22px 54px rgba(0, 0, 0, 0.34);
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    Inter, "Noto Sans Arabic", system-ui, sans-serif;
}

body[data-theme="dark"] {
  background:
    linear-gradient(180deg, #050506 0%, #090807 42%, #030303 100%) !important;
  background-size: auto !important;
  color: var(--lg-ink) !important;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body[data-theme="dark"]::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 34%),
    linear-gradient(120deg, rgba(255, 45, 104, 0.08), transparent 42%),
    linear-gradient(260deg, rgba(91, 211, 194, 0.06), transparent 38%);
  opacity: 0.9;
}

body[data-theme="dark"] .visitor-topbar {
  height: 58px !important;
  padding: 9px 16px !important;
  background: rgba(8, 8, 9, 0.58) !important;
  border: 0 !important;
  box-shadow: inset 0 -1px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(28px) saturate(1.55) !important;
  -webkit-backdrop-filter: blur(28px) saturate(1.55) !important;
}

body[data-theme="dark"] .brand-wordmark {
  width: 94px !important;
  filter: brightness(0) invert(1);
}

body[data-theme="dark"] .brand-language-toggle {
  width: 34px !important;
  height: 34px !important;
  border-radius: 50% !important;
  color: #fff !important;
  background: rgba(255, 45, 104, 0.78) !important;
  border: 1px solid rgba(255, 255, 255, 0.24) !important;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.3),
    0 10px 24px rgba(255, 45, 104, 0.28) !important;
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
}

body[data-theme="dark"] .theme-button {
  width: 38px !important;
  height: 38px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.12) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.2),
    0 12px 30px rgba(0, 0, 0, 0.28) !important;
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
}

body[data-theme="dark"] .visitor-home,
body[data-theme="dark"] .journey-section.standalone,
body[data-theme="dark"] .listening-screen {
  color: var(--lg-ink) !important;
}

body[data-theme="dark"] .welcome-copy h1,
body[data-theme="dark"] .route-hero-card h1,
body[data-theme="dark"] .map-hero-card h1,
body[data-theme="dark"] .now-copy h1 {
  color: var(--lg-ink) !important;
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", Inter,
    "Noto Sans Arabic", system-ui, sans-serif !important;
  font-weight: 760 !important;
  letter-spacing: -0.01em !important;
}

body[data-theme="dark"] .welcome-copy p,
body[data-theme="dark"] .route-hero-card p,
body[data-theme="dark"] .map-hero-card p,
body[data-theme="dark"] .now-copy > p,
body[data-theme="dark"] .muted {
  color: var(--lg-muted) !important;
}

body[data-theme="dark"] .primary-button,
body[data-theme="dark"] .secondary-button,
body[data-theme="dark"] .ghost-button,
body[data-theme="dark"] .text-button {
  border-radius: 999px !important;
  border: 1px solid var(--lg-stroke) !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  backdrop-filter: blur(22px) saturate(1.45);
  -webkit-backdrop-filter: blur(22px) saturate(1.45);
}

body[data-theme="dark"] .primary-button {
  color: #fff !important;
  background:
    linear-gradient(180deg, rgba(255, 103, 143, 0.98), rgba(255, 45, 104, 0.9)) !important;
  border-color: rgba(255, 255, 255, 0.24) !important;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.3),
    0 18px 36px rgba(255, 45, 104, 0.28) !important;
}

body[data-theme="dark"] .secondary-button,
body[data-theme="dark"] .ghost-button,
body[data-theme="dark"] .text-button {
  color: var(--lg-ink) !important;
  background: rgba(255, 255, 255, 0.1) !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.16) !important;
}

body[data-theme="dark"] .route-hero-card,
body[data-theme="dark"] .map-hero-card,
body[data-theme="dark"] .now-copy,
body[data-theme="dark"] .transcript-card,
body[data-theme="dark"] .guide-panel,
body[data-theme="dark"] .route-tools,
body[data-theme="dark"] .map-route-card,
body[data-theme="dark"] .map-stop-list {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.055)),
    var(--lg-glass) !important;
  border: 1px solid var(--lg-stroke) !important;
  border-radius: 26px !important;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.2),
    var(--lg-shadow) !important;
  backdrop-filter: blur(30px) saturate(1.55) !important;
  -webkit-backdrop-filter: blur(30px) saturate(1.55) !important;
}

body[data-theme="dark"] .home-progress-card,
body[data-theme="dark"] .qr-search-entry,
body[data-theme="dark"] .stop-card,
body[data-theme="dark"] .shelf-card,
body[data-theme="dark"] .up-next-card,
body[data-theme="dark"] .map-stop-row,
body[data-theme="dark"] .map-node,
body[data-theme="dark"] .source-notebook-card,
body[data-theme="dark"] .answer-box {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.055)),
    rgba(255, 255, 255, 0.055) !important;
  border: 1px solid rgba(255, 255, 255, 0.13) !important;
  border-radius: 22px !important;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.14),
    0 14px 34px rgba(0, 0, 0, 0.22) !important;
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
}

body[data-theme="dark"] .mobile-visual-strip,
body[data-theme="dark"] .art-stack,
body[data-theme="dark"] .mobile-now-art img,
body[data-theme="dark"] .now-art img,
body[data-theme="dark"] .stop-art img,
body[data-theme="dark"] .route-featured-stop img,
body[data-theme="dark"] .map-stop-row img {
  border-radius: 24px !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}

body[data-theme="dark"] .route-featured-stop {
  border-radius: 24px !important;
  overflow: hidden !important;
}

body[data-theme="dark"] .soft-kicker,
body[data-theme="dark"] .eyebrow,
body[data-theme="dark"] .route-program-meta span,
body[data-theme="dark"] .now-meta-row span,
body[data-theme="dark"] .stop-overline {
  color: rgba(255, 250, 245, 0.74) !important;
  background: rgba(255, 255, 255, 0.09) !important;
  border: 1px solid rgba(255, 255, 255, 0.13) !important;
  border-radius: 999px !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

body[data-theme="dark"] .route-search-wrap,
body[data-theme="dark"] .field,
body[data-theme="dark"] .question-form input {
  min-height: 50px !important;
  color: var(--lg-ink) !important;
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid var(--lg-stroke) !important;
  border-radius: 999px !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.12) !important;
  backdrop-filter: blur(20px) saturate(1.35);
  -webkit-backdrop-filter: blur(20px) saturate(1.35);
}

body[data-theme="dark"] .visitor-dock {
  height: 68px !important;
  padding: 6px !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08)),
    rgba(26, 24, 24, 0.58) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 30px !important;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.22),
    0 22px 58px rgba(0, 0, 0, 0.42) !important;
  backdrop-filter: blur(34px) saturate(1.7) !important;
  -webkit-backdrop-filter: blur(34px) saturate(1.7) !important;
}

body[data-theme="dark"] .dock-item {
  border-radius: 24px !important;
  color: rgba(255, 250, 245, 0.58) !important;
}

body[data-theme="dark"] .dock-item.active {
  color: #fff !important;
  background:
    linear-gradient(180deg, rgba(255, 103, 143, 0.96), rgba(255, 45, 104, 0.86)) !important;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.24),
    0 10px 24px rgba(255, 45, 104, 0.22) !important;
}

body[data-theme="dark"] .now-controls {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.075)),
    rgba(20, 18, 18, 0.64) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 28px !important;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.18),
    0 22px 58px rgba(0, 0, 0, 0.44) !important;
  backdrop-filter: blur(34px) saturate(1.6) !important;
  -webkit-backdrop-filter: blur(34px) saturate(1.6) !important;
}

body[data-theme="dark"] .play-toggle {
  border-radius: 18px !important;
  background:
    linear-gradient(180deg, rgba(255, 103, 143, 1), rgba(255, 45, 104, 0.9)) !important;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.26),
    0 12px 28px rgba(255, 45, 104, 0.3) !important;
}

body[data-theme="dark"] .progress-track {
  height: 8px !important;
  background: rgba(255, 255, 255, 0.16) !important;
  border-radius: 999px !important;
}

body[data-theme="dark"] .player-action-row button {
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.09) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

@media (max-width: 640px) {
  body[data-theme="dark"] .mobile-visual-strip {
    height: 300px !important;
    margin-bottom: 24px !important;
    border-radius: 0 0 30px 30px !important;
    border: 0 !important;
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.3) !important;
  }

  body[data-theme="dark"] .mobile-visual-strip::after {
    background:
      linear-gradient(180deg, rgba(0, 0, 0, 0.02) 20%, rgba(0, 0, 0, 0.52) 100%) !important;
  }

  body[data-theme="dark"] .discovery-hero .welcome-copy h1 {
    max-width: 342px !important;
    font-size: clamp(2.54rem, 11.4vw, 3.18rem) !important;
    line-height: 0.96 !important;
  }

  body[data-theme="dark"] .discovery-hero .welcome-copy p {
    max-width: 330px !important;
    font-size: 1.02rem !important;
    line-height: 1.45 !important;
  }

  body[data-theme="dark"] .hero-actions {
    display: grid !important;
    grid-template-columns: 1fr 0.72fr !important;
    gap: 10px !important;
    max-width: 342px !important;
  }

  body[data-theme="dark"] .hero-actions .primary-button,
  body[data-theme="dark"] .hero-actions .ghost-button {
    min-height: 52px !important;
  }

  body[data-theme="dark"] .today-shelf {
    margin-top: -54px !important;
    padding-top: 72px !important;
  }

  body[data-theme="dark"] .route-hero-card,
  body[data-theme="dark"] .map-hero-card,
  body[data-theme="dark"] .now-copy {
    padding: 20px !important;
  }

  body[data-theme="dark"] .route-hero-card h1,
  body[data-theme="dark"] .map-hero-card h1,
  body[data-theme="dark"] .now-copy h1 {
    letter-spacing: -0.018em !important;
  }

  body[data-theme="dark"] .route-hero-card h1 {
    font-size: clamp(2.12rem, 9vw, 2.62rem) !important;
  }

  body[data-theme="dark"] .map-hero-card h1 {
    font-size: clamp(2.2rem, 10vw, 2.72rem) !important;
  }

  body[data-theme="dark"] .now-copy h1 {
    font-size: clamp(1.72rem, 7.5vw, 2.08rem) !important;
  }

  body[data-theme="dark"] .route-hero-actions {
    display: grid !important;
    grid-template-columns: 1fr 0.72fr !important;
    gap: 10px !important;
  }

  body[data-theme="dark"] .map-stage {
    background:
      linear-gradient(180deg, transparent 0 7%, rgba(255, 45, 104, 0.42) 7% 93%, transparent 93%),
      transparent !important;
    background-size: 3px 100%, auto !important;
    background-position: center, center !important;
    background-repeat: no-repeat !important;
  }

  body[data-theme="dark"] .map-node {
    min-height: 68px !important;
  }

  body[data-theme="dark"] .visitor-dock {
    bottom: 12px !important;
    width: min(340px, calc(100vw - 24px)) !important;
  }

  body[data-theme="dark"] .now-controls {
    width: min(350px, calc(100vw - 28px)) !important;
  }
}

@media (max-width: 640px) {
  body[data-theme="dark"] .route-hero-card .route-hero-actions,
  body[data-theme="dark"] .map-hero-card .route-hero-actions {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  body[data-theme="dark"] .route-hero-card .route-hero-actions button,
  body[data-theme="dark"] .map-hero-card .route-hero-actions button {
    width: min(292px, 100%) !important;
    max-width: min(292px, 100%) !important;
    min-width: 0 !important;
    justify-self: start !important;
    padding-inline: 8px !important;
    font-size: 0.9rem !important;
    box-sizing: border-box !important;
  }

  body[data-theme="dark"] .route-hero-card .route-hero-actions .secondary-button,
  body[data-theme="dark"] .map-hero-card .route-hero-actions .secondary-button {
    display: none !important;
  }
}

@media (max-width: 640px) {
  body[data-theme="dark"] .listening-screen.now-playing-screen {
    padding-bottom: 96px !important;
  }

  body[data-theme="dark"] .now-controls {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    z-index: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 14px 0 0 !important;
    transform: none !important;
  }

  body[data-theme="dark"] .now-copy {
    padding-bottom: 20px !important;
  }
}

/* Pixel QA correction layer: phone-first polish after the liquid glass pass. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body,
#app,
.app-shell {
  max-width: 100%;
  overflow-x: hidden;
}

body[data-theme="dark"] .route-tools-header h2 {
  margin: 0;
}

body[data-theme="dark"] .route-stop-list {
  padding-bottom: 18px;
}

body[data-theme="dark"] .completion-card h1,
body[data-theme="dark"] .setup-hero h1 {
  color: var(--lg-ink) !important;
  letter-spacing: -0.012em !important;
}

body[data-theme="dark"] .completion-card .muted,
body[data-theme="dark"] .setup-hero p {
  color: var(--lg-muted) !important;
}

body[data-theme="dark"] .rating-button {
  color: var(--lg-ink) !important;
  background: rgba(255, 255, 255, 0.09) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 16px !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.12) !important;
}

body[data-theme="dark"] .rating-button.active {
  color: #fff !important;
  background: linear-gradient(180deg, rgba(255, 103, 143, 0.96), rgba(255, 45, 104, 0.88)) !important;
  border-color: rgba(255, 255, 255, 0.24) !important;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.24),
    0 14px 30px rgba(255, 45, 104, 0.24) !important;
}

@media (max-width: 640px) {
  body[data-theme="dark"] .setup-screen,
  body[data-theme="dark"] .completion.page {
    width: 100% !important;
    max-width: 100vw !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 18px !important;
    align-items: start !important;
    justify-items: center !important;
    padding: 18px 16px 112px !important;
    overflow: hidden !important;
  }

  body[data-theme="dark"] .completion.page {
    min-height: calc(100svh - 58px) !important;
    align-content: start !important;
    padding-top: 92px !important;
  }

  body[data-theme="dark"] .setup-hero,
  body[data-theme="dark"] .setup-stack,
  body[data-theme="dark"] .choice-block,
  body[data-theme="dark"] .completion-card {
    width: 100% !important;
    max-width: 430px !important;
    min-width: 0 !important;
  }

  body[data-theme="dark"] .setup-hero,
  body[data-theme="dark"] .choice-block,
  body[data-theme="dark"] .completion-card {
    border-radius: 28px !important;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.055)),
      rgba(34, 31, 30, 0.48) !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    box-shadow:
      inset 0 1px rgba(255, 255, 255, 0.18),
      0 22px 54px rgba(0, 0, 0, 0.34) !important;
    backdrop-filter: blur(30px) saturate(1.55) !important;
    -webkit-backdrop-filter: blur(30px) saturate(1.55) !important;
  }

  body[data-theme="dark"] .setup-hero {
    position: relative !important;
    top: auto !important;
    padding: 16px 16px 20px !important;
    overflow: hidden !important;
  }

  body[data-theme="dark"] .setup-visual {
    width: 100% !important;
    height: 186px !important;
    margin: 0 0 18px !important;
    overflow: hidden !important;
    border-radius: 24px !important;
  }

  body[data-theme="dark"] .setup-visual-image {
    position: absolute !important;
    object-fit: cover !important;
    border-radius: 22px !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
  }

  body[data-theme="dark"] .setup-visual .image-1 {
    left: -8px !important;
    top: 36px !important;
    width: 48% !important;
    height: 116px !important;
    opacity: 0.72 !important;
  }

  body[data-theme="dark"] .setup-visual .image-2 {
    left: 16% !important;
    top: 16px !important;
    width: 68% !important;
    height: 148px !important;
    z-index: 2 !important;
  }

  body[data-theme="dark"] .setup-visual .image-3 {
    right: -8px !important;
    top: 4px !important;
    width: 48% !important;
    height: 120px !important;
    opacity: 0.68 !important;
  }

  body[data-theme="dark"] .setup-hero .soft-kicker,
  body[data-theme="dark"] .completion-card .eyebrow {
    width: fit-content !important;
    margin: 0 0 12px !important;
  }

  body[data-theme="dark"] .setup-hero h1,
  body[data-theme="dark"] .completion-card h1 {
    max-width: 100% !important;
    margin: 0 !important;
    font-size: clamp(2.18rem, 9.4vw, 2.78rem) !important;
    line-height: 0.98 !important;
  }

  body[data-theme="dark"] .setup-hero p:not(.soft-kicker),
  body[data-theme="dark"] .completion-card .muted {
    max-width: 310px !important;
    margin: 14px 0 0 !important;
    font-size: 1rem !important;
    line-height: 1.45 !important;
  }

  body[data-theme="dark"] .setup-proof {
    display: none !important;
  }

  body[data-theme="dark"] .onboarding-progress {
    margin: 2px auto 16px !important;
  }

  body[data-theme="dark"] .choice-block {
    padding: 16px !important;
  }

  body[data-theme="dark"] .choice-block .eyebrow {
    width: fit-content !important;
    margin: 0 0 12px !important;
  }

  body[data-theme="dark"] .chip-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
  }

  body[data-theme="dark"] .chip {
    min-height: 44px !important;
    padding: 0 14px !important;
    border-radius: 16px !important;
    color: var(--lg-ink) !important;
    white-space: nowrap !important;
  }

  body[data-theme="dark"] .chip.active,
  body[data-theme="dark"] .mode-card.active {
    color: #fff !important;
    background: rgba(255, 45, 104, 0.22) !important;
    border-color: rgba(255, 103, 143, 0.42) !important;
  }

  body[data-theme="dark"] .mode-strip {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  body[data-theme="dark"] .mode-card {
    min-height: 0 !important;
    padding: 15px !important;
    border-radius: 22px !important;
    text-align: start !important;
    background: rgba(255, 255, 255, 0.07) !important;
    border: 1px solid rgba(255, 255, 255, 0.13) !important;
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.1) !important;
  }

  body[data-theme="dark"] .mode-card h3 {
    margin: 0 0 5px !important;
    color: var(--lg-ink) !important;
    font-size: 1rem !important;
    line-height: 1.2 !important;
  }

  body[data-theme="dark"] .mode-card p {
    margin: 0 !important;
    color: var(--lg-muted) !important;
    font-size: 0.88rem !important;
    line-height: 1.35 !important;
  }

  body[data-theme="dark"] .start-dock {
    left: 50% !important;
    right: auto !important;
    bottom: 12px !important;
    width: min(358px, calc(100vw - 24px)) !important;
    max-width: calc(100vw - 24px) !important;
    display: grid !important;
    grid-template-columns: 0.78fr 1fr !important;
    gap: 8px !important;
    padding: 6px !important;
    border-radius: 30px !important;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08)),
      rgba(26, 24, 24, 0.62) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    box-shadow:
      inset 0 1px rgba(255, 255, 255, 0.22),
      0 22px 58px rgba(0, 0, 0, 0.42) !important;
    transform: translateX(-50%) !important;
    backdrop-filter: blur(34px) saturate(1.7) !important;
    -webkit-backdrop-filter: blur(34px) saturate(1.7) !important;
  }

  body[data-theme="dark"] .start-dock .primary-button,
  body[data-theme="dark"] .start-dock .secondary-button {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 52px !important;
    padding-inline: 10px !important;
    font-size: 0.88rem !important;
    white-space: nowrap !important;
  }

  body[data-theme="dark"] .completion-card {
    padding: 24px !important;
    overflow: hidden !important;
  }

  body[data-theme="dark"] .completion-card .muted {
    max-width: 286px !important;
  }

  body[data-theme="dark"] .rating-row {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin: 12px 0 14px !important;
  }

  body[data-theme="dark"] .rating-button {
    width: 100% !important;
    min-width: 0 !important;
    height: 44px !important;
  }

  body[data-theme="dark"] .completion-card .field {
    width: 100% !important;
    min-height: 92px !important;
    padding: 14px 16px !important;
    border-radius: 24px !important;
    resize: vertical !important;
  }

  body[data-theme="dark"] .completion-card .inline-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  body[data-theme="dark"] .completion-card .inline-actions .primary-button {
    grid-column: 1 / -1 !important;
  }

  body[data-theme="dark"] .completion-card .inline-actions button {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 50px !important;
    padding-inline: 10px !important;
    font-size: 0.9rem !important;
    white-space: nowrap !important;
  }

  body[data-theme="dark"] .now-controls {
    overflow: hidden !important;
    padding: 10px !important;
  }

  body[data-theme="dark"] .now-controls .custom-player {
    width: 100% !important;
    min-width: 0 !important;
  }

  body[data-theme="dark"] .now-controls .player-main-row {
    grid-template-columns: 52px minmax(0, 1fr) minmax(70px, auto) !important;
    gap: 9px !important;
  }

  body[data-theme="dark"] .now-controls .player-time {
    font-size: 0.73rem !important;
    white-space: nowrap !important;
  }

  body[data-theme="dark"] .player-action-row {
    grid-template-columns: 0.72fr 1fr 0.72fr !important;
    gap: 7px !important;
  }

  body[data-theme="dark"] .player-action-row button {
    min-height: 38px !important;
    padding: 0 6px !important;
    border-radius: 17px !important;
    font-size: 0.75rem !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  body[data-theme="dark"] .route-tools {
    margin-top: 18px !important;
  }

  body[data-theme="dark"] .route-search-wrap {
    width: 100% !important;
  }

  body[data-theme="dark"] .map-stop-list {
    padding-bottom: 92px !important;
  }
}

/* Phone viewport hardening: keep every glass surface inside a 390px-class
   screen. Applies to both themes (was previously dark-only, which left
   light mode without the same narrow-phone width/font clamping). */
@media (max-width: 430px) {
  body[data-theme] .route-hero-card,
  body[data-theme] .map-hero-card,
  body[data-theme] .route-tools,
  body[data-theme] .route-stop-list,
  body[data-theme] .map-route-card,
  body[data-theme] .map-stop-list,
  body[data-theme] .now-playing-stage,
  body[data-theme] .listen-body,
  body[data-theme] .guide-workspace,
  body[data-theme] .setup-hero,
  body[data-theme] .setup-stack,
  body[data-theme] .choice-block,
  body[data-theme] .completion-card {
    width: min(334px, calc(100vw - 56px)) !important;
    max-width: min(334px, calc(100vw - 56px)) !important;
    min-width: 0 !important;
    margin-left: 28px !important;
    margin-right: 0 !important;
  }

  body[dir="rtl"][data-theme] .route-hero-card,
  body[dir="rtl"][data-theme] .map-hero-card,
  body[dir="rtl"][data-theme] .route-tools,
  body[dir="rtl"][data-theme] .route-stop-list,
  body[dir="rtl"][data-theme] .map-route-card,
  body[dir="rtl"][data-theme] .map-stop-list,
  body[dir="rtl"][data-theme] .now-playing-stage,
  body[dir="rtl"][data-theme] .listen-body,
  body[dir="rtl"][data-theme] .guide-workspace,
  body[dir="rtl"][data-theme] .setup-hero,
  body[dir="rtl"][data-theme] .setup-stack,
  body[dir="rtl"][data-theme] .choice-block,
  body[dir="rtl"][data-theme] .completion-card {
    margin-left: 0 !important;
    margin-right: 28px !important;
  }

  body[data-theme] .now-copy {
    width: 100% !important;
    max-width: 100% !important;
  }

  body[data-theme] .setup-screen {
    overflow: visible !important;
    overflow-x: hidden !important;
  }

  body[data-theme] .completion.page {
    padding-top: 74px !important;
  }

  body[data-theme] .route-hero-card,
  body[data-theme] .map-hero-card,
  body[data-theme] .now-copy {
    padding: 18px !important;
  }

  body[data-theme] .route-hero-card h1,
  body[data-theme] .map-hero-card h1 {
    max-width: 288px !important;
    font-size: clamp(1.95rem, 8.4vw, 2.32rem) !important;
  }

  body[data-theme] .completion-card {
    padding: 24px !important;
  }

  body[data-theme] .completion-card h1 {
    font-size: clamp(2.02rem, 8.8vw, 2.42rem) !important;
  }

  body[data-theme] .completion-card .muted {
    max-width: 260px !important;
  }

  body[data-theme] .rating-row {
    width: 100% !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }

  body[data-theme] .rating-button {
    width: 100% !important;
  }

  body[data-theme] .now-controls {
    width: 100% !important;
    max-width: 100% !important;
  }

  body[data-theme] .now-controls .player-main-row {
    grid-template-columns: 48px minmax(0, 1fr) minmax(64px, auto) !important;
    gap: 8px !important;
  }

  body[data-theme] .now-controls .play-toggle {
    width: 48px !important;
    height: 48px !important;
  }

  body[data-theme] .player-action-row {
    grid-template-columns: 0.68fr 1fr 0.68fr !important;
  }

  body[data-theme] .player-action-row button {
    padding-inline: 4px !important;
    font-size: 0.72rem !important;
  }

  body[data-theme] .start-dock {
    z-index: 140 !important;
    width: min(334px, calc(100vw - 56px)) !important;
    max-width: min(334px, calc(100vw - 56px)) !important;
    left: 28px !important;
    right: auto !important;
    transform: none !important;
  }

  body[dir="rtl"][data-theme] .start-dock {
    left: auto !important;
    right: 28px !important;
  }

  body[data-theme] .visitor-dock {
    left: 36px !important;
    right: auto !important;
    width: min(318px, calc(100vw - 72px)) !important;
    max-width: min(318px, calc(100vw - 72px)) !important;
    transform: none !important;
  }

body[dir="rtl"][data-theme] .visitor-dock {
    left: auto !important;
    right: 36px !important;
  }
}

/* Theme parity: the same pixel fixes and glass system apply in light and dark. */
body[data-theme="light"] {
  --lt-bg: #f7f1e7;
  --lt-ink: #171411;
  --lt-muted: rgba(23, 20, 17, 0.66);
  --lt-glass: rgba(255, 255, 255, 0.56);
  --lt-glass-strong: rgba(255, 255, 255, 0.74);
  --lt-stroke: rgba(65, 46, 34, 0.16);
  --lt-stroke-strong: rgba(65, 46, 34, 0.24);
  background:
    linear-gradient(180deg, #fbf7f0 0%, #f3eadf 54%, #efe4d7 100%) !important;
  color: var(--lt-ink) !important;
}

body[data-theme="light"]::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), transparent 34%),
    linear-gradient(120deg, rgba(255, 45, 104, 0.08), transparent 42%),
    linear-gradient(260deg, rgba(21, 125, 112, 0.08), transparent 42%);
}

body[data-theme="light"] .visitor-topbar {
  height: 58px !important;
  padding: 9px 16px !important;
  background: rgba(255, 251, 245, 0.72) !important;
  border: 0 !important;
  box-shadow: inset 0 -1px rgba(75, 56, 42, 0.1);
  backdrop-filter: blur(28px) saturate(1.45) !important;
  -webkit-backdrop-filter: blur(28px) saturate(1.45) !important;
}

body[data-theme="light"] .brand-wordmark {
  width: 94px !important;
  filter: none !important;
}

body[data-theme="light"] .brand-language-toggle {
  width: 34px !important;
  height: 34px !important;
  border-radius: 50% !important;
  color: #fff !important;
  background: rgba(190, 28, 79, 0.9) !important;
  border: 1px solid rgba(255, 255, 255, 0.76) !important;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.36),
    0 10px 24px rgba(190, 28, 79, 0.22) !important;
}

body[data-theme="light"] .theme-button {
  width: 38px !important;
  height: 38px !important;
  border-radius: 50% !important;
  color: #4f3c2f !important;
  background: rgba(255, 255, 255, 0.74) !important;
  border: 1px solid rgba(65, 46, 34, 0.16) !important;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.72),
    0 12px 30px rgba(76, 56, 42, 0.14) !important;
}

body[data-theme="light"] .visitor-home,
body[data-theme="light"] .journey-section.standalone,
body[data-theme="light"] .listening-screen {
  color: var(--lt-ink) !important;
}

body[data-theme="light"] .welcome-copy h1,
body[data-theme="light"] .route-hero-card h1,
body[data-theme="light"] .map-hero-card h1,
body[data-theme="light"] .now-copy h1,
body[data-theme="light"] .setup-hero h1,
body[data-theme="light"] .completion-card h1,
body[data-theme="light"] .transcript-card h2,
body[data-theme="light"] .guide-panel h2 {
  color: var(--lt-ink) !important;
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", Inter,
    "Noto Sans Arabic", system-ui, sans-serif !important;
  font-weight: 760 !important;
  letter-spacing: -0.01em !important;
}

body[data-theme="light"] .welcome-copy p,
body[data-theme="light"] .route-hero-card p,
body[data-theme="light"] .map-hero-card p,
body[data-theme="light"] .now-copy > p,
body[data-theme="light"] .setup-hero p,
body[data-theme="light"] .completion-card .muted,
body[data-theme="light"] .muted {
  color: var(--lt-muted) !important;
}

body[data-theme="light"] .primary-button {
  color: #fff !important;
  background:
    linear-gradient(180deg, rgba(255, 98, 139, 0.98), rgba(234, 35, 97, 0.94)) !important;
  border: 1px solid rgba(255, 255, 255, 0.72) !important;
  border-radius: 999px !important;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.34),
    0 18px 36px rgba(234, 35, 97, 0.22) !important;
}

body[data-theme="light"] .secondary-button,
body[data-theme="light"] .ghost-button,
body[data-theme="light"] .text-button {
  color: var(--lt-ink) !important;
  background: rgba(255, 255, 255, 0.68) !important;
  border: 1px solid var(--lt-stroke) !important;
  border-radius: 999px !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.66) !important;
}

body[data-theme="light"] .route-hero-card,
body[data-theme="light"] .map-hero-card,
body[data-theme="light"] .now-copy,
body[data-theme="light"] .transcript-card,
body[data-theme="light"] .guide-panel,
body[data-theme="light"] .route-tools,
body[data-theme="light"] .map-route-card,
body[data-theme="light"] .map-stop-list,
body[data-theme="light"] .setup-hero,
body[data-theme="light"] .choice-block,
body[data-theme="light"] .completion-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.46)),
    var(--lt-glass) !important;
  border: 1px solid var(--lt-stroke) !important;
  border-radius: 28px !important;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.76),
    0 22px 54px rgba(83, 61, 44, 0.16) !important;
  backdrop-filter: blur(30px) saturate(1.45) !important;
  -webkit-backdrop-filter: blur(30px) saturate(1.45) !important;
}

body[data-theme="light"] .home-progress-card,
body[data-theme="light"] .qr-search-entry,
body[data-theme="light"] .stop-card,
body[data-theme="light"] .shelf-card,
body[data-theme="light"] .up-next-card,
body[data-theme="light"] .map-stop-row,
body[data-theme="light"] .map-node,
body[data-theme="light"] .source-notebook-card,
body[data-theme="light"] .answer-box,
body[data-theme="light"] .mode-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.46)),
    rgba(255, 255, 255, 0.54) !important;
  border: 1px solid rgba(65, 46, 34, 0.13) !important;
  border-radius: 22px !important;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.7),
    0 14px 34px rgba(83, 61, 44, 0.12) !important;
  backdrop-filter: blur(24px) saturate(1.35);
  -webkit-backdrop-filter: blur(24px) saturate(1.35);
}

body[data-theme="light"] .soft-kicker,
body[data-theme="light"] .eyebrow,
body[data-theme="light"] .route-program-meta span,
body[data-theme="light"] .now-meta-row span,
body[data-theme="light"] .stop-overline {
  color: rgba(23, 20, 17, 0.68) !important;
  background: rgba(255, 255, 255, 0.64) !important;
  border: 1px solid var(--lt-stroke) !important;
  border-radius: 999px !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

body[data-theme="light"] .route-search-wrap,
body[data-theme="light"] .field,
body[data-theme="light"] .question-form input {
  color: var(--lt-ink) !important;
  background: rgba(255, 255, 255, 0.68) !important;
  border: 1px solid var(--lt-stroke) !important;
  border-radius: 999px !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.68) !important;
  backdrop-filter: blur(20px) saturate(1.35);
  -webkit-backdrop-filter: blur(20px) saturate(1.35);
}

body[data-theme="light"] .route-search-input,
body[data-theme="light"] .route-search-input::placeholder,
body[data-theme="light"] .field::placeholder {
  color: rgba(23, 20, 17, 0.48) !important;
}

body[data-theme="light"] .visitor-dock,
body[data-theme="light"] .start-dock,
body[data-theme="light"] .now-controls {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.5)),
    rgba(255, 255, 255, 0.62) !important;
  border: 1px solid rgba(65, 46, 34, 0.16) !important;
  border-radius: 30px !important;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.76),
    0 22px 58px rgba(83, 61, 44, 0.18) !important;
  backdrop-filter: blur(34px) saturate(1.55) !important;
  -webkit-backdrop-filter: blur(34px) saturate(1.55) !important;
}

body[data-theme="light"] .dock-item {
  color: rgba(23, 20, 17, 0.54) !important;
}

body[data-theme="light"] .dock-item.active {
  color: #fff !important;
  background:
    linear-gradient(180deg, rgba(255, 98, 139, 0.96), rgba(234, 35, 97, 0.9)) !important;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.32),
    0 10px 24px rgba(234, 35, 97, 0.18) !important;
}

body[data-theme="light"] .play-toggle,
body[data-theme="light"] .now-controls .play-toggle {
  color: #fff !important;
  background:
    linear-gradient(180deg, rgba(255, 98, 139, 1), rgba(234, 35, 97, 0.92)) !important;
  border-radius: 18px !important;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.28),
    0 12px 28px rgba(234, 35, 97, 0.22) !important;
}

body[data-theme="light"] .progress-track {
  background: rgba(23, 20, 17, 0.14) !important;
}

body[data-theme="light"] .progress-fill {
  background: linear-gradient(90deg, #e92361, #d29b35) !important;
}

body[data-theme="light"] .player-time {
  color: rgba(23, 20, 17, 0.58) !important;
}

body[data-theme="light"] .player-action-row button,
body[data-theme="light"] .rating-button,
body[data-theme="light"] .chip {
  color: var(--lt-ink) !important;
  background: rgba(255, 255, 255, 0.62) !important;
  border: 1px solid var(--lt-stroke) !important;
  border-radius: 16px !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.64) !important;
}

body[data-theme="light"] .rating-button.active,
body[data-theme="light"] .chip.active,
body[data-theme="light"] .mode-card.active {
  color: #fff !important;
  background: linear-gradient(180deg, rgba(255, 98, 139, 0.96), rgba(234, 35, 97, 0.88)) !important;
  border-color: rgba(255, 255, 255, 0.72) !important;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.28),
    0 14px 30px rgba(234, 35, 97, 0.18) !important;
}

body[data-theme="light"] .mobile-visual-strip,
body[data-theme="light"] .art-stack,
body[data-theme="light"] .setup-visual,
body[data-theme="light"] .mobile-now-art img,
body[data-theme="light"] .now-art img,
body[data-theme="light"] .stop-art img,
body[data-theme="light"] .route-featured-stop img,
body[data-theme="light"] .map-stop-row img {
  border-color: rgba(65, 46, 34, 0.14) !important;
}

body[data-theme] .route-tools-header h2 {
  margin: 0 !important;
}

body[data-theme] .route-stop-list {
  padding-bottom: 18px !important;
}

body[data-theme] .route-suggestion-row,
body[data-theme] .route-filter-row,
body[data-theme] .route-result-count,
body[data-theme] .stop-meta-row,
body[data-theme] .visit-pills,
body[data-theme] .route-proof,
body[data-theme] .trust-row {
  display: none !important;
}

@media (max-width: 640px) {
  body[data-theme] .setup-screen,
  body[data-theme] .completion.page {
    width: 100% !important;
    max-width: 100vw !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 18px !important;
    align-items: start !important;
    justify-items: center !important;
    padding: 18px 16px 112px !important;
    overflow: hidden !important;
  }

  body[data-theme] .completion.page {
    min-height: calc(100svh - 58px) !important;
    align-content: start !important;
    padding-top: 74px !important;
  }

  body[data-theme] .setup-hero,
  body[data-theme] .setup-stack,
  body[data-theme] .choice-block,
  body[data-theme] .completion-card {
    width: 100% !important;
    max-width: 430px !important;
    min-width: 0 !important;
  }

  body[data-theme] .setup-hero,
  body[data-theme] .choice-block,
  body[data-theme] .completion-card {
    border-radius: 28px !important;
  }

  body[data-theme] .setup-hero {
    position: relative !important;
    top: auto !important;
    padding: 16px 16px 20px !important;
    overflow: hidden !important;
  }

  body[data-theme] .setup-visual {
    width: 100% !important;
    height: 186px !important;
    margin: 0 0 18px !important;
    overflow: hidden !important;
    border-radius: 24px !important;
  }

  body[data-theme] .setup-visual-image {
    position: absolute !important;
    object-fit: cover !important;
    border-radius: 22px !important;
  }

  body[data-theme] .setup-visual .image-1 {
    left: -8px !important;
    top: 36px !important;
    width: 48% !important;
    height: 116px !important;
    opacity: 0.72 !important;
  }

  body[data-theme] .setup-visual .image-2 {
    left: 16% !important;
    top: 16px !important;
    width: 68% !important;
    height: 148px !important;
    z-index: 2 !important;
  }

  body[data-theme] .setup-visual .image-3 {
    right: -8px !important;
    top: 4px !important;
    width: 48% !important;
    height: 120px !important;
    opacity: 0.68 !important;
  }

  body[data-theme] .setup-hero .soft-kicker,
  body[data-theme] .completion-card .eyebrow,
  body[data-theme] .choice-block .eyebrow {
    width: fit-content !important;
    margin: 0 0 12px !important;
  }

  body[data-theme] .soft-kicker,
  body[data-theme] .eyebrow {
    width: fit-content !important;
    max-width: calc(100vw - 56px) !important;
  }

  body[data-theme] .setup-hero h1,
  body[data-theme] .completion-card h1 {
    max-width: 100% !important;
    margin: 0 !important;
    font-size: clamp(2.18rem, 9.4vw, 2.78rem) !important;
    line-height: 0.98 !important;
  }

  body[data-theme] .setup-hero p:not(.soft-kicker),
  body[data-theme] .completion-card .muted {
    max-width: 310px !important;
    margin: 14px 0 0 !important;
    font-size: 1rem !important;
    line-height: 1.45 !important;
  }

  body[data-theme] .setup-proof {
    display: none !important;
  }

  body[data-theme] .onboarding-progress {
    margin: 2px auto 16px !important;
  }

  body[data-theme] .choice-block {
    padding: 16px !important;
  }

  body[data-theme] .chip-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
  }

  body[data-theme] .chip {
    min-height: 44px !important;
    padding: 0 14px !important;
    border-radius: 16px !important;
    white-space: nowrap !important;
  }

  body[data-theme] .mode-strip {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  body[data-theme] .mode-card {
    min-height: 0 !important;
    padding: 15px !important;
    border-radius: 22px !important;
    text-align: start !important;
  }

  body[data-theme] .mode-card h3 {
    margin: 0 0 5px !important;
    font-size: 1rem !important;
    line-height: 1.2 !important;
  }

  body[data-theme] .mode-card p {
    margin: 0 !important;
    font-size: 0.88rem !important;
    line-height: 1.35 !important;
  }

  body[data-theme] .completion-card {
    padding: 24px !important;
    overflow: hidden !important;
  }

  body[data-theme] .completion-card .muted {
    max-width: 286px !important;
  }

  body[data-theme] .rating-row {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin: 12px 0 14px !important;
  }

  body[data-theme] .rating-button {
    width: 100% !important;
    min-width: 0 !important;
    height: 44px !important;
  }

  body[data-theme] .completion-card .field {
    width: 100% !important;
    min-height: 92px !important;
    padding: 14px 16px !important;
    border-radius: 24px !important;
    resize: vertical !important;
  }

  body[data-theme] .completion-card .inline-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  body[data-theme] .completion-card .inline-actions .primary-button {
    grid-column: 1 / -1 !important;
  }

  body[data-theme] .completion-card .inline-actions button {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 50px !important;
    padding-inline: 10px !important;
    font-size: 0.9rem !important;
    white-space: nowrap !important;
  }

  body[data-theme] .now-controls {
    overflow: hidden !important;
    padding: 10px !important;
  }

  body[data-theme] .now-controls .custom-player {
    width: 100% !important;
    min-width: 0 !important;
  }

  body[data-theme] .now-controls .player-main-row {
    grid-template-columns: 52px minmax(0, 1fr) minmax(70px, auto) !important;
    gap: 9px !important;
  }

  body[data-theme] .now-controls .player-time {
    font-size: 0.73rem !important;
    white-space: nowrap !important;
  }

  body[data-theme] .player-action-row {
    grid-template-columns: 0.72fr 1fr 0.72fr !important;
    gap: 7px !important;
  }

  body[data-theme] .player-action-row button {
    min-height: 38px !important;
    padding: 0 6px !important;
    border-radius: 17px !important;
    font-size: 0.75rem !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  body[data-theme] .route-tools {
    margin-top: 18px !important;
  }

  body[data-theme] .route-category-grid {
    display: none !important;
  }

  body[data-theme] .route-hero-card .route-hero-actions,
  body[data-theme] .map-hero-card .route-hero-actions {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0 !important;
    overflow: hidden !important;
  }

  body[data-theme] .route-hero-card .route-hero-actions button,
  body[data-theme] .map-hero-card .route-hero-actions button {
    width: min(292px, 100%) !important;
    max-width: min(292px, 100%) !important;
    min-width: 0 !important;
    justify-self: start !important;
    padding-inline: 8px !important;
    font-size: 0.9rem !important;
  }

  body[data-theme] .route-hero-card .route-hero-actions .secondary-button,
  body[data-theme] .map-hero-card .route-hero-actions .secondary-button {
    display: none !important;
  }

  body[data-theme] .route-search-wrap {
    width: 100% !important;
  }

  body[data-theme] .map-stop-list {
    padding-bottom: 92px !important;
  }
}

@media (max-width: 900px) and (max-height: 500px) {
  body[data-theme] .route-hero-card,
  body[data-theme] .map-hero-card,
  body[data-theme] .route-tools,
  body[data-theme] .route-stop-list,
  body[data-theme] .map-route-card,
  body[data-theme] .map-stop-list,
  body[data-theme] .now-playing-stage,
  body[data-theme] .listen-body,
  body[data-theme] .guide-workspace,
  body[data-theme] .setup-hero,
  body[data-theme] .setup-stack,
  body[data-theme] .choice-block,
  body[data-theme] .completion-card {
    width: min(334px, calc(100vw - 56px)) !important;
    max-width: min(334px, calc(100vw - 56px)) !important;
    min-width: 0 !important;
    margin-left: 28px !important;
    margin-right: 0 !important;
    justify-self: start !important;
  }

  body[dir="rtl"][data-theme] .route-hero-card,
  body[dir="rtl"][data-theme] .map-hero-card,
  body[dir="rtl"][data-theme] .route-tools,
  body[dir="rtl"][data-theme] .route-stop-list,
  body[dir="rtl"][data-theme] .map-route-card,
  body[dir="rtl"][data-theme] .map-stop-list,
  body[dir="rtl"][data-theme] .now-playing-stage,
  body[dir="rtl"][data-theme] .listen-body,
  body[dir="rtl"][data-theme] .guide-workspace,
  body[dir="rtl"][data-theme] .setup-hero,
  body[dir="rtl"][data-theme] .setup-stack,
  body[dir="rtl"][data-theme] .choice-block,
  body[dir="rtl"][data-theme] .completion-card {
    margin-left: 0 !important;
    margin-right: 28px !important;
  }

  body[data-theme] .now-copy {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 18px !important;
    justify-self: stretch !important;
  }

  body[data-theme] .route-hero-card h1,
  body[data-theme] .map-hero-card h1 {
    max-width: 288px !important;
    font-size: clamp(1.95rem, 8.4vw, 2.32rem) !important;
  }

  body[data-theme] .now-controls {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  body[data-theme] .now-controls .player-main-row {
    grid-template-columns: 48px minmax(0, 1fr) minmax(64px, auto) !important;
    gap: 8px !important;
  }

  body[data-theme] .now-controls .play-toggle {
    width: 48px !important;
    height: 48px !important;
  }

  body[data-theme] .player-action-row {
    grid-template-columns: 0.68fr 1fr 0.68fr !important;
  }

  body[data-theme] .player-action-row button {
    padding-inline: 4px !important;
    font-size: 0.72rem !important;
  }

  body[data-theme] .start-dock {
    position: fixed !important;
    left: 28px !important;
    right: auto !important;
    bottom: 12px !important;
    z-index: 180 !important;
    width: min(334px, calc(100vw - 56px)) !important;
    max-width: min(334px, calc(100vw - 56px)) !important;
    display: grid !important;
    grid-template-columns: 0.78fr 1fr !important;
    gap: 8px !important;
    padding: 6px !important;
    transform: none !important;
    margin: 0 !important;
  }

  body[dir="rtl"][data-theme] .start-dock {
    left: auto !important;
    right: 28px !important;
  }

  body[data-theme] .start-dock .primary-button,
  body[data-theme] .start-dock .secondary-button {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 52px !important;
    padding-inline: 10px !important;
    font-size: 0.88rem !important;
    white-space: nowrap !important;
  }

  body[data-theme] .visitor-dock {
    left: 36px !important;
    right: auto !important;
    width: min(318px, calc(100vw - 72px)) !important;
    max-width: min(318px, calc(100vw - 72px)) !important;
    transform: none !important;
  }

  body[dir="rtl"][data-theme] .visitor-dock {
    left: auto !important;
    right: 36px !important;
  }
}

@media (max-width: 640px) {
  body[data-theme="light"] .visitor-home {
    padding-top: 0 !important;
    padding-bottom: 92px !important;
  }

  body[data-theme="light"] .welcome-band.discovery-hero {
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 0 0 24px !important;
  }

  body[data-theme="light"] .welcome-copy {
    width: 100vw !important;
    max-width: 100vw !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  body[data-theme="light"] .mobile-visual-strip {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 300px !important;
    margin: 0 0 24px !important;
    border: 0 !important;
    border-radius: 0 0 30px 30px !important;
    overflow: hidden !important;
    box-shadow: 0 22px 50px rgba(83, 61, 44, 0.16) !important;
  }

  body[data-theme="light"] .mobile-visual-strip::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.02) 24%, rgba(238, 224, 207, 0.52) 100%) !important;
    pointer-events: none;
  }

  body[data-theme="light"] .mobile-visual-strip .image-1,
  body[data-theme="light"] .mobile-visual-strip .image-3 {
    display: none !important;
  }

  body[data-theme="light"] .mobile-visual-strip .image-2 {
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    opacity: 1 !important;
    object-fit: cover !important;
  }

  body[data-theme="light"] .visitor-home .soft-kicker {
    display: none !important;
  }

  body[data-theme="light"] .discovery-hero .welcome-copy h1,
  body[data-theme="light"] .discovery-hero .welcome-copy p,
  body[data-theme="light"] .hero-actions {
    width: calc(100vw - 48px) !important;
    margin-left: 24px !important;
    margin-right: 24px !important;
  }

  body[data-theme="light"] .discovery-hero .welcome-copy h1 {
    max-width: 342px !important;
    font-size: clamp(2.54rem, 11.4vw, 3.18rem) !important;
    line-height: 0.96 !important;
  }

  body[data-theme="light"] .discovery-hero .welcome-copy p {
    max-width: 330px !important;
    font-size: 1.02rem !important;
    line-height: 1.45 !important;
  }

  body[data-theme="light"] .hero-actions {
    display: grid !important;
    grid-template-columns: 1fr 0.72fr !important;
    gap: 10px !important;
    max-width: 342px !important;
  }

  body[data-theme="light"] .today-shelf {
    width: calc(100vw - 28px) !important;
    max-width: 430px !important;
    margin: -54px auto 0 !important;
    padding-top: 72px !important;
  }
}

body[data-theme] .soft-kicker,
body[data-theme] .eyebrow,
body[data-theme] .now-meta-row span,
body[data-theme] .route-program-meta span {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: fit-content !important;
  max-width: 100% !important;
  min-width: 0 !important;
  padding: 6px 10px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

@media (max-width: 640px) {
  body[data-theme] .visitor-home .hero-actions {
    width: min(342px, calc(100vw - 48px)) !important;
    max-width: min(342px, calc(100vw - 48px)) !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.72fr) !important;
    gap: 10px !important;
    margin: 14px 24px 0 !important;
    overflow: hidden !important;
  }

  body[data-theme] .visitor-home .hero-actions .primary-button,
  body[data-theme] .visitor-home .hero-actions .ghost-button {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 52px !important;
    padding-inline: 8px !important;
    white-space: nowrap !important;
  }
}

/* 3D motion layer: animated picture cards with reduced-motion safety. */
body[data-theme="dark"] {
  --depth-rim: rgba(255, 255, 255, 0.24);
  --depth-sheen: rgba(255, 255, 255, 0.32);
  --depth-glow: rgba(255, 45, 104, 0.32);
  --depth-card-shadow: 0 28px 70px rgba(0, 0, 0, 0.46);
  --depth-inner-shadow: inset 0 1px rgba(255, 255, 255, 0.22);
}

body[data-theme="light"] {
  --depth-rim: rgba(80, 56, 38, 0.18);
  --depth-sheen: rgba(255, 255, 255, 0.62);
  --depth-glow: rgba(234, 35, 97, 0.2);
  --depth-card-shadow: 0 28px 70px rgba(97, 70, 46, 0.18);
  --depth-inner-shadow: inset 0 1px rgba(255, 255, 255, 0.7);
}

body[data-theme] .route-hero-card,
body[data-theme] .map-hero-card,
body[data-theme] .now-copy,
body[data-theme] .setup-hero,
body[data-theme] .completion-card,
body[data-theme] .route-featured-stop,
body[data-theme] .shelf-card,
body[data-theme] .stop-card,
body[data-theme] .map-stop-row,
body[data-theme] .up-next-card {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --press-y: 0px;
  position: relative;
  isolation: isolate;
  transform:
    perspective(1100px)
    rotateX(var(--tilt-x))
    rotateY(var(--tilt-y))
    translate3d(0, var(--press-y), 0);
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform;
  transition:
    transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 220ms ease,
    border-color 220ms ease;
}

/* .now-copy hosts the fixed now-playing audio bar as a descendant. A non-none
   transform here would make .now-copy the containing block for that fixed
   child, breaking its viewport-anchored position and letting page content
   overlap it. Opt out of the shared tilt transform while keeping the
   position/isolation it needs for its ::before sheen. */
body[data-theme] .now-copy {
  transform: none;
  will-change: auto;
  transform-style: flat;
  backface-visibility: visible;
}

/* backdrop-filter also creates a containing block for fixed descendants, and
   the glass-surface rules above re-enable it on .now-copy at high enough
   specificity to beat the max-width:920px reset. Below that breakpoint
   .now-controls is docked as a fixed mini-player, so .now-copy must not
   capture it; above it .now-controls is in-flow and the glass blur is safe. */
@media (max-width: 920px) {
  body[data-theme] .now-copy {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

body[data-theme] .route-hero-card::before,
body[data-theme] .map-hero-card::before,
body[data-theme] .now-copy::before,
body[data-theme] .setup-hero::before,
body[data-theme] .completion-card::before,
body[data-theme] .route-featured-stop::before,
body[data-theme] .shelf-card::before,
body[data-theme] .stop-card::before,
body[data-theme] .map-stop-row::before,
body[data-theme] .up-next-card::before,
body[data-theme] .mobile-visual-strip::before,
body[data-theme] .setup-visual::before,
body[data-theme] .mobile-now-art::before,
body[data-theme] .art-stack::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(
      115deg,
      transparent 0%,
      transparent 34%,
      var(--depth-sheen) 46%,
      transparent 58%,
      transparent 100%
    );
  opacity: 0;
  transform: translateX(-42%) skewX(-10deg);
  mix-blend-mode: screen;
  transition: opacity 220ms ease, transform 620ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

body[data-theme] .route-hero-card:hover,
body[data-theme] .map-hero-card:hover,
body[data-theme] .now-copy:hover,
body[data-theme] .setup-hero:hover,
body[data-theme] .completion-card:hover,
body[data-theme] .route-featured-stop:hover,
body[data-theme] .shelf-card:hover,
body[data-theme] .stop-card:hover,
body[data-theme] .map-stop-row:hover,
body[data-theme] .up-next-card:hover {
  border-color: var(--depth-rim) !important;
  box-shadow: var(--depth-inner-shadow), var(--depth-card-shadow) !important;
}

body[data-theme] .route-hero-card:hover::before,
body[data-theme] .map-hero-card:hover::before,
body[data-theme] .now-copy:hover::before,
body[data-theme] .setup-hero:hover::before,
body[data-theme] .completion-card:hover::before,
body[data-theme] .route-featured-stop:hover::before,
body[data-theme] .shelf-card:hover::before,
body[data-theme] .stop-card:hover::before,
body[data-theme] .map-stop-row:hover::before,
body[data-theme] .up-next-card:hover::before {
  opacity: 0.72;
  transform: translateX(52%) skewX(-10deg);
}

body[data-theme] .mobile-visual-strip,
body[data-theme] .setup-visual,
body[data-theme] .mobile-now-art,
body[data-theme] .art-stack,
body[data-theme] .route-featured-stop,
body[data-theme] .stop-art,
body[data-theme] .shelf-card {
  perspective: 1000px;
  transform-style: preserve-3d;
}

body[data-theme] .mobile-visual-strip,
body[data-theme] .setup-visual,
body[data-theme] .mobile-now-art {
  box-shadow:
    0 24px 62px rgba(0, 0, 0, 0.2),
    0 0 0 1px var(--depth-rim) !important;
}

body[data-theme="light"] .mobile-visual-strip,
body[data-theme="light"] .setup-visual,
body[data-theme="light"] .mobile-now-art {
  box-shadow:
    0 24px 62px rgba(90, 66, 45, 0.18),
    0 0 0 1px var(--depth-rim) !important;
}

body[data-theme] .mobile-visual-strip img,
body[data-theme] .setup-visual-image,
body[data-theme] .art-stack-image,
body[data-theme] .mobile-now-art img,
body[data-theme] .route-featured-stop img,
body[data-theme] .shelf-card img,
body[data-theme] .stop-art img {
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform;
  transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1), filter 260ms ease;
}

body[data-theme] [data-depth-pressed="true"] img,
body[data-theme] [data-depth-pressed="true"] .setup-visual-image,
body[data-theme] [data-depth-pressed="true"] .mobile-visual-image {
  scale: 1.045;
  filter: saturate(1.14) contrast(1.05);
}

body[data-theme] .mobile-visual-strip[data-depth-pressed="true"] .image-1,
body[data-theme] .setup-visual[data-depth-pressed="true"] .image-1 {
  translate: 12px -12px;
  scale: 1.04;
}

body[data-theme] .mobile-visual-strip[data-depth-pressed="true"] .image-2,
body[data-theme] .setup-visual[data-depth-pressed="true"] .image-2,
body[data-theme] .mobile-now-art[data-depth-pressed="true"] img {
  translate: -6px -18px;
  scale: 1.07;
}

body[data-theme] .mobile-visual-strip[data-depth-pressed="true"] .image-3,
body[data-theme] .setup-visual[data-depth-pressed="true"] .image-3 {
  translate: -12px -10px;
  scale: 1.04;
}

body[data-theme] .route-featured-stop[data-depth-pressed="true"] img,
body[data-theme] .shelf-card[data-depth-pressed="true"] img,
body[data-theme] .stop-card[data-depth-pressed="true"] .stop-art img,
body[data-theme] .map-stop-row[data-depth-pressed="true"] img {
  translate: 0 -8px;
  scale: 1.085;
}

body[data-theme] .route-featured-stop img,
body[data-theme] .shelf-card img,
body[data-theme] .stop-art img,
body[data-theme] .mobile-now-art img {
  filter: saturate(1.05) contrast(1.02);
}

body[data-theme] .route-featured-stop:hover img,
body[data-theme] .shelf-card:hover img,
body[data-theme] .stop-card:hover .stop-art img,
body[data-theme] .mobile-now-art:hover img {
  transform: translateZ(34px) scale(1.045) rotateX(1deg);
  filter: saturate(1.12) contrast(1.04);
}

body[data-theme] .route-featured-stop span,
body[data-theme] .route-featured-stop strong,
body[data-theme] .shelf-card span,
body[data-theme] .shelf-card small,
body[data-theme] .stop-copy,
body[data-theme] .up-next-card span,
body[data-theme] .up-next-card strong {
  position: relative;
  z-index: 5;
  transform: translateZ(24px);
}

body[data-theme] .mobile-visual-strip .image-1,
body[data-theme] .mobile-visual-strip .image-2,
body[data-theme] .mobile-visual-strip .image-3 {
  display: block !important;
  object-fit: cover !important;
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.22),
    0 0 0 1px var(--depth-rim) !important;
}

@media (max-width: 640px) {
  body[data-theme] .mobile-visual-strip {
    overflow: hidden !important;
    background:
      radial-gradient(circle at 30% 18%, var(--depth-glow), transparent 34%),
      rgba(255, 255, 255, 0.04) !important;
  }

  body[data-theme] .mobile-visual-strip .image-1 {
    left: -9% !important;
    top: 72px !important;
    width: 58% !important;
    height: 172px !important;
    opacity: 0.74 !important;
    z-index: 1 !important;
    transform: translate3d(0, 0, 8px) rotateX(8deg) rotateY(-10deg) rotateZ(-8deg) !important;
  }

  body[data-theme] .mobile-visual-strip .image-2 {
    left: 14% !important;
    top: 44px !important;
    width: 76% !important;
    height: 208px !important;
    opacity: 1 !important;
    z-index: 3 !important;
    transform: translate3d(0, 0, 42px) rotateX(6deg) rotateY(8deg) rotateZ(4deg) !important;
  }

  body[data-theme] .mobile-visual-strip .image-3 {
    right: -9% !important;
    top: 92px !important;
    width: 54% !important;
    height: 156px !important;
    opacity: 0.7 !important;
    z-index: 2 !important;
    transform: translate3d(0, 0, 22px) rotateX(8deg) rotateY(12deg) rotateZ(9deg) !important;
  }

  body[data-theme] .setup-visual .image-1 {
    transform: translate3d(0, 0, 10px) rotateX(7deg) rotateY(-10deg) rotateZ(-7deg) !important;
  }

  body[data-theme] .setup-visual .image-2 {
    transform: translate3d(0, 0, 42px) rotateX(6deg) rotateY(8deg) rotateZ(4deg) !important;
  }

  body[data-theme] .setup-visual .image-3 {
    transform: translate3d(0, 0, 20px) rotateX(7deg) rotateY(10deg) rotateZ(8deg) !important;
  }
}

@media (prefers-reduced-motion: no-preference) {
  body[data-theme] .mobile-visual-strip .image-1,
  body[data-theme] .setup-visual .image-1 {
    animation: empowrdFloatLeft 7s ease-in-out infinite;
  }

  body[data-theme] .mobile-visual-strip .image-2,
  body[data-theme] .setup-visual .image-2,
  body[data-theme] .mobile-now-art img {
    animation: empowrdFloatCenter 6.2s ease-in-out infinite;
  }

  body[data-theme] .mobile-visual-strip .image-3,
  body[data-theme] .setup-visual .image-3 {
    animation: empowrdFloatRight 7.6s ease-in-out infinite;
  }

  body[data-theme] .route-featured-stop img,
  body[data-theme] .shelf-card img,
  body[data-theme] .stop-art img {
    animation: empowrdImageBreathe 8s ease-in-out infinite;
  }

  body[data-theme] .route-hero-card::before,
  body[data-theme] .map-hero-card::before,
  body[data-theme] .now-copy::before,
  body[data-theme] .setup-hero::before,
  body[data-theme] .completion-card::before,
  body[data-theme] .route-featured-stop::before,
  body[data-theme] .shelf-card::before,
  body[data-theme] .stop-card::before,
  body[data-theme] .mobile-visual-strip::before,
  body[data-theme] .setup-visual::before,
  body[data-theme] .mobile-now-art::before {
    animation: empowrdAmbientSheen 7.5s ease-in-out infinite;
  }
}

@keyframes empowrdFloatLeft {
  0%, 100% {
    translate: 0 0;
  }
  50% {
    translate: 8px -10px;
  }
}

@keyframes empowrdFloatCenter {
  0%, 100% {
    translate: 0 0;
  }
  50% {
    translate: -6px -12px;
  }
}

@keyframes empowrdFloatRight {
  0%, 100% {
    translate: 0 0;
  }
  50% {
    translate: -8px -8px;
  }
}

@keyframes empowrdImageBreathe {
  0%, 100% {
    transform: translateZ(0) scale(1);
  }
  50% {
    transform: translateZ(18px) scale(1.025);
  }
}

@keyframes empowrdAmbientSheen {
  0%, 36%, 100% {
    opacity: 0;
    transform: translateX(-44%) skewX(-10deg);
  }
  48%, 58% {
    opacity: 0.52;
  }
  72% {
    opacity: 0;
    transform: translateX(54%) skewX(-10deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-theme] .mobile-visual-strip img,
  body[data-theme] .setup-visual-image,
  body[data-theme] .art-stack-image,
  body[data-theme] .mobile-now-art img,
  body[data-theme] .route-featured-stop img,
  body[data-theme] .shelf-card img,
  body[data-theme] .stop-art img {
    animation: none !important;
    transition-duration: 0.01ms !important;
    scale: 1 !important;
    translate: 0 0 !important;
  }

  body[data-theme] .route-hero-card,
  body[data-theme] .map-hero-card,
  body[data-theme] .now-copy,
  body[data-theme] .setup-hero,
  body[data-theme] .completion-card,
  body[data-theme] .route-featured-stop,
  body[data-theme] .shelf-card,
  body[data-theme] .stop-card,
  body[data-theme] .map-stop-row,
  body[data-theme] .up-next-card {
    transform: none !important;
  }
}

@media (max-width: 900px) and (max-height: 500px) {
  body[data-theme="dark"] .route-hero-card,
  body[data-theme="dark"] .map-hero-card,
  body[data-theme="dark"] .route-tools,
  body[data-theme="dark"] .route-stop-list,
  body[data-theme="dark"] .map-route-card,
  body[data-theme="dark"] .map-stop-list,
  body[data-theme="dark"] .now-playing-stage,
  body[data-theme="dark"] .listen-body,
  body[data-theme="dark"] .guide-workspace,
  body[data-theme="dark"] .setup-hero,
  body[data-theme="dark"] .setup-stack,
  body[data-theme="dark"] .choice-block,
  body[data-theme="dark"] .completion-card {
    width: min(334px, calc(100vw - 56px)) !important;
    max-width: min(334px, calc(100vw - 56px)) !important;
    min-width: 0 !important;
    margin-left: 28px !important;
    margin-right: 0 !important;
  }

  body[dir="rtl"][data-theme="dark"] .route-hero-card,
  body[dir="rtl"][data-theme="dark"] .map-hero-card,
  body[dir="rtl"][data-theme="dark"] .route-tools,
  body[dir="rtl"][data-theme="dark"] .route-stop-list,
  body[dir="rtl"][data-theme="dark"] .map-route-card,
  body[dir="rtl"][data-theme="dark"] .map-stop-list,
  body[dir="rtl"][data-theme="dark"] .now-playing-stage,
  body[dir="rtl"][data-theme="dark"] .listen-body,
  body[dir="rtl"][data-theme="dark"] .guide-workspace,
  body[dir="rtl"][data-theme="dark"] .setup-hero,
  body[dir="rtl"][data-theme="dark"] .setup-stack,
  body[dir="rtl"][data-theme="dark"] .choice-block,
  body[dir="rtl"][data-theme="dark"] .completion-card {
    margin-left: 0 !important;
    margin-right: 28px !important;
  }

  body[data-theme="dark"] .setup-screen {
    overflow: visible !important;
    overflow-x: hidden !important;
  }

  body[data-theme="dark"] .completion.page {
    padding-top: 74px !important;
  }

  body[data-theme="dark"] .route-hero-card,
  body[data-theme="dark"] .map-hero-card,
  body[data-theme="dark"] .now-copy {
    padding: 18px !important;
  }

  body[data-theme="dark"] .route-hero-card h1,
  body[data-theme="dark"] .map-hero-card h1 {
    max-width: 288px !important;
    font-size: clamp(1.95rem, 8.4vw, 2.32rem) !important;
  }

  body[data-theme="dark"] .completion-card {
    padding: 24px !important;
  }

  body[data-theme="dark"] .completion-card h1 {
    font-size: clamp(2.02rem, 8.8vw, 2.42rem) !important;
  }

  body[data-theme="dark"] .completion-card .muted {
    max-width: 260px !important;
  }

  body[data-theme="dark"] .rating-row {
    width: 100% !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }

  body[data-theme="dark"] .rating-button {
    width: 100% !important;
  }

  body[data-theme="dark"] .now-controls {
    width: 100% !important;
    max-width: 100% !important;
  }

  body[data-theme="dark"] .now-controls .player-main-row {
    grid-template-columns: 48px minmax(0, 1fr) minmax(64px, auto) !important;
    gap: 8px !important;
  }

  body[data-theme="dark"] .now-controls .play-toggle {
    width: 48px !important;
    height: 48px !important;
  }

  body[data-theme="dark"] .player-action-row {
    grid-template-columns: 0.68fr 1fr 0.68fr !important;
  }

  body[data-theme="dark"] .player-action-row button {
    padding-inline: 4px !important;
    font-size: 0.72rem !important;
  }

  body[data-theme="dark"] .start-dock {
    z-index: 140 !important;
    width: min(334px, calc(100vw - 56px)) !important;
    max-width: min(334px, calc(100vw - 56px)) !important;
    left: 28px !important;
    right: auto !important;
    transform: none !important;
  }

  body[dir="rtl"][data-theme="dark"] .start-dock {
    left: auto !important;
    right: 28px !important;
  }

  body[data-theme="dark"] .visitor-dock {
    left: 36px !important;
    right: auto !important;
    width: min(318px, calc(100vw - 72px)) !important;
    max-width: min(318px, calc(100vw - 72px)) !important;
    transform: none !important;
  }

  body[dir="rtl"][data-theme="dark"] .visitor-dock {
    left: auto !important;
    right: 36px !important;
  }
}

/* Last-word mobile alignment fix for headless Chrome and real narrow phones. */
@media (max-width: 900px) and (max-height: 500px) {
  body[data-theme="dark"] .route-hero-card,
  body[data-theme="dark"] .map-hero-card,
  body[data-theme="dark"] .route-tools,
  body[data-theme="dark"] .route-stop-list,
  body[data-theme="dark"] .map-route-card,
  body[data-theme="dark"] .map-stop-list,
  body[data-theme="dark"] .now-playing-stage,
  body[data-theme="dark"] .listen-body,
  body[data-theme="dark"] .guide-workspace,
  body[data-theme="dark"] .setup-hero,
  body[data-theme="dark"] .setup-stack,
  body[data-theme="dark"] .choice-block,
  body[data-theme="dark"] .completion-card {
    width: min(334px, calc(100vw - 56px)) !important;
    max-width: min(334px, calc(100vw - 56px)) !important;
    min-width: 0 !important;
    margin-left: 28px !important;
    margin-right: 0 !important;
    justify-self: start !important;
  }

  body[dir="rtl"][data-theme="dark"] .route-hero-card,
  body[dir="rtl"][data-theme="dark"] .map-hero-card,
  body[dir="rtl"][data-theme="dark"] .route-tools,
  body[dir="rtl"][data-theme="dark"] .route-stop-list,
  body[dir="rtl"][data-theme="dark"] .map-route-card,
  body[dir="rtl"][data-theme="dark"] .map-stop-list,
  body[dir="rtl"][data-theme="dark"] .now-playing-stage,
  body[dir="rtl"][data-theme="dark"] .listen-body,
  body[dir="rtl"][data-theme="dark"] .guide-workspace,
  body[dir="rtl"][data-theme="dark"] .setup-hero,
  body[dir="rtl"][data-theme="dark"] .setup-stack,
  body[dir="rtl"][data-theme="dark"] .choice-block,
  body[dir="rtl"][data-theme="dark"] .completion-card {
    margin-left: 0 !important;
    margin-right: 28px !important;
  }

  body[data-theme="dark"] .now-copy {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    justify-self: stretch !important;
  }

  body[data-theme="dark"] .now-controls {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  body[data-theme="dark"] .start-dock {
    position: fixed !important;
    left: 28px !important;
    right: auto !important;
    bottom: 12px !important;
    z-index: 180 !important;
    width: min(334px, calc(100vw - 56px)) !important;
    max-width: min(334px, calc(100vw - 56px)) !important;
    display: grid !important;
    grid-template-columns: 0.78fr 1fr !important;
    transform: none !important;
    margin: 0 !important;
  }

  body[dir="rtl"][data-theme="dark"] .start-dock {
    left: auto !important;
    right: 28px !important;
  }

  body[data-theme="dark"] .visitor-dock {
    left: 36px !important;
    right: auto !important;
    width: min(318px, calc(100vw - 72px)) !important;
    max-width: min(318px, calc(100vw - 72px)) !important;
    transform: none !important;
  }

  body[dir="rtl"][data-theme="dark"] .visitor-dock {
    left: auto !important;
    right: 36px !important;
  }
}

/* Final mobile route-search polish after motion/theme overrides. */
@media (max-width: 640px) {
  body[data-theme] .route-tools {
    padding: 18px !important;
    overflow: hidden !important;
    border-radius: 30px !important;
  }

  body[data-theme] .route-tools-header {
    align-items: flex-start !important;
    margin: 0 0 14px !important;
  }

  body[data-theme] .route-tools-header .eyebrow {
    margin: 0 0 8px !important;
  }

  body[data-theme] .route-tools-header h2 {
    margin: 0 !important;
    line-height: 1.08 !important;
  }

  body[data-theme] .route-search-wrap {
    min-height: 56px !important;
  }

  body[data-theme="dark"] .route-tools {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.055)),
      rgba(34, 34, 32, 0.78) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    box-shadow:
      inset 0 1px rgba(255, 255, 255, 0.2),
      0 26px 68px rgba(0, 0, 0, 0.42) !important;
    backdrop-filter: blur(28px) saturate(1.3);
    -webkit-backdrop-filter: blur(28px) saturate(1.3);
  }
}

/* Library-style theme switch: compact, tactile, and topbar-safe. */
body[data-theme] .theme-switch {
  position: relative;
  width: 54px !important;
  min-width: 54px !important;
  height: 34px !important;
  min-height: 34px !important;
  display: inline-grid !important;
  place-items: center !important;
  padding: 0 !important;
  color: inherit !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 999px !important;
  box-shadow: none !important;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

body[data-theme] .theme-switch-track {
  position: relative;
  width: 52px;
  height: 34px;
  display: block;
  overflow: hidden;
  border-radius: 999px;
  transition:
    background 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease;
  backdrop-filter: blur(24px) saturate(1.45);
  -webkit-backdrop-filter: blur(24px) saturate(1.45);
}

body[data-theme="dark"] .theme-switch-track {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.17), rgba(255, 255, 255, 0.07)),
    rgba(33, 33, 32, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.22),
    inset 0 -12px 24px rgba(0, 0, 0, 0.18),
    0 12px 28px rgba(0, 0, 0, 0.3);
}

body[data-theme="light"] .theme-switch-track {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.58)),
    rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(68, 48, 34, 0.16);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.84),
    inset 0 -12px 24px rgba(97, 70, 46, 0.06),
    0 12px 28px rgba(97, 70, 46, 0.14);
}

body[data-theme] .theme-switch-thumb {
  position: absolute;
  top: 4px;
  left: 3px;
  z-index: 2;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  transition:
    transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1),
    background 220ms ease,
    box-shadow 220ms ease;
}

body[data-theme="dark"] .theme-switch-thumb {
  transform: translateX(20px);
  background:
    radial-gradient(circle at 62% 36%, rgba(255, 229, 165, 0.98) 0 22%, transparent 23%),
    linear-gradient(180deg, #f8d889, #d9a846);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.74),
    0 7px 16px rgba(0, 0, 0, 0.34),
    0 0 22px rgba(235, 184, 75, 0.34);
}

body[data-theme="light"] .theme-switch-thumb {
  transform: translateX(0);
  background:
    radial-gradient(circle at 34% 34%, rgba(255, 255, 255, 0.92) 0 16%, transparent 17%),
    linear-gradient(180deg, #fffdf8, #efe4d5);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.92),
    0 7px 16px rgba(97, 70, 46, 0.2);
}

body[data-theme] .theme-switch-glyph {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  opacity: 0.88;
  transition: opacity 180ms ease;
}

body[data-theme] .theme-switch-sun {
  left: 8px;
}

body[data-theme] .theme-switch-sun::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: #d59b2b;
  box-shadow:
    0 -6px 0 -3px #d59b2b,
    0 6px 0 -3px #d59b2b,
    6px 0 0 -3px #d59b2b,
    -6px 0 0 -3px #d59b2b,
    4px 4px 0 -3px #d59b2b,
    -4px -4px 0 -3px #d59b2b,
    4px -4px 0 -3px #d59b2b,
    -4px 4px 0 -3px #d59b2b;
}

body[data-theme] .theme-switch-moon {
  right: 8px;
}

body[data-theme] .theme-switch-moon::before {
  content: "";
  position: absolute;
  inset: 2px 3px 2px 1px;
  border-radius: 50%;
  background: #f2d083;
}

body[data-theme] .theme-switch-moon::after {
  content: "";
  position: absolute;
  inset: 1px 0 3px 6px;
  border-radius: 50%;
  background: rgba(35, 35, 34, 0.86);
}

body[data-theme="light"] .theme-switch-sun,
body[data-theme="dark"] .theme-switch-moon {
  opacity: 0;
}

body[data-theme] .theme-switch:hover .theme-switch-track {
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.28),
    inset 0 -12px 24px rgba(0, 0, 0, 0.14),
    0 16px 34px rgba(0, 0, 0, 0.2);
}

body[data-theme] .theme-switch:active .theme-switch-thumb {
  width: 29px;
}

body[data-theme="dark"] .theme-switch:active .theme-switch-thumb {
  transform: translateX(17px);
}

body[data-theme] .theme-switch:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.74) !important;
  outline-offset: 3px !important;
}

body[data-theme="light"] .theme-switch:focus-visible {
  outline-color: rgba(190, 28, 79, 0.42) !important;
}

body[data-theme] .visitor-topbar .top-actions {
  position: absolute !important;
  top: 50% !important;
  left: min(320px, calc(100vw - 68px)) !important;
  right: auto !important;
  grid-template-columns: 54px !important;
  width: 54px !important;
  max-width: 54px !important;
  transform: translateY(-50%) !important;
}

@media (max-width: 640px) {
  body[data-theme] .visitor-topbar {
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  body[data-theme] .app-shell > .visitor-topbar > .top-actions {
    position: absolute !important;
    top: 50% !important;
    left: min(320px, calc(100vw - 68px)) !important;
    right: auto !important;
    grid-template-columns: 54px !important;
    width: 54px !important;
    max-width: 54px !important;
    flex-basis: 54px !important;
    transform: translateY(-50%) !important;
  }

  body[data-theme] .app-shell > .visitor-topbar .theme-switch {
    width: 54px !important;
    min-width: 54px !important;
    height: 34px !important;
    min-height: 34px !important;
  }
}

/* RTL-safe visitor header and Radix-style language segmented control. */
body[data-theme] .visitor-topbar {
  width: 100vw !important;
  max-width: 100vw !important;
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  padding: 12px 18px !important;
  direction: ltr !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

body[dir="rtl"][data-theme] .visitor-topbar {
  direction: rtl !important;
}

body[data-theme] .visitor-topbar .brand-mark {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  max-width: none !important;
}

body[data-theme] .visitor-topbar .brand-copy {
  min-width: 0 !important;
}

body[data-theme] .visitor-topbar .brand-row {
  width: 100% !important;
  min-width: 0 !important;
}

body[data-theme] .visitor-topbar .brand-subtitle {
  display: none !important;
}

body[data-theme] .visitor-topbar .top-actions {
  position: static !important;
  inset: auto !important;
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: none !important;
  display: inline-flex !important;
  grid-template-columns: none !important;
  align-items: center !important;
  justify-content: center !important;
  transform: none !important;
}

body[data-theme] .language-switch {
  position: relative;
  flex: 0 0 auto;
  width: 82px;
  height: 34px;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 3px;
  border-radius: 999px;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(22px) saturate(1.45);
  -webkit-backdrop-filter: blur(22px) saturate(1.45);
}

body[data-theme="dark"] .language-switch {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.06)),
    rgba(34, 34, 32, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.18),
    0 12px 28px rgba(0, 0, 0, 0.26);
}

body[data-theme="light"] .language-switch {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.58)),
    rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(68, 48, 34, 0.15);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.8),
    0 12px 26px rgba(97, 70, 46, 0.13);
}

body[data-theme] .language-switch::before {
  content: "";
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  z-index: -1;
  width: calc(50% - 3px);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 93, 137, 0.98), rgba(222, 34, 94, 0.95));
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.32),
    0 8px 18px rgba(222, 34, 94, 0.28);
  transform: translateX(0);
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

body[data-theme] .language-switch.is-ar::before {
  transform: translateX(calc(100% + 0px));
}

body[data-theme] .language-option {
  position: relative;
  z-index: 1;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: color-mix(in srgb, var(--ink) 62%, transparent);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1;
  cursor: pointer;
}

body[data-theme] .language-option.active {
  color: #fff !important;
}

body[data-theme] .language-option:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.72);
  outline-offset: 2px;
}

body[data-theme="light"] .language-option:not(.active) {
  color: rgba(23, 20, 17, 0.58);
}

body[data-theme="dark"] .language-option:not(.active) {
  color: rgba(255, 247, 239, 0.62);
}

body[dir="rtl"][data-theme] .visitor-topbar .theme-switch-track,
body[dir="rtl"][data-theme] .visitor-topbar .language-switch {
  direction: ltr !important;
}

@media (max-width: 640px) {
  body[data-theme] .visitor-topbar {
    padding-inline: 20px 56px !important;
  }

  body[dir="rtl"][data-theme] .visitor-topbar {
    padding-inline: 56px 20px !important;
  }

  body[data-theme] .visitor-topbar .brand-wordmark {
    width: 96px !important;
    max-width: 96px !important;
  }
}

/* Swipeable hero picture stack. */
body[data-theme] .mobile-visual-strip[data-visual-carousel] {
  --drag-x: 0px;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

body[data-theme] .mobile-visual-strip[data-visual-carousel][data-dragging="true"] {
  cursor: grabbing;
}

body[data-theme] .mobile-visual-strip[data-visual-carousel] .mobile-visual-image {
  display: block !important;
  position: absolute !important;
  object-fit: cover !important;
  pointer-events: auto;
  animation: none !important;
  will-change: transform, opacity;
  transition:
    transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1),
    left 260ms cubic-bezier(0.2, 0.8, 0.2, 1),
    right 260ms cubic-bezier(0.2, 0.8, 0.2, 1),
    top 260ms cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 220ms ease,
    filter 220ms ease !important;
}

body[data-theme] .mobile-visual-strip[data-visual-carousel][data-dragging="true"] .mobile-visual-image {
  transition: none !important;
}

@media (max-width: 640px) {
  body[data-theme] .mobile-visual-strip[data-visual-carousel] .mobile-visual-image[data-slot="center"] {
    left: 13% !important;
    right: auto !important;
    top: 44px !important;
    width: 77% !important;
    height: 208px !important;
    opacity: 1 !important;
    z-index: 4 !important;
    filter: brightness(0.96) saturate(1.03) !important;
    transform:
      translate3d(var(--drag-x), 0, 48px)
      rotateX(5deg)
      rotateY(7deg)
      rotateZ(4deg) !important;
  }

  body[data-theme] .mobile-visual-strip[data-visual-carousel] .mobile-visual-image[data-slot="left"] {
    left: -10% !important;
    right: auto !important;
    top: 80px !important;
    width: 56% !important;
    height: 168px !important;
    opacity: 0.72 !important;
    z-index: 2 !important;
    filter: brightness(0.76) saturate(0.92) !important;
    transform:
      translate3d(calc(var(--drag-x) * 0.38), 0, 12px)
      rotateX(7deg)
      rotateY(-12deg)
      rotateZ(-8deg) !important;
  }

  body[data-theme] .mobile-visual-strip[data-visual-carousel] .mobile-visual-image[data-slot="right"] {
    left: auto !important;
    right: -10% !important;
    top: 92px !important;
    width: 54% !important;
    height: 156px !important;
    opacity: 0.7 !important;
    z-index: 3 !important;
    filter: brightness(0.78) saturate(0.94) !important;
    transform:
      translate3d(calc(var(--drag-x) * 0.38), 0, 22px)
      rotateX(8deg)
      rotateY(12deg)
      rotateZ(9deg) !important;
  }
}

/* Visitor header control cluster: one unit that mirrors correctly in RTL. */
body[data-theme] .visitor-controls {
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  direction: ltr !important;
  min-width: 0 !important;
}

body[data-theme] .visitor-controls .top-actions {
  position: static !important;
  inset: auto !important;
  width: auto !important;
  max-width: none !important;
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transform: none !important;
}

body[data-theme] .visitor-controls .language-switch {
  width: 72px !important;
  height: 34px !important;
  min-height: 34px !important;
}

body[data-theme] .visitor-controls .language-option {
  font-size: 0.7rem !important;
}

body[data-theme] .visitor-controls .theme-switch {
  width: 54px !important;
  min-width: 54px !important;
  height: 34px !important;
  min-height: 34px !important;
}

body[data-theme] .visitor-controls .theme-switch-track {
  width: 52px !important;
  height: 34px !important;
}

body[data-theme] .visitor-topbar .brand-mark {
  max-width: calc(100vw - 186px) !important;
}

@media (max-width: 640px) {
  body[data-theme] .visitor-topbar,
  body[dir="rtl"][data-theme] .visitor-topbar {
    padding-inline: 20px !important;
  }

  body[data-theme] .visitor-topbar .brand-wordmark {
    width: 96px !important;
    max-width: 96px !important;
  }

  body[data-theme] .visitor-controls {
    gap: 7px !important;
  }

  body[data-theme] .visitor-controls .language-switch {
    width: 70px !important;
  }
}

/* Branded, scannable QR kit. */
.qr-code-shell {
  width: 140px;
  height: 140px;
  display: grid;
  place-items: center;
  padding: 10px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(38, 29, 25, 0.12);
  border-radius: 22px;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.88),
    0 16px 38px rgba(42, 27, 23, 0.12);
}

.qr-code-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.qr-code-error {
  padding: 14px;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.25;
  text-align: center;
}

.qr-entry-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1.1fr);
  gap: 22px;
  align-items: center;
  margin-bottom: 18px;
}

.qr-entry-art {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 22px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 72, 125, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.34));
  border: 1px solid rgba(255, 255, 255, 0.26);
}

.qr-entry-art img {
  width: 138px;
  height: auto;
  object-fit: contain;
}

.qr-entry-art .qr-code-shell {
  width: min(210px, 100%);
  height: auto;
  aspect-ratio: 1;
  padding: 14px;
  border-radius: 30px;
}

.qr-preview .qr-code-shell {
  width: 140px;
  height: 140px;
  border-radius: 22px;
}

.qr-poster-screen {
  min-height: calc(100svh - 58px);
  display: grid;
  place-items: center;
  padding: 86px 20px 42px;
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 72, 125, 0.2), transparent 32%),
    radial-gradient(circle at 84% 78%, rgba(91, 211, 194, 0.14), transparent 34%);
}

.qr-poster-card {
  width: min(390px, calc(100vw - 40px));
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--depth-rim);
  border-radius: 34px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06)),
    rgba(255, 255, 255, 0.06);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.18),
    0 28px 70px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(26px) saturate(1.32);
  -webkit-backdrop-filter: blur(26px) saturate(1.32);
}

body[data-theme="dark"] .qr-poster-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(21, 16, 14, 0.82);
  border-color: rgba(244, 216, 183, 0.22);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.1),
    0 28px 70px rgba(0, 0, 0, 0.46);
}

body[data-theme="light"] .qr-poster-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.58)),
    rgba(255, 255, 255, 0.74);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.8),
    0 28px 70px rgba(97, 70, 46, 0.18);
}

.qr-poster-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.qr-poster-brand img {
  width: 118px;
  height: auto;
  object-fit: contain;
}

body[data-theme="dark"] .qr-poster-brand img {
  filter: invert(1);
}

.qr-poster-brand span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  text-align: end;
}

.qr-poster-code {
  display: grid;
  place-items: center;
  padding: 18px;
  border-radius: 30px;
  background:
    radial-gradient(circle at 26% 16%, rgba(255, 72, 125, 0.14), transparent 36%),
    rgba(255, 255, 255, 0.06);
}

.qr-poster-code .qr-code-shell {
  width: min(286px, 100%);
  height: auto;
  aspect-ratio: 1;
  padding: 16px;
  border-radius: 34px;
}

.qr-poster-copy {
  text-align: center;
}

.qr-poster-copy h1 {
  margin: 4px 0 8px;
  color: var(--ink);
  font-size: clamp(2.25rem, 11vw, 3.2rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.qr-poster-copy p:not(.eyebrow) {
  margin: 0 auto;
  max-width: 31ch;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.42;
}

.qr-url {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 11px 12px;
  overflow: hidden;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--depth-rim);
  border-radius: 16px;
  font-size: 0.68rem;
  line-height: 1.3;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-theme="light"] .qr-url {
  background: rgba(255, 255, 255, 0.54);
}

.qr-poster-card .hero-actions {
  width: 100%;
  margin: 0;
}

@media (max-width: 700px) {
  .qr-entry-card,
  .qr-preview {
    grid-template-columns: 1fr;
    overflow: hidden;
  }

  .qr-preview .qr-code-shell {
    width: 172px;
    height: 172px;
  }

  .qr-preview .muted.small,
  .qr-entry-card .muted.small {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

@media (max-width: 640px) {
  .qr-poster-screen {
    min-height: calc(100svh - 58px);
    place-items: start center;
    padding: 88px 18px 36px;
    overflow: hidden;
    box-sizing: border-box;
  }

  .qr-poster-card {
    width: min(360px, calc(100vw - 52px));
    max-width: min(360px, calc(100vw - 52px));
    padding: 20px;
    box-sizing: border-box;
    justify-self: center;
  }

  .qr-poster-brand span {
    max-width: 142px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .qr-poster-code {
    padding: 14px;
  }

  .qr-poster-code .qr-code-shell {
    width: min(248px, 100%);
    padding: 14px;
    border-radius: 30px;
  }

  .qr-poster-copy h1 {
    font-size: clamp(2.14rem, 10vw, 2.8rem);
  }

  .qr-poster-card .hero-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .qr-poster-card .hero-actions button {
    min-width: 0;
    padding-inline: 12px;
    white-space: nowrap;
  }
}

/* Hard mobile header placement for scroll-wider WebViews. */
@media (max-width: 640px) {
  body[data-theme] .visitor-topbar {
    position: sticky !important;
    justify-content: flex-start !important;
  }

  body[data-theme] .visitor-controls {
    position: absolute !important;
    top: 50% !important;
    left: min(286px, calc(100vw - 144px)) !important;
    right: auto !important;
    width: 126px !important;
    max-width: 126px !important;
    transform: translateY(-50%) !important;
  }

  body[dir="rtl"][data-theme] .visitor-controls {
    left: 20px !important;
    right: auto !important;
  }

  body[data-theme] .visitor-controls .language-switch {
    width: 67px !important;
  }

  body[data-theme] .visitor-controls .theme-switch {
    width: 52px !important;
    min-width: 52px !important;
  }

  body[data-theme] .visitor-controls .theme-switch-track {
    width: 50px !important;
  }

  body[data-theme] .visitor-topbar .brand-mark {
    max-width: 170px !important;
  }

  body[dir="rtl"][data-theme] .visitor-topbar .brand-mark {
    margin-inline-start: auto !important;
    margin-inline-end: 0 !important;
    justify-content: flex-start !important;
  }
}

/* RTL landing alignment: keep Arabic home content inside the phone viewport. */
@media (max-width: 640px) {
  body[dir="rtl"][data-theme] .visitor-home .welcome-copy,
  body[dir="rtl"][data-theme] .visitor-home .welcome-copy h1,
  body[dir="rtl"][data-theme] .visitor-home .welcome-copy p,
  body[dir="rtl"][data-theme] .visitor-home .hero-actions {
    width: min(342px, calc(100vw - 48px)) !important;
    max-width: min(342px, calc(100vw - 48px)) !important;
    margin-left: 24px !important;
    margin-right: 24px !important;
    text-align: right !important;
  }

  body[dir="rtl"][data-theme] .visitor-home .hero-actions {
    direction: rtl !important;
  }
}

/* Visitor content polish: map-led home, museum wording, and podcast-style stop tools. */
body[data-theme] .home-route-map {
  width: min(342px, 100%);
  margin: 16px 0 18px;
  padding: 12px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.055)),
    rgba(255, 255, 255, 0.055);
  border: 1px solid var(--depth-rim);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.16),
    0 18px 42px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(24px) saturate(1.35);
  -webkit-backdrop-filter: blur(24px) saturate(1.35);
}

body[data-theme="light"] .home-route-map {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.48)),
    rgba(255, 255, 255, 0.66);
  border-color: rgba(65, 46, 34, 0.14);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.72),
    0 16px 36px rgba(83, 61, 44, 0.12);
}

.home-map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 0.78rem;
}

.home-map-header span {
  color: var(--muted);
}

.home-map-header strong {
  color: var(--ink);
  font-size: 0.82rem;
}

.home-map-stage {
  position: relative;
  height: 152px;
  border-radius: 19px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.12)),
    url("../public/assets/images/route-map-heritage.png") center / cover no-repeat,
    rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.22),
    inset 0 -28px 42px rgba(0, 0, 0, 0.18);
}

body[data-theme="dark"] .home-map-stage {
  background:
    linear-gradient(180deg, rgba(8, 7, 6, 0.08), rgba(8, 7, 6, 0.34)),
    url("../public/assets/images/route-map-heritage.png") center / cover no-repeat,
    rgba(255, 255, 255, 0.08);
}

.home-map-path {
  display: none;
}

body[data-theme="light"] .home-map-path {
  border-color: rgba(65, 46, 34, 0.18);
  border-left-color: transparent;
  border-bottom-color: transparent;
}

.home-map-point {
  position: absolute;
  z-index: 2;
  width: 30px;
  height: 30px;
  min-height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.28),
    0 10px 24px rgba(38, 24, 20, 0.18);
  backdrop-filter: blur(8px) saturate(1.2);
  -webkit-backdrop-filter: blur(8px) saturate(1.2);
}

body[data-theme="light"] .home-map-point {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(65, 46, 34, 0.14);
}

.home-map-point span {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(180deg, rgba(255, 103, 143, 0.98), rgba(255, 45, 104, 0.9));
  border-radius: 50%;
  font-size: 0.56rem;
  font-weight: 850;
}

.home-map-point strong {
  display: none;
}

.home-map-point.active {
  border-color: rgba(255, 103, 143, 0.55);
}

.home-map-point.point-1 { left: 5%; top: 43%; }
.home-map-point.point-2 { left: 38%; top: 31%; }
.home-map-point.point-3 { right: 4%; top: 38%; }
.home-map-point.point-4 { right: 30%; top: 36%; }
.home-map-point.point-5 { left: 27%; bottom: 16%; }
.home-map-point.point-6 { left: 46%; bottom: 36%; }

/* The dedicated Map screen shows the same route-map image + pins as the
   Home preview, but full-width and more prominent. Widen the wrapper and
   let .home-map-stage grow via aspect-ratio (matching its calibrated
   342x152 preview proportions) so the "cover" background crop — and
   therefore the pin percentage positions above — stay geometrically
   identical, just scaled up. Do not change the aspect ratio or the pins
   will drift off their calibrated spots on the image. */
.map-screen .home-route-map {
  width: 100%;
  max-width: 100%;
  margin: 18px 0 0;
}

.map-screen .home-map-stage {
  height: auto;
  aspect-ratio: 342 / 152;
}

.home-map-caption {
  margin: 8px 2px 0 !important;
  color: var(--muted) !important;
  font-size: 0.74rem !important;
  line-height: 1.3 !important;
}

body[data-theme] .welcome-band.discovery-hero {
  overflow: visible !important;
}

@media (max-width: 640px) {
  body[data-theme] .welcome-band.discovery-hero {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  body[data-theme]:not([dir="rtl"]) .welcome-band.discovery-hero > .welcome-copy {
    width: 100% !important;
    max-width: 100% !important;
    flex-basis: 100% !important;
  }

  /* The rules below through the end of this media block were previously
     unwrapped and leaking mobile-only sizing (e.g. fixed ~390px card caps)
     into desktop/tablet widths, breaking wide-viewport layout (grid columns
     collapsing to near-zero width, single-letter title wrapping on the stop
     screen, etc). They are mobile polish and belong inside this query. */
  body[data-theme] .welcome-copy {
    position: relative;
  }

  body[data-theme] .welcome-copy::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -34px;
  height: 90px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(10, 10, 11, 0.36), transparent 86%);
}

body[data-theme="light"] .welcome-copy::after {
  background: linear-gradient(180deg, rgba(239, 228, 215, 0.54), transparent 86%);
}

body[data-theme] .discovery-card {
  width: min(390px, calc(100vw - 32px)) !important;
  max-width: min(390px, calc(100vw - 32px)) !important;
  margin: 20px auto 0 !important;
  overflow: hidden !important;
  border-radius: 28px !important;
}

body[data-theme] .discovery-card .art-stack,
body[data-theme] .discovery-card .art-stack-image {
  border-radius: 24px !important;
}

body[data-theme] .visit-card-copy {
  padding: 18px 20px 20px !important;
}

body[data-theme] .today-shelf {
  width: min(390px, calc(100vw - 28px)) !important;
  max-width: min(390px, calc(100vw - 28px)) !important;
  margin-inline: auto !important;
  background: transparent !important;
  box-shadow: none !important;
}

body[data-theme] .today-shelf .eyebrow {
  display: none !important;
}

body[data-theme] .today-shelf .section-heading {
  align-items: center !important;
  margin-bottom: 14px !important;
}

body[data-theme] .today-shelf .section-heading h2 {
  font-size: clamp(1.28rem, 6vw, 1.62rem) !important;
}

body[data-theme] .shelf-card {
  min-width: 250px !important;
  border-radius: 22px !important;
}

body[data-theme] .route-tools .eyebrow {
  display: none !important;
}

body[data-theme] .route-tools-header {
  align-items: center !important;
}

body[data-theme] .route-tools-header h2 {
  font-size: clamp(1.4rem, 6vw, 1.72rem) !important;
}

body[data-theme] .listening-screen {
  width: 100% !important;
  overflow-x: hidden !important;
}

body[data-theme] .now-playing-stage,
body[data-theme] .listener-drawer {
  width: min(390px, calc(100vw - 32px)) !important;
  max-width: min(390px, calc(100vw - 32px)) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

body[data-theme] .now-copy {
  width: 100% !important;
  max-width: 100% !important;
  border-radius: 28px !important;
}

body[data-theme] .mobile-now-art img {
  width: 100% !important;
  aspect-ratio: 16 / 10 !important;
  border-radius: 22px !important;
}

body[data-theme] .listener-drawer {
  display: block !important;
  padding: 14px !important;
  border-radius: 28px !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.055)),
    rgba(255, 255, 255, 0.055) !important;
  border: 1px solid var(--depth-rim) !important;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.16),
    0 24px 58px rgba(0, 0, 0, 0.3) !important;
  backdrop-filter: blur(28px) saturate(1.42);
  -webkit-backdrop-filter: blur(28px) saturate(1.42);
}

body[data-theme="light"] .listener-drawer {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.58)),
    rgba(255, 255, 255, 0.72) !important;
  border-color: rgba(65, 46, 34, 0.14) !important;
}

.listen-drawer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.listen-drawer-top > div:first-child {
  display: grid;
  gap: 2px;
}

.listen-drawer-top span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
}

.listen-drawer-top strong {
  color: var(--ink);
  font-size: 0.88rem;
}

.listen-tab-row {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

body[data-theme="light"] .listen-tab-row {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(65, 46, 34, 0.14);
}

.listen-tab-row button {
  min-height: 32px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.listen-tab-row button.active {
  color: #fff;
  background: linear-gradient(180deg, rgba(255, 103, 143, 0.98), rgba(255, 45, 104, 0.9));
  box-shadow: 0 8px 18px rgba(255, 45, 104, 0.22);
}

.listen-panel {
  display: none;
}

.listener-drawer[data-panel-mode="transcript"] .transcript-panel,
.listener-drawer[data-panel-mode="ask"] .ask-panel {
  display: grid;
  gap: 12px;
}

.panel-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.listener-drawer[data-audio-started="true"] .panel-hint {
  display: none;
}

.transcript-scroll {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition:
    max-height 240ms ease,
    opacity 200ms ease;
}

.listener-drawer[data-audio-started="true"] .transcript-scroll,
.listener-drawer[data-panel-mode="ask"] .transcript-scroll {
  max-height: 300px;
  overflow: auto;
  opacity: 1;
}

.transcript-scroll p {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.7;
}

.compact-source {
  margin: 0 !important;
  padding: 12px 14px !important;
  border-radius: 18px !important;
}

.chat-intro {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

body[data-theme="light"] .chat-intro {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(65, 46, 34, 0.14);
}

.chat-intro > span {
  width: 42px;
  height: 42px;
  display: block;
  border-radius: 16px;
  background:
    radial-gradient(circle at 38% 34%, rgba(255, 255, 255, 0.92), transparent 18%),
    linear-gradient(180deg, rgba(255, 103, 143, 0.98), rgba(255, 45, 104, 0.9));
}

.chat-intro strong {
  display: block;
  color: var(--ink);
  font-size: 1rem;
}

.chat-intro p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.listener-drawer .suggested-questions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.listener-drawer .suggested-questions > span {
  display: none;
}

.listener-drawer .suggested-questions button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.chat-composer {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 46px !important;
  gap: 8px !important;
}

.chat-composer .field {
  height: 48px !important;
}

.chat-composer .primary-button {
  width: 46px !important;
  min-width: 46px !important;
  height: 46px !important;
  min-height: 46px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  font-size: 1.2rem !important;
}

.chat-answer {
  padding: 12px 14px !important;
  border-radius: 18px !important;
}

.listen-drawer-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.listen-drawer-actions:has(.primary-button:only-child) {
  grid-template-columns: 1fr;
}

.listen-drawer-actions button {
  min-width: 0 !important;
}
}

@media (max-width: 640px) {
  body[data-theme] .home-route-map {
    width: min(342px, calc(100% - 48px)) !important;
    margin-inline: 24px auto !important;
    box-sizing: border-box !important;
  }

  body[data-theme] .visitor-home .home-map-caption {
    display: none !important;
  }

  body[data-theme] .now-playing-stage {
    padding: 0 !important;
  }

  body[data-theme] .now-copy {
    padding: 20px !important;
  }

  body[data-theme] .listen-body.listener-drawer {
    margin-top: 14px !important;
    margin-bottom: 104px !important;
  }
}

@media (max-width: 640px) {
  body[data-theme] .listening-screen .now-playing-stage,
  body[data-theme] .listening-screen .listener-drawer {
    width: calc(100vw - 40px) !important;
    max-width: calc(100vw - 40px) !important;
    box-sizing: border-box !important;
    margin-left: 20px !important;
    margin-right: 20px !important;
    justify-self: auto !important;
  }

  body[dir="rtl"][data-theme] .listening-screen .now-playing-stage,
  body[dir="rtl"][data-theme] .listening-screen .listener-drawer {
    margin-left: 20px !important;
    margin-right: 20px !important;
  }
}

@media (max-width: 640px) {
  body[data-theme] .now-controls {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    padding: 10px !important;
    box-sizing: border-box !important;
  }

  body[data-theme] .now-controls .custom-player {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  body[data-theme] .now-controls .player-main-row {
    width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: 52px minmax(0, 1fr) !important;
    gap: 10px !important;
    align-items: center !important;
  }

  body[data-theme] .now-controls .play-toggle {
    width: 52px !important;
    height: 52px !important;
  }

  body[data-theme] .now-controls .progress-track {
    min-width: 0 !important;
  }

  body[data-theme] .now-controls .player-time {
    grid-column: 2 !important;
    justify-self: start !important;
    margin-top: -8px !important;
    font-size: 0.72rem !important;
  }

  body[data-theme] .now-controls .player-action-row {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.2fr) minmax(0, 0.7fr) !important;
    gap: 8px !important;
  }

  body[data-theme] .now-controls .player-action-row button {
    width: 100% !important;
    min-width: 0 !important;
    height: 42px !important;
    min-height: 42px !important;
    padding: 0 4px !important;
    font-size: 0.76rem !important;
    white-space: nowrap !important;
  }
}

/* Final mobile QA pass: consistent visitor columns, centered chrome, and cleaner chips. */
@media (max-width: 640px) {
  body[data-theme] .visitor-topbar,
  body[dir="rtl"][data-theme] .visitor-topbar {
    left: 0 !important;
    right: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    padding-inline: 20px !important;
    transform: none !important;
  }

  body[data-theme] .visitor-dock,
  body[dir="rtl"][data-theme] .visitor-dock {
    left: 50% !important;
    right: auto !important;
    width: min(318px, calc(100vw - 48px)) !important;
    max-width: min(318px, calc(100vw - 48px)) !important;
    transform: translateX(-50%) !important;
  }

  body[dir="rtl"][data-theme] .visitor-dock {
    direction: rtl !important;
  }

  body[data-theme] .journey-section.standalone .route-hero-card,
  body[data-theme] .journey-section.standalone .route-tools,
  body[data-theme] .journey-section.standalone .route-stop-list,
  body[data-theme] .journey-section.standalone .map-route-card,
  body[data-theme] .journey-section.standalone .map-stop-list {
    width: min(390px, calc(100vw - 40px)) !important;
    max-width: min(390px, calc(100vw - 40px)) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    justify-self: center !important;
    box-sizing: border-box !important;
  }

  body[dir="rtl"][data-theme] .journey-section.standalone .route-hero-card,
  body[dir="rtl"][data-theme] .journey-section.standalone .route-tools,
  body[dir="rtl"][data-theme] .journey-section.standalone .route-stop-list,
  body[dir="rtl"][data-theme] .journey-section.standalone .map-route-card,
  body[dir="rtl"][data-theme] .journey-section.standalone .map-stop-list {
    margin-left: auto !important;
    margin-right: auto !important;
  }

  body[data-theme] .route-hero-card h1,
  body[data-theme] .map-hero-card h1 {
    max-width: 100% !important;
    font-size: clamp(2.12rem, 8.8vw, 2.48rem) !important;
    letter-spacing: 0 !important;
  }

  body[data-theme] .route-hero-card .route-hero-actions button,
  body[data-theme] .map-hero-card .route-hero-actions button {
    width: 100% !important;
    max-width: 100% !important;
    justify-self: stretch !important;
  }

  body[data-theme] .listener-drawer .suggested-questions {
    scrollbar-width: none;
  }

  body[data-theme] .listener-drawer .suggested-questions::-webkit-scrollbar {
    display: none;
  }
}

/* QR poster must anchor to the real mobile viewport, not inherited page grids. */
@media (max-width: 640px) {
  body[data-theme] .qr-poster-screen {
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    display: block !important;
    padding: 88px 0 36px !important;
    margin: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  body[data-theme] .qr-poster-card {
    width: calc(100vw - 40px) !important;
    max-width: 390px !important;
    margin-left: 20px !important;
    margin-right: 20px !important;
    justify-self: start !important;
    box-sizing: border-box !important;
  }

  body[data-theme] .qr-poster-code .qr-code-shell {
    width: min(248px, 100%) !important;
  }
}

/* Four-mode polish pass: keep EN/AR and light/dark visually equivalent. */
@media (max-width: 640px) {
  body[dir="rtl"][data-theme] .visitor-home .welcome-copy,
  body[dir="rtl"][data-theme] .visitor-home .welcome-copy h1,
  body[dir="rtl"][data-theme] .visitor-home .welcome-copy p,
  body[dir="rtl"][data-theme] .visitor-home .hero-actions,
  body[dir="rtl"][data-theme] .home-route-map {
    width: min(342px, calc(100vw - 88px)) !important;
    max-width: min(342px, calc(100vw - 88px)) !important;
    margin-left: 24px !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
  }

  body[dir="rtl"][data-theme] .visitor-home .hero-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body[data-theme] .listening-screen .now-playing-stage,
  body[data-theme] .listening-screen .listener-drawer,
  body[dir="rtl"][data-theme] .listening-screen .now-playing-stage,
  body[dir="rtl"][data-theme] .listening-screen .listener-drawer {
    width: calc(100vw - 40px) !important;
    max-width: calc(100vw - 40px) !important;
    margin-left: 20px !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
  }

  body[data-theme] .now-copy h1 {
    max-width: min(330px, 100%) !important;
    color: var(--ink) !important;
    font-size: clamp(2.1rem, 9vw, 2.46rem) !important;
    font-weight: 780 !important;
    line-height: 1.02 !important;
    letter-spacing: 0 !important;
  }

  body[dir="rtl"][data-theme] .now-copy h1 {
    max-width: 100% !important;
    font-size: clamp(1.82rem, 8.2vw, 2.24rem) !important;
    text-align: right !important;
  }

  body[dir="rtl"][data-theme] .listening-screen .now-playing-stage,
  body[dir="rtl"][data-theme] .listening-screen .listener-drawer {
    transform: translateX(-8px) !important;
  }

  body[data-theme] .qr-poster-copy,
  body[dir="rtl"][data-theme] .qr-poster-copy {
    text-align: center !important;
  }

  body[data-theme] .qr-poster-copy h1,
  body[dir="rtl"][data-theme] .qr-poster-copy h1 {
    width: auto !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
  }

  body[data-theme] .qr-poster-brand,
  body[dir="rtl"][data-theme] .qr-poster-brand {
    justify-content: center !important;
  }

  body[data-theme] .qr-poster-brand span {
    display: none !important;
  }

  body[data-theme] .qr-poster-card .qr-url,
  body[dir="rtl"][data-theme] .qr-poster-card .qr-url {
    width: calc(100% - 40px) !important;
    max-width: calc(100% - 40px) !important;
    justify-self: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
    direction: ltr !important;
    text-align: center !important;
  }

  body[dir="rtl"][data-theme] .qr-poster-card .qr-url {
    transform: translateX(20px) !important;
  }
}

/* Final visitor landing cleanup: the home screen is the QR entry point.
   Detailed browsing lives in Route/Explore, so the dock should feel like
   a compact liquid-glass control, not a heavy footer. */
body[data-theme] .visitor-dock,
body[dir="rtl"][data-theme] .visitor-dock {
  height: 70px !important;
  padding: 6px !important;
  gap: 5px !important;
  border-radius: 36px !important;
  overflow: hidden !important;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.72), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0.24)),
    rgba(255, 255, 255, 0.34) !important;
  border: 1px solid rgba(255, 255, 255, 0.48) !important;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.8),
    inset 0 -18px 34px rgba(75, 56, 41, 0.08),
    0 22px 52px rgba(83, 61, 44, 0.18) !important;
  backdrop-filter: blur(38px) saturate(1.75) !important;
  -webkit-backdrop-filter: blur(38px) saturate(1.75) !important;
}

body[data-theme="dark"] .visitor-dock,
body[dir="rtl"][data-theme="dark"] .visitor-dock {
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.24), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.075)),
    rgba(20, 18, 18, 0.56) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.24),
    inset 0 -18px 34px rgba(0, 0, 0, 0.18),
    0 24px 58px rgba(0, 0, 0, 0.42) !important;
}

body[data-theme] .visitor-dock .dock-item {
  min-height: 58px !important;
  height: 58px !important;
  border-radius: 30px !important;
  padding: 7px 4px 6px !important;
  color: rgba(23, 20, 17, 0.5) !important;
  background: transparent !important;
  box-shadow: none !important;
}

body[data-theme="dark"] .visitor-dock .dock-item {
  color: rgba(255, 250, 245, 0.6) !important;
}

body[data-theme] .visitor-dock .dock-item.active {
  color: #fff !important;
  background:
    radial-gradient(circle at 32% 0%, rgba(255, 255, 255, 0.42), transparent 40%),
    linear-gradient(180deg, rgba(255, 103, 143, 0.98), rgba(234, 35, 97, 0.9)) !important;
  border-radius: 30px !important;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.34),
    inset 0 -12px 20px rgba(124, 13, 56, 0.13),
    0 13px 26px rgba(234, 35, 97, 0.22) !important;
}

body[data-theme] .visitor-dock .dock-icon {
  width: 23px !important;
  height: 23px !important;
  transform: scale(1.14);
  transform-origin: center;
}

body[data-theme] .visitor-dock .dock-icon-home::before {
  left: 5px !important;
  top: 9px !important;
  width: 13px !important;
  height: 10px !important;
  border-width: 2px !important;
  border-radius: 3px !important;
}

body[data-theme] .visitor-dock .dock-icon-home::after {
  left: 5px !important;
  top: 4px !important;
  width: 12px !important;
  height: 12px !important;
  border-left-width: 2px !important;
  border-top-width: 2px !important;
}

body[data-theme] .visitor-dock .dock-icon-route::before {
  left: 2px !important;
  top: 2px !important;
  width: 13px !important;
  height: 13px !important;
  border-width: 2px !important;
}

body[data-theme] .visitor-dock .dock-icon-route::after {
  right: 2px !important;
  bottom: 3px !important;
  width: 8px !important;
  height: 2px !important;
}

body[data-theme] .visitor-dock .dock-icon-listen::before {
  left: 7px !important;
  top: 5px !important;
  border-top-width: 7px !important;
  border-bottom-width: 7px !important;
  border-left-width: 11px !important;
}

body[data-theme] .visitor-dock .dock-item strong {
  font-size: 0.7rem !important;
  line-height: 1.05 !important;
}
