:root {
  --bg: #F5F6F8;
  --card: #FFFFFF;
  --input-bg: #F0F2F5;
  --border: #E7E9EC;
  --border-soft: #EEF0F3;
  --ink: #1C1E21;
  --ink-muted: #6B7280;
  --ink-soft: #9CA3AF;
  --accent: #00BF8F;
  --accent-deep: #049873;
  --accent-soft-bg: #E3F8F0;
  --visited-unfilled: #C9CDD3;
  --visited-map-bg: #F5F6F8;
  --warn: #C77D1D;
  --warn-bg: #FFF3E0;
  --teal: #049873;
  --danger: #E5484D;
  --danger-bg: #FDEEEE;
  /* Airbnbを手本にした2層シャドウ（近い影を薄く＋遠い影を大きく柔らかく）。2026-09-29〜 */
  --card-shadow: 0 1px 2px rgba(20, 20, 30, 0.06), 0 6px 16px rgba(20, 20, 30, 0.08);
  --font-body: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', Meiryo, sans-serif;
  --font-display: var(--font-body);
  --radius-card: 18px;
  --radius-control: 12px;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  overscroll-behavior-x: none;
  /* 縦のバウンス（ラバーバンド）も止める。画面はhtml/body自体がスクロール領域（.screenは
     display:block/noneで切り替えるだけで、中に別スクロール領域は無い）。いちばん下まで
     スクロールしてさらに引っぱると、iOS（WKWebView）はページ全体をバウンスさせ、
     position: fixedの下タブ（#tabbar）もそれにつられて浮き上がって見えてしまう
     （commit 8f636b3のバグ報告、2026-09-29）。overscroll-behavior-yでバウンスそのものを止める。 */
  overscroll-behavior-y: none;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  overscroll-behavior-x: none;
  overscroll-behavior-y: none;
  -webkit-text-size-adjust: 100%;
}

button { font-family: inherit; color: inherit; cursor: pointer; border: none; background: none; padding: 0; appearance: none; -webkit-appearance: none; text-align: inherit; }
/* iOSは入力欄のfont-sizeが16px未満だと、タップ時に強制的にズームしてしまう
   （viewportのuser-scalable=noを設定していても発生する既知の挙動）ため16px以上にする */
input, textarea { font-family: inherit; font-size: 16px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* どこかの要素が画面幅をはみ出しても、ページが横にずれないようにする安全策（clipはスクロール領域を作らないので、
   position: stickyなどに影響しない） */
.app { min-height: 100dvh; overflow-x: clip; }
.screen { display: none; }
.screen.active { display: block; }
/* タブバーの4画面（マイログ・旅先一覧・旅の足跡・プロフィール）を切り替えたときだけ、ふわっと
   クロスフェードする（app.jsのshowScreenが切り替え時だけ.tab-switch-inを付ける。それ以外の画面遷移
   ＝旅の詳細を開く／戻る等は今までどおり一瞬で切り替わる。2026-09-29〜、Airbnbのタブ切り替えを手本にした）。 */
.screen.tab-switch-in { animation: tab-switch-in .22s ease both; }
@keyframes tab-switch-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .screen.tab-switch-in { animation: none; }
}

/* マイログの「評価したもの」を横スワイプでカテゴリ切り替えしたとき、一覧をスワイプした向きへ
   短く滑らせながらふわっと出す（app.jsのanimateSwipeList・mylogResolveSwipe。2026-09-29〜）。
   --swipe-xはJSがスワイプの向きに合わせて設定する（右へ流れてきたように見せたいときは正、
   左のときは負）。 */
.list-switch-in { animation: list-switch-in .22s ease both; }
@keyframes list-switch-in {
  from { opacity: 0; transform: translateX(var(--swipe-x, 12px)); }
  to { opacity: 1; transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .list-switch-in { animation: none; }
}

.wrap { max-width: 460px; margin: 0 auto; padding: 20px 16px 60px; }
.wrap.narrow { max-width: 420px; }

.hd { padding-bottom: 8px; }
.hd h1 { font-family: var(--font-display); font-size: 24px; font-weight: 700; margin: 0; letter-spacing: -0.2px; }
.hd .lead { color: var(--ink-soft); font-size: 13px; margin: 4px 0 0; }
.hd-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
/* ボトムタブバーで行き来する4画面（マイログ・旅先一覧・旅の足跡・プロフィール）だけ、
   Airbnbの「プロフィール」のような大きく太いタイトル＋上の余白にする（2026-09-29〜）。
   他の画面（新しい旅を作る・旅の詳細など）の見出しサイズは変えない。 */
.screen[data-screen="home"] > .wrap > .hd,
.screen[data-screen="mylog"] > .wrap > .hd,
.screen[data-screen="visited"] > .wrap > .hd,
.screen[data-screen="profile"] > .wrap > .hd {
  padding-top: 8px;
}
.screen[data-screen="home"] > .wrap > .hd h1,
.screen[data-screen="mylog"] > .wrap > .hd h1,
.screen[data-screen="visited"] > .wrap > .hd h1,
.screen[data-screen="profile"] > .wrap > .hd h1 {
  font-size: 30px; letter-spacing: -0.4px; line-height: 1.15;
}
.plan-badge {
  flex-shrink: 0; margin-top: 2px; border-radius: 999px;
  background: var(--border-soft); color: var(--ink-muted); font-size: 11.5px; font-weight: 700;
  padding: 6px 12px; white-space: nowrap;
}
.plan-badge.is-free { color: var(--accent-deep); background: var(--accent-soft-bg); }

.login-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 80dvh; text-align: center; }
.login-wrap > .hd:first-child { align-self: stretch; text-align: left; padding-bottom: 0; }
.google-signin-slot { margin-top: 22px; }
.apple-signin-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px;
  background: #000; color: #fff; border-radius: var(--radius-control); padding: 11px 20px; font-size: 14px; font-weight: 500;
  width: 280px;
}

.login-divider { display: flex; align-items: center; gap: 10px; width: 280px; margin: 18px 0; color: var(--ink-soft); font-size: 11.5px; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.or-divider { display: flex; align-items: center; gap: 10px; width: 100%; margin: 22px 0; color: var(--ink-soft); font-size: 11.5px; }
.or-divider::before, .or-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.email-login-form { display: flex; flex-direction: column; gap: 10px; width: 280px; text-align: left; }
.email-login-form input {
  border: none; border-radius: var(--radius-control); padding: 11px 13px; background: var(--card); color: var(--ink); box-shadow: var(--card-shadow);
}
.email-login-note { margin: 2px 0 0; text-align: center; }

/* 4つ（名前・マイログ・行ったことある旅先・ログアウト）が375px幅でも1行に収まるよう、
   このrowだけ文字を少し小さく・字間を詰め、隣り合う名前は省略記号で切る（2026-09-28〜）。 */
.account-row {
  display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 10px 0 0;
  font-size: 11px; color: var(--ink-muted); flex-wrap: nowrap;
}
.account-row .btn.text { white-space: nowrap; flex-shrink: 0; padding: 6px 0; font-size: 11px; letter-spacing: -.2px; }
.account-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 1; }

.notice {
  background: var(--warn-bg); color: var(--warn);
  border-radius: var(--radius-control); padding: 10px 14px; font-size: 13px; margin: 12px 0;
}

/* ---------- buttons ---------- */
.btn {
  border: none; border-radius: var(--radius-control); padding: 12px 18px; font-size: 14.5px; font-weight: 700;
  background: var(--border-soft); color: var(--ink);
}
.btn.primary { background: var(--accent); color: white; }
.btn.primary:hover { background: var(--accent-deep); }
.btn.ghost { background: transparent; }
.btn.ghost.small { padding: 7px 12px; font-size: 12.5px; font-weight: 500; }
.btn.primary.small { padding: 7px 12px; font-size: 12.5px; font-weight: 600; }
.btn.danger { color: var(--danger); background: var(--danger-bg); }
.btn.text { background: none; border: none; padding: 6px 0; color: var(--ink-muted); font-weight: 500; }
.btn.wide { width: 100%; }
#btnVoiceRecord { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn[hidden] { display: none; }

/* 押した瞬間だけ少し縮む共通のプレス反応（Airbnbのボタン・カードを手本にした。2026-09-29〜）。
   カード・ボタン類に共通で付け、タップした感触を出す。 */
.btn, .trip-card, .chip-btn, .sort-btn, .visited-tab {
  transition: transform .12s ease;
}
.btn:active, .trip-card:active, .chip-btn:active, .sort-btn:active, .visited-tab:active {
  transform: scale(.98);
}
@media (prefers-reduced-motion: reduce) {
  .btn, .trip-card, .chip-btn, .sort-btn, .visited-tab { transition: none; }
  .btn:active, .trip-card:active, .chip-btn:active, .sort-btn:active, .visited-tab:active { transform: none; }
}

/* 旅行のカードがスクロールで浮かび上がる演出（Airbnbアプリを手本にした。app.jsのrevealCardsOnScroll。
   2026-09-29〜）。押し込み演出（.trip-card:active、上のtransform: scale()）とtransformの
   トランジション時間（.12s）がぶつからないよう、こちらはtranslate（transformとは別のCSSプロパティ、
   同時に効かせられる）を使う。JSがprefers-reduced-motionのときは.reveal-init自体を付けないので、
   このルールは適用されず、最初から普通に表示される。 */
.reveal-init {
  opacity: 0;
  translate: 0 16px;
  transition: opacity .35s ease-out, translate .35s ease-out;
}
.reveal-init.reveal-in {
  opacity: 1;
  translate: 0 0;
}

