/* チャカフェ 共通スタイル（DESIGN.md の値をそのまま変数にしている） */
:root {
  --bg: #F6F4EF; --surface: #FFFFFF; --surface-2: #EFECE5; --glass: rgba(255,255,255,.92);
  --ink: #1C1F1D; --ink-2: #5E645F; --ink-3: #8B908A; --line: #E3DFD6; --on-ink: #FFFFFF;
  --accent: #2E5E4E;
  --open: #2F7D55; --closing: #B26A00; --closed: #8B908A; --caution: #B5452F;
  --tea-sencha: #7A9A3A; --tea-hojicha: #9A6B43; --tea-matcha: #4F7A3A; --tea-azuki: #8A4B4F;
  --shadow-card: 0 1px 2px rgba(28,31,29,.06), 0 4px 16px rgba(28,31,29,.06);
  --shadow-sheet: 0 -8px 32px rgba(28,31,29,.10);
  --font: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Hiragino Sans", sans-serif;
  --ease: cubic-bezier(.2,.8,.2,1);
  --tabbar-h: calc(56px + env(safe-area-inset-bottom));
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121412; --surface: #1B1E1B; --surface-2: #232723; --glass: rgba(27,30,27,.92);
    --ink: #ECEAE4; --ink-2: #A3A8A2; --ink-3: #6F756F; --line: #2E322E; --on-ink: #121412;
    --accent: #7FB89F; --open: #5FBF8A; --closing: #E3A040; --closed: #6F756F; --caution: #E07A62;
    --shadow-card: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
    --shadow-sheet: 0 -8px 32px rgba(0,0,0,.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121412; --surface: #1B1E1B; --surface-2: #232723; --glass: rgba(27,30,27,.92);
  --ink: #ECEAE4; --ink-2: #A3A8A2; --ink-3: #6F756F; --line: #2E322E; --on-ink: #121412;
  --accent: #7FB89F; --open: #5FBF8A; --closing: #E3A040; --closed: #6F756F; --caution: #E07A62;
  --shadow-card: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  --shadow-sheet: 0 -8px 32px rgba(0,0,0,.4);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); font: 400 15px/1.7 var(--font); letter-spacing: .02em; -webkit-font-smoothing: antialiased; }
/* 短い文は文節で折り返し、1〜2文字だけの行を作らない（長い段落は通常の折り返し） */
h1, h2, h3, .catch, .status, .lead, .lead-sm, .notice, .kv dd, .list-row small, .chip, .btn { word-break: auto-phrase; text-wrap: pretty; }
p { text-wrap: pretty; }
.prose .section > h2 { color: var(--ink); font-size: 19px; letter-spacing: .01em; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.num { font-variant-numeric: tabular-nums; }
.i { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ページ（地図以外） */
.page { max-width: 560px; margin: 0 auto; padding: 8px 20px calc(var(--tabbar-h) + 32px); }
.nav { height: 52px; display: flex; justify-content: space-between; align-items: center; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; }
.h-page { font-size: 26px; font-weight: 700; line-height: 1.35; letter-spacing: .02em; margin-top: 8px; }
.lead-sm { color: var(--ink-2); font-size: 14px; margin-top: 6px; }
.section { margin-top: 32px; }
.section > h2 { font-size: 12px; font-weight: 700; color: var(--ink-3); letter-spacing: .12em; margin-bottom: 12px; }

/* 店カード */
.cards { display: flex; flex-direction: column; gap: 12px; }
.card { position: relative; display: block; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-card);
  padding: 14px 16px 14px 19px; overflow: hidden; transition: transform .1s var(--ease); }
.card:active { transform: scale(.98); }
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--tea); }
.card-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.card h3 { font-size: 17px; font-weight: 700; line-height: 1.4; letter-spacing: .01em; }
.card .dist { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.card .catch { font-size: 14px; line-height: 1.6; color: var(--ink-2); margin-top: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; }
.card-foot:empty { display: none; }
.price { color: var(--ink-2); margin-left: auto; }

.tea-sencha { --tea: var(--tea-sencha); } .tea-hojicha { --tea: var(--tea-hojicha); }
.tea-matcha { --tea: var(--tea-matcha); } .tea-azuki { --tea: var(--tea-azuki); }

/* 営業状況 */
.status { font-size: 14px; margin-top: 4px; display: flex; align-items: center; gap: 6px; min-height: 22px; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.status .sub { color: var(--ink-2); }
.st-open { color: var(--open); } .st-closing { color: var(--closing); } .st-closed { color: var(--closed); }
.st-closed .dot, .st-later .dot { background: none; border: 1.5px solid currentColor; }
.st-later { color: var(--closed); }
.st-unknown { color: var(--ink-3); }
.cautions { display: inline-flex; gap: 10px; color: var(--caution); font-weight: 700; }
.cautions span { display: inline-flex; align-items: center; gap: 3px; }
.cautions .i { width: 14px; height: 14px; }

/* チップ */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { height: 36px; padding: 0 14px; border-radius: 999px; background: var(--surface-2); display: inline-flex; align-items: center;
  gap: 6px; font-size: 14px; white-space: nowrap; flex-shrink: 0; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.chip .badge { background: var(--accent); color: var(--on-ink); border-radius: 999px; font-size: 11px; min-width: 18px; padding: 0 5px; text-align: center; }
.chip .i { width: 16px; height: 16px; }

/* ボタン */
.btn { height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 15px; font-weight: 700; padding: 0 14px; }
.btn.primary { background: var(--ink); color: var(--on-ink); }
.btn.secondary { background: var(--surface-2); color: var(--ink); }
.btn.text { height: auto; padding: 0; color: var(--accent); font-weight: 400; justify-content: flex-start; }

/* 下のタブ */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; height: var(--tabbar-h); padding-bottom: env(safe-area-inset-bottom);
  background: var(--glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: 1px solid var(--line);
  display: flex; justify-content: space-around; z-index: 900; }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--ink-3); width: 96px; }
.tab .i { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--ink); font-weight: 700; }

