:root {
  color-scheme: light;
  --bg: #f6f4f0; --card: #ffffff; --ink: #2b2724; --muted: #948b84; --line: #ebe6df;
  --black: #1f1c1a; --accent: #ff7f6e; --accent-ink: #ffffff; --soft: #fff0ec;
  --shadow: 0 1px 2px rgba(60, 40, 30, .05), 0 4px 14px rgba(60, 40, 30, .06);
  /* ジャンルの色（淡いパステル） */
  --g-all: #1f1c1a; --g-cafe: #f7e8d5; --g-food: #e4efd8; --g-sweets: #fbe1ea; --g-bar: #f9ddd5;
  --g-sight: #dde9f6; --g-temple: #e8e1f6; --g-nature: #d8efe5; --g-stay: #efe9df; --g-other: #eeebe6;
}
/* よるモード（せっていで選んだ時だけ） */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #34302d; --card: #403b37; --ink: #f6f1ec; --muted: #c2b8af; --line: #524b46; --black: #f6f1ec; --soft: #55423d;
  --shadow: 0 4px 14px rgba(0, 0, 0, .18);
  --g-cafe: #5a4b3a; --g-food: #44523b; --g-sweets: #5b4049; --g-bar: #5c443d; --g-sight: #3e4b5b; --g-temple: #4a4359; --g-nature: #3c5149; --g-stay: #4d463d; --g-other: #4a4541;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font-family: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", sans-serif; font-weight: 500;
  font-size: 15px; display: flex; flex-direction: column; letter-spacing: .02em;
}
a { color: inherit; }
button { font: inherit; font-weight: 700; cursor: pointer; border: 0; border-radius: 999px; padding: 9px 16px; white-space: nowrap; background: var(--black); color: var(--bg); transition: transform .12s; }
button:active { transform: scale(.96); }
button.ghost { background: transparent; color: var(--muted); }
button.small { padding: 5px 12px; font-size: 13px; }
button.sub { background: var(--card); color: var(--ink); border: 1.5px solid var(--line); }
button.danger { background: #e9a9a0; color: #fff; }
input, textarea { font: inherit; color: var(--ink); background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 14px; width: 100%; min-width: 0; outline: none; }
input:focus, textarea:focus { border-color: var(--ink); }
textarea { resize: none; }
h1 { font-size: 18px; font-weight: 900; margin: 0; }
h2 { font-size: 16px; font-weight: 700; margin: 16px 0 8px; }
h2:first-child { margin-top: 2px; }
.muted { color: var(--muted); font-size: 13px; margin: 4px 0; }
.row { display: flex; gap: 8px; align-items: center; }
.eyebrow { display: block; font-family: ui-sans-serif, -apple-system, "Helvetica Neue", sans-serif; font-size: 10px; letter-spacing: .18em; color: var(--muted); font-weight: 600; }

/* ヘッダー */
.top { padding: 10px 16px 10px; padding-top: max(10px, env(safe-area-inset-top)); background: var(--bg); border-bottom: 1px solid var(--line); }
.brand { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.logo { font-size: 18px; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--card); box-shadow: var(--shadow); }
.add { display: flex; gap: 8px; align-items: center; }
.add textarea { border-radius: 999px; height: 44px; padding: 11px 16px; }
#addBtn { width: 44px; height: 44px; padding: 0; font-size: 22px; flex: none; background: var(--accent); color: #fff; }
.hint { margin: 6px 4px 0; font-size: 11px; color: var(--muted); }
main { flex: 1; overflow: auto; }
.tab { display: none; padding: 4px 16px 28px; }
.tab.active { display: block; }
#tab-map { padding: 0; height: 100%; }
#map { height: 100%; min-height: 400px; }

/* 見出し（雑誌っぽく） */
.masthead { text-align: center; padding: 18px 0 10px; }
.masthead .title { font-size: 24px; font-weight: 900; margin: 4px 0 2px; letter-spacing: .06em; }
.mode-title { font-size: 18px; font-weight: 900; margin: 14px 2px 12px; }
.mode-title .eyebrow { margin-bottom: 2px; }

/* 行きたい／行った の切り替え */
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--card); border-radius: 999px; padding: 4px; box-shadow: var(--shadow); margin-top: 10px; }
.seg button { background: transparent; color: var(--muted); padding: 8px 0; }
.seg button.on { background: var(--black); color: var(--bg); }

