/* ============================================================
   吉日カレンダー - スタイルシート (style.css)
   ・完全純生CSS / 外部CDN・フォント非依存
   ・和モダン＆洗練されたクリーンデザイン
   ・モバイル対応（横スクロール皆無、タッチ領域44px以上）
   ・アクセシビリティ（高い文字コントラスト、キーボードフォーカス明示）
   ・prefers-reduced-motion 尊重
   ============================================================ */

:root {
  --color-bg: #f9f8f5;
  --color-surface: #ffffff;
  --color-surface-subtle: #f4f2ec;
  --color-border: #e3dec3;
  --color-border-light: #ece9de;
  --color-text-main: #1f2429;
  --color-text-sub: #4b5563;
  --color-text-muted: #545b67;

  /* アクセントカラー */
  --color-primary: #c53d43;       /* 茜色 */
  --color-primary-hover: #aa3137;
  --color-primary-subtle: #faebeb;
  --color-gold: #b45309;          /* 黄金 */
  --color-gold-bg: #fef3c7;
  --color-ichiryu: #be123c;       /* 紅 */
  --color-ichiryu-bg: #ffe4e6;
  --color-taian: #b91c1c;         /* 朱色 */
  --color-taian-bg: #fee2e2;
  --color-tora: #b45309;          /* 虎斑 */
  --color-tora-bg: #fffbeb;
  --color-mi: #047857;            /* 翠色 */
  --color-mi-bg: #ecfdf5;
  --color-fujoju: #475569;        /* 墨鈍色 */
  --color-fujoju-bg: #f1f5f9;
  --color-holiday: #b91c1c;       /* 祝日赤 */
  --color-sunday: #b91c1c;
  --color-saturday: #1d4ed8;

  --color-recommended: #0284c7;   /* 推奨日ハイライト青 */
  --color-recommended-bg: #f0f9ff;
  --color-recommended-border: #38bdf8;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);

  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "BIZ UDPGothic", Meiryo, sans-serif;
}

/* リセット & 基本設定 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--color-bg);
  color: var(--color-text-main);
  line-height: 1.6;
  font-size: 15px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* キーボードフォーカス表示 */
:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
}

/* prefers-reduced-motion 対応 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* レイアウトコンテナ */
.app-container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 16px 16px 40px;
}

/* 1. ヘッダー: 站名只占一行，说明文字最多一行（手机上隐藏说明） */
.app-header {
  text-align: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.app-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--color-text-main);
  line-height: 1.3;
  white-space: nowrap;
}

