/* Full-screen tour management is a separate app mode, not a map drawer. */
.tour-book[hidden] { display:none !important; }
.tour-book {
  --tour-canvas:#f2f3f5;
  --tour-surface:#fff;
  --tour-ink:#172019;
  --tour-muted:#56646b;
  --tour-blue:#075985;
  --tour-green:#087247;
  position:fixed !important;
  z-index:2300;
  inset:0;
  display:grid !important;
  grid-template-rows:auto minmax(0,1fr);
  width:100vw !important;
  max-width:none !important;
  height:100dvh !important;
  max-height:none !important;
  padding:0 !important;
  overflow:hidden !important;
  border:0 !important;
  border-radius:0 !important;
  background:var(--tour-canvas) !important;
  color:var(--tour-ink) !important;
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text",ui-sans-serif,system-ui,sans-serif;
}
.tour-book *, .tour-book *::before, .tour-book *::after { box-sizing:border-box; }
.tour-book-header {
  position:relative;
  display:grid !important;
  grid-template-columns:minmax(0,1fr) !important;
  gap:0 !important;
  min-width:0;
  padding:max(.55rem,env(safe-area-inset-top)) max(1rem,env(safe-area-inset-right)) 0 max(1rem,env(safe-area-inset-left));
  border-bottom:1px solid #d5d8d7;
  background:var(--tour-surface) !important;
  color:var(--tour-ink) !important;
}
.tour-book-heading {
  position:relative;
  display:grid !important;
  grid-template-columns:1fr auto;
  align-items:center !important;
  min-height:2.75rem;
}
.tour-book-heading>strong {
  grid-column:1;
  min-width:0;
  overflow:hidden;
  color:var(--tour-ink);
  font-size:1.06rem;
  font-weight:700;
  letter-spacing:-.015em;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.tour-book-heading-actions {
  grid-column:2;
  display:flex;
  align-items:center;
  gap:.15rem;
}
.tour-book button, .tour-book a {
  min-height:2.75rem;
  border:0;
  border-radius:0;
  color:inherit;
  background:transparent;
  font:600 .9rem/1.1 -apple-system,BlinkMacSystemFont,"SF Pro Text",ui-sans-serif,system-ui,sans-serif;
  text-decoration:none;
  -webkit-tap-highlight-color:transparent;
}
.tour-book button { cursor:pointer; }
.tour-book-heading-actions button {
  display:grid !important;
  width:2.75rem;
  min-width:2.75rem !important;
  height:2.75rem;
  min-height:2.75rem !important;
  place-items:center;
  padding:0 !important;
  color:var(--tour-blue) !important;
}
.tour-book-heading-actions .tour-book-edit {
  width:auto;
  min-width:3.15rem !important;
  padding:0 .25rem !important;
  font-size:.9rem !important;
  font-weight:650 !important;
}
.tour-book-heading-actions svg, .tour-stop-map svg, .tour-mode-cue svg {
  width:1.28rem;
  height:1.28rem;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.tour-book-nav {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  align-items:end;
  gap:1rem;
  height:2.75rem;
  padding:0 0 0;
}
.tour-book-nav button {
  position:relative;
  min-height:2.75rem !important;
  padding:0 !important;
  color:var(--tour-muted) !important;
  font-size:.84rem !important;
  font-weight:650 !important;
}
.tour-book-nav [aria-current="page"] { color:var(--tour-ink) !important; }
.tour-book-nav [aria-current="page"]::after {
  content:"";
  position:absolute;
  right:.4rem;
  bottom:0;
  left:.4rem;
  height:3px;
  border-radius:3px 3px 0 0;
  background:var(--tour-blue);
}
.tour-book-menu {
  position:absolute;
  z-index:3;
  top:calc(max(.55rem,env(safe-area-inset-top)) + 2.95rem);
  right:max(.55rem,env(safe-area-inset-right));
  display:grid;
  min-width:13rem;
  overflow:hidden;
  padding:.3rem;
  border:1px solid #d5d8d7;
  border-radius:.75rem;
  background:#fff;
  box-shadow:0 .6rem 1.7rem #17201928;
}
.tour-book-menu[hidden] { display:none; }
.tour-book-menu button, .tour-book-menu .tour-book-import {
  display:flex !important;
  min-height:2.75rem !important;
  align-items:center;
  justify-content:flex-start;
  padding:0 .7rem !important;
  color:var(--tour-blue) !important;
  font-size:.86rem !important;
  font-weight:600 !important;
}
.tour-book-import input { display:none; }
.tour-book-menu button + button, .tour-book-menu label + button { border-top:1px solid #e6e8e7; }
.tour-book-status { min-height:0; margin:0; padding:0; color:var(--tour-muted); font-size:.78rem; }
.tour-book-status:empty { display:none; }
.tour-book-content {
  min-height:0;
  overflow:auto;
  overscroll-behavior:contain;
  padding:1.15rem max(1rem,env(safe-area-inset-right)) calc(1.25rem + env(safe-area-inset-bottom)) max(1rem,env(safe-area-inset-left));
  -webkit-overflow-scrolling:touch;
}
.tour-book-hero { margin:0 0 1.35rem; }
.tour-book-hero small, .tour-stop-detail>small, .tour-book-library article>small, .tour-book-stops li small {
  display:block;
  color:#38687f;
  font-size:.68rem;
  font-weight:750;
  letter-spacing:.075em;
}
.tour-book-hero h2, .tour-stop-detail h2, .tour-book-library h2 {
  margin:.3rem 0 .45rem;
  color:var(--tour-ink);
  font:700 1.58rem/1.08 -apple-system,BlinkMacSystemFont,"SF Pro Display",ui-sans-serif,system-ui,sans-serif;
  letter-spacing:-.03em;
}
.tour-book-hero p, .tour-stop-detail p, .tour-book-library p { margin:.35rem 0; color:#364347; font-size:.96rem; line-height:1.42; }
.tour-book-hero span, .tour-book-library article>span { color:#38687f; font-size:.78rem; font-weight:650; }
.tour-book-section { margin:1.25rem 0; }
.tour-book-section h3 { margin:0 0 .55rem; font-size:1.04rem; letter-spacing:-.01em; }
.section-note { margin:.1rem 0 .75rem; color:var(--tour-muted); font-size:.82rem; line-height:1.35; }
.tour-book-stops, .tour-book-editor-list {
  display:grid !important;
  gap:.45rem !important;
  margin:0 !important;
  padding:0 !important;
  list-style:none !important;
}
.tour-book-stops li:not(.tour-mode-cue) {
  position:relative;
  display:grid;
  grid-template-columns:minmax(0,1fr) 2.75rem;
  gap:0;
  overflow:hidden;
  padding:0;
  border:1px solid #dfe3e1;
  border-radius:.75rem;
  background:var(--tour-surface);
  box-shadow:0 1px 1px #17201908;
}
.tour-book-stops li.active { border-color:#93c8ad; box-shadow:inset 4px 0 0 var(--tour-green),0 1px 1px #17201908; }
.tour-stop-open {
  display:grid !important;
  grid-template-columns:minmax(0,1fr) 1rem !important;
  align-items:center;
  gap:.45rem !important;
  width:auto !important;
  min-height:5.55rem !important;
  padding:.8rem .2rem .8rem 1rem !important;
  color:var(--tour-ink) !important;
  text-align:left;
}
.tour-book-stops li.active .tour-stop-open { padding-left:1.15rem !important; }
.tour-book-stops li strong { display:block; margin:.2rem 0 0; font-size:1.02rem; font-weight:700; letter-spacing:-.014em; line-height:1.16; }
.tour-book-stops li p {
  display:-webkit-box;
  overflow:hidden;
  margin:.28rem 0 0;
  color:#4c5a5f;
  font-size:.84rem;
  line-height:1.28;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
}
.tour-stop-chevron { color:#94a0a5; font:400 1.45rem/1 -apple-system,BlinkMacSystemFont,sans-serif; }
.tour-stop-map {
  display:grid !important;
  width:2.75rem;
  min-width:2.75rem !important;
  height:100%;
  min-height:2.75rem !important;
  place-items:center;
  padding:0 !important;
  color:var(--tour-blue) !important;
}
.tour-book-stops .tour-mode-cue {
  display:flex;
  min-height:1.8rem;
  align-items:center;
  gap:.35rem;
  padding:.05rem .2rem;
  color:var(--tour-muted);
}
.tour-mode-cue svg { width:1rem; height:1rem; }
.tour-mode-cue small { color:inherit !important; font-size:.72rem !important; font-weight:600 !important; letter-spacing:.02em !important; }
.tour-stop-open:active, .tour-stop-map:active, .tour-book-heading-actions button:active, .tour-book-nav button:active, .tour-book-menu button:active, .tour-book-menu label:active { background:#e7f2f7 !important; }
.tour-stop-detail { max-width:40rem; margin:0 auto; }
.tour-stop-detail>button { margin:0 0 1rem; padding:0 !important; color:var(--tour-blue) !important; font-weight:650 !important; }
.tour-stop-summary { margin:.85rem 0 !important; padding:.8rem .9rem; border-left:3px solid var(--tour-green); background:#eaf5ef; font-weight:600; }
.tour-stop-detail-actions { display:grid; grid-template-columns:1fr; gap:.55rem; margin-top:1.15rem; }
.tour-stop-detail-actions button, .tour-stop-detail-actions a {
  display:grid;
  min-height:2.8rem;
  place-items:center;
  padding:.65rem .85rem;
  border:1px solid var(--tour-blue);
  border-radius:.5rem;
  color:var(--tour-blue) !important;
  font-weight:700;
}
.tour-stop-detail-actions button { border-color:var(--tour-green); color:#fff !important; background:var(--tour-green); }
.tour-book-library { display:grid; gap:.55rem; }
.tour-book-library article {
  padding:1rem;
  border:1px solid #dfe3e1;
  border-radius:.75rem;
  background:#fff;
}
.tour-book-library article>div { display:flex; flex-wrap:wrap; gap:.45rem; margin-top:.85rem; }
.tour-book-library article button, .tour-book-library article a, .tour-import-actions button, .tour-add-actions button, .tour-book form>footer button {
  min-height:2.6rem;
  padding:.55rem .75rem;
  border:1px solid var(--tour-blue);
  border-radius:.5rem;
  color:var(--tour-blue) !important;
  font-size:.82rem;
}
.tour-book .secondary { color:var(--tour-blue) !important; background:#fff !important; }
.tour-book .danger { border-color:#a61924 !important; color:#a61924 !important; }
.tour-book form { display:grid; gap:.85rem; }
.tour-book label { display:grid; gap:.3rem; color:#304047; font-size:.8rem; font-weight:650; }
.tour-book input, .tour-book textarea, .tour-book select {
  width:100%;
  min-height:2.75rem;
  padding:.6rem .65rem;
  border:1px solid #aeb8b6;
  border-radius:.45rem;
  color:var(--tour-ink);
  background:#fff;
  font:400 1rem/1.3 -apple-system,BlinkMacSystemFont,"SF Pro Text",ui-sans-serif,sans-serif;
}
.tour-book textarea { min-height:5.5rem; resize:vertical; }
.tour-coordinate-fields, .tour-field-pair, .tour-add-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.65rem; }
.tour-route-file { padding:.75rem; border:1px dashed #94aaa4; border-radius:.55rem; background:#f7fbf8; }
.tour-route-file input { min-height:0; padding:.3rem 0; border:0; background:transparent; font-size:.82rem; }
.tour-route-file small { color:var(--tour-muted); font-weight:500; }
.tour-book-editor-list li { display:grid; gap:.7rem; padding:.85rem; border:1px solid #dfe3e1; border-radius:.7rem; background:#fff; }
.tour-book-editor-list header { display:flex !important; align-items:center; justify-content:space-between; gap:.5rem; }
.tour-book-editor-list header div { display:flex; gap:.25rem; }
.tour-book-editor-list header button { width:2.75rem; min-width:2.75rem; padding:0; border:1px solid #b8c2bf; border-radius:.45rem; }
.tour-leg-section { display:grid; gap:.65rem; }
.tour-leg-editor { border:1px solid #cfd8d5; border-radius:.65rem; background:#fff; }
.tour-leg-editor summary { display:flex; min-height:3rem; align-items:center; gap:.55rem; padding:.7rem; cursor:pointer; font-size:.84rem; font-weight:650; }
.tour-leg-editor summary svg { width:1.2rem; height:1.2rem; fill:none; stroke:var(--tour-blue); stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.tour-leg-fields { display:grid; gap:.65rem; padding:0 .7rem .8rem; }
.tour-import-preview dl { display:grid; grid-template-columns:repeat(3,1fr); gap:.55rem; margin:1rem 0; }
.tour-import-preview dl div { padding:.65rem; border-radius:.5rem; background:#fff; }
.tour-import-preview dt { color:var(--tour-muted); font-size:.65rem; font-weight:700; text-transform:uppercase; }
.tour-import-preview dd { margin:.18rem 0 0; font-weight:700; text-transform:capitalize; }
.tour-import-actions { display:flex; justify-content:flex-end; gap:.55rem; }
.tour-book form>footer {
  position:sticky;
  bottom:calc(-1.25rem - env(safe-area-inset-bottom));
  display:flex;
  justify-content:flex-end;
  gap:.55rem;
  margin:0 -1rem;
  padding:.75rem max(1rem,env(safe-area-inset-right)) calc(.75rem + env(safe-area-inset-bottom)) max(1rem,env(safe-area-inset-left));
  border-top:1px solid #d5d8d7;
  background:#fffffff2;
  backdrop-filter:blur(12px);
}
.tour-book button:disabled { opacity:.45; }
.tour-book :focus-visible { outline:3px solid #005fcc; outline-offset:2px; }
html.tour-book-open { overflow:hidden; overscroll-behavior:none; }
@media (display-mode:standalone) { .tour-book { background:#f2f3f5; } }
@media (min-width:701px) {
  .tour-book { inset:1rem; width:min(43rem,calc(100% - 2rem)) !important; height:calc(100dvh - 2rem) !important; margin-left:auto; border:1px solid #cfd8d5 !important; border-radius:1rem !important; box-shadow:0 .7rem 2rem #1720192e; }
}
@media (prefers-reduced-motion:reduce) { .tour-book *, .tour-book *::before, .tour-book *::after { scroll-behavior:auto !important; transition:none !important; } }

/* The legacy map drawer uses broad descendant selectors.  The full-screen
   book deliberately resets those rules with the drawer ID rather than relying
   on cascade order, so route-map styles cannot reshape application controls. */
#tour-drawer.tour-book .tour-book-heading-actions button {
  border:0 !important;
  border-radius:0 !important;
  background:transparent !important;
  color:var(--tour-blue) !important;
  font-size:.9rem !important;
  line-height:1.1 !important;
}
#tour-drawer.tour-book .tour-book-menu button,
#tour-drawer.tour-book .tour-book-menu .tour-book-import {
  display:flex !important;
  width:100% !important;
  min-height:2.75rem !important;
  height:auto !important;
  align-items:center !important;
  justify-content:flex-start !important;
  padding:0 .7rem !important;
  border:0 !important;
  border-radius:0 !important;
  background:transparent !important;
  color:var(--tour-blue) !important;
  font-size:.86rem !important;
  line-height:1.1 !important;
}
#tour-drawer.tour-book .tour-book-menu button + button,
#tour-drawer.tour-book .tour-book-menu label + button { border-top:1px solid #e6e8e7 !important; }
#tour-drawer.tour-book .tour-book-nav button {
  width:auto !important;
  height:auto !important;
  min-height:2.75rem !important;
  border:0 !important;
  border-radius:0 !important;
  background:transparent !important;
  color:var(--tour-muted) !important;
  font-size:.84rem !important;
  line-height:1.1 !important;
}
#tour-drawer.tour-book .tour-book-nav [aria-current="page"] { color:var(--tour-ink) !important; }
#tour-drawer.tour-book .tour-book-stops li .tour-stop-open {
  display:grid !important;
  width:auto !important;
  grid-template-columns:minmax(0,1fr) 1rem !important;
  gap:.45rem !important;
  padding:.8rem .2rem .8rem 1rem !important;
  border:0 !important;
  border-radius:0 !important;
  color:var(--tour-ink) !important;
  background:transparent !important;
  text-align:left !important;
}
#tour-drawer.tour-book .tour-book-stops li.active .tour-stop-open { padding-left:1.15rem !important; }
#tour-drawer.tour-book .tour-book-stops li .tour-stop-map {
  display:grid !important;
  width:2.75rem !important;
  height:100% !important;
  min-height:2.75rem !important;
  padding:0 !important;
  border:0 !important;
  border-radius:0 !important;
  background:transparent !important;
  color:var(--tour-blue) !important;
}
