/* ===== テーマ(配色) =====
   既定はブランド(どこジム♪)に合わせた明るいポップ配色。
   ツールバーの🎨ボタンで dark / pop を切替できる(data-theme属性)。 */
:root,
:root[data-theme="light"] {
  --bg: #fff5fa;
  --panel: #ffffff;
  --panel2: #fff0f6;
  --border: #f3c6dd;
  --text: #2b2230;
  --muted: #7d6f86;
  --accent: #ff4d88;       /* ブランドピンク */
  --accent2: #7cc02a;      /* ブランドグリーン */
  --chip: #fff0f6;
  --warn: #f08a24;
  --row-hover: #fff0f6;
  --note-bg: #fff7ea;
  --special-bg: #fff2e0;
  --scheme: light;
}

/* ダーク(従来の暗い配色) */
:root[data-theme="dark"] {
  --bg: #0f1115;
  --panel: #1a1e26;
  --panel2: #232834;
  --border: #38404f;
  --text: #f4f6fa;
  --muted: #c2cad8;
  --accent: #6db1ff;
  --accent2: #4dd6a0;
  --chip: #2b3242;
  --warn: #ffc06b;
  --row-hover: #25313f;
  --note-bg: #20222b;
  --special-bg: #2e2410;
  --scheme: dark;
}

/* ポップ(明るめ・彩度高め。既定より一段華やか) */
:root[data-theme="pop"] {
  --bg: #fffbe8;
  --panel: #ffffff;
  --panel2: #fff4d6;
  --border: #ffd98a;
  --text: #3a2a10;
  --muted: #9a7d4a;
  --accent: #ff6a00;       /* オレンジ */
  --accent2: #16a34a;
  --chip: #fff4d6;
  --warn: #e0531b;
  --row-hover: #fff4d6;
  --note-bg: #fff7e0;
  --special-bg: #ffeccc;
  --scheme: light;
}

* { box-sizing: border-box; }

