html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: #111827;
  background: #ffffff;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0 8px;
  position: relative;
}

.brand img {
  max-height: 90px;
  max-width: 90%;
  object-fit: contain;
}

.lang-flags {
  position: absolute;
  right: 24px;
  top: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-flag {
  font-size: 20px;
  line-height: 1;
  text-decoration: none;
  border-radius: 8px;
  padding: 6px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.55);
}

.lang-flag.is-active {
  border-color: #111827;
  background: rgba(255, 255, 255, 0.9);
}

.lang-flag:focus-visible {
  outline: 3px solid rgba(0, 0, 0, 0.35);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .lang-flags {
    right: 12px;
    top: 18px;
    gap: 6px;
  }
  .lang-flag {
    font-size: 18px;
    padding: 5px;
  }
}

.hero {
  min-height: calc(100vh - 130px);
  display: flex;
  align-items: center;
  position: relative;
  background: #ffffff;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--hero-bg);
  background-size: cover;
  background-position: center;
  opacity: 0.8;
}

.hero > .container {
  position: relative;
  z-index: 1;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  width: 100%;
}

.route-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 20px;
  justify-content: center;
  align-items: stretch;
  width: 100%;
}

.route-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  height: auto;
  aspect-ratio: 1 / 1;
  min-height: 160px;
  background: rgba(17, 24, 39, 0.55);
  border: 2px solid #000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  text-decoration: none;
  flex: 1 1 0;
  min-width: 0;
}

.route-card:focus-visible {
  outline: 3px solid rgba(0, 0, 0, 0.5);
  outline-offset: 3px;
}

.route-card-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 100%;
  text-align: center;
}

.route-card-title {
  color: #fff;
  font-size: clamp(14px, 1.4vw, 18px);
  letter-spacing: 0.2px;
  font-weight: 700;
}

.route-card-subtitle {
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-weight: 600;
  margin-top: 2px;
}

.route-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 1;
}

.route-card-icon svg {
  width: clamp(64px, 10vw, 120px);
  height: clamp(64px, 10vw, 120px);
}

.route-card-icon-image {
  width: clamp(64px, 10vw, 120px);
  height: clamp(64px, 10vw, 120px);
  object-fit: contain;
}

.route-card-icon-font {
  font-size: clamp(58px, 9vw, 108px);
  line-height: 1;
  color: #fff;
}

.route-card-icon-text {
  font-size: clamp(36px, 6vw, 72px);
  line-height: 1;
  font-weight: 700;
  color: #fff;
}

.route-icon-current {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
}

.route-icon-current-symbol {
  font-size: 30px;
  color: #111827;
}

.icon-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(15, 23, 42, 0.58);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.icon-picker-modal[hidden] {
  display: none !important;
}

.icon-picker-modal-card {
  width: min(900px, 96vw);
  max-height: 86vh;
  overflow: hidden;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.icon-picker-modal-results {
  overflow: auto;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  min-height: 180px;
}

.icon-picker-result-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
}

.icon-picker-result-symbol {
  font-size: 18px;
}

@media (max-width: 900px) {
  .route-grid {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
  }

  .route-card {
    flex: 0 1 clamp(120px, 40vw, 180px);
    max-width: calc(100% - 32px);
    aspect-ratio: 1 / 1;
    height: auto;
    min-height: 120px;
    padding: 8px;
  }

  .route-card-content {
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    text-align: center;
  }

  .route-card-title {
    font-size: 15px;
  }

  .route-card-icon svg {
    width: clamp(56px, 15vw, 78px);
    height: clamp(56px, 15vw, 78px);
  }

  .route-card-icon-image {
    width: clamp(56px, 15vw, 78px);
    height: clamp(56px, 15vw, 78px);
  }

  .route-card-icon-font {
    font-size: clamp(50px, 13vw, 72px);
  }

  .route-card-icon-text {
    font-size: clamp(30px, 11vw, 52px);
  }
}

.panel {
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  border: 1px solid #e5e7eb;
}

.scan-gate {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 26px 20px;
}

.scan-gate-icon {
  width: 88px;
  height: 88px;
}

