:root {
  --brand: #5ec8d8;
  --bg-grad-start: #fdf2ff;
  --bg-grad-mid:   #e4f4ff;
  --bg-grad-end:   #fbe9f1;
  --card-bg: rgba(255, 255, 255, 0.7);
  --card-border: rgba(255, 255, 255, 0.8);
  --shadow-soft: 0 18px 40px rgba(140, 160, 190, 0.25);
  --mint: #5ec8d8;
  --mint-soft: #b7f0eb;
  --lavender: #8f8cf3;
  --lavender-soft: #dcd6ff;
  --coral-soft: #ffc9d6;
  --text-main: #2c3140;
  --text-sub: #6c7285;
  --text-muted: #a0a5b6;
  --border-radius-lg: 20px;
  --border-radius-md: 16px;
  --font-scale: 1;
  /* 可読性の下限を14pxに統一（12px/13px級は禁止） */
  --fs-11: calc(var(--font-scale) * 14px);
  --fs-12: calc(var(--font-scale) * 14px);
  --fs-13: calc(var(--font-scale) * 14px);
  --fs-14: calc(var(--font-scale) * 14px);
  --fs-15: calc(var(--font-scale) * 15px);
  --fs-16: calc(var(--font-scale) * 16px);
  --fs-17: calc(var(--font-scale) * 17px);
  --fs-18: calc(var(--font-scale) * 18px);
  --fs-20: calc(var(--font-scale) * 20px);
  --fs-22: calc(var(--font-scale) * 22px);
  --fs-24: calc(var(--font-scale) * 24px);
  --fs-26: calc(var(--font-scale) * 26px);
  --fs-32: calc(var(--font-scale) * 32px);
}

/* 最小14pxを守るため small でも縮めない（可読性優先） */
/* デフォルト（100%表示想定） */
body[data-font-size="small"] { --font-scale: 1; }
/* 自然に：デフォルトはほんの少しだけ大きく（+5%） */
body[data-font-size="medium"] { --font-scale: 1.05; }
body[data-font-size="large"] { --font-scale: 1.15; }

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  /* ベースフォントを16pxに戻す */
  font-size: 16px;
}

body {
  min-height: 100vh;
  height: 100%;
  font-family: "M PLUS Rounded 1c", "Inter", "Noto Sans JP", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: var(--fs-16);
  line-height: 1.6;
  background: radial-gradient(circle at 0% 0%, var(--bg-grad-start), transparent 60%),
              radial-gradient(circle at 100% 0%, var(--bg-grad-mid), transparent 60%),
              radial-gradient(circle at 50% 100%, var(--bg-grad-end), #f5f7ff 70%);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  color: var(--text-main);
  padding: 20px;
  box-sizing: border-box;
  scrollbar-gutter: stable both-edges;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

.app-shell {
  width: 100%;
  max-width: 1440px;
  height: calc(100vh - 40px);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(245, 248, 255, 0.96));
  border-radius: 30px;
  box-shadow: var(--shadow-soft);
  padding: 22px 30px 28px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  margin: 0 auto;
  transform-origin: top center;
  overflow: hidden;
  overflow-x: hidden;
  min-height: 0;
}

/* タイポグラフィ階層 */
h1, .h1 {
  font-size: var(--fs-24);
  font-weight: 700;
  letter-spacing: 0.01em;
}
h2, .h2 {
  font-size: var(--fs-20);
  font-weight: 700;
}
h3, .h3 {
  font-size: var(--fs-16);
  font-weight: 600;
}

/* ヘッダー */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* =========================
   ハンバーガーメニューボタン（PCでは非表示、スマホで表示）
   ========================= */
.hamburger-menu-toggle {
  display: none;
}

.hamburger-icon {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 24px;
  height: 18px;
  justify-content: center;
  align-items: center;
}

.hamburger-icon span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-main);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* =========================
   ドロワーメニュー（PCでは非表示、スマホで表示）
   ========================= */
.drawer-overlay {
  display: none;
}

.drawer-menu {
  display: none;
}

/* =========================
   User Menu（ヘッダー右上）
   ========================= */

/* まずは共通buttonスタイルを“この中だけ”リセット */
.user-menu-wrapper button {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  background: none;
  font: inherit;
  padding: 0;
  margin: 0;
}

