/* ==========================================================
   Viaggio a Seoul — design tokens
   Palette ispirata al poster di viaggio: rosa, turchese,
   giallo e terracotta, con richiami alla Corea (taegeuk,
   hanok, torri, ponti) al posto dei simboli generici.
   ========================================================== */

:root{
  --pink: #F2A6C4;
  --pink-deep: #E983AC;
  --pink-pale: #FBE3ED;
  --teal: #4FC1C9;
  --teal-deep: #2FA3AC;
  --yellow: #F5C438;
  --orange: #E8703A;
  --orange-deep: #D65A28;
  --violet: #A88CE0;
  --violet-deep: #8362C9;
  --cream: #FFF8F0;
  --ink: #2B2233;
  --ink-soft: #6E6178;
  --white: #FFFFFF;

  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;

  --shadow-soft: 0 10px 30px rgba(43, 34, 51, 0.12);
  --shadow-pop: 0 16px 40px rgba(232, 112, 58, 0.25);

  --font-display: 'Mansalva', 'Fredoka', cursive;
  --font-body: 'Poppins', sans-serif;
}

*{ box-sizing: border-box; }

html, body{
  margin: 0;
  padding: 0;
  min-height: 100%;
  width: 100%;
  overflow-x: hidden;
}

body{
  font-family: var(--font-body);
  color: var(--ink);
  /* Il pattern fa parte dello sfondo della pagina (non di un livello fisso):
     così copre anche la zona sotto la barra di stato e il "rimbalzo" su iOS. */
  background:
    url('../icons/pattern.svg') top center / 420px auto repeat,
    radial-gradient(circle at 12% 8%, rgba(255,255,255,.5), transparent 40%),
    radial-gradient(circle at 90% 85%, rgba(255,255,255,.35), transparent 45%),
    linear-gradient(160deg, #F3E6D2 0%, #ECDBBF 55%, #E4CDA8 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

img{ max-width: 100%; display:block; }
button{ font-family: inherit; }
a{ color: inherit; }

/* ---------- App shell ---------- */

.app{
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  overflow-x: hidden;
}

/* ---------- Header ---------- */

.app-header{
  position: relative;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px 14px;
  background: transparent;
  border-bottom: 1px solid rgba(242, 166, 196, 0.35);
}

.header-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-logo{
  height: 100px;
  width: auto;
  flex-shrink: 0;
}

/* ---------- Pull to refresh ---------- */

.pull-refresh{
  height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: height .25s ease;
  z-index: 20;
}

.pull-refresh.dragging{ transition: none; }

.pull-refresh-inner{
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 18px;
  box-shadow: var(--shadow-soft);
}

.pull-refresh.refreshing .pull-refresh-inner i{
  animation: pull-refresh-spin .7s linear infinite;
}

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

.offline-toggle{
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  color: var(--pink-deep);
  box-shadow: var(--shadow-soft);
  flex-shrink: 0;
  transition: transform .15s ease, background .2s ease, color .2s ease;
}

.offline-toggle i{ font-size: 22px; }

.offline-toggle:active{ transform: scale(0.92); }

.offline-toggle.is-ready{
  background: linear-gradient(135deg, var(--teal), var(--teal-deep));
  color: var(--white);
}

.offline-toggle.is-loading{
  color: var(--ink-soft);
}

.offline-dot{
  position: absolute;
  top: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--yellow);
  border: 2px solid var(--cream);
  display: none;
}

.offline-toggle.is-ready .offline-dot{ display: block; background: var(--teal-deep); }

/* ---------- Content ---------- */

.app-content{
  flex: 1;
  padding: 18px 16px 130px;
  overflow-x: hidden;
}

.section-title{
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 400;
  color: #2B2B2B;
  text-shadow: none;
  margin: 6px 4px 4px;
}

.section-lead{
  color: #2B2B2B;
  font-size: 13.5px;
  font-weight: 600;
  margin: 0 4px 18px;
}

/* ---------- Toast (offline feedback) ---------- */

.toast{
  position: fixed;
  left: 50%;
  bottom: 108px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--cream);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 60;
  max-width: 90%;
  text-align: center;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.show{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Day cards (itinerary) ---------- */

.day-card{
  position: relative;
  background: var(--white);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.day-card-head{
  position: relative;
  width: 100%;
  padding: 22px 20px 18px;
  color: var(--white);
  overflow: hidden;
  background: none;
  border: none;
  margin: 0;
  display: block;
  text-align: left;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.day-card:nth-of-type(4n+1) .day-card-head{ background: linear-gradient(135deg, var(--orange), var(--orange-deep)); }
.day-card:nth-of-type(4n+2) .day-card-head{ background: linear-gradient(135deg, var(--teal), var(--teal-deep)); }
.day-card:nth-of-type(4n+3) .day-card-head{ background: linear-gradient(135deg, #F0A2C4, var(--pink-deep)); }
.day-card:nth-of-type(4n+4) .day-card-head{ background: linear-gradient(135deg, var(--yellow), #E0A420); }

.day-card:nth-of-type(4n+1) .stop-icon,
.day-card:nth-of-type(4n+1) .stop-number{ background: rgba(232,112,58,0.14); color: var(--orange-deep); }
.day-card:nth-of-type(4n+2) .stop-icon,
.day-card:nth-of-type(4n+2) .stop-number{ background: rgba(79,193,201,0.16); color: var(--teal-deep); }
.day-card:nth-of-type(4n+3) .stop-icon,
.day-card:nth-of-type(4n+3) .stop-number{ background: var(--pink-pale); color: var(--pink-deep); }
.day-card:nth-of-type(4n+4) .stop-icon,
.day-card:nth-of-type(4n+4) .stop-number{ background: rgba(245,196,56,0.2); color: #B9800F; }

.day-card:nth-of-type(4n+1) .stop-address i,
.day-card:nth-of-type(4n+1) .stop-switch-btn.active,
.day-card:nth-of-type(4n+1) .stop-time{ color: var(--orange-deep); }
.day-card:nth-of-type(4n+2) .stop-address i,
.day-card:nth-of-type(4n+2) .stop-switch-btn.active,
.day-card:nth-of-type(4n+2) .stop-time{ color: var(--teal-deep); }
.day-card:nth-of-type(4n+3) .stop-address i,
.day-card:nth-of-type(4n+3) .stop-switch-btn.active,
.day-card:nth-of-type(4n+3) .stop-time{ color: var(--pink-deep); }
.day-card:nth-of-type(4n+4) .stop-address i,
.day-card:nth-of-type(4n+4) .stop-switch-btn.active,
.day-card:nth-of-type(4n+4) .stop-time{ color: #B9800F; }

.day-card:nth-of-type(4n+1) .stop-switch{ background: rgba(232,112,58,0.14); }
.day-card:nth-of-type(4n+2) .stop-switch{ background: rgba(79,193,201,0.16); }
.day-card:nth-of-type(4n+3) .stop-switch{ background: var(--pink-pale); }
.day-card:nth-of-type(4n+4) .stop-switch{ background: rgba(245,196,56,0.2); }

.day-number{
  position: absolute;
  right: 6px;
  top: -22px;
  font-family: var(--font-display);
  font-size: 96px;
  font-weight: 600;
  color: rgba(255,255,255,0.22);
  line-height: 1;
  user-select: none;
  pointer-events: none;
}

.day-eyebrow{
  font-size: 11.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .85;
  font-weight: 600;
}

.day-title{
  font-family: var(--font-display);
  font-size: 27px;
  margin: 2px 0 2px;
  position: relative;
  z-index: 1;
}

.day-subtitle{
  font-size: 12.5px;
  opacity: .92;
  position: relative;
  z-index: 1;
}

.day-chevron{
  position: absolute;
  right: 18px;
  bottom: 16px;
  z-index: 2;
  font-size: 18px;
  color: rgba(255,255,255,0.85);
  transition: transform .25s ease;
}

.day-card.open .day-chevron{ transform: rotate(180deg); }

.day-card-body{
  max-height: 0;
  overflow: hidden;
  transition: max-height .32s ease;
}

.audio-list .day-card-body{
  max-height: none;
  overflow: visible;
}

.day-card-body-inner{
  padding: 6px 16px 16px;
}

.stop{
  border-bottom: 1px dashed rgba(43,34,51,0.12);
}

.stop:last-child{ border-bottom: none; }

.stop-header{
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 6px;
  background: none;
  border: none;
  margin: 0;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.stop-chevron{
  flex-shrink: 0;
  margin-left: auto;
  font-size: 16px;
  color: var(--ink-soft);
  transition: transform .25s ease;
}

.stop.open .stop-chevron{ transform: rotate(180deg); }

.stop-details{
  max-height: 0;
  overflow: hidden;
  transition: max-height .28s ease;
}

.stop-details-inner{
  padding: 0 6px 14px;
}

.stop-numbered .stop-details-inner{
  padding: 0 6px 14px;
}

.stop-icon{
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--pink-pale);
  color: var(--orange-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.stop-body{ min-width: 0; }

.stop-time{
  font-size: 11px;
  font-weight: 600;
  color: var(--teal-deep);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.stop-title{
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15.5px;
  margin: 2px 0 3px;
  color: var(--ink);
}

.stop-desc{
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 0 0 4px;
}

.stop-address{
  font-size: 11.5px;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 5px;
}

.stop-address i{ color: var(--orange); }

.stop-link{
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--orange-deep);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
}
.stop-link:hover{ text-decoration: underline; }

.stop-number{
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--pink-pale);
  color: var(--orange-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
}

.stop-switch{
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--pink-pale);
  border-radius: 999px;
  padding: 3px;
  flex-shrink: 0;
}

.stop-switch-btn{
  border: none;
  background: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 13px;
  -webkit-tap-highlight-color: transparent;
}

.stop-switch-btn.active{
  background: var(--white);
  color: var(--orange-deep);
  box-shadow: var(--shadow-soft);
}

.stop-view.hidden{ display: none; }

.stop-tip{
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-soft);
  background: var(--pink-pale);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-top: 4px;
}

.stop-tip i{ color: var(--yellow); font-size: 14px; margin-top: 1px; flex-shrink: 0; }

.stop-map{
  width: 100%;
  height: 180px;
  border: none;
  border-radius: var(--radius-sm);
  display: block;
}

/* ---------- Voli — carte d'imbarco ---------- */

.flight-group{ margin-bottom: 22px; }
.flight-group:last-child{ margin-bottom: 0; }

.flight-group-head{
  margin: 0 0 12px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  color: var(--white);
  background: linear-gradient(135deg, var(--teal), var(--teal-deep));
  box-shadow: var(--shadow-soft);
}

.flight-group:nth-of-type(4n+2) .flight-group-head{ background: linear-gradient(135deg, var(--orange), var(--orange-deep)); }
.flight-group:nth-of-type(4n+3) .flight-group-head{ background: linear-gradient(135deg, #F0A2C4, var(--pink-deep)); }
.flight-group:nth-of-type(4n+4) .flight-group-head{ background: linear-gradient(135deg, var(--yellow), #E0A420); }

.flight-group-date{
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  opacity: .85;
  margin-bottom: 2px;
}

.flight-group-title{
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 24px;
  margin: 0;
}

/* --- singolo biglietto (una tratta) --- */

.boarding-pass{
  position: relative;
  display: flex;
  background: var(--white);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  margin-bottom: 12px;
}

.boarding-pass:last-of-type{ margin-bottom: 12px; }

.bp-main{
  flex: 1 1 auto;
  min-width: 0;
  padding: 16px 14px 14px 16px;
}

.bp-airline{
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--teal-deep);
  margin-bottom: 12px;
}

.bp-airline i{ font-size: 14px; }

.bp-route{
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 25px;
  color: var(--ink);
  margin-bottom: 16px;
}

.bp-route-code{ flex-shrink: 0; }

.bp-route-line{
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal-deep);
  font-size: 15px;
  min-width: 24px;
}

.bp-route-line::before{
  content: '';
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1.5px;
  background: currentColor;
  opacity: .4;
}

.bp-route-line i{
  position: relative;
  z-index: 1;
  background: var(--white);
  padding: 0 4px;
}

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

.bp-field{ display: flex; flex-direction: column; gap: 1px; min-width: 0; }

.bp-field-label{
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-soft);
}

.bp-field-value{
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 1px;
}

.bp-field-sub{
  font-size: 11px;
  color: var(--ink-soft);
  line-height: 1.3;
  margin-top: 1px;
}

.bp-duration{
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-soft);
  padding-top: 10px;
  border-top: 1px dashed rgba(43,34,51,0.16);
}

.bp-duration i{ color: var(--teal-deep); font-size: 14px; }

.bp-stub{
  flex: 0 0 92px;
  width: 92px;
  position: relative;
  padding: 16px 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  border-left: 2px dashed rgba(43,34,51,0.18);
  background: var(--cream);
}

.bp-stub::before,
.bp-stub::after{
  content: '';
  position: absolute;
  left: -9px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--cream);
  box-shadow: inset 0 0 0 1px rgba(43,34,51,0.04);
  z-index: 2;
}

.bp-stub::before{ top: -9px; }
.bp-stub::after{ bottom: -9px; }

.bp-stub-icon{
  font-size: 17px;
  color: var(--teal-deep);
  transform: rotate(90deg);
}

.bp-stub-field{ text-align: center; }

.bp-stub-label{
  display: block;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-soft);
}

.bp-stub-value{
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 1px;
}

.bp-barcode{
  margin-top: auto;
  width: 100%;
  height: 30px;
  background-image: repeating-linear-gradient(90deg,
    var(--ink-soft) 0px, var(--ink-soft) 2px, transparent 2px, transparent 4px,
    var(--ink-soft) 4px, var(--ink-soft) 5px, transparent 5px, transparent 9px,
    var(--ink-soft) 9px, var(--ink-soft) 10px, transparent 10px, transparent 14px);
  opacity: .55;
}

/* accento colore a rotazione per gruppo di volo (coerente col resto dell'app) */

.flight-group:nth-of-type(4n+2) .bp-airline,
.flight-group:nth-of-type(4n+2) .bp-route-line,
.flight-group:nth-of-type(4n+2) .bp-duration i,
.flight-group:nth-of-type(4n+2) .bp-stub-icon{ color: var(--orange-deep); }

.flight-group:nth-of-type(4n+3) .bp-airline,
.flight-group:nth-of-type(4n+3) .bp-route-line,
.flight-group:nth-of-type(4n+3) .bp-duration i,
.flight-group:nth-of-type(4n+3) .bp-stub-icon{ color: var(--pink-deep); }

.flight-group:nth-of-type(4n+4) .bp-airline,
.flight-group:nth-of-type(4n+4) .bp-route-line,
.flight-group:nth-of-type(4n+4) .bp-duration i,
.flight-group:nth-of-type(4n+4) .bp-stub-icon{ color: #B9800F; }

/* --- scalo --- */

.flight-layover{
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-soft);
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  margin: 0 0 12px;
  box-shadow: var(--shadow-soft);
}

.flight-layover i{ color: var(--yellow); font-size: 15px; flex-shrink: 0; }

/* --- numero di prenotazione --- */

.flight-booking-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--white);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
}

.flight-booking-left{
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.flight-booking-label{
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 700;
}

.flight-booking-label i{ color: var(--teal-deep); font-size: 13px; }

.flight-group:nth-of-type(4n+2) .flight-booking-label i{ color: var(--orange-deep); }
.flight-group:nth-of-type(4n+3) .flight-booking-label i{ color: var(--pink-deep); }
.flight-group:nth-of-type(4n+4) .flight-booking-label i{ color: #B9800F; }

.flight-booking-code{
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--ink);
}

.flight-copy-btn{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: var(--pink-pale);
  color: var(--teal-deep);
  cursor: pointer;
  font-size: 15px;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.flight-group:nth-of-type(4n+2) .flight-copy-btn{ color: var(--orange-deep); }
.flight-group:nth-of-type(4n+3) .flight-copy-btn{ color: var(--pink-deep); }
.flight-group:nth-of-type(4n+4) .flight-copy-btn{ color: #B9800F; }

/* ---------- Empty state (voli / audioguida / speaker) ---------- */

.empty-state{
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 46px 26px;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.empty-state i{
  font-size: 46px;
  color: var(--orange);
  margin-bottom: 14px;
  display: inline-block;
}

.empty-state h3{
  font-family: var(--font-display);
  font-size: 18px;
  margin: 0 0 6px;
}

.empty-state p{
  font-size: 13.5px;
  color: var(--ink-soft);
  margin: 0;
}

/* ---------- Loading state ---------- */

.loading-state{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 60px 0;
  color: var(--white);
}

.spinner{
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.4);
  border-top-color: var(--white);
  animation: spin 0.8s linear infinite;
}

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

/* ---------- Mappa ---------- */

.map-tabs{
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 14px;
  margin: 0 -2px;
  scrollbar-width: none;
}

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

.map-tab{
  flex-shrink: 0;
  border: 1px solid rgba(43,34,51,0.1);
  background: var(--white);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: .02em;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .15s ease, box-shadow .2s ease, color .2s ease;
  --tab-c1: var(--orange);
  --tab-c2: var(--orange-deep);
}

.map-tab:active{ transform: scale(0.95); }

.map-tab.active{
  color: var(--white);
  border-color: transparent;
  background: linear-gradient(135deg, var(--tab-c1), var(--tab-c2));
  box-shadow: var(--shadow-pop);
}

.map-day-heading{
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-soft);
  background: linear-gradient(135deg, var(--heading-c1, var(--orange)), var(--heading-c2, var(--orange-deep)));
}

.map-day-heading .map-day-title{
  font-family: var(--font-display);
  font-size: 27px;
  color: var(--white);
  line-height: 1.15;
}

.map-day-heading .map-day-subtitle{
  font-size: 12.5px;
  color: rgba(255,255,255,0.85);
  margin-top: 2px;
}

.map-wrap{
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  margin-bottom: 16px;
  border: 1px solid rgba(255,255,255,0.6);
}

.leaflet-map{
  width: 100%;
  height: 320px;
  background: var(--cream);
}

.leaflet-map .leaflet-tile-pane{
  filter: grayscale(0.25) sepia(0.32) saturate(0.55) brightness(1.18) contrast(0.92);
}

.leaflet-map .leaflet-control-zoom a{
  font-family: var(--font-body);
  color: var(--ink);
  border-color: rgba(43,34,51,0.12) !important;
}

.leaflet-map .leaflet-control-attribution{
  background: rgba(253,247,237,0.75) !important;
  font-size: 9.5px !important;
}

.map-no-coord-note{
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-soft);
  background: var(--pink-pale);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin: 0 0 16px;
}

.map-no-coord-note i{ color: var(--orange); font-size: 15px; flex-shrink: 0; }

.map-pin{
  width: 30px;
  height: 30px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2px solid var(--white);
  box-shadow: 0 4px 10px rgba(43,34,51,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-pin span{
  transform: rotate(45deg);
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12px;
}

.map-popup .leaflet-popup-content-wrapper{
  border-radius: var(--radius-sm);
  background: var(--white);
}

.map-popup .leaflet-popup-tip{
  background: var(--white);
}

.map-popup-title{
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
}

.map-popup-time{
  font-size: 11px;
  font-weight: 600;
  color: var(--popup-c, var(--teal-deep));
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-top: 2px;
}

.map-stop-list{
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  margin-bottom: 20px;
}

.map-stop-item{
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border: none;
  border-bottom: 1px dashed rgba(43,34,51,0.12);
  background: none;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.map-stop-item:last-child{ border-bottom: none; }

.map-stop-item-plain{ cursor: default; }

.map-stop-num{
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--list-c, var(--orange-deep)) 16%, white);
  color: var(--list-c, var(--orange-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}

.map-stop-icon{
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--list-c, var(--orange-deep)) 16%, white);
  color: var(--list-c, var(--orange-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.map-stop-info{
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.map-stop-time{
  font-size: 10.5px;
  font-weight: 600;
  color: var(--list-c, var(--teal-deep));
  text-transform: uppercase;
  letter-spacing: .04em;
}

.map-stop-title{
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.map-stop-arrow{
  margin-left: auto;
  flex-shrink: 0;
  color: var(--ink-soft);
  font-size: 14px;
}

/* ---------- Bottom nav — liquid glass ---------- */

.bottom-nav{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(94%, 520px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  border-radius: 999px;
  background: rgba(255, 248, 240, 0.55);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: 0 12px 34px rgba(43,34,51,0.22);
  z-index: 40;
}

.nav-btn{
  position: relative;
  flex: 1;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 4px;
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  transition: color .2s ease, transform .15s ease;
}

.nav-btn i{ font-size: 21px; }

.nav-btn span{
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .01em;
}

.nav-btn.active{
  color: var(--white);
}

.nav-btn:nth-child(1).active::before{ background: linear-gradient(135deg, var(--orange), var(--orange-deep)); }
.nav-btn:nth-child(2).active::before{ background: linear-gradient(135deg, var(--teal), var(--teal-deep)); }
.nav-btn:nth-child(3).active::before{ background: linear-gradient(135deg, var(--yellow), #E0A420); }
.nav-btn:nth-child(4).active::before{ background: linear-gradient(135deg, #F0A2C4, var(--pink-deep)); }
.nav-btn:nth-child(5).active::before{ background: linear-gradient(135deg, var(--violet), var(--violet-deep)); }

.nav-btn.active::before{
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 999px;
  z-index: -1;
  box-shadow: var(--shadow-pop);
}

.nav-btn:active{ transform: scale(0.94); }

/* ---------- Audioguida — testata a musicassetta ---------- */

.cassette-head{
  position: relative;
  aspect-ratio: 1138 / 308;
  padding: 0;
  overflow: hidden;
}

.cassette-bg{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.cassette-label{
  position: absolute;
  left: 16px;
  top: 50%;
  z-index: 3;
  max-width: 68%;
  background: var(--white);
  border-radius: 5px;
  padding: 7px 12px 8px;
  box-shadow: 0 6px 14px rgba(43,34,51,0.28);
}

.cassette-label-eyebrow{
  font-family: var(--font-body);
  font-size: 11.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--orange-deep); /* fallback: overridden inline per-card to match the cassette color */
  white-space: nowrap;
}

.cassette-label-title{
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.08;
  color: var(--ink);
  margin-top: 2px;
}

.cassette-meta{
  position: absolute;
  right: 16px;
  bottom: 12px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255,255,255,0.95);
  text-shadow: 0 1px 4px rgba(0,0,0,0.15);
  white-space: nowrap;
}

.cassette-meta .day-chevron{
  position: static;
  font-size: 16px;
  color: rgba(255,255,255,0.95);
}

@media (max-width: 380px){
  .cassette-label{ max-width: 64%; }
  .cassette-label-title{ font-size: 21px; }
}

/* ---------- Audioguida ---------- */

.audio-item{
  padding: 14px 6px;
  border-bottom: 1px dashed rgba(43,34,51,0.12);
}

.audio-item:last-child{ border-bottom: none; }

.audio-item-row{
  display: flex;
  align-items: center;
  gap: 14px;
}

.audio-play-btn{
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--orange), var(--pink-deep));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  box-shadow: var(--shadow-pop);
  -webkit-tap-highlight-color: transparent;
}

.audio-play-btn:active{ transform: scale(0.92); }

.audio-unlocked-icon{
  flex-shrink: 0;
  font-size: 17px;
  color: var(--teal-deep);
}

.audio-progress-row{
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 0 58px;
}

.audio-seek{
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--pink-pale);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}

.audio-seek::-webkit-slider-thumb{
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--orange-deep);
  cursor: pointer;
}

.audio-seek::-moz-range-thumb{
  width: 14px;
  height: 14px;
  border: none;
  border-radius: 50%;
  background: var(--orange-deep);
  cursor: pointer;
}

.audio-time{
  flex-shrink: 0;
  font-size: 11px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.audio-item-locked .stop-icon{
  background: var(--pink-pale);
  color: var(--orange-deep);
}

.audio-password-form{
  display: flex;
  gap: 8px;
  margin: 10px 0 0 58px;
}

.audio-password-input{
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(43,34,51,0.15);
  font-family: var(--font-body);
  font-size: 13.5px;
  background: var(--cream);
  color: var(--ink);
}

.audio-password-input:focus{ outline: 2px solid var(--teal); }

.audio-password-btn{
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(135deg, var(--orange), var(--pink-deep));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
}

.audio-password-error{
  margin: 8px 0 0 58px;
  font-size: 12px;
  color: var(--orange-deep);
}

/* ---------- Speaker (frasi parlate in coreano) ---------- */

.speaker-tabs{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 2px 40px;
}

.speaker-tab{
  border: 1px solid rgba(43,34,51,0.1);
  background: var(--white);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: .02em;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .15s ease, box-shadow .2s ease, color .2s ease, background .2s ease;
}

.speaker-tab:active{ transform: scale(0.95); }

.speaker-tab.active{
  color: var(--white);
  border-color: transparent;
  background: linear-gradient(135deg, var(--violet), var(--violet-deep));
  box-shadow: 0 12px 28px rgba(131, 98, 201, 0.35);
}

.speaker-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 56px 10px;
  padding: 4px 2px 20px;
  overflow-x: hidden;
}

.speaker-btn{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  min-width: 0;
  max-width: 100%;
}

/* Sfalsamento verticale alternato per righe/colonne, look "adesivi" non allineati */
.speaker-btn:nth-child(3n+1){ transform: translateY(-6px); }
.speaker-btn:nth-child(3n+2){ transform: translateY(10px); }
.speaker-btn:nth-child(3n+3){ transform: translateY(-2px); }

.speaker-emoji{
  /* Su iPhone/Mac usa le emoji di sistema: il font web Noto può apparire vuoto */
  font-family: 'Apple Color Emoji', 'Noto Color Emoji', var(--font-body);
  font-size: 64px;
  line-height: 1;
  display: inline-block;
  transition: transform .18s ease;
  /* simula un bordo bianco "adesivo" attorno all'emoji + ombra morbida */
  text-shadow:
    -2px 0 0 #fff, 2px 0 0 #fff, 0 -2px 0 #fff, 0 2px 0 #fff,
    -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff, 2px 2px 0 #fff,
    -3px 0 0 #fff, 3px 0 0 #fff, 0 -3px 0 #fff, 0 3px 0 #fff,
    0 8px 10px rgba(43, 34, 51, 0.22);
}

/* Ogni emoji leggermente storta, con angoli diversi tipo adesivi applicati a mano */
.speaker-btn:nth-child(7n+1) .speaker-emoji{ transform: rotate(-6deg); }
.speaker-btn:nth-child(7n+2) .speaker-emoji{ transform: rotate(5deg); }
.speaker-btn:nth-child(7n+3) .speaker-emoji{ transform: rotate(-3deg); }
.speaker-btn:nth-child(7n+4) .speaker-emoji{ transform: rotate(7deg); }
.speaker-btn:nth-child(7n+5) .speaker-emoji{ transform: rotate(-7deg); }
.speaker-btn:nth-child(7n+6) .speaker-emoji{ transform: rotate(3deg); }
.speaker-btn:nth-child(7n+7) .speaker-emoji{ transform: rotate(-5deg); }

.speaker-btn:active .speaker-emoji{ transform: scale(0.9); }

.speaker-btn.speaking .speaker-emoji{
  animation: speaker-pulse 0.9s ease-in-out infinite;
}

@keyframes speaker-pulse{
  0%, 100%{ transform: scale(1); }
  50%{ transform: scale(1.14) rotate(0deg); }
}

.speaker-label{
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  color: #2B2B2B;
  text-align: center;
  line-height: 1.15;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

@media (max-width: 340px){
  .speaker-emoji{ font-size: 54px; }
  .speaker-grid{ gap: 46px 6px; }
}

/* ---------- Utility ---------- */

.hidden{ display: none !important; }

::-webkit-scrollbar{ width: 8px; }
::-webkit-scrollbar-thumb{ background: rgba(255,255,255,0.4); border-radius: 8px; }

@media (max-width: 380px){
  .day-number{ font-size: 78px; }
  .brand-logo{ height: 80px; }
}
