/* Shared visual system. Content and original media remain in app.mjs. */
:root {
  --bg: #f5f4ef;
  --surface: #fffdf9;
  --surface-muted: #f0f1ec;
  --ink: #243139;
  --muted: #626f70;
  --line: rgba(36,49,57,.12);
  --shadow: 0 8px 24px rgba(36,49,57,.05);
  --shadow-soft: 0 4px 16px rgba(36,49,57,.035);
  --radius-lg: 24px;
  --radius-md: 20px;
  --radius-sm: 12px;
}
html { scroll-padding-top: 92px; -webkit-text-size-adjust: 100%; }
body { line-height: 1.6; background: var(--bg); }
button, a, label { -webkit-tap-highlight-color: transparent; }
button, a, input, textarea { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button:active { filter: brightness(.96); }
.app-frame { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
.main-content { padding-top: 16px; }
.topbar { padding-top: max(12px, env(safe-area-inset-top)); padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.date-nav { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 6px; overflow: visible; }
.date-tab { min-width: 0; min-height: 54px; padding: 6px 4px; border-radius: 14px; text-align: center; }
.date-tab span { font-size: 16px; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.date-tab small { font-size: 12px; }
.date-tab.is-active { box-shadow: 0 3px 9px color-mix(in srgb,var(--accent) 16%,transparent); }
.date-label, .section-kicker { font-size: 12px; letter-spacing: .09em; }
.day-card { padding: 18px; background: linear-gradient(135deg,var(--accent-soft),var(--surface) 76%); border-color: color-mix(in srgb,var(--accent) 12%,transparent); }
.day-highlight-strip { margin-top: 14px; gap: 8px; }
.day-highlight, .day-highlight:first-child { flex: 1; height: 100px; border-radius: 12px; padding: 0; }
.day-highlight span { font-size: 12px; line-height: 1.4; white-space: normal; text-overflow: clip; }
.day-highlight::after { background: linear-gradient(0deg,rgba(17,34,39,.7),transparent 80%); }
.day-tags { margin-top: 12px; gap: 6px; }
.day-tags span { font-size: 12px; padding: 4px 9px; color: var(--muted); }
.day-stats { font-size: 12px; gap: 6px 12px; margin-top: 16px; padding-top: 12px; }
.day-stats strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.map-section, .timeline-section { margin-top: 24px; }
.map-card { border: 1px solid var(--line); box-shadow: none; border-radius: 20px; }
.route-map-card { aspect-ratio: auto; }
.route-map-card .map-image { height: auto; min-height: 136px; max-height: 280px; object-fit: contain; filter: none; }
.mountain-map-card { height: 300px; aspect-ratio: auto; background: #eaf0e8; }
.mountain-map-card .map-image { object-fit: contain; filter: none; }
.map-image[data-image-preview], .transport-image { cursor: zoom-in; }
.timeline { padding-bottom: 0; }
.timeline::before { left: 59px; background: color-mix(in srgb,var(--accent) 23%,transparent); }
.timeline-item { grid-template-columns: 46px 28px minmax(0,1fr); }
.time-col { padding-top: 19px; font-size: 12px; line-height: 1.5; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.timeline-dot { margin-top: 21px; }
.timeline-card { padding: 14px; margin: 4px 0 12px; background: var(--surface); border: 1px solid rgba(36,49,57,.06); box-shadow: none; }
.timeline-card-top { min-height: 24px; padding-right: 30px; }
.timeline-card h3 { font-size: 17px; line-height: 1.45; letter-spacing: 0; margin: 7px 0 6px; overflow-wrap: anywhere; }
.timeline-card p { font-size: 14px; line-height: 1.65; }
.item-kind { font-size: 12px; letter-spacing: .04em; }
.meal-card { border-style: solid; border-color: color-mix(in srgb,var(--accent) 9%,transparent); background: color-mix(in srgb,var(--accent-soft) 28%,var(--surface)); }
.is-optional .timeline-card { border-style: dashed; background: color-mix(in srgb,var(--surface) 60%,var(--bg)); }
.is-pending .timeline-card h3 { color: var(--muted); font-weight: 500; }
.done-check { position: absolute; right: 4px; top: 5px; width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer; }
.done-check span, .packing-check span { width: 22px; height: 22px; border-color: #a3afac; }
.done-check input, .packing-check input { inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.done-check:focus-within span, .packing-check:focus-within span { outline: 2px solid var(--accent); outline-offset: 3px; }
.text-action, .restaurant-detail-action { min-height: 44px; font-size: 14px; font-weight: 650; margin-top: 4px; }
.text-action span { font-size: 18px; }
.item-note { margin-top: 4px; gap: 4px; }
.item-note span { font-size: 12px; }
.item-note textarea { min-height: 44px; height: 44px; font-size: 16px; padding: 9px 10px; line-height: 1.5; border-color: rgba(36,49,57,.08); background: rgba(240,241,236,.45); }
.item-note textarea:focus { min-height: 80px; }
.transport-times { gap: 8px; padding-top: 12px; }
.transport-times div { grid-template-columns: auto 1fr 16px 1fr; gap: 6px; }
.transport-times span { font-size: 12px; }
.transport-times strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.transport-image { max-height: none; height: auto; }
.bottom-nav { padding: 8px 14px max(8px,env(safe-area-inset-bottom)); background: rgba(255,253,249,.96); box-shadow: 0 -4px 18px rgba(36,49,57,.025); gap: 8px; }
.nav-item { min-height: 54px; padding: 7px 0 5px; border-radius: 14px; color: var(--muted); }
.nav-item small { font-size: 12px; font-weight: 500; }
.nav-item.is-active { background: var(--accent-soft); color: var(--accent); }
.nav-item.is-active small { font-weight: 700; }
.nav-item .nav-icon { width: 23px; height: 23px; }

/* Photo libraries keep their original images and original-image actions. */
.stay-view { padding-top: 6px; gap: 32px; }
.stay-zone { gap: 16px; }
.stay-zone-head { grid-template-columns: 1fr auto; gap: 4px 12px; }
.stay-zone-head h2 { grid-column: 1 / -1; font-size: 26px; letter-spacing: 0; line-height: 1.35; }
.stay-zone-dates { font-size: 14px; font-weight: 500; }
.stay-zone-count { font-size: 12px; }
.hotel-list { gap: 18px; }
.hotel-card, .restaurant-card { border-color: rgba(36,49,57,.08); background: var(--surface); box-shadow: var(--shadow-soft); }
.hotel-photo-strip { display: flex; height: 240px; gap: 8px; overflow-x: auto; padding: 10px 10px 0; scroll-snap-type: x mandatory; scrollbar-width: thin; background: var(--surface); }
.hotel-photo { flex: 0 0 82%; border-radius: 14px; background: var(--surface-muted); scroll-snap-align: start; }
.hotel-photo img { object-fit: contain; }
.hotel-photo span { min-width: 24px; padding: 4px 7px; font-size: 12px; background: rgba(24,40,45,.76); }
.hotel-card-body { padding: 16px 18px; }
.hotel-rank { font-family: inherit; font-size: 12px; letter-spacing: .1em; color: var(--muted); }
.hotel-card h3 { font-size: 18px; line-height: 1.5; letter-spacing: 0; margin: 5px 0 10px; }
.hotel-tags span { font-size: 12px; line-height: 1.5; padding: 4px 9px; background: var(--surface-muted); }
.hotel-card-foot { margin-top: 12px; padding-top: 8px; font-size: 12px; gap: 8px; }
.hotel-card-foot .text-action { margin-top: 0; white-space: nowrap; }
.restaurant-view { margin-top: 4px; }
.restaurant-intro { padding: 8px 2px 20px; }
.restaurant-intro h1, .restaurant-subpage-head h1 { font-family: inherit; font-size: 28px; line-height: 1.35; letter-spacing: 0; font-weight: 700; }
.restaurant-intro h1 { margin-top: 6px; }
.coffee-category-card { min-height: 148px; padding: 20px 18px; gap: 14px; border-radius: 22px; box-shadow: none; }
.coffee-category-card + .coffee-category-card { margin-top: 14px; }
.coffee-category-mark { width: 56px; height: 56px; flex-basis: 56px; border-radius: 18px; border-color: rgba(255,255,255,.3); }
.category-icon { width: 44px; height: 44px; }
.coffee-category-mark::before, .coffee-category-mark::after { display: none; }
.coffee-category-copy { gap: 7px; flex: 1; padding-right: 10px; }
.coffee-category-copy .section-kicker { font-size: 10px; color: rgba(255,255,255,.8); }
.coffee-category-copy strong { font-family: inherit; font-size: 22px; line-height: 1.35; letter-spacing: 0; font-weight: 650; }
.coffee-category-copy small { font-size: 13px; line-height: 1.6; color: rgba(255,255,255,.9); }
.coffee-category-arrow { position: absolute; top: 14px; right: 14px; font-size: 22px; }
.restaurant-subpage-head { margin-bottom: 20px; align-items: center; gap: 10px; }
.restaurant-subpage-head > div { min-width: 0; }
.restaurant-subpage-head .section-kicker { font-size: 10px; letter-spacing: .04em; }
.restaurant-subpage-head h1 { font-size: 26px; }
.subpage-back { flex: 0 0 44px; width: 44px; height: 44px; background: var(--surface); border: 1px solid var(--line); }
.collection-count { flex-shrink: 0; font-size: 12px; padding: 5px 9px; }
.restaurant-list { gap: 20px; }
.restaurant-cover { height: 232px; background: var(--surface-muted); }
.restaurant-photo { object-fit: contain; background: var(--surface-muted); }
.restaurant-cover::after { background: none; }
.restaurant-cover-mark { font-size: 12px; background: rgba(24,40,45,.78); }
.restaurant-card-body { padding: 18px; }
.restaurant-area { font-size: 12px; letter-spacing: .02em; font-weight: 600; }
.restaurant-card h2 { font-size: 19px; line-height: 1.5; letter-spacing: 0; margin-top: 5px; overflow-wrap: anywhere; }
.restaurant-tags { margin-top: 12px; gap: 6px; }
.restaurant-tags span { font-size: 12px; padding: 4px 9px; line-height: 1.5; }
.restaurant-dishes { font-size: 12px; gap: 6px; margin-top: 14px; }
.restaurant-dishes > span { width: 100%; }
.restaurant-dishes b { font-size: 12px; font-weight: 500; padding: 4px 8px; }
.restaurant-detail-action { width: 100%; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 16px; padding-top: 8px; }

/* Sheets: independent close layer, consistent safe spacing and readable facts. */
.sheet-layer { justify-content: center; }
.sheet-backdrop { background: rgba(22,34,39,.42); backdrop-filter: blur(4px); }
.bottom-sheet, .other-sheet { max-height: 91vh; max-height: 91dvh; padding: 14px 20px max(28px,env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; overscroll-behavior-y: contain; scroll-padding-top: 64px; }
.sheet-handle { margin-bottom: 46px; background: #cad2cf; }
.sheet-chrome { position: sticky; top: -14px; z-index: 30; height: 54px; margin: -14px -20px 14px; padding: 14px 20px 0; background: var(--surface); border-radius: 24px 24px 0 0; }
.sheet-chrome .sheet-handle { margin: 0 auto; }
.sheet-chrome .sheet-close { top: 5px; }
.sheet-close { z-index: 20; top: 10px; right: 12px; width: 44px; height: 44px; display: grid; place-items: center; font-size: 26px; background: #edf0ec; color: #43565a; box-shadow: 0 0 0 4px var(--surface); }
.detail-gallery { height: 220px; border-radius: 16px; isolation: isolate; }
.detail-gallery::after { background: linear-gradient(0deg,rgba(13,30,35,.72),transparent 75%); }
.detail-gallery-title { left: 16px; right: 16px; bottom: 16px; }
.detail-gallery-title h2 { font-size: 24px; line-height: 1.35; letter-spacing: 0; }
.detail-gallery-title span, .gallery-count { font-size: 12px; }
.gallery-control { width: 44px; height: 44px; font-size: 28px; background: rgba(20,40,46,.52); }
.detail-body { padding: 20px 0 0; }
.detail-subtitle { font-size: 14px; line-height: 1.65; margin-bottom: 20px; }
.detail-grid { grid-template-columns: minmax(0,1fr); gap: 16px; padding-bottom: 20px; }
.detail-grid dt, .detail-block > span, .note-field > span, .meal-form label > span { font-size: 12px; font-weight: 600; }
.detail-grid dd, .detail-block p { font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; }
.detail-block { padding-top: 20px; }
.detail-block p { margin-top: 5px; }
.caution p { color: var(--ink); }
.caution { border-left: 2px solid var(--accent-soft); padding-left: 12px; }
.note-field textarea, .meal-form input, .meal-form textarea, .memo-card textarea, .packing-add input { font-size: 16px; line-height: 1.6; min-height: 48px; border-radius: 12px; }
.primary-button { min-height: 48px; font-size: 15px; border-radius: 12px; padding: 12px 16px; }
.meal-edit-head { padding: 0; }
.meal-edit-head h2 { font-size: 26px; letter-spacing: 0; }
.meal-form { padding-top: 4px; }
.restaurant-detail-title { padding: 0 0 18px; }
.restaurant-detail-title h2 { font-size: 25px; line-height: 1.4; letter-spacing: 0; margin: 7px 0; overflow-wrap: anywhere; }
.restaurant-detail-title p { font-size: 13px; }
.restaurant-gallery { gap: 12px; }
.restaurant-gallery-item { flex-basis: 88%; height: 260px; border-radius: 14px; }
.restaurant-gallery-hint { font-size: 12px; line-height: 1.6; margin-top: 10px; }
.restaurant-source-link { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; text-underline-offset: 4px; }
.image-preview-sheet { overflow: visible; height: 84vh; height: 84dvh; }
.image-preview-sheet .sheet-close { position: fixed; z-index: 25; top: max(12px,env(safe-area-inset-top)); right: max(14px,env(safe-area-inset-right)); box-shadow: none; background: #fffdf9; }
.image-preview-viewport { overflow: hidden; border-radius: 14px; }
body:has(.sheet-layer), body:has(.image-preview-layer) { overflow: hidden; }

/* Personal planning stays editable, with larger controls and calmer grouping. */
.me-view { margin-top: 6px; }
.personal-section { padding: 22px 16px 16px; }
.personal-section-head { padding: 0 4px; margin-bottom: 20px; }
.personal-section-head h2 { font-size: 28px; letter-spacing: 0; }
.personal-progress { font-size: 12px; }
.other-category-card { grid-template-columns: 44px minmax(0,1fr) 14px; gap: 12px; padding: 16px 12px; background: #f3f4ef; }
.other-category-copy strong { font-size: 16px; letter-spacing: 0; }
.other-category-copy small { font-size: 12px; white-space: normal; line-height: 1.6; overflow: visible; }
.other-sheet-head { gap: 12px; padding: 0; flex-wrap: wrap; }
.other-sheet-head h2 { font-size: 28px; line-height: 1.35; letter-spacing: 0; margin: 6px 0; }
.other-sheet-head p { font-size: 13px; }
.other-sheet-head:has(> h2) { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.other-sheet-head:has(> h2) > .section-kicker { grid-column: 1 / -1; }
.other-sheet-head:has(> h2) > p { align-self: center; color: var(--muted); font-weight: 500; }
.packing-reset { min-height: 44px; font-size: 12px; padding: 8px 12px; }
.packing-summary { margin: 20px 0; padding: 12px 14px; }
.packing-summary span { font-size: 12px; }
.packing-summary p, .other-sheet-summary { font-size: 14px; line-height: 1.65; }
.packing-groups { gap: 24px; }
.packing-group h3 { font-size: 14px; color: var(--ink); margin: 0; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.packing-list { gap: 4px; margin-top: 8px; }
.packing-row { grid-template-columns: 44px 44px minmax(0,1fr) 44px; gap: 0; padding: 5px 0; }
.packing-check, .packing-drag-handle, .packing-remove { width: 44px; height: 44px; display: grid; place-items: center; margin: 0; }
.packing-drag-handle { color: #71817e; }
.packing-label, .reservation-card-title .packing-label { font-size: 16px; padding: 8px 0; min-height: 44px; }
.packing-row-note, .packing-row-owner { padding: 0; font-size: 13px; line-height: 1.6; }
.packing-row { align-items: start; }
.packing-row-copy { padding-bottom: 6px; }
.reservation-list { gap: 16px; }
.reservation-card { display: block; padding: 14px 16px 18px; background: #f4f4ef; border-radius: 18px; }
.reservation-card + .reservation-card { margin-top: 0; }
.reservation-check { position: absolute; top: 8px; left: 6px; }
.reservation-remove { position: absolute; top: 8px; right: 6px; }
.reservation-card-title { display: flex; flex-direction: column; align-items: start; gap: 4px; padding: 0 30px; }
.reservation-card-title .packing-label { font-weight: 650; }
.reservation-card-title > span { font-size: 12px; padding: 4px 9px; white-space: normal; }
.reservation-facts { gap: 14px; margin-top: 16px; padding-top: 16px; }
.reservation-facts div { grid-template-columns: minmax(0,1fr); gap: 4px; }
.reservation-facts b { font-size: 12px; font-weight: 600; }
.reservation-facts p { font-size: 14px; line-height: 1.7; }
.other-sheet .memo-card { margin-top: 16px; }
.other-sheet .memo-card textarea { min-height: 42vh; min-height: 42dvh; }
@media (min-width: 600px) {
  .day-highlight, .day-highlight:first-child { height: 145px; }
  .hotel-photo-strip { height: 300px; }
  .hotel-photo { flex-basis: calc(50% - 4px); }
  .restaurant-cover { height: 300px; }
  .restaurant-gallery-item { flex-basis: 60%; height: 340px; }
  .detail-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .detail-grid > div:first-child, .restaurant-detail-sheet .detail-grid > div:nth-child(3) { grid-column: 1 / -1; }
}
@media (max-width: 374px) {
  .main-content { padding-left: 14px; padding-right: 14px; }
  .topbar { padding-left: 14px; padding-right: 14px; }
  .timeline-item { grid-template-columns: 42px 24px minmax(0,1fr); }
  .timeline::before { left: 53px; }
  .timeline-card { padding: 12px; }
  .day-highlight span { font-size: 11px; }
  .coffee-category-mark { flex-basis: 48px; width: 48px; height: 48px; }
  .coffee-category-copy strong { font-size: 21px; }
  .bottom-sheet { padding-left: 16px; padding-right: 16px; }
  .sheet-chrome { margin-left: -16px; margin-right: -16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
