/* 京大落研グルメ部
   iwatalog.com と同じ配色・フォントを土台に、見出しだけ寄席の「めくり」風にする。
   スマホ優先。ダークモードは端末の設定に合わせる。 */

:root {
  --bg: #F7F7F4;
  --surface: #FFFFFF;
  --ink: #1B1B1F;
  --muted: #6D6D72;
  --line: #D9D9D3;
  --accent: #3D5A80;
  --accent-ink: #FFFFFF;
  --accent-soft: #E3E9F1;
  --shu: #BF3923;
  --shu-ink: #FFFFFF;
  --shu-soft: #F6E3DE;
  --kin: #B38A33;
  --paper: #FBFAF7;
  --paper-ink: #1D1916;
  --paper-edge: #DCD5CB;
  --ok: #2F7D4F;
  --warn-bg: #FFF4DB;
  --warn-ink: #6B4A00;
  --shadow: 0 10px 30px -12px rgba(20, 20, 30, .25);

  --font: "Zen Kaku Gothic New", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  --brush: "Yuji Boku", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --radius: 12px;
  --tap: 48px;
  --tabbar-h: 64px;

  color-scheme: light dark;
  box-sizing: border-box;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17171A;
    --surface: #202024;
    --ink: #EDEDEA;
    --muted: #9A9AA0;
    --line: #34343A;
    --accent: #9DB4D6;
    --accent-ink: #17171A;
    --accent-soft: #26303D;
    --shu: #E0674F;
    --shu-ink: #17171A;
    --shu-soft: #3A2420;
    --paper: #EEEBE5;
    --paper-edge: #9C948A;
    --ok: #7CC495;
    --warn-bg: #3A3020;
    --warn-ink: #F2D9A6;
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
  }
}
:root[data-theme="dark"] {
  --bg: #17171A;
  --surface: #202024;
  --ink: #EDEDEA;
  --muted: #9A9AA0;
  --line: #34343A;
  --accent: #9DB4D6;
  --accent-ink: #17171A;
  --accent-soft: #26303D;
  --shu: #E0674F;
  --shu-ink: #17171A;
  --shu-soft: #3A2420;
  --paper: #EEEBE5;
  --paper-edge: #9C948A;
  --ok: #7CC495;
  --warn-bg: #3A3020;
  --warn-ink: #F2D9A6;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
}

*, *::before, *::after { box-sizing: inherit; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}
a { color: var(--accent); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
.booting { text-align: center; color: var(--muted); padding: 40vh 16px 0; margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 全体の枠 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  min-height: 48px;
  padding: env(safe-area-inset-top, 0px) 16px 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--brush); font-size: 20px; letter-spacing: .08em;
  color: var(--ink); text-decoration: none; padding: 6px 4px;
}
.page {
  max-width: 720px; margin: 0 auto;
  padding: 16px 16px calc(var(--tabbar-h) + 48px + env(safe-area-inset-bottom, 0px));
}
.page.plain { padding-bottom: 48px; }

/* 下のタブと ＋ ボタン */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding: 0 4px env(safe-area-inset-bottom, 0px);
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: var(--tabbar-h); color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 700;
}
.tab svg { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--accent); }
.fab-wrap { display: flex; justify-content: center; height: var(--tabbar-h); }
.fab {
  width: 64px; height: 64px; margin-top: -22px;
  display: grid; place-items: center;
  border: 4px solid var(--bg); border-radius: 50%;
  background: var(--shu); color: var(--shu-ink);
  box-shadow: var(--shadow);
}
.fab svg { width: 30px; height: 30px; }
.fab:active { transform: scale(.96); }

/* ---------- めくり（寄席の演者名の札）風の見出し ---------- */
.mekuri { display: flex; justify-content: center; margin: 18px 0 26px; }
.mekuri > span {
  position: relative; display: inline-block; min-width: 7em;
  padding: 16px 26px 10px;
  background: var(--paper); color: var(--paper-ink);
  font-family: var(--brush); font-weight: 400;
  font-size: clamp(26px, 7.5vw, 36px); line-height: 1.25; letter-spacing: .1em; text-align: center;
  border-radius: 2px;
  box-shadow:
    0 0 0 1px var(--paper-edge),
    0 5px 0 -1px var(--paper), 0 5px 0 0 var(--paper-edge),
    0 10px 0 -2px var(--paper), 0 10px 0 -1px var(--paper-edge);
}
.mekuri > span::before, .mekuri > span::after {
  content: ""; position: absolute; top: -10px; width: 12px; height: 20px;
  border: 3px solid var(--kin); border-radius: 8px;
}
.mekuri > span::before { left: 22%; }
.mekuri > span::after { right: 22%; }
.mekuri.small > span { font-size: 24px; min-width: 5em; padding: 12px 20px 8px; }

