:root {
  --guide-paper: #f7f4ed;
  --guide-panel: #fffdf8;
  --guide-ink: #2d2a25;
  --guide-muted: #655d51;
  --guide-line: #ded5c6;
  --guide-accent: #853b30;
  --guide-soft: #f5e9e3;
  --guide-radius: 16px;
}
html:has(.guide-layout) {
  background: var(--guide-paper);
  scroll-padding-block: 16px 108px;
}
.guide-layout, main#app.guide-layout {
  display: block;
  width: min(100%, 1180px);
  height: auto;
  min-height: 100vh;
  margin: auto;
  padding: 0 clamp(16px, 4vw, 40px) 28px;
  overflow: visible;
  color: var(--guide-ink);
  font-family: system-ui, "PingFang TC", sans-serif;
  line-height: 1.5;
}
.guide-layout button, .guide-layout summary { touch-action: manipulation; }
.guide-layout :is(button,a,summary):focus-visible { outline: 3px solid #8d4e28; outline-offset: 3px; }

.guide-layout > header {
  display: flex;
  position: relative;
  inset: auto;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  margin: 0;
  padding-block: 7px;
  border-bottom: 1px solid var(--guide-line);
  pointer-events: auto;
}
.guide-layout header .brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: var(--guide-ink);
  font-size: .875rem;
  line-height: 1.35;
  font-weight: 750;
  letter-spacing: 0;
}
.guide-layout .brand .seal {
  flex: 0 0 33px;
  width: 33px;
  height: 34px;
  border-radius: 7px;
  background: var(--guide-accent);
  color: #fff9ef;
  font-size: 1.18rem;
}
.guide-layout header .edition { display: none; }
.guide-layout #baibaigo-return {
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
  justify-content: center;
  max-width: 52%;
  min-height: 44px;
  padding: 5px 11px;
  border: 1px solid var(--guide-line);
  border-radius: 10px;
  background: var(--guide-panel);
  color: var(--guide-accent);
  font-size: .83rem;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}
