/* Funzioni operative aggiuntive — Giappone 2026 */

:root {
  --app-accent: #9b2226;
  --app-gold: #9c7c2a;
  --app-green: #3a6b4a;
  --app-blue: #3a5577;
  --app-radius: 10px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

:where(a, button, input, textarea, select):focus-visible {
  outline: 3px solid #e0a500;
  outline-offset: 3px;
}

.app-panel {
  border: 1px solid var(--bordo);
  border-radius: var(--app-radius);
  background: var(--carta2);
  padding: 16px;
  margin: 14px 0;
}

.app-panel h3,
.app-panel h4 {
  margin-top: 0;
}

.appbtn {
  border: 1px solid var(--bordo);
  border-radius: 7px;
  background: var(--carta2);
  color: var(--inchiostro);
  min-height: 44px;
  padding: 7px 12px;
  font: 700 12.5px/1.2 var(--sans);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.appbtn:hover {
  background: var(--inchiostro);
  color: var(--carta2);
  border-color: var(--inchiostro);
}

.appbtn.primary {
  background: var(--rosso);
  color: #fff;
  border-color: var(--rosso);
}

.appbtn.good {
  background: var(--verde);
  color: #fff;
  border-color: var(--verde);
}

.appbtn.danger {
  color: #a8341f;
  border-color: #c9533e;
}

.appbtn[aria-pressed="true"] {
  background: var(--inchiostro);
  color: #fff;
  border-color: var(--inchiostro);
}

.app-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  border: 1px solid var(--bordo);
  background: #f3ecdb;
  color: #51483a;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 700;
}

.status-chip.live {
  color: #245536;
  background: #e7f5ec;
  border-color: #b9ddc6;
}

.status-chip.warn {
  color: #8a4b00;
  background: #fff4e5;
  border-color: #f0d3a7;
}

/* Cockpit Adesso */
#live-cockpit {
  grid-column: 1 / -1;
}

.cockpit-layout {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 12px;
}

.cockpit-now {
  border-left: 4px solid var(--rosso);
}

.cockpit-kicker {
  font: 700 10px/1.2 var(--sans);
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--rossoscuro);
}

.cockpit-title {
  font: 700 24px/1.12 var(--serif);
  margin: 6px 0 4px;
}

.cockpit-countdown {
  font: 700 17px/1.25 var(--serif);
  color: var(--rosso);
  margin: 6px 0;
}

.cockpit-meta {
  color: var(--grigio);
  font-size: 13.5px;
}

.cockpit-next {
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px dashed var(--bordo);
}

.cockpit-next strong {
  display: block;
  font-size: 15px;
}

.cockpit-time {
  color: var(--rosso);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.simulator {
  margin-top: 13px;
  border-top: 1px solid var(--bordo);
  padding-top: 11px;
}

.simulator summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--rosso);
}

.sim-fields {
  display: grid;
  grid-template-columns: 1fr 110px auto;
  gap: 7px;
  margin-top: 9px;
  align-items: end;
}

.sim-fields label,
.setting-field label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .6px;
  font-weight: 700;
  color: var(--grigio);
}

.sim-fields input,
.setting-field input,
.journal-note {
  width: 100%;
  border: 1px solid var(--bordo);
  border-radius: 6px;
  padding: 8px 9px;
  background: #fff;
  color: var(--inchiostro);
  font: 13px var(--sans);
}

.weather-main {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 8px 0;
}

.weather-icon {
  font-size: 34px;
  line-height: 1;
}

.weather-temp {
  font: 700 25px/1 var(--serif);
}

.weather-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  font-size: 12px;
  color: var(--grigio);
}

.weather-advice {
  margin-top: 9px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #eef2fb;
  border: 1px solid #d3def5;
  font-size: 12.5px;
}

.weather-advice.severe {
  background: #fff4e5;
  border-color: #e8bd78;
  color: #7c3f00;
}

/* Giorni 17/29 e strumenti live */
.day-edge {
  border-left-color: var(--oro);
}

.day-edge .dnum {
  background: var(--oro);
}

.day-live-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 9px 0 3px;
}

.daybar button {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--bordo);
  background: #fffdf8;
  color: var(--inchiostro);
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
}

.daybar button:hover,
.daybar button[aria-pressed="true"] {
  background: var(--inchiostro);
  color: #fff;
  border-color: var(--inchiostro);
}

.route-strip {
  list-style: none;
  margin: 14px 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.route-stop {
  display: grid;
  grid-template-columns: 31px 58px 1fr;
  gap: 8px;
  position: relative;
  padding: 7px 0 12px;
  align-items: start;
}

.route-stop:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 29px;
  bottom: -2px;
  width: 2px;
  background: var(--bordo);
}

.route-index {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f3ecdb;
  border: 1px solid var(--bordo);
  font-size: 11px;
  font-weight: 800;
  z-index: 1;
}

.route-stop.current .route-index {
  background: var(--rosso);
  border-color: var(--rosso);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(155, 34, 38, .12);
}

.route-stop.done {
  opacity: .6;
}

.route-time {
  font-size: 12px;
  color: var(--rosso);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  padding-top: 5px;
}

.route-label {
  font-size: 13px;
  padding-top: 4px;
}

/* Wallet con allegati */
.wallet-enhanced {
  position: relative;
}

.attachment-zone {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px dashed var(--bordo);
}

.attachment-list {
  display: grid;
  gap: 6px;
  margin-top: 7px;
}

.attachment-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--bordo);
  border-radius: 6px;
  padding: 7px 9px;
  background: #f8f4ea;
}

.attachment-name {
  min-width: 0;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-size {
  color: var(--grigio);
  font-size: 10px;
  margin-left: 5px;
}

.mini-actions {
  display: flex;
  gap: 4px;
}

.mini-actions button {
  border: 1px solid var(--bordo);
  background: var(--carta2);
  color: var(--inchiostro);
  border-radius: 5px;
  padding: 4px 7px;
  cursor: pointer;
  font-size: 11px;
}

.storage-meter {
  margin-top: 9px;
}

.storage-track {
  height: 7px;
  border-radius: 10px;
  overflow: hidden;
  background: #e7ddca;
}

.storage-fill {
  height: 100%;
  width: 0;
  background: var(--verde);
}

.storage-label {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  color: var(--grigio);
  font-size: 11px;
}

/* Passaporto e diario */
.passport-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 14px 0;
}

.passport-stamp {
  aspect-ratio: 1;
  border: 2px dashed var(--bordo);
  border-radius: 50%;
  background: transparent;
  color: var(--grigio);
  cursor: pointer;
  display: grid;
  place-items: center;
  align-content: center;
  font-family: var(--serif);
  transform: rotate(-3deg);
}

.passport-stamp .jp {
  display: block;
  font-size: 24px;
  line-height: 1;
}

.passport-stamp .city {
  display: block;
  margin-top: 4px;
  font: 700 9px/1 var(--sans);
  text-transform: uppercase;
  letter-spacing: .6px;
}

.passport-stamp[aria-pressed="true"] {
  color: var(--rosso);
  border-color: var(--rosso);
  background: rgba(155, 34, 38, .06);
  box-shadow: inset 0 0 0 4px rgba(155, 34, 38, .08);
}

.journal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}

.journal-card {
  border: 1px solid var(--bordo);
  border-radius: 8px;
  padding: 12px;
  background: var(--carta2);
}

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

.journal-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 16px;
}

.journal-note {
  resize: vertical;
  min-height: 86px;
}

.journal-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.journal-photo {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid var(--bordo);
  background: #efe8d8;
}

.journal-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.journal-photo button {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 25px;
  height: 25px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(35, 31, 24, .8);
  cursor: pointer;
}

.passport-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 9px 0 14px;
}

/* Dati e backup */
.data-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.setting-field {
  margin-top: 8px;
}

/* Dialog e modalità emergenza */
.app-dialog {
  width: min(760px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 0;
  border: 1px solid var(--bordo);
  border-radius: 12px;
  color: var(--inchiostro);
  background: var(--carta2);
  box-shadow: 0 18px 70px rgba(0, 0, 0, .4);
}

.app-dialog::backdrop {
  background: rgba(12, 10, 8, .72);
  backdrop-filter: blur(3px);
}

.dialog-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  background: var(--inchiostro);
  color: var(--carta2);
}

.dialog-head h2 {
  margin: 0;
  font: 700 19px/1.2 var(--serif);
}

.dialog-close {
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  background: transparent;
  color: inherit;
  font-size: 20px;
  cursor: pointer;
}

.dialog-body {
  padding: 15px;
  overflow: auto;
}

#media-content {
  min-height: 55vh;
  display: grid;
  place-items: center;
  background: #fff;
}

#media-content img {
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
}

#media-content iframe {
  width: 100%;
  height: 72vh;
  border: 0;
  background: #fff;
}