/* 小見出し */
.section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 700; margin: 32px 0 12px;
}
.section-title::before { content: ""; width: 4px; height: 1.2em; background: var(--shu); border-radius: 2px; }

/* ---------- 部品 ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px;
}
.card + .card { margin-top: 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.stack > * + * { margin-top: 12px; }
.mt { margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1 1 auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 10px 20px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink);
  font-weight: 700; text-decoration: none; line-height: 1.3;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.shu { background: var(--shu); border-color: var(--shu); color: var(--shu-ink); }
.btn.block { display: flex; width: 100%; }
.btn.big { min-height: 56px; font-size: 18px; }
.btn.quiet { border-color: transparent; background: transparent; color: var(--muted); }
.btn:active:not(:disabled) { transform: translateY(1px); }

/* タップで選ぶボタン（選ぶと色がつく） */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px; padding: 8px 16px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink);
  font-weight: 700; line-height: 1.3;
}
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip[aria-pressed="true"] .muted { color: inherit; opacity: .85; }
.chip.add { border-style: dashed; color: var(--accent); }

/* 入力欄 */
.field { display: block; margin: 0 0 18px; }
.field > .label { display: block; font-weight: 700; margin-bottom: 6px; }
.field > .hint, .field .hint { display: block; color: var(--muted); font-size: 13px; margin-top: 6px; }
.input, .textarea {
  display: block; width: 100%;
  min-height: var(--tap); padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink);
  font-size: 16px; /* 16px 未満だと iPhone が勝手に拡大する */
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
.input:focus, .textarea:focus { border-color: var(--accent); outline: 2px solid var(--accent-soft); }
.input-row { display: flex; gap: 8px; }
.input-row .input { flex: 1 1 auto; min-width: 0; }
.input-row .btn { flex: none; white-space: nowrap; }

/* お知らせ */
.notice { border-radius: 10px; padding: 12px 14px; font-size: 15px; }
.notice p { margin: 0; }
.notice p + p { margin-top: 6px; }
.notice.warn { background: var(--warn-bg); color: var(--warn-ink); }
.notice.error { background: var(--shu-soft); color: var(--ink); border-left: 4px solid var(--shu); }
.notice.ok { background: var(--accent-soft); color: var(--ink); border-left: 4px solid var(--accent); }
.fineprint { color: var(--muted); font-size: 12px; margin: 20px 0 0; text-align: center; }

/* 下から出るメニュー */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(10, 10, 15, .45);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .15s ease-out;
}
.sheet {
  width: 100%; max-width: 560px;
  max-height: 90vh; max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg); border-radius: 20px 20px 0 0;
  padding: 0 16px calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--shadow);
  animation: rise .2s ease-out;
}
.sheet > :first-child:not(h2) { margin-top: 20px; }
/* 題名はスクロールしても上に残す */
.sheet > h2 {
  position: sticky; top: 0; z-index: 2;
  margin: 0 0 8px; padding: 18px 0 10px;
  background: var(--bg); font-size: 16px; text-align: center;
}
.menu { display: grid; gap: 10px; }
.menu-item {
  display: flex; align-items: center; gap: 14px;
  min-height: 64px; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 17px; text-align: left;
}
.menu-item .desc { display: block; font-weight: 400; font-size: 13px; color: var(--muted); }
.menu-item .emoji { font-size: 26px; width: 36px; text-align: center; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(30px); opacity: .5; } }

/* 小さな知らせ（下に数秒出る） */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom, 0px)); z-index: 35;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 10px 18px; border-radius: 16px;
  background: var(--ink); color: var(--bg); font-weight: 700; font-size: 15px;
  box-shadow: var(--shadow);
  animation: rise .2s ease-out;
}

/* ---------- 画面ごと ---------- */
.login { max-width: 420px; margin: 0 auto; padding: 12vh 16px 48px; }
.login .mekuri { margin-bottom: 36px; }
.login form { margin-top: 12px; }