html {
  /* ネイティブ部品(select/option/スクロールバー等)をテーマに追従させ、
     プルダウンの選択肢が見えなくなるのを防ぐ */
  color-scheme: var(--scheme);
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

header {
  position: sticky;
  top: 0;
  z-index: 1200;
  background: var(--panel);
  border-bottom: 2px solid var(--accent);
  padding: 8px 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
/* タブは折り返さず横スクロールで全項目に到達できるように(固定ヘッダー時の高さ抑制) */
.tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.tabs .tab { flex: 0 0 auto; }

/* ツールバー: 左にロゴ、右にメタ情報＋テーマ切替 */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.brand { margin: 0; display: inline-flex; align-items: center; }
.brand a.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand a { display: inline-flex; align-items: center; text-decoration: none; }
.brand-logo {
  height: 92px;
  width: auto;
  display: block;
  flex-shrink: 0;
}
.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.brand-name {
  font-size: 20px;
  font-weight: 900;
  line-height: 1.15;
  color: var(--text);
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.brand-nickname {
  font-size: 0.88em;
  font-weight: 800;
  color: var(--accent);
}
.brand-catch {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--accent);
  white-space: nowrap;
  letter-spacing: 0.03em;
}
.brand-aliases {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--muted);
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.brand-tagline {
  flex: 1 1 220px;
  margin: 0 4px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
  min-width: 0;
}
.brand-tagline-genres {
  display: inline-block;
  color: var(--accent);
  font-weight: 700;
}
/* スクリーンリーダー/クローラー向け(視覚的には非表示)のテキスト見出し */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
/* トップのリード文(SEO・初訪問者向けの説明) */
.lead {
  margin: 6px 0 0;
  padding: 0 16px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
  max-width: 1000px;
}
.lead strong { color: var(--text); font-weight: 700; }

/* 元ネタ『今日はどこでエアロ？』への敬意リンク */
.homage {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 16px 0;
  padding: 12px 14px;
  border: 1px solid var(--accent);
  border-radius: 14px;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--accent) 10%, transparent),
    color-mix(in srgb, var(--accent) 4%, transparent));
}
.homage-heart { color: var(--accent); font-size: 18px; line-height: 1; }
.homage-text {
  flex: 1 1 280px;
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.55;
}
.homage-text strong { color: var(--accent); }
.homage-btn {
  flex: 0 0 auto;
  display: inline-block;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 40%, transparent);
}
.homage-btn:hover { filter: brightness(1.06); }
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.toolbar-right .sub { color: var(--muted); font-size: 12.5px; }
.theme-toggle {
  background: var(--chip);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  width: 38px;
  height: 38px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle:hover { border-color: var(--accent); }

.title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.title h1 { font-size: 19px; margin: 0; }
.title .sub { color: var(--muted); font-size: 13px; }

.modetabs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.modetab {
  background: transparent;
  border: 1px solid var(--border);
  border-bottom: 2px solid transparent;
  color: var(--muted);
  padding: 8px 18px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
}
.modetab:hover { color: var(--text); border-color: var(--accent); }
.modetab.active {
  background: var(--panel);
  color: var(--text);
  border-color: var(--border);
  border-bottom-color: var(--accent);
}

.tabs {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.tab {
  background: var(--chip);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12.5px;
}
.tab:hover { border-color: var(--accent); }
.tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #06101f;
  font-weight: 700;
}

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
  padding: 12px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.field { display: flex; flex-direction: column; gap: 3px; }
.field label {
  font-size: 12.5px;
  color: var(--text);
  font-weight: 600;
  opacity: 0.85;
}
.field select, .field input {
  background-color: var(--panel2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 9px;
  min-width: 120px;
  font-size: 14px;
}
/* プルダウンの選択肢(ネイティブ popup)の地色・文字色を明示 */
.field select option {
  background-color: var(--panel2);
  color: var(--text);
}
.field input::placeholder { color: var(--muted); opacity: 1; }
.field input.q { min-width: 200px; }
/* 地域は利用者ごとにほぼ固定で重要なため、視覚的に強調する */
#s-region, #f-region {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(109, 177, 255, 0.35);
  font-weight: 700;
  min-width: 150px;
}
.btn {
  background: var(--panel2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 12px;
  cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn-clear {
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--accent);
  font-weight: 800;
  font-size: 13px;
  padding: 8px 16px;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 35%, transparent);
}
.btn-clear:hover {
  filter: brightness(1.08);
  border-color: var(--accent);
}

.summary {
  padding: 6px 16px;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.summary b { color: var(--text); }

main { padding: 0 16px 60px; }

.group {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--panel);
}
.group > h2 {
  margin: 0;
  padding: 8px 12px;
  font-size: 14px;
  background: var(--panel2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
}
.group > h2 .cnt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 5px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  position: sticky;
  background: var(--panel2);
}
th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
th.sortable:hover { color: var(--text); }
th.sortable .sort-mark { opacity: 0.85; margin-left: 2px; }
a.store-link {
  color: var(--accent2);
  text-decoration: none;
  font-weight: 600;
}
a.store-link:hover { text-decoration: underline; }
tr:hover td { background: var(--row-hover); }
tr.lesson { cursor: pointer; }
tr.lesson:hover td { background: var(--row-hover); }

.day { font-weight: 700; color: var(--accent); white-space: nowrap; }
.time { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--accent2); font-weight: 600; }
.cls { font-weight: 600; }
.cat {
  display: inline-block;
  font-size: 11px;
  color: var(--text);
  background: var(--chip);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 9px;
}
.muted { color: var(--muted); }
/* 店舗名の下に出る「ジム・地域」などの補助行は少し小さく(ただし高コントラスト) */
td .muted { font-size: 11.5px; }
.tag-pay { color: var(--warn); font-size: 11px; font-weight: 700; }
.tag-res { color: var(--accent); font-size: 11px; font-weight: 700; }
.instructor {
  font-weight: 800;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
}
a { color: var(--accent); }

.empty, .loading {
  text-align: center;
  color: var(--muted);
  padding: 40px;
}
.note {
  margin: 12px 0;
  padding: 8px 12px;
  border-left: 3px solid var(--warn);
  background: var(--note-bg);
  color: var(--muted);
  font-size: 12px;
  border-radius: 4px;
}
.hashigo-day td { border-bottom: 1px dashed var(--border); }