.sos-fab {
  position: fixed;
  left: 14px;
  bottom: 74px;
  z-index: 59;
  min-width: 48px;
  height: 44px;
  padding: 0 12px;
  border: 2px solid #fff;
  border-radius: 24px;
  background: #a8341f;
  color: #fff;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .24);
  font: 800 12px var(--sans);
  cursor: pointer;
}

.emergency-card {
  border: 2px solid #a8341f;
  border-radius: 9px;
  padding: 13px;
  margin: 10px 0;
}

.emergency-number {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--bordo);
}

.emergency-number:last-child {
  border-bottom: 0;
}

.emergency-number strong {
  display: block;
  font: 700 21px/1.1 var(--serif);
}

.jp-address {
  font-size: 17px;
  line-height: 1.5;
  word-break: break-word;
}

/* Piccole notifiche */
#app-toast {
  position: fixed;
  left: 50%;
  bottom: 128px;
  z-index: 120;
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  border-radius: 24px;
  background: var(--inchiostro);
  color: var(--carta2);
  padding: 9px 15px;
  max-width: calc(100vw - 30px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .28);
  font-size: 12.5px;
  transition: opacity .2s, transform .2s;
}

#app-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

body.dark .app-panel,
body.dark .journal-card,
body.dark .app-dialog {
  background: #241f1a;
}

body.dark .attachment-item {
  background: #2a241e;
}

body.dark .daybar button {
  background: #2a241e;
  color: #ece5d6;
}

body.dark .sim-fields input,
body.dark .setting-field input,
body.dark .journal-note {
  background: #2a241e;
  color: #ece5d6;
}

body.dark .status-chip {
  background: #30291f;
  color: #d6cbb5;
}

body.dark #media-content {
  background: #111;
}

@media (max-width: 680px) {
  .sos-fab {
    display: none;
  }

  #backtop {
    display: none;
  }

  .botnav .sos-nav {
    color: #ffb7a9;
  }

  .cockpit-layout,
  .journal-grid,
  .data-grid {
    grid-template-columns: 1fr;
  }

  .sim-fields {
    grid-template-columns: 1fr 100px;
  }

  .sim-fields .appbtn {
    grid-column: 1 / -1;
  }

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

  .route-stop {
    grid-template-columns: 29px 52px 1fr;
  }
}

@media print {
  .app-actions,
  .simulator,
  .attachment-zone .appbtn,
  .journal-photo button,
  .sos-fab,
  .app-dialog,
  #app-toast,
  .day-live-tools {
    display: none !important;
  }

  details.day[open] > :not(summary) {
    display: block;
  }

  .journal-grid {
    display: block;
  }

  .journal-card {
    break-inside: avoid;
    margin: 8px 0;
  }

  body.print-diary header,
  body.print-diary nav,
  body.print-diary #guidesearch,
  body.print-diary main > :not(#passaporto),
  body.print-diary footer,
  body.print-diary #backtop,
  body.print-diary #tripbar {
    display: none !important;
  }

  body.print-diary main {
    display: block !important;
    padding: 0 !important;
  }

  body.print-diary #passaporto {
    display: block !important;
    margin: 0 !important;
  }
}

/* ============================================================
   PREMIUM EDITORIAL SYSTEM
   Unifica l'intera guida tra desktop, mobile e modalità scura.
   ============================================================ */

:root {
  --rosso: #a5282c;
  --rossoscuro: #7f1d22;
  --inchiostro: #211d18;
  --carta: #f3efe6;
  --carta2: #fffdf9;
  --grigio: #70685d;
  --grigiochiaro: #9a9081;
  --bordo: #ded6c8;
  --oro: #a98236;
  --verde: #376a4d;
  --blu: #405d7d;
  --ombra: 0 16px 44px rgba(42, 31, 19, .075), 0 2px 8px rgba(42, 31, 19, .04);
  --ombra-hover: 0 24px 64px rgba(42, 31, 19, .12), 0 3px 10px rgba(42, 31, 19, .055);
  --premium-radius: 18px;
  --premium-radius-sm: 11px;
  --premium-gold: #c5a363;
  --premium-ink-2: #2c2721;
  --premium-paper: rgba(255, 253, 249, .92);
}

html {
  scroll-padding-top: 118px;
}

body {
  min-height: 100vh;
  font-size: 16.5px;
  line-height: 1.72;
  letter-spacing: .003em;
  background:
    radial-gradient(circle at 12% 8%, rgba(197, 163, 99, .09), transparent 28rem),
    radial-gradient(circle at 88% 30%, rgba(155, 34, 38, .045), transparent 32rem),
    var(--carta);
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .18;
  background-image:
    linear-gradient(rgba(77, 62, 42, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77, 62, 42, .018) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, #000, transparent 80%);
}

::selection {
  background: rgba(165, 40, 44, .18);
  color: var(--inchiostro);
}

a {
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

main {
  max-width: 1080px;
  padding: 48px 30px 120px;
}

section {
  margin: 58px 0;
  scroll-margin-top: 124px;
}

.eyebrow,
.cockpit-kicker {
  color: var(--rosso);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2.2px;
}

h2.sec {
  position: relative;
  border-top: 0;
  padding: 17px 0 0;
  margin: 0 0 10px;
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.08;
  letter-spacing: -.035em;
}

h2.sec::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 52px;
  height: 2px;
  background: linear-gradient(90deg, var(--rosso), var(--premium-gold));
}

.lead {
  max-width: 72ch;
  color: var(--grigio);
  font-size: 17.5px;
  line-height: 1.6;
}

.anchor-h {
  border-top: 1px solid rgba(35, 31, 24, .18);
  padding-top: 13px;
  margin-top: 64px;
  color: var(--grigio);
}

/* Hero */
header.hero {
  min-height: 520px;
  padding: 104px 28px 84px;
  display: grid;
  align-content: center;
  justify-items: center;
  background:
    radial-gradient(circle at 50% 115%, rgba(165, 40, 44, .34), transparent 45%),
    radial-gradient(circle at 82% 16%, rgba(197, 163, 99, .12), transparent 24%),
    linear-gradient(145deg, #181512 0%, #28221c 55%, #191613 100%);
  border-bottom: 0;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .08);
}

header.hero::before {
  content: "";
  position: absolute;
  inset: 24px;
  border: 1px solid rgba(201, 173, 115, .18);
  pointer-events: none;
}

header.hero::after {
  right: 4%;
  bottom: -92px;
  font-size: 330px;
  color: #d3b579;
  opacity: .045;
}

header.hero .kanji {
  color: var(--premium-gold);
  font-size: 13px;
  letter-spacing: 12px;
  margin-bottom: 18px;
}

header.hero .subt {
  order: 2;
  color: rgba(239, 223, 188, .8);
  font-size: 11px;
  letter-spacing: 4px;
  margin-top: 14px;
}

header.hero h1 {
  font-size: clamp(58px, 8vw, 86px);
  line-height: .98;
  letter-spacing: -.055em;
  text-shadow: 0 10px 32px rgba(0, 0, 0, .28);
}

header.hero p.who {
  order: 3;
  max-width: 720px;
  margin-top: 28px;
  color: rgba(248, 242, 229, .94);
  font-family: var(--serif);
  font-size: 20px;
}

header.hero .meta {
  order: 4;
  margin-top: 24px;
  gap: 9px;
}

header.hero .meta span {
  padding: 8px 16px;
  border-color: rgba(214, 190, 142, .24);
  background: rgba(255, 255, 255, .055);
  color: rgba(248, 242, 229, .92);
  font-size: 12.5px;
  backdrop-filter: blur(10px);
}

/* Doppia barra di navigazione */
nav.toc {
  min-height: 52px;
  padding: 8px max(12px, calc((100vw - 1180px) / 2));
  gap: 5px;
  background: rgba(28, 24, 20, .97);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 5px 22px rgba(24, 19, 14, .14);
  scrollbar-width: none;
}

nav.toc::-webkit-scrollbar {
  display: none;
}

nav.toc a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: rgba(248, 242, 229, .72);
  font-size: 12px;
  transition: color .18s, background .18s, border-color .18s;
}

nav.toc a:hover,
nav.toc a:focus-visible {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .1);
  color: #fff;
}

nav.toc a.chap {
  background: rgba(197, 163, 99, .1);
  border-color: rgba(197, 163, 99, .22);
  color: #e5c98f;
}

nav.toc a.spec {
  background: rgba(165, 40, 44, .14);
  border-color: rgba(203, 97, 99, .22);
  color: #f0b9ae;
}

#guidesearch {
  min-height: 54px;
  padding: 8px max(14px, calc((100vw - 1080px) / 2));
  gap: 7px;
  background: rgba(247, 243, 235, .9);
  border-bottom-color: rgba(93, 77, 56, .12);
  box-shadow: 0 10px 28px rgba(48, 37, 25, .055);
}

#guidesearch input {
  height: 44px;
  border: 1px solid rgba(104, 88, 65, .16);
  border-radius: 11px;
  padding: 8px 13px;
  background: rgba(255, 255, 255, .86);
  box-shadow: inset 0 1px 1px rgba(48, 37, 25, .025);
}