/* ヘッダー右側のエリア */
.user-area {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* =========================
   お金のミニ辞書ボタン（ヘッダー）
   ========================= */
.money-dictionary-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, rgba(234, 249, 255, 0.9), rgba(255, 233, 243, 0.85));
  box-shadow: 0 4px 12px rgba(150, 175, 220, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  height: auto;
  min-height: 40px;
  position: relative;
  overflow: hidden;
}

.money-dictionary-toggle::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 0% 0%, rgba(94, 200, 216, 0.08), transparent 60%),
              radial-gradient(circle at 100% 100%, rgba(143, 140, 243, 0.06), transparent 60%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.money-dictionary-toggle:hover::before {
  opacity: 1;
}

.money-dictionary-toggle:hover {
  background: linear-gradient(135deg, rgba(234, 249, 255, 1), rgba(255, 233, 243, 0.95));
  box-shadow: 0 6px 20px rgba(150, 175, 220, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transform: translateY(-2px);
}

.money-dictionary-toggle:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(150, 175, 220, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.money-dictionary-toggle:focus {
  outline: none;
}

.money-dictionary-toggle:focus-visible {
  outline: 2px solid rgba(94, 200, 216, 0.5);
  outline-offset: 3px;
}

.money-dictionary-icon {
  font-size: var(--fs-20);
  line-height: 1;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.05));
}

.money-dictionary-label {
  font-size: var(--fs-14);
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  position: relative;
  z-index: 1;
  letter-spacing: 0.01em;
}

/* ラッパー */
.user-menu-wrapper {
  position: relative;
}

.user-menu-container {
  position: relative;
}

/* トグルボタン本体 */
.user-menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(245, 248, 255, 0.85));
  box-shadow: 0 4px 12px rgba(150, 175, 220, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.user-menu-toggle::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 0% 0%, rgba(249, 168, 255, 0.08), transparent 60%),
              radial-gradient(circle at 100% 100%, rgba(74, 222, 255, 0.08), transparent 60%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.user-menu-toggle:hover::before {
  opacity: 1;
}

.user-menu-toggle:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(245, 248, 255, 0.95));
  box-shadow: 0 6px 20px rgba(150, 175, 220, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transform: translateY(-2px);
}