/* 名簿：回生タブ → 亭号 → 名前 */
.member-search { margin: 0 0 10px; }
.grade-tabs {
  display: flex; gap: 6px; overflow-x: auto;
  margin: 0 -16px; padding: 2px 16px 10px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.grade-tabs::-webkit-scrollbar { display: none; }
.grade-tab {
  flex: none; min-height: 44px; padding: 6px 14px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink); font-weight: 700;
}
.grade-tab[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.grade-tab .count, .teigo .count { margin-left: 6px; font-size: 12px; font-family: var(--font); opacity: .7; }
.teigo-group { margin-top: 14px; }
.teigo { margin: 0 0 8px; font-family: var(--brush); font-weight: 400; font-size: 19px; letter-spacing: .06em; }
.name-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.chip.name {
  display: flex; align-items: center; justify-content: center; gap: 2px;
  min-height: 48px; padding: 6px 8px; text-align: center; text-decoration: none; word-break: break-all;
}
.chip.link { color: var(--ink); }
.chip .ext { font-size: 11px; color: var(--muted); }
.chip.static { color: var(--muted); font-weight: 400; }
.chip.is-hidden { border-style: dashed; color: var(--muted); font-weight: 400; }
.quick-pick { display: grid; gap: 10px; padding: 12px; margin-bottom: 12px; background: var(--accent-soft); border-radius: 12px; }
.quick-label { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.add-member { font-weight: 400; color: var(--accent); border-style: dashed; }
.me-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.me-name { font-size: 20px; font-weight: 700; }

.placeholder { text-align: center; color: var(--muted); padding: 24px 8px; }

.meter { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 8px; }
.meter > span { display: block; height: 100%; background: var(--shu); transition: width .2s; }
.meter.good > span { background: var(--ok); }
.meter.fair > span { background: var(--kin); }

.admin-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.check { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 8px 0; }
.check input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.bulk-help { padding-left: 1.2em; margin: 0 0 16px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-weight: 700; }
.btn.small { min-height: 36px; padding: 4px 10px; font-size: 13px; }

dl.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }

/* ---------- 店 ---------- */
:root {
  --st-want: #3D5A80;    /* 行きたい：藍 */
  --st-planned: #B38A33; /* 予定：金 */
  --st-visited: #BF3923; /* 行った：朱 */
}
.field .req { margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--shu); color: var(--shu-ink); font-size: 11px; font-weight: 700; vertical-align: 2px; }
.fineprint.left { text-align: left; margin-top: 6px; }
.notice.row, .similar { margin: 0 0 18px; }
.search-results { margin: -6px 0 18px; }
.menu-item.result { justify-content: space-between; }
.menu-item .source {
  flex: none; align-self: flex-start; margin-top: 2px;
  padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 11px; font-weight: 700; color: var(--muted); white-space: nowrap;
}
/* ホットペッパーのクレジット（形を変えずに出す） */
.credit { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.hp-linked { margin: 0 0 18px; }
.hp-linked .row { margin-bottom: 4px; flex-wrap: nowrap; }
.hp-info { margin-top: 8px; }
.hp-box > p:first-child { margin-top: 0; }

/* 「くわしく入力（任意）」のたたむ欄 */
.more-fields { margin: 8px 0 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.more-fields > summary {
  display: block; min-height: 56px; padding: 12px 16px;
  font-weight: 700; cursor: pointer; list-style: none;
}
.more-fields > summary .small { display: block; margin-top: 2px; }
.more-fields > summary::-webkit-details-marker { display: none; }
.more-fields > summary::before { content: "＋ "; color: var(--accent); }
.more-fields[open] > summary::before { content: "− "; }
.more-fields > summary .small { font-weight: 400; }
.more-body { padding: 4px 16px 4px; border-top: 1px solid var(--line); }
.more-body .field:first-child { margin-top: 14px; }
.menu-item.result { min-height: 56px; font-size: 16px; }
.menu-item.danger { color: var(--shu); }
.similar ul { margin: 6px 0; padding-left: 1.2em; }
.similar li { margin: 4px 0; }
.similar li .small { margin-left: 8px; }
.place-line { margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }

.map-wrap { position: relative; }
.map { height: 300px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); z-index: 0; }
.map.small-map { height: 200px; margin: 12px 0 16px; }
.map-error { position: absolute; left: 8px; right: 8px; top: 8px; }
.leaflet-container { font-family: var(--font); }
.leaflet-control-attribution { font-size: 11px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .leaflet-tile-pane { filter: brightness(.78) contrast(1.05) saturate(.85); }
}
:root[data-theme="dark"] .leaflet-tile-pane { filter: brightness(.78) contrast(1.05) saturate(.85); }

/* ピン（しずく形）。色は状態ごと */
.pin span {
  position: relative; display: block; width: 26px; height: 26px; margin: 1px;
  border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--pin, var(--st-want)); border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
}
.pin span::after { content: ""; position: absolute; left: 8px; top: 8px; width: 7px; height: 7px; border-radius: 50%; background: #fff; }
.pin-want { --pin: var(--st-want); }
.pin-planned { --pin: var(--st-planned); }
.pin-visited { --pin: var(--st-visited); }
.pin-pick { --pin: #2F7D4F; }
/* カテゴリの絵文字入りの印：色（状態）のしずくの中に白い丸と絵文字 */
.pin-emoji span::after { display: none; }
.pin-emoji i {
  position: absolute; inset: 3px; display: grid; place-items: center; border-radius: 50%;
  background: #fff; transform: rotate(45deg); font-style: normal; font-size: 13px; line-height: 1;
}
/* 部室の印（めくり風の小さな札） */
.pin-clubroom span {
  display: block; padding: 2px 6px 1px;
  background: var(--paper); color: var(--paper-ink); border: 2px solid var(--kin); border-radius: 3px;
  font-family: var(--brush); font-size: 15px; line-height: 1.3; text-align: center; white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
}

/* 状態などの札 */
.badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: -8px 0 8px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.6; white-space: nowrap; border: 1px solid transparent; }
.badge.status-want { background: var(--st-want); color: #fff; }
.badge.status-planned { background: var(--st-planned); color: #fff; }
.badge.status-visited { background: var(--st-visited); color: #fff; }
.badge.pioneered { background: var(--paper); color: var(--paper-ink); border-color: var(--kin); }
.badge.closed { background: transparent; color: var(--muted); border-color: var(--muted); }
.badge.category { background: var(--paper); color: var(--paper-ink); border-color: var(--paper-edge); }
.facts { margin: 0; font-weight: 700; }

.want-box { margin: 16px 0; }
.want-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 8px; }
.want-count { font-size: 18px; }
.action-row { display: grid; gap: 10px; margin: 16px 0; }
.tight { margin: -4px 0 0; }
.owner-row { display: flex; align-items: center; gap: 10px; margin-top: 28px; padding-top: 12px; border-top: 1px solid var(--line); }
.btn.more { min-width: var(--tap); padding: 10px 14px; font-size: 20px; line-height: 1; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 1px 10px; border-radius: 999px; background: var(--accent-soft); font-size: 13px; }
.links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.pre { white-space: pre-wrap; }

.shop-list { list-style: none; margin: 16px 0 0; padding: 0; }
.shop-list li + li { border-top: 1px solid var(--line); }
.shop-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 4px; color: var(--ink); text-decoration: none; min-height: 64px; }
.shop-row-main { display: flex; flex-direction: column; min-width: 0; }
.shop-row-main strong { font-size: 17px; }
.shop-row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }

/* ---------- お店：地図と一覧 ---------- */
.view-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 0 0 12px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.view-tabs button { min-height: 48px; border: 0; background: var(--surface); color: var(--muted); font-weight: 700; }
.view-tabs button + button { border-left: 1px solid var(--line); }
.view-tabs button[aria-selected="true"] { background: var(--ink); color: var(--bg); }
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.chip.small-chip { min-height: 36px; padding: 4px 12px; font-size: 13px; }
.map.big-map { height: min(62vh, 560px); height: min(62dvh, 560px); }
.map-controls { position: absolute; right: 10px; top: 10px; z-index: 500; display: flex; flex-direction: column; gap: 6px; }
.map-controls .btn { box-shadow: var(--shadow); background: var(--surface); }
.map-note { position: absolute; left: 8px; right: 8px; bottom: 28px; z-index: 500; }
.pin-user span {
  display: block; width: 18px; height: 18px; margin: 1px; border-radius: 50%;
  background: #2B7BE4; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(43, 123, 228, .25);
}
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: center; margin: 8px 0; }
.legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: 0; }
.dot.status-want { background: var(--st-want); }
.dot.status-planned { background: var(--st-planned); }
.dot.status-visited { background: var(--st-visited); }
.shop-card { display: block; margin-top: 8px; color: var(--ink); text-decoration: none; }
.shop-card .row { margin: 2px 0; }
.link-like { color: var(--accent); font-weight: 700; }
.today-note { color: var(--shu); font-weight: 700; }
.filter-sheet .field { margin-bottom: 14px; }
/* まとめ表示（markercluster）の色をサイトに合わせる */
.leaflet-container .marker-cluster-small, .leaflet-container .marker-cluster-medium, .leaflet-container .marker-cluster-large { background-color: rgba(61, 90, 128, .25); }
.leaflet-container .marker-cluster-small div, .leaflet-container .marker-cluster-medium div, .leaflet-container .marker-cluster-large div { background-color: rgba(61, 90, 128, .88); color: #fff; font-weight: 700; font-family: var(--font); }
/* 地図の上に重ねる店の札（下の帰属表示は隠さない） */
.map-stage { position: relative; }
.map-stage .shop-card { position: absolute; left: 8px; right: 56px; bottom: 26px; z-index: 600; margin: 0; box-shadow: var(--shadow); }
.map-stage .card-close { position: absolute; right: 8px; bottom: 26px; z-index: 600; min-width: 40px; min-height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); font-size: 18px; }