#guidesearch .gsbtn {
  width: 44px;
  height: 44px;
  border-color: rgba(104, 88, 65, .15);
  border-radius: 10px;
  background: rgba(255, 255, 255, .78);
}

#guidesearch .cnt {
  color: var(--rosso);
  font-weight: 700;
}

/* Superfici */
.card,
.app-panel,
.qrcard,
.hcard,
.wcard,
.journal-card,
.placecard {
  border-color: rgba(104, 88, 65, .15);
  background: var(--premium-paper);
  box-shadow: var(--ombra);
  backdrop-filter: blur(8px);
}

.card {
  padding: 28px 30px;
  border-radius: var(--premium-radius);
}

main > .card:first-child {
  position: relative;
  overflow: hidden;
  border-top: 3px solid var(--rosso);
}

main > .card:first-child::after {
  content: "私";
  position: absolute;
  right: 18px;
  bottom: -42px;
  color: var(--rosso);
  font: 120px/1 var(--serif);
  opacity: .035;
}

.app-panel {
  padding: 22px 24px;
  border-radius: var(--premium-radius);
}

.box {
  padding: 16px 18px;
  border-width: 0 0 0 3px !important;
  border-radius: 0 var(--premium-radius-sm) var(--premium-radius-sm) 0;
  box-shadow: 0 8px 24px rgba(48, 37, 25, .035);
}

.box.tip {
  border-left-color: #6aa17a !important;
}

.box.info {
  border-left-color: #718cac !important;
}

.box.warnbox {
  border-left-color: #d39a46 !important;
}

.box.eat {
  border-left-color: #b85c75 !important;
}

.box.rain {
  border-left-color: #6488a3 !important;
}

.box b.lbl {
  margin-bottom: 6px;
  font-size: 11px;
  letter-spacing: .9px;
  text-transform: uppercase;
}

/* Dashboard */
#oggi {
  margin-top: 22px;
  padding: 34px;
  border: 1px solid rgba(104, 88, 65, .12);
  border-radius: 24px;
  background:
    radial-gradient(circle at 93% 0, rgba(197, 163, 99, .13), transparent 19rem),
    rgba(255, 253, 249, .42);
  box-shadow: 0 28px 76px rgba(48, 37, 25, .065);
}

.dashhead {
  margin-bottom: 22px;
  align-items: flex-end;
}

#oggi .dashhead h2.sec {
  font-size: clamp(36px, 4vw, 48px) !important;
}

.modebar {
  padding: 4px;
  gap: 3px;
  border: 1px solid rgba(104, 88, 65, .14);
  border-radius: 999px;
  background: rgba(255, 255, 255, .65);
}

.modebar button {
  min-height: 44px;
  padding: 6px 14px;
  border: 0;
  background: transparent;
}

.modebar button.on {
  box-shadow: 0 5px 14px rgba(33, 29, 24, .19);
}

.cockpit-layout {
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .8fr);
  gap: 16px;
}

.cockpit-now {
  border-left: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .7), rgba(255, 253, 249, .96)),
    var(--carta2);
}

.cockpit-now::before {
  content: "";
  display: block;
  width: 38px;
  height: 3px;
  margin-bottom: 16px;
  background: linear-gradient(90deg, var(--rosso), var(--premium-gold));
}

.cockpit-title {
  margin-top: 10px;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -.035em;
}

.cockpit-meta {
  font-size: 14px;
}

.cockpit-next {
  margin-top: 18px;
  padding-top: 16px;
}

.cockpit-next strong {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.35;
}

#weathercard {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(160deg, rgba(237, 242, 246, .92), rgba(255, 253, 249, .96));
}

#weathercard::after {
  content: "天";
  position: absolute;
  right: 16px;
  bottom: -28px;
  color: var(--blu);
  font: 110px/1 var(--serif);
  opacity: .045;
}

.status-chip {
  border-color: rgba(104, 88, 65, .12);
  padding: 5px 10px;
  background: #eee7d9;
}

.appbtn,
.dactions a,
.dactions button,
.wact button,
.wact a,
.hcard .hact button,
.hcard .hact a {
  min-height: 42px;
  padding: 9px 14px;
  border-color: rgba(104, 88, 65, .17);
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(48, 37, 25, .035);
  transition: transform .16s, box-shadow .16s, background .16s, color .16s;
}

.appbtn:hover,
.dactions a:hover,
.dactions button:hover,
.wact button:hover,
.wact a:hover,
.hcard .hact button:hover,
.hcard .hact a:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(48, 37, 25, .11);
}

.appbtn.primary {
  background: linear-gradient(145deg, #ae3034, #8f1f24);
  box-shadow: 0 8px 22px rgba(155, 34, 38, .2);
}

.simulator {
  margin-top: 18px;
  padding-top: 16px;
}

/* Capitoli */
.chapter {
  margin: 72px 0 34px;
}

.chapter .herochap {
  min-height: 290px;
  display: grid;
  align-content: center;
  padding: 48px 50px;
  border: 1px solid rgba(197, 163, 99, .18);
  border-radius: 22px;
  background:
    radial-gradient(circle at 86% 12%, rgba(197, 163, 99, .14), transparent 18rem),
    linear-gradient(145deg, #1b1815, #2c2620);
  box-shadow: 0 30px 80px rgba(30, 24, 18, .16);
}

.chapter .herochap::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(234, 216, 179, .08);
  border-radius: 14px;
  pointer-events: none;
}

.chapter .herochap h2 {
  font-size: clamp(40px, 6vw, 58px);
  letter-spacing: -.045em;
}

.chapter .herochap p {
  max-width: 58ch;
  font-size: 17px;
  line-height: 1.65;
}

.chapter .herochap .kj {
  right: 16px;
  bottom: -58px;
  font-size: 210px;
  color: var(--premium-gold);
  opacity: .055;
}

.dropcap {
  max-width: 78ch;
  margin-inline: auto;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.75;
}

.pull {
  margin: 28px 0;
  padding: 10px 0 10px 24px;
  border-left-color: var(--premium-gold);
  font-size: 24px;
}

.photo {
  padding: 0;
  overflow: hidden;
  border-radius: 18px;
  background: #e9e1d2;
  box-shadow: var(--ombra);
}

.photo .ph-img {
  aspect-ratio: 16 / 8.5;
  object-fit: cover;
  margin: 0;
  border-radius: 0;
}

.photo .ph-cap {
  padding: 15px 22px 4px;
}

.photo .ph-shoot {
  padding: 0 22px 18px;
}

/* Giornate */
details.day {
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(104, 88, 65, .16);
  border-left: 0;
  border-radius: 20px;
  background: rgba(255, 253, 249, .94);
  box-shadow: var(--ombra);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}

details.day:hover {
  border-color: rgba(104, 88, 65, .24);
  box-shadow: var(--ombra-hover);
}

details.day.today {
  border-color: rgba(169, 130, 54, .7);
  box-shadow: 0 0 0 3px rgba(169, 130, 54, .11), var(--ombra-hover);
}

details.day > summary {
  min-height: 128px;
  padding: 27px 66px 25px 28px;
  display: grid;
  align-content: center;
  background:
    linear-gradient(100deg, rgba(165, 40, 44, .035), transparent 46%),
    rgba(255, 255, 255, .38);
}

details.day > summary::after {
  right: 27px;
  top: 50%;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(104, 88, 65, .14);
  border-radius: 50%;
  background: rgba(255, 255, 255, .6);
  transform: translateY(-50%);
}

details.day[open] > summary {
  border-bottom: 1px solid rgba(104, 88, 65, .1);
}

details.day[open] > summary::after {
  transform: translateY(-50%) rotate(90deg);
}

.day .dhead {
  gap: 11px;
}

.day .dnum {
  padding: 5px 11px;
  border-radius: 7px;
  background: linear-gradient(145deg, #ad3034, #8c1f23);
  font-size: 11px;
  letter-spacing: 1.2px;
  box-shadow: 0 5px 14px rgba(155, 34, 38, .16);
}

.day h3 {
  font-size: clamp(24px, 3.4vw, 32px);
  line-height: 1.16;
  letter-spacing: -.025em;
}

.day .dsub {
  margin-top: 7px;
  color: var(--grigio);
  font-family: var(--serif);
  font-size: 15px;
}

.sumquick {
  margin-top: 12px !important;
  gap: 6px 18px !important;
}

.sumquick span {
  color: var(--grigio);
}

details.day > :not(summary) {
  margin-left: 28px;
  margin-right: 28px;
}

details.day > .daybar {
  margin-top: 22px;
}

details.day > :last-child {
  margin-bottom: 28px;
}

.daybar {
  gap: 7px;
}

.daybar a,
.daybar button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-color: rgba(104, 88, 65, .14);
  border-radius: 9px;
  background: rgba(255, 255, 255, .72);
  color: var(--inchiostro);
  box-shadow: 0 3px 10px rgba(48, 37, 25, .035);
}

.opbox {
  padding: 20px 22px;
  border: 1px solid rgba(197, 163, 99, .16);
  border-radius: 14px;
  background:
    radial-gradient(circle at 100% 0, rgba(197, 163, 99, .12), transparent 14rem),
    linear-gradient(145deg, #211d19, #302921);
  box-shadow: 0 16px 34px rgba(36, 28, 21, .13);
  font-size: 14px;
  line-height: 1.7;
}

.opbox b.lbl {
  color: #d7b775;
}

.day .base {
  padding: 7px 12px;
  border: 1px solid rgba(83, 139, 102, .14);
  border-radius: 9px;
  background: rgba(231, 245, 236, .72);
}

ul.tl {
  position: relative;
  margin-top: 20px;
}

ul.tl::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 24px;
  bottom: 24px;
  width: 1px;
  background: linear-gradient(var(--rosso), rgba(165, 40, 44, .08));
}

ul.tl li {
  padding: 15px 0 16px 34px;
  border-bottom-color: rgba(104, 88, 65, .12);
}

ul.tl li::before {
  left: 6px;
  top: 23px;
  width: 9px;
  height: 9px;
  border: 3px solid var(--carta2);
  box-shadow: 0 0 0 1px rgba(165, 40, 44, .18);
}

ul.tl li .t {
  display: inline-block;
  min-width: 62px;
  margin-right: 3px;
  font-size: 13px;
}

ul.tl li .why {
  margin-top: 6px;
  color: #514a41;
  line-height: 1.65;
}

ul.tl li .note {
  margin-top: 7px;
  color: var(--grigio);
  line-height: 1.55;
}

.tags {
  gap: 7px;
}

.tag,
.pill,
.v {
  border-radius: 999px;
}

.placecard {
  padding: 23px 24px;
  border-top: 0;
  border-left: 3px solid var(--rosso);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(48, 37, 25, .05);
}

.placecard h4.pc {
  font-size: 23px;
}

.placecard .pc-specs span {
  border-color: rgba(104, 88, 65, .12);
  border-radius: 7px;
  background: #f1ebdf;
}

.route-panel {
  background:
    linear-gradient(140deg, rgba(245, 239, 226, .78), rgba(255, 253, 249, .94));
}

.maplink {
  min-height: 42px;
  padding: 9px 14px;
  border-radius: 10px;
}

/* Tabelle */
.tw {
  border: 1px solid rgba(104, 88, 65, .14);
  border-radius: 14px;
  background: rgba(255, 253, 249, .75);
  box-shadow: 0 10px 30px rgba(48, 37, 25, .045);
}

table th,
table td {
  padding: 12px 13px;
  border-bottom-color: rgba(104, 88, 65, .11);
}

table th {
  background: #28231e;
  color: #e7d7b8;
  font-size: 10px;
  letter-spacing: .9px;
}

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

/* Wallet, hotel, dati e diario */
#walletbody > .card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.wcard,
.hcard,
.journal-card {
  margin: 0;
  padding: 20px;
  border-radius: 15px;
}

.wcard .wname {
  font-size: 19px;
}

.wnote,
.journal-note,
.setting-field input,
.sim-fields input {
  border-color: rgba(104, 88, 65, .17);
  border-radius: 10px;
  background: rgba(255, 255, 255, .78);
}

#hotelcards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

#hotelcards > h4 {
  grid-column: 1 / -1;
}