.user-menu-toggle:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(150, 175, 220, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.user-menu-toggle:focus {
  outline: none;
}
.user-menu-toggle:focus-visible {
  outline: 2px solid rgba(94, 200, 216, 0.5);
  outline-offset: 3px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: radial-gradient(circle at 0% 0%, #f9a8ff, #4adeff);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(249, 168, 255, 0.3);
  flex-shrink: 0;
}

.user-avatar-small {
  width: 28px;
  height: 28px;
  font-size: var(--fs-14);
  background: radial-gradient(circle at 0% 0%, #f9a8ff, #4adeff);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 600;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(249, 168, 255, 0.3);
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.user-menu-toggle .user-name {
  position: relative;
  z-index: 1;
  font-weight: 600;
  letter-spacing: 0.01em;
  font-size: var(--fs-14);
  color: var(--text-main);
}

.user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.user-meta .user-name {
  font-size: var(--fs-14);
  font-weight: 600;
  color: #0f172a;
}
.user-role {
  font-size: var(--fs-14);
  color: #94a3b8;
}
.chevron {
  font-size: var(--fs-14);
  color: #94a3b8;
}

/* ドロップダウンパネル */
.user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 230px;
  padding: 10px 10px 8px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.15);
  backdrop-filter: blur(10px);
  transform-origin: top right;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.97);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 50;
  max-height: min(70vh, 420px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
/* 開いているとき */
.user-menu-toggle[aria-expanded="true"] + .user-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* メニュー内ヘッダー */
.user-menu-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 8px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  margin-bottom: 6px;
}

/* メニューリスト */
.user-menu-list {
  padding: 2px 0 4px;
}

/* 共通メニューアイテム */
.user-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 12px;
  background: transparent;
  font-size: var(--fs-14);
  color: #0f172a;
  cursor: pointer;
  text-align: left;
  white-space: normal;
  transition: background 0.12s ease, transform 0.05s ease;
}
.icon-circle {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: radial-gradient(circle at 0 0, #eaf9ff, #ffe9f3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-14);
  color: #64748b;
}
.user-menu-item:hover {
  background: linear-gradient(
    90deg,
    rgba(196, 181, 253, 0.15),
    rgba(125, 211, 252, 0.15)
  );
  transform: translateY(-1px);
}

/* ログアウトだけ差別化 */
.user-menu-item.logout {
  margin-top: 2px;
  color: #ef4444;
}
.user-menu-item.logout .icon-circle {
  background: rgba(254, 226, 226, 0.9);
}

/* 仕切り線 */
.menu-divider {
  height: 1px;
  margin: 4px 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(226, 232, 240, 0.9),
    transparent
  );
}
/* フォントサイズ切り替え */
.font-size-toggle {
  display: inline-flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid #e5e9f5;
  border-radius: 12px;
  padding: 6px 8px;
  box-shadow: 0 4px 10px rgba(140, 160, 190, 0.18);
}

.font-size-button {
  border: none;
  background: transparent;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: var(--fs-14);
  cursor: pointer;
  color: var(--text-sub);
  transition: all 0.15s;
}

.font-size-button.active {
  background: radial-gradient(circle at 0 0, #eaf9ff, transparent 55%),
              radial-gradient(circle at 100% 100%, #ffe9f3, transparent 55%);
  color: var(--text-main);
  box-shadow: 0 4px 10px rgba(150, 175, 220, 0.3);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: conic-gradient(from 210deg, var(--mint), var(--lavender), var(--coral-soft), var(--mint));
  box-shadow: 0 4px 12px rgba(120, 160, 190, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: var(--fs-16);
  font-weight: 700;
}

.logo-text {
  font-size: var(--fs-20);
  letter-spacing: 0.06em;
  font-weight: 700;
}

.user-area {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: var(--fs-14);
  color: var(--text-sub);
  position: relative;
}
.user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.user-name {
  font-size: var(--fs-14);
  font-weight: 600;
  color: #0f172a;
}
.user-role {
  font-size: var(--fs-14);
  color: #94a3b8;
}
.chevron {
  font-size: var(--fs-14);
  color: #94a3b8;
}
.user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 230px;
  padding: 10px 10px 8px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.15);
  backdrop-filter: blur(10px);
  transform-origin: top right;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.97);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 50;
}
.user-menu-toggle[aria-expanded="true"] + .user-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.user-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 12px;
  border: none;
  background: transparent;
  font-size: var(--fs-14);
  color: #0f172a;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease, transform 0.05s ease;
}
.user-menu-item .icon-circle {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.user-menu-item:hover {
  background: linear-gradient(90deg, rgba(196, 181, 253, 0.15), rgba(125, 211, 252, 0.15));
  transform: translateY(-1px);
}
.user-menu-item.logout {
  margin-top: 2px;
  color: #ef4444;
}
.user-menu-item.logout .icon-circle {
  background: rgba(254, 226, 226, 0.9);
}
.menu-divider {
  height: 1px;
  margin: 4px 0;
  background: linear-gradient(90deg, transparent, rgba(226, 232, 240, 0.9), transparent);
}
.user-menu-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 8px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  margin-bottom: 6px;
}
.user-menu-list {
  padding: 2px 0 4px;
}

/* タブ */
.tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(220, 226, 245, 0.9);
  padding-bottom: 6px;
}

.tab-button {
  position: relative;
  border: none;
  background: transparent;
  padding: 10px 14px 12px;
  border-radius: 999px;
  /* 主要タブ/ナビ：16〜17px（スクショ基準は16寄り） */
  font-size: var(--fs-16);
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.tab-button:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-0.5px);
}

.tab-button.active {
  color: var(--text-main);
  background: linear-gradient(135deg, rgba(94, 200, 216, 0.14), rgba(143, 140, 243, 0.12));
  box-shadow: 0 10px 24px rgba(150, 175, 220, 0.35);
}

.tab-button.active::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: -8px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--mint), var(--lavender));
}

.tab-spacer { flex: 1; }

/* bottom-nav start */
.bottom-nav {
  display: none;
}

.bottom-nav-button {
  flex: 1;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  /* タップ領域 44px 確保（mobile） */
  min-height: 44px;
  padding: 10px 8px;
  font-size: var(--fs-14);
  color: var(--text-sub);
  cursor: pointer;
}

.bottom-nav-label {
  white-space: nowrap;
}
/* bottom-nav end */

/* タブパネル表示制御（フェイルセーフ：JSが死んでも複数表示されない） */
.tab-panel {
  display: none !important;
  flex: 1;
  overflow-y: scroll;
  overflow-x: hidden;
  min-height: 0;
  padding-top: 8px;
  padding-right: 10px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(140, 160, 190, 0.3) transparent;
  box-sizing: border-box;
}
.tab-panel.active {
  display: flex !important;
  flex-direction: column;
}

