:root {
  --bg: #f4f1ea;
  --bg-card: #fffdf8;
  --green-dark: #2d5a3d;
  --green-mid: #4a7c59;
  --green-light: #e8f0e9;
  --gold: #c9a227;
  --gold-soft: #f5ecd3;
  --text: #2a2a28;
  --text-muted: #5c5c56;
  --border: #ddd8cc;
  --shadow: 0 4px 24px rgba(45, 90, 61, 0.08);
  --radius: 14px;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(4.25rem + env(safe-area-inset-bottom, 0px));
}

body.modal-open {
  overflow: hidden;
}

a {
  color: var(--green-dark);
}

/* Hero — fast header */
.hero {
  position: sticky;
  top: 0;
  z-index: 40;
  flex-shrink: 0;
  background: linear-gradient(145deg, var(--green-dark) 0%, #3d6b4a 55%, #5a8f6a 100%);
  color: #fff;
  padding: 2.5rem 1.25rem 2rem;
  text-align: center;
}

.hero__top {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 36px;
  margin-bottom: 0.5rem;
}

.hero__logo {
  position: absolute;
  left: 0;
  top: 0;
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.12));
}

.hero__inner {
  padding: 0;
}

.hero__eyebrow {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
}

.hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 7vw, 2.75rem);
  font-weight: 600;
  line-height: 1.1;
}

.hero__meta {
  margin: 0.75rem 0 0;
  font-size: 1rem;
  opacity: 0.95;
}

.hero__hint {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  opacity: 0.8;
}

/* Tabs */
.tab-panels {
  flex: 1;
  touch-action: pan-y;
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
  animation: tab-enter 0.28s ease;
}

.tab-panel--from-left {
  animation-name: tab-enter-left;
}

.tab-panel--from-right {
  animation-name: tab-enter-right;
}

@keyframes tab-enter {
  from { opacity: 0.85; }
  to { opacity: 1; }
}

@keyframes tab-enter-left {
  from { opacity: 0.7; transform: translateX(-18px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes tab-enter-right {
  from { opacity: 0.7; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .tab-panel.is-active {
    animation: none;
  }
}

.tab-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
}

.tab-nav__btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.55rem 0.25rem 0.65rem;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
}

.tab-nav__btn.is-active {
  color: var(--green-dark);
}

.tab-nav__icon {
  font-size: 1.2rem;
  line-height: 1;
}

/* Main layout */
.main {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.25rem 1rem 1.5rem;
}

.main--more {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Filters */
.filters {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem 1rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}

.filters__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: none;
  background: transparent;
  padding: 0.25rem 0;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--green-dark);
  cursor: pointer;
}

.filters__toggle-icon {
  font-size: 0.9rem;
  opacity: 0.7;
}

.filters__body {
  margin-top: 0.75rem;
}

.filters__row {
  margin-bottom: 0.75rem;
}

.filters__row--grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.filter-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.filter-field input,
.filter-field select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  background: #fff;
  color: var(--text);
}

.filter-field input:focus,
.filter-field select:focus {
  outline: 2px solid var(--green-mid);
  outline-offset: 1px;
}

.filters__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
}

.view-toggle {
  display: flex;
  background: var(--green-light);
  border-radius: 10px;
  padding: 3px;
}

.view-btn {
  border: none;
  background: transparent;
  padding: 0.45rem 0.85rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  color: var(--green-dark);
}

.view-btn.active {
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.fav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: none;
  background: var(--green-light);
  padding: 0.45rem 0.85rem;
  border-radius: 10px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--green-dark);
}

.fav-toggle.active {
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  color: var(--green-dark);
}

.fav-toggle__icon {
  color: var(--gold);
  font-size: 1.35rem;
  line-height: 1;
}

.result-meta {
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Program */
.program {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.time-block__label {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--green-dark);
}

.parallel-hint {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

.parallel-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Session cards */
.session-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.session-card.is-favorite {
  border-color: var(--gold);
  box-shadow: 0 4px 20px rgba(201, 162, 39, 0.15);
}

.session-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.session-card__time {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--green-dark);
}

.favorite-btn {
  border: none;
  background: transparent;
  font-size: 1.85rem;
  line-height: 1;
  cursor: pointer;
  color: #ccc;
  padding: 0.1rem 0.15rem;
  min-width: 2rem;
  min-height: 2rem;
}

.favorite-btn.active {
  color: var(--gold);
}

.session-card__title {
  margin: 0.35rem 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.2;
}

.session-card__scene {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.session-card__desc {
  margin: 0.6rem 0;
  font-size: 0.925rem;
  color: var(--text);
}

.session-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.tag {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 999px;
  background: var(--green-light);
  color: var(--green-dark);
  text-transform: capitalize;
}

.tag-element {
  background: var(--gold-soft);
  color: #6b5510;
}

.badge {
  display: inline-block;
  margin: 0.25rem 0;
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 6px;
  background: #eef4ff;
  color: #3a5a8a;
}

.badge-moved {
  background: #fff3d6;
  color: #7a5a12;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 600;
}

.override-banner {
  margin: 0;
  padding: 0.65rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 500;
  color: #5c4510;
  background: #fff3d6;
  border-bottom: 1px solid #e8d49a;
}

.instructor-link {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--green-mid);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Scene sections */
.scene-section {
  margin-bottom: 1.5rem;
}

.scene-section__title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--green-dark);
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--green-light);
}

.scene-section__list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