.icon-btn {
  width: 30px; height: 30px; border-radius: var(--radius-control); border: none; background: var(--border-soft);
  display: flex; align-items: center; justify-content: center; color: var(--ink-muted);
}

.chip-btn {
  display: inline-flex; align-items: center; gap: 5px; background: var(--border-soft); padding: 7px 13px;
  border: none; border-radius: 999px; color: var(--ink-muted); font-size: 12px; font-weight: 600; white-space: nowrap;
}

/* ---------- fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; min-width: 0; }
.field input { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; }
.field label { font-size: 12.5px; color: var(--ink-muted); font-weight: 500; }
.field input[type="text"], .field input[type="date"], .field input[type="time"],
.field input[type="number"], .field input[type="url"], .field textarea {
  border: none; border-radius: var(--radius-control); padding: 11px 13px; background: var(--input-bg); color: var(--ink);
}
/* iOS Safariは input[type=date]/[type=time] を、他のinputとは違うネイティブの見た目
   （OS標準の部品）で描画し、指定した幅より少しはみ出して見えることがあった。
   -webkit-appearanceでネイティブの見た目自体を消し、見出し(text)の入力欄と
   全く同じ見た目・サイズになるようにする */
.field input[type="date"], .field input[type="time"] {
  -webkit-appearance: none; appearance: none;
}
/* 日付・時間・テキストなど1行入力の高さを揃える。特にiOS Safariは
   <input type="time">が未入力のとき、値ありの<input type="date">より
   低く描画されることがあり、paddingを揃えただけでは高さが一致しない */