/* ---------- 感想・写真 ---------- */
.fan path:first-child { fill: var(--shu); stroke: var(--shu); stroke-width: 2; stroke-linejoin: round; }
.fan .ribs path { stroke: var(--paper); stroke-width: 2; stroke-linecap: round; fill: none; }
.fan circle { fill: var(--kin); }
.fan.off path:first-child { fill: none; stroke: var(--line); stroke-width: 3; }
.fan.off .ribs path { stroke: var(--line); }
.fan.off circle { fill: var(--line); }
.fans { display: inline-flex; gap: 2px; vertical-align: middle; }
.fan-rating { display: flex; flex-direction: column; gap: 4px; }
.fan-buttons { display: flex; gap: 4px; }
.fan-buttons button { min-width: 52px; min-height: 52px; padding: 4px; border: 0; background: transparent; border-radius: 12px; }
.fan-buttons button:active { transform: scale(.94); }
.fan-word { font-size: 14px; font-weight: 700; color: var(--muted); }

.date-input { width: auto; min-width: 11em; flex: 0 1 auto; }
.input-row.yen { align-items: center; max-width: 16em; }
.chip.static-chip { background: var(--accent-soft); border-color: transparent; }
.picked-shop { display: flex; align-items: center; gap: 8px; padding: 12px 14px; }
.multi-selected { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; min-height: 44px; align-items: center; }
.sheet-done { position: sticky; bottom: -20px; padding: 12px 0 8px; background: var(--bg); }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.photo-grid.view { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); margin-top: 10px; }
.photo-thumb { position: relative; margin: 0; padding: 0; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
button.photo-thumb { cursor: zoom-in; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb.loading { display: grid; place-items: center; padding: 8px; font-size: 12px; color: var(--muted); text-align: center; }
.thumb-remove { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; font-size: 18px; line-height: 1; }
.thumb-move { position: absolute; left: 4px; bottom: 4px; display: flex; gap: 4px; }
.thumb-move button { width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .55); color: #fff; font-size: 18px; line-height: 1; }
.photo-add { aspect-ratio: 1; border: 2px dashed var(--line); border-radius: 10px; background: transparent; color: var(--accent); font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.photo-note { margin-top: 10px; }

.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .92); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: env(safe-area-inset-top, 0px) 8px env(safe-area-inset-bottom, 0px); }
.lightbox img { max-width: 100%; max-height: calc(100% - 80px); object-fit: contain; }
.lightbox-bar { display: flex; align-items: center; gap: 12px; margin-top: 12px; color: #fff; }
.lightbox-bar button { min-width: 48px; min-height: 44px; border: 1px solid rgba(255, 255, 255, .4); border-radius: 999px; background: transparent; color: #fff; font-size: 16px; padding: 4px 14px; }

/* 行きたい・行った */
.action-box { margin: 16px 0; }
.action-box .field { margin-bottom: 10px; }
.action-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 8px; }
.action-buttons .btn { min-height: 56px; font-size: 17px; }
.want-btn { border-color: var(--st-want); color: var(--st-want); }
.visit-date { align-items: center; gap: 6px; }
.small-input { min-height: 36px; padding: 4px 8px; font-size: 16px; min-width: 9.5em; }
.visit-done { margin-top: 12px; }

/* この店の記録のまとめ */
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; margin-bottom: 12px; }
.summary-grid > div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; background: var(--bg); border-radius: 10px; }
.summary-grid strong { font-size: 18px; display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: center; }
.summary-people { margin: 4px 0 8px; }
.summary-photos { margin-top: 12px; }
.visitors { margin-top: 6px; }