.app-desc {
  font-size: 13px;
  color: var(--color-text-sub);
  margin-top: 4px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 2. 「日付を入力して判定」: 页面第一视觉 */
.direct-date-section {
  background: var(--color-surface);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.direct-date-heading {
  font-size: 24px;
  font-weight: 800;
  color: var(--color-text-main);
  text-align: center;
  margin-bottom: 12px;
}

.direct-date-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.direct-date-input {
  font-size: 22px;
  font-weight: 700;
  padding: 10px 16px;
  width: min(100%, 340px);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  min-height: 56px;
  color: var(--color-text-main);
  background: #fff;
  font-family: inherit;
}

.direct-date-input:focus-visible {
  border-color: #2563eb;
  outline: 3px solid #2563eb;
  outline-offset: 2px;
}

.btn-direct-judge {
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 32px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  min-height: 56px;
  transition: background 0.15s ease;
  font-family: inherit;
}

.btn-direct-judge:hover {
  background: var(--color-primary-hover);
}

.quick-date-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.btn-quick {
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  color: var(--color-text-main);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  min-height: 36px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-quick:hover {
  background: #e9e5d8;
  border-color: #cbbe9f;
}

.date-input-alert {
  background: #fef2f2;
  border: 1px solid #f87171;
  color: #991b1b;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  margin-top: 12px;
  text-align: center;
}

/* 3. 判定结果区 (页内显示) */
.result-section {
  background: var(--color-surface);
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
}

.result-top-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.result-title {
  font-size: 21px;
  font-weight: 800;
  color: var(--color-text-main);
  outline: none;
}

.badge-rokuyo-lg {
  display: inline-block;
  font-size: 18px;
  font-weight: 900;
  padding: 4px 14px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
}

.badge-rokuyo-taian {
  background: var(--color-taian-bg);
  color: var(--color-taian);
  border: 1px solid #fca5a5;
}

.badge-rokuyo-butsumetsu {
  background: var(--color-fujoju-bg);
  color: var(--color-fujoju);
  border: 1px solid #cbd5e1;
}

.badge-rokuyo-tomobiki {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fde047;
}

.badge-rokuyo-sensho {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #7dd3fc;
}

.badge-rokuyo-sakimake {
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #c4b5fd;
}

.badge-rokuyo-shakko {
  background: #ffedd5;
  color: #c2410c;
  border: 1px solid #fdba74;
}

.badge-rokuyo-neutral {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.result-sub-date {
  font-size: 14px;
  color: var(--color-text-sub);
  margin-top: 4px;
}

.result-notices {
  margin-top: 10px;
}

.result-notice-box {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 8px;
}

.notice-warning {
  background: #fffbeb;
  border: 1px solid #fef08a;
  color: #854d0e;
}

.notice-info {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0369a1;
}

.result-holiday-box {
  background: var(--color-primary-subtle);
  color: var(--color-primary);
  font-weight: 700;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

/* 吉 / 凶 行 */
.result-judgement-card {
  background: #fafaf9;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-top: 12px;
}

.judgement-line {
  white-space: pre-line;
  font-size: 15px;
  line-height: 1.6;
}

.judgement-line.lucky {
  color: #047857;
  font-weight: 700;
}

.judgement-line.unlucky {
  color: #b91c1c;
  font-weight: 700;
  margin-top: 4px;
}

/* 吉日・凶日タグ */
.result-rekichu-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  line-height: 1.3;
}

.tag-tensha { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.tag-ichiryu { background: #ffe4e6; color: #be123c; border: 1px solid #fecdd3; }
.tag-taian { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.tag-tora { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.tag-mi { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.tag-koushi { background: #f3e8ff; color: #7e22ce; border: 1px solid #e9d5ff; }
.tag-inu { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.tag-lucky-default { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.tag-unlucky-default { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.tag-fujoju { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }

/* 点数の内訳を見る（折叠） */
.score-details-collapse {
  margin-top: 14px;
  border-top: 1px solid var(--color-border-light);
  padding-top: 10px;
}

.score-details-summary {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-sub);
  cursor: pointer;
  padding: 4px 0;
  user-select: none;
}

.score-details-list {
  background: #f8fafc;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 8px;
  font-size: 13px;
}

.score-breakdown-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px dashed #e2e8f0;
}

.score-breakdown-row:last-child {
  border-bottom: none;
}

.breakdown-purpose {
  font-weight: 700;
  color: var(--color-text-main);
  min-width: 100px;
}

.breakdown-score.pos {
  color: #0369a1;
  font-weight: 800;
}

.breakdown-score.neg {
  color: #b91c1c;
  font-weight: 800;
}

.breakdown-score.zero {
  color: #64748b;
  font-weight: 800;
}

.breakdown-reasons {
  color: var(--color-text-sub);
  font-size: 12px;
}

/* 4. 「次のおすすめ日」カード */
.next-recommended-card {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 2px solid #f59e0b;
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.next-recommended-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.next-rec-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.next-rec-icon {
  font-size: 16px;
}

.next-rec-title {
  font-size: 14px;
  font-weight: 800;
  color: #92400e;
}

.next-rec-body {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.next-rec-date-text {
  font-size: 17px;
  font-weight: 800;
  color: #78350f;
}

.next-rec-tags {
  font-size: 13px;
  font-weight: 700;
  color: #b45309;
  background: rgba(255, 255, 255, 0.7);
  padding: 2px 10px;
  border-radius: 12px;
}

/* 5. 月历 (Calendar Wrapper) */
.calendar-wrapper {
  margin-bottom: 20px;
}

.controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.date-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-nav {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-main);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  min-height: 38px;
  font-family: inherit;
}

.btn-nav:hover {
  background: var(--color-surface-subtle);
}

.current-label-group {
  margin-left: 6px;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.current-month-text {
  font-size: 18px;
  font-weight: 800;
  color: var(--color-text-main);
}

.current-era-text {
  font-size: 12px;
  color: var(--color-text-sub);
}

.action-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.view-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.tab-btn {
  flex: 1;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-sub);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.tab-btn.active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.calendar-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: var(--shadow-sm);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border-light);
}

.weekday-cell {
  color: var(--color-text-sub);
}

.weekday-cell.sun {
  color: var(--color-sunday);
}

.weekday-cell.sat {
  color: var(--color-saturday);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--color-border-light);
  border: 1px solid var(--color-border-light);
  margin-top: 8px;
}

/* 3層格子のスタイリング */
.day-cell {
  background: #fff;
  padding: 4px 2px;
  min-height: 58px;
  max-height: 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  user-select: none;
}

.day-cell:hover {
  background: #f8fafc;
}

.day-cell.other-month {
  opacity: 0.35;
}

/* 1層目: 日付数字 */
.cell-layer-num {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  height: 22px;
}

.cell-num-badge {
  font-size: 13px;
  font-weight: 700;
  width: 22px;
  height: 22px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  color: var(--color-text-main);
}

.day-cell.sat .cell-num-badge {
  color: var(--color-saturday);
}

.day-cell.sun .cell-num-badge,
.day-cell.holiday .cell-num-badge {
  color: var(--color-sunday);
}

.day-cell.is-today .cell-num-badge {
  border: 2px solid var(--color-primary);
  background: var(--color-primary-subtle);
}

.day-cell.is-selected-date {
  outline: 2px solid #2563eb;
  background: #eff6ff !important;
}

.day-cell.is-recommended {
  border-top: 3px solid var(--color-recommended);
}

.cell-rec-dot {
  position: absolute;
  right: 2px;
  top: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-recommended);
}

/* 2層目: 六曜 */
.cell-layer-rokuyo {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-sub);
  text-align: center;
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.cell-rokuyo-text.taian {
  color: var(--color-taian);
}

.cell-rokuyo-text.butsumetsu {
  color: var(--color-fujoju);
}

/* 3層目: 重点吉日简称（最多1個） */
.cell-layer-tag {
  height: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  overflow: hidden;
}

.cell-key-tag {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 96%;
  line-height: 1.2;
}

.key-tag-tensha { background: #fef3c7; color: #b45309; }
.key-tag-ichiryu { background: #ffe4e6; color: #be123c; }
.key-tag-tora { background: #fffbeb; color: #b45309; }
.key-tag-mi { background: #ecfdf5; color: #047857; }
.key-tag-koushi { background: #f3e8ff; color: #7e22ce; }
.key-tag-daimyo { background: #f0fdf4; color: #15803d; }
.key-tag-tenon { background: #eff6ff; color: #1d4ed8; }
.key-tag-boso { background: #fdf4ff; color: #a21caf; }
.key-tag-fujoju { background: #f1f5f9; color: #475569; }

/* フィルター時のハイライト */
.day-cell.is-filter-matched {
  background: #fefce8;
}

.day-cell.filter-dimmed {
  opacity: 0.35;
}

/* 年間吉日一覧 */
.year-overview-view {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
}

.super-luck-banner {
  background: linear-gradient(135deg, #fef3c7 0%, #fffbeb 100%);
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 16px;
}

.super-luck-title {
  font-size: 15px;
  font-weight: 800;
  color: #92400e;
  margin-bottom: 8px;
}

.super-luck-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.super-luck-card {
  background: #fff;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.super-luck-date {
  font-size: 14px;
  font-weight: 800;
  color: #78350f;
}

.super-luck-desc {
  font-size: 12px;
  color: #b45309;
}

.year-months-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.year-month-card {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  padding: 10px;
  background: #fafaf9;
}

.year-month-header {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--color-border-light);
}

.year-month-count {
  font-size: 12px;
  color: var(--color-text-sub);
}

.year-day-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px dashed #e2e8f0;
}

.year-day-row:last-child {
  border-bottom: none;
}

.year-day-date {
  font-size: 13px;
  font-weight: 700;
}

/* 6. 「用途でおすすめ日を判定」 & 暦注フィルター (月歴下部) */
.filter-card,
.rekichu-filter-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.filter-header,
.rekichu-filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.filter-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-chip {
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-main);
  cursor: pointer;
  min-height: 36px;
  font-family: inherit;
  transition: all 0.15s ease;
}

.filter-chip.active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.filter-note {
  font-size: 12px;
  color: var(--color-text-sub);
  margin-top: 8px;
  line-height: 1.5;
}

.filter-note-mobile {
  display: none;
}

.rekichu-filter-group {
  margin-top: 8px;
}

.filter-group-label {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
  display: block;
}

.filter-group-label.lucky { color: #047857; }
.filter-group-label.unlucky { color: #b91c1c; }

.rekichu-chips-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rekichu-filter-chip {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  min-height: 32px;
  font-family: inherit;
}

.rekichu-filter-chip.active {
  background: #047857;
  color: #fff;
  border-color: #047857;
}

.rekichu-filter-chip.unlucky-chip.active {
  background: #b91c1c;
  color: #fff;
  border-color: #b91c1c;
}

.btn-filter-reset {
  background: none;
  border: none;
  color: #2563eb;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
}

/* 7. 「このサイトの暦注の定義」 (3行概要 + teigi.htmlへのリンク) */
.definitions-summary-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 20px;
  text-align: center;
}

.definitions-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--color-text-main);
  margin-bottom: 8px;
}

.definitions-summary-text {
  font-size: 14px;
  color: var(--color-text-sub);
  line-height: 1.7;
  max-width: 680px;
  margin: 0 auto 14px;
}

.btn-more-definitions {
  display: inline-block;
  background: #2563eb;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 9px 22px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 0.15s ease;
}

.btn-more-definitions:hover {
  background: #1d4ed8;
}

/* 8. フッター */
.app-footer {
  text-align: center;
  font-size: 12px;
  color: var(--color-text-sub);
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
  line-height: 1.8;
}

.app-footer a {
  color: #2563eb;
  text-decoration: none;
}

/* teigi.html 固有スタイル */
.teigi-header {
  text-align: left;
  padding-bottom: 12px;
}

.nav-back-link {
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  color: #2563eb;
  text-decoration: none;
  margin-bottom: 10px;
}

.nav-back-link:hover {
  text-decoration: underline;
}

.definitions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.def-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.def-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.def-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--color-text-main);
}

.def-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.badge-lucky { background: #ecfdf5; color: #047857; }
.badge-unlucky { background: #fef2f2; color: #991b1b; }
.badge-neutral { background: #f1f5f9; color: #475569; }

.def-meta {
  font-size: 11px;
  color: #64748b;
}

.def-desc {
  font-size: 14px;
  color: var(--color-text-main);
  line-height: 1.6;
  margin-top: 4px;
}

.def-sources {
  font-size: 12px;
  color: var(--color-text-sub);
  margin-top: 8px;
}

.def-sources a {
  color: #2563eb;
  word-break: break-all;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ==========================================
   モバイルレスポンシブ (375px)
   ========================================== */
@media (max-width: 600px) {
  .app-container {
    padding: 10px 8px 32px;
    width: 100%;
    overflow-x: hidden;
  }

  .app-title {
    font-size: 20px;
  }

  .app-desc {
    display: none;
  }

  .direct-date-section {
    padding: 12px 10px;
  }

  .direct-date-controls {
    flex-direction: column;
    width: 100%;
  }

  .direct-date-input {
    width: 100%;
    text-align: center;
  }

  .btn-direct-judge {
    width: 100%;
  }

  .result-section {
    padding: 14px 12px;
  }

  .result-title {
    font-size: 18px;
  }

  .badge-rokuyo-lg {
    font-size: 16px;
    padding: 3px 10px;
  }

  .next-rec-date-text {
    font-size: 15px;
  }

  .calendar-card {
    padding: 6px 4px;
  }

  .day-cell {
    padding: 2px 1px;
    min-height: 52px;
    max-height: 58px;
  }

  .cell-num-badge {
    font-size: 12px;
    width: 18px;
    height: 18px;
  }

  .cell-layer-rokuyo {
    font-size: 10px;
  }

  .cell-key-tag {
    font-size: 10px;
    padding: 0 2px;
  }

  .filter-note-desktop {
    display: none;
  }

  .filter-note-mobile {
    display: inline;
  }
}

/* ==========================================================
   公開用：サイト名・フッターリンク・静的SEOページ
   ========================================================== */
.app-title-sub {
  font-size: 0.6em;
  font-weight: 700;
  color: var(--color-text-sub);
  margin-left: 6px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  margin-bottom: 10px;
}

.footer-links a,
.seo-links a {
  color: var(--color-text-main);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.seo-links {
  text-align: left;
  margin: 0 auto 16px;
  max-width: 900px;
}

.seo-links h2 {
  font-size: 15px;
  margin: 12px 0 6px;
}

.seo-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.static-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 4px 24px;
}

.static-page h1 {
  font-size: 24px;
  line-height: 1.4;
  margin: 8px 0 12px;
}

.static-page h2 {
  font-size: 19px;
  margin: 28px 0 10px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--color-border);
}

.static-page p,
.static-page li {
  line-height: 1.8;
}

.breadcrumb {
  font-size: 13px;
  color: var(--color-text-sub);
  margin: 4px 0 8px;
}

.breadcrumb a {
  color: var(--color-text-sub);
}

.lead-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin: 12px 0;
}

.note-box {
  background: var(--color-surface-subtle);
  border-left: 4px solid var(--color-gold);
  padding: 10px 14px;
  margin: 12px 0;
  font-size: 14px;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.day-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  font-size: 14px;
}

.day-table th,
.day-table td {
  border: 1px solid var(--color-border);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

.day-table th {
  background: var(--color-surface-subtle);
  white-space: nowrap;
}

.day-table td.date-cell {
  white-space: nowrap;
}

.day-table .sat { color: #1d4ed8; }
.day-table .sun,
.day-table .hol { color: #b91c1c; }

.pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 20px 0;
}

.pager a {
  color: var(--color-text-main);
}

.cta-link {
  display: inline-block;
  margin: 8px 0;
  padding: 10px 18px;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-decoration: none;
}

.cta-link:focus-visible,
.footer-links a:focus-visible,
.seo-links a:focus-visible,
.static-page a:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .static-page h1 {
    font-size: 20px;
  }
  .day-table {
    font-size: 13px;
  }
  .day-table th,
  .day-table td {
    padding: 5px 6px;
  }
}