.hcard {
  border-top: 0;
  border-left: 3px solid var(--rosso);
}

.hcard h4.hn {
  font-size: 21px;
}

.passport-grid {
  gap: 16px;
}

.passport-stamp {
  border-color: rgba(104, 88, 65, .3);
  background: rgba(255, 255, 255, .35);
  transition: transform .2s, color .2s, border-color .2s, box-shadow .2s;
}

.passport-stamp:hover {
  transform: rotate(0) scale(1.035);
}

.passport-stamp[aria-pressed="true"] {
  box-shadow: inset 0 0 0 5px rgba(165, 40, 44, .065), 0 10px 28px rgba(165, 40, 44, .09);
}

.journal-grid {
  gap: 14px;
}

.data-grid {
  gap: 16px;
}

.attachment-item {
  border-color: rgba(104, 88, 65, .12);
  border-radius: 9px;
  background: #f4efe5;
}

/* Bottoni flottanti e footer */
.sos-fab {
  left: 20px;
  bottom: 24px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, .6);
  background: linear-gradient(145deg, #b33b32, #8c241f);
  box-shadow: 0 12px 30px rgba(121, 31, 25, .25);
}

#backtop {
  right: 20px;
  bottom: 24px;
  border-color: rgba(104, 88, 65, .15);
  background: rgba(255, 253, 249, .9);
  backdrop-filter: blur(12px);
}

footer {
  padding: 50px 20px 72px;
}

/* Dark premium */
body.dark {
  --carta: #151310;
  --carta2: #211d19;
  --inchiostro: #f0e8d9;
  --grigio: #b8ad9a;
  --grigiochiaro: #8f8575;
  --bordo: #3b342b;
  --rossoscuro: #e38b78;
  --premium-paper: rgba(33, 29, 25, .92);
  background:
    radial-gradient(circle at 12% 8%, rgba(197, 163, 99, .07), transparent 28rem),
    radial-gradient(circle at 88% 30%, rgba(165, 40, 44, .06), transparent 32rem),
    #151310;
}

body.dark #oggi {
  background:
    radial-gradient(circle at 93% 0, rgba(197, 163, 99, .08), transparent 19rem),
    rgba(30, 26, 22, .55);
}

body.dark details.day,
body.dark .card,
body.dark .app-panel,
body.dark .journal-card,
body.dark .wcard,
body.dark .hcard,
body.dark .placecard,
body.dark .qrcard {
  background: rgba(34, 30, 26, .95);
  border-color: rgba(218, 198, 164, .11);
}

body.dark details.day > summary {
  background:
    linear-gradient(100deg, rgba(194, 67, 70, .05), transparent 46%),
    rgba(255, 255, 255, .012);
}

body.dark #weathercard {
  background: linear-gradient(160deg, #202933, #211d19);
}

body.dark .cockpit-now {
  background: linear-gradient(145deg, #26211c, #211d19);
}

body.dark .modebar {
  background: rgba(39, 34, 29, .9);
}

body.dark .box {
  box-shadow: none;
}

body.dark ul.tl li .why {
  color: #d6cdbc;
}

body.dark .placecard .pc-specs span,
body.dark .attachment-item {
  background: #2c2620;
}

body.dark .tw {
  background: rgba(33, 29, 25, .8);
}

body.dark #guidesearch {
  background: rgba(21, 19, 16, .93);
}

body.dark #guidesearch input,
body.dark #guidesearch .gsbtn {
  border-color: rgba(226, 210, 180, .12);
  background: rgba(43, 37, 31, .92);
  color: #eee6d6;
}

body.dark .daybar a,
body.dark .daybar button,
body.dark .appbtn {
  border-color: rgba(226, 210, 180, .13);
  background: #2b251f;
  color: #eee6d6;
}

/* Tablet */
@media (max-width: 900px) {
  main {
    padding-inline: 22px;
  }

  .cockpit-layout {
    grid-template-columns: 1fr;
  }

  #walletbody > .card,
  #hotelcards {
    grid-template-columns: 1fr;
  }
}