.review-card { margin-top: 12px; }
.review-card.visit-only { padding: 10px 14px; }
.review-card.visit-only p { margin: 0; }
.review-head { display: flex; align-items: center; gap: 8px; }
.review-comment { margin: 8px 0; font-size: 16px; }
.review-card dl.kv { margin-top: 6px; }
.review-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; }

@media (min-width: 720px) {
  .page { padding-left: 24px; padding-right: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- 企画 ---------- */
.badge.kind { background: var(--paper); color: var(--paper-ink); border-color: var(--paper-edge); }
.badge.phase-open { background: var(--accent); color: var(--accent-ink); }
.badge.phase-confirmed { background: var(--st-planned); color: #fff; }
.badge.phase-ended { background: transparent; color: var(--muted); border-color: var(--muted); }
.badge.phase-canceled { background: transparent; color: var(--shu); border-color: var(--shu); }
.action-row.two { grid-template-columns: 1fr 1fr; }
.plan-card { display: block; color: var(--ink); text-decoration: none; margin-top: 12px; }
.plan-card-head { display: flex; align-items: center; gap: 8px; }
.plan-card p { margin: 4px 0 0; }
.kind-emoji { font-size: 22px; line-height: 1; }
.plan-facts ul.plain, .plan-facts ol.plain { margin: 2px 0 0; padding-left: 1.2em; }
.plan-facts ul.plain { list-style: "・"; }
.plan-facts ol.plain:not(.numbered) { list-style: none; padding-left: 0; }
.plan-message { margin-top: 12px; }
.plan-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.new-plan { margin-bottom: 16px; }
.box-title { font-size: 16px; margin: 0 0 8px; }
.who { margin: 0 0 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.answer-box { margin: 16px 0; }
.answer-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0; }
.answer-buttons .chip { min-height: 52px; font-size: 16px; }
.chip.answer-yes[aria-pressed="true"] { background: var(--shu); border-color: var(--shu); color: var(--shu-ink); }
.waiting-note { color: var(--warn-ink); background: var(--warn-bg); padding: 0 6px; border-radius: 6px; }
.vote-grid { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.vote-grid p { margin: 0 0 4px; }
.vote-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.vote-row + .vote-row { border-top: 1px dashed var(--line); }
.vote-row .marks { display: flex; gap: 4px; flex: none; }
.chip.mark { min-width: 46px; padding: 6px 0; font-size: 18px; }
.people-box p { margin: 8px 0 0; }
.people { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.people li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--accent-soft); font-weight: 700; }
.people .org { font-size: 11px; padding: 0 6px; border-radius: 999px; background: var(--shu); color: var(--shu-ink); }
.people.waiting li { background: var(--warn-bg); color: var(--warn-ink); }
.mini-title { font-size: 13px; color: var(--muted); margin: 12px 0 6px; font-weight: 700; }
.tally-row { padding: 8px 10px; margin: 0 -10px; border-radius: 10px; }
.tally-row + .tally-row { border-top: 1px solid var(--line); }
.tally-row.best { background: var(--accent-soft); }
.tally-row p { margin: 2px 0 0; }
.tally .counts { font-weight: 700; white-space: nowrap; }
.ended-box { margin: 16px 0; }
.ended-box .action-row { margin: 10px 0 0; }
.plan-report { margin: 0 0 8px; }
.line-text { min-height: 280px; font-size: 15px; }
.num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--shu); color: var(--shu-ink); font-size: 13px; font-weight: 700; flex: none; }

/* 店・日時の入力（企画） */
.picked-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.picked-list li { display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; min-height: 44px; }
.sheet .picked-list { margin-bottom: 12px; }
.menu-item[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.pick-mark { font-size: 20px; color: var(--accent); flex: none; }
.datetime { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.time-input { width: auto; min-width: 7.5em; flex: 0 1 auto; }
.date-options { display: grid; gap: 8px; }
.date-option { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.date-option .datetime { margin-top: 0; }

/* 地図：食べ歩きの順番の線と番号つきの印 */
.leaflet-container path.route-line { stroke: var(--shu); }
.pin-num span::after { display: none; }
.pin-num b { position: absolute; inset: 0; display: grid; place-items: center; transform: rotate(45deg); color: #fff; font-size: 13px; font-weight: 700; line-height: 1; }
.shop-plans { list-style: none; padding: 4px 12px; margin: 0; }
.shop-plans li + li { border-top: 1px solid var(--line); }
.shop-plans a { display: flex; align-items: center; gap: 8px; min-height: 48px; color: var(--ink); text-decoration: none; }

/* ---------- ホーム ---------- */
.home-hello p { margin: 0; }
.home-hello p + * { margin-top: 8px; }
.new-since p { margin: 0 0 6px; }
.new-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.new-counts a, .new-counts button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  min-height: 64px; padding: 6px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--accent-soft); color: var(--ink); text-decoration: none; font-weight: 700; line-height: 1.3;
}
.new-counts strong { font-size: 22px; color: var(--accent); }
.new-counts span { font-size: 12px; font-weight: 400; color: var(--muted); }
.badge.new { background: var(--shu); color: var(--shu-ink); }
.recent-review .shop-name { font-weight: 700; text-decoration: none; color: var(--ink); }
.recent-review .review-by { margin: 8px 0 0; }
.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.wanted-list { padding: 0 12px; margin: 0; }
.waiting-plan { border-color: var(--shu); }
.my-state { margin-left: 8px; padding: 0 8px; border-radius: 999px; background: var(--shu-soft); color: var(--ink); font-weight: 700; }

/* ---------- 管理画面（段階7） ---------- */
.admin-tabs { display: flex; gap: 6px; overflow-x: auto; margin: -8px -16px 16px; padding: 2px 16px 10px; scrollbar-width: none; }
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tabs a { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-weight: 700; text-decoration: none; }
.admin-tabs a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.option-list { list-style: none; margin: 0; padding: 0; }
.option-list li { display: flex; align-items: center; gap: 6px; min-height: 48px; padding: 4px 0; }
.option-list li + li { border-top: 1px solid var(--line); }
.danger-btn { color: var(--shu); border-color: var(--shu); }
.audit-entry { padding: 12px 14px; }
.audit-entry header { gap: 6px 8px; }
.audit-entry.reverted { opacity: .65; }
.audit-diff { margin: 6px 0; padding-left: 1.2em; }
.audit-diff li { margin: 2px 0; }
.badge.audit-create { background: var(--ok); color: #fff; }
.badge.audit-update { background: var(--accent); color: var(--accent-ink); }
.badge.audit-delete { background: var(--shu); color: var(--shu-ink); }
.badge.audit-restore, .badge.audit-revert { background: var(--paper); color: var(--paper-ink); border-color: var(--kin); }
.audit-preview { max-height: 50vh; overflow-y: auto; }
.audit-preview .audit-entry { padding: 8px 10px; margin-top: 6px; }
.trash-list { list-style: none; padding: 4px 14px; margin: 0; }
.trash-list li { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 6px 0; }
.trash-list li + li { border-top: 1px solid var(--line); }
.trash-photo { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; flex: none; }
.backup-list { list-style: none; margin: 0; padding: 0; }
.backup-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 6px 0; border-top: 1px solid var(--line); }

/* ---------- 部員のページ・番付（段階9） ---------- */
.lock-mark { font-size: 11px; margin-left: 2px; }
.member-hero { --member-color: var(--shu); text-align: center; border-top: 6px solid var(--member-color); margin-top: 8px; }
.member-emoji { font-size: 48px; line-height: 1.2; }
.member-name { font-family: var(--brush); font-weight: 400; font-size: 30px; letter-spacing: .08em; margin: 4px 0 0; }
.member-hero p { margin: 4px 0; }
.member-bio { font-size: 16px; }
.member-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.member-stats > div { display: flex; flex-direction: column; align-items: center; padding: 10px 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.member-stats strong { font-size: 22px; }
.member-stats small { font-size: 12px; margin-left: 2px; font-weight: 400; }
.pick-list { list-style: none; padding: 0; margin: 0; }
.pick-list li { display: flex; align-items: flex-start; gap: 10px; }
.pick-list .num, .pick-edit .num { margin-top: 3px; }
.pick-comment { display: block; font-size: 14px; color: var(--muted); }
.pick-edit { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.pick-edit li { display: flex; align-items: flex-start; gap: 8px; }
.top-shops { padding: 4px 12px; }
.top-shops .rank { width: 2em; color: var(--muted); font-weight: 700; }
.nowrap { white-space: nowrap; }
.emoji-chips .chip { font-size: 22px; padding: 4px 10px; }
.emoji-input { max-width: 10em; }
.textarea.short { min-height: 80px; }
.color-chip { display: inline-flex; align-items: center; gap: 6px; }
.color-chip .swatch { width: 16px; height: 16px; border-radius: 50%; background: var(--swatch); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.banzuke { list-style: none; padding: 4px 14px; margin: 0; }
.banzuke li { display: flex; align-items: center; gap: 10px; min-height: 48px; }
.banzuke li + li { border-top: 1px solid var(--line); }
.banzuke .title { width: 3em; font-family: var(--brush); font-size: 17px; color: var(--muted); }
.banzuke li.top .title { color: var(--shu); }
.banzuke li.rank-1 .title { color: var(--kin); font-size: 20px; }
.banzuke li.me { background: var(--accent-soft); margin: 0 -14px; padding: 0 14px; }
.banzuke small { font-size: 12px; margin-left: 2px; font-weight: 400; }
.shop-picks { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 8px 0; }
.shop-pick { font-size: 14px; color: var(--ink); text-decoration: none; background: var(--shu-soft); padding: 4px 12px; border-radius: 999px; }

/* ---------- 使い方 ---------- */
.guide-banner { border-color: var(--accent); background: var(--accent-soft); margin-bottom: 12px; }
.guide-banner p { margin: 0; }
.guide-step { display: flex; gap: 12px; align-items: flex-start; }
.guide-step h2 { font-size: 16px; margin: 0 0 4px; }
.guide-step p { margin: 0 0 8px; }
.guide-step.first { border-color: var(--shu); }
.guide-emoji { font-size: 30px; line-height: 1.2; width: 40px; text-align: center; flex: none; }
.home-links a { margin: 0 6px; }

/* ---------- 今日どこ行く？ ---------- */
.random-result { text-align: center; animation: rise .25s ease-out; }
.random-result p { margin: 4px 0; }
.random-name { font-family: var(--brush); font-size: 30px; letter-spacing: .06em; line-height: 1.3; }
.random-result .badges { margin: 4px 0 8px; }

/* ---------- 上の「もどる」（ホーム画面に追加して開いたときは、ブラウザの戻るボタンが無いため） ---------- */
.topbar { position: sticky; }
.back-btn {
  position: absolute; left: 4px; bottom: 0; min-height: 44px; padding: 0 12px;
  border: 0; background: transparent; color: var(--accent); font-weight: 700; font-size: 15px;
}

/* ---------- 特集リスト・制覇率 ---------- */
.shop-links { margin: -4px 0 8px; text-align: right; }
.shop-links a { margin-left: 12px; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 4px 0 0; }
.progress + .progress { margin-top: 10px; }
.progress-head { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.progress-box { margin-bottom: 12px; }
.list-items { list-style: none; padding: 0; margin: 12px 0 0; }
.list-items li { display: flex; gap: 10px; align-items: flex-start; }
.list-items .num { margin-top: 3px; }
.list-shop { margin-right: 6px; }
.list-items p { margin: 4px 0 0; }
.list-comment { font-size: 15px; }
.shop-in-lists { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 6px 0; }
.shop-in-lists a { text-decoration: none; color: var(--ink); }
.center-chips { justify-content: center; margin-bottom: 8px; }
.progress-table .progress + .progress { margin-top: 12px; }
.progress-all { margin-bottom: 8px; }

/* ---------- 年間まとめ ---------- */
.yearly-stats { margin-bottom: 8px; }
.my-year { border-color: var(--shu); }
.my-year p { margin: 4px 0; }
.month-chart { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; align-items: end; height: 160px; padding: 12px 8px 8px; }
.month-bar { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.month-bar .bar { width: 70%; min-height: 2px; background: var(--shu); border-radius: 4px 4px 0 0; }
.month-bar .count { font-size: 11px; font-weight: 700; min-height: 1.2em; }
.month-bar .label { font-size: 10px; color: var(--muted); white-space: nowrap; }
.month-bar .count { order: -1; }
.kings { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.king p { margin: 2px 0; }
.lock-note { font-size: 14px; font-weight: 700; color: var(--ink); background: var(--warn-bg); display: inline-block; padding: 2px 12px; border-radius: 999px; }

/* 知らせのボタン（「記録しました［取り消す］」） */
.toast.with-action { display: flex; align-items: center; gap: 14px; width: max-content; padding: 6px 8px 6px 20px; white-space: nowrap; }
.toast-action { flex: none; min-height: 44px; padding: 0 16px; border: 1px solid currentColor; border-radius: 999px; background: transparent; color: inherit; font-weight: 700; white-space: nowrap; }
/* 行った記録の確かめ */
.visit-shop { text-align: center; font-weight: 700; font-size: 18px; margin: 0 0 12px; }
.action-buttons .btn.done-btn { border-color: var(--st-visited); color: var(--st-visited); font-size: 15px; padding-left: 8px; padding-right: 8px; white-space: nowrap; }
.dupes { padding: 4px 14px; }
.dupe-row + .dupe-row { border-top: 1px solid var(--line); }

/* ---- 開拓部：カテゴリ（管理画面・スポット） ---- */
.input-row .emoji-input { flex: 0 0 5em; max-width: 5em; text-align: center; }
.emoji-field { flex: 0 0 5.5em; }
.emoji-field .emoji-input { max-width: 100%; text-align: center; }
.input-row .field.grow { flex: 1 1 auto; min-width: 0; }
.option-list .btn { flex: none; white-space: nowrap; }

/* ---- 開拓部：地図・一覧のカテゴリ ---- */
/* カテゴリのボタンは横に並べ、はみ出したら横にすべらせる */
.category-bar { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; margin: 0 0 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.category-bar::-webkit-scrollbar { display: none; }
.category-bar .chip { flex: none; white-space: nowrap; }
.row-emoji { font-size: 22px; width: 30px; text-align: center; flex: none; }
.shop-row-main { flex: 1 1 auto; }
.genre-group + .genre-group { margin-top: 8px; }
.badge.season { background: var(--accent-soft); color: var(--ink); border-color: var(--line); }

/* ---- 開拓部：グルメ部からの取り込み ---- */
.import-progress { height: 12px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 8px 0 4px; }
.import-progress-bar { height: 100%; background: var(--accent); transition: width .2s; }
ol.steps { margin: 0; padding-left: 1.4em; }
ol.steps li + li { margin-top: 4px; }
.food-notice { border-color: var(--kin); }
.food-notice .btn { margin-top: 8px; }

/* ---- 開拓部：コース ---- */
.course-leg { list-style: none; margin: -4px 0 -4px 22px; padding: 2px 0; font-size: 13px; color: var(--muted); }
.pick-edit .course-leg { margin: 0 0 0 10px; }
.course-totals { margin: 4px 0 8px; }