/* ===== 店舗カレンダー ===== */
#store-mode { padding-bottom: 60px; }
.store-head-box {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin: 14px 16px 4px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.store-head-main h2 { margin: 0 0 4px; font-size: 19px; }
.store-addr { margin-top: 6px; color: var(--text); }
.store-head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.store-head-actions .btn { text-decoration: none; white-space: nowrap; }
.map-btn { border-color: var(--accent2); color: var(--accent2); font-weight: 700; }
.map-btn:hover { background: var(--accent2); color: #06101f; }

#store-main { padding: 0 16px; }
.cal-wrap { overflow-x: auto; margin-top: 14px; }
table.calendar {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 760px;
}
table.calendar th, table.calendar td {
  border: 1px solid var(--border);
  vertical-align: top;
  padding: 4px;
}
table.calendar thead th {
  background: var(--panel2);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 2;
}
table.calendar th.cal-time, table.calendar td.cal-time {
  width: 64px;
  text-align: center;
  color: var(--accent2);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  background: var(--panel);
}
.cell-class {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 5px 7px;
  margin-bottom: 5px;
}
.cell-class:last-child { margin-bottom: 0; }
.cell-time { font-size: 11.5px; color: var(--accent2); font-variant-numeric: tabular-nums; }
.cell-name { font-weight: 700; font-size: 13.5px; margin: 1px 0; }
.cell-sub { font-size: 11.5px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip-instr { color: var(--text); }
/* ジム名バッジ(店舗名の前に明示) */
.chip-gym {
  display: inline-block; margin-right: 6px; padding: 0 6px;
  border-radius: 8px; font-size: 11px; line-height: 18px;
  vertical-align: middle; font-weight: 700; white-space: nowrap;
  color: var(--accent2); border: 1px solid var(--accent2);
  background: rgba(56, 189, 248, 0.10);
}
/* スタジオ(館内の場所)バッジ */
.chip-studio {
  display: inline-block; padding: 0 6px; border-radius: 8px;
  font-size: 11px; line-height: 16px; vertical-align: middle;
  color: var(--muted); border: 1px solid var(--border);
  background: rgba(127, 127, 127, 0.08); white-space: nowrap;
}
/* Googleカレンダー登録リンク */
td.gcal { white-space: nowrap; text-align: center; }
a.gcal-link {
  display: inline-block; padding: 1px 5px; border-radius: 6px;
  font-size: 10px; font-weight: 600; text-decoration: none; white-space: nowrap;
  color: var(--accent2); border: 1px solid var(--border);
  background: rgba(56, 189, 248, 0.08);
}
a.gcal-link:hover { background: rgba(56, 189, 248, 0.18); text-decoration: none; }
/* 時間列の📅(横スクロール不要・常に表示) */
a.gcal-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  margin-right: 3px;
  border-radius: 5px;
  font-size: 11px;
  line-height: 1;
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--card, #fff);
  vertical-align: middle;
}
a.gcal-ico:hover { border-color: var(--accent2); filter: brightness(1.05); }
/* 登録列: 横スクロール時も右端に固定表示 */
.group > table th.gcal-col,
.group > table td.gcal {
  position: sticky;
  right: 0;
  z-index: 2;
  background: var(--panel, #fff);
  box-shadow: -4px 0 8px rgba(0, 0, 0, 0.05);
}
th.nosort { cursor: default; }
.b-studio {
  margin-left: 6px; padding: 0 4px; border-radius: 6px;
  font-size: 10px; color: var(--muted);
  border: 1px solid var(--border); white-space: nowrap;
}
.group.special > h2 { border-left: 4px solid var(--warn); }

/* 週間タイムライン(高さ=所要時間に比例) */
.cal-tl {
  display: grid;
  margin-top: 14px;
  overflow: auto;
  max-height: calc(100vh - 240px);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}
.cal-corner { position: sticky; top: 0; left: 0; z-index: 4; background: var(--panel2); border-bottom: 1px solid var(--border); }
.cal-dayhead {
  position: sticky; top: 0; z-index: 3;
  background: var(--panel2);
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
}
.cal-axis {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--panel);
  border-right: 1px solid var(--border);
}
.cal-hour {
  position: absolute;
  right: 6px;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--accent2);
  font-variant-numeric: tabular-nums;
}
.cal-col {
  position: relative;
  border-left: 1px solid var(--border);
  /* 1時間ごとの横罫線 */
  background-image: linear-gradient(to bottom, var(--border) 0, var(--border) 1px, transparent 1px);
  background-repeat: repeat-y;
}
.cal-block {
  position: absolute;
  box-sizing: border-box;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 3px 6px;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.25;
}
.cal-block .b-time { font-size: 11px; color: var(--accent2); font-variant-numeric: tabular-nums; }
.cal-block .b-name { font-weight: 700; font-size: 12.5px; margin: 1px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-block .b-instr { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-block .b-cat { font-size: 10px; color: var(--accent); margin-left: 4px; }
.cal-block.compact { padding: 1px 5px; }
.cal-block.compact .b-time { display: inline; }
.cal-block.compact .b-name { display: inline; margin-left: 4px; font-size: 12px; }
.cal-block.compact .b-instr { display: none; }
.cal-block.special {
  border-left-color: var(--warn);
  background: var(--special-bg);
}
.cal-block .tag-pay { background: var(--warn); color: #1a1206; border-radius: 4px; padding: 0 4px; font-size: 10px; font-weight: 700; }
.cal-block .tag-res { background: var(--accent2); color: #06121a; border-radius: 4px; padding: 0 4px; font-size: 10px; font-weight: 700; }
.cal-block .tag-sp { background: var(--warn); color: #1a1206; border-radius: 4px; padding: 0 4px; font-size: 10px; font-weight: 700; }
.undated { display: flex; flex-wrap: wrap; gap: 8px; }
.undated .cell-class { margin-bottom: 0; min-width: 180px; }

.truncate-warn {
  margin: 18px 0 8px;
  padding: 14px 16px;
  background: #3a2a16;
  border: 1px solid var(--warn);
  border-left: 5px solid var(--warn);
  border-radius: 8px;
  color: #ffe2b8;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}

/* ===== ジャンル(カテゴリー)アイコン ===== */
.cat .cat-ico { margin-right: 4px; }
/* カテゴリー別ビューの見出しに付くアイコン */
.group > h2 .cat-ico { font-size: 18px; }
/* セレクトの選択肢は絵文字込みで表示(option内テキストに付与) */

/* ===== 地図(近くで探す) ===== */
#mapView { padding: 0 0 60px; }
.map-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  padding: 12px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.map-toolbar .btn.locate {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}
.map-toolbar .btn.locate:hover { background: var(--accent); color: #fff; }
.map-toolbar label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.map-toolbar select {
  background-color: var(--panel2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 9px;
  font-size: 14px;
}
.map-hint { padding: 8px 16px; color: var(--muted); font-size: 12.5px; }
#mapCanvas {
  width: 100%;
  height: calc(100vh - 230px);
  min-height: 360px;
  background: var(--panel2);
}

/* 地図ビュー: 説明文・敬意バナー・地図に不要なフィルタを隠して地図を上部へ */
body.view-map .lead,
body.view-map .homage { display: none; }
body.view-map .filters .field:not(.map-filter),
body.view-map #resetBtn { display: none; }
body.view-map .filters { padding-top: 8px; padding-bottom: 8px; }
body.view-map #mapCanvas { height: calc(100vh - 150px); }
/* Leafletのポップアップ(店舗カード) */
.leaflet-popup-content { margin: 10px 12px; font-size: 13px; }
.map-pop-name { font-weight: 700; font-size: 14px; margin-bottom: 2px; color: #2b2230; }
.map-pop-sub { color: #6b6b6b; font-size: 12px; margin-bottom: 4px; }
.map-pop-addr { color: #555; font-size: 12px; margin-bottom: 3px; }
.map-pop-tel { font-size: 12.5px; margin-bottom: 6px; }
.map-pop-tel a { color: #ff4d88; font-weight: 700; text-decoration: none; }
.map-pop-info { color: #555; font-size: 12px; margin-bottom: 2px; }

/* 店舗の地図/電話アイコンリンク */
.store-icos { white-space: nowrap; }
.store-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  margin-left: 4px;
  border-radius: 7px;
  font-size: 13px;
  line-height: 1;
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--card, #fff);
  vertical-align: middle;
}
.store-ico:hover { border-color: var(--accent); filter: brightness(1.05); }
.map-pop-btn {
  display: inline-block; padding: 4px 10px; border-radius: 8px;
  background: #ff4d88; color: #fff; text-decoration: none; font-weight: 700;
  font-size: 12.5px;
}
.group > h2 .store-head-link {
  color: var(--accent2);
  text-decoration: none;
  font-weight: 800;
}
.group > h2 .store-head-link:hover { text-decoration: underline; }
.map-pop-web { font-size: 12px; margin-bottom: 6px; }
.map-pop-web a { color: var(--accent2); font-weight: 700; text-decoration: none; }
.map-pop-web a:hover { text-decoration: underline; }
.map-pop-reserve { font-size: 12px; margin-bottom: 6px; }
.map-pop-reserve a { color: var(--accent); font-weight: 700; text-decoration: none; }
.map-pop-reserve a:hover { text-decoration: underline; }
.store-ico.reserve-ico:hover { border-color: var(--accent); }
.map-pop-dist { color: #7cc02a; font-weight: 700; }

/* ===== モバイル対応 ===== */
/* 広い表は横スクロールにして、列が潰れて文字が縦書きになるのを防ぐ。
   グループ枠内でスクロールさせ、セルは基本 nowrap(1文字折返し防止)。 */
.group { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.group > table { min-width: 600px; }
th, td { white-space: nowrap; }
/* クラス名と店舗下の補助行(ジム・地域)は折り返し可にして横幅の暴走を抑える */
td.cls { white-space: normal; min-width: 160px; }
td .muted { white-space: normal; }

@media (max-width: 720px) {
  html, body { font-size: 13px; }
  header { padding: 6px 10px; }
  .title h1 { font-size: 17px; }
  .title .sub { font-size: 11.5px; }
  .brand-logo { height: 72px; }
  .brand-name { font-size: 17px; }
  .brand-catch { font-size: 12px; letter-spacing: 0.01em; }
  .brand-aliases { font-size: 10px; }
  .theme-toggle { width: 34px; height: 34px; font-size: 16px; }
  .toolbar-right .sub { font-size: 11px; }
  /* モバイル: タグラインは2行目に回して表示(非表示にしない) */
  .toolbar { align-items: flex-start; }
  .brand-tagline {
    flex: 1 1 100%;
    order: 3;
    margin: 2px 0 0;
    font-size: 10.5px;
    line-height: 1.4;
  }
  .toolbar-right { order: 2; margin-left: auto; }
  .toolbar-right .sub { display: none; }
  #mapCanvas { height: calc(100vh - 250px); }
  body.view-map #mapCanvas { height: calc(100vh - 120px); }
  main { padding: 0 8px 60px; }

  /* フィルタは縦積み・各項目を横いっぱいに */
  .filters { padding: 8px 10px; gap: 8px; }
  .field { flex: 1 1 46%; }
  .field select, .field input,
  #f-region, #s-region { min-width: 0; width: 100%; }
  .field input.q { min-width: 0; }
  .btn { flex: 1 1 100%; }

  /* タブ(ビュー切替)は横スクロールで全種見られるように */
  .tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; gap: 4px; }
  .tab { white-space: nowrap; font-size: 11.5px; padding: 4px 9px; }

  th, td { padding: 4px 6px; font-size: 11.5px; }
  .group > h2 { font-size: 13px; padding: 7px 10px; }
  .instructor { font-size: 12.5px; }
  /* モバイル: 登録列は非表示(時間列の📅アイコンのみ) */
  .group > table th.gcal-col,
  .group > table td.gcal { display: none; }

  /* 店舗カレンダー(横長グリッド)も枠内で横スクロール */
  .cal-tl { max-height: calc(100vh - 200px); }
}

/* 極小画面 */
@media (max-width: 420px) {
  .field { flex: 1 1 100%; }
  .summary { gap: 8px; font-size: 12px; }
}

/* ---- イントラ検索 ---- */
.ins-search { padding: 10px 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ins-search input[type="search"] {
  flex: 1 1 320px; max-width: 520px; padding: 10px 12px; font-size: 15px;
  border: 1px solid var(--border, #ccc); border-radius: 8px;
}
.ins-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; padding: 6px; }
.ins-card {
  text-align: left; padding: 10px 12px; border: 1px solid var(--border, #ddd);
  border-radius: 10px; background: var(--card, #fff); cursor: pointer; transition: .12s;
}
.ins-card:hover { border-color: var(--accent, #3a7); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.ins-name { font-weight: 700; font-size: 15px; }
.ins-alias { font-weight: 400; font-size: 12px; color: var(--muted, #888); }
.ins-meta { font-size: 12px; color: var(--muted, #777); margin-top: 3px; }
.ins-genres { font-size: 11px; color: var(--accent, #3a7); margin-top: 3px; }
.ins-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ins-table th, .ins-table td { border-bottom: 1px solid var(--border, #eee); padding: 6px 8px; text-align: left; }
.ins-table thead th { position: sticky; top: 0; background: var(--card, #fff); }
/* レッスン行の先生名リンク(→イントラ検索) */
a.ins-link { color: var(--accent, #2a7); text-decoration: none; border-bottom: 1px dotted currentColor; cursor: pointer; }
a.ins-link:hover { text-decoration: none; opacity: .8; }

/* ---- 紹介/ヘルプ ---- */
.doc { max-width: 760px; margin: 0 auto; padding: 12px 14px; line-height: 1.7; }
.doc h2 { font-size: 20px; margin: 8px 0 12px; }
.doc h3 { font-size: 16px; margin: 20px 0 6px; border-left: 4px solid var(--accent, #3a7); padding-left: 8px; }
.doc p { margin: 6px 0; }
.doc .doc-stat { font-size: 14px; color: var(--muted, #666); }
.doc-list { margin: 6px 0 6px 1.1em; padding: 0; }
.doc-list li { margin: 4px 0; }
.doc-credit { margin: 18px 0; padding: 12px; background: var(--card, #f5f5f5); border-radius: 10px; }
.doc-note { font-size: 12px; margin-top: 14px; }
.doc-contact { margin: 10px 0 4px; padding: 14px; background: #f0fbf3; border: 1px solid #d4eedd;
  border-radius: 10px; text-align: center; }
.doc-contact .line-qr { width: 200px; height: 200px; max-width: 70vw; max-height: 70vw;
  border-radius: 10px; background: #fff; padding: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.doc-contact p { font-size: 12px; margin: 8px 0 0; }

/* フッターの索引(エリア/ジャンル内部リンク) */
.site-index { margin-top: 14px; }
.site-index .si-h { font-weight: 700; font-size: 12px; margin: 10px 0 4px; color: var(--muted, #888); }
.site-index .si-row { display: flex; flex-wrap: wrap; gap: 6px; }
.site-index .si-row a { font-size: 12px; color: var(--muted, #777); text-decoration: none;
  border: 1px solid var(--border, #ddd); border-radius: 999px; padding: 2px 9px; }
.site-index .si-row a:hover { border-color: var(--accent); }

/* 管理者LINE 連絡ダイアログ */
.line-dialog { border: none; border-radius: 14px; padding: 0; max-width: 92vw; width: 320px;
  box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.line-dialog::backdrop { background: rgba(0,0,0,.45); }
.line-dialog-body { position: relative; padding: 20px 18px 18px; text-align: center; }
.line-dialog-body h3 { margin: 0 0 6px; font-size: 16px; }
.line-dialog-body .muted { font-size: 12px; margin: 0 0 12px; }
.line-dialog-body img { width: 220px; height: 220px; max-width: 78vw; max-height: 78vw;
  background: #fff; padding: 8px; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.line-dialog-x { position: absolute; top: 8px; right: 10px; border: none; background: transparent;
  font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted, #888); }
.line-dialog-x:hover { color: #333; }

/* ---- イベント ---- */
.ev-list { display: flex; flex-direction: column; gap: 10px; padding: 8px 6px; }
.ev-card { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--card, #fff); }
.ev-date { flex: 0 0 64px; text-align: center; display: flex; flex-direction: column;
  justify-content: center; border-right: 1px dashed var(--border); padding-right: 8px; }
.ev-date .ev-md { font-size: 22px; font-weight: 800; line-height: 1.1; color: var(--accent); }
.ev-date .ev-wd { font-size: 12px; color: var(--muted, #777); }
.ev-date .ev-yr { font-size: 11px; color: var(--muted, #999); }
.ev-body { flex: 1 1 auto; min-width: 0; }
.ev-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.ev-meta { font-size: 12.5px; color: var(--muted, #555); line-height: 1.6; }
.ev-desc { font-size: 12.5px; margin-top: 6px; line-height: 1.6; }
.ev-foot { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.ev-fee { font-size: 13px; font-weight: 600; }
.btn.ev-apply { padding: 6px 14px; font-size: 13px; text-decoration: none; }
/* 通常検索の先頭に出す「関連イベント」バナー */
.ev-banner { margin: 6px; padding: 8px 10px 10px; border: 1px solid #f0d28a;
  background: #fffaf0; border-radius: 12px; }
.ev-banner-h { font-weight: 700; font-size: 14px; margin: 2px 2px 6px; color: #9a6b00; }
.ev-banner .ev-list { padding: 0; }
.ev-banner .ev-card { background: #fff; }
.ev-more { text-align: right; margin-top: 6px; font-size: 13px; }
@media (max-width: 720px) {
  .ev-date { flex-basis: 52px; }
  .ev-date .ev-md { font-size: 18px; }
  .ev-title { font-size: 14px; }
}

/* ---- 広告枠(未設定なら display:none で非表示) ---- */
.ad-slot { margin: 12px auto; max-width: 970px; text-align: center; overflow: hidden; }
.ad-slot ins.adsbygoogle { display: block; }
.ad-html-embed img { max-width: 100%; height: auto; }
.ad-html-embed a { display: inline-block; }
.ad-banner { display: inline-block; line-height: 0; }
.ad-banner img { max-width: 100%; height: auto; border-radius: 6px; }

/* ---- お気に入り ---- */
.favbtn { background: none; border: none; cursor: pointer; font-size: 18px; line-height: 1;
  color: #bbb; padding: 2px 4px; }
.favbtn.on { color: #f5a623; }
th.fav-col, td.fav { width: 30px; text-align: center; }
.fav-head { justify-content: space-between; }
.fav-modes { display: flex; gap: 6px; }
.fav-mode.active { background: var(--accent, #2a7); color: #fff; }
.fav-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; padding: 6px; }
.fav-col { min-width: 0; }
.fav-col-h { font-weight: 700; text-align: center; padding: 4px; background: var(--card, #f3f3f3);
  border-radius: 6px; position: sticky; top: 0; }
.fav-ev { position: relative; border: 1px solid var(--border, #e3e3e3); border-radius: 8px;
  padding: 6px 8px; margin-top: 6px; background: var(--card, #fff); font-size: 12px; }
.fav-ev-t { font-weight: 700; }
.fav-ev-c { margin-top: 2px; }
.fav-ev-x { position: absolute; top: 2px; right: 2px; font-size: 14px; }
.fav-empty { text-align: center; padding: 8px 0; }
@media (max-width: 720px) {
  .fav-cal { grid-template-columns: 1fr; }
  .fav-col-h { position: static; }
}

/* ---- クラスコピー / 詳細 ---- */
.copybtn {
  background: none; border: 1px solid var(--border, #ddd); border-radius: 6px;
  cursor: pointer; font-size: 14px; line-height: 1; padding: 3px 6px;
}
.copybtn:hover { border-color: var(--accent); }
.copybtn.copied { border-color: var(--accent2, #2a7); background: var(--card, #f6fff9); }
th.copy-col, td.copy { width: 36px; text-align: center; }
a.lesson-link { font-weight: 600; text-decoration: none; color: var(--accent, #2a7); }
a.lesson-link:hover { text-decoration: underline; }
.lesson-detail { max-width: 720px; margin: 0 auto; }
.lesson-back-bar { margin: 0 0 14px; }
.lesson-back-bar.bottom { margin: 18px 0 0; }
.btn.lesson-back-top {
  display: block; width: 100%; text-align: center;
  background: var(--accent, #e8590c); color: #fff; border: none;
  font-size: 15px; font-weight: 700; padding: 12px 16px; border-radius: 10px;
  cursor: pointer; box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
}
.btn.lesson-back-top:hover { filter: brightness(1.08); }
.lesson-detail-head h2 { margin: 0 0 12px; font-size: 1.35rem; }
.lesson-detail-meta { display: grid; gap: 8px; margin-bottom: 14px; }
.lesson-detail-meta b { display: inline-block; min-width: 4.5em; }
.lesson-detail-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.lesson-detail-links { font-size: 14px; line-height: 1.8; margin-bottom: 12px; }
.lesson-copy-box { margin-top: 8px; }
.lesson-copy-pre {
  white-space: pre-wrap; word-break: break-word; font-size: 13px;
  background: var(--card, #f8f8f8); border: 1px solid var(--border, #e3e3e3);
  border-radius: 8px; padding: 10px 12px; margin-top: 8px;
}