.field input[type="text"], .field input[type="date"], .field input[type="time"],
.field input[type="number"], .field input[type="url"] {
  height: 46px;
}
.field textarea { resize: vertical; }
.open-link .row { display: flex; gap: 8px; }
.open-link input { flex: 1; }
.map-search-row { display: flex; gap: 8px; margin-top: 6px; }
.map-search-row input { flex: 1; min-width: 0; height: 40px; border: none; border-radius: var(--radius-control); padding: 8px 11px; background: var(--input-bg); color: var(--ink); }
.map-search-row button { flex-shrink: 0; }
.map-preview { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.map-preview iframe { width: 100%; height: 240px; border: none; border-radius: var(--radius-control); }
.map-preview button { align-self: flex-start; }
.hint { color: var(--ink-soft); font-size: 12px; margin: 10px 0; line-height: 1.6; }
.hint.is-recording { color: var(--danger); font-weight: 700; animation: voice-pulse 1.2s ease-in-out infinite; }
@keyframes voice-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* ---------- trip list ---------- */
.trip-filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
.trip-filters select {
  flex: 1; min-width: 100px; border: none; border-radius: var(--radius-control);
  padding: 9px 9px; font-size: 12px; background: var(--card); color: var(--ink-muted); box-shadow: var(--card-shadow);
}
.trip-list { display: flex; flex-direction: column; gap: 12px; margin: 6px 0 18px; }
#btnClearTripHistory { display: block; margin: 0 0 14px; }
.home-actions { margin-bottom: 8px; }
.forget-trip-btn { margin-top: 12px; }
.trip-card {
  background: var(--card); border-radius: var(--radius-card); box-shadow: var(--card-shadow);
  text-align: left; padding: 14px 16px; width: 100%; cursor: pointer;
}
.trip-card-row { display: flex; gap: 12px; align-items: flex-start; }
.trip-card-thumb {
  width: 56px; height: 56px; border-radius: var(--radius-control); flex-shrink: 0;
  background-color: var(--border-soft); background-size: cover; background-position: center;
}
.trip-card-body { flex: 1; min-width: 0; }
.trip-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.trip-card-title { font-weight: 700; font-size: 15px; line-height: 1.35; }
.trip-card-date { font-size: 10.5px; color: var(--ink-soft); white-space: nowrap; flex-shrink: 0; padding-top: 2px; }
.trip-card-companions { font-size: 11.5px; color: var(--ink-muted); margin-top: 6px; }
.trip-card-type {
  display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: 10px; font-weight: 700;
  background: var(--accent-soft-bg); color: var(--accent-deep);
}
/* サムネイル画像がある旅行だけ、ホーム画面のカードを「写真を大きく＋下に参加者のアイコン」の見た目にする
   （DAY30〜）。マイログの「参加した旅行一覧」は今までどおり.trip-card-row／.trip-card-thumbの小さい一覧のまま。 */
.trip-card.has-photo { padding: 0; overflow: hidden; }
.trip-card-photo {
  width: 100%; height: 140px; background-color: var(--border-soft); background-size: cover; background-position: center; position: relative;
}
.trip-card-photo-badge {
  position: absolute; left: 12px; top: 12px; background: rgba(255, 255, 255, 0.92); border-radius: 999px;
  padding: 5px 12px; font-size: 11.5px; font-weight: 600; color: var(--accent-deep);
}
.trip-card-info { padding: 14px 16px 16px; }
.trip-card-people { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.trip-card-avatars { display: flex; }
.trip-card-avatar {
  width: 22px; height: 22px; border-radius: 999px; border: 2px solid var(--card); margin-left: -6px;
  display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; flex-shrink: 0;
}
.trip-card-avatar:first-child { margin-left: 0; }
.trip-card-avatar.c0 { background: #FFD9A0; color: #A6620C; }
.trip-card-avatar.c1 { background: #B9E4D0; color: #1F8A5C; }
.trip-card-avatar.c2 { background: #CFE0FF; color: #3563C9; }
.trip-card-avatar.c3 { background: #FFD3CB; color: #C4482F; }
.trip-card-avatar.c4 { background: #E4D4FA; color: #6B3FA0; }
.trip-card-avatar.c5 { background: #FFE9A8; color: #9C7A0A; }
.trip-card-people-text { font-size: 12px; color: var(--ink-muted); }
.empty { color: var(--ink-soft); font-size: 13px; padding: 20px 0; }

/* 通信待ちのシマー（光が流れる）スケルトン（マイログ・「行ったことある旅先」の初回読み込みで使う。
   2026-09-29〜）。カードの形だけ先に出して、空欄や「読み込み中…」の文字より進行中だと伝わりやすくする。 */
.skeleton-wrap { display: flex; flex-direction: column; gap: 12px; margin: 6px 0 18px; }
.skeleton-card {
  background: var(--card); border-radius: var(--radius-card); box-shadow: var(--card-shadow);
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
.skeleton-line {
  height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, var(--border-soft) 25%, var(--border) 37%, var(--border-soft) 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}
.skeleton-line-title { width: 55%; height: 14px; }
.skeleton-line-sub { width: 80%; }
@keyframes skeleton-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton-line { animation: none; background: var(--border-soft); }
}

/* ---------- trip detail header ---------- */
.trip-cover { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-bottom: 4px; }
.trip-cover-photo {
  width: 100%; height: 160px; border-radius: var(--radius-card); margin-bottom: 12px;
  background-color: var(--border-soft); background-size: cover; background-position: center; position: relative;
}
/* サムネイル画像が無い旅行では、戻る／共有／編集の3ボタンは通常のフローで横並びにする */
.trip-cover .share-btn { margin-left: auto; }
.trip-cover-text { flex-basis: 100%; }
/* サムネイル画像がある旅行だけ、Airbnbの旅程詳細を手本にしたレイアウトにする（2026-09-29、
   「カードの写真が薄い帯に縮んで見える」というオーナー指摘の修正で、TimeTree風の重ね表示から
   作り替えた）。カバー写真をビューポート高の約40%・画面幅いっぱいに見せ（.wrapのpaddingを
   打ち消す負のmarginで画面端まで届かせ、ステータスバーの下にも回り込ませる）、タイトル・日程は
   写真の下の白いシート（角丸20px、写真に16px重ねる）に置く。戻る／編集ボタンだけ写真の上に
   丸い白ボタンで重ねる（safe-area-inset-topの分だけ下げる）。 */
.trip-cover:has(.trip-cover-photo:not([hidden])) {
  display: block; margin: -20px -16px 0; padding-bottom: 0;
}
.trip-cover:has(.trip-cover-photo:not([hidden])) .trip-cover-photo {
  width: 100%; height: clamp(220px, 40vh, 340px); border-radius: 0; margin-bottom: 0;
}
.trip-cover:has(.trip-cover-photo:not([hidden])) .back-btn,
.trip-cover:has(.trip-cover-photo:not([hidden])) .share-btn,
.trip-cover:has(.trip-cover-photo:not([hidden])) .edit-btn {
  position: absolute; top: calc(14px + env(safe-area-inset-top)); z-index: 3; margin-left: 0;
  width: 36px; height: 36px; background: rgba(255, 255, 255, 0.94); color: #2A2E33;
  box-shadow: 0 1px 4px rgba(10, 12, 16, 0.18);
}
.trip-cover:has(.trip-cover-photo:not([hidden])) .back-btn { left: 16px; }
.trip-cover:has(.trip-cover-photo:not([hidden])) .share-btn { right: 60px; }
.trip-cover:has(.trip-cover-photo:not([hidden])) .edit-btn { right: 16px; }
.trip-cover:has(.trip-cover-photo:not([hidden])) .trip-cover-text {
  position: relative; z-index: 2; flex-basis: auto; background: var(--card);
  margin-top: -16px; padding: 18px 16px 4px; border-radius: 20px 20px 0 0;
}
.trip-cover:has(.trip-cover-photo:not([hidden])) .trip-title { margin-top: 0; }
.trip-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; margin-top: 10px; }
.trip-dates { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }

/* 旅行カードをタップしたときに、そのカードが丸ごと浮かび上がって詳細画面のヘッダーへ広がる演出
   （Airbnbアプリを手本にしたshared-element遷移。app.jsのopenTripFromCard／maybeAnimateTripCardClose、
   2026-09-29〜、写真だけ縮む見え方の修正で「写真クローン」「白い本体クローン」の2枚構成に作り替え）。
   暗幕（backdrop）はぼかし＋暗くするだけの装飾要素で、クリックは透過させない（pointer-events: none。
   演出中は裏の一覧を操作させたくないが、専用の要素にせずJS側で一覧のfreeze中は元画面が
   position:fixedで前面に出ないようにしている）。詳細画面そのものは演出中は常に非表示のままで、
   クローンが最終位置に達した瞬間だけ即座に（フェード無しで）その下に見せる。 */
.trip-open-backdrop {
  position: fixed; inset: 0; z-index: 490; pointer-events: none;
  background: rgba(10, 12, 16, 0); backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px);
  transition: background .45s ease, backdrop-filter .45s ease, -webkit-backdrop-filter .45s ease;
}
.trip-open-backdrop.show {
  background: rgba(10, 12, 16, 0.3); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
/* 写真クローン・白本体クローンに共通：位置・大きさ・角丸をひとつのtransitionでなめらかに動かす
   （gentle springのcubic-bezier。450msはTRIP_OPEN_ANIM_MSと揃える） */
.trip-open-clone {
  position: fixed; z-index: 500; overflow: hidden; pointer-events: none;
  transition: top .45s cubic-bezier(.2, .9, .25, 1), left .45s cubic-bezier(.2, .9, .25, 1),
    width .45s cubic-bezier(.2, .9, .25, 1), height .45s cubic-bezier(.2, .9, .25, 1),
    border-radius .45s cubic-bezier(.2, .9, .25, 1);
}
.trip-open-clone-photo {
  background-color: var(--border-soft); background-size: cover; background-position: center;
}
/* 白い本体クローンは写真クローンより手前（写真の上に16px重なる白いシートを表現するため） */
.trip-open-clone-body {
  background: var(--card); box-shadow: var(--card-shadow); z-index: 501;
}
@media (prefers-reduced-motion: reduce) {
  .trip-open-backdrop, .trip-open-clone { transition: none; }
}

/* ボタン（参加する・招待・アルバム・精算）が画面幅より広いと、ページ全体が横に少しずれて動いていた。
   入りきらないときは折り返す */
.companions-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0 0; }
.companions-names { font-size: 12px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.companions-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: 100%; }
#tripMembers { padding-top: 4px; }

.stats-row { display: flex; gap: 10px; padding: 14px 0 4px; flex-wrap: wrap; }
.stat-card { flex: 1; min-width: 100px; background: var(--card); border-radius: var(--radius-card); padding: 12px 13px; box-shadow: var(--card-shadow); align-self: flex-start; }
.stat-card .lbl { font-size: 10.5px; color: var(--ink-soft); font-weight: 600; }
.stat-card .val {
  font-size: 13.5px; font-weight: 700; margin-top: 3px; line-height: 1.3;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}
.stat-card-btn { text-align: left; font-family: inherit; width: 100%; -webkit-appearance: none; appearance: none; cursor: pointer; }
.cost-breakdown-panel { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.cost-breakdown-row {
  display: flex; justify-content: space-between; padding: 10px 13px; font-size: 13px; font-weight: 700;
  background: var(--card); border-radius: var(--radius-control); box-shadow: var(--card-shadow);
}
.cost-breakdown-row .amount { font-variant-numeric: tabular-nums; }

.day-tabs { display: flex; gap: 8px; padding: 12px 0; overflow-x: auto; }
.day-tab { padding: 8px 16px; border-radius: 999px; color: var(--ink-muted); font-size: 12.5px; font-weight: 600; background: var(--border-soft); white-space: nowrap; flex-shrink: 0; }
.day-tab.on { background: var(--accent); color: white; font-weight: 700; }

.section-label { padding: 2px 0 8px; display: flex; align-items: center; gap: 8px; }
.section-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; }

.day-weather {
  margin-left: auto; display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700;
  color: var(--ink-muted); background: var(--border-soft); padding: 6px 12px; border-radius: 999px; white-space: nowrap;
}
.day-weather.has-weather { color: var(--accent-deep); background: var(--accent-soft-bg); }
.day-weather .forecast-mark { font-weight: 500; color: var(--ink-soft); }

.weather-edit-panel {
  background: var(--card); border-radius: var(--radius-control); box-shadow: var(--card-shadow);
  padding: 14px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 10px;
}
.weather-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.weather-picker-opt {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px;
  border-radius: 12px; background: var(--input-bg); color: var(--ink-muted); font-size: 11.5px; font-weight: 600;
}
.weather-picker-icon { font-size: 22px; line-height: 1; }
.weather-picker-opt.on { background: var(--accent-soft-bg); color: var(--accent-deep); box-shadow: inset 0 0 0 1.5px var(--accent); }
.weather-edit-actions { display: flex; justify-content: flex-end; gap: 8px; }

.voice-transcript { margin-bottom: 10px; }
.voice-transcript summary { font-size: 12px; color: var(--accent-deep); font-weight: 700; cursor: pointer; }
.voice-transcript p { font-size: 12.5px; color: var(--ink-muted); white-space: pre-line; line-height: 1.6; margin: 8px 0 0; padding: 12px 13px; background: var(--card); box-shadow: var(--card-shadow); border-radius: var(--radius-control); }

/* ---------- timeline: 大項目(block) / 小項目(entry) ---------- */
.timeline { display: flex; flex-direction: column; gap: 16px; padding: 4px 0 8px; }
.block { display: flex; flex-direction: column; gap: 8px; }
.block-head { display: flex; align-items: center; gap: 8px; padding: 2px 2px; cursor: pointer; }
.block-time { font-size: 13px; font-weight: 700; }
.block-label { font-size: 13.5px; font-weight: 700; }
.block-cat {
  display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 700;
  margin-left: auto; white-space: nowrap; padding: 3px 10px; border-radius: 999px;
}

/* 時刻未設定のBlockだけ、持ち手を長押ししてドラッグし、並び順を入れ替えられる（時刻ありは固定）。
   長押しで持ち上がるまでは指の動きを妨げず、ふつうのスクロールができるようにしておく
   （touch-action: noneは持ち上がった後の.block.draggingにだけ付ける） */
.block-drag-handle {
  flex-shrink: 0; color: var(--ink-soft); padding: 4px; margin: -4px; touch-action: manipulation; cursor: grab;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.block.dragging {
  position: relative; z-index: 50; touch-action: none; pointer-events: none;
  box-shadow: 0 10px 26px rgba(20, 20, 30, 0.22);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.block.block-shift { transition: transform 150ms ease; }
.block.settling { transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1); }

.entries { display: flex; flex-direction: column; gap: 8px; }
.entry-card { background: var(--card); border-radius: var(--radius-card); box-shadow: var(--card-shadow); padding: 12px; cursor: pointer; }
.entry-card.lodging { background: var(--warn-bg); box-shadow: none; }
.entry-card.dragging { position: fixed; z-index: 50; box-shadow: 0 8px 20px rgba(20, 20, 30, 0.18); opacity: 0.96; pointer-events: none; }

/* 記録を別の予定へ移す（ドラッグ持ち手・「移動」ボタン） */
.entry-card-head { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin: -4px -4px 2px; }
.entry-move-btn {
  display: flex; align-items: center; gap: 3px; border: none; background: none; padding: 5px 6px; margin: -4px;
  color: var(--ink-soft); font-size: 10.5px; font-weight: 700;
}
.entry-drag-handle { flex-shrink: 0; color: var(--ink-soft); padding: 5px; margin: -4px; touch-action: none; cursor: grab; }
.entry-move-menu:not([hidden]) { display: flex; flex-direction: column; gap: 6px; margin: 2px 0 10px; }
.entry-move-target {
  text-align: left; border: none; border-radius: var(--radius-control); padding: 10px 11px;
  background: var(--border-soft); color: var(--ink); font-size: 12.5px; font-weight: 500;
}
.block.drop-target { outline: 2px dashed var(--accent); outline-offset: 4px; border-radius: var(--radius-card); }
.entry-author { font-size: 10.5px; color: var(--ink-soft); margin-top: 10px; margin-bottom: 4px; }
.entry-photos { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; margin-bottom: 10px; }
.entry-photo {
  width: 100%; height: 120px; border-radius: var(--radius-control); background-color: var(--border-soft); background-size: cover; background-position: center;
}
.entry-photos:has(.entry-photo ~ .entry-photo) .entry-photo { width: calc(50% - 3px); height: 90px; }
.entry-time { font-size: 11px; font-weight: 700; color: var(--ink-soft); margin-bottom: 2px; }
.entry-episode { font-size: 12.5px; line-height: 1.6; }
.entry-comment { font-size: 12px; color: var(--ink-muted); margin-top: 6px; font-style: italic; }
.entry-detail { font-size: 12px; color: var(--ink-muted); margin-top: 8px; white-space: pre-line; line-height: 1.6; }
.cost-lines { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.cost-line { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-muted); margin-top: 3px; }
.cost-line:first-child { margin-top: 0; }
.cost-line.total { font-size: 12.5px; font-weight: 700; color: var(--ink); margin-top: 6px; }
.entry-meta { display: flex; align-items: center; gap: 14px; margin-top: 10px; font-size: 11px; color: var(--ink-muted); flex-wrap: wrap; }
.entry-meta a { font-size: 11px; }

.block-add {
  display: flex; align-items: center; justify-content: center; gap: 6px; padding: 13px;
  border: 1.5px dashed var(--border); border-radius: var(--radius-card); color: var(--accent-deep); background: none;
  font-size: 13px; font-weight: 700;
}
.entry-add {
  display: flex; align-items: center; gap: 6px; padding: 8px 2px; border: none; background: none;
  color: var(--accent-deep); font-size: 11.5px; font-weight: 700; align-self: flex-start;
}

/* ---------- forms (block / entry sheets) ---------- */
.sheet { background: var(--card); border-radius: var(--radius-card); padding: 18px; box-shadow: var(--card-shadow); margin-top: 16px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sheet-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; }

.cat-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.cat-chip { padding: 7px 14px; border-radius: 999px; background: var(--input-bg); color: var(--ink-muted); font-size: 12.5px; border: none; }
.cat-chip.on { background: var(--accent); color: white; font-weight: 700; }
.transport-chips .cat-chip { display: inline-flex; align-items: center; gap: 5px; }

.photo-picker {
  display: flex; align-items: center; gap: 10px; border: 1.5px dashed var(--border); border-radius: var(--radius-card);
  padding: 14px; color: var(--ink-muted); font-size: 13px; font-weight: 500; background: none;
}
.photo-preview { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.photo-preview .ph { position: relative; width: 60px; height: 60px; }
.photo-preview .ph img { width: 100%; height: 100%; border-radius: var(--radius-control); object-fit: cover; }
.photo-preview .ph .ph-remove {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--danger);
  color: white; border: 2px solid var(--card); font-size: 12px; line-height: 1; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.photo-preview .ph .ph-rotate {
  position: absolute; bottom: -6px; left: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--card);
  color: var(--ink-muted); border: none; box-shadow: var(--card-shadow); padding: 0;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- アルバム（旅行全体の写真・動画） ---------- */
.album-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.album-tile {
  position: relative; aspect-ratio: 1 / 1; background-color: var(--border-soft); background-size: cover;
  background-position: center; border-radius: var(--radius-control); overflow: hidden;
}
.album-tile video { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.album-tile .album-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(20, 20, 30, 0.18); color: #fff;
}
.album-tile .album-date {
  position: absolute; left: 4px; bottom: 4px; font-size: 9.5px; font-weight: 700; color: #fff;
  background: rgba(20, 20, 30, 0.45); padding: 1px 6px; border-radius: 999px;
}

/* ---------- 写真の拡大表示（ライトボックス） ---------- */
.lightbox {
  position: fixed; inset: 0; background: rgba(10, 12, 16, 0.92); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.lightbox img { max-width: 100%; max-height: 100%; border-radius: var(--radius-control); }
.lightbox video { max-width: 100%; max-height: 100%; border-radius: var(--radius-control); background: #000; }
.lightbox-close {
  position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.15); color: #fff; display: flex; align-items: center; justify-content: center;
}
.lightbox-save {
  position: absolute; top: 16px; left: 16px; width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.15); color: #fff; display: flex; align-items: center; justify-content: center;
}
.lightbox-save[disabled] { opacity: 0.5; }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.15); color: #fff; display: flex; align-items: center; justify-content: center;
}
.lightbox-nav-prev { left: 12px; }
.lightbox-nav-next { right: 12px; }
.lightbox-count {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 12.5px; font-weight: 700;
  background: rgba(255, 255, 255, 0.15); padding: 4px 12px; border-radius: 999px;
}

.video-preview { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.video-chip { display: flex; align-items: center; gap: 8px; border: none; border-radius: var(--radius-control); padding: 9px 10px; font-size: 12px; background: var(--input-bg); }
.video-chip .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-chip .size { color: var(--ink-soft); font-size: 11px; flex-shrink: 0; }
.video-chip button { flex-shrink: 0; background: none; border: none; color: var(--danger); font-size: 14px; padding: 0; }

/* 写真（.entry-photos/.entry-photo）と同じ粒度のタイルで並べる。縦長（スマホ縦撮り）の動画も
   object-fit: coverで正方形に切り取るので、写真と混ざっても見た目の大きさが揃う */
.entry-videos { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; margin-bottom: 10px; }
.entry-video-tile {
  position: relative; width: 100%; height: 120px; border-radius: var(--radius-control); overflow: hidden; background: #000;
}
.entry-videos:has(.entry-video-tile ~ .entry-video-tile) .entry-video-tile { width: calc(50% - 3px); height: 90px; }
.entry-video-tile video { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.entry-video-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(20, 20, 30, 0.18); color: #fff;
}

.cost-items { display: flex; flex-direction: column; gap: 8px; }
/* 1行目＝内容（幅いっぱい）、2行目＝金額・通貨・×、その下にレート（外貨のみ）・立て替えボタン
   の順で縦に積む（375px幅で金額欄が潰れてプレースホルダーが見切れないように。2026-09-28） */
.cost-item-row { display: flex; flex-direction: column; gap: 6px; }
.cost-item-line1, .cost-item-line2 { display: flex; gap: 8px; align-items: center; }
.cost-item-row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cost-item-row input[type="text"] { min-width: 0; width: 0; flex: 1; border: none; border-radius: var(--radius-control); padding: 9px 11px; background: var(--input-bg); }
.cost-item-amount { flex: 1; min-width: 7em; width: 0; border: none; border-radius: var(--radius-control); padding: 9px 8px; background: var(--input-bg); }
.cost-item-row button { flex: 0 0 auto; background: none; border: none; color: var(--ink-soft); font-size: 16px; width: 22px; padding: 0; }
.cost-currency-select {
  flex: 0 0 auto; border: none; border-radius: var(--radius-control); padding: 9px 6px; background: var(--input-bg);
  color: var(--ink); font-size: 12px; max-width: 70px;
}
.cost-currency-other { flex: 0 0 70px; min-width: 0; border: none; border-radius: var(--radius-control); padding: 9px 8px; background: var(--input-bg); text-transform: uppercase; }
.cost-rate-row {
  display: flex; flex-direction: column; gap: 4px;
  padding: 8px 10px; background: var(--border-soft); border-radius: var(--radius-control); font-size: 11.5px; color: var(--ink-muted);
}
.cost-rate-line { font-weight: 700; color: var(--ink); }
.cost-rate-edit { display: flex; align-items: center; gap: 6px; }
.cost-rate-edit input.cost-rate-input { flex: 1; min-width: 7em; width: 0; border: none; border-radius: var(--radius-control); padding: 6px 8px; background: var(--card); }
.cost-rate-converted { font-weight: 600; color: var(--accent-deep); }
.cost-rate-warn { margin: 0; color: var(--danger, #c0392b); }
.cost-item-row .cost-payer-toggle {
  width: auto; font-size: 11px; font-weight: 700; color: var(--ink-muted); white-space: nowrap; padding: 7px 10px;
  border: none; border-radius: 999px; background: var(--border-soft);
}
.cost-item-row .cost-payer-toggle.on { color: var(--accent-deep); background: var(--accent-soft-bg); }
.cost-payer-row {
  display: flex; flex-direction: column; gap: 8px; margin: -2px 0 4px; padding: 12px;
  background: var(--border-soft); border-radius: var(--radius-control);
}
.cost-payer-section { display: flex; flex-direction: column; gap: 6px; }
.cost-payer-label { font-size: 11.5px; font-weight: 700; color: var(--ink-muted); }
.chip-select { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-option {
  border: none; border-radius: 999px; padding: 7px 13px; font-size: 12.5px; font-weight: 600;
  background: var(--card); color: var(--ink-muted);
}
.chip-option.on { background: var(--accent); color: white; }
.cost-payer-clear, .cost-split-even { align-self: flex-start; }
.cost-total { font-size: 12.5px; font-weight: 700; margin-top: 8px; }
.cost-item-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 精算（割り勘） ---------- */
.settle-unit-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.settle-unit-label { font-size: 12.5px; font-weight: 700; color: var(--ink-muted); }
.settle-unit-picker {
  display: flex; gap: 4px; padding: 3px; background: var(--input-bg); border-radius: 999px;
}
.settle-unit-opt {
  padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  color: var(--ink-muted);
}
.settle-unit-opt.on { background: var(--card); color: var(--accent-deep); box-shadow: var(--card-shadow); }
.settle-round-note { font-size: 12px; color: var(--ink-muted); margin: -6px 0 18px; }
.balance-list, .settle-plan-list, .expense-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.balance-row {
  display: flex; justify-content: space-between; align-items: center; padding: 11px 13px;
  background: var(--card); border-radius: var(--radius-control); font-weight: 700; box-shadow: var(--card-shadow);
}
.balance-row .amount { font-variant-numeric: tabular-nums; }
.balance-row.plus .amount { color: var(--teal); }
.balance-row.minus .amount { color: var(--danger); }
.settle-plan-row {
  display: flex; align-items: center; gap: 8px; padding: 11px 13px;
  background: var(--card); border-radius: var(--radius-control); font-size: 13.5px; box-shadow: var(--card-shadow);
}
.settle-plan-row .from, .settle-plan-row .to { font-weight: 700; }
.settle-plan-row .amount { margin-left: auto; font-weight: 700; color: var(--accent-deep); font-variant-numeric: tabular-nums; }
.expense-row { padding: 11px 13px; background: var(--card); border-radius: var(--radius-control); box-shadow: var(--card-shadow); }
.expense-main { display: flex; justify-content: space-between; font-weight: 700; }
.expense-sub { font-size: 12px; color: var(--ink-muted); margin-top: 3px; }

.sheet-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }

/* ---------- 評価（★） ---------- */
.entry-rating { font-size: 12.5px; font-weight: 700; color: #B38600; margin-bottom: 4px; }
.entry-rating .count { font-weight: 500; color: var(--ink-soft); margin-left: 2px; }

.rating-widget { display: flex; align-items: center; }
.stars { display: flex; gap: 4px; }
.star-btn {
  font-size: 26px; line-height: 1; color: #DDE0E4; background: none; border: none; padding: 2px;
}
.star-btn.on { color: #FFAB00; }
.rating-fine { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.rating-fine-value { font-size: 13px; color: var(--ink-muted); min-width: 34px; text-align: center; }

/* ---------- 音声入力プラン ---------- */
.plan-status {
  background: var(--card); border-radius: var(--radius-card);
  box-shadow: var(--card-shadow); padding: 14px 16px; margin-top: 6px;
}
.plan-status .plan-name { font-size: 15px; font-weight: 900; }
.plan-status .plan-usage { font-size: 12.5px; color: var(--ink-muted); margin-top: 4px; }
.plan-options { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.plan-card {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--card); border-radius: var(--radius-card);
  box-shadow: var(--card-shadow); padding: 12px 16px;
}
.plan-card .plan-card-name { font-size: 13.5px; font-weight: 700; }
.plan-card .plan-card-detail { font-size: 11.5px; color: var(--ink-muted); margin-top: 2px; }
.plan-card button { flex-shrink: 0; }

/* ---------- マイログ ---------- */

/* ---------- 行ったことある旅先（国内・海外タブ、docs/adr/0017） ---------- */
.visited-tabs { display: flex; gap: 6px; padding: 10px 0 4px; }
.visited-tab { flex: 1; padding: 9px 0; border-radius: 999px; text-align: center; color: var(--ink-muted); font-size: 13px; font-weight: 700; background: var(--border-soft); }
.visited-tab.on { background: var(--accent); color: white; }

/* 集計カード（大きい数字＋ドーナツ）。行ったことある旅先の一番上、地図より前に出す */
.visited-totals { display: flex; align-items: center; gap: 14px; margin: 12px 0 6px; padding: 12px 14px; border-radius: 14px; background: var(--card); box-shadow: var(--card-shadow); }
.visited-donut { width: 64px; height: 64px; flex: none; }
.visited-donut-bg { stroke: var(--visited-unfilled); }
.visited-donut-fg { stroke: var(--accent); transition: stroke-dashoffset .3s ease; }
.visited-donut-pct { font-size: 13px; font-weight: 700; fill: var(--ink); }
.visited-totals-text { display: flex; flex-direction: column; gap: 4px; }
.visited-totals-frac { font-size: 20px; font-weight: 700; color: var(--ink); }
.visited-totals-frac strong { font-size: 24px; }
.visited-totals-unit { font-size: 13px; font-weight: 500; color: var(--ink-muted); }
.visited-totals-pct { font-size: 12.5px; color: var(--ink-muted); }

.visited-map { display: flex; justify-content: center; padding: 10px 0; background: var(--visited-map-bg); border-radius: 14px; margin-top: 4px; }
.visited-svg { width: 100%; max-width: 340px; height: auto; }
.visited-region { fill: var(--visited-unfilled); stroke: #FFFFFF; stroke-width: .5; }
.visited-region.is-visited { fill: var(--accent); cursor: pointer; }
.visited-region.is-visited.on { fill: var(--accent-deep); stroke: var(--ink); stroke-width: 1.25; }
.visited-inset-box { fill: var(--card); stroke: var(--visited-unfilled); stroke-width: 1; }
.visited-inset-label { font-size: 7px; font-weight: 700; fill: var(--ink-muted); }
/* 選択サマリー（地図タップでも一覧の行ハイライトと同じ場所がひと目で分かるように、
   小さな見出し「選んだ場所」付きのカードにした。一覧の行の強調と役割が分かれて見えるよう、
   アクセント色の枠だけで背景は控えめにする。2026-09-28〜 */
.visited-caption { margin: 4px 0 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--accent); background: var(--card); }
.visited-caption-label { font-size: 10.5px; font-weight: 700; color: var(--accent-deep); letter-spacing: .02em; }
.visited-caption-name { font-size: 14.5px; font-weight: 700; color: var(--ink); margin-top: 2px; }
.visited-caption-trips { font-size: 12.5px; color: var(--ink-muted); margin-top: 3px; }
.visited-caption-trips a, .visited-row-trips a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.visited-caption-trips a:hover, .visited-row-trips a:hover { color: var(--accent-deep); }
/* 複数の旅行にまたがる場所は、旅行名を「・」でつなげず1行ずつ出す（新しい旅行が上）。
   行間は詰めすぎない程度に2px空ける。2026-09-29〜 */
.visited-trip-links { display: flex; flex-direction: column; }
.visited-trip-links a { display: block; font-size: 13px; color: var(--ink-muted); margin-top: 2px; }
.visited-trip-links a:first-child { margin-top: 0; }

/* 地方・大陸ごとの見出し付き一覧：太字の見出し＋右に件数、下に区切り線（参考にしたアプリと同じ構成）。
   行は見出しと同じ左インデントに揃え、選択中でも余白は変えず背景だけで強調する（2026-09-28〜。
   以前はキャプションと行ハイライトが二重に見えたり、選択中の行だけ余白がずれて見えたりしたため）。 */
.visited-group { margin-top: 14px; }
.visited-group-header {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  padding: 0 4px 8px; border-bottom: 1px solid var(--border-soft);
}
.visited-group-title { font-size: 17px; font-weight: 700; color: var(--ink); }
.visited-group-count { font-size: 12.5px; font-weight: 600; color: var(--ink-muted); }
.visited-list { display: flex; flex-direction: column; }
.visited-row { display: flex; flex-direction: column; gap: 3px; padding: 10px 4px; border-bottom: 1px solid var(--border-soft); cursor: pointer; }
.visited-group:last-child .visited-row:last-child { border-bottom: none; }
.visited-row.on { background: var(--accent-soft-bg); }
.visited-row-name { font-size: 15px; font-weight: 700; color: var(--ink); }
.visited-row-flag { margin-right: 4px; }
.visited-row-trips { font-size: 13px; color: var(--ink-muted); }
.visited-credit { margin-top: 10px; font-size: 10.5px; }

/* 参加した旅行カードの中の「訪れた場所」チップ（2026-09-28〜、旧「旅行ごとの訪れた場所」
   セクションをカード内へ統合）。チップ内に「外す／戻す」ボタンを持つ。外しても消さず、
   灰色＋「戻す」のまま残してすぐ元に戻せるようにする。 */
.trip-place-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.trip-place-chip { display: inline-flex; align-items: center; gap: 2px; padding: 2px 2px 2px 10px; border-radius: 999px; background: var(--accent-soft-bg); color: var(--accent-deep); font-size: 13px; font-weight: 700; max-width: 100%; }
/* 外した場所は一覧の最後に回った上で、スキミング時はほぼ見えないくらい薄くする
   （ほぼ白背景＋薄いグレー文字・枠線なし。押し間違いを防ぎつつ、探せば「戻す」で見つかる程度。
   2026-09-29〜。「戻す」はタップ領域だけ既存の.trip-place-actionのpaddingを少し増やして28px以上を確保）。 */
.trip-place-chip.is-excluded { background: #F7F8FA; color: #B8BDC4; font-size: 11.5px; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .03); }
.trip-place-name { overflow-wrap: anywhere; }
/* 「外す／戻す」は見た目は小さい文字リンクのまま、paddingだけでタップ領域を確保する
   （チップ自体が大きく膨らまないよう、枠線・背景は付けない。2026-09-28〜） */
.trip-place-action {
  padding: 7px 8px; border-radius: 999px; background: none; border: none; color: inherit; font-size: 11px; font-weight: 700;
  opacity: .7; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.trip-place-action:disabled { opacity: .4; }
.trip-place-chip.is-excluded .trip-place-action { padding: 8px 9px; opacity: .85; }
.mylog-tabs { display: flex; gap: 6px; padding: 12px 0 4px; overflow-x: auto; }
.mylog-tab { padding: 8px 15px; border-radius: 999px; color: var(--ink-muted); font-size: 12px; font-weight: 600; background: var(--border-soft); white-space: nowrap; flex-shrink: 0; }
.mylog-tab.on { background: var(--accent); color: white; font-weight: 700; }

.mylog-sort { display: flex; gap: 8px; padding: 8px 0 4px; }
.sort-btn { padding: 7px 13px; border-radius: 999px; border: none; color: var(--ink-muted); font-size: 11.5px; background: var(--border-soft); }
.sort-btn.on { background: var(--accent-soft-bg); color: var(--accent-deep); font-weight: 700; }

.mylog-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.mylog-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: var(--card); border-radius: var(--radius-card); box-shadow: var(--card-shadow); padding: 10px;
}
.mylog-photo { width: 48px; height: 48px; border-radius: var(--radius-control); background-color: var(--border-soft); background-size: cover; background-position: center; flex-shrink: 0; }
.mylog-info { flex: 1; min-width: 0; }
.mylog-label { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mylog-trip { font-size: 11px; color: var(--ink-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mylog-score { font-size: 13.5px; font-weight: 700; color: #B38600; flex-shrink: 0; }

@media (max-width: 400px) {
  .field-row { flex-direction: column; }
}

/* ---------- 地図でふりかえる ---------- */
.replay-entry-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  margin: 12px 0 2px; padding: 13px 16px; border-radius: var(--radius-card);
  background: var(--accent-soft-bg); color: var(--accent-deep); font-size: 14.5px; font-weight: 700;
}
.screen[data-screen="replay"].active { position: fixed; inset: 0; z-index: 50; background: var(--bg); }
.replay { position: relative; width: 100%; height: 100%; overflow: hidden; }
.replay-map { position: absolute; inset: 0; z-index: 0; background: #E8EBEF; }
.replay-clock, .replay-close, .replay-caption, .replay-controls, .replay-status, .replay-status-sub {
  background: rgba(255, 255, 255, 0.95); box-shadow: 0 4px 16px rgba(20, 20, 30, 0.12);
}
.replay-clock {
  position: absolute; top: 12px; left: 12px; z-index: 10;
  border-radius: 16px; padding: 7px 14px 8px; min-width: 104px;
}
.replay-day { font-size: 12px; font-weight: 700; color: var(--accent-deep); }
.replay-time { font-size: 30px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: 0.5px; }
.replay-close { position: absolute; top: 12px; right: 12px; z-index: 10; }
.replay-daybanner {
  position: absolute; top: 38%; left: 50%; z-index: 20; transform: translate(-50%, -50%);
  background: rgba(28, 30, 33, 0.82); color: #fff; font-size: 28px; font-weight: 800;
  padding: 14px 30px; border-radius: 18px; pointer-events: none;
  animation: replay-banner 1.6s ease forwards;
}
@keyframes replay-banner {
  0% { opacity: 0; transform: translate(-50%, -35%); }
  15% { opacity: 1; transform: translate(-50%, -50%); }
  80% { opacity: 1; }
  100% { opacity: 0; }
}
.replay-status-wrap {
  position: absolute; top: 50%; left: 16px; right: 16px; z-index: 10; transform: translateY(-50%);
  max-width: 420px; margin: 0 auto; display: flex; flex-direction: column; align-items: stretch; gap: 8px;
}
.replay-status {
  border-radius: 14px; padding: 14px 16px; margin: 0;
  text-align: center; font-size: 14px; color: var(--ink-muted);
}
.replay-status:empty { display: none; }
/* 初めて開く旅行の補足（サーバーに座標を覚えさせている間だけの案内）。本文より小さく控えめに */
.replay-status-sub {
  border-radius: 12px; padding: 8px 14px; margin: 0;
  text-align: center; font-size: 12.5px; line-height: 1.5; color: var(--ink-muted);
}
.replay-status-sub[hidden] { display: none; }
.replay-bottom {
  position: absolute; left: 12px; right: 12px; bottom: 30px; z-index: 10;
  max-width: 460px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px;
}
.replay-caption { border-radius: 18px; padding: 12px 16px; animation: replay-caption-in 0.25s ease; }
@keyframes replay-caption-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.replay-caption-head { display: flex; gap: 8px; align-items: baseline; }
.replay-caption-time { font-size: 12.5px; font-weight: 700; color: var(--accent-deep); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.replay-caption-title { font-size: 16px; font-weight: 800; }
.replay-caption-lines div { font-size: 13.5px; color: var(--ink-muted); margin-top: 3px; white-space: pre-wrap; word-break: break-word; }
/* 全文を出すようにしたので、長いときは地図を隠しすぎないよう高さに上限を付け、中でスクロールさせる */
.replay-caption { max-height: 38vh; overflow-y: auto; -webkit-overflow-scrolling: touch; transition: opacity 0.2s ease; }
/* 地図が動いている間は写真つきの吹き出しを隠す（写真が地図を覆って動きが見えないため。2026-09-27） */
.replay-caption.hide-for-move { opacity: 0; pointer-events: none; }
.replay-controls { display: flex; align-items: center; gap: 12px; border-radius: 999px; padding: 6px 16px 6px 6px; }
.replay-play {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; background: var(--accent); color: #fff;
}
/* 指でつまんで動かせるよう、見た目より広い範囲（上下）で触れるようにし、つまみを付ける */
.replay-progress { position: relative; flex: 1; height: 26px; cursor: pointer; touch-action: none; padding: 10px 0; margin: -10px 0; box-sizing: content-box; }
.replay-progress::before {
  content: ''; position: absolute; left: 0; right: 0; top: 10px; height: 6px; border-radius: 3px; background: var(--border);
}
.replay-progress-bar { position: absolute; left: 0; top: 20px; height: 6px; width: 0; border-radius: 3px; background: var(--accent); }
.replay-progress::before { top: 20px !important; }
.replay-progress-bar::after {
  content: ''; position: absolute; right: -9px; top: -6px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 2px solid var(--accent); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.replay-progress.dragging .replay-progress-bar::after { transform: scale(1.25); }
.replay-step {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; background: var(--accent-soft-bg); color: var(--accent-deep);
}
.replay-days { display: flex; gap: 6px; overflow-x: auto; padding: 2px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.replay-days::-webkit-scrollbar { display: none; }
.replay-days[hidden] { display: none; }
.replay-day-chip {
  flex-shrink: 0; border: none; cursor: pointer; border-radius: 999px; padding: 7px 12px;
  background: rgba(255, 255, 255, 0.95); box-shadow: 0 2px 8px rgba(20, 20, 30, 0.12);
  font-size: 12.5px; font-weight: 700; color: var(--ink);
}
.replay-day-chip span { margin-left: 5px; font-weight: 500; color: var(--ink-muted); }
.replay-day-chip.on { background: var(--accent); color: #fff; }
.replay-day-chip.on span { color: rgba(255, 255, 255, 0.85); }
.replay-vehicle {
  width: 38px; height: 38px; border-radius: 50%; background: #fff; color: var(--accent-deep);
  border: 2px solid var(--accent); box-shadow: 0 2px 8px rgba(20, 20, 30, 0.25);
  display: flex; align-items: center; justify-content: center;
}
.replay-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); }
.replay-dot.upcoming { background: #fff; border-color: var(--accent); }

/* ---------- いいね・コメント（docs/adr/0006） ---------- */
.social-bar { display: flex; gap: 6px; margin: 10px 0 4px; }
.entry-social { display: flex; gap: 4px; margin-top: 8px; margin-left: -6px; }
.social-btn {
  display: inline-flex; align-items: center; gap: 4px; border: none; background: none; cursor: pointer;
  padding: 6px 8px; border-radius: 999px; color: var(--ink-muted); font-size: 12.5px; font-weight: 700; min-height: 32px;
}
.social-btn:active { background: var(--border-soft); }
.social-btn span:empty { display: none; }
.social-btn.liked { color: var(--danger); }
.social-btn.liked svg path { fill: currentColor; }

body.sheet-open { overflow: hidden; }
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(20, 20, 30, 0.35);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet-backdrop[hidden] { display: none; }
/* 下から出すシート。.sheet・.sheet-head・.sheet-titleは記録フォームなど既存の画面でも使っている
   クラス名なので、必ず.sheet-backdropの中だけに効かせる（上書きすると記録フォームの表示が崩れる） */
.sheet-backdrop .sheet {
  width: 100%; max-width: 560px; max-height: 80vh; display: flex; flex-direction: column; margin-top: 0;
  background: var(--card); border-radius: 20px 20px 0 0; padding: 14px 16px calc(12px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 20px rgba(20, 20, 30, 0.12);
}
.sheet-backdrop .sheet-head { margin-bottom: 8px; }
.sheet-backdrop .sheet-title { font-size: 15px; }
.sheet-close { border: none; background: none; font-size: 22px; color: var(--ink-soft); cursor: pointer; padding: 0 4px; }
.comment-list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; min-height: 80px; }
.comment-item { padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.comment-head { display: flex; align-items: baseline; gap: 8px; }
.comment-name { font-weight: 700; font-size: 13px; }
.comment-time { font-size: 11px; color: var(--ink-soft); }
.comment-menu-btn { margin-left: auto; border: none; background: none; color: var(--ink-soft); font-size: 16px; cursor: pointer; padding: 0 4px; }
.comment-body { font-size: 14px; white-space: pre-wrap; word-break: break-word; margin-top: 2px; }
.comment-actions { display: flex; gap: 8px; margin-top: 4px; }
.comment-actions[hidden] { display: none; }
.comment-empty { padding: 18px 0; }
.comment-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.comment-form textarea {
  flex: 1; resize: none; border: 1px solid var(--border); border-radius: var(--radius-control);
  background: var(--input-bg); padding: 10px 12px; font: inherit; font-size: 16px; max-height: 120px;
}
.comment-form .btn { flex: none; padding: 10px 16px; }
.comment-status { margin: 6px 0 0; min-height: 1em; }
.comment-actions .btn.text.danger { color: var(--danger); }

/* ---------- 紹介文・レビュー項目（docs/adr/0007） ---------- */
.post-entry-btn { background: var(--card); border: 1px solid var(--border); color: var(--ink); }
.post-text {
  width: 100%; flex: 1; min-height: 200px; resize: none; border: 1px solid var(--border); border-radius: var(--radius-control);
  background: var(--input-bg); padding: 12px; font: inherit; font-size: 14px; line-height: 1.55;
}
.post-actions { display: flex; gap: 8px; margin-top: 10px; }
.post-actions .btn { flex: 1; }
.rating-widget { flex-wrap: wrap; column-gap: 12px; }
.rating-level { flex-basis: 100%; margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--accent-deep); }
.rating-level.private { color: var(--ink-muted); font-weight: 500; }
.review-fields { margin-top: 12px; padding: 12px; border-radius: var(--radius-control); background: var(--input-bg); }
.review-fields[hidden] { display: none; }
.review-title { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-bottom: 8px; }
/* 項目名を上、入力を下にする（横並びだと「金額（円）」「ホスピタリティ」が折り返し、「明細の合計」の例が切れていた） */
.review-row { display: flex; flex-direction: column; align-items: stretch; gap: 4px; font-size: 13px; min-width: 0; }
.review-row > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.review-row select, .review-row input, .review-row textarea { font-size: 16px; min-width: 0; width: 100%; }
.review-row-wide { margin-bottom: 8px; }
.review-status { margin-left: 8px; }
.travel-grid { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.travel-grid input[type="text"] { flex: 1; min-width: 0; }
.travel-arrow { color: var(--ink-muted); }
.travel-time { display: flex; align-items: center; gap: 6px; flex: 1; font-size: 13px; white-space: nowrap; }
.travel-time input { min-width: 0; flex: 1; }
.travel-example { margin: -4px 0 8px; }
#entTravelField > input { width: 100%; margin-bottom: 8px; }

/* 場所の候補：番号・名前・住所・「選択」ボタンのカード */
.place-list { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.place-list[hidden] { display: none; }
.place-list-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; color: var(--ink-muted); }
.place-count { color: var(--accent); }
/* カード全体がタップの対象（以前は右のボタンだけで、名前や住所をタップしても選べなかった）。
   ボタンは見た目のラベルとして残す（buttonではなくspanなので、二重にクリックイベントが飛ばない）。 */
.place-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--card); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.place-card:active { background: var(--input-bg); }
.place-card.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.place-num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--input-bg); color: var(--ink-muted); }
.place-card.on .place-num { background: var(--accent); color: #fff; }
.place-text { flex: 1; min-width: 0; }
.place-name { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.place-address { font-size: 12px; color: var(--ink-muted); margin-top: 2px; overflow-wrap: anywhere; }
.place-pick { flex: none; font-size: 13px; font-weight: 700; padding: 6px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--ink); pointer-events: none; }
.place-card.on .place-pick { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- 入力欄の×ボタン（app.jsのinitClearButtons） ---------- */
/* ×が文字に重ならないよう、対象の1行入力欄は右側を空けておく */
input[type="text"], input[type="url"], input[type="search"], input[type="email"], input[type="number"] { padding-right: 36px !important; }
/* 欄を幅0のラッパー（span）で包み、元の欄が持っていたflexのサイズ指定はラッパーに移す（app.jsのwrapForClearButton）。
   ラッパー自身はレイアウトに参加するだけの器なので、幅・高さは中身（input）に合わせる */
.ipt-clear-wrap { position: relative; display: inline-block; vertical-align: top; min-width: 0; }
.ipt-clear-wrap input { display: block; }
.input-clear-btn {
  position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
  z-index: 2; width: 28px; height: 28px; border-radius: 999px; border: none; cursor: pointer;
  background: var(--ink-soft); color: #fff; font-size: 16px; line-height: 28px; padding: 0; text-align: center;
}
.input-clear-btn[hidden] { display: none; }

/* ---------- 場所のプレビュー地図（拡大・縮小・ピンの微調整） ---------- */
.place-map { width: 100%; height: 240px; border-radius: var(--radius-control); overflow: hidden; z-index: 0; }
.place-map[hidden], .map-frame-wrap[hidden] { display: none; }
.place-pin { width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--danger); border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.map-frame-wrap { position: relative; }
.map-zoom { position: absolute; right: 8px; bottom: 8px; display: flex; flex-direction: column; gap: 4px; }
.map-preview .map-zoom button { align-self: auto; width: 36px; height: 36px; border: none; border-radius: 8px; background: var(--card); color: var(--ink); font-size: 20px; font-weight: 700; box-shadow: 0 1px 4px rgba(0,0,0,.25); cursor: pointer; }

/* ---------- 時差の区切り（docs/adr/0009） ---------- */
.zone-divider {
  margin: 6px 0 10px; padding: 8px 12px; border-radius: var(--radius-control);
  background: var(--accent-soft-bg); color: var(--accent-deep); font-size: 12.5px; font-weight: 700; text-align: center;
}

/* ---------- 写真の並べ替え（長押し→ドラッグ） ---------- */
.photo-preview .ph { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; transition: transform 0.12s ease; }
.photo-preview .ph img { -webkit-user-drag: none; pointer-events: none; }
.photo-preview .ph.dragging { z-index: 5; transition: none; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); border-radius: var(--radius-control); }
.photo-preview .ph.drop-target { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-control); }
.photo-preview .ph-first {
  position: absolute; left: 3px; bottom: 3px; padding: 1px 5px; border-radius: 6px;
  background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 10px; font-weight: 700; pointer-events: none;
}

/* ---------- 写真・動画のビューア（LINEのような見方） ---------- */
#photoLightbox { padding: 0; overflow: hidden; touch-action: none; background: rgba(10, 12, 16, 0.96); }
#photoLightbox .lightbox-close, #photoLightbox .lightbox-save, #photoLightbox .lightbox-nav, #photoLightbox .lightbox-count { z-index: 2; transition: opacity 0.15s ease; }
#photoLightbox .lightbox-close, #photoLightbox .lightbox-save { top: calc(16px + env(safe-area-inset-top)); }
#photoLightbox.mv-chrome-hidden .lightbox-close, #photoLightbox.mv-chrome-hidden .lightbox-save,
#photoLightbox.mv-chrome-hidden .lightbox-nav, #photoLightbox.mv-chrome-hidden .lightbox-count { opacity: 0; pointer-events: none; }
.mv-track { display: flex; width: 100%; height: 100%; will-change: transform; }
.mv-slide { flex: 0 0 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 60px 0 56px; box-sizing: border-box; }
.mv-slide img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 0; -webkit-user-drag: none; user-select: none; }
.mv-slide video { max-width: 100%; max-height: 100%; background: #000; }
/* ビューアを開いているあいだ、後ろのページを動かさない */
body.viewer-open { overflow: hidden; }

/* ---------- 記録の画面：たたんだ欄 ---------- */
.more-fields { margin: 4px 0 14px; border-radius: var(--radius-control); background: var(--input-bg); }
.more-fields > summary {
  list-style: none; cursor: pointer; padding: 12px 14px; font-size: 13px; font-weight: 700; color: var(--ink-muted);
  display: flex; align-items: center; justify-content: space-between;
}
.more-fields > summary::-webkit-details-marker { display: none; }
.more-fields > summary::after { content: '＋'; font-size: 16px; color: var(--ink-soft); }
.more-fields[open] > summary::after { content: '－'; }
.more-fields > .field { padding: 0 14px; }
.more-fields > .field:last-child { padding-bottom: 12px; }
.more-fields .field input, .more-fields .field textarea { background: var(--card); }
.more-fields > .review-fields { margin: 0 14px 12px; background: var(--card); }

/* ---------- 移動の予定：移動手段・移動時間 ---------- */
.move-time-label { display: block; margin-top: 12px; }
.move-time { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 13px; color: var(--ink-muted); }
.field .move-time input[type="number"] { width: 84px; flex: none; }
.block-head { flex-wrap: wrap; }
.block-move {
  flex-basis: 100%; display: flex; align-items: center; gap: 5px; margin-top: 2px;
  font-size: 12px; font-weight: 700; color: var(--ink-muted);
}

/* ---------- メモの取り込み（AIなし・無料） ---------- */
.memo-help { margin-top: 6px; line-height: 1.6; }
.memo-ai-btn { display: block; margin: 8px auto 0; font-size: 12.5px; }
#memoAiInfo { text-align: center; margin-top: 2px; }

/* 記録のエピソードの改行をそのまま出す（メモの取り込みでは、予定の下の1行ずつを改行でつないでいる） */
.entry-episode { white-space: pre-wrap; word-break: break-word; }

/* ---------- 地図でふりかえる：写真（Reliveのように） ---------- */
.replay-caption-photos { position: relative; margin: -12px -16px 10px; aspect-ratio: 4 / 3; max-height: 30vh; width: calc(100% + 32px); overflow: hidden; border-radius: 18px 18px 0 0; background: #111; }
.replay-caption-photos[hidden] { display: none; }
.replay-caption-photos img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.45s ease; }
.replay-caption-photos img.on { opacity: 1; animation: replay-photo-zoom 3s ease-out forwards; }
@keyframes replay-photo-zoom { from { transform: scale(1.06); } to { transform: scale(1); } }
.replay-photo-dots { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; justify-content: center; gap: 5px; }
.replay-photo-dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.5); }
.replay-photo-dots span.on { background: #fff; }
/* 写真の吹き出しは高さに余裕を持たせる（文字の部分は今までどおり中でスクロール） */
.replay-caption:has(.replay-caption-photos:not([hidden])) { max-height: 62vh; }
.replay-photo-pin {
  width: 40px; height: 40px; border-radius: 50%; background: #ddd center / cover no-repeat;
  border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.replay-photo-pin.upcoming { opacity: 0.55; }

.post-option { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-muted); margin: 2px 0 8px; }
.post-option input { width: 18px; height: 18px; }

/* 地図でふりかえるのバナー（「2日目」「時差 −13時間」）。以前は長い文が変な位置で折り返していたので、
   大きい1行＋小さい1行に分け、どちらも途中で折り返さない */
.replay-daybanner { text-align: center; max-width: calc(100% - 32px); padding: 12px 26px; }
.replay-banner-main { font-size: 26px; font-weight: 800; line-height: 1.25; white-space: nowrap; }
.replay-banner-sub { margin-top: 4px; font-size: 13.5px; font-weight: 700; line-height: 1.3; opacity: 0.85; white-space: nowrap; }

/* ---------- 小さな通知（app.jsのshowToast）。画面下中央、フェードイン・アウト ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translate(-50%, 8px); z-index: 500;
  background: var(--ink); color: var(--card);
  padding: 10px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 700;
  box-shadow: 0 4px 16px rgba(20, 20, 30, 0.22);
  max-width: calc(100vw - 32px); text-align: center;
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast[hidden] { display: none; }
.toast.toast-show { opacity: 1; transform: translate(-50%, 0); }
.toast.toast-hide { opacity: 0; transform: translate(-50%, 8px); }

/* 時差の並びを調べる（URLに ?zonedebug を付けたときだけ出す） */
.zone-diag-btn { display: block; margin: 16px auto 0; background: none; border: none; color: var(--ink-muted); font-size: 12px; text-decoration: underline; }
.zone-diag { position: fixed; inset: 0; z-index: 3000; background: var(--bg, #F5F6F8); padding: calc(env(safe-area-inset-top) + 16px) 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.zone-diag textarea { flex: 1; width: 100%; font: 11px/1.5 ui-monospace, Menlo, monospace; padding: 10px; border-radius: 10px; border: 1px solid #ddd; }

/* 宿泊先の内訳（1泊1行）と、宿泊先を足す・直すフォーム（2026-09-27）。ほかの入力画面（.field）と同じ見た目にそろえる。
   名前が長くても「n泊目」「同上」「直す」は折り返さず、名前だけを折り返す */
.lodging-row { display: flex; align-items: center; gap: 10px; width: 100%; color: var(--ink); cursor: pointer; }
.lodging-night { flex: none; white-space: nowrap; display: flex; align-items: baseline; gap: 6px; }
.lodging-night small { font-size: 11px; font-weight: 500; color: var(--ink-muted); }
.lodging-name { flex: 1; min-width: 0; text-align: right; overflow-wrap: anywhere; line-height: 1.4; }
.lodging-name.cont { color: var(--ink-muted); font-weight: 500; }
.lodging-name.none { color: var(--ink-muted); font-weight: 500; }
.lodging-actions { flex: none; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.lodging-row-edit { font-size: 11px; font-weight: 700; color: var(--accent-deep); }
.lodging-row-same {
  flex: none; white-space: nowrap; border: 1px solid var(--accent); background: var(--card); color: var(--accent-deep);
  border-radius: 999px; padding: 2px 9px; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer;
}
.lodging-row.on { outline: 2px solid var(--accent); }
.lodging-add[hidden] { display: none; }
.lodging-add { background: var(--card); border-radius: var(--radius-control); box-shadow: var(--card-shadow); padding: 14px 13px 10px; }
.lodging-add-title { font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.lodging-add .field { margin-bottom: 12px; }
.lodging-range { display: flex; align-items: center; gap: 8px; }
.lodging-range .lodging-select { flex: 1; min-width: 0; }
.lodging-select {
  width: 100%; height: 46px; border: none; border-radius: var(--radius-control); padding: 0 10px;
  background: var(--input-bg); color: var(--ink); font: inherit; font-size: 16px;
}
.lodging-add .place-list { margin-top: 8px; }
.lodging-add .hint { margin: 0 0 10px; }
.lodging-add-actions { display: flex; justify-content: flex-end; align-items: center; gap: 14px; }

/* 宿泊先・総費用：横幅いっぱいの行を縦に並べ、押すと下に詳細が開く（2026-09-27）。
   名前は2行まで、「ほか○か所」は必ず見える */
.stats-row { flex-direction: column; gap: 8px; }
.stat-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font-family: inherit; color: var(--ink);
  background: var(--card); border: none; border-radius: var(--radius-card); padding: 13px 14px; box-shadow: var(--card-shadow);
  -webkit-appearance: none; appearance: none; cursor: pointer;
}
.stat-row-lbl { flex: none; font-size: 11.5px; color: var(--ink-soft); font-weight: 600; width: 44px; }
.stat-row-val { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.stat-row .lodging-val {
  font-size: 14px; font-weight: 700; line-height: 1.35;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere;
}
.stat-row .lodging-more { font-size: 11.5px; font-weight: 700; color: var(--accent-deep); }
.stat-row-chev { flex: none; color: var(--ink-muted); transition: transform 0.2s ease; }
.stat-row[aria-expanded="true"] .stat-row-chev { transform: rotate(180deg); }
.stats-row .cost-breakdown-panel { margin-top: 0; }

/* 参加済み：押すと参加をやめられる（2026-09-27） */
.chip-btn.is-joined { background: var(--accent-soft-bg); color: var(--accent-deep); }

/* 地図のリンクが壊れている記録（2026-09-27） */
.map-broken { color: var(--warn, #B7791F); font-weight: 700; }

/* 前後の予定から遠く離れたピン（違う場所のピンかもしれない）。壊れた地図ほど強くは出さず、
   さりげない注意書きにとどめる（2026-09-29） */
.map-far-outlier { color: var(--warn, #B7791F); font-size: 0.85em; }

#blkMoveTimeWrap[hidden] { display: none; }

/* 手で並べた日の案内（2026-09-27） */
.manual-order-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; margin: 4px 2px 10px; font-size: 12px; color: var(--ink-muted); }
.manual-order-note .btn.text { color: var(--accent-deep); font-weight: 700; padding: 4px 0; }

/* ============ ボトムタブバー（Airbnbアプリを手本にした4タブ。2026-09-28〜） ============
   マイログ・旅先一覧（＝行ったことある旅先）・旅の足跡（＝ホーム）・プロフィールの4画面だけで
   表示する（app.jsのupdateTabbarが.showの付け外しをする）。旅の詳細・記録フォーム・地図で
   ふりかえる・シート・ログインでは隠す。 */
.tabbar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  justify-content: space-around; align-items: stretch;
  background: var(--card);
  border-top: 1px solid var(--border-soft);
  box-shadow: 0 -2px 12px rgba(20, 20, 30, 0.06);
  /* WKWebViewでposition: fixedの要素を専用レイヤーに乗せておく（コンポジット確定）。
     html/bodyのoverscroll-behavior-yと合わせて、スクロールの端でタブバーが浮き上がらないようにする
     ための保険（2026-09-29）。 */
  transform: translateZ(0);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabbar.show { display: flex; }
.tabbar-btn {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 8px 4px calc(6px + env(safe-area-inset-bottom, 0px) * 0);
  color: var(--ink-soft); font-size: 10.5px; font-weight: 600; letter-spacing: -.1px;
}
.tabbar-icon { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; transition: transform .25s cubic-bezier(.34, 1.56, .64, 1); }
.tabbar-icon svg { width: 23px; height: 23px; }
.tabbar-label { transition: color .2s ease, font-weight .2s ease; }
.tabbar-btn.on { color: var(--accent-deep); }
.tabbar-btn.on .tabbar-icon { transform: translateY(-3px) scale(1.05); }
/* 選択中はラベルも太字にして、アイコン＋アクセント色だけより選択状態が分かりやすいようにする
   （Airbnbアプリのタブを手本にした。2026-09-29〜）。 */
.tabbar-btn.on .tabbar-label { font-weight: 800; }
/* タップした瞬間だけ付くクラス（app.js）。アイコンがふわっと持ち上がって少し弾む→
   .onの定常状態（-3px, 1.05倍）に落ち着く。Airbnbアプリのタブ切り替えの動きを参考にした。 */
.tabbar-btn.pop .tabbar-icon { animation: tabbar-pop .25s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes tabbar-pop {
  0% { transform: translateY(0) scale(1); }
  55% { transform: translateY(-4px) scale(1.15); }
  100% { transform: translateY(-3px) scale(1.05); }
}
.tabbar-btn:active .tabbar-icon { transform: scale(.95); }
/* ボタン自体にもごく小さい押し込み感（ハプティックの代わりの視覚フィードバック）を足す。
   アイコンの動きより控えめにして、既存のtabbar-pop演出と喧嘩しないようにする。2026-09-29〜 */
.tabbar-btn { transition: transform .12s ease; }
.tabbar-btn:active { transform: scale(.97); }
@media (prefers-reduced-motion: reduce) {
  .tabbar-icon, .tabbar-btn { transition: none; }
  .tabbar-btn.pop .tabbar-icon { animation: none; }
  .tabbar-btn.on .tabbar-icon, .tabbar-btn:active .tabbar-icon, .tabbar-btn:active { transform: none; }
}

/* ボトムタブバーが常に出る4画面（マイログ・旅先一覧・ホーム・プロフィール）だけ、
   タブバーの高さ＋セーフエリア分の余白を下に足す（他の画面はタブバー自体が出ないので不要）。 */
.screen[data-screen="home"] .wrap,
.screen[data-screen="mylog"] .wrap,
.screen[data-screen="visited"] .wrap,
.screen[data-screen="profile"] .wrap {
  padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px) + 24px);
}

/* ============ プロフィール画面（Airbnbのプロフィールカードを手本にした。2026-09-28〜） ============ */
.profile-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border-radius: var(--radius-card); box-shadow: var(--card-shadow);
  padding: 18px 16px; margin: 4px 0 18px;
  animation: profile-card-in .35s ease both;
}
@keyframes profile-card-in {
  from { opacity: 0; transform: scale(.96); }
  to { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .profile-card { animation: none; }
}
.profile-avatar {
  flex: none; width: 60px; height: 60px; border-radius: 50%; overflow: hidden;
  background: var(--accent-soft-bg); color: var(--accent-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-info { flex: 1; min-width: 0; }
.profile-name { font-size: 16px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-stats { display: flex; gap: 14px; margin-top: 8px; flex-wrap: wrap; }
.profile-stat { display: flex; flex-direction: column; }
.profile-stat-num { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.profile-stat-label { font-size: 10.5px; color: var(--ink-soft); }