/* 店ページ */
.kicker { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; color: var(--ink-2); }
.kicker .sw { width: 10px; height: 10px; border-radius: 3px; background: var(--tea); }
.shop-name { font-size: 26px; font-weight: 700; line-height: 1.35; letter-spacing: .01em; margin-top: 4px; }
.status-box { margin-top: 16px; background: var(--surface); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow-card); }
.status-box .status { font-size: 17px; font-weight: 700; margin: 0; }
.status-box .status .dot { width: 10px; height: 10px; }
.status-box .next { font-size: 14px; color: var(--ink-2); margin-top: 2px; padding-left: 16px; }
.notice { margin-top: 12px; font-size: 14px; color: var(--caution); display: flex; flex-wrap: wrap; gap: 4px 12px; font-weight: 700; }
.notice span { display: inline-flex; align-items: center; gap: 4px; }
.notice .i { width: 16px; height: 16px; }
.lead { margin-top: 14px; font-size: 15px; line-height: 1.8; }
.actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; margin-top: 18px; }
.actions .primary { grid-column: span 1; }
.kv { display: grid; grid-template-columns: 84px 1fr; row-gap: 12px; column-gap: 8px; font-size: 15px; }
.kv dt { color: var(--ink-2); font-size: 14px; }
.kv dd .p { color: var(--ink-2); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 13px; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); }
details.week { margin-top: 12px; }
details.week summary { color: var(--accent); font-size: 14px; cursor: pointer; list-style: none; }
details.week summary::-webkit-details-marker { display: none; }
.week-table { display: grid; grid-template-columns: 40px 1fr; row-gap: 6px; margin-top: 10px; font-size: 14px; }
.week-table .today { font-weight: 700; }
.hscroll { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -20px; padding: 2px 20px 8px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll .card { flex: 0 0 82%; scroll-snap-align: start; }
.meta { margin-top: 32px; font-size: 13px; color: var(--ink-3); display: flex; flex-direction: column; gap: 6px; }

/* 探す */
.search-field { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 16px; background: var(--surface-2); border-radius: 14px; color: var(--ink-3); margin-top: 12px; }
.search-field input { flex: 1; border: 0; background: none; font: inherit; color: var(--ink); outline: none; min-width: 0; }
.areas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.area { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-card); padding: 14px; display: block; }
.area b { font-size: 15px; font-weight: 700; display: block; }
.area span { font-size: 13px; color: var(--ink-2); }
.list-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row .ic { width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; color: var(--accent); flex-shrink: 0; }
.list-row .t { flex: 1; }
.list-row .t small { display: block; font-size: 13px; color: var(--ink-2); }
.list-row .n { color: var(--ink-2); font-size: 14px; }
.list-row > .i:last-child { color: var(--ink-3); }
.empty { color: var(--ink-2); font-size: 14px; padding: 24px 0; text-align: center; }