.scan-gate-icon-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  border-radius: 18px;
  cursor: pointer;
}

.scan-gate-icon-btn:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.4);
  outline-offset: 3px;
}

.scan-gate-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.scan-gate-icon-frame {
  stroke: #d1d5db;
  stroke-width: 2;
  fill: #ffffff;
}

.scan-gate-icon-corners {
  stroke: #111827;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scan-gate-icon-line {
  stroke: #2563eb;
  stroke-width: 3.2;
  stroke-linecap: round;
  animation: scanLine 1.6s ease-in-out infinite;
}

.scan-gate-title {
  color: #111827;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.scan-gate-text {
  color: #6b7280;
  font-size: 14px;
  line-height: 1.45;
  max-width: 420px;
}

.scan-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.scan-modal[hidden] {
  display: none !important;
}

.scan-modal-card {
  width: min(520px, 100%);
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid #e5e7eb;
  padding: 14px;
}

.scan-video {
  width: 100%;
  border-radius: 12px;
  background: #0f172a;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.scan-status {
  margin-top: 10px;
  text-align: center;
}

@keyframes scanLine {
  0%, 100% {
    transform: translateY(-9px);
    opacity: 0.85;
  }
  50% {
    transform: translateY(9px);
    opacity: 1;
  }
}

/* Overlay di attesa: mostrato mentre una richiesta lenta è in corso. */
.busy-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.busy-overlay[hidden] {
  display: none !important;
}

.busy-card {
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid #e5e7eb;
  padding: 22px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: min(340px, 100%);
  text-align: center;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
}

.busy-spinner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 4px solid #e5e7eb;
  border-top-color: #111827;
  animation: busySpin 0.9s linear infinite;
}

.busy-text {
  font-weight: 700;
  color: #111827;
}

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

/* Attesa nell'elenco orari quando si cambia giorno (non blocca la pagina). */
.times-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #6b7280;
  font-weight: 600;
  padding: 6px 0;
}

.times-loading-spinner {
  width: 20px;
  height: 20px;
  border-width: 3px;
  flex: 0 0 auto;
}

@media (prefers-reduced-motion: reduce) {
  .busy-spinner {
    animation-duration: 2.4s;
  }
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
}

.admin-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 0 0 14px;
}

.admin-menu-item {
  text-decoration: none;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #111827;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.admin-menu-item.is-active {
  background: #111827;
  border-color: #111827;
  color: #fff;
}

.tab-btn {
  appearance: none;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #111827;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
}

.tab-btn.is-active {
  background: #111827;
  border-color: #111827;
  color: #fff;
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.route-admin-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 0 14px;
}

.route-admin-item {
  display: flex;
  gap: 12px;
  align-items: stretch;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 12px;
  background: #fff;
}

.route-admin-item.is-dragging {
  opacity: 0.6;
}

.route-admin-handle {
  flex: 0 0 auto;
  width: 34px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  user-select: none;
  color: #6b7280;
  font-weight: 700;
}

.route-admin-form {
  flex: 1 1 auto;
}

.route-admin-fields {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.route-admin-active {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px 10px;
}

.route-admin-actions {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 16px;
  align-items: start;
}

.row-room-bookings {
  grid-template-columns: 0.78fr 1.22fr;
  align-items: start;
}

@media (max-width: 900px) {
  .row {
    grid-template-columns: 1fr;
  }

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

  .row-room-bookings {
    grid-template-columns: 0.72fr 1.28fr;
    align-items: start;
  }
}

.label {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 6px;
}

input[type="text"], select, textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  box-sizing: border-box;
}

input[type="password"],
input[type="date"],
input[type="time"],
input[type="email"],
input[type="number"] {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  box-sizing: border-box;
}