/* スクロールバーのスタイル（重なり防止） */
.tab-panel::-webkit-scrollbar {
  width: 12px;
}

.tab-panel::-webkit-scrollbar-track {
  background: transparent;
  margin: 0;
}

.tab-panel::-webkit-scrollbar-thumb {
  background: rgba(140, 160, 190, 0.3);
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.tab-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(140, 160, 190, 0.5);
  background-clip: padding-box;
}

/* タブパネル内のコンテンツ */
.tab-panel > .grid,
.tab-panel > .card,
.tab-panel > .summary-toggle,
.tab-panel > .summary-content,
.tab-panel > .settings-grid {
  flex-shrink: 0;
}

/* カード共通 */
.grid {
  display: grid;
  grid-template-columns: 2fr 1.1fr;
  gap: 18px;
}

.card {
  background: var(--card-bg);
  border-radius: var(--border-radius-md);
  border: 1px solid var(--card-border);
  box-shadow: 0 10px 24px rgba(140, 160, 190, 0.18);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
              rgba(255, 255, 255, 0.96),
              rgba(255, 255, 255, 0.78) 40%,
              rgba(255, 255, 255, 0.6) 80%);
  opacity: 0.35;
  pointer-events: none;
}

.card-inner { position: relative; z-index: 1; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.card-title {
  /* カード見出し：16〜17px */
  font-size: var(--fs-16);
  color: var(--text-main);
  font-weight: 700;
}
.card-sub {
  /* 説明/補足：14〜15px */
  font-size: var(--fs-14);
  color: var(--text-muted);
  margin-bottom: 6px;
}
.amount {
  /* KPI数値：26〜32px（画面幅に追従。ただし26px未満にしない） */
  font-size: clamp(26px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-top: 4px;
  margin-bottom: 10px;
}
.chip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--fs-14);
  color: var(--text-muted);
}
.chip {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: var(--fs-14);
  background: rgba(255, 255, 255, 0.9);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.chip.mint {
  background: rgba(186, 240, 225, 0.85);
  color: #12796e;
}
.chip.coral {
  background: rgba(255, 218, 230, 0.9);
  color: #a14c65;
}

.card-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: var(--fs-14);
  color: var(--text-sub);
}

