:root {
  --bg: #ffffff; --panel: #f5f6f8; --card: #ffffff; --ink: #1c1c22; --sub: #6a6a75; --line: #e7e7ec;
  --accent: #e5484d; --accent-ink: #ffffff; --accent-soft: #fdecec; --warn: #b45309; --ok: #1f8a70;
  --radius: 18px; --shadow: 0 1px 2px rgb(28 28 34 / .05), 0 10px 30px rgb(28 28 34 / .07);
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", system-ui, sans-serif;
  /* Always the bright theme, even when the OS is in dark mode. */
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.7 var(--font); -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: 2px; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--sub); }
.small { font-size: 13px; }
.boot { padding: 40px; color: var(--sub); }

/* buttons */
.primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 11px 22px; font-weight: 700; white-space: nowrap; text-decoration: none; }
.primary:not(:disabled):hover { filter: brightness(1.06); }
.ghost { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 16px; font-weight: 600; }
.ghost:hover { border-color: var(--ink); }
.ghost.wide { width: 100%; padding: 11px; }
.small-btn { padding: 6px 14px; font-size: 13px; }
.text-btn { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 6px 0; font-weight: 600; color: var(--sub); }
.text-btn:hover { color: var(--ink); }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 0; background: none; color: var(--sub); }
.icon-btn:hover { background: var(--panel); color: var(--ink); }
.send { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.center { justify-content: center; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600; }
.chip:hover { border-color: var(--accent); color: var(--accent); }

/* header */
.top { display: flex; align-items: center; gap: 16px; height: 56px; padding: 0 20px; border-bottom: 1px solid var(--line); background: var(--bg); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 17px; }
.brand img { border-radius: 7px; }
.trip-pill { display: flex; align-items: center; margin: 0 auto; border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px; font-size: 13px; font-weight: 600; min-width: 0; }
.trip-pill span { display: inline-flex; align-items: center; gap: 5px; padding: 0 10px; white-space: nowrap; }
.trip-pill span + span { border-left: 1px solid var(--line); }
.trip-pill .ico { width: 15px; height: 15px; color: var(--sub); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.trip-pill + .top-actions { margin-left: 0; }
/* phone-only pieces (shown in the phone media query) */
.m-check, .reel-entry, .m-back, .m-entries { display: none; }

/* home */
.home { min-height: 100%; display: flex; flex-direction: column; background: radial-gradient(1200px 500px at 50% -10%, var(--accent-soft), transparent 70%); }
.hero { width: min(720px, 100% - 32px); margin: 7vh auto 32px; text-align: center; }
.hero h1 { font-size: clamp(30px, 5vw, 50px); line-height: 1.2; margin: 0 0 14px; letter-spacing: -.01em; font-weight: 800; }
.lead { color: var(--sub); font-size: 17px; margin: 0 auto 28px; max-width: 32em; }
.ask { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 18px 18px 14px; box-shadow: var(--shadow); text-align: left; margin-bottom: 16px; }
.ask textarea { width: 100%; border: 0; background: none; resize: none; font-size: 17px; outline: none; }
.ask-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ask .primary .ico { width: 16px; height: 16px; }
/* home showcase: two looping rows of 9:16 cards, sliding in opposite directions */
.showcase { margin: 8px 0 44px; }
.show-title { text-align: center; color: var(--sub); font-size: 13px; font-weight: 700; margin: 0 16px 14px; }
.show-row { overflow: hidden; padding: 6px 0; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.show-track, .show-copy { display: flex; gap: 14px; width: max-content; }
.show-track { animation: slide 110s linear infinite; padding-right: 14px; }
.show-row.reverse .show-track { animation-direction: reverse; animation-duration: 130s; }
.show-row:hover .show-track, .show-row:focus-within .show-track { animation-play-state: paused; }
@keyframes slide { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .show-track { animation: none; } .show-row { overflow-x: auto; } }
.show-card { position: relative; flex: none; width: 200px; aspect-ratio: 9 / 16; border: 0; border-radius: 16px; overflow: hidden; color: #fff; display: grid; place-items: center; box-shadow: var(--shadow); transition: transform .15s; }
.show-card:hover { transform: translateY(-3px); }
.show-card .ico.big { width: 40px; height: 40px; opacity: .9; }
.show-text { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: flex-start; padding: 36px 10px 10px; background: linear-gradient(transparent, rgb(0 0 0 / .55)); text-align: left; }
.show-text small { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; opacity: .9; }
.show-text small .ico { width: 12px; height: 12px; }
.show-text strong { font-size: 13px; line-height: 1.35; }
.how { width: min(900px, 100% - 32px); margin: 0 auto 40px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.how-step { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.how-step span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, #ffe1d8, #e6ddfb); color: var(--accent); }
.how-step strong { font-size: 15px; }
.how-step p { margin: 0; color: var(--sub); font-size: 13px; line-height: 1.6; }
@media (max-width: 699px) { .how { grid-template-columns: 1fr; } .show-card { width: 120px; } }
.recent { width: min(720px, 100% - 32px); margin: 0 auto 24px; }
.recent h2 { font-size: 15px; margin: 0 0 10px; }
.recent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.recent-card { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.recent-card .ico { color: var(--accent); }
.recent-card span { display: flex; flex-direction: column; min-width: 0; }
.recent-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-card small { color: var(--sub); }
.recent-card:hover { border-color: var(--accent); }
.recent-item { position: relative; }
.recent-item .recent-card { padding-right: 44px; height: 100%; }
.recent-delete { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); font-size: 18px; }
.recent-delete:hover { color: var(--accent); }
.about { width: min(680px, 100% - 32px); margin: 40px auto 60px; }
.about h1 { font-size: 26px; margin: 0 0 16px; }
.about h2 { font-size: 17px; margin: 28px 0 8px; }
.about p, .about li { color: var(--sub); }
.demo-note { margin: auto auto 20px; width: min(720px, 100% - 32px); color: var(--sub); font-size: 12px; text-align: center; }

/* workspace */
.workspace { height: 100dvh; display: grid; grid-template-columns: minmax(340px, 420px) 1fr; grid-template-rows: 56px 1fr; }
.workspace > .top { grid-column: 1 / -1; }
.chat { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.messages { flex: 1; overflow-y: auto; padding: 24px 22px 8px; display: flex; flex-direction: column; gap: 18px; }
.msg p { margin: 0; overflow-wrap: anywhere; }
.msg.assistant p { line-height: 1.8; }
.msg.user { align-self: flex-end; max-width: 85%; }
.msg.user p { background: var(--accent-soft); padding: 10px 14px; border-radius: 18px 18px 4px 18px; }
.typing p { display: flex; gap: 4px; padding: 6px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--sub); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: .25; } }
.trip-card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 16px; padding: 10px; box-shadow: var(--shadow); }
.trip-card-map { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); flex: none; }
.trip-card span:nth-child(2) { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.trip-card small { color: var(--sub); font-size: 11px; }
.trip-card em { font-style: normal; color: var(--sub); font-size: 12px; }
.trip-card .open { border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 700; }
.trip-card:hover .open { border-color: var(--accent); color: var(--accent); }
.quick { padding: 4px 18px 10px; }
#composer { margin: 0 14px; padding: 10px 10px 6px 14px; border: 1px solid var(--line); border-radius: 22px; background: var(--card); box-shadow: var(--shadow); }
#composer textarea { display: block; width: 100%; border: 0; background: none; resize: none; outline: none; padding: 4px 0; max-height: 160px; }
.composer-row { display: flex; justify-content: space-between; align-items: center; }
.fineprint { font-size: 11px; color: var(--sub); text-align: center; margin: 6px 14px 10px; }

/* right panel */
/* Pale lavender stage behind the reels and the trip; the accent stays coral. */
.panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative;
  background: radial-gradient(900px 480px at 85% -10%, #f9d9ec 0%, transparent 62%), radial-gradient(900px 640px at 0% 100%, #ddd3fa 0%, transparent 62%), #ece6fb; }
.panel .map-bg { fill: #f6f3fe; }
.panel .tray, .panel .book-bar { background: rgb(255 255 255 / .82); backdrop-filter: blur(14px); border-top-color: rgb(120 100 190 / .14); }
.panel .cond-list span, .panel .ghost { border-color: rgb(120 100 190 / .18); }
.panel-scroll { flex: 1; overflow-y: auto; display: grid; place-items: center; padding: 24px; }

/* checklist (before a destination) */
.checklist-card { width: min(440px, 100%); background: var(--card); border-radius: 22px; padding: 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.checklist-head { display: flex; align-items: center; gap: 14px; }
.checklist-head small { color: var(--sub); font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.checklist-head h2 { margin: 0; font-size: 19px; }
.ring { width: 48px; height: 48px; flex: none; transform: rotate(-90deg); }
.ring circle { fill: none; stroke: var(--line); stroke-width: 4; }
.ring .ring-on { stroke: var(--accent); stroke-linecap: round; }
.ring text { transform: rotate(90deg); transform-origin: 20px 20px; font: 700 10px var(--font); fill: var(--ink); text-anchor: middle; }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; }
.mark { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1.5px dashed var(--line); flex: none; margin-top: 2px; }
.checklist li.on .mark { background: var(--ink); border: 0; color: var(--bg); }
.mark .ico { width: 14px; height: 14px; stroke-width: 2.4; }
.checklist small { display: flex; align-items: center; gap: 4px; color: var(--sub); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.checklist small .ico { width: 13px; height: 13px; }
.checklist strong { display: block; font-size: 15px; }
.checklist li:not(.on) strong { color: var(--sub); font-weight: 500; }

/* feed */
.feed-head { display: flex; align-items: center; gap: 12px; padding: 12px 20px; }
.cond { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.cond .ring { width: 38px; height: 38px; }
.cond-list { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.cond-list span { flex: none; font-size: 12px; color: var(--sub); border: 1px dashed var(--line); border-radius: 999px; padding: 3px 10px; background: var(--card); }
.cond-list span.on { border-style: solid; color: var(--ink); }
.cond-list b { margin-left: 5px; font-weight: 700; }
.reels { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; align-content: start; padding: 4px 20px 24px; }
.reel { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.reel-media { position: relative; aspect-ratio: 9 / 16; border-radius: 16px; overflow: hidden; background: #111; box-shadow: var(--shadow); outline: 2px solid transparent; outline-offset: 3px; transition: outline-color .15s, transform .15s; }
.reel:hover .reel-media { transform: translateY(-2px); }
.reel.picked .reel-media { outline-color: var(--accent); }
.reel.partly .reel-media { outline-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.reel-media video, .reel-media iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; background: #000; }
.placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: rgb(255 255 255 / .85); }
.ico.big { width: 56px; height: 56px; stroke-width: 1.2; }
.tone-sunset .reel-media, .show-card.tone-sunset, .from-reel .tone-sunset { background: linear-gradient(165deg, #f7b267, #d9486b); }
.tone-sea .reel-media, .show-card.tone-sea, .from-reel .tone-sea { background: linear-gradient(165deg, #56b4d3, #145da0); }
.tone-forest .reel-media, .show-card.tone-forest, .from-reel .tone-forest { background: linear-gradient(165deg, #7fb77e, #1f4e3d); }
.tone-dusk .reel-media, .show-card.tone-dusk, .from-reel .tone-dusk { background: linear-gradient(165deg, #7c7fc2, #2b2d42); }
.tone-sakura .reel-media, .show-card.tone-sakura, .from-reel .tone-sakura { background: linear-gradient(165deg, #f6bdc0, #9d6b7f); }
.tone-stone .reel-media, .show-card.tone-stone, .from-reel .tone-stone { background: linear-gradient(165deg, #a3b1c2, #3d4552); }
.play { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 0; background: rgb(0 0 0 / .15); color: #fff; padding: 20px; text-align: center; }
.play > .ico { width: 54px; height: 54px; padding: 14px; border-radius: 50%; background: rgb(0 0 0 / .45); fill: currentColor; stroke: none; }
.play span { font-weight: 700; font-size: 14px; }
.play small { font-size: 11px; opacity: .85; }
.play.clean { background: none; }
.play.clean > .ico { width: 48px; height: 48px; padding: 13px; background: rgb(0 0 0 / .35); backdrop-filter: blur(6px); }
.reel-by { position: absolute; top: 10px; left: 10px; right: 52px; display: flex; align-items: baseline; gap: 6px; color: #fff; font-size: 13px; font-weight: 700; text-shadow: 0 1px 3px rgb(0 0 0 / .45); pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reel-by small { font-size: 10px; font-weight: 600; opacity: .85; }
.reel-title { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.reel-where { margin: 4px 0 0; display: flex; align-items: center; gap: 4px; font-size: 12px; opacity: .9; }
.reel-where .ico { width: 13px; height: 13px; }
dialog.player-dialog { width: min(440px, 100% - 24px); background: #111; color: #fff; overflow: hidden; }
.player { display: flex; flex-direction: column; }
.player-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; }
.player-bar > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.player-bar strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-bar small { font-size: 11px; opacity: .7; }
.player-bar a, .player-bar .close { color: #fff; font-size: 12px; }
.player-bar .close { font-size: 22px; line-height: 1; padding: 2px 6px; }
.player-bar a .ico { width: 13px; height: 13px; }
.player iframe { width: 100%; height: min(78vh, 760px); border: 0; background: #000; }
.badge { position: absolute; top: 10px; left: 10px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: rgb(0 0 0 / .45); color: #fff; backdrop-filter: blur(6px); pointer-events: none; }
.badge.curated { background: var(--accent); }
.like { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgb(0 0 0 / .4); color: #fff; backdrop-filter: blur(6px); transition: transform .12s; }
.like:active { transform: scale(.9); }
.like .ico { width: 21px; height: 21px; }
.like.on { background: var(--accent); }
.like.on .ico { fill: currentColor; }
.sound { position: absolute; right: 8px; bottom: 8px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgb(0 0 0 / .4); color: #fff; z-index: 2; }
.reel-text { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 12px 12px; background: linear-gradient(transparent, rgb(0 0 0 / .65)); color: #fff; pointer-events: none; }
.reel-media.live .reel-text { padding-right: 48px; }
.reel-text a { pointer-events: auto; color: #fff; vertical-align: middle; }
.reel-text a .ico { width: 14px; height: 14px; }
.handle { margin: 0; font-weight: 700; font-size: 13px; }
.caption { margin: 2px 0 0; font-size: 12px; line-height: 1.5; opacity: .92; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.reel-places { display: flex; flex-wrap: wrap; gap: 6px; }
.place { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 4px 10px 4px 8px; font-size: 12px; font-weight: 600; text-align: left; }
.place span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place .ico { width: 14px; height: 14px; color: var(--sub); }
.place em { font-style: normal; font-weight: 500; font-size: 10px; color: var(--warn); }
.place.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.place.on .ico { color: var(--accent); stroke-width: 2.6; }
.reel.add { aspect-ratio: 9 / 16; align-self: start; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 2px dashed var(--line); border-radius: 16px; background: none; color: var(--sub); padding: 20px; text-align: center; }
.reel.add span { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--card); }
.reel.add strong { color: var(--ink); }
.reel.add small { font-size: 12px; }
.reel.add:hover { border-color: var(--accent); }

.tray { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--card); }
.tray-list { flex: 1; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.tray-item { display: inline-flex; align-items: center; gap: 6px; flex: none; border: 0; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 700; }
.tray-empty { color: var(--sub); font-size: 13px; }

/* trip page */
.trip-page { flex: 1; min-height: 0; overflow-y: auto; padding: 0 max(20px, calc((100% - 760px) / 2)) 96px; }
.page-bar { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; }
.overview { border-radius: var(--radius); padding: 20px 22px; background: linear-gradient(120deg, #ffe3d6, #ffd0d6 55%, #fbe7c6); }
.overview h2 { margin: 0 0 8px; font-size: 26px; line-height: 1.3; }
.overview .stats { color: #5b4a4a; }
.day-pills { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 14px 0 0; }
.day-pill { display: inline-flex; align-items: center; gap: 6px; flex: none; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 14px 5px 6px; font-size: 13px; font-weight: 700; }
.day-pill i { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--c); color: #fff; font-style: normal; font-size: 11px; }
.day-pill small { color: var(--sub); font-weight: 500; font-size: 12px; }
.day-pill:hover { border-color: var(--c); }
.stats { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--sub); font-size: 13px; font-weight: 600; }
.stats span { display: inline-flex; align-items: center; gap: 5px; }
.stats .ico { width: 16px; height: 16px; }
.route { display: flex; align-items: center; margin: 20px 0; font-size: 13px; font-weight: 600; }
.route i { flex: 1; height: 2px; background: var(--line); }
.route .end { display: inline-flex; align-items: center; gap: 4px; }
.route .end .ico { width: 15px; height: 15px; color: var(--sub); }
.route .hop { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--card); border: 1px solid var(--line); color: var(--sub); }
.route .hop .ico { width: 16px; height: 16px; }
.route .dest { display: flex; flex-direction: column; align-items: center; background: var(--card); border-radius: 14px; padding: 8px 16px; box-shadow: var(--shadow); }
.route .dest small { color: var(--sub); font-weight: 500; font-size: 11px; }
.map-card { background: var(--card); border-radius: var(--radius); padding: 8px; box-shadow: var(--shadow); margin: 16px 0 24px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 8px 4px; font-size: 12px; font-weight: 600; }
.legend button { display: inline-flex; align-items: center; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 3px 11px; font-size: 12px; font-weight: 700; color: var(--sub); }
.legend button[class*="dc"]::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); margin-right: 5px; }
.legend button.on { border-color: var(--ink); color: var(--ink); background: var(--panel); }
.legend small { color: var(--sub); font-weight: 400; margin-left: auto; }
/* keep in sync with dayColors in map.js */
.dc0 { --c: #e5484d; } .dc1 { --c: #2f6fbd; } .dc2 { --c: #1f8a70; } .dc3 { --c: #c27c0e; } .dc4 { --c: #8b3f96; } .dc5 { --c: #0e7490; } .dc6 { --c: #57606a; }
.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl::before { content: ""; position: absolute; left: 17px; top: 18px; bottom: 18px; width: 2px; background: var(--line); }
.node { position: relative; display: grid; grid-template-columns: 36px 1fr; gap: 14px; margin-bottom: 18px; }
.node-icon { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--card); border: 1px solid var(--line); color: var(--sub); }
.node-icon.day { background: var(--c); border: 0; color: #fff; font-weight: 800; font-size: 14px; }
.node-body > small { display: block; font-size: 12px; font-weight: 700; color: var(--sub); margin: 7px 0 6px; }
.card { background: var(--card); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); }
.card strong { display: block; }
.card p { margin: 2px 0 0; }
.hint { color: var(--warn); font-size: 12px; margin-top: 8px !important; }
.book-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.book-link { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); font-size: 13px; font-weight: 600; text-decoration: none; }
.book-link .ico { width: 13px; height: 13px; color: var(--sub); }
.book-link:hover { border-color: var(--accent); color: var(--accent); }
.day-card summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; }
.day-card summary::-webkit-details-marker { display: none; }
.day-card summary::after { content: "詳しく見る"; font-size: 12px; font-weight: 700; color: var(--accent); margin-top: 4px; }
.day-card[open] summary::after { content: "閉じる"; }
.stops { list-style: none; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); }
.stop { display: grid; grid-template-columns: 54px 44px 1fr; gap: 12px; align-items: start; padding: 8px 0; }
.time { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; padding-top: 2px; }
.time small { display: block; color: var(--sub); font-weight: 400; font-size: 11px; }
/* Stand-in for a photo: a tile in the day's colour with the category icon and the stop number. */
.dot { position: relative; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, #fff); color: var(--c); }
.dot .ico { width: 22px; height: 22px; }
.dot b { position: absolute; right: -5px; bottom: -5px; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 999px; background: var(--c); color: #fff; font-size: 11px; border: 2px solid var(--card); }
.stop strong { font-size: 15px; }
.stop > div { display: flex; flex-direction: column; gap: 1px; }
.meta { display: inline-flex; align-items: center; gap: 4px; color: var(--sub); font-size: 12px; }
.meta .ico { width: 14px; height: 14px; }
.maplink { font-size: 12px; width: fit-content; }
.warn { color: var(--warn); font-size: 12px; font-weight: 600; }
.move { margin-left: 88px; padding: 1px 0 1px 12px; border-left: 2px dotted var(--line); color: var(--sub); font-size: 12px; }
.unplaced { background: color-mix(in srgb, var(--warn) 10%, var(--card)); border-radius: 14px; padding: 12px 16px; margin: 8px 0 12px; }
.unplaced p { margin: 4px 0; font-size: 13px; }
.unplaced b { margin-right: 8px; }
.assumptions { color: var(--sub); font-size: 12px; padding-left: 18px; }
.book-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px max(20px, calc((100% - 760px) / 2)); background: var(--card); border-top: 1px solid var(--line); }
.book-bar div { display: flex; flex-direction: column; min-width: 0; }
.book-bar small { color: var(--sub); font-size: 11px; }
.book-bar .primary .ico { width: 16px; height: 16px; }

/* plan → book → booklet */
.steps { display: flex; align-items: center; gap: 6px; margin: 0 0 14px; }
.steps > i { flex: 0 1 28px; height: 2px; background: var(--line); }
.step { display: flex; align-items: center; gap: 8px; flex: 1 1 0; min-width: 0; border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 8px 10px; text-align: left; color: var(--ink); }
.step > span:last-child { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.step strong { font-size: 13px; }
.step small { color: var(--sub); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--panel); color: var(--sub); flex: none; }
.step-icon .ico { width: 16px; height: 16px; }
.step.now { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.step.now .step-icon { background: var(--accent); color: var(--accent-ink); }
.step.ok .step-icon { background: var(--ok); color: #fff; }
.step:hover { border-color: var(--accent); }
.asks { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 0; }
.ask-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; background: var(--card); border: 1px dashed color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: 14px; padding: 10px 14px; font-size: 13px; }
.ask-row > span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.ask-row > span:first-child .ico { color: var(--accent); width: 16px; height: 16px; }
.ask-row .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.date-pick { position: relative; display: inline-flex; align-items: center; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 700; padding: 6px 14px; cursor: pointer; }
.date-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.booked-btn { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; border: 1.5px dashed var(--line); background: none; border-radius: 999px; padding: 5px 14px; font-size: 12px; font-weight: 700; color: var(--sub); }
.booked-btn .ico { width: 14px; height: 14px; stroke-width: 2.6; }
.booked-btn:hover { border-color: var(--ok); color: var(--ok); }
.booked-btn.on { border: 1.5px solid var(--ok); background: color-mix(in srgb, var(--ok) 10%, var(--card)); color: var(--ok); }
.stop-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 2px; }
.from-reel { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; padding: 0; font-size: 12px; font-weight: 600; color: var(--ink); }
.from-reel i { width: 12px; height: 20px; border-radius: 4px; }
.from-reel:hover { color: var(--accent); }
.drop { padding: 0; font-size: 12px; margin-left: auto; }
.drop:hover { color: var(--accent); }
.book-check { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; margin: 8px 0 16px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; }
.sec-head h3 { margin: 0; font-size: 16px; }
.count { font-size: 13px; font-weight: 800; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 2px 10px; }
.count.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, var(--card)); }
.book-check ul { list-style: none; margin: 10px 0 0; padding: 0; }
.book-check li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.book-check li > div { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.45; }
.book-check li small { color: var(--sub); font-size: 12px; }
.book-check li em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--ok); }
.book-check li.on strong { color: var(--sub); }
.mark-btn { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1.5px dashed var(--sub); background: none; padding: 0; flex: none; }
.mark-btn .ico { width: 14px; height: 14px; stroke-width: 2.8; }
.book-check li.on .mark-btn { background: var(--ok); border: 0; color: #fff; }
.task-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--panel); color: var(--sub); flex: none; }
.fine { color: var(--sub); font-size: 11px; margin: 10px 0 0; }
.bar-actions { display: flex; gap: 6px; }
.bar-actions .ghost { white-space: nowrap; }
.bar-actions .ico { width: 15px; height: 15px; }

/* map replay (fresh plan, or ▶): origin → destination, then the stops land */
.map-card { margin: 0 0 16px; }
.map-stage { position: relative; }
.fly-layer { position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity .35s; }
.fly-svg, .map-svg { display: block; width: 100%; height: auto; }
.map-card.playing .fly-layer { opacity: 1; }
.map-card.playing .map-svg { opacity: 0; }
.map-svg { transition: opacity .35s; }
.fly-line { fill: none; stroke: var(--ink); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.playing .fly-line { animation: line-draw 2s cubic-bezier(.45, 0, .25, 1) forwards; }
@keyframes line-draw { to { stroke-dashoffset: 0; } }
.fly-end circle { fill: var(--sub); stroke: #fff; stroke-width: 3; }
.fly-end.to circle { fill: var(--accent); }
.fly-end text { font: 800 26px var(--font); fill: var(--ink); text-anchor: middle; paint-order: stroke; stroke: var(--panel); stroke-width: 5px; }
.fly-vehicle circle { fill: var(--accent); stroke: #fff; stroke-width: 3; }
.fly-vehicle path { fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stay-pin circle { fill: var(--ink); stroke: #fff; stroke-width: 3; }
.stay-lead line { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 3 3; }
.stay-lead circle { fill: var(--ink); }

.stay-pin path { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.map-play { position: absolute; left: 12px; top: 12px; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow); }
.map-play .ico { width: 16px; height: 16px; fill: currentColor; }
.landed .map-svg > g { animation: pin-drop .45s cubic-bezier(.2, .9, .3, 1.4) both; transform-box: fill-box; }
.landed .map-svg > g:nth-of-type(1) { animation-delay: 0.19s; }
.landed .map-svg > g:nth-of-type(2) { animation-delay: 0.28s; }
.landed .map-svg > g:nth-of-type(3) { animation-delay: 0.37s; }
.landed .map-svg > g:nth-of-type(4) { animation-delay: 0.46s; }
.landed .map-svg > g:nth-of-type(5) { animation-delay: 0.55s; }
.landed .map-svg > g:nth-of-type(6) { animation-delay: 0.64s; }
.landed .map-svg > g:nth-of-type(7) { animation-delay: 0.73s; }
.landed .map-svg > g:nth-of-type(8) { animation-delay: 0.82s; }
.landed .map-svg > g:nth-of-type(9) { animation-delay: 0.91s; }
.landed .map-svg > g:nth-of-type(10) { animation-delay: 1.00s; }
.landed .map-svg > g:nth-of-type(11) { animation-delay: 1.09s; }
.landed .map-svg > g:nth-of-type(12) { animation-delay: 1.18s; }
.landed .map-svg > g:nth-of-type(n+13) { animation-delay: 1.2s; }
.landed .map-svg > g.stay-pin { animation: stay-pop .55s cubic-bezier(.2, .9, .3, 1.5) 1.3s both; }
.landed .route-line { animation: march 1.2s .2s ease-out both; }
@keyframes stay-pop { from { opacity: 0; scale: .2; } }
.landed .map-svg > g.stay-lead { animation: fade-in .3s 1.3s both; }
@keyframes fade-in { from { opacity: 0; } }

/* small moments: picking a place, checking a booking, a fresh plan */
.burst { position: fixed; z-index: 60; width: 0; height: 0; pointer-events: none; }
.burst i { position: absolute; left: -4px; top: -4px; width: 8px; height: 12px; border-radius: 2px; opacity: 0; animation: confetti .9s cubic-bezier(.2, .7, .3, 1) forwards; }
.burst i:nth-child(1) { --x: 0px; --y: -90px; --r: 0deg; }
.burst i:nth-child(2) { --x: 40px; --y: -103px; --r: 67deg; }
.burst i:nth-child(3) { --x: 89px; --y: -91px; --r: 134deg; }
.burst i:nth-child(4) { --x: 68px; --y: -36px; --r: 201deg; }
.burst i:nth-child(5) { --x: 90px; --y: 0px; --r: 268deg; }
.burst i:nth-child(6) { --x: 89px; --y: 51px; --r: 335deg; }
.burst i:nth-child(7) { --x: 30px; --y: 43px; --r: 42deg; }
.burst i:nth-child(8) { --x: 0px; --y: 72px; --r: 109deg; }
.burst i:nth-child(9) { --x: -49px; --y: 83px; --r: 176deg; }
.burst i:nth-child(10) { --x: -55px; --y: 24px; --r: 243deg; }
.burst i:nth-child(11) { --x: -90px; --y: 0px; --r: 310deg; }
.burst i:nth-child(12) { --x: -111px; --y: -45px; --r: 17deg; }
.burst i:nth-child(13) { --x: -55px; --y: -64px; --r: 84deg; }
.burst i:nth-child(14) { --x: -40px; --y: -103px; --r: 151deg; }
.burst i:nth-child(5n+1) { background: #e5484d; }
.burst i:nth-child(5n+2) { background: #f7b267; }
.burst i:nth-child(5n+3) { background: #b07cf0; }
.burst i:nth-child(5n+4) { background: #1f8a70; }
.burst i:nth-child(5n+5) { background: #2f6fbd; }
@keyframes confetti { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--x), calc(var(--y) + 40px)) rotate(var(--r)); } }
@media (prefers-reduced-motion: no-preference) {
  .like.pop { animation: heart-pop .45s cubic-bezier(.2, .9, .3, 1.4); }
  .place.pop, .mark-btn.pop, .booked-btn.pop { animation: chip-pop .35s cubic-bezier(.2, .9, .3, 1.4); }
  .tray-item.arrive { animation: arrive .4s cubic-bezier(.2, .9, .3, 1.2) both; }
  .tray .primary.bump { animation: chip-pop .4s cubic-bezier(.2, .9, .3, 1.4); }
  .fresh .overview, .fresh .tl > li, .fresh .stop { animation: rise .5s cubic-bezier(.2, .8, .3, 1) both; }
  .fresh .overview { animation-delay: .1s; }
  .fresh .tl > li:nth-child(1) { animation-delay: .25s; } .fresh .tl > li:nth-child(2) { animation-delay: .32s; } .fresh .tl > li:nth-child(3) { animation-delay: .39s; }
  .fresh .tl > li:nth-child(4) { animation-delay: .46s; } .fresh .tl > li:nth-child(5) { animation-delay: .53s; } .fresh .tl > li:nth-child(n+6) { animation-delay: .6s; }
  .shiori .state.on { animation: stamp .45s cubic-bezier(.2, .9, .3, 1.3) .2s both; }
}
@keyframes heart-pop { 0% { transform: scale(1); } 35% { transform: scale(1.45); } 60% { transform: scale(.9); } 100% { transform: scale(1); } }
@keyframes chip-pop { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes arrive { from { opacity: 0; transform: translateY(10px) scale(.8); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes march { from { opacity: 0; stroke-dashoffset: 90; } to { opacity: 1; stroke-dashoffset: 0; } }
@keyframes pin-drop { from { opacity: 0; translate: 0 -14px; } }
@keyframes stamp { from { opacity: 0; transform: scale(1.8) rotate(-12deg); } }

/* booklet */
.shiori { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 26px; margin-bottom: 24px; }
.shiori-cover { border-bottom: 2px solid var(--ink); padding-bottom: 14px; margin-bottom: 6px; }
.shiori-cover small { font-size: 11px; font-weight: 800; letter-spacing: .12em; color: var(--accent); }
.shiori-cover h2 { margin: 2px 0 8px; font-size: 26px; line-height: 1.3; }
.shiori h3 { margin: 0 0 8px; font-size: 15px; }
.shiori-sec, .shiori-day { padding: 16px 0; border-bottom: 1px solid var(--line); }
.shiori-sec:last-of-type { border-bottom: 0; }
.shiori-book { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.shiori-book li { display: flex; align-items: center; gap: 12px; }
.shiori-book li > div { display: flex; flex-direction: column; line-height: 1.45; }
.shiori-book small { color: var(--sub); font-size: 12px; }
.state { flex: none; font-size: 11px; font-weight: 800; border: 1.5px solid var(--warn); color: var(--warn); border-radius: 6px; padding: 1px 7px; }
.state.on { border-color: var(--ok); color: var(--ok); }
.shiori-day h3 { display: flex; align-items: center; gap: 10px; }
.shiori-day h3 i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--c); color: #fff; font-style: normal; font-size: 13px; flex: none; }
.shiori-day h3 span { display: flex; flex-direction: column; line-height: 1.35; }
.shiori-day h3 small { color: var(--sub); font-weight: 600; font-size: 12px; }
.shiori-day ol { list-style: none; margin: 0; padding: 0 0 0 38px; }
.shiori-day li { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: baseline; padding: 5px 0; }
.shiori-day time { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--c); }
.shiori-day li > div { display: flex; flex-direction: column; line-height: 1.45; }
.shiori-day li small { color: var(--sub); font-size: 12px; }
.shiori-day li a { font-size: 12px; }
.shiori-day .s-move { display: block; padding: 0 0 0 62px; color: var(--sub); font-size: 11px; }
.s-stay { display: flex; align-items: center; gap: 6px; margin: 8px 0 0 38px; font-size: 13px; font-weight: 600; color: var(--sub); }
.s-stay .ico { width: 16px; height: 16px; }
.s-notes { margin: 0; padding-left: 18px; color: var(--sub); font-size: 12px; }
.s-foot { margin: 8px 0 0; text-align: right; color: var(--sub); font-size: 11px; }
@media print {
  @page { margin: 14mm; }
  .top, .chat, .page-bar, .steps, .book-bar, .no-print, #toast, #dialog { display: none !important; }
  html, body, #app, .workspace, .panel, .trip-page { display: block !important; height: auto !important; overflow: visible !important; background: #fff !important; padding: 0 !important; }
  .shiori { box-shadow: none; padding: 0; }
  .shiori-day { break-inside: avoid; }
  .shiori a { color: inherit; text-decoration: none; }
  .shiori-day time, .shiori-day h3 i { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.pr { display: inline-block; font-size: 10px; border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; margin-right: 6px; }
.map-svg { width: 100%; height: auto; display: block; }
.map-bg { fill: var(--panel); }
.grid { stroke: var(--line); stroke-width: 1; }
.route-line { fill: none; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 2 7; }
.pin text { fill: #fff; font: 700 12px var(--font); text-anchor: middle; }
.pin .pin-label { fill: var(--ink); text-anchor: start; font-weight: 600; paint-order: stroke; stroke: var(--panel); stroke-width: 4px; }
.pin .pin-label.flip { text-anchor: end; }
.faded { opacity: .18; }
.map-empty { padding: 40px; text-align: center; color: var(--sub); }

/* sign-up gate: the plan is built, then shown blurred until sign-up */
.gated { position: relative; }
.locked .gated-body { filter: blur(7px); user-select: none; max-height: 1100px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.lock-card { position: absolute; z-index: 2; top: 90px; left: 50%; transform: translateX(-50%); width: min(400px, 100% - 24px); display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; background: rgb(255 255 255 / .92); backdrop-filter: blur(10px); border-radius: 22px; padding: 26px 24px 22px; box-shadow: 0 20px 60px rgb(80 60 150 / .18); }
.lock-card strong { font-size: 18px; }
.lock-card p { margin: 0 0 6px; color: var(--sub); font-size: 13px; }
.lock-icon, .signup-art { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: linear-gradient(135deg, #ffd9cf, #e3d8fb); color: var(--accent); }
.lock-icon .ico, .signup-art .ico { width: 24px; height: 24px; }
.signup { align-items: center; text-align: center; padding: 28px 26px 16px; }
.signup p.muted { font-size: 13px; }
.signup-actions { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 6px; }
.signup-actions button { width: 100%; padding: 12px; }
.signup .fineprint { margin: 4px 0 0; }
.signup .later { padding: 4px 12px; }

/* login, account, admin */
.avatar { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #ffd9cf, #e3d8fb); color: var(--accent); font-weight: 800; text-decoration: none; }
.login-options { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.login-btn { display: flex; align-items: center; justify-content: center; padding: 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-weight: 700; text-decoration: none; }
.login-btn:hover { border-color: var(--ink); }
.login-btn.line { background: #06c755; border-color: #06c755; color: #fff; }
.email-login { display: flex; gap: 8px; }
.email-login input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; background: var(--bg); }
.invite-gate { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.invite-gate p { margin: 0 0 6px; }
.account .card, .admin .card { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin: 8px 0 12px; }
.account label, .admin label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ink); }
.account input, .admin input { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--bg); }
.plain { list-style: none; padding: 0; }
.plain li { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; color: var(--ink); }
.danger { color: #b42318; border-color: #f3c3bd; }
.chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0 16px; }
.admin-table th, .admin-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); color: var(--ink); }
.admin-table th { color: var(--sub); font-weight: 600; }
.locked .gated-body { min-height: 440px; }
.skeleton-day { display: grid; gap: 10px; margin-bottom: 14px; padding: 18px; border-radius: 16px; background: var(--card); }
.skeleton-day i { display: block; height: 14px; border-radius: 7px; background: var(--line); }
.skeleton-day i:nth-child(2) { width: 70%; }
.skeleton-day i:nth-child(3) { width: 45%; }

.affiliate { align-items: center; }
.affiliate strong { min-width: 150px; }
.affiliate label { flex: 1; min-width: 220px; }
.admin .affiliate label.check { flex: none; min-width: 0; flex-direction: row; align-items: center; gap: 6px; }
.about code { font-size: 12px; background: var(--panel); padding: 1px 5px; border-radius: 4px; }
.admin h3 { font-size: 14px; margin: 18px 0 4px; }
.admin textarea, .admin select { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--bg); font: inherit; font-weight: 400; color: var(--ink); }
.admin .wide { flex: 1 1 100%; min-width: 0; }
.reel-form strong { flex: 1 1 100%; }
.reel-form input[type=file] { max-width: 100%; min-width: 0; }
.reel-places { border: 1px dashed var(--line); border-radius: 12px; padding: 8px 12px 10px; margin: 0; }
.reel-places legend { font-size: 13px; font-weight: 600; color: var(--ink); padding: 0 4px; }
.place-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0; }
.place-row input { flex: 1 1 140px; min-width: 0; }
.card-details { margin: 4px 0 12px; font-size: 13px; }
.card-details summary { cursor: pointer; color: var(--sub); }
.nowrap { white-space: nowrap; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap .admin-table { min-width: 640px; }

/* legal pages and footer links */
.legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: 28px auto 24px; font-size: 12px; }
.legal-links a { color: var(--sub); }
.legal h2 { font-size: 16px; }
.legal ol, .legal ul { padding-left: 1.4em; }
.legal li { margin: 4px 0; }
.legal li ul { margin: 4px 0; }

/* dialog & toast */
dialog { border: 0; border-radius: 22px; padding: 0; width: min(520px, 100% - 32px); background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
dialog::backdrop { background: rgb(10 10 15 / .45); }
.sheet { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.sheet h2 { margin: 0; font-size: 19px; }
.sheet p { margin: 0; font-size: 13px; }
.sheet label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
.sheet input[type="url"], .sheet textarea { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--bg); font-weight: 400; }
.sheet .file input { font-weight: 400; font-size: 13px; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 8px; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 12px; font-size: 14px; max-width: calc(100% - 32px); transition: .2s; z-index: 20; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
body.busy .send, body.busy .primary { opacity: .6; pointer-events: none; }

/* ---------- phone ---------- */
@media (max-width: 899px) {
  .workspace { grid-template-columns: 1fr; grid-template-rows: 52px 1fr; }
  .top { height: 52px; padding: 0 12px; gap: 8px; }
  /* Chat is the home screen on phones (as in Layla's phone version); reels and the trip open full screen over it. */
  .trip-pill { display: none; }
  .top-actions, .trip-pill + .top-actions { margin-left: auto; }
  .chat { position: relative; }
  .m-back { display: inline-flex; }
  .page-bar { justify-content: flex-start; gap: 16px; }
  .page-bar .text-btn { white-space: nowrap; }
  .page-bar .ghost { display: none; } /* re-generating stays available from the reel tray */
  .m-check { display: block; position: absolute; z-index: 3; top: 8px; left: 10px; right: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); max-height: calc(100% - 120px); overflow-y: auto; }
  .m-check summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; align-items: center; column-gap: 12px; row-gap: 6px; padding: 10px 14px; }
  .m-check summary::-webkit-details-marker { display: none; }
  .m-check summary small { font-size: 11px; font-weight: 800; letter-spacing: .06em; color: var(--sub); }
  .m-check summary b { grid-row: 1 / span 2; grid-column: 2; font-size: 13px; }
  .m-bar { grid-column: 1; height: 5px; border-radius: 999px; background: var(--line); overflow: hidden; }
  .m-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #b07cf0); }
  .m-bar .w0 { width: 0; } .m-bar .w1 { width: 16.7%; } .m-bar .w2 { width: 33.3%; } .m-bar .w3 { width: 50%; } .m-bar .w4 { width: 66.7%; } .m-bar .w5 { width: 83.3%; } .m-bar .w6 { width: 100%; }
  .m-check-body { padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
  .m-check-body .primary { width: 100%; white-space: normal; }
  .messages { padding-top: 76px; }
  .reel-entry { display: flex; align-items: center; gap: 12px; margin: 0 14px 8px; padding: 10px 12px; border: 0; border-radius: 18px; text-align: left; color: var(--ink); background: linear-gradient(120deg, #ffe6dd, #e9e1fc); box-shadow: var(--shadow); }
  .reel-entry .stack { display: flex; flex: none; }
  .reel-entry .stack i { width: 26px; height: 44px; border-radius: 8px; border: 2px solid #fff; }
  .reel-entry .stack i + i { margin-left: -12px; }
  .reel-entry .stack .tone-sunset { background: linear-gradient(165deg, #f7b267, #d9486b); } .reel-entry .stack .tone-sea { background: linear-gradient(165deg, #56b4d3, #145da0); } .reel-entry .stack .tone-forest { background: linear-gradient(165deg, #7fb77e, #1f4e3d); }
  .reel-entry .stack .tone-dusk { background: linear-gradient(165deg, #7c7fc2, #2b2d42); } .reel-entry .stack .tone-sakura { background: linear-gradient(165deg, #f6bdc0, #9d6b7f); } .reel-entry .stack .tone-stone { background: linear-gradient(165deg, #a3b1c2, #3d4552); }
  .reel-entry > span:nth-child(2) { display: flex; flex-direction: column; flex: 1; min-width: 0; }
  .reel-entry strong { font-size: 14px; }
  .reel-entry small { font-size: 12px; color: var(--sub); }
  .reel-entry em { font-style: normal; font-weight: 800; font-size: 13px; color: #fff; background: var(--accent); border-radius: 999px; padding: 6px 14px; }
  .quick { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 4px 14px 10px; }
  .quick .chip { flex: none; }
  .top-actions .ghost { padding: 5px 10px; font-size: 12px; }
  .workspace[data-mobile="chat"] .panel, .workspace:not([data-mobile="chat"]) .chat { display: none; }
  .chat { border-right: 0; }
  .feed-head { padding: 8px 12px; }
  /* Reels-style vertical swipe: one post per screen. */
  .reels { grid-template-columns: 1fr; gap: 14px; padding: 0 12px 16px; scroll-snap-type: y mandatory; overscroll-behavior-y: contain; }
  .reel { scroll-snap-align: start; scroll-snap-stop: always; }
  .reel-media { aspect-ratio: auto; height: calc(100dvh - 52px - 56px - 64px - 74px); min-height: 360px; }
  .reel.add { aspect-ratio: auto; height: 240px; }
  .tray { padding: 10px 12px; }
  .tray .primary { padding: 10px 16px; }
  .trip-page { padding: 0 14px 96px; }
  /* plan → book → booklet: a compact bar that stays on top while scrolling the plan */
  .trip-page .steps { position: sticky; top: 0; z-index: 2; margin: 0 -14px 12px; padding: 8px 14px; gap: 6px; background: rgb(250 247 255 / .88); backdrop-filter: blur(12px); }
  .trip-page .step { flex-direction: row; text-align: left; gap: 6px; padding: 6px 8px; border-radius: 12px; }
  .trip-page .step > span:last-child { align-items: flex-start; }
  .trip-page .step-icon { width: 24px; height: 24px; }
  .trip-page .step-icon .ico { width: 14px; height: 14px; }
  .trip-page .step strong { font-size: 12px; }
  .trip-page .step small { font-size: 10px; }
  .m-check .steps { flex-direction: column; align-items: stretch; margin: 0; }
  .m-check .steps > i { display: block; width: 2px; height: 10px; flex: none; margin-left: 24px; }
  .m-check .step { flex-direction: row; text-align: left; padding: 10px 12px; }
  .m-check .step > span:last-child { align-items: flex-start; }
  .m-check .step::after { content: "開く"; margin-left: auto; font-size: 12px; font-weight: 800; color: var(--accent); }
  .m-check.prep .m-bar i { background: linear-gradient(90deg, var(--ok), #6cc4a8); }
  .m-entries { display: flex; gap: 8px; margin: 0 14px 8px; }
  .m-entries .reel-entry { margin: 0; flex: 1; min-width: 0; }
  .plan-entry { background: linear-gradient(120deg, #ffe3d6, #ffd0d6 55%, #fbe7c6); }
  .plan-entry strong, .plan-entry small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .plan-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--card); color: var(--accent); flex: none; }
  .reel-mini { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 64px; flex: none; border: 0; border-radius: 18px; background: linear-gradient(120deg, #ffe6dd, #e9e1fc); box-shadow: var(--shadow); color: var(--ink); }
  .reel-mini .stack { display: flex; }
  .reel-mini .stack i { width: 16px; height: 28px; border-radius: 5px; border: 2px solid #fff; }
  .reel-mini .stack i + i { margin-left: -8px; }
  .reel-mini small { font-size: 11px; font-weight: 700; }
  .reel-mini .tone-sunset { background: linear-gradient(165deg, #f7b267, #d9486b); } .reel-mini .tone-sea { background: linear-gradient(165deg, #56b4d3, #145da0); } .reel-mini .tone-forest { background: linear-gradient(165deg, #7fb77e, #1f4e3d); }
  .reel-mini .tone-dusk { background: linear-gradient(165deg, #7c7fc2, #2b2d42); } .reel-mini .tone-sakura { background: linear-gradient(165deg, #f6bdc0, #9d6b7f); } .reel-mini .tone-stone { background: linear-gradient(165deg, #a3b1c2, #3d4552); }
  .stop { grid-template-columns: 44px 40px 1fr; gap: 10px; }
  .dot { width: 40px; height: 40px; }
  .move { margin-left: 74px; }
  .card { padding: 14px; }
  /* thumb-sized targets for the per-stop actions */
  .stop-actions { gap: 0 12px; }
  .stop-actions .drop { margin-left: 0; }
  .stop-actions .maplink, .from-reel, .drop { padding: 8px 0; }
  .booked-btn { padding: 8px 16px; font-size: 13px; }
  .mark-btn { width: 30px; height: 30px; }
  .tray { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .fineprint { margin-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .page-bar .bar-actions { margin-left: auto; }
  .shiori-page .page-bar > .text-btn:not(.m-back) { display: none; } /* the step bar leads back to the plan */
  .page-bar .bar-actions .ghost { display: inline-flex; padding: 5px 10px; font-size: 12px; }
  .steps > i { display: none; }
  .step { flex-direction: column; text-align: center; gap: 4px; padding: 8px 4px; }
  .step > span:last-child { align-items: center; }
  .shiori { padding: 18px 16px; }
  .shiori-day ol { padding-left: 0; }
  .s-stay { margin-left: 0; }
  .shiori-day .s-move { padding-left: 62px; }
  .overview h2 { font-size: 22px; }
  .book-bar { padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
  .hero { margin-top: 6vh; }
  .ask-row .muted { display: none; }
  .ask-row { justify-content: flex-end; }
}