/* 読み物（お茶・このサイトについて） */
.prose h2 { font-size: 19px; font-weight: 700; margin: 36px 0 8px; letter-spacing: .01em; }
.prose h3 { font-size: 16px; font-weight: 700; margin: 20px 0 4px; }
.prose p, .prose li { color: var(--ink); line-height: 1.85; }
.prose p + p { margin-top: 10px; }
.prose ul { padding-left: 1.2em; margin-top: 6px; }
.prose .muted { color: var(--ink-2); font-size: 14px; }
.tea-item { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-card); padding: 16px 18px 16px 21px; position: relative; overflow: hidden; margin-top: 12px; }
.tea-item::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--tea); }
.tea-item h3 { margin: 0; font-size: 17px; }
.tea-item p { font-size: 14px; color: var(--ink-2); margin-top: 4px; line-height: 1.75; }
.tea-item a { display: inline-flex; align-items: center; gap: 2px; margin-top: 8px; color: var(--accent); font-size: 14px; }
.tea-item a .i { width: 16px; height: 16px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ===== トップ（地図） ===== */
body.is-map { overflow: hidden; height: 100dvh; overscroll-behavior: none; }
#map { position: fixed; inset: 0; }
.is-dark #map canvas { filter: invert(.92) hue-rotate(180deg) saturate(.5) brightness(.95); }
.top-bar { position: fixed; top: 0; left: 0; right: 0; padding: calc(env(safe-area-inset-top) + 10px) 16px 0; z-index: 500; pointer-events: none; }
.top-bar > * { pointer-events: auto; }
.searchbar { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 16px; background: var(--glass);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-radius: 14px; box-shadow: var(--shadow-card); color: var(--ink-3); font-size: 15px; }
.searchbar .logo { font-size: 16px; font-weight: 700; color: var(--ink); letter-spacing: .12em; padding-right: 12px; border-right: 1px solid var(--line); }
.top-bar .chips { margin-top: 10px; }
.top-bar .chip { background: var(--glass); box-shadow: var(--shadow-card); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.top-bar .chip[aria-pressed="true"] { background: var(--ink); }
.map-ctrls { position: fixed; right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 500; transition: bottom .28s var(--ease); }
.map-btn { width: 44px; height: 44px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-card); display: grid; place-items: center; }
.map-btn[data-theme-toggle] { width: 36px; height: 36px; margin-left: 8px; border-radius: 10px; color: var(--ink-2); }
.map-btn[data-theme-toggle] .i { width: 17px; height: 17px; }
.theme-ic-dark { display: none; } .is-dark .theme-ic-light { display: none; } .is-dark .theme-ic-dark { display: contents; }
.theme-ic-light { display: contents; }
.maplibregl-ctrl-top-right { top: calc(env(safe-area-inset-top) + 112px) !important; }
.maplibregl-ctrl-attrib { font-size: 10px; }

.pin-wrap { position: relative; width: 40px; height: 40px; display: grid; place-items: center; }
.pin { display: grid; place-items: center; border-radius: 50%; box-shadow: 0 2px 6px rgba(0,0,0,.25); transition: transform .16s var(--ease); }
.pin.is-open { width: 26px; height: 26px; background: var(--accent); border: 2px solid var(--tea); }
.pin.is-open::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.pin.is-closed { width: 20px; height: 20px; background: var(--surface); border: 2px solid var(--closed); }
.pin.sel { transform: scale(1.35); }
.pin-label { display: none; position: absolute; top: 40px; left: 50%; transform: translateX(-50%); background: var(--surface); color: var(--ink);
  padding: 5px 10px; border-radius: 10px; box-shadow: var(--shadow-card); font-size: 13px; font-weight: 700; white-space: nowrap; }
.pin.sel + .pin-label { display: block; }
.me { width: 16px; height: 16px; border-radius: 50%; background: var(--ink); border: 3px solid var(--surface); box-shadow: 0 0 0 10px rgba(28,31,29,.12); }

.sheet { position: fixed; left: 0; right: 0; bottom: var(--tabbar-h); background: var(--glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-radius: 24px 24px 0 0; box-shadow: var(--shadow-sheet); z-index: 600; display: flex; flex-direction: column; max-width: 640px; margin: 0 auto; }
.sheet-handle { padding: 8px 20px 10px; touch-action: none; cursor: grab; flex-shrink: 0; }
.grabber { width: 36px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 12px; }
.sheet-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.sheet-head h2 { font-size: 17px; font-weight: 700; letter-spacing: .01em; }
.sheet-head .meta-r { font-size: 13px; color: var(--ink-2); }
.sheet-list { overflow-y: auto; padding: 0 16px 24px; flex: 1; overscroll-behavior: contain; }
.sheet[data-state="min"] .sheet-list { visibility: hidden; }
.loc-hint { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 14px; margin-bottom: 12px; border-radius: 12px;
  background: var(--surface-2); color: var(--ink); font-size: 14px; }
.loc-hint .i { width: 18px; height: 18px; color: var(--accent); }

dialog.cond { margin: auto auto 0; width: 100%; max-width: 640px; border: 0; border-radius: 24px 24px 0 0; background: var(--surface); color: var(--ink);
  padding: 8px 20px calc(16px + env(safe-area-inset-bottom)); max-height: 85dvh; }
dialog.cond::backdrop { background: rgba(0,0,0,.35); }
.cond-top { display: flex; justify-content: space-between; align-items: center; height: 48px; }
.cond-top h2 { font-size: 17px; font-weight: 700; }
.cond-group { margin-top: 18px; }
.cond-group h3 { font-size: 12px; color: var(--ink-3); letter-spacing: .12em; margin-bottom: 8px; font-weight: 700; }
.cond-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cond-foot { display: flex; gap: 8px; margin-top: 24px; }
.cond-foot .btn { flex: 1; }
.preset { background: var(--accent) !important; color: var(--on-ink) !important; }

/* 表示の切り替え（探す） */
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; }
.segmented button { height: 40px; border-radius: 9px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; color: var(--ink-2); }
.segmented button .i { width: 16px; height: 16px; }
.segmented button[aria-checked="true"] { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: var(--shadow-card); }
.segmented + .lead-sm { margin-top: 8px; }

.pref { font-size: 14px; font-weight: 700; color: var(--ink-2); margin: 18px 0 10px; }
.section > h2 + .pref { margin-top: 0; }