.calendar {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cal-nav-btn {
  min-width: 38px;
  padding: 8px 10px;
}

.calendar th {
  font-size: 12px;
  color: #6b7280;
  font-weight: 600;
  padding: 10px 6px;
  text-align: center;
}

.calendar td {
  padding: 6px;
  text-align: center;
}

.day {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
}

@media (max-width: 480px) {
  .calendar th {
    padding: 8px 2px;
    font-size: 11px;
  }

  .calendar td {
    padding: 4px 2px;
  }

  .day {
    width: 34px;
    height: 34px;
    border-radius: 12px;
  }
}

.day[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}

.day.is-selected {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.times {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.time-pill {
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #fff;
  width: 72px;
  height: 72px;
  padding: 0;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
  line-height: 1.1;
  position: relative;
  overflow: visible;
}

.time-pill-time {
  font-size: 14px;
  font-weight: 700;
}

.time-pill-avail {
  font-size: 12px;
  color: #6b7280;
}

.time-pill-stop-icon {
  position: absolute;
  top: -4px;
  right: -2px;
  width: 18px;
  height: 18px;
  color: #2563eb;
  opacity: 0.9;
}

.time-pill.is-selected .time-pill-stop-icon {
  color: rgba(255, 255, 255, 0.95);
}

@media (max-width: 900px) {
  .time-pill {
    width: 66px;
    height: 66px;
  }
}

.time-pill[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}

.time-pill.is-booked {
  border-color: #111827;
  background: rgba(17, 24, 39, 0.06);
}

.time-pill.is-booked[disabled] {
  opacity: 1;
}

.time-pill.is-selected {
  background: #111827;
  border-color: #111827;
  color: #fff;
}

.time-pill.is-selected .time-pill-avail {
  color: rgba(255, 255, 255, 0.85);
}

.room-bookings {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 44px;
}

.room-booking-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 8px 10px;
  background: #fff;
}

.room-booking-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.room-booking-stop-badge {
  color: #2563eb;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.room-booking-stop-badge svg {
  width: 12px;
  height: 12px;
}

.room-booking-text {
  font-size: 13px;
  color: #111827;
  line-height: 1.2;
}

.room-booking-cancel {
  appearance: none;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #111827;
  border-radius: 999px;
  width: 34px;
  height: 34px;
  padding: 0;
  cursor: pointer;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.room-booking-cancel svg {
  width: 18px;
  height: 18px;
}

.room-booking-cancel[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.btn {
  appearance: none;
  border: 2px solid #000;
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 600;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
}

.btn-secondary {
  background: #111827;
}

.btn-danger {
  background: #dc2626;
}

.schedule-slot-row.is-editing {
  background: rgba(37, 99, 235, 0.04);
}

.schedule-day-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.schedule-day-table th,
.schedule-day-table td {
  text-align: left;
  padding: 6px 4px 6px 0;
  vertical-align: middle;
}

.schedule-col-time {
  width: 72px;
}

.schedule-col-capacity {
  width: 56px;
}

.schedule-col-active {
  width: 44px;
}

.schedule-col-actions {
  width: 72px;
}

.schedule-col-stop-check {
  width: 52px;
  text-align: center !important;
}

/* Il giorno si allarga con le tappe; su schermi stretti la tabella scorre dentro il riquadro. */
.schedule-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--schedule-card-min, 284px)), 1fr));
}

.schedule-scroll {
  overflow-x: auto;
}

.schedule-scroll .schedule-day-table {
  min-width: calc(var(--schedule-card-min, 284px) - 40px);
}

.schedule-day-table th.schedule-col-stop-check {
  font-size: 11px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.schedule-new-row {
  display: grid;
  align-items: center;
  gap: 4px;
}

.schedule-new-cell {
  padding: 6px 4px 6px 0;
}

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

.schedule-copy-btn {
  padding: 8px 12px;
  min-height: 30px;
  border-radius: 8px;
  font-size: 12px;
}

.schedule-slot-input {
  height: 40px;
  padding: 8px 10px;
  font-size: 13px;
}

.schedule-slot-input-small {
  padding-left: 8px;
  padding-right: 8px;
}

.schedule-slot-row [data-slot-field]:disabled {
  opacity: 1;
  background: #f8fafc;
  color: #6b7280;
  cursor: default;
}

.schedule-slot-row input[type="checkbox"][data-slot-field]:disabled {
  accent-color: #9ca3af;
}

.schedule-slot-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}