/* ジャンルのタイル */
.genres { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 12px; }
.tile { background: var(--card); color: var(--ink); border-radius: 16px; padding: 10px 10px 9px; text-align: left; display: flex; flex-direction: column; gap: 1px; border: 1.5px solid transparent; font-weight: 500; min-height: 82px; }
.tile .ti { font-size: 17px; margin-bottom: 4px; }
.tile .en { font-family: ui-sans-serif, -apple-system, sans-serif; font-size: 8.5px; letter-spacing: .14em; color: var(--muted); }
.tile b { font-size: 12.5px; }
.tile small { font-size: 10.5px; color: var(--muted); }
.tile.on { border-color: var(--ink); }
.tile.g-all { background: var(--black); color: var(--bg); }
.tile.g-all .en, .tile.g-all small { color: var(--bg); opacity: .7; }
.g-cafe { background: var(--g-cafe); } .g-food { background: var(--g-food); } .g-sweets { background: var(--g-sweets); } .g-bar { background: var(--g-bar); }
.g-sight { background: var(--g-sight); } .g-temple { background: var(--g-temple); } .g-nature { background: var(--g-nature); } .g-stay { background: var(--g-stay); } .g-other { background: var(--g-other); }
.search { border-radius: 999px; margin-bottom: 12px; }