.guide-layout > .intro {
  position: static;
  margin: 0;
  padding: 18px 0 16px;
  pointer-events: auto;
}
.guide-layout .intro .eyebrow {
  margin: 0 0 4px;
  color: var(--guide-accent);
  font-size: .75rem;
  font-weight: 750;
  letter-spacing: .07em;
}
.guide-layout .intro h1 {
  margin: 0 0 5px;
  color: var(--guide-ink);
  font-family: "Noto Serif TC", "Songti TC", ui-serif, Georgia, serif;
  font-size: clamp(1.65rem, 4vw, 2.8rem);
  font-weight: 750;
  line-height: 1.18;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
.guide-layout .intro p:not(.eyebrow) {
  margin: 0;
  color: var(--guide-muted);
  font-size: .9rem;
  line-height: 1.55;
  letter-spacing: 0;
}
.guide-layout .intro .tag {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 6px;
  color: var(--guide-muted);
  font-size: .75rem;
}
.guide-layout .intro .tag span { color: inherit; }

.guide-workspace {
  display: grid;
  grid-template-columns: minmax(0,1.6fr) minmax(280px,1fr);
  gap: clamp(14px, 2vw, 24px);
  align-items: start;
}
.guide-model, .guide-sidebar { min-width: 0; }
.guide-layout .viewport {
  position: relative;
  isolation: isolate;
  height: clamp(340px, 52vh, 535px);
  min-width: 0;
  border: 1px solid var(--guide-line);
  border-radius: var(--guide-radius);
  overflow: hidden;
  background: #ebe7de;
}
.guide-layout .viewport > :is(#scene,#labels) {
  position: absolute;
  inset: 0;
}
.guide-layout #loading { padding: 8px; }
.guide-layout #labels { pointer-events: none; }
.guide-layout #labels :is(.pin,.map-tag) { pointer-events: auto; }
.guide-layout .pin {
  max-width: 44%;
  min-height: 34px;
  font-size: .7rem;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
}
.guide-layout .pin b { flex: 0 0 auto; }
.guide-layout .pin[aria-pressed=true] { z-index: 2; }
.guide-layout .guide-gesture {
  position: static;
  margin: 6px 0 0;
  color: var(--guide-muted);
  font-size: .76rem;
  line-height: 1.45;
  letter-spacing: 0;
  text-align: start;
  overflow-wrap: anywhere;
}
.guide-controls {
  display: grid;
  grid-template-columns: minmax(0,1.3fr) minmax(0,1fr);
  gap: 8px;
  align-items: start;
  margin: 8px 0 0;
}
.guide-view-options { min-width: 0; }
.guide-layout :is(.guide-view-summary,#roof) {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 44px;
  padding: 6px 9px;
  border: 1px solid var(--guide-line);
  border-radius: 10px;
  background: var(--guide-panel);
  color: var(--guide-ink);
  font: 650 .82rem/1.28 system-ui, sans-serif;
  white-space: normal;
  overflow-wrap: anywhere;
}
.guide-layout .guide-view-summary { cursor: pointer; list-style: none; justify-content: space-between; }
.guide-view-summary::-webkit-details-marker { display: none; }
.guide-view-summary::after {
  content: "";
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg) translateY(-2px);
}
.guide-view-options[open] .guide-view-summary::after { transform: rotate(225deg); }
.guide-current-view { color: var(--guide-muted); font-size: .74rem; font-weight: 500; text-align: end; }
.guide-layout #roof { justify-content: center; }
.guide-layout #roof[aria-pressed=true] { background: var(--guide-soft); color: var(--guide-accent); border-color: #c49183; }
.guide-layout #roof span { display: none; }
.guide-layout .views, .guide-layout .toolbar, .guide-layout .tool-group {
  position: static;
  transform: none;
  display: grid;
  width: 100%;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 5px;
  padding: 0;
  margin: 6px 0 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  white-space: normal;
}
.guide-layout .toolbar .tool-group { margin: 0; grid-column: 1 / -1; }
.guide-layout .toolbar :is(.divider,button span) { display: none; }
.guide-layout :is(.views,.toolbar) button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 0;
  padding: 5px;
  border: 1px solid var(--guide-line);
  border-radius: 8px;
  background: var(--guide-panel);
  color: var(--guide-ink);
  font: 600 .75rem/1.25 system-ui, sans-serif;
  white-space: normal;
  overflow-wrap: anywhere;
}
.guide-layout :is(.views,.toolbar) button[aria-pressed=true] {
  color: var(--guide-accent);
  background: var(--guide-soft);
  border-color: #c49183;
}
.guide-layout .guide-mode {
  display: inline-grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  max-width: 100%;
  gap: 4px;
  margin-top: 10px;
  padding: 3px;
  border: 1px solid var(--guide-line);
  border-radius: 11px;
  background: #eee9df;
}
.guide-layout .guide-mode button, .guide-layout .guide-mode #worship {
  position: static;
  min-height: 44px;
  min-width: 0;
  margin: 0;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--guide-muted);
  font: 650 .83rem/1.25 system-ui, sans-serif;
  white-space: normal;
  overflow-wrap: anywhere;
}
.guide-layout .guide-mode #worship[aria-pressed=true]::before { content: none; }
.guide-layout .guide-mode button[aria-pressed=true], .guide-layout .guide-mode #worship[aria-pressed=true] {
  border-color: var(--guide-line);
  background: var(--guide-panel);
  color: var(--guide-accent);
}