/* Telefono: leggibilità e target tattili */
@media (max-width: 680px) {
  html {
    scroll-padding-top: 103px;
  }

  body {
    font-size: 16px;
    line-height: 1.7;
    padding-bottom: calc(70px + env(safe-area-inset-bottom));
  }

  main {
    padding: 30px 14px 96px;
  }

  section {
    margin: 46px 0;
    scroll-margin-top: 108px;
  }

  header.hero {
    min-height: 460px;
    padding: 80px 22px 66px;
  }

  header.hero::before {
    inset: 14px;
  }

  header.hero .kanji {
    font-size: 12px;
    letter-spacing: 8px;
  }

  header.hero h1 {
    font-size: clamp(48px, 16vw, 62px);
  }

  header.hero p.who {
    margin-top: 22px;
    font-size: 18px;
    line-height: 1.55;
  }

  header.hero .meta {
    gap: 6px;
  }

  header.hero .meta span {
    padding: 7px 12px;
    font-size: 11.5px;
  }

  nav.toc {
    min-height: 48px;
    padding: 7px 8px;
  }

  nav.toc a {
    min-height: 34px;
    padding: 5px 10px;
    font-size: 11px;
  }

  #guidesearch {
    min-height: 52px;
    padding: 7px 9px;
  }

  #guidesearch input {
    min-width: 0;
    height: 44px;
    font-size: 14px;
  }

  #guidesearch .gsbtn {
    width: 44px;
    height: 44px;
  }

  #guidesearch .cnt {
    display: none;
  }

  h2.sec {
    font-size: 31px;
  }

  .lead {
    font-size: 16.5px;
  }

  .card {
    padding: 22px 20px;
    border-radius: 16px;
  }

  #oggi {
    margin: 8px -2px;
    padding: 22px 12px 14px;
    border-radius: 20px;
  }

  .dashhead {
    display: block;
    margin-bottom: 16px;
  }

  #oggi .dashhead h2.sec {
    font-size: 36px !important;
  }

  .modebar {
    margin-top: 13px;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  .modebar::-webkit-scrollbar {
    display: none;
  }

  .modebar button {
    flex: 0 0 auto;
    min-height: 44px;
    padding-inline: 13px;
  }

  .app-panel {
    padding: 20px 18px;
    border-radius: 16px;
  }

  .cockpit-layout {
    gap: 12px;
  }

  .cockpit-title {
    font-size: 31px;
  }

  .cockpit-next strong {
    font-size: 17px;
  }

  .app-actions {
    gap: 7px;
  }

  .appbtn,
  .dactions a,
  .dactions button,
  .wact button,
  .wact a {
    min-height: 44px;
    padding: 9px 13px;
  }

  .chapter {
    margin-top: 58px;
  }

  .chapter .herochap {
    min-height: 300px;
    padding: 38px 25px;
    border-radius: 18px;
  }

  .chapter .herochap::before {
    inset: 10px;
  }

  .chapter .herochap h2 {
    font-size: 42px;
  }

  .chapter .herochap p {
    font-size: 16px;
  }

  .dropcap {
    font-size: 17px;
    line-height: 1.72;
  }

  .photo {
    margin-inline: -2px;
    border-radius: 15px;
  }

  .photo .ph-img {
    aspect-ratio: 4 / 3;
  }

  details.day {
    margin-inline: -1px;
    border-radius: 16px;
  }

  details.day > summary {
    min-height: 134px;
    padding: 23px 52px 22px 20px;
  }

  details.day > summary::after {
    right: 15px;
    width: 30px;
    height: 30px;
  }

  .day .dhead {
    display: block;
  }

  .day .dnum {
    width: fit-content;
    margin-bottom: 12px;
  }

  .day h3 {
    font-size: 25px;
    line-height: 1.22;
  }

  .day .dsub {
    margin-top: 9px;
    font-size: 14.5px;
    line-height: 1.55;
  }

  .sumquick {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 3px !important;
  }

  details.day > :not(summary) {
    margin-left: 18px;
    margin-right: 18px;
  }

  details.day > .daybar {
    margin-top: 18px;
  }

  details.day > :last-child {
    margin-bottom: 20px;
  }

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

  .daybar a,
  .daybar button {
    min-height: 44px;
    justify-content: center;
    text-align: center;
  }

  .opbox {
    padding: 18px;
    font-size: 14.5px;
  }

  ul.tl li {
    padding: 17px 0 18px 31px;
  }

  ul.tl li .t {
    display: block;
    margin-bottom: 3px;
    font-size: 14px;
  }

  ul.tl li .why,
  ul.tl li .note {
    font-size: 14.5px;
  }

  .tags {
    display: grid;
  }

  .tag {
    width: 100%;
    border-radius: 9px;
    line-height: 1.45;
  }

  .placecard {
    padding: 20px 18px;
  }

  .placecard h4.pc {
    font-size: 21px;
  }

  .passport-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .journal-grid,
  .data-grid {
    gap: 11px;
  }

  .journal-card,
  .wcard,
  .hcard {
    padding: 18px;
  }

  .tw {
    margin-inline: -1px;
    border-radius: 11px;
  }

  .botnav {
    min-height: 66px;
    padding-bottom: env(safe-area-inset-bottom);
    border-top-color: rgba(255, 255, 255, .09);
    background: rgba(26, 22, 19, .96);
    box-shadow: 0 -10px 30px rgba(25, 20, 16, .18);
    backdrop-filter: blur(16px);
  }

  .botnav a,
  .botnav button {
    min-height: 64px;
    padding-top: 9px;
    color: rgba(239, 228, 209, .75);
  }

  .botnav .ic {
    font-size: 18px;
  }

  .botnav .sos-nav {
    color: #ffb8a9;
  }
}

@media print {
  body {
    background: #fff !important;
  }

  body::before,
  header.hero::before,
  .chapter .herochap::before {
    display: none !important;
  }

  .card,
  .app-panel,
  details.day,
  .placecard,
  .wcard,
  .hcard,
  .journal-card,
  .tw {
    box-shadow: none !important;
    backdrop-filter: none !important;
  }

  details.day > :not(summary) {
    margin-left: 12px;
    margin-right: 12px;
  }
}

/* ============================================================
   NAVIGAZIONE VISIBILE + COPERTINA FOTOGRAFICA + GOOGLE EARTH
   ============================================================ */

header.hero {
  isolation: isolate;
  min-height: 560px;
  background-color: #1c1814;
  background-image:
    linear-gradient(180deg, rgba(14, 12, 10, .28) 0%, rgba(14, 12, 10, .48) 48%, rgba(14, 12, 10, .82) 100%),
    radial-gradient(circle at 50% 40%, rgba(0, 0, 0, 0) 12%, rgba(13, 10, 8, .42) 100%),
    url("https://commons.wikimedia.org/wiki/Special:FilePath/Floating%20Torii%20Gate%20Itsukushima%20Shrine%20%28111096511%29.jpeg?width=1800");
  background-position: center, center, center 58%;
  background-size: cover;
  background-repeat: no-repeat;
}

header.hero::before,
header.hero::after {
  z-index: 0;
}

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

header.hero .hero-credit {
  position: absolute;
  right: 34px;
  bottom: 23px;
  z-index: 2;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  background: rgba(14, 12, 10, .44);
  color: rgba(255, 255, 255, .78);
  font-size: 10px;
  line-height: 1;
  letter-spacing: .04em;
  text-decoration: none;
  backdrop-filter: blur(8px);
}

header.hero .hero-credit:hover,
header.hero .hero-credit:focus-visible {
  background: rgba(14, 12, 10, .72);
  color: #fff;
}

.toc-shell {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 46px;
  min-height: 52px;
  background: rgba(28, 24, 20, .98);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 8px 24px rgba(24, 19, 14, .2);
}

.toc-shell nav.toc {
  position: static;
  z-index: auto;
  min-width: 0;
  min-height: 52px;
  padding: 8px 5px;
  border: 0;
  box-shadow: none;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
}

.toc-shell nav.toc a {
  scroll-snap-align: center;
}

.toc-shell nav.toc a.is-current {
  border-color: rgba(231, 199, 135, .54);
  background: rgba(197, 163, 99, .2);
  color: #fff5de;
  box-shadow: inset 0 -2px 0 #d8b56d;
}

.toc-scroll {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(28, 24, 20, 1) 55%, rgba(28, 24, 20, .78));
  color: #e5c98f;
  cursor: pointer;
  transition: color .18s, background .18s, opacity .18s;
}

.toc-next {
  background:
    linear-gradient(270deg, rgba(28, 24, 20, 1) 55%, rgba(28, 24, 20, .78));
}

.toc-scroll span {
  display: block;
  transform: translateY(-1px);
  font-family: Georgia, serif;
  font-size: 32px;
  line-height: 1;
}

.toc-scroll:hover,
.toc-scroll:focus-visible {
  background: #3a3026;
  color: #fff2cf;
  outline: 2px solid rgba(229, 201, 143, .6);
  outline-offset: -3px;
}

.toc-scroll:disabled {
  color: rgba(229, 201, 143, .22);
  cursor: default;
  opacity: .7;
}

.photo .earth-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 12px auto 2px;
  padding: 8px 13px;
  border: 1px solid rgba(67, 94, 72, .2);
  border-radius: 999px;
  background: rgba(239, 246, 238, .86);
  color: #2f6541;
  font-family: var(--sans);
  font-size: 12.5px;
  font-style: normal;
  font-weight: 750;
  text-decoration: none;
}

.photo .earth-link:hover,
.photo .earth-link:focus-visible {
  border-color: #3f7550;
  background: #e5f2e7;
  color: #214f31;
}

.earth-panel {
  margin: 14px 0 20px;
  padding: 17px 18px;
  border: 1px solid rgba(59, 99, 73, .18);
  border-radius: 14px;
  background:
    radial-gradient(circle at 100% 0, rgba(75, 132, 92, .11), transparent 14rem),
    rgba(247, 250, 245, .8);
  box-shadow: 0 10px 30px rgba(42, 65, 48, .06);
}

.earth-panel strong {
  display: block;
  margin-bottom: 3px;
  color: #294f35;
  font-family: var(--serif);
  font-size: 18px;
}

.earth-panel > span {
  display: block;
  color: var(--grigio);
  font-size: 13px;
}

.earth-locations {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.earth-locations a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  padding: 7px 12px;
  border: 1px solid rgba(52, 94, 66, .18);
  border-radius: 9px;
  background: rgba(255, 255, 255, .84);
  color: #2d6340;
  font-size: 12.5px;
  font-weight: 750;
  text-decoration: none;
}