.empty-state p {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

.btn {
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.btn-secondary {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
}

.btn-primary {
  border: none;
  background: var(--green-dark);
  color: #fff;
}

.btn-block {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Share buttons */
.share-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.share-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-height: 3.25rem;
  padding: 0.5rem 0.35rem;
  border-radius: 10px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
}

.share-btn--sms {
  background: var(--green-light);
  color: var(--green-dark);
  border-color: var(--green-mid);
}

.share-btn--email {
  background: #eef4ff;
  color: #3a5a8a;
  border-color: #b8cce8;
}

.share-btn--fb {
  background: #1877f2;
  color: #fff;
  border-color: #1877f2;
}

.cta-ticket-open {
  display: block;
  font-size: 0.85rem;
  color: var(--green-mid);
  text-align: center;
  padding: 0.25rem;
}

.card-hint {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.program-list {
  margin: 0;
  padding-left: 1.1rem;
}

.program-list li {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.share-preview {
  margin: 0.75rem 0 0;
  padding: 0.6rem 0.75rem;
  font-size: 0.75rem;
  word-break: break-all;
  background: var(--green-light);
  border-radius: 8px;
  color: var(--green-dark);
}

.share-status {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--green-mid);
}

.version-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Map */
.map-intro {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.map-wrap {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.festival-map {
  display: block;
  width: 100%;
  height: auto;
}

.map-bg {
  fill: #dce8d4;
}

.map-field {
  fill: #b8d4a8;
}

.map-building {
  fill: #c4a882;
}

.map-building--barn {
  fill: #d4b85a;
}

.map-building--private {
  fill: url(#map-hatch);
  stroke: #9a8a72;
  stroke-width: 1;
}

.map-building--toilet {
  fill: #b8a88a;
  stroke: rgba(45, 90, 61, 0.2);
  stroke-width: 1;
}

.map-hatch-line {
  stroke: rgba(90, 70, 50, 0.35);
  stroke-width: 2;
}

.map-court {
  fill: #9cb88a;
  stroke: #fff;
  stroke-width: 2;
}

.map-pool {
  fill: #6eb5d4;
}

.map-parking {
  fill: #e8e4dc;
  stroke: rgba(45, 90, 61, 0.15);
  stroke-width: 1;
}

.map-building--north {
  stroke: rgba(45, 90, 61, 0.12);
  stroke-width: 1;
}

.map-building--cafe {
  fill: #e8c878;
  stroke: rgba(45, 90, 61, 0.25);
  stroke-width: 1;
}

.map-staging {
  fill: #d4c4a8;
  stroke: rgba(45, 90, 61, 0.15);
  stroke-width: 1;
}

.map-entrance {
  stroke: #2d5a3d;
  stroke-width: 2.5;
  stroke-linecap: round;
}

.map-marker--center {
  transform: translate(-50%, -50%);
}

.map-marker--center:active {
  transform: translate(-50%, -50%) scale(0.95);
}

.map-marker--compact {
  width: 1.65rem;
  height: 1.65rem;
  font-size: 0.85rem;
  border-width: 1.5px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
}

.map-road {
  fill: #b0b0b0;
}

.map-divider {
  stroke: rgba(255, 255, 255, 0.6);
  stroke-width: 2;
}

.map-flagpole {
  fill: #8b7355;
  stroke: #fff;
  stroke-width: 1.5;
}

.map-compass text {
  fill: rgba(45, 90, 61, 0.45);
  font-size: 7px;
  font-family: var(--font-body);
  font-weight: 600;
}

.map-compass__n {
  fill: rgba(45, 90, 61, 0.7);
}

.map-label {
  fill: rgba(45, 90, 61, 0.55);
  font-size: 11px;
  font-family: var(--font-body);
  pointer-events: none;
}

.map-label--small {
  font-size: 9px;
}
.map-markers {
  position: absolute;
  inset: 0;
}

.map-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 2.5rem;
  height: 2.5rem;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--bg-card);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 1;
}

.map-marker--above {
  transform: translate(-50%, calc(-100% - 10px));
}

.map-marker:active {
  transform: translate(-50%, -50%) scale(0.95);
}

.map-marker--above:active {
  transform: translate(-50%, calc(-100% - 10px)) scale(0.95);
}

.map-legend {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}

.map-legend__btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 10px;
  padding: 0.5rem 0.6rem;
  font: inherit;
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
  color: var(--text);
}

/* Info cards */
.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}

.info-card h2 {
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--green-dark);
}

.info-card ul {
  margin: 0;
  padding-left: 1.1rem;
}

.info-card li {
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.info-card p {
  margin: 0.25rem 0;
  font-size: 0.9rem;
}

.info-card--muted {
  background: var(--green-light);
  border-color: transparent;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.modal__panel {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--bg-card);
  border-radius: 20px 20px 0 0;
  padding: 1.5rem 1.25rem 2rem;
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  background: var(--green-light);
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--green-dark);
}

.modal__body h2 {
  margin: 0 2rem 0.25rem 0;
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--green-dark);
}

.modal-role {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.modal-bio {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
}

.modal__body h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: var(--green-dark);
}

.modal-sessions {
  margin: 0;
  padding-left: 1.1rem;
}

.modal-sessions li {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.modal-scene {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Desktop tweaks */
@media (min-width: 600px) {
  .hero {
    padding: 3rem 2rem 2.5rem;
  }

  .hero__logo {
    width: 38px;
    height: 38px;
  }

  .hero__top {
    min-height: 40px;
  }

  .main {
    padding: 1.5rem 1.5rem 2.5rem;
  }

  .parallel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .map-legend {
    grid-template-columns: repeat(3, 1fr);
  }

  .modal {
    align-items: center;
    padding: 1rem;
  }

  .modal__panel {
    border-radius: var(--radius);
    max-height: 80vh;
  }
}