.guide-layout .guide-sidebar :is(.station,#detail,.refs), .guide-layout > .refs {
  position: static;
  width: auto;
  margin: 0 0 9px;
  padding: 13px 15px;
  border: 1px solid var(--guide-line);
  border-radius: var(--guide-radius);
  background: var(--guide-panel);
  box-shadow: none;
  backdrop-filter: none;
  overflow-wrap: anywhere;
}
.guide-layout :is(.station-head,.detail-top) {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 0;
}
.guide-layout :is(.station-head,.detail-top) .eyebrow {
  margin: 0;
  color: var(--guide-accent);
  font-size: .76rem;
  font-weight: 750;
  letter-spacing: .045em;
}
.guide-layout :is(#count,#number) {
  flex: 0 0 auto;
  color: var(--guide-muted);
  font-size: .8rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.guide-progress { height: 4px; margin: 7px 0 10px; border-radius: 6px; background: #eae0d3; }
.guide-progress-fill { display: block; height: 100%; border-radius: inherit; background: var(--guide-accent); }
.guide-layout :is(.station h2,#detail h2) {
  margin: 0 0 4px;
  color: var(--guide-ink);
  font-family: "Noto Serif TC", "Songti TC", ui-serif, Georgia, serif;
  font-size: clamp(1.17rem, 2vw, 1.55rem);
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: 0;
}
.guide-layout :is(#station-text,#description) { margin: 0; color: var(--guide-muted); font-size: .91rem; line-height: 1.6; }
.guide-layout #english { display: none; }
.guide-layout #features { display: flex; margin-top: 6px; }
.guide-layout #features span { padding: 2px 6px; border-radius: 4px; }
.guide-layout .guide-stepbar { margin-top: 12px; }
.guide-layout .guide-stepbar :is(nav,#worship-steps) {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1.25fr);
  gap: 8px;
  margin: 0;
}
.guide-layout .guide-stepbar button, .guide-layout .guide-stepbar #worship-steps button {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 46px;
  min-width: 0;
  padding: 5px 8px;
  margin: 0;
  border: 1px solid var(--guide-line);
  border-radius: 9px;
  background: var(--guide-panel);
  color: var(--guide-ink);
  font: 650 .86rem/1.25 system-ui, sans-serif;
  text-align: center;
  overflow-wrap: anywhere;
}
.guide-layout .guide-stepbar button:disabled, .guide-layout .guide-stepbar #worship-steps button:disabled {
  background: #f4f0e7;
  color: #746b60;
  opacity: 1;
  cursor: default;
}
.guide-layout .guide-stepbar :is(.primary,.next), .guide-layout .guide-stepbar #worship-steps #worship-next {
  border-color: var(--guide-accent);
  background: var(--guide-accent);
  color: #fffaf2;
}
.guide-layout .guide-stepbar .next span { margin-inline-start: 8px; font-size: inherit; }
.guide-mobile-count { display: none; }
.guide-layout :is(#next,#worship-steps)[hidden] { display: none; }
.guide-layout .refs summary {
  min-height: 24px;
  cursor: pointer;
  color: var(--guide-ink);
  font-weight: 650;
}
.guide-layout :is(#station-list,.guide-stop-list) {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.guide-layout :is(#station-list,.guide-stop-list) li { margin: 0; }
.guide-layout :is(#station-list,.guide-stop-list) button {
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: start;
  width: 100%;
  min-height: 44px;
  padding: 5px 8px;
  border: 1px solid var(--guide-line);
  border-radius: 8px;
  background: var(--guide-panel);
  color: var(--guide-ink);
  font: 550 .82rem/1.35 system-ui, sans-serif;
  text-align: start;
  overflow-wrap: anywhere;
}
.guide-layout :is(#station-list,.guide-stop-list) button[aria-pressed=true] {
  border-color: #c49183;
  background: var(--guide-soft);
  color: var(--guide-accent);
}
.guide-layout ol#station-list p { display: none; }
.guide-layout :is(.legend,.notice) { margin: 9px 0; color: var(--guide-muted); font-size: .81rem; }
.guide-layout > footer {
  display: flex;
  position: static;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 0;
  color: var(--guide-muted);
  font-size: .76rem;
}
.guide-layout > footer span { max-width: none; font-size: inherit; }
.guide-layout > footer button { min-height: 44px; color: var(--guide-accent); font-size: inherit; white-space: normal; }

@media(max-width:760px) {
  .guide-layout, main#app.guide-layout {
    padding-inline: clamp(12px, 4vw, 18px);
    padding-bottom: calc(20px + var(--guide-dock-height, 64px));
  }
  .guide-layout > .intro { padding-block: 12px; }
  .guide-workspace { grid-template-columns: minmax(0,1fr); gap: 10px; }
  .guide-layout .viewport { height: clamp(220px, 34vh, 340px); }
  .guide-layout .guide-stepbar {
    position: fixed;
    inset: auto 0 0;
    z-index: 8;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px clamp(12px, 4vw, 18px) max(7px, env(safe-area-inset-bottom));
    margin: 0;
    border-top: 1px solid var(--guide-line);
    background: var(--guide-panel);
    box-shadow: 0 -4px 16px #392d2116;
  }
  .guide-mobile-count {
    display: block;
    color: var(--guide-muted);
    font-size: .75rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  .guide-layout .guide-stepbar :is(nav,#worship-steps,.next) { flex: 1 1 0; }
}
.guide-stop-index {
  display: inline-grid;
  place-items: center;
  flex: 0 0 27px;
  min-height: 25px;
  border-radius: 5px;
  background: #eee8dc;
  color: var(--guide-muted);
  font-size: .73rem;
  font-variant-numeric: tabular-nums;
}
.guide-stop-jump[aria-pressed=true] .guide-stop-index,
#station-list button[aria-pressed=true] .guide-stop-index {
  background: #ead7cd;
  color: var(--guide-accent);
}
.guide-layout .guide-model > .legend { margin: 3px 0 0; font-size: .76rem; }