.earth-locations a:hover,
.earth-locations a:focus-visible {
  border-color: #4b805b;
  background: #edf6ed;
}

body.dark .earth-panel {
  border-color: rgba(138, 184, 147, .16);
  background:
    radial-gradient(circle at 100% 0, rgba(75, 132, 92, .12), transparent 14rem),
    rgba(28, 35, 29, .82);
}

body.dark .earth-panel strong {
  color: #b9d7be;
}

body.dark .earth-locations a,
body.dark .photo .earth-link {
  border-color: rgba(150, 195, 158, .17);
  background: rgba(44, 58, 47, .88);
  color: #c4dfc8;
}

@media (max-width: 680px) {
  header.hero {
    min-height: 500px;
    padding: 82px 23px 76px;
    background-position: center, center, 54% center;
  }

  header.hero .hero-credit {
    right: 50%;
    bottom: 18px;
    max-width: calc(100% - 36px);
    transform: translateX(50%);
    white-space: nowrap;
  }

  .toc-shell {
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    min-height: 48px;
  }

  .toc-shell nav.toc {
    min-height: 48px;
    padding: 7px 3px;
  }

  .toc-scroll span {
    font-size: 29px;
  }

  .earth-panel {
    padding: 16px;
  }

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

  .earth-locations a {
    justify-content: center;
  }
}

@media print {
  .toc-shell,
  .hero-credit,
  .earth-panel,
  .earth-link {
    display: none !important;
  }

  header.hero {
    min-height: 0;
    background-image: none !important;
  }
}

/* ============================================================
   WOW SUITE · LIVE MODE, COPILOTA PRIVATO, ATLANTE INTERATTIVO
   ============================================================ */

.live-progress-block {
  margin-top: 16px;
}

.live-progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  color: var(--grigio);
  font-size: 11.5px;
}

.live-progress-label strong {
  color: var(--rosso);
}

.live-progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(102, 86, 65, .12);
}

.live-progress-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--premium-gold), var(--rosso));
  box-shadow: 0 0 18px rgba(165, 40, 44, .22);
  transition: width .45s ease;
}

.live-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.live-facts > div {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(104, 88, 65, .12);
  border-radius: 10px;
  background: rgba(255, 255, 255, .48);
}

.live-facts span,
.live-context-card span,
.live-story-block span {
  display: block;
  margin-bottom: 3px;
  color: var(--grigio);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.live-facts strong {
  display: block;
  overflow: hidden;
  font-size: 11.5px;
  line-height: 1.35;
  text-overflow: ellipsis;
}

.appbtn.live-launch {
  border-color: #a5282c;
  background: linear-gradient(135deg, #a5282c, #6f171a);
  color: #fff;
  box-shadow: 0 8px 22px rgba(126, 29, 33, .2);
}

.live-dialog {
  width: min(930px, calc(100vw - 28px));
  max-height: calc(100dvh - 24px);
  border-color: rgba(218, 198, 164, .2);
  background: #eee8dc;
}

.live-dialog-head {
  background:
    radial-gradient(circle at 0 0, rgba(197, 163, 99, .18), transparent 16rem),
    #191613;
}

.live-dialog-head > div {
  display: flex;
  align-items: center;
  gap: 13px;
}

.live-dialog-head h2 {
  font-size: 22px;
}

.live-signal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #f3d89c;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .13em;
}

.live-signal i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff6258;
  box-shadow: 0 0 0 5px rgba(255, 98, 88, .12);
  animation: live-pulse 1.8s infinite;
}

.live-dialog .dialog-body {
  padding: 18px;
  background:
    radial-gradient(circle at 100% 0, rgba(197, 163, 99, .09), transparent 24rem),
    #f4efe6;
}

.live-stage {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 19px;
  background:
    radial-gradient(circle at 95% 0, rgba(197, 163, 99, .16), transparent 19rem),
    radial-gradient(circle at 0 100%, rgba(165, 40, 44, .16), transparent 22rem),
    linear-gradient(145deg, #1c1915, #28211b);
  color: #f5eddf;
  box-shadow: 0 22px 55px rgba(32, 25, 19, .2);
}

.live-stage::after {
  content: "今";
  position: absolute;
  right: -24px;
  bottom: -70px;
  color: rgba(255, 255, 255, .025);
  font-family: var(--serif);
  font-size: 240px;
  pointer-events: none;
}

.live-stage-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.live-stage .cockpit-kicker {
  color: #d5b776;
}

.live-stage-top h3 {
  margin: 5px 0 3px;
  color: #fff;
  font-family: var(--serif);
  font-size: clamp(25px, 4vw, 36px);
}

.live-stage-top p {
  margin: 0;
  color: rgba(245, 237, 223, .68);
  font-size: 13px;
}

.live-orbit {
  --live-progress: 0%;
  position: relative;
  display: grid;
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#d3b574 var(--live-progress), rgba(255, 255, 255, .1) 0);
}

.live-orbit::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: #211c17;
}

.live-orbit span {
  position: relative;
  z-index: 1;
  color: #f7e9c9;
  font-size: 14px;
  font-weight: 900;
}

.live-primary {
  position: relative;
  z-index: 1;
  margin-top: 22px;
  padding: 18px 0;
  border-top: 1px solid rgba(255, 255, 255, .09);
  border-bottom: 1px solid rgba(255, 255, 255, .09);
}

.live-primary > span {
  display: block;
  color: #d5b776;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.live-primary strong {
  display: block;
  margin-top: 5px;
  font-family: var(--serif);
  font-size: clamp(23px, 4vw, 34px);
  line-height: 1.16;
}

.live-primary strong b {
  margin-right: 8px;
  color: #ef8d7d;
  font-family: var(--sans);
  font-size: .62em;
  font-variant-numeric: tabular-nums;
}

.live-primary em {
  display: inline-flex;
  margin-top: 8px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(197, 163, 99, .13);
  color: #edd39c;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.live-progress-large {
  position: relative;
  z-index: 1;
  height: 8px;
  margin-top: 17px;
  background: rgba(255, 255, 255, .09);
}

.live-mini-route {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 15px 0 0;
  padding: 0;
  list-style: none;
}

.live-mini-route li {
  min-width: 0;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
  background: rgba(255, 255, 255, .035);
}

.live-mini-route li.current {
  border-color: rgba(239, 141, 125, .48);
  background: rgba(165, 40, 44, .18);
}

.live-mini-route li.next {
  border-color: rgba(213, 183, 118, .35);
}

.live-mini-route li.done,
.live-mini-route li.skipped,
.live-mini-route li.skip {
  opacity: .48;
}

.live-mini-route span,
.live-mini-route strong,
.live-mini-route em {
  display: block;
}

.live-mini-route span {
  color: #ef8d7d;
  font-size: 10px;
  font-weight: 900;
}

.live-mini-route strong {
  margin-top: 3px;
  overflow: hidden;
  font-size: 11.5px;
  line-height: 1.35;
  text-overflow: ellipsis;
}

.live-mini-route em {
  margin-top: 4px;
  color: #d5b776;
  font-size: 9.5px;
  font-style: normal;
}

.live-action-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-top: 17px;
}

.live-big-action {
  min-height: 70px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 12px;
  background: rgba(255, 255, 255, .055);
  color: #f5eddf;
  font: 800 11px/1.25 var(--sans);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.live-big-action span {
  display: block;
  margin-bottom: 4px;
  color: #d5b776;
  font-size: 21px;
}

.live-big-action.done {
  border-color: rgba(118, 190, 137, .36);
  background: rgba(55, 106, 77, .3);
}

.live-big-action:hover,
.live-big-action:focus-visible {
  border-color: rgba(255, 255, 255, .34);
  background: rgba(255, 255, 255, .1);
}

.live-context-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.live-context-card {
  padding: 15px;
  border: 1px solid rgba(104, 88, 65, .13);
  border-radius: 13px;
  background: rgba(255, 253, 249, .8);
}

.live-context-card strong {
  display: block;
  font-size: 12px;
  line-height: 1.4;
}

.live-hotel-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin-top: 12px;
  padding: 17px;
  border: 1px solid rgba(104, 88, 65, .13);
  border-left: 3px solid var(--rosso);
  border-radius: 13px;
  background: rgba(255, 253, 249, .84);
}

.live-hotel-card h3 {
  margin: 3px 0;
  font-family: var(--serif);
  font-size: 20px;
}

.live-hotel-card p {
  margin: 3px 0;
}

.live-utility-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
}

.live-plan-b {
  margin-top: 12px;
  padding: 12px 15px;
  border: 1px solid #d5dfe7;
  border-radius: 12px;
  background: #eef4f7;
}

.live-plan-b summary {
  color: #365a6f;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.live-plan-b p {
  margin: 8px 0 0;
  font-size: 13px;
}

/* Atlante */
.atlas-section {
  margin: 62px 0 46px;
  scroll-margin-top: 120px;
}

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

