/* ==========================================================================
   いちご数学 高校入試過去問トレーナー — Mobile-First Commercial Learning App UI
   ========================================================================== */

:root {
  --bg-app: #f3f6fb;
  --bg-card: #ffffff;
  --bg-subtle: #f8fafc;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;
  --accent-indigo: #4f46e5;
  --success: #059669;
  --success-bg: #ecfdf5;
  --success-border: #6ee7b7;
  --danger: #e11d48;
  --danger-bg: #fff1f2;
  --danger-border: #fda4af;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --text-main: #0f172a;
  --text-sub: #475569;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.14);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
  color: var(--text-main);
  background: var(--bg-app);
  -webkit-tap-highlight-color: transparent;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100dvh;
  background: var(--bg-app);
  color: var(--text-main);
  overflow-x: hidden;
  font-size: 15px;
  line-height: 1.5;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  border: none;
  background: none;
}

button:disabled {
  opacity: 0.45;
  cursor: default;
}

[hidden] {
  display: none !important;
}

/* アプリ外枠（スマホ中央フレーム、PCでも美しいモバイルアプリビュー＋ワイド対応） */
.mapp-shell {
  max-width: 680px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(74px + var(--safe-bottom));
}

/* ==================== 上部ヘッダー（ホーム・タブ画面用） ==================== */
.mapp-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mapp-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mapp-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #ffffff;
  font-weight: 800;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.28);
}

.mapp-brand-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

.mapp-brand-sub {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.mapp-streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
}

/* ==================== メインコンテンツ領域 ==================== */
.mapp-view {
  flex: 1;
  padding: 14px 14px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ==================== ヒーロー統計＆クイックスタートカード ==================== */
.mapp-hero-card {
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: 0 8px 24px rgba(30, 64, 175, 0.24);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mapp-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mapp-hero-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 800;
}

.mapp-hero-desc {
  margin: 0;
  font-size: 12.5px;
  opacity: 0.9;
}

.mapp-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mapp-stat-box {
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 9px 10px;
  text-align: center;
}

.mapp-stat-value {
  display: block;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}

.mapp-stat-label {
  font-size: 11px;
  opacity: 0.88;
}

.mapp-hero-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mapp-hero-btn {
  padding: 11px 12px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.1s;
}

.mapp-hero-btn:active {
  transform: scale(0.98);
}

.mapp-hero-btn.is-primary {
  background: #ffffff;
  color: #1e40af;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
}

.mapp-hero-btn.is-review {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
}

/* ==================== 学年セグメントタブ（中1 / 中2 / 中3） ==================== */
.mapp-grade-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #e2e8f0;
  padding: 4px;
  border-radius: 13px;
  gap: 4px;
}

.mapp-grade-tab {
  padding: 9px 8px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-sub);
  text-align: center;
  transition: all 0.15s ease;
}

.mapp-grade-tab.is-active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.1);
}

/* ==================== 章・節アコーディオンカード ==================== */
.mapp-chapter-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mapp-chapter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.mapp-chapter-header {
  width: 100%;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  background: #ffffff;
}

.mapp-chapter-header:active {
  background: var(--bg-subtle);
}

.mapp-chapter-info {
  flex: 1;
  min-width: 0;
}

.mapp-chapter-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 4px;
}

.mapp-chapter-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 800;
  color: var(--text-main);
}

.mapp-chapter-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.mapp-progress-bar {
  flex: 1;
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.mapp-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #10b981);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.mapp-progress-text {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.mapp-chapter-chevron {
  font-size: 14px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.mapp-chapter-card.is-open .mapp-chapter-chevron {
  transform: rotate(180deg);
}

.mapp-section-list {
  border-top: 1px solid var(--border-color);
  background: var(--bg-subtle);
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.mapp-section-item {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 11px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
}

.mapp-section-item:active {
  background: var(--primary-light);
  border-color: var(--primary-border);
}

.mapp-section-main {
  flex: 1;
  min-width: 0;
}

.mapp-section-title {
  margin: 0 0 3px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.mapp-section-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 11.5px;
  color: var(--text-muted);
}

.mapp-section-regions {
  color: var(--primary-dark);
  font-weight: 600;
}

.mapp-section-start-btn {
  flex: none;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.22);
}

.mapp-section-start-btn.is-completed {
  background: var(--success);
}

/* ==================== 演習セッション画面（1問1画面カード） ==================== */
.mapp-session-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg-app);
  display: flex;
  flex-direction: column;
  max-width: 680px;
  margin: 0 auto;
}

.mapp-session-header {
  flex: none;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mapp-session-toprow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mapp-icon-btn {
  padding: 7px 11px;
  border-radius: 9px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mapp-icon-btn.is-active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary-dark);
}

