@font-face { font-family: "Zen Kaku"; src: url(/fonts/zen-kaku-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Zen Kaku"; src: url(/fonts/zen-kaku-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Zen Kaku"; src: url(/fonts/zen-kaku-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "DM Serif"; src: url(/fonts/dm-serif-display.woff2) format("woff2"); font-weight: 400; font-display: swap; }

/* ---------- デザイン案（A：リビエラ / B：サンセット / C：誌面モノクロ） ---------- */
:root, [data-theme="a"] {
  --bg: #ffffff; --surface: #ffffff; --surface-2: #f3f6fb; --line: #e3e8f0;
  --ink: #0f1b2d; --ink-2: #5a6578; --accent: #1f4fd8; --accent-ink: #ffffff; --accent-soft: #e7edfc;
  --heart: #e5484d; --heart-soft: #fde8e8; --chip: #ffffff; --chip-on: #0f1b2d; --chip-on-ink: #ffffff;
  --display: "DM Serif", "Zen Kaku", serif; --display-weight: 400; --kicker-spacing: .14em;
  --radius: 18px; --radius-sm: 12px; --shadow: 0 10px 30px rgb(15 27 45 / .12), 0 2px 6px rgb(15 27 45 / .06);
  --day-coral: #f2614a; --day-cobalt: #2f5bea; --day-sun: #e6a400; --day-violet: #7b5cf0; --day-rose: #d6408f; --day-sky: #1e9bd7;
}
[data-theme="b"] {
  --bg: #fffaf4; --surface: #ffffff; --surface-2: #fff1e6; --line: #f1e1d3;
  --ink: #2a1c18; --ink-2: #7a6259; --accent: #ef5a43; --accent-ink: #ffffff; --accent-soft: #fde4dc;
  --heart: #e0335e; --heart-soft: #fde3ea; --chip: #ffffff; --chip-on: #2a1c18; --chip-on-ink: #fffaf4;
  --display: "DM Serif", "Zen Kaku", serif; --display-weight: 400; --kicker-spacing: .12em;
  --radius: 24px; --radius-sm: 16px; --shadow: 0 12px 34px rgb(122 60 40 / .14), 0 2px 6px rgb(122 60 40 / .06);
  --day-coral: #ef5a43; --day-cobalt: #3557d6; --day-sun: #e8a317; --day-violet: #8a5ad8; --day-rose: #d94a8c; --day-sky: #2c95c9;
}
[data-theme="c"] {
  --bg: #ffffff; --surface: #ffffff; --surface-2: #f4f4f2; --line: #e6e6e3;
  --ink: #111111; --ink-2: #66665f; --accent: #111111; --accent-ink: #ffffff; --accent-soft: #fff3c2;
  --heart: #111111; --heart-soft: #ffe47a; --chip: #ffffff; --chip-on: #ffd23f; --chip-on-ink: #111111;
  --display: "Zen Kaku", sans-serif; --display-weight: 700; --kicker-spacing: .22em;
  --radius: 6px; --radius-sm: 4px; --shadow: 0 0 0 1px #111111, 0 8px 0 -4px rgb(0 0 0 / .08);
  --day-coral: #ff5a3c; --day-cobalt: #2244dd; --day-sun: #f2b705; --day-violet: #6c47e8; --day-rose: #e0337f; --day-sky: #1688c9;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
body {
  font-family: "Zen Kaku", -apple-system, BlinkMacSystemFont, "Hiragino Sans", sans-serif;
  font-size: 17px; line-height: 1.5; letter-spacing: .01em; -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.i { width: 24px; height: 24px; flex: none; display: block; }

.app { position: fixed; inset: 0; height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }

/* ---------- 上部 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; background: var(--bg); z-index: 5;
  border-bottom: 1px solid transparent;
}
.trip-button { display: grid; text-align: left; min-height: 48px; min-width: 0; }
.trip-kicker { font-size: 11px; letter-spacing: var(--kicker-spacing); text-transform: uppercase; color: var(--ink-2); font-weight: 500; }
.trip-name {
  font-family: var(--display); font-weight: var(--display-weight); font-size: 26px; line-height: 1.15;
  display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.trip-name .i { width: 18px; height: 18px; color: var(--ink-2); }
.topbar-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.icon-button { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); }
.icon-button:active { background: var(--surface-2); }
.me-button { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 4px 0 0; border-radius: 999px; font-size: 14px; color: var(--ink-2); }

/* ---------- アバター ---------- */
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  font-size: 13px; font-weight: 700; color: #fff; border: 2px solid var(--surface);
}
.avatar[data-tone="coral"] { background: var(--day-coral); }
.avatar[data-tone="cobalt"] { background: var(--day-cobalt); }
.avatar[data-tone="violet"] { background: var(--day-violet); }
.avatar[data-tone="sun"] { background: var(--day-sun); color: #2a1c00; }
.avatars { display: inline-flex; align-items: center; }
.avatars .avatar + .avatar { margin-left: -9px; }
.avatars.small .avatar { width: 26px; height: 26px; font-size: 11px; }

/* ---------- 画面 ---------- */
.views { position: relative; overflow: hidden; }
.view { position: absolute; inset: 0; }
.view-likes, .view-plan { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 4px 16px 40px; }

/* ---------- 下部タブ ---------- */
.tabbar {
  display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface);
  border-top: 1px solid var(--line); padding: 6px 8px calc(env(safe-area-inset-bottom) + 6px); z-index: 5;
}
.tabbar button { display: grid; justify-items: center; gap: 2px; min-height: 56px; font-size: 13px; font-weight: 500; color: var(--ink-2); border-radius: 14px; }
.tabbar button[aria-current="page"] { color: var(--accent); }
[data-theme="c"] .tabbar button[aria-current="page"] { color: var(--ink); }
[data-theme="c"] .tabbar button[aria-current="page"] .tab-icon { background: var(--chip-on); border-radius: 999px; }
.tab-icon { display: grid; place-items: center; width: 56px; height: 30px; }
.tabbar button { position: relative; }
.tab-badge {
  position: absolute; top: 2px; left: calc(50% + 8px); min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--heart); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--surface);
}
[data-theme="c"] .tab-badge { background: #111; }

/* ---------- 地図と検索 ---------- */
.map-host { position: absolute; inset: 0; }
.map { position: absolute; inset: 0; background: var(--surface-2); }
.maplibregl-ctrl-attrib { font-size: 10px; }
.searchbar {
  position: absolute; top: 10px; left: 12px; right: 12px; z-index: 3; display: flex; align-items: center; gap: 8px;
  background: var(--surface); border-radius: 999px; box-shadow: var(--shadow); padding: 0 6px 0 16px; height: 54px;
}
[data-theme="c"] .searchbar { border-radius: var(--radius-sm); }
.searchbar-icon { color: var(--ink-2); }
.searchbar input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 17px; height: 100%; }
.searchbar input::-webkit-search-cancel-button { display: none; }
.searchbar-clear { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); }
.chips {
  position: absolute; top: 72px; left: 0; right: 0; z-index: 3; display: flex; gap: 8px; overflow-x: auto;
  padding: 0 12px 8px; scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 44px; padding: 0 16px 0 12px;
  border-radius: 999px; background: var(--chip); box-shadow: 0 2px 10px rgb(0 0 0 / .1); font-size: 15px; font-weight: 500;
}
[data-theme="c"] .chip { border-radius: var(--radius-sm); box-shadow: 0 0 0 1px var(--ink); }
.chip .i { width: 20px; height: 20px; }
.chip[aria-pressed="true"] { background: var(--chip-on); color: var(--chip-on-ink); }
.area-button {
  position: absolute; top: 128px; left: 50%; transform: translateX(-50%); z-index: 3; min-height: 44px; padding: 0 18px;
  background: var(--ink); color: var(--bg); border-radius: 999px; font-size: 15px; font-weight: 500; box-shadow: var(--shadow);
}