.card-heading-row > span {
  font-weight: 600;
  color: var(--text-main);
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend {
  margin-top: 8px;
  display: flex;
  gap: 14px;
  font-size: var(--fs-14);
  color: var(--text-sub);
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.legend-dot.mint { background: var(--mint); }
.legend-dot.lavender { background: var(--lavender); }
.legend-dot.gray { background: #d3d7e5; }
.legend-dot.coral { background: #ff9ba8; }

/* プレースホルダ共通 */
.placeholder {
  padding: 24px 4px 8px;
  font-size: var(--fs-14);
  color: var(--text-sub);
  line-height: 1.7;
}

/* 共通ボタン */
.chip-link {
  border-radius: 999px;
  padding: 6px 12px;
  border: none;
  font-size: var(--fs-14);
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  background: radial-gradient(circle at 0 0, #eaf9ff, transparent 55%),
              radial-gradient(circle at 100% 100%, #ffe9f3, transparent 55%);
  box-shadow: 0 5px 12px rgba(150, 175, 220, 0.35);
  transition: all 0.15s ease;
}
.chip-link:hover {
  filter: brightness(1.03);
  transform: translateY(-0.5px);
}

.btn-icon {
  border-radius: 12px;
  border: 1px solid #e3e7f5;
  padding: 6px 12px;
  font-size: var(--fs-14);
  cursor: pointer;
  background: linear-gradient(135deg, #f6f8ff, #eef3ff);
  color: var(--text-sub);
  box-shadow: 0 5px 12px rgba(150, 175, 220, 0.25);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.btn-icon:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(150, 175, 220, 0.35);
}
.btn-icon:active {
  transform: translateY(0);
}

/* 共通設定 */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.settings-item-title {
  font-size: var(--fs-14);
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-sub);
}
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: var(--fs-14);
}
.pill {
  border-radius: 999px;
  padding: 6px 12px;
  border: 1px solid #dde1f3;
  background: rgba(255, 255, 255, 0.96);
  cursor: pointer;
}
.pill.active {
  border-color: transparent;
  background: radial-gradient(circle at 0 0, #eaf9ff, transparent 55%),
              radial-gradient(circle at 100% 100%, #ffe9f3, transparent 55%);
  box-shadow: 0 6px 14px rgba(150, 175, 220, 0.35);
}

.settings-note {
  margin-top: 10px;
  font-size: var(--fs-14);
  color: var(--text-muted);
  line-height: 1.6;
}

.form-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* テーブル共通 */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  /* テーブル/一覧：14〜15px（スクショ基準は14寄り） */
  font-size: var(--fs-14);
  color: var(--text-sub);
}
.table thead th {
  background: rgba(245, 248, 255, 0.8);
  color: var(--text-muted);
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #e7ebf6;
}
.table tbody tr {
  transition: background 0.12s ease;
}
.table tbody tr:hover {
  background: rgba(94, 200, 216, 0.06);
}
.table td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf0fb;
}
.table tbody tr:last-child td {
  border-bottom: none;
}
.table td[contenteditable="true"] {
  cursor: text;
}
.table .cell-muted {
  color: var(--text-muted);
}

/* レイアウト */
.page-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* メディアクエリ（共通） */
/* tablet: 769px - 1024px */
@media (max-width: 1024px) {
  body {
    padding: 12px;
  }

  .app-shell {
    padding: 16px 18px;
    border-radius: 20px;
    height: calc(100vh - 24px);
    overflow: hidden;
    min-height: 0;
  }
}

/* =========================
   スマホ版スタイル（768px以下）
   ========================= */
@media (max-width: 768px) {
  /* 基本レイアウト */
  html {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
  }

  body {
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    width: 100%;
    max-width: 100vw;
  }

  .app-shell {
    padding: 12px 14px;
    border-radius: 0;
    height: 100vh;
    max-width: 100%;
    width: 100%;
    box-shadow: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(245, 248, 255, 0.98));
    overflow-x: hidden;
  }

  /* すべての要素が横スクロールを引き起こさないように */
  * {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* 画像やメディア要素 */
  img, video, iframe, embed, object {
    max-width: 100%;
    height: auto;
  }

  /* ヘッダー */
  .header {
    margin-bottom: 12px;
    gap: 8px;
  }

  .header-content {
    gap: 8px;
  }

  /* ハンバーガーメニューボタン（非表示） */
  .hamburger-menu-toggle {
    display: none;
  }

  .logo-area {
    gap: 8px;
  }

  .logo-mark {
    width: 24px;
    height: 24px;
    font-size: var(--fs-14);
  }

  h1.app-title.logo-text {
    font-size: var(--fs-18);
  }

  .header-actions {
    gap: 8px;
  }

  /* ボトムナビゲーションを非表示 */
  .bottom-nav {
    display: none !important;
  }

  /* スワイプで開くヒント（画面下部に表示） */
  .swipe-hint {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    font-size: var(--fs-12);
    color: var(--text-sub);
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.1);
    z-index: 9997;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .swipe-hint.show {
    opacity: 1;
  }

  .swipe-hint.hide {
    opacity: 0;
  }

  /* ドロワーメニュー（スマホで表示） */
  .drawer-overlay {
    display: block;
    position: fixed;
    inset: 0;
    left: 0;
    top: 0;
    width: 100%;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
  }

  .drawer-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .drawer-menu {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    max-height: 85vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.15);
    border-radius: 24px 24px 0 0;
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    touch-action: pan-y;
  }

  .drawer-menu.is-visible {
    transform: translateY(0);
  }

  /* ボトムシートのドラッグハンドル */
  .drawer-menu.bottom-sheet::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: rgba(203, 213, 225, 0.8);
    border-radius: 2px;
    z-index: 1;
  }

  .drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 20px 16px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    flex-shrink: 0;
    position: relative;
    cursor: grab;
  }

  .drawer-header:active {
    cursor: grabbing;
  }

  .drawer-title {
    font-size: var(--fs-20);
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
  }

  .drawer-close {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    color: var(--text-sub);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s ease, color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .drawer-close:hover {
    background: rgba(226, 232, 240, 0.5);
    color: var(--text-main);
  }

  /* フローティング閉じるボタン（スマホ版のみ） */
  .drawer-close-floating {
    display: none;
  }

  @media (max-width: 768px) {
    .drawer-close {
      display: none;
    }

    .drawer-close-floating {
      display: flex;
      align-items: center;
      justify-content: center;
      position: fixed;
      bottom: calc(80px + max(8px, env(safe-area-inset-bottom)));
      right: 20px;
      width: 56px;
      height: 56px;
      border-radius: 50%;
      background: linear-gradient(135deg, 
        rgba(94, 200, 216, 0.2) 0%,
        rgba(143, 140, 243, 0.15) 100%);
      border: 2px solid rgba(94, 200, 216, 0.3);
      color: rgba(94, 200, 216, 0.9);
      font-size: var(--fs-24);
      font-weight: 700;
      cursor: pointer;
      transition: all 0.2s ease;
      box-shadow: 0 4px 12px rgba(94, 200, 216, 0.25);
      z-index: 10000;
      -webkit-tap-highlight-color: transparent;
      border: none;
      padding: 0;
      margin: 0;
    }

    .drawer-close-floating:active {
      transform: scale(0.95);
      box-shadow: 0 2px 8px rgba(94, 200, 216, 0.2);
    }

    .drawer-menu.is-visible .drawer-close-floating {
      display: flex;
    }

    /* ドロワーの閉じるボタンは常に固定位置（スクロール追従なし） */
    .drawer-close-floating {
      position: fixed !important;
      bottom: calc(80px + max(8px, env(safe-area-inset-bottom))) !important;
      right: 20px !important;
    }
  }

  .drawer-content {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .drawer-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: none;
    background: transparent;
    border-radius: 12px;
    font-size: var(--fs-16);
    font-weight: 500;
    color: var(--text-main);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .drawer-menu-item:hover {
    background: rgba(245, 248, 255, 0.8);
  }

  .drawer-menu-item.active {
    background: linear-gradient(135deg, rgba(94, 200, 216, 0.14), rgba(143, 140, 243, 0.12));
    color: var(--text-main);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(150, 175, 220, 0.2);
  }

  .drawer-menu-icon {
    font-size: var(--fs-20);
    line-height: 1;
    flex-shrink: 0;
  }

  .drawer-menu-label {
    flex: 1;
    white-space: nowrap;
  }

  /* サブメニューを持つアイテム */
  .drawer-menu-item-has-submenu {
    position: relative;
  }

  .drawer-menu-chevron {
    font-size: 20px;
    line-height: 1;
    color: var(--text-sub);
    transition: transform 0.2s ease;
    flex-shrink: 0;
  }

  .drawer-menu-item-has-submenu[aria-expanded="true"] .drawer-menu-chevron {
    transform: rotate(90deg);
  }

  /* サブメニュー */
  .drawer-submenu {
    display: none;
    flex-direction: column;
    padding-left: 20px;
    margin-top: 4px;
    gap: 2px;
  }

  .drawer-menu-item-has-submenu[aria-expanded="true"] + .drawer-submenu,
  .drawer-submenu.is-visible {
    display: flex;
  }

  .drawer-submenu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-size: var(--fs-14);
    font-weight: 500;
    color: var(--text-sub);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .drawer-submenu-item:hover {
    background: rgba(245, 248, 255, 0.6);
    color: var(--text-main);
  }

  .drawer-submenu-item.active {
    background: linear-gradient(135deg, rgba(94, 200, 216, 0.12), rgba(143, 140, 243, 0.1));
    color: var(--text-main);
    font-weight: 600;
  }

  .drawer-submenu-icon {
    font-size: var(--fs-18);
    line-height: 1;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
  }

  .drawer-submenu-label {
    flex: 1;
    white-space: nowrap;
  }

  /* お金のミニ辞書ボタン（スマホ） */
  .money-dictionary-toggle {
    width: 36px;
    height: 36px;
    padding: 0;
    min-height: 36px;
    gap: 0;
    justify-content: center;
  }

  .money-dictionary-toggle .money-dictionary-label {
    display: none;
  }

  .money-dictionary-icon {
    font-size: var(--fs-18);
  }

  /* ユーザーメニューボタン（スマホ） */
  .user-menu-toggle {
    padding: 4px 8px 4px 4px;
    gap: 6px;
  }

  .user-menu-toggle .user-name {
    display: none;
  }

  .user-avatar-small {
    width: 28px;
    height: 28px;
    font-size: var(--fs-14);
  }

  /* タブ（非表示） */
  .tabs {
    display: none;
  }

  /* ボトムナビゲーション */
  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 8px 8px max(8px, env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 -2px 16px rgba(140, 160, 190, 0.15);
    border-top: 1px solid rgba(226, 232, 240, 0.5);
    z-index: 100;
  }

  .bottom-nav-button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 48px;
    padding: 6px 4px;
    border-radius: 12px;
    font-size: var(--fs-12);
    font-weight: 500;
    color: var(--text-sub);
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .bottom-nav-button.active {
    background: linear-gradient(135deg, rgba(94, 200, 216, 0.1), rgba(143, 140, 243, 0.08));
    color: var(--text-main);
    font-weight: 600;
  }

  .bottom-nav-label {
    font-size: var(--fs-11);
    white-space: nowrap;
  }

  /* コンテンツエリアのパディング調整 */
  .app-shell {
    padding-bottom: calc(64px + max(8px, env(safe-area-inset-bottom)) + 12px);
  }

  .tab-panel {
    padding-top: 4px;
    padding-right: 4px;
    padding-left: 0;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
  }

  /* グリッドレイアウト */
  .grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  /* タイポグラフィ調整 */
  h1, .h1 {
    font-size: var(--fs-20);
  }

  .app-title {
    font-size: var(--fs-20);
  }

  h2, .h2 {
    font-size: var(--fs-18);
  }

  h3, .h3 {
    font-size: var(--fs-16);
  }

  /* カードのパディング調整 */
  .card {
    padding: 10px 12px;
  }

  .card-header {
    margin-bottom: 8px;
    gap: 10px;
  }

  .card-title {
    font-size: var(--fs-14);
  }

  .card-sub {
    font-size: var(--fs-12);
    margin-bottom: 4px;
  }

  .amount {
    font-size: clamp(22px, 3vw, 28px);
    margin-top: 3px;
    margin-bottom: 8px;
  }

  .chip-row {
    font-size: var(--fs-13);
  }

  .chip {
    padding: 3px 7px;
    font-size: var(--fs-13);
  }

  .card-heading-row {
    margin-bottom: 8px;
    font-size: var(--fs-13);
  }

  .legend {
    margin-top: 6px;
    gap: 10px;
    font-size: var(--fs-13);
  }

  .legend-item {
    gap: 5px;
  }

  .legend-dot {
    width: 7px;
    height: 7px;
  }

  .placeholder {
    padding: 20px 4px 6px;
    font-size: var(--fs-13);
  }

  /* ユーザーメニュー（スマホ） */
  .user-menu {
    right: 8px;
    left: auto;
    width: calc(100vw - 16px);
    max-width: 320px;
    transform-origin: top right;
    z-index: 1000;
  }

  /* ダイアログとモーダル（スマホ） */
  .confirm-dialog,
  .alert-dialog {
    padding: 16px;
    align-items: flex-end;
  }

  .confirm-dialog-content,
  .alert-dialog-content {
    padding: 20px 16px;
    max-width: 100%;
    width: 100%;
    border-radius: 20px 20px 0 0;
    margin-bottom: 0;
  }

  .confirm-dialog-title,
  .alert-dialog-title {
    font-size: var(--fs-18);
    margin-bottom: 12px;
  }

  .confirm-dialog-message,
  .alert-dialog-message {
    font-size: var(--fs-14);
    margin-bottom: 20px;
    line-height: 1.6;
  }

  .confirm-dialog-actions,
  .alert-dialog-actions {
    flex-direction: column-reverse;
    gap: 8px;
  }

  .confirm-dialog-btn,
  .alert-dialog-btn {
    width: 100%;
    padding: 14px 20px;
    font-size: var(--fs-16);
    min-height: 48px;
    min-width: auto;
  }

  /* お金のミニ辞書モーダル（スマホ） */
  .money-dictionary-overlay {
    align-items: flex-end;
    justify-content: center;
  }

  .money-dictionary-modal {
    max-width: 100%;
    width: 100%;
    max-height: 85vh;
    border-radius: 24px 24px 0 0;
    margin: 0;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .money-dictionary-overlay.is-visible .money-dictionary-modal {
    transform: translateY(0);
  }

  .money-dictionary-header {
    padding: 16px 20px;
  }

  .money-dictionary-content {
    padding: 16px 20px;
  }
}

/* =========================
   お金のミニ辞書（全タブ共通）
   ========================= */

/* オーバーレイ */
.money-dictionary-overlay {
  position: fixed;
  inset: 0;
  left: 0;
  top: 0;
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  overflow-x: hidden;
}

.money-dictionary-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* iOS等の動的ビューポート対応 */
@supports (height: 100dvh) {
  .money-dictionary-overlay {
    height: 100dvh;
  }
}

/* モーダル表示中の背景スクロール防止 */
body.modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* モーダル（PC） */
.money-dictionary-modal {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.2s ease;
  pointer-events: auto;
}

.money-dictionary-overlay.is-visible .money-dictionary-modal {
  transform: scale(1);
}

/* ヘッダー */
.money-dictionary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  flex-shrink: 0;
}

.money-dictionary-header-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.money-dictionary-header-icon {
  font-size: var(--fs-24);
  line-height: 1;
}

.money-dictionary-title {
  font-size: var(--fs-20);
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.money-dictionary-close {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: rgba(245, 248, 255, 0.6);
  color: var(--text-sub);
  font-size: var(--fs-24);
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
  padding: 0;
  margin: 0;
}

.money-dictionary-close:hover {
  background: rgba(94, 200, 216, 0.15);
  color: var(--mint);
}

/* フローティング閉じるボタン（スマホ版のみ） */
.money-dictionary-close-floating {
  display: none;
}

@media (max-width: 768px) {
  .money-dictionary-close {
    display: none;
  }

  .money-dictionary-close-floating {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: calc(80px + max(8px, env(safe-area-inset-bottom)));
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, 
      rgba(94, 200, 216, 0.2) 0%,
      rgba(143, 140, 243, 0.15) 100%);
    border: 2px solid rgba(94, 200, 216, 0.3);
    color: rgba(94, 200, 216, 0.9);
    font-size: var(--fs-24);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(94, 200, 216, 0.25);
    z-index: 10000;
    -webkit-tap-highlight-color: transparent;
    border: none;
    padding: 0;
    margin: 0;
  }

  .money-dictionary-close-floating:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(94, 200, 216, 0.2);
  }

  .money-dictionary-overlay.is-visible .money-dictionary-close-floating {
    display: flex;
  }

  /* ミニ辞書の閉じるボタンも常に固定位置（スクロール追従なし） */
  .money-dictionary-close-floating {
    position: fixed !important;
    bottom: calc(80px + max(8px, env(safe-area-inset-bottom))) !important;
    right: 20px !important;
  }

}

.money-dictionary-subtitle {
  padding: 12px 24px;
  font-size: var(--fs-14);
  color: var(--text-sub);
  border-bottom: 1px solid rgba(226, 232, 240, 0.4);
  flex-shrink: 0;
}

/* コンテンツ */
.money-dictionary-content {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.money-dictionary-category-title {
  padding-left: 0;
}

.money-dictionary-term-item {
  padding-left: 0;
}

.money-dictionary-category-section {
  margin-bottom: 28px;
}

.money-dictionary-category-section:last-child {
  margin-bottom: 0;
}

.money-dictionary-category-title {
  font-size: var(--fs-17);
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 16px;
  padding-bottom: 10px;
  padding-left: 0;
  border-bottom: 2px solid rgba(94, 200, 216, 0.2);
  letter-spacing: 0.01em;
}

.money-dictionary-term-item {
  padding: 18px 0 18px 0;
  border-bottom: 1px solid rgba(226, 232, 240, 0.3);
}

.money-dictionary-category-section .money-dictionary-term-item:last-child {
  border-bottom: none;
}

.money-dictionary-term-name-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.money-dictionary-term-icon {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--text-main);
  flex-shrink: 0;
  opacity: 0.4;
}

.money-dictionary-term-name {
  font-size: var(--fs-16);
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.5;
  flex: 1;
}

.money-dictionary-term-description {
  font-size: var(--fs-14);
  color: var(--text-main);
  line-height: 1.7;
  white-space: pre-line;
  padding-left: 16px;
  margin-top: 4px;
}

/* スマホ：ボトムシート */
@media (max-width: 768px) {
  .money-dictionary-toggle .money-dictionary-label {
    display: none;
  }

  .money-dictionary-toggle {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
  }

  .money-dictionary-overlay {
    align-items: flex-end;
    justify-content: center;
  }

  .money-dictionary-modal {
    max-width: 100%;
    width: 100%;
    max-height: 80vh;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .money-dictionary-overlay.is-visible .money-dictionary-modal {
    transform: translateY(0);
  }

  .money-dictionary-header {
    padding: 16px 20px;
  }

  .money-dictionary-subtitle {
    padding: 10px 20px;
  }

  .money-dictionary-content {
    padding: 16px 20px;
  }

  .money-dictionary-term-item {
    padding: 14px 0;
  }

  @supports (height: 100dvh) {
    .money-dictionary-overlay {
      height: 100dvh;
    }
  }
}

/* PC・タブレット：スワイプヒントを非表示 */
@media (min-width: 769px) {
  .swipe-hint {
    display: none !important;
  }
}