.atlas-heading h2.sec {
  margin-bottom: 7px;
}

.atlas-heading .lead {
  margin-bottom: 0;
}

.atlas-play {
  min-height: 44px;
  flex: 0 0 auto;
  padding: 9px 15px;
  border: 1px solid rgba(165, 40, 44, .2);
  border-radius: 999px;
  background: rgba(165, 40, 44, .08);
  color: var(--rosso);
  font: 800 12px var(--sans);
  cursor: pointer;
}

.atlas-play[aria-pressed="true"] {
  background: var(--rosso);
  color: #fff;
}

.atlas-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, .8fr);
  overflow: hidden;
  min-height: 460px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 22px;
  background: #181a18;
  box-shadow: 0 24px 70px rgba(28, 21, 16, .18);
}

.atlas-stage {
  position: relative;
  min-height: 460px;
  overflow: hidden;
}

.atlas-canvas,
.atlas-grid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.atlas-grid {
  opacity: .2;
  background-image:
    linear-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .08) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to right, transparent, #000 12%, #000 86%, transparent);
}

.atlas-land {
  fill: none;
  stroke: rgba(197, 163, 99, .16);
  stroke-linecap: round;
  stroke-width: 8;
}

.atlas-land-echo {
  stroke: rgba(255, 255, 255, .04);
  stroke-width: 4;
}

.atlas-route-shadow,
.atlas-route-line {
  fill: none;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.atlas-route-shadow {
  stroke: rgba(0, 0, 0, .4);
  stroke-width: 8;
}

.atlas-route-line {
  stroke: url(#atlasRouteGradient);
  stroke-width: 3;
  filter: drop-shadow(0 0 7px rgba(239, 101, 90, .55));
}

.atlas-route-line.animate {
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  animation: atlas-draw 1s cubic-bezier(.2, .8, .2, 1) forwards;
}

.atlas-marker {
  position: absolute;
  z-index: 3;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(247, 237, 220, .58);
  transform: translate(-50%, -50%);
  cursor: pointer;
}

.atlas-marker i {
  position: absolute;
  top: 15px;
  left: 50%;
  display: block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, .38);
  border-radius: 50%;
  background: #20201c;
  transform: translateX(-50%);
  transition: transform .25s, background .25s, border-color .25s;
}

.atlas-marker span {
  position: absolute;
  top: 30px;
  left: 50%;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(16, 18, 17, .5);
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
  transform: translateX(-50%);
}

.atlas-marker.on-route {
  color: #f6e7c6;
}

.atlas-marker.on-route i {
  border-color: #d5b776;
  background: #d5b776;
  box-shadow: 0 0 0 6px rgba(213, 183, 118, .1);
}

.atlas-marker.destination i {
  border-color: #ff7b70;
  background: #ef655a;
  box-shadow: 0 0 0 9px rgba(239, 101, 90, .13), 0 0 24px rgba(239, 101, 90, .55);
  transform: translateX(-50%) scale(1.2);
}

/* mappa satellitare vera (tile GSI) — visibile nei giorni in Giappone */
.atlas-sat {
  position: absolute;
  overflow: hidden;
  opacity: 0;
  transition: opacity .6s ease;
  pointer-events: none;
}

.atlas-sat img {
  position: absolute;
  display: block;
  filter: brightness(1.18) saturate(1.08);
}

.atlas-sat::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(17, 27, 33, .06), rgba(17, 27, 33, .26));
}

.atlas-sat-credit {
  position: absolute;
  right: 9px;
  bottom: 6px;
  z-index: 1;
  color: rgba(255, 255, 255, .55);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .08em;
}

.atlas-stage.sat .atlas-sat {
  opacity: 1;
}

.atlas-stage.sat .atlas-sea,
.atlas-stage.sat .atlas-land {
  opacity: 0;
}

.atlas-stage.sat .atlas-grid {
  opacity: .1;
}

.atlas-marker.off-map {
  display: none;
}

.atlas-stage.sat .atlas-marker span {
  background: rgba(16, 18, 17, .68);
}

.atlas-watermark {
  position: absolute;
  left: 24px;
  bottom: 19px;
  color: rgba(255, 255, 255, .36);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .18em;
}

.atlas-watermark span {
  display: block;
  color: rgba(213, 183, 118, .54);
  font-family: var(--serif);
  font-size: 25px;
  letter-spacing: .08em;
}

.atlas-story {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 30px 27px;
  border-left: 1px solid rgba(255, 255, 255, .08);
  background:
    radial-gradient(circle at 100% 0, rgba(197, 163, 99, .13), transparent 17rem),
    rgba(20, 18, 16, .94);
  color: #f2eadc;
}

.atlas-day-label {
  color: #d5b776;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.atlas-story h3 {
  margin: 7px 0 3px;
  color: #fff;
  font-family: var(--serif);
  font-size: clamp(27px, 4vw, 40px);
  line-height: 1.08;
}

.atlas-story > p {
  margin: 0 0 18px;
  color: rgba(242, 234, 220, .62);
  font-size: 12px;
}

.atlas-story-block {
  padding: 13px 0;
  border-top: 1px solid rgba(255, 255, 255, .09);
}

.atlas-story-block span {
  color: #bda66f;
}

.atlas-story-block strong {
  display: block;
  font-size: 13px;
  line-height: 1.4;
}

.atlas-story-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 17px;
}

.atlas-story .appbtn {
  border-color: rgba(255, 255, 255, .13);
  background: rgba(255, 255, 255, .055);
  color: #f2eadc;
}

.atlas-story .appbtn.primary {
  border-color: #a5282c;
  background: #a5282c;
}

.atlas-controls {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 7px;
  align-items: center;
  margin-top: 10px;
}

.atlas-controls > button {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(104, 88, 65, .14);
  border-radius: 50%;
  background: rgba(255, 253, 249, .8);
  color: var(--rosso);
  font: 700 25px var(--serif);
  cursor: pointer;
}

.atlas-timeline {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 3px;
  scrollbar-width: none;
  scroll-behavior: smooth;
}

.atlas-timeline::-webkit-scrollbar {
  display: none;
}

.atlas-timeline button {
  min-width: 62px;
  min-height: 48px;
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid rgba(104, 88, 65, .13);
  border-radius: 10px;
  background: rgba(255, 253, 249, .7);
  color: var(--inchiostro);
  cursor: pointer;
}

.atlas-timeline button span,
.atlas-timeline button small {
  display: block;
}

.atlas-timeline button span {
  font-weight: 900;
}