.schedule-action-btn {
  appearance: none;
  border: 2px solid #111827;
  background: #fff;
  color: #111827;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.schedule-action-btn svg {
  width: 13px;
  height: 13px;
}

.schedule-action-btn-save {
  background: #2563eb;
  color: #fff;
}

.schedule-action-btn-danger {
  background: #dc2626;
  color: #fff;
}

.schedule-action-btn[hidden] {
  display: none !important;
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.muted {
  color: #6b7280;
  font-size: 13px;
}

.error {
  color: #b91c1c;
  font-size: 13px;
  margin-top: 10px;
}

.confirm-panel {
  max-width: 980px;
  margin: 0 auto;
  padding: 34px;
}

.confirm-top {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 22px;
}

.confirm-title {
  margin: 0;
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.confirm-info {
  margin-top: 10px;
  color: #111827;
  font-size: 14px;
  font-weight: 700;
}

.confirm-subtitle {
  margin-top: 10px;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.confirm-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 28px;
  align-items: start;
}

.confirm-grid--noimg {
  grid-template-columns: 1fr;
  justify-items: center;
}

.confirm-grid--noimg .confirm-left {
  display: none;
}

.confirm-left {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.confirm-photo {
  width: 100%;
  max-width: 640px;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  object-fit: cover;
  aspect-ratio: 16 / 9;
}

.powered-by {
  text-align: center;
  padding: 16px 24px 24px;
  color: #6b7280;
  font-size: 12px;
}

.powered-by a {
  color: inherit;
  text-decoration: underline;
}

.login-page {
  background-image: url("https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=1920&q=80");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

@media (max-width: 900px) {
  .login-page {
    background-attachment: scroll;
  }
}

.confirm-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
}

.confirm-qr {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.confirm-qr #qrcode canvas,
.confirm-qr #qrcode img {
  display: block;
}

.confirm-download {
  width: 100%;
  max-width: 240px;
  background: #ffffff;
  border-color: #f43f5e;
  color: #f43f5e;
}

@media (max-width: 900px) {
  .confirm-panel {
    padding: 22px 18px;
  }

  .confirm-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .confirm-right {
    padding-top: 0;
  }
}

.qr-generator {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .qr-generator {
    grid-template-columns: 1fr;
  }
}

.qr-preview {
  display: flex;
  justify-content: center;
}

.qr-room-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-start;
}

.qr-room-item {
  flex: 0 0 auto;
}

.qr-room-card {
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 12px;
  box-sizing: border-box;
  text-align: center;
}

.qr-room-top {
  color: #ffffff;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  width: 100%;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.qr-room-qr {
  background: #ffffff;
  border-radius: 16px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.qr-room-room {
  color: #ffffff;
  font-weight: 900;
  letter-spacing: 0.5px;
  width: 100%;
  line-height: 1.05;
}

/* Novita' e versioni (modal al primo accesso dopo un aggiornamento, pagina admin/changelog.php). */
.cl-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.cl-card {
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid #e5e7eb;
  padding: 22px;
  width: min(620px, 100%);
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
}

.cl-title {
  margin: 0 0 12px;
  font-size: 1.2rem;
  color: #111827;
}

.cl-body {
  overflow-y: auto;
  min-height: 0;
}

.cl-entry + .cl-entry {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e5e7eb;
}

.cl-version {
  font-weight: 800;
  color: #111827;
  margin-bottom: 8px;
}

.cl-date {
  font-weight: 600;
  color: #6b7280;
  margin-left: 6px;
}

.cl-todo {
  background: #fef2f2;
  border: 1px solid #ef4444;
  color: #7f1d1d;
  border-radius: 12px;
  padding: 10px 12px;
  margin: 0 0 8px;
  font-weight: 700;
}

.cl-changes {
  margin: 6px 0 0 18px;
  padding: 0;
  color: #374151;
}

.cl-changes li + li {
  margin-top: 4px;
}

.cl-type {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  vertical-align: 1px;
}

.cl-type-sicurezza {
  background: #ede9fe;
  color: #5b21b6;
  border: 1px solid #8b5cf6;
}

.cl-type-bug {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fb923c;
}

.cl-type-caratteristica {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #10b981;
}

.cl-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.cl-footer {
  text-align: center;
  color: #6b7280;
  font-size: 13px;
  margin: 18px 0 10px;
}

.cl-footer a {
  color: inherit;
}

/* Linea delle fermate in prenotazione: a sinistra la salita, a destra la discesa */
.leg-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.leg-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.leg-stop {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 8px 6px 34px;
  border: 0;
  border-radius: 10px;
  background: none;
  font: inherit;
  color: #111827;
  text-align: left;
  cursor: pointer;
}

/* linea verticale: grigia sotto (::before), blu sul tratto del viaggio (::after) */
.leg-stop::before,
.leg-stop::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #d1d5db;
}

.leg-stop::after {
  display: none;
  background: #2563eb;
}

.leg-col .leg-stop:nth-child(2)::before {
  top: 50%;
}

.leg-col .leg-stop:last-child::before {
  bottom: 50%;
}

.leg-stop.is-in-trip::after {
  display: block;
}

.leg-stop.is-trip-start::after {
  top: 50%;
}

.leg-stop.is-trip-end::after {
  bottom: 50%;
}

.leg-dot {
  position: absolute;
  left: 9px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border-radius: 50%;
  border: 3px solid #9ca3af;
  background: #fff;
  box-sizing: border-box;
  z-index: 1;
}

.leg-stop.is-in-trip .leg-dot {
  border-color: #2563eb;
}

.leg-stop.is-selected .leg-dot {
  width: 22px;
  height: 22px;
  left: 6px;
  margin-top: -11px;
  border: 0;
  background: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.leg-stop.is-selected {
  background: rgba(37, 99, 235, 0.08);
}

.leg-stop.is-selected .leg-name {
  font-weight: 700;
}

.leg-name {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Tappa non servita (nel giorno scelto o mai) e linea senza tappe servite. */
.leg-picker[hidden],
.leg-stop[hidden] {
  display: none !important;
}

.leg-stop:disabled {
  cursor: default;
  color: #9ca3af;
}

.leg-stop:disabled .leg-dot {
  border-color: #e5e7eb;
}

/* Scelta delle persone in prenotazione */
.pax-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pax-option {
  min-width: 48px;
  height: 44px;
  border: 2px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-weight: 700;
  color: #111827;
  cursor: pointer;
}

.pax-option.is-selected {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.terms-link {
  color: #2563eb;
  text-decoration: underline;
}

.terms-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.terms-modal[hidden] {
  display: none !important;
}

.terms-modal-card {
  width: min(560px, 100%);
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid #e5e7eb;
  padding: 16px;
}

.terms-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.terms-modal-x {
  border: 0;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  padding: 4px 8px;
}

.terms-modal-body {
  white-space: pre-wrap;
  overflow: auto;
  min-height: 0;
  flex: 1;
}

/* Orari per hotel: una card per tratta con i blocchi dei giorni. */
.tt-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.tt-card {
  margin: 0;
  min-width: 0;
}

.tt-title {
  font-weight: 900;
  font-size: 17px;
  margin: 0 0 10px;
}

.tt-list-daily {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.tt-skip {
  color: #cbd5e1;
  font-weight: 400;
}

/* Settimanale: un blocco per giorno come in Orari. */
.tt-week {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 10px;
}

.tt-day-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  min-width: 0;
}

.tt-day-head {
  background: #2563eb;
  color: #fff;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
}

.tt-day-empty {
  padding: 8px 10px;
  font-size: 12px;
}

.tt-day-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.tt-day-table th {
  padding: 6px 4px 4px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.2;
  color: #6b7280;
  text-align: center;
  overflow-wrap: anywhere;
  border-bottom: 1px solid #e5e7eb;
}

.tt-day-table td {
  padding: 4px;
  text-align: center;
  font-weight: 600;
  white-space: nowrap;
}

.tt-day-table tbody tr + tr td {
  border-top: 1px solid #f1f5f9;
}

.tt-day-table .tt-dep {
  font-weight: 800;
  color: #2563eb;
}