.mapp-session-title {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mapp-session-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mapp-session-step-pill {
  font-size: 12px;
  font-weight: 800;
  color: var(--primary-dark);
  min-width: 58px;
}

.mapp-session-dots {
  flex: 1;
  display: flex;
  gap: 4px;
  height: 7px;
}

.mapp-session-dot {
  flex: 1;
  border-radius: 999px;
  background: #cbd5e1;
  cursor: pointer;
}

.mapp-session-dot.is-current {
  background: var(--primary);
  transform: scaleY(1.3);
}

.mapp-session-dot.is-correct {
  background: var(--success);
}

.mapp-session-dot.is-wrong {
  background: var(--danger);
}

/* セッション本文エリア */
.mapp-session-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

/* 問題カード */
.mapp-question-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 15px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mapp-badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.mapp-exam-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
  font-size: 12px;
  font-weight: 800;
}

.mapp-level-badge {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: #f1f5f9;
  color: #334155;
}

.mapp-level-badge.is-basic { background: #dcfce7; color: #166534; }
.mapp-level-badge.is-standard { background: #dbeafe; color: #1e40af; }
.mapp-level-badge.is-advanced { background: #fae8ff; color: #86198f; }

.mapp-subcat-badge {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: var(--text-sub);
}

/* 類題バリエーション切替ピル */
.mapp-variation-switcher {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 7px 10px;
  background: var(--bg-subtle);
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.mapp-variation-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-sub);
  margin-right: 2px;
}

.mapp-variation-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--text-sub);
}

.mapp-variation-pill.is-active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary-dark);
}

.mapp-question-text {
  margin: 2px 0;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.6;
  color: var(--text-main);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ==================== 選択式オプションカード ==================== */
.mapp-choices-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.mapp-choice-btn {
  width: 100%;
  min-height: 54px;
  padding: 12px 14px;
  border-radius: 13px;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  transition: all 0.12s ease;
}

.mapp-choice-btn:active:not(:disabled) {
  transform: scale(0.99);
}

.mapp-choice-index {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 1.5px solid #94a3b8;
  color: #334155;
  font-size: 13.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mapp-choice-btn.is-selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.mapp-choice-btn.is-selected .mapp-choice-index {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.mapp-choice-btn.is-correct {
  border-color: var(--success);
  background: var(--success-bg);
}

.mapp-choice-btn.is-correct .mapp-choice-index {
  background: var(--success);
  border-color: var(--success);
  color: #ffffff;
}

.mapp-choice-btn.is-wrong {
  border-color: var(--danger);
  background: var(--danger-bg);
}

.mapp-choice-btn.is-wrong .mapp-choice-index {
  background: var(--danger);
  border-color: var(--danger);
  color: #ffffff;
}

/* ==================== 記述入力ボックス＆数学専用キーパッド ==================== */
.mapp-input-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mapp-answer-box-wrap {
  background: #ffffff;
  border: 2px solid var(--primary);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.1);
}

.mapp-answer-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: 0.02em;
}

.mapp-answer-input::placeholder {
  font-size: 13.5px;
  font-weight: 600;
  color: #94a3b8;
}

.mapp-kb-mode-btn {
  flex: none;
  padding: 5px 9px;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-sub);
}

/* 数学専用キーパッド */
.mapp-keypad-card {
  background: #e2e8f0;
  border-radius: 16px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

.mapp-smart-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.mapp-smart-chips::-webkit-scrollbar {
  display: none;
}

.mapp-smart-chip-hint {
  font-size: 11px;
  font-weight: 800;
  color: #475569;
  white-space: nowrap;
}

.mapp-smart-chip {
  flex: none;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fef3c7;
  border: 1.5px solid #f59e0b;
  color: #78350f;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.mapp-smart-chip:active {
  background: #fde68a;
  transform: translateY(1px);
}

.mapp-keypad-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 5px;
}

.mapp-key-btn {
  min-height: 45px;
  border-radius: 9px;
  background: #ffffff;
  color: var(--text-main);
  font-size: 16px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 0 #94a3b8;
  transition: transform 0.05s, background 0.1s;
}

.mapp-key-btn:active {
  transform: translateY(2px);
  box-shadow: 0 0 0 #94a3b8;
  background: #dbeafe;
}

.mapp-key-btn.is-op {
  background: #eff6ff;
  color: #1d4ed8;
}

.mapp-key-btn.is-sym {
  background: #f5f3ff;
  color: #5b21b6;
}

.mapp-key-btn.is-var {
  background: #ecfdf5;
  color: #047857;
  font-style: italic;
}