.atlas-timeline button small {
  overflow: hidden;
  color: var(--grigio);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.atlas-timeline button.active {
  border-color: var(--rosso);
  background: var(--rosso);
  color: #fff;
  box-shadow: 0 7px 20px rgba(165, 40, 44, .2);
}

.atlas-timeline button.active small {
  color: rgba(255, 255, 255, .72);
}

.legacy-map {
  margin: 13px 0 20px;
  border: 1px solid rgba(104, 88, 65, .13);
  border-radius: 12px;
  background: rgba(255, 253, 249, .55);
}

.legacy-map > summary {
  min-height: 44px;
  padding: 11px 15px;
  color: var(--grigio);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.legacy-map > .routemap {
  margin: 0;
  padding: 0 13px 13px;
}

/* Copilota */
.copilot-fab {
  position: fixed;
  right: 20px;
  bottom: 86px;
  z-index: 58;
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, .65);
  border-radius: 999px;
  background: linear-gradient(135deg, #26211c, #8f2729);
  color: #fff;
  box-shadow: 0 14px 34px rgba(77, 27, 25, .25);
  font: 800 12px var(--sans);
  cursor: pointer;
}

.copilot-fab span {
  color: #f0d39a;
  font-size: 18px;
}

.copilot-dialog {
  width: min(720px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  background: #f2ede4;
}

.copilot-head {
  background:
    radial-gradient(circle at 0 0, rgba(165, 40, 44, .22), transparent 17rem),
    #1c1915;
}

.copilot-head > div {
  display: block;
}

.copilot-private {
  display: block;
  margin-bottom: 4px;
  color: #bcd1be;
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: .12em;
}

.copilot-body {
  display: grid;
  grid-template-rows: minmax(220px, 1fr) auto auto auto;
  min-height: min(640px, calc(100dvh - 100px));
  padding: 0;
}

.copilot-messages {
  overflow-y: auto;
  padding: 18px;
  background:
    radial-gradient(circle at 100% 0, rgba(197, 163, 99, .08), transparent 22rem),
    #f4efe7;
}

.copilot-message {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 12px;
}

.copilot-message > span {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 50%;
  background: #27211c;
  color: #e4c889;
}

.copilot-message > div {
  max-width: 85%;
  padding: 12px 14px;
  border: 1px solid rgba(104, 88, 65, .12);
  border-radius: 4px 15px 15px;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 6px 20px rgba(43, 33, 23, .045);
}

.copilot-message strong {
  display: block;
  font-family: var(--serif);
  font-size: 17px;
}

.copilot-message p {
  margin: 5px 0 0;
  font-size: 13.5px;
  line-height: 1.55;
}

.copilot-message.user {
  justify-content: flex-end;
}

.copilot-message.user > div {
  border-radius: 15px 4px 15px 15px;
  background: #27211c;
  color: #f4ecdd;
}

.copilot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.copilot-actions .appbtn {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 11px;
}

.copilot-speak {
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--rosso);
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
}

.copilot-prompts {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 10px 14px 6px;
  background: #f4efe7;
  scrollbar-width: none;
}

.copilot-prompts button {
  min-height: 35px;
  flex: 0 0 auto;
  padding: 6px 11px;
  border: 1px solid rgba(104, 88, 65, .13);
  border-radius: 999px;
  background: rgba(255, 255, 255, .76);
  color: var(--inchiostro);
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.copilot-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px 42px;
  gap: 7px;
  padding: 11px 14px;
  border-top: 1px solid rgba(104, 88, 65, .1);
  background: rgba(255, 253, 249, .92);
}

.copilot-form input {
  min-width: 0;
  height: 44px;
  padding: 9px 13px;
  border: 1px solid rgba(104, 88, 65, .18);
  border-radius: 12px;
  background: #fff;
  color: var(--inchiostro);
  font: 14px var(--sans);
}

.copilot-mic,
.copilot-send {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
}

.copilot-mic {
  background: #e7e0d5;
  color: #9b3132;
}

.copilot-mic.listening {
  background: #a5282c;
  color: #fff;
  animation: live-pulse 1s infinite;
}

.copilot-send {
  background: #27211c;
  color: #fff;
  font-size: 19px;
}

.copilot-note {
  margin: 0;
  padding: 0 15px 12px;
  background: rgba(255, 253, 249, .92);
  color: var(--grigio);
  font-size: 9.5px;
}

body.dark .live-facts > div,
body.dark .live-context-card,
body.dark .live-hotel-card,
body.dark .legacy-map,
body.dark .atlas-timeline button,
body.dark .atlas-controls > button {
  border-color: rgba(226, 210, 180, .12);
  background: rgba(39, 34, 29, .86);
}

body.dark .live-dialog,
body.dark .copilot-dialog,
body.dark .copilot-messages,
body.dark .copilot-prompts {
  background: #1d1916;
}

body.dark .live-dialog .dialog-body {
  background: #1d1916;
}

body.dark .copilot-message > div,
body.dark .copilot-form,
body.dark .copilot-note {
  border-color: rgba(226, 210, 180, .1);
  background: #29231e;
}

body.dark .copilot-form input {
  border-color: rgba(226, 210, 180, .13);
  background: #1e1a17;
  color: #f0e8d9;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .58; transform: scale(.86); }
}

@keyframes atlas-draw {
  to { stroke-dashoffset: 0; }
}

@media (max-width: 760px) {
  .live-facts {
    grid-template-columns: 1fr;
  }

  .live-dialog,
  .copilot-dialog {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .live-dialog .dialog-body {
    padding: 11px;
  }

  .live-stage {
    padding: 19px 16px;
    border-radius: 15px;
  }

  .live-stage-top h3 {
    font-size: 25px;
  }

  .live-orbit {
    width: 60px;
    height: 60px;
    flex-basis: 60px;
  }

  .live-primary strong {
    font-size: 24px;
  }

  .live-mini-route {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .live-mini-route li {
    min-width: 142px;
    flex: 0 0 142px;
    scroll-snap-align: start;
  }

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

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

  .live-hotel-card .app-actions {
    margin-top: 0;
  }

  .atlas-heading {
    display: block;
  }

  .atlas-play {
    margin-top: 10px;
  }

  .atlas-shell {
    grid-template-columns: 1fr;
    min-height: 0;
    border-radius: 17px;
  }

  .atlas-stage {
    min-height: 350px;
  }

  .atlas-story {
    min-height: 290px;
    padding: 23px 20px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    border-left: 0;
  }

  .atlas-story h3 {
    font-size: 32px;
  }

  .atlas-controls {
    grid-template-columns: 38px minmax(0, 1fr) 38px;
  }

  .atlas-controls > button {
    width: 38px;
    height: 44px;
  }

  .copilot-fab {
    right: 12px;
    bottom: calc(76px + env(safe-area-inset-bottom));
    width: 50px;
    min-width: 50px;
    height: 50px;
    padding: 0;
    justify-content: center;
  }

  .copilot-fab b {
    display: none;
  }

  .copilot-body {
    min-height: calc(100dvh - 67px);
  }

  .copilot-message > div {
    max-width: 88%;
  }

  .toc-shell {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    min-height: 58px;
  }

  .toc-shell nav.toc {
    min-height: 58px;
    padding-block: 7px;
  }

  .toc-shell nav.toc a {
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .live-signal i,
  .copilot-mic.listening,
  .atlas-route-line.animate {
    animation: none !important;
  }
}

@media print {
  #atlante,
  .live-dialog,
  .copilot-dialog,
  .copilot-fab {
    display: none !important;
  }
}


/* ===== Diario ridisegnato: sigilli hanko, carta a righe, polaroid ===== */
.passport-stamp {
  border: 1.5px dashed rgba(104, 88, 65, .4);
  color: var(--grigiochiaro);
  transition: transform .25s ease, background .3s ease, color .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.passport-stamp:active { transform: rotate(-3deg) scale(.92); }
.passport-stamp[aria-pressed="true"] {
  border: 2px solid transparent;
  color: #fff6ec;
  background: radial-gradient(circle at 35% 30%, #b03337, var(--rossoscuro) 78%);
  box-shadow: 0 6px 18px rgba(155, 34, 38, .35), inset 0 0 0 3px rgba(255, 246, 236, .25), inset 0 0 22px rgba(90, 12, 15, .55);
  transform: rotate(-6deg);
}
.passport-stamp[aria-pressed="true"] .city { color: rgba(255, 246, 236, .8); }

.journal-date { display: flex; align-items: center; gap: 12px; min-width: 0; }
.journal-date > b {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 44px;
  line-height: .9;
  color: var(--rosso);
  font-variant-numeric: tabular-nums;
}
.journal-date span { display: block; font: 800 9.5px/1.4 var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--oro); }
.journal-date em { display: block; font-family: var(--serif); font-style: normal; font-size: 17px; line-height: 1.15; color: var(--inchiostro); }

.journal-visited {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--bordo);
  border-radius: 999px;
  background: var(--carta);
  color: var(--grigio);
  font: 750 11px/1 var(--sans);
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.journal-visited[aria-pressed="true"] { border-color: var(--verde); background: rgba(58, 107, 74, .1); color: var(--verde); }
body.dark .journal-visited { background: #2a241e; }

.journal-note {
  min-height: 112px;
  padding: 5px 10px 8px;
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 26px;
  background-color: rgba(255, 255, 255, .78);
  background-image: repeating-linear-gradient(transparent, transparent 25px, rgba(104, 88, 65, .14) 25px, rgba(104, 88, 65, .14) 26px);
  background-attachment: local;
}
body.dark .journal-note {
  background-color: #2a241e;
  background-image: repeating-linear-gradient(transparent, transparent 25px, rgba(226, 210, 180, .12) 25px, rgba(226, 210, 180, .12) 26px);
}

.journal-gallery { gap: 13px; }
.journal-photo {
  aspect-ratio: auto;
  border: 0;
  border-radius: 3px;
  padding: 7px 7px 22px;
  background: #fdfbf6;
  box-shadow: 0 4px 14px rgba(48, 38, 24, .18);
  transform: rotate(-1.6deg);
  transition: transform .25s ease, box-shadow .25s ease;
}
.journal-photo:nth-child(even) { transform: rotate(1.8deg); }
.journal-photo:hover { transform: rotate(0) scale(1.03); box-shadow: 0 10px 24px rgba(48, 38, 24, .24); z-index: 2; }
.journal-photo img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 2px; }
.journal-photo button { top: 11px; right: 11px; }
body.dark .journal-photo { background: #efe8da; }

.passport-progress { margin: 4px 0 10px; }
.passport-progress-label span { font: 750 11px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--rossoscuro); }
.passport-progress-track { margin-top: 6px; height: 7px; border-radius: 999px; background: rgba(104, 88, 65, .14); overflow: hidden; }
.passport-progress-track i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--oro), var(--rosso)); transition: width .5s ease; }
body.dark .passport-progress-track { background: rgba(226, 210, 180, .14); }
@media print { .passport-progress { display: none; } }

/* link Tabelog nelle card città della mini guida */
.food-tabelog { display: inline-block; margin-top: 10px; color: var(--rossoscuro); font: 750 12px/1.4 var(--sans); text-decoration: none; border-bottom: 1px solid rgba(155, 34, 38, .35); }
.food-tabelog:hover { color: var(--rosso); border-bottom-color: var(--rosso); }