/* 地図上のマーカー */
.marker {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: #fff;
  background: var(--accent); border: 3px solid #fff; box-shadow: 0 3px 10px rgb(0 0 0 / .25);
}
.marker .i { width: 20px; height: 20px; }
.marker.liked { background: var(--heart); }
[data-theme="c"] .marker.liked { background: #111; }
.marker.result { background: #fff; color: var(--ink); border-color: var(--ink); width: 34px; height: 34px; }
.marker.result .i { width: 17px; height: 17px; }
.marker.selected { transform: scale(1.25); z-index: 2; }
.marker .count {
  position: absolute; top: -8px; right: -10px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: #fff; color: var(--ink); font-size: 12px; font-weight: 700; display: grid; place-items: center;
  box-shadow: 0 1px 4px rgb(0 0 0 / .25);
}
.marker.marker-stop { width: 36px; height: 36px; font-weight: 700; font-size: 16px; }

/* ---------- 下から出るシート ---------- */
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; background: var(--surface);
  border-radius: 22px 22px 0 0; box-shadow: 0 -8px 30px rgb(0 0 0 / .12); display: flex; flex-direction: column;
  transition: height .28s cubic-bezier(.2, .8, .2, 1); height: 34%;
}
[data-theme="c"] .sheet { border-radius: 0; box-shadow: 0 -1px 0 #111; }
.sheet[data-size="mini"] { height: 104px; }
.sheet[data-size="peek"] { height: 38%; }
.sheet[data-size="half"] { height: 60%; }
.sheet[data-size="full"] { height: calc(100% - 64px); }
.sheet-grip { display: grid; place-items: center; height: 26px; flex: none; }
.sheet-grip span { width: 40px; height: 5px; border-radius: 3px; background: var(--line); }
.sheet-body { overflow-y: auto; padding: 0 16px 20px; flex: 1; -webkit-overflow-scrolling: touch; }

.sheet-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 2px 0 10px; }
.sheet-title h2 { margin: 0; font-size: 19px; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }

/* 一覧の行 */
.row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 0; min-height: 64px;
  border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
.row-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.row-title { font-weight: 700; font-size: 17px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.row-sub { font-size: 14px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex: none;
  background: var(--accent-soft); color: var(--accent);
}
[data-theme="c"] .thumb { border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink); }
.thumb[data-cat="eat"] { background: #fff0e8; color: #d0461f; }
.thumb[data-cat="cafe"] { background: #fdebf2; color: #b8336a; }
.thumb[data-cat="see"] { background: #eceffa; color: #3d4f8c; }
.thumb[data-cat="shop"] { background: #fff5d6; color: #9a6a00; }
[data-theme="c"] .thumb[data-cat] { background: var(--surface-2); color: var(--ink); }

/* 行きたいボタン（1タップ） */
.like {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 52px; min-height: 48px;
  padding: 0 12px; border-radius: 999px; color: var(--ink-2); font-weight: 700; font-size: 15px; flex: none;
}
.like[aria-pressed="true"] { color: var(--heart); background: var(--heart-soft); }
[data-theme="c"] .like[aria-pressed="true"] { color: #111; }
.like.pop .i { animation: pop .35s ease; }
@keyframes pop { 40% { transform: scale(1.35); } }

/* 場所カード */
.place-head { display: flex; gap: 14px; align-items: flex-start; margin-top: 4px; }
.place-head .thumb { width: 56px; height: 56px; border-radius: 16px; }
.place-name { font-family: var(--display); font-weight: var(--display-weight); font-size: 25px; line-height: 1.2; margin: 0; }
[data-theme="c"] .place-name { font-size: 23px; }
.place-local { margin: 4px 0 0; color: var(--ink-2); font-size: 15px; }
.who { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; min-height: 32px; font-size: 15px; }
.actions-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 8px; }
.big-action {
  display: grid; justify-items: center; gap: 6px; padding: 14px 6px 12px; border-radius: var(--radius);
  background: var(--surface-2); font-size: 15px; font-weight: 700; min-height: 84px;
}
.big-action .i { width: 28px; height: 28px; }
.big-action.primary { background: var(--accent); color: var(--accent-ink); }
.big-action[aria-pressed="true"] { background: var(--heart-soft); color: var(--heart); }
[data-theme="c"] .big-action { border: 1.5px solid #111; background: #fff; }
[data-theme="c"] .big-action.primary { background: #111; color: #fff; }
[data-theme="c"] .big-action[aria-pressed="true"] { background: var(--chip-on); color: #111; }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.link-button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); font-size: 14px; color: var(--ink); text-decoration: none; background: var(--surface);
}
.link-button .i { width: 18px; height: 18px; }

/* 相談 */
.notes { display: grid; gap: 8px; margin: 12px 0; }
.note { display: flex; gap: 8px; align-items: flex-start; }
.note-bubble { background: var(--surface-2); border-radius: 4px 16px 16px 16px; padding: 7px 12px; font-size: 15px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.quick button {
  min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 15px;
}
.note-form { display: flex; gap: 8px; margin-top: 6px; }
.note-form input { flex: 1; min-width: 0; min-height: 48px; border: 1px solid var(--line); border-radius: 999px; padding: 0 16px; background: var(--surface); font-size: 16px; }
.send { min-height: 48px; padding: 0 18px; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 700; }

/* 日を選ぶ大きなボタン */
.day-pick { display: grid; gap: 10px; margin: 8px 0; }
.day-option {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--surface-2); text-align: left; width: 100%;
}
.day-option .day-dot { width: 14px; height: 40px; border-radius: 7px; flex: none; }
.day-option strong { display: block; font-size: 17px; }
.day-option .meta { font-size: 13px; color: var(--ink-2); }
.day-option.new { background: none; border: 1.5px dashed var(--line); justify-content: center; font-weight: 700; color: var(--accent); }
[data-theme="c"] .day-option.new { color: var(--ink); border-color: var(--ink); }

.day-dot[data-color="coral"], .day-bar[data-color="coral"] { background: var(--day-coral); }
.day-dot[data-color="cobalt"], .day-bar[data-color="cobalt"] { background: var(--day-cobalt); }
.day-dot[data-color="sun"], .day-bar[data-color="sun"] { background: var(--day-sun); }
.day-dot[data-color="violet"], .day-bar[data-color="violet"] { background: var(--day-violet); }
.day-dot[data-color="rose"], .day-bar[data-color="rose"] { background: var(--day-rose); }
.day-dot[data-color="sky"], .day-bar[data-color="sky"] { background: var(--day-sky); }

/* ---------- 行きたい画面・よてい画面の共通見出し ---------- */
.page-head { padding: 8px 0 6px; }
.page-kicker { font-size: 11px; letter-spacing: var(--kicker-spacing); text-transform: uppercase; color: var(--ink-2); font-weight: 500; }
.page-title { font-family: var(--display); font-weight: var(--display-weight); font-size: 32px; line-height: 1.15; margin: 2px 0 0; }
.page-lead { color: var(--ink-2); font-size: 15px; margin: 6px 0 0; }
.filter { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 6px; scrollbar-width: none; }
.filter .chip { box-shadow: none; border: 1px solid var(--line); }
[data-theme="c"] .filter .chip { box-shadow: 0 0 0 1px var(--ink); border: 0; }

.card {
  background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); padding: 14px 14px 12px; margin: 12px 0;
}
[data-theme="c"] .card { border: 1.5px solid #111; }
.card.top { border: 0; background: linear-gradient(160deg, var(--accent-soft), var(--surface)); }
[data-theme="c"] .card.top { background: var(--accent-soft); border: 1.5px solid #111; }
.rank { font-family: var(--display); font-size: 15px; color: var(--ink-2); width: 22px; text-align: center; flex: none; }
.card-row { display: flex; align-items: center; gap: 12px; }
.card-row .open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-align: left; min-height: 56px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.last-note { font-size: 14px; color: var(--ink-2); display: flex; gap: 6px; align-items: center; min-width: 0; }
.last-note span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 15px;
}
[data-theme="c"] .pill { background: #111; color: #fff; border-radius: var(--radius-sm); }
.pill.in { background: var(--surface-2); color: var(--ink-2); }
.pill .i { width: 20px; height: 20px; }
.empty { text-align: center; padding: 36px 12px; color: var(--ink-2); }
.empty .i { width: 40px; height: 40px; margin: 0 auto 8px; }

/* ---------- よてい ---------- */
.plan-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 4px; scrollbar-width: none; }
.plan-tab {
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); font-weight: 700; flex: none; background: var(--surface);
}
.plan-tab[aria-current="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
[data-theme="c"] .plan-tab { border-radius: var(--radius-sm); border-color: #111; }
[data-theme="c"] .plan-tab[aria-current="true"] { background: var(--chip-on); color: #111; }
.plan-tab.add { color: var(--ink-2); border-style: dashed; display: inline-flex; align-items: center; gap: 4px; }
.dates {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left;
  min-height: 60px; padding: 10px 14px; margin: 10px 0 4px; border-radius: var(--radius-sm); background: var(--surface-2);
}
.dates strong { display: block; font-size: 16px; }
.dates .small { display: block; }
.section-label { font-size: 13px; font-weight: 700; color: var(--ink-2); letter-spacing: .06em; margin: 22px 0 6px; display: flex; justify-content: space-between; align-items: center; }

.day-card {
  display: flex; align-items: stretch; gap: 0; width: 100%; text-align: left; background: var(--surface);
  border-radius: var(--radius); border: 1px solid var(--line); margin: 10px 0; overflow: hidden; min-height: 92px;
}
[data-theme="c"] .day-card { border: 1.5px solid #111; }
.day-card .day-bar { width: 8px; flex: none; }
.day-card .day-content { flex: 1; padding: 12px 14px; min-width: 0; display: grid; gap: 4px; }
.day-number { font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--ink-2); text-transform: uppercase; }
.day-title { font-family: var(--display); font-weight: var(--display-weight); font-size: 22px; line-height: 1.2; }
[data-theme="c"] .day-title { font-size: 20px; }
.day-stops { font-size: 14px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-card .chev { display: grid; place-items: center; padding: 0 12px; color: var(--ink-2); }
.warn { color: #b4232c; font-size: 13px; font-weight: 700; }
.add-day {
  width: 100%; min-height: 60px; border-radius: var(--radius); border: 1.5px dashed var(--line); color: var(--accent);
  font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; margin: 10px 0;
}
[data-theme="c"] .add-day { color: #111; border-color: #111; }

.stops { list-style: none; margin: 8px 0 0; padding: 0; position: relative; }
.stop {
  display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 8px 4px 8px 10px; margin: 0 0 10px; min-height: 72px; position: relative;
  touch-action: pan-y; transition: transform .15s ease, box-shadow .15s ease;
}
[data-theme="c"] .stop { border: 1.5px solid #111; }
.stop-wrap { position: relative; }
.stops.sorting .stop-wrap { transition: transform .2s cubic-bezier(.2, .8, .2, 1); }
.stops.sorting .stop-wrap.dragging { transition: none; z-index: 5; }
.stops.sorting .stop-wrap.dragging.settling { transition: transform .17s ease-out; }
.stop-wrap.dragging .stop { box-shadow: var(--shadow); transform: scale(1.02); border-color: transparent; }
.stops.sorting .leg { opacity: 0; transition: opacity .12s; }
.handle, .day-handle { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.stop-number {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; flex: none;
}
.stop-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.stop-name { font-weight: 700; line-height: 1.3; }
.time-button {
  justify-self: start; display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 10px; border-radius: 999px;
  background: var(--surface-2); font-size: 14px; color: var(--ink-2); position: relative; overflow: hidden;
}
.time-button .i { width: 16px; height: 16px; }
.time-button input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; }
.time-button.set { color: var(--ink); font-weight: 700; }
.handle { width: 44px; height: 56px; display: grid; place-items: center; color: var(--ink-2); touch-action: none; cursor: grab; flex: none; }
.remove { width: 40px; height: 48px; display: grid; place-items: center; color: var(--ink-2); flex: none; }
.remove .i { width: 20px; height: 20px; }
.leg { font-size: 13px; color: var(--ink-2); margin: -4px 0 10px 54px; display: flex; align-items: center; gap: 6px; }
.leg .i { width: 16px; height: 16px; }
.add-stop {
  width: 100%; min-height: 60px; border-radius: var(--radius-sm); background: var(--accent); color: var(--accent-ink);
  font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 6px;
}

/* ---------- パネル（下から開く画面） ---------- */
.panel {
  margin: auto 0 0; width: 100%; max-width: 100%; max-height: 88dvh; border: 0; padding: 0;
  border-radius: 22px 22px 0 0; background: var(--surface); color: var(--ink); box-shadow: 0 -10px 40px rgb(0 0 0 / .2);
}
[data-theme="c"] .panel { border-radius: 0; border-top: 2px solid #111; }
.panel::backdrop { background: rgb(10 15 25 / .4); }
.panel[open] { animation: rise .26s cubic-bezier(.2, .8, .2, 1); }
@keyframes rise { from { transform: translateY(40px); opacity: .4; } }
.panel-inner { padding: 8px 16px calc(env(safe-area-inset-bottom) + 20px); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 8px; }
.panel-head h2 { margin: 0; font-size: 21px; }
.choice {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; text-align: left; padding: 8px 4px;
  border-bottom: 1px solid var(--line); font-size: 17px;
}
.choice:last-child { border-bottom: 0; }
.choice[aria-current="true"] { font-weight: 700; color: var(--accent); }
[data-theme="c"] .choice[aria-current="true"] { color: #111; background: var(--accent-soft); }
.choice .grow { flex: 1; min-width: 0; }
.choice .check { color: var(--accent); }
.field { display: grid; gap: 6px; margin: 12px 0; font-weight: 700; font-size: 15px; }
.field input {
  min-height: 52px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 14px; font-size: 17px; font-weight: 400;
  background: var(--surface); width: 100%;
}
.button-row { display: flex; gap: 10px; margin-top: 16px; }
.button {
  flex: 1; min-height: 54px; border-radius: 999px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--surface-2);
}
.button.primary { background: var(--accent); color: var(--accent-ink); }
[data-theme="c"] .button { border-radius: var(--radius-sm); border: 1.5px solid #111; background: #fff; }
[data-theme="c"] .button.primary { background: #111; color: #fff; }
.button:disabled { opacity: .45; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.suggest button { min-height: 44px; padding: 0 14px; border-radius: 999px; background: var(--surface-2); font-size: 15px; }
.slot-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; }
.slot {
  min-height: 64px; border-radius: var(--radius-sm); background: var(--surface-2); display: grid; place-items: center; align-content: center;
  font-weight: 700; line-height: 1.2; padding: 4px;
}
.slot small { font-weight: 400; font-size: 12px; color: var(--ink-2); }
.slot[aria-current="true"] { background: var(--accent); color: var(--accent-ink); }
.slot[aria-current="true"] small { color: inherit; opacity: .85; }
.slot.taken::after { content: "使用中"; font-size: 10px; font-weight: 500; color: var(--ink-2); }
.theme-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 14px; }
.theme-card { border-radius: 14px; border: 2px solid var(--line); padding: 10px 6px; display: grid; gap: 6px; justify-items: center; font-size: 13px; font-weight: 700; }
.theme-card[aria-pressed="true"] { border-color: var(--ink); }
.swatch { display: flex; gap: 3px; }
.swatch i { width: 14px; height: 14px; border-radius: 50%; display: block; border: 1px solid rgb(0 0 0 / .1); }
.checklist label { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.checklist input { width: 24px; height: 24px; flex: none; margin-top: 1px; accent-color: var(--accent); }
textarea.feedback { width: 100%; min-height: 110px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 16px; background: var(--surface); }

/* ---------- 通知 ---------- */
.toast {
  flex-wrap: wrap;
  position: fixed; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 84px); z-index: 20;
  background: var(--ink); color: var(--bg); border-radius: 16px; padding: 10px 10px 10px 16px; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; box-shadow: var(--shadow); font-size: 15px; animation: rise .22s ease;
}
.toast button { white-space: nowrap; flex: none; min-height: 44px; padding: 0 14px; border-radius: 999px; color: var(--bg); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; border: 1px solid rgb(255 255 255 / .35); }
.toast button .i { width: 18px; height: 18px; }

@media (min-width: 760px) {
  .app { max-width: 520px; margin: 0 auto; box-shadow: 0 0 0 1px var(--line); }
  .panel { max-width: 520px; margin: auto auto 0; }
  .toast { max-width: 496px; margin: 0 auto; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- 日の詳細（独立した画面。見出しは固定、地図と一覧だけがスクロールする） ---------- */
.view-day { display: flex; flex-direction: column; background: var(--bg); z-index: 2; }
.day-head { flex: none; display: flex; align-items: center; gap: 4px; padding: 4px 8px 8px 4px; border-bottom: 1px solid var(--line); background: var(--bg); }
.day-head .grow { flex: 1; min-width: 0; }
.day-head .title-button { text-align: left; display: grid; min-height: 48px; width: 100%; }
.day-head .day-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.day-map { position: relative; height: 210px; }
.day-body { padding: 8px 16px 40px; }
.day-tools { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 0 4px; }
.day-empty { display: flex; align-items: center; gap: 12px; padding: 14px; margin: 12px 0 8px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink-2); font-size: 15px; }
.day-empty .i { color: var(--accent); }

/* ---------- 経路の目安 ---------- */
.leg { flex-wrap: nowrap; white-space: nowrap; min-height: 36px; margin-top: -8px; margin-bottom: 4px; }
.leg button { color: var(--accent); font-weight: 700; font-size: 13px; min-height: 36px; padding: 0 10px; margin-left: auto; display: inline-flex; align-items: center; gap: 4px; }
[data-theme="c"] .leg button { color: #111; text-decoration: underline; }
.route-links { display: grid; gap: 10px; margin: 12px 0; }
.route-links a { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 0 16px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink); text-decoration: none; font-weight: 700; }

/* ---------- 候補の状態・紹介メモ・コメント ---------- */
.saved-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 3px 10px 3px 6px; }
.saved-chip .i { width: 16px; height: 16px; }
[data-theme="c"] .saved-chip { color: #111; }
.state-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 0; }
.text-button { color: var(--ink-2); font-size: 13px; text-decoration: underline; min-height: 36px; padding: 0 4px; }
.block { margin: 18px 0 0; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.block-head h3 { margin: 0; font-size: 16px; }
.memo { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 15px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.memo.empty-memo { color: var(--ink-2); }
.memo-meta { font-size: 12px; color: var(--ink-2); margin-top: 4px; }
textarea.memo-input { width: 100%; min-height: 220px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; font-size: 16px; line-height: 1.6; background: var(--surface); }
.comments { display: grid; gap: 10px; }
.comment { display: flex; gap: 8px; align-items: flex-start; }
.comment.mine { flex-direction: row-reverse; }
.comment-body { display: grid; gap: 2px; max-width: 80%; }
.comment.mine .comment-body { justify-items: end; }
.comment-meta { font-size: 12px; color: var(--ink-2); }
.bubble { background: var(--surface-2); border-radius: 4px 16px 16px 16px; padding: 8px 12px; font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment.mine .bubble { background: var(--accent-soft); border-radius: 16px 4px 16px 16px; }
.comment-form { display: flex; gap: 8px; margin-top: 10px; }
.comment-form input { flex: 1; min-width: 0; min-height: 48px; border: 1px solid var(--line); border-radius: 999px; padding: 0 16px; background: var(--surface); font-size: 16px; }
.hint { font-size: 12px; color: var(--ink-2); margin: 6px 0 0; }
.new-dot { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--heart); }
.new-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
[data-theme="c"] .new-dot { color: #111; }
.memo-snippet { font-size: 14px; color: var(--ink-2); margin: 8px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.save-button { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 12px; border-radius: 999px; font-size: 14px; font-weight: 700; color: var(--accent); background: var(--accent-soft); flex: none; }
[data-theme="c"] .save-button { color: #111; background: var(--chip-on); }
.save-button .i { width: 18px; height: 18px; }

/* ---------- 日程（日のカードのドラッグ） ---------- */
.slot-row { margin: 12px 0; }
.slot-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--ink-2); margin: 0 0 4px 4px; }
.slot-row .day-card { margin: 0; }
.drop-empty {
  width: 100%; min-height: 64px; border: 1.5px dashed var(--line); border-radius: var(--radius); display: flex; align-items: center;
  justify-content: center; gap: 6px; color: var(--ink-2); font-size: 15px; background: none;
}
.drop-empty .i { width: 20px; height: 20px; }
.reserve { display: grid; gap: 10px; min-height: 64px; border-radius: var(--radius); padding: 2px 0; }
.reserve .day-card { margin: 0; }
.drop-over { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: var(--radius); background: var(--accent-soft); }
.day-card { position: relative; }
.day-card .day-open { flex: 1; display: flex; align-items: stretch; text-align: left; min-width: 0; }
.day-handle { width: 48px; display: grid; place-items: center; color: var(--ink-2); touch-action: none; cursor: grab; flex: none; border-left: 1px solid var(--line); }
.day-card.lifted { opacity: .35; }
.ghost { position: fixed; z-index: 40; pointer-events: none; box-shadow: var(--shadow); transform: rotate(-1.2deg) scale(1.02); opacity: .96; margin: 0; }
.drag-hint { font-size: 13px; color: var(--ink-2); margin: 4px 0 0; display: flex; align-items: center; gap: 6px; }
.drag-hint .i { width: 18px; height: 18px; }

/* ---------- 候補の追加・場所の情報 ---------- */
.add-entry { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 14px; margin: 12px 0 4px;
  border-radius: var(--radius-sm); border: 1.5px dashed var(--line); text-align: left; color: var(--ink); background: var(--surface); }
.add-entry > .i { color: var(--accent); }
.add-entry strong { display: block; font-size: 16px; }
.add-entry .meta, .add-option .meta { display: block; font-size: 13px; color: var(--ink-2); }
[data-theme="c"] .add-entry { border-color: #111; }
.add-options { display: grid; gap: 10px; margin-top: 8px; }
.add-option { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 72px; padding: 10px 14px; text-align: left;
  border-radius: var(--radius-sm); background: var(--surface-2); }
.add-option strong { display: block; font-size: 17px; }
.add-option-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
[data-theme="c"] .add-option-icon { background: var(--chip-on); color: #111; }
.warn-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: #9a3412; background: #ffedd5;
  border-radius: 999px; padding: 3px 10px 3px 8px; min-height: 26px; }
.warn-chip .i { width: 14px; height: 14px; }
button.warn-chip { min-height: 36px; }
.status-chip { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 10px; }
.status-chip.open { color: #1d4ed8; background: #dbeafe; }
.status-chip.closed { color: #991b1b; background: #fee2e2; }
.chips-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.info { display: grid; grid-template-columns: 4.5em 1fr; gap: 6px 10px; margin: 6px 0 0; font-size: 15px; }
.info dt { color: var(--ink-2); font-size: 13px; padding-top: 2px; }
.info dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; overflow-wrap: anywhere; }
.sources { display: grid; gap: 6px; }
.source { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; align-items: center; padding: 8px 10px; border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--ink); text-decoration: none; font-size: 14px; }
.source .i { width: 16px; height: 16px; grid-row: span 2; color: var(--ink-2); }
.source-kind { font-weight: 700; }
.source-url { grid-column: 2; color: var(--ink-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.source-meta { grid-column: 2; color: var(--ink-2); font-size: 11px; }
.ok-note, .warn-note { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; border-radius: var(--radius-sm); padding: 10px 12px; margin: 8px 0; }
.ok-note { background: #e0f2fe; color: #075985; }
.warn-note { background: #fff7ed; color: #9a3412; }
.ok-note .i, .warn-note .i { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.dup { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.dup-reasons { font-size: 12px; font-weight: 700; color: #9a3412; }
.suggest button.on { background: var(--ink); color: var(--bg); }
[data-theme="c"] .suggest button.on { background: var(--chip-on); color: #111; }
.sheet[data-size="pin"] { height: 190px; }
.crosshair { position: absolute; left: 50%; top: calc(50% - 95px); width: 0; height: 0; z-index: 2; pointer-events: none; }
.crosshair span { position: absolute; left: -20px; top: -40px; width: 40px; height: 40px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--accent); border: 3px solid #fff; box-shadow: 0 4px 12px rgb(0 0 0 / .3); }
.crosshair::after { content: ""; position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%; background: rgb(0 0 0 / .35); }

/* ---------- クラウド保存 ---------- */
.login { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 420px; }
.login-brand { font-family: "DM Serif", serif; font-size: 44px; margin-bottom: 8px; }
.me-button[data-state] { font-size: 13px; font-weight: 700; padding: 0 12px; gap: 4px; border-radius: 999px; background: var(--surface-2); }
.me-button[data-state] .i { width: 16px; height: 16px; }
.me-button[data-state="ok"] { color: var(--ink-2); }
.me-button[data-state="busy"] { color: var(--accent); }
.me-button[data-state="warn"] { color: #9a3412; background: #ffedd5; }