/* お店カード（ジャンルの色で塗る） */
.place { border-radius: 20px; padding: 12px; margin-bottom: 10px; }
.place-top { display: flex; gap: 12px; align-items: flex-start; }
.place .body { flex: 1; min-width: 0; }
.place .name { font-weight: 900; font-size: 16px; line-height: 1.35; }
.place .addr { font-size: 12px; color: var(--ink); opacity: .75; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tags { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.tag { font-size: 11px; padding: 2px 9px; border-radius: 999px; background: rgba(255,255,255,.7); font-weight: 700; }
.ghost-tag { background: transparent; border: 1px solid rgba(0,0,0,.12); color: var(--muted); }
.place-acts { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.pill { font-size: 12px; padding: 6px 12px; border-radius: 999px; background: var(--card); color: var(--ink); border: 1.5px solid rgba(0,0,0,.08); text-decoration: none; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.pill-love { background: var(--accent); color: #fff; border-color: transparent; }
.pill-x { margin-left: auto; background: transparent; color: var(--muted); border-color: transparent; padding: 6px 8px; }
.date, .credit { font-size: 10.5px; color: var(--ink); opacity: .55; margin-top: 6px; }
.credit { margin-top: 6px; }
:root[data-theme="dark"] .tag { background: rgba(0,0,0,.2); }
:root[data-theme="dark"] .pill { border-color: rgba(255,255,255,.1); }

/* 写真 */
.ph { width: 72px; height: 72px; border-radius: 16px; flex: none; position: relative; overflow: hidden; display: grid; place-items: center; font-size: 28px; cursor: pointer; background: rgba(255,255,255,.65); }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph .cam { position: absolute; right: 3px; bottom: 3px; font-size: 10px; background: rgba(255,255,255,.92); border-radius: 999px; width: 20px; height: 20px; display: grid; place-items: center; }

/* プランのお知らせ */
.ready { border-radius: 20px; padding: 14px 16px; margin: 4px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--black); color: var(--bg); }
.ready b { font-size: 15px; }
.ready .muted { color: var(--bg); opacity: .7; }
.ready button { background: var(--accent); color: #fff; }

.card { background: var(--card); border-radius: 20px; padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow); }

/* プラン */
.plan-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 12px 0 10px; }
.plan-tabs button.small { background: var(--black); color: var(--bg); }
.plan-tabs button.sub { background: var(--card); color: var(--ink); }
.hero { background: var(--card); border-radius: 22px; padding: 18px; margin-bottom: 12px; box-shadow: var(--shadow); text-align: center; }
.hero .big { font-size: 24px; font-weight: 900; margin: 4px 0; }
.day h3 { font-family: ui-sans-serif, -apple-system, sans-serif; font-size: 11px; letter-spacing: .2em; color: var(--muted); margin: 14px 0 6px; }
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { display: grid; grid-template-columns: 44px 1fr; gap: 8px; align-items: center; padding: 3px 0; }
.tl .t { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; text-align: right; }
.block { display: flex; align-items: center; gap: 10px; border-radius: 14px; padding: 10px 12px; border-left: 4px solid rgba(0,0,0,.18); }
.block b { display: block; font-size: 14.5px; }
.block small { color: var(--ink); opacity: .6; font-size: 11.5px; }
.block .no { width: 22px; height: 22px; border-radius: 999px; background: var(--black); color: var(--bg); display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; }
.stop-ph { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; flex: none; }
.leg-row .leg { color: var(--muted); font-size: 11.5px; padding: 2px 0 2px 14px; border-left: 2px dotted var(--line); margin-left: 10px; }
.cost { width: 100%; border-collapse: collapse; font-size: 14px; }
.cost td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.cost td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.cost tr.total td { font-weight: 900; border-bottom: 0; font-size: 18px; padding-top: 12px; }
.recs { display: grid; }
.rec { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); }
.rec:first-child { border-top: 0; }

/* 広告・下のメニュー */
.ad { text-align: center; font-size: 11px; color: var(--muted); background: var(--card); border-top: 1px solid var(--line); padding: 14px 0; }
.bottom { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--card); padding: 6px 10px; padding-bottom: max(6px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); gap: 4px; }
.bottom button { background: transparent; color: var(--muted); padding: 7px 0; position: relative; font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.bottom .ni { font-size: 18px; filter: grayscale(1); opacity: .5; }
.bottom button.active { background: var(--black); color: var(--bg); }
.bottom button.active .ni { filter: none; opacity: 1; }
.badge { position: absolute; top: 2px; left: 58%; background: var(--accent); color: #fff; border-radius: 9px; font-size: 10px; padding: 0 6px; line-height: 16px; }

/* シート・お知らせ */
.sheet { position: fixed; inset: 0; background: rgba(30, 25, 20, .3); display: flex; align-items: flex-end; z-index: 1000; }
.sheet[hidden] { display: none; }
.sheet-body { background: var(--card); width: 100%; max-height: 80%; overflow: auto; border-radius: 24px 24px 0 0; padding: 10px 18px 20px; }
.grip { width: 44px; height: 5px; border-radius: 9px; background: var(--line); margin: 0 auto 8px; }
.result { display: block; width: 100%; text-align: left; background: transparent; color: var(--ink); border-top: 1px solid var(--line); border-radius: 0; padding: 12px 2px; }
.result small { display: block; color: var(--muted); font-weight: 500; }
.toast { position: fixed; left: 16px; right: 16px; bottom: 130px; background: var(--black); color: var(--bg); padding: 12px 16px; border-radius: 16px; z-index: 1100; display: flex; justify-content: space-between; gap: 10px; align-items: center; font-weight: 700; }
.toast[hidden] { display: none; }
.toast button { background: var(--accent); color: #fff; padding: 5px 12px; }
.empty { text-align: center; color: var(--muted); padding: 36px 16px; line-height: 1.9; }
.empty .big { font-size: 40px; display: block; margin-bottom: 6px; }
.switch { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; }
.switch input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.leaflet-container { font-family: inherit; }

/* 営業時間 */
.hours-line { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; margin-top: 10px; padding: 8px 12px; border-radius: 14px; background: rgba(255,255,255,.6); color: var(--ink); font-weight: 700; font-size: 12.5px; text-align: left; white-space: normal; }
.hours-line small { font-weight: 500; font-size: 10.5px; opacity: .55; }
.hours-line .warn, .warn { color: #c4452f; font-weight: 700; }
:root[data-theme="dark"] .hours-line { background: rgba(0,0,0,.18); }
.sheet h3 { font-size: 13px; margin: 14px 0 6px; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.dayt { padding: 9px 0; background: var(--g-food); color: var(--ink); }
.dayt.off { background: var(--black); color: var(--bg); }
.tc { justify-content: space-between; padding: 4px 0; font-size: 13px; }
.plan-date { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 10px; }
.plan-date input { width: auto; }
.block .hint-time { display: block; font-size: 11px; color: var(--ink); opacity: .7; }
.block .warn { font-size: 11px; display: block; }
.closed-day { color: var(--muted); font-size: 12.5px; padding: 6px 0 6px 52px; }
.skipped { background: #fdecea; color: #8a3a2c; border-radius: 16px; padding: 12px 14px; margin-bottom: 12px; font-size: 13px; }
.skipped b { display: block; margin-bottom: 4px; }

.share-row { margin-top: 14px; gap: 8px; flex-wrap: wrap; }
.share-row .pill { flex: 1; justify-content: center; text-align: center; }
.line-pill { background: #06c755; color: #fff; border-color: #06c755; }

.hint-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.hint-row .hint { flex: 1; }
.shot-btn { margin-top: 6px; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.chip { font-size: 13px; padding: 6px 12px; border-radius: 999px; background: var(--card); color: var(--ink); border: 1.5px solid var(--line); font-weight: 700; }

/* LINE版：宿カード・PR表示 */
#ad[hidden] { display: none; }
.pr { font-size: 10px; font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; vertical-align: middle; margin-left: 4px; }
.hotels { display: flex; flex-direction: column; gap: 10px; }
.hotel { display: flex; gap: 10px; text-decoration: none; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 8px; }
.hotel img, .hotel-noimg { width: 92px; height: 92px; object-fit: cover; border-radius: 10px; flex: none; background: var(--line); display: flex; align-items: center; justify-content: center; font-size: 30px; }
.hotel-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hotel-body b { font-size: 14px; line-height: 1.35; }
.hotel-body small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.hotel-price { font-weight: 900; color: var(--accent); }
.hotel-go { font-size: 12px; font-weight: 700; color: #bf0000; }

/* 県をまたぐ旅 */
.combo { margin: 0 0 10px; }
.combo .chips { margin-top: 6px; }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.area-tag { font-size: 12px; font-weight: 700; color: var(--accent); }
.leg.transfer { font-weight: 700; color: var(--ink); }
.stay-head { font-size: 13px; font-weight: 700; margin: 12px 0 6px; }
