:root {
  color-scheme: light;
  --ink: #29203e;
  --muted: #716a7f;
  --paper: #f8f6ff;
  --surface: #ffffff;
  --surface-soft: #eee9ff;
  --forest: #4a28ae;
  --forest-2: #5b35c8;
  --moss: #ffcf63;
  --lime: #ffc247;
  --sun: #ff9a64;
  --danger: #b43f5f;
  --line: rgba(72, 43, 145, .15);
  --shadow: 0 20px 60px rgba(66, 37, 142, .16);
  --radius-lg: 2rem;
  --radius-md: 1.35rem;
  --max: 74rem;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f4efff;
  --muted: #bcb2cf;
  --paper: #151021;
  --surface: #211934;
  --surface-soft: #302347;
  --forest: #4f2bb9;
  --forest-2: #bba7ff;
  --moss: #ffcf63;
  --lime: #ffc247;
  --sun: #ff9a64;
  --danger: #ff9c90;
  --line: rgba(239, 229, 255, .16);
  --shadow: 0 20px 60px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  padding-bottom: calc(5.25rem + env(safe-area-inset-bottom));
  background: var(--paper);
  color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", "PingFang TC", "Noto Sans TC", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
button, a { -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; }
a { color: inherit; }
svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 1000; padding: .75rem 1rem; background: var(--surface); border-radius: .75rem; }
.skip-link:focus { top: 1rem; }
.topbar {
  height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(1.1rem, env(safe-area-inset-left));
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  color: var(--ink);
  pointer-events: none;
}
.brand { display: flex; align-items: center; width: 9.25rem; height: 3.1rem; padding: .55rem .8rem; border: 1px solid rgba(91,53,200,.15); border-radius: .9rem; background: rgba(255,255,255,.94); box-shadow: 0 8px 28px rgba(48,26,107,.14); backdrop-filter: blur(12px); text-decoration: none; pointer-events: auto; }
.brand img { display: block; width: 100%; height: auto; }
.top-actions { display: flex; gap: .5rem; }
.top-actions { pointer-events: auto; }
.icon-button { width: 2.75rem; height: 2.75rem; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.34); border-radius: 50%; background: rgba(60,31,139,.72); color: white; backdrop-filter: blur(12px); cursor: pointer; }
.icon-button:hover { background: #5b35c8; }

.hero { min-height: 43rem; position: relative; overflow: hidden; color: white; background: radial-gradient(circle at 75% 20%, rgba(255,194,71,.27), transparent 24%), linear-gradient(145deg, #37207f 0%, #5b35c8 58%, #714de0 100%); }
.hero::before { content: ""; position: absolute; width: 25rem; height: 25rem; right: -8rem; top: 6rem; border-radius: 45% 55% 65% 35%; background: rgba(255,194,71,.13); filter: blur(2px); transform: rotate(28deg); }
.hero::after { content: ""; position: absolute; left: -6rem; bottom: -12rem; width: 36rem; height: 29rem; border-radius: 50%; border: 1px solid rgba(255,194,71,.26); box-shadow: 0 0 0 3rem rgba(255,194,71,.04), 0 0 0 7rem rgba(255,194,71,.03); }
.contours { position: absolute; inset: 0; opacity: .14; background-image: repeating-radial-gradient(ellipse at 85% 20%, transparent 0 30px, rgba(255,255,255,.45) 31px 32px, transparent 33px 53px); transform: scale(1.4); }
.hero-content { position: relative; z-index: 2; width: min(var(--max), 100%); margin: auto; padding: 9rem 1.25rem 3.5rem; }
.eyebrow, .kicker { font-size: .78rem; font-weight: 850; letter-spacing: .17em; text-transform: uppercase; }
.eyebrow { display: flex; align-items: center; gap: .65rem; color: var(--lime); }
.eyebrow span { width: 2.5rem; height: 1px; background: currentColor; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin: 1.5rem 0 1rem; max-width: 15ch; font-family: "Iowan Old Style", "Songti TC", "Noto Serif TC", serif; font-size: clamp(3.15rem, 12vw, 6.7rem); line-height: .98; letter-spacing: -.055em; font-weight: 700; }
h1 em { color: var(--lime); font-style: normal; }
.hero-copy { color: rgba(255,255,255,.7); font-weight: 650; letter-spacing: .04em; }
.install-wrap { min-height: 2.4rem; margin-top: 1rem; }
.pwa-install { min-height: 2.4rem; padding: .42rem .85rem; border: 1px solid rgba(255,255,255,.28); border-radius: 999px; background: rgba(255,255,255,.1); color: white; font-weight: 800; cursor: pointer; backdrop-filter: blur(8px); }
.ios-install-hint { width: max-content; max-width: 100%; margin: 0; padding: .42rem .75rem; border-radius: 999px; background: rgba(255,255,255,.1); color: rgba(255,255,255,.82); font-size: .75rem; font-weight: 700; }
.hero-status { margin-top: 4rem; display: grid; gap: 1.5rem; align-items: end; padding: 1.25rem; border: 1px solid rgba(255,255,255,.18); border-radius: var(--radius-md); background: rgba(43,23,103,.4); backdrop-filter: blur(10px); }
.micro-label { margin: 0 0 .25rem; font-size: .8rem; color: inherit; opacity: .68; font-weight: 750; letter-spacing: .08em; }
.countdown { display: block; font-size: clamp(1.55rem, 7vw, 2.6rem); line-height: 1.15; }
.hero-route { display: flex; align-items: center; color: rgba(255,255,255,.72); font-size: .85rem; font-weight: 700; }
.hero-route i { flex: 1; min-width: 1.25rem; height: 1px; margin: 0 .5rem; background: rgba(255,255,255,.25); position: relative; }
.hero-route i::after { content: ""; position: absolute; right: 0; top: -2px; width: 5px; height: 5px; background: var(--lime); border-radius: 50%; }

.section-nav { position: fixed; left: 50%; bottom: max(.65rem, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40; display: flex; width: max-content; max-width: calc(100% - max(1rem, env(safe-area-inset-left)) - max(1rem, env(safe-area-inset-right))); overflow-x: auto; margin: 0; padding: .4rem; gap: .15rem; border: 1px solid var(--line); border-radius: 999px; background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: 0 10px 35px rgba(48,26,107,.2); backdrop-filter: blur(18px); scrollbar-width: none; }
.section-nav::-webkit-scrollbar { display: none; }
.section-nav a { flex: 0 0 auto; min-width: 3.35rem; padding: .55rem .75rem; border-radius: 999px; text-align: center; text-decoration: none; font-size: .82rem; font-weight: 800; }
.section-nav a:hover, .section-nav a:focus-visible { background: var(--surface-soft); }

.section { width: min(var(--max), 100%); margin: auto; padding: 5rem 1.25rem; }
.section-heading { display: flex; gap: 1rem; justify-content: space-between; align-items: flex-start; margin-bottom: 2rem; }
.section-heading.align-end { align-items: flex-end; }
.section-heading h2 { margin: 0; font-family: "Iowan Old Style", "Songti TC", serif; font-size: clamp(2.25rem, 8vw, 4.4rem); line-height: 1; letter-spacing: -.04em; }
.section-heading > time { padding-top: 1.75rem; font-size: .8rem; color: var(--muted); font-weight: 700; text-align: right; }
.kicker { margin-bottom: .65rem; color: var(--forest-2); }
.section-lead { color: var(--muted); margin: -1rem 0 2rem; }

.now-card { overflow: hidden; border-radius: var(--radius-lg); background: var(--forest); color: white; box-shadow: var(--shadow); }
.now-indicator { display: flex; gap: .55rem; align-items: center; padding: 1.1rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,.12); color: var(--lime); font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; }
.now-indicator span { width: .55rem; height: .55rem; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 .35rem rgba(217,236,170,.1); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 .65rem rgba(217,236,170,0); } }
.now-card-body { padding: 1.5rem; }
.now-card h3 { margin: .4rem 0 .4rem; font-family: "Iowan Old Style", "Songti TC", serif; font-size: clamp(2rem, 8vw, 3.7rem); line-height: 1.05; letter-spacing: -.03em; }
.now-card-body > p:not(.micro-label) { color: rgba(255,255,255,.68); }
.next-row { display: grid; grid-template-columns: 1fr auto; gap: 1rem; margin: 1.5rem 0; padding: 1rem 0; border-top: 1px solid rgba(255,255,255,.13); border-bottom: 1px solid rgba(255,255,255,.13); }
.next-row span { display: block; font-size: .76rem; color: rgba(255,255,255,.55); }
.next-row strong { display: block; font-size: 1rem; }
.next-count { text-align: right; }
.button { min-height: 3.25rem; display: inline-flex; align-items: center; justify-content: center; padding: .75rem 1.15rem; border: 0; border-radius: 999px; text-decoration: none; font-weight: 850; cursor: pointer; }
.button-light { background: var(--lime); color: #31205f; }
.button-primary { background: var(--forest); color: white; }
.button:hover { transform: translateY(-1px); }
.button:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
.privacy-note { display: flex; gap: .5rem; align-items: center; margin: 1.1rem 0 0; color: var(--muted); font-size: .8rem; }
.privacy-note svg { flex: 0 0 auto; width: 1rem; height: 1rem; }

.itinerary-section { padding-top: 6rem; }
.segmented { display: flex; padding: .25rem; background: var(--surface-soft); border-radius: 999px; }
.segmented button { padding: .45rem .75rem; border: 0; border-radius: 999px; color: var(--muted); background: transparent; font-size: .78rem; font-weight: 800; cursor: pointer; }
.segmented button.active { background: var(--surface); color: var(--ink); box-shadow: 0 4px 14px rgba(15,45,37,.08); }
.day-group { margin: 0 0 3rem; }
.day-label { display: flex; align-items: baseline; gap: .8rem; margin-bottom: 1.5rem; }
.day-label strong { font-family: "Iowan Old Style", "Songti TC", serif; font-size: 2rem; }
.day-label span { color: var(--muted); font-size: .86rem; }
.timeline-list { position: relative; }
.timeline-list::before { content: ""; position: absolute; left: 4.25rem; top: 1rem; bottom: 1rem; width: 1px; background: var(--line); }
.timeline-item { display: grid; grid-template-columns: 3.5rem 1.5rem 1fr; gap: .45rem; position: relative; padding: 0 0 1.4rem; }
.timeline-time { padding-top: .85rem; text-align: right; font-weight: 850; font-size: .86rem; font-variant-numeric: tabular-nums; }
.timeline-dot { z-index: 1; width: .85rem; height: .85rem; margin: 1.15rem auto 0; border: 3px solid var(--paper); border-radius: 50%; background: var(--moss); box-shadow: 0 0 0 1px var(--line); }
.timeline-item.is-current .timeline-dot { background: var(--sun); box-shadow: 0 0 0 5px color-mix(in srgb, var(--sun) 20%, transparent); }
.timeline-item.is-past .timeline-dot { background: var(--forest-2); }
.timeline-card { min-width: 0; padding: .85rem 1rem; border: 1px solid transparent; border-radius: 1rem; }
.timeline-item.is-current .timeline-card { border-color: color-mix(in srgb, var(--sun) 60%, transparent); background: color-mix(in srgb, var(--sun) 10%, var(--surface)); }
.timeline-title-row { display: flex; justify-content: space-between; gap: .75rem; align-items: flex-start; }
.timeline-title-row h3 { margin: 0; font-size: 1rem; line-height: 1.45; }
.timeline-card p { margin: .25rem 0 0; color: var(--muted); font-size: .82rem; }
.timeline-card a { flex: 0 0 auto; font-size: .78rem; color: var(--forest-2); font-weight: 850; text-underline-offset: .18rem; }
.tag { display: inline-flex; margin-top: .5rem; padding: .12rem .5rem; border-radius: 999px; background: color-mix(in srgb, var(--sun) 20%, transparent); color: var(--danger); font-size: .7rem; font-weight: 850; }
.schedule-warning { display: flex; gap: .9rem; padding: 1.1rem; border: 1px solid color-mix(in srgb, var(--sun) 50%, transparent); border-radius: var(--radius-md); background: color-mix(in srgb, var(--sun) 10%, var(--surface)); }
.schedule-warning svg { flex: 0 0 auto; color: var(--danger); margin-top: .2rem; }
.schedule-warning strong { display: block; }
.schedule-warning p { margin: .15rem 0 0; color: var(--muted); font-size: .85rem; }

.location-section { width: 100%; max-width: none; padding-left: max(1.25rem, calc((100% - var(--max)) / 2 + 1.25rem)); padding-right: max(1.25rem, calc((100% - var(--max)) / 2 + 1.25rem)); background: var(--surface-soft); }
.location-section > * { max-width: var(--max); margin-left: auto; margin-right: auto; }
.location-panel { display: grid; gap: 1rem; padding: 1.5rem; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.location-intro { text-align: center; }
.location-orb { width: 5.5rem; height: 5.5rem; display: grid; place-items: center; margin: 0 auto 1.25rem; border-radius: 50%; background: color-mix(in srgb, var(--moss) 22%, var(--surface)); box-shadow: 0 0 0 1rem color-mix(in srgb, var(--moss) 7%, transparent); }
.location-orb span { width: 1rem; height: 1rem; border-radius: 50%; background: var(--forest-2); box-shadow: 0 0 0 .4rem color-mix(in srgb, var(--forest-2) 20%, transparent); }
.location-intro h3 { font-size: 1.35rem; margin-bottom: .35rem; }
.location-intro p { max-width: 34rem; margin: 0 auto 1rem; color: var(--muted); font-size: .88rem; }
.secure-hint { margin-top: .7rem !important; font-size: .74rem !important; }
.location-details { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.location-details > div { padding: .9rem; border-radius: 1rem; background: var(--surface-soft); }
.location-details span, .location-details small { display: block; color: var(--muted); font-size: .72rem; }
.location-details strong { display: block; margin: .2rem 0; }
.nearest b { color: var(--forest-2); }
.place-grid { display: grid; gap: .8rem; margin-top: 1.25rem; }
.place-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .8rem; padding: .95rem; border-radius: 1.1rem; background: var(--surface); }
.place-index { width: 2.25rem; height: 2.25rem; display: grid; place-items: center; border-radius: 50%; background: var(--surface-soft); color: var(--forest-2); font-size: .75rem; font-weight: 900; }
.place-card h3 { margin: 0; font-size: .95rem; }
.place-card p { margin: .05rem 0 0; color: var(--muted); font-size: .76rem; }
.place-distance { text-align: right; font-weight: 900; font-size: .84rem; }
.place-distance small { display: block; color: var(--muted); font-size: .66rem; font-weight: 600; }
.place-card a { width: 2.5rem; height: 2.5rem; display: grid; place-items: center; margin-left: .1rem; border-radius: 50%; background: var(--forest); color: white; text-decoration: none; font-size: .75rem; font-weight: 900; }

.progress-ring { --progress: 0deg; width: 4.25rem; height: 4.25rem; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: conic-gradient(var(--forest-2) var(--progress), var(--surface-soft) 0); position: relative; }
.progress-ring::before { content: ""; position: absolute; inset: .36rem; border-radius: 50%; background: var(--paper); }
.progress-ring span { position: relative; font-size: .75rem; font-weight: 900; }
.check-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; }
.check-item { position: relative; }
.check-item input { position: absolute; opacity: 0; pointer-events: none; }
.check-item label { min-height: 5.5rem; display: flex; flex-direction: column; justify-content: space-between; padding: .9rem; border: 1px solid var(--line); border-radius: 1.15rem; background: var(--surface); cursor: pointer; }
.check-item label span:first-child { font-size: 1.3rem; }
.check-item label strong { font-size: .9rem; }
.check-item input:checked + label { border-color: var(--moss); background: color-mix(in srgb, var(--moss) 18%, var(--surface)); }
.check-item input:checked + label strong { text-decoration: line-through; opacity: .68; }
.check-item input:focus-visible + label { outline: 3px solid var(--sun); outline-offset: 2px; }
.activity-checkin { margin-top: 4rem; padding-top: 3rem; border-top: 1px solid var(--line); }
.subheading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 1.25rem; }
.subheading h3 { margin: 0; font-family: "Iowan Old Style", "Songti TC", serif; font-size: 2rem; }
.subheading > span { color: var(--muted); font-weight: 800; }
.stamp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; }
.stamp { min-height: 7.5rem; padding: .85rem; border: 1px dashed var(--line); border-radius: 50% 50% 45% 48%; background: transparent; color: var(--muted); cursor: pointer; transform: rotate(-1deg); }
.stamp:nth-child(even) { transform: rotate(1.5deg); }
.stamp span { display: block; font-size: 1.7rem; filter: grayscale(1); }
.stamp strong { display: block; font-size: .82rem; }
.stamp small { font-size: .68rem; }
.stamp.checked { border: 2px solid var(--forest-2); background: color-mix(in srgb, var(--moss) 18%, transparent); color: var(--forest-2); }
.stamp.checked span { filter: none; }
.text-button { display: block; margin: 2rem auto 0; border: 0; background: none; color: var(--muted); text-decoration: underline; text-underline-offset: .2rem; cursor: pointer; font-size: .8rem; }

.notes-section { padding-bottom: 7rem; }
.note-grid { display: grid; gap: .8rem; }
.note-grid article { padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.note-grid article > span { width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border-radius: 50%; background: var(--surface-soft); color: var(--forest-2); font-size: 1.25rem; }
.note-grid h3 { margin: .9rem 0 .25rem; font-size: 1rem; }
.note-grid p { margin: 0; color: var(--muted); font-size: .84rem; }
.source-card { display: grid; gap: 1rem; margin-top: 1.5rem; padding: 1.25rem; border-radius: var(--radius-md); background: var(--forest); color: white; }
.source-card h3 { margin: 0 0 .2rem; }
.source-card p { margin: 0; color: rgba(255,255,255,.64); font-size: .82rem; }
.source-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.source-links a { padding: .5rem .75rem; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; text-decoration: none; font-size: .75rem; font-weight: 800; }

footer { padding: 3.5rem 1.25rem calc(3.5rem + env(safe-area-inset-bottom)); background: #2f196d; color: white; text-align: center; }
footer p { margin-bottom: .25rem; font-family: "Iowan Old Style", "Songti TC", serif; font-size: 1.5rem; }
footer small { color: rgba(255,255,255,.52); }
.toast { position: fixed; z-index: 50; left: 50%; bottom: calc(5.4rem + env(safe-area-inset-bottom)); transform: translateX(-50%); width: max-content; max-width: calc(100% - 2rem); padding: .75rem 1rem; border-radius: 999px; background: var(--ink); color: var(--paper); box-shadow: var(--shadow); font-size: .82rem; font-weight: 750; }
.offline-banner { position: fixed; z-index: 45; left: max(.75rem, env(safe-area-inset-left)); right: max(.75rem, env(safe-area-inset-right)); bottom: calc(5.4rem + env(safe-area-inset-bottom)); padding: .65rem .85rem; border-radius: .85rem; background: #2f196d; color: white; box-shadow: var(--shadow); text-align: center; font-size: .75rem; font-weight: 800; }
[hidden] { display: none !important; }

@media (max-width: 380px) {
  .topbar { padding-left: max(.75rem, env(safe-area-inset-left)); padding-right: max(.75rem, env(safe-area-inset-right)); }
  .brand { width: 7.9rem; height: 2.8rem; }
  .icon-button { width: 2.5rem; height: 2.5rem; }
  .hero-content { padding-left: max(.95rem, env(safe-area-inset-left)); padding-right: max(.95rem, env(safe-area-inset-right)); }
  .section { padding-left: max(.95rem, env(safe-area-inset-left)); padding-right: max(.95rem, env(safe-area-inset-right)); }
  .section-heading { gap: .6rem; }
  .section-heading h2 { font-size: 2.15rem; }
  .check-grid, .stamp-grid { grid-template-columns: 1fr 1fr; }
  .location-details { grid-template-columns: 1fr; }
  .section-nav { width: calc(100% - 1rem); justify-content: space-between; }
  .section-nav a { min-width: 0; flex: 1 1 20%; padding-left: .35rem; padding-right: .35rem; font-size: .78rem; }
}

@media (orientation: landscape) and (max-height: 520px) {
  .hero { min-height: 100svh; }
  .hero-content { padding-top: max(5.5rem, calc(env(safe-area-inset-top) + 4.5rem)); padding-bottom: 2rem; }
  h1 { font-size: clamp(2.8rem, 10vw, 4.4rem); max-width: 20ch; }
  .hero-status { margin-top: 1.5rem; }
}

/* iPhone Duo / dual-screen: split key content around the division region. */
@media (horizontal-viewport-segments: 2) {
  body { padding-right: calc(6rem + env(safe-area-inset-right)); padding-bottom: 0; }
  .topbar { padding-left: max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right)); }
  .hero { min-height: 100svh; }
  .hero-content {
    width: 100%; max-width: none; padding: max(7rem, calc(env(safe-area-inset-top) + 5rem)) 0 3rem;
    display: grid;
    grid-template-columns: env(viewport-segment-width 0 0) env(viewport-segment-width 1 0);
    column-gap: calc(env(viewport-segment-left 1 0) - env(viewport-segment-right 0 0));
    align-content: center;
  }
  .hero-content > .eyebrow, .hero-content > h1, .hero-content > .hero-copy, .hero-content > .install-wrap { grid-column: 1; margin-left: max(1.5rem, env(safe-area-inset-left)); margin-right: 1.5rem; }
  .hero-status { grid-column: 2; grid-row: 1 / span 5; align-self: center; margin: 0 max(1.5rem, env(safe-area-inset-right)) 0 1.5rem; }
  .section { width: 100%; max-width: none; padding-left: max(1.5rem, env(safe-area-inset-left)); padding-right: max(1.5rem, env(safe-area-inset-right)); }
  .timeline { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: calc(env(viewport-segment-left 1 0) - env(viewport-segment-right 0 0) + 2.5rem); }
  .day-group { min-width: 0; }
  .day-group[data-day="day1"] { grid-column: 1; }
  .day-group[data-day="day2"] { grid-column: 2; }
  .place-grid, .note-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: calc(env(viewport-segment-left 1 0) - env(viewport-segment-right 0 0) + 1.25rem); }
  .source-card { margin-left: max(0px, calc(env(viewport-segment-left 1 0) - env(safe-area-inset-left))); }
  .section-nav {
    left: auto; right: max(.65rem, env(safe-area-inset-right)); top: 50%; bottom: auto;
    width: 4.8rem; max-width: none; transform: translateY(-50%); flex-direction: column; overflow: visible;
    border-radius: 1.6rem; padding: .45rem;
  }
  .section-nav a { width: 100%; min-width: 0; padding: .7rem .35rem; }
  .toast, .offline-banner { right: calc(6.25rem + env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); }
}

@media (device-posture: folded) {
  body { padding-right: calc(5.8rem + env(safe-area-inset-right)); padding-bottom: 0; }
  .section-nav {
    left: auto; right: max(.55rem, env(safe-area-inset-right)); top: 50%; bottom: auto;
    width: 4.6rem; max-width: none; transform: translateY(-50%); flex-direction: column; overflow: visible;
    border-radius: 1.5rem;
  }
  .section-nav a { width: 100%; min-width: 0; padding: .68rem .3rem; }
}

@media (min-width: 700px) {
  .topbar { padding-left: max(2rem, calc((100% - var(--max)) / 2)); padding-right: max(2rem, calc((100% - var(--max)) / 2)); }
  .hero-content { padding-left: 2rem; padding-right: 2rem; }
  .hero-status { grid-template-columns: 1fr 1fr; padding: 1.5rem; }
  .section { padding-left: 2rem; padding-right: 2rem; }
  .now-card-body { padding: 2.25rem; }
  .now-card .button { width: auto; }
  .timeline-list::before { left: 6.25rem; }
  .timeline-item { grid-template-columns: 5.5rem 1.5rem 1fr; }
  .timeline-card { padding-left: 1.25rem; padding-right: 1.25rem; }
  .location-panel { grid-template-columns: 1.25fr .75fr; align-items: center; padding: 2rem; }
  .location-details { grid-template-columns: 1fr; border-top: 0; border-left: 1px solid var(--line); padding: 0 0 0 1.5rem; }
  .place-grid { grid-template-columns: repeat(2, 1fr); }
  .check-grid { grid-template-columns: repeat(4, 1fr); }
  .stamp-grid { grid-template-columns: repeat(3, 1fr); }
  .note-grid { grid-template-columns: repeat(2, 1fr); }
  .source-card { grid-template-columns: 1fr auto; align-items: center; }
  .source-links { justify-content: flex-end; }
}

@media (min-width: 1024px) {
  .hero { min-height: 47rem; }
  .hero-content { padding-top: 10rem; }
  .hero-status { max-width: 46rem; }
  .section-nav a { padding-left: 1.15rem; padding-right: 1.15rem; }
  .now-card { display: grid; grid-template-columns: 11rem 1fr; }
  .now-indicator { align-items: flex-start; border-bottom: 0; border-right: 1px solid rgba(255,255,255,.12); padding: 2.25rem 1.5rem; }
  .now-card-body { padding: 2.5rem; }
  .place-grid { grid-template-columns: repeat(3, 1fr); }
  .check-grid { grid-template-columns: repeat(8, 1fr); }
  .note-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