.mapp-key-btn.is-action {
  background: #ffe4e6;
  color: #be123c;
  font-size: 13px;
}

/* ==================== 採点・ナビゲーションアクション行 ==================== */
.mapp-action-bar {
  display: flex;
  gap: 8px;
  align-items: center;
}

.mapp-submit-btn {
  flex: 1;
  min-height: 50px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.mapp-submit-btn:disabled {
  background: #94a3b8;
  box-shadow: none;
}

.mapp-giveup-btn {
  padding: 0 14px;
  min-height: 50px;
  border-radius: 14px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

/* ==================== 採点結果・丁寧な解説カード ==================== */
.mapp-result-card {
  border-radius: var(--radius-md);
  padding: 16px;
  border: 2px solid var(--border-color);
  background: #ffffff;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: mappSlideUp 0.2s ease-out;
}

@keyframes mappSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.mapp-result-card.is-correct {
  border-color: var(--success-border);
  background: linear-gradient(to bottom, #ecfdf5 0%, #ffffff 90px);
}

.mapp-result-card.is-wrong {
  border-color: var(--danger-border);
  background: linear-gradient(to bottom, #fff1f2 0%, #ffffff 90px);
}

.mapp-result-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mapp-result-verdict {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 900;
}

.mapp-result-card.is-correct .mapp-result-verdict { color: var(--success); }
.mapp-result-card.is-wrong .mapp-result-verdict { color: var(--danger); }

.mapp-answer-comparison {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 11px;
  padding: 10px 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mapp-correct-answer-line {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

.mapp-user-answer-line {
  font-size: 13px;
  color: var(--danger);
  font-weight: 700;
}

.mapp-exp-block {
  padding: 11px 13px;
  border-radius: 11px;
  font-size: 14px;
  line-height: 1.65;
}

.mapp-exp-block h4 {
  margin: 0 0 4px;
  font-size: 12.5px;
  font-weight: 800;
}

.mapp-exp-block p {
  margin: 0;
  white-space: pre-wrap;
}

.mapp-exp-block.is-main {
  background: #f8fafc;
  border-left: 4px solid var(--primary);
}

.mapp-exp-block.is-reason {
  background: #eff6ff;
  border-left: 4px solid #3b82f6;
  color: #1e3a8a;
}

.mapp-exp-block.is-pitfall {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  color: #78350f;
}

.mapp-exp-block.is-funfact {
  background: #f5f3ff;
  border-left: 4px solid #8b5cf6;
  color: #4c1d95;
}

.mapp-next-btn {
  width: 100%;
  min-height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #059669, #047857);
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.28);
}

/* ==================== 手書き計算メモドロワー（オーバーレイ／インライン切替） ==================== */
.mapp-scratch-panel {
  background: #ffffff;
  border: 2px solid var(--primary-border);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-md);
}

.mapp-scratch-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

.mapp-scratch-tools {
  display: flex;
  gap: 5px;
}

.mapp-scratch-tool-btn {
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  background: #f1f5f9;
  color: var(--text-sub);
  border: 1px solid #cbd5e1;
}

.mapp-scratch-tool-btn.is-active {
  background: var(--text-main);
  color: #ffffff;
  border-color: var(--text-main);
}

.mapp-scratch-canvas {
  width: 100%;
  height: 200px;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  background-color: #ffffff;
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, 0.2) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.2) 1px, transparent 1px);
  background-size: 20px 20px;
  touch-action: none;
  cursor: crosshair;
}

/* ==================== 都道府県・検索・フィルタービュー ==================== */
.mapp-search-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.mapp-search-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 11px;
  border: 1.5px solid #cbd5e1;
  font-size: 15px;
  background: var(--bg-subtle);
}

.mapp-region-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mapp-region-chip {
  padding: 6px 11px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-sub);
}

.mapp-region-chip.is-active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary-dark);
}

/* ==================== 用語・公式集カード ==================== */
.mapp-glossary-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}

.mapp-glossary-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--primary-dark);
}

.mapp-glossary-summary {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-main);
}

/* ==================== 下部ボトムナビゲーションバー ==================== */
.mapp-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-color);
  padding: 6px 8px calc(6px + var(--safe-bottom));
  display: flex;
  justify-content: space-around;
  max-width: 680px;
  margin: 0 auto;
}

.mapp-nav-item {
  flex: 1;
  padding: 6px 4px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.mapp-nav-icon {
  font-size: 19px;
  line-height: 1.1;
}

.mapp-nav-item.is-active {
  color: var(--primary);
}

.mapp-badge-count {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  margin-left: 3px;
}
