:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --accent: #10b981;
  --accent-bg: #ecfdf5;

  /* フォーム・ボタン・コンポーネント共通 */
  --input-bg: #f8fafc;
  --input-bg-focus: #ffffff;
  --input-border: #cbd5e1;
  --btn-gray: #f1f5f9;
  --btn-gray-text: #475569;
  --btn-clear-bg: #e2e8f0;
  --footer-bg: #ffffff;

  /* ツール固有カラー */
  --discount-text: #dc2626;
  --discount-bg: #fef2f2;
  --win-bg: #ecfdf5;
  --win-border: #10b981;
  --win-text: #047857;
  --drinker-bg: #eff6ff;
  --drinker-border: #93c5fd;
  --gray-bg: #f8fafc;
  --gold-1: #f59e0b;
  --gold-2: #d97706;
  --silver-1: #94a3b8;
  --silver-2: #64748b;
}

/* ダークテーマ手動設定 */
html.dark {
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --bg: #0f172a;
  --card-bg: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border: #334155;
  --accent: #10b981;
  --accent-bg: #064e3b;

  --input-bg: #0f172a;
  --input-bg-focus: #162032;
  --input-border: #475569;
  --btn-gray: #334155;
  --btn-gray-text: #e2e8f0;
  --btn-clear-bg: #334155;
  --footer-bg: #0f172a;

  --discount-text: #f87171;
  --discount-bg: rgba(220, 38, 38, 0.2);
  --win-bg: rgba(16, 185, 129, 0.18);
  --win-border: #10b981;
  --win-text: #34d399;
  --drinker-bg: rgba(37, 99, 235, 0.15);
  --drinker-border: #3b82f6;
  --gray-bg: #1e293b;
}

/* OS設定がダークかつ手動で.lightが指定されていない場合の自動連動 */
@media (prefers-color-scheme: dark) {
  html:not(.light) {
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --bg: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --accent: #10b981;
    --accent-bg: #064e3b;

    --input-bg: #0f172a;
    --input-bg-focus: #162032;
    --input-border: #475569;
    --btn-gray: #334155;
    --btn-gray-text: #e2e8f0;
    --btn-clear-bg: #334155;
    --footer-bg: #0f172a;

    --discount-text: #f87171;
    --discount-bg: rgba(220, 38, 38, 0.2);
    --win-bg: rgba(16, 185, 129, 0.18);
    --win-border: #10b981;
    --win-text: #34d399;
    --drinker-bg: rgba(37, 99, 235, 0.15);
    --drinker-border: #3b82f6;
    --gray-bg: #1e293b;
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background-color: var(--bg);
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* レイアウト */
.wrapper {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 16px;
  flex: 1;
  width: 100%;
  position: relative;
}

.container {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

/* ナビゲーション */
#site-nav, .top-nav, .header-nav {
  padding-top: 4px;
}
.wrapper #site-nav, .wrapper .header-nav {
  position: absolute;
  top: 18px;
  right: 16px;
  padding-top: 0;
  margin-bottom: 0;
  z-index: 10;
}

.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-height: 38px;
}
.wrapper .nav-bar {
  min-height: auto;
  justify-content: flex-end;
}
.nav-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.theme-toggle-btn {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-main);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  flex-shrink: 0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  vertical-align: middle;
}
.theme-toggle-btn:hover {
  border-color: var(--primary);
  transform: scale(1.08);
}
.theme-toggle-btn:active {
  transform: scale(0.92);
}

.back-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: opacity 0.15s ease;
}
.back-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* ヘッダー */
header {
  text-align: center;
  padding: 4px 0 6px;
}
header h1 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}
.has-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
header p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* トップページ専用ヘッダー */
.site-header {
  margin-bottom: 28px;
  padding-top: 2px;
  padding-left: 44px;
  padding-right: 44px;
}
.site-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}
.site-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* カード共通 */
.card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  border: 1px solid var(--border);
}
.wrapper .card {
  padding: 28px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.card-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 入力・フォーム共通 */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}
.input-group:last-child {
  margin-bottom: 0;
}
.input-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}
.input-group input {
  width: 100%;
  padding: 10px 12px;
  font-size: 1.15rem;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  outline: none;
  background: var(--input-bg);
  -webkit-appearance: none;
  font-weight: 600;
  color: var(--text-main);
}
.input-group input:focus {
  border-color: var(--primary);
  background: var(--input-bg-focus);
}

.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.input-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 10px;
}

/* ボタン共通 */
.btn-action {
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background 0.15s ease;
}
.btn-action:active {
  background: var(--primary-hover);
}

.btn-clear {
  background: var(--btn-clear-bg);
  color: var(--btn-gray-text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: opacity 0.15s ease;
}
.btn-clear:active {
  opacity: 0.8;
}

.btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* 折りたたみガイド共通 */
details.guide-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.82rem;
  color: var(--text-muted);
}
details.guide-box summary {
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
details.guide-box summary::-webkit-details-marker {
  display: none;
}
details.guide-box summary::after {
  content: "＋";
  font-size: 0.9rem;
  color: var(--text-muted);
}
details.guide-box[open] summary::after {
  content: "−";
}
details.guide-box ol {
  margin: 10px 0 0 18px;
  line-height: 1.6;
}
details.guide-box li {
  margin-bottom: 4px;
}

/* 広告バナー（※AdSense審査通過までは完全非表示にして未完成感を排除） */
.ad-banner {
  display: none !important;
  min-height: 90px;
  background: var(--gray-bg);
  border: 1px dashed var(--border);
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* フッター共通 */
footer, #site-footer {
  margin-top: auto;
  padding: 24px 16px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--footer-bg);
  width: 100%;
}
.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-bottom: 12px;
}
.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}
.footer-links a:hover {
  color: var(--primary);
  text-decoration: underline;
}
.copyright {
  font-size: 0.75rem;
  color: #94a3b8;
}

/* ----------------------------------------------------
   トップページ (index.html) スタイル
---------------------------------------------------- */
.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tool-grid {
  display: grid;
  gap: 14px;
}
.tool-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.tool-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,99,235,0.08);
}
.tool-info h3 {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tool-info p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}
.badge {
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-active {
  background: #ecfdf5;
  color: #059669;
}
.tool-arrow {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  margin-left: 12px;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
.tool-card:hover .tool-arrow {
  transform: translateX(3px);
}
.about-box {
  margin-top: 40px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-muted);
}
.about-box h4 {
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 8px;
}

/* ----------------------------------------------------
   文字数カウント (counter) スタイル
---------------------------------------------------- */
textarea {
  width: 100%;
  height: 160px;
  padding: 12px;
  font-size: 1rem;
  line-height: 1.5;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  outline: none;
  background: var(--input-bg);
  resize: vertical;
  color: var(--text-main);
}
textarea:focus {
  border-color: var(--primary);
  background: var(--input-bg-focus);
}
/* --- 文字数カウンター ワークスペース --- */
.counter-workspace {
  display: flex;
  flex-direction: column;
}
.counter-input-col,
.counter-result-col {
  width: 100%;
}
.counter-result-col .stat-grid {
  margin-top: 14px;
}
.counter-result-col .speech-box {
  margin-top: 14px;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.stat-box {
  background: var(--gray-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}
.stat-box.highlight {
  background: rgba(37, 99, 235, 0.12);
  border-color: var(--primary);
}
.stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}
.stat-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 2px;
}
.stat-box.highlight .stat-val {
  color: var(--primary);
}
.stat-unit {
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 2px;
  color: var(--text-muted);
}
.speech-box {
  background: var(--accent-bg);
  border: 1px solid #a7f3d0;
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}
.speech-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #065f46;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.speech-time {
  font-size: 1.8rem;
  font-weight: 900;
  color: #047857;
  margin: 6px 0 2px;
}
.speech-sub {
  font-size: 0.75rem;
  color: #059669;
  line-height: 1.4;
}

/* --- スピーチ実測タイマー＆録音セルフチェック --- */
.practice-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 22px 20px;
  margin-top: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

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

.practice-title {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.practice-badge-safe {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}

html.dark .practice-badge-safe {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}

.practice-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 14px;
}

.timer-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 12px;
  text-align: center;
  margin-bottom: 14px;
}

.timer-display {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
  margin: 4px 0;
}

.timer-display.running {
  color: var(--primary);
}

.recording-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #dc2626;
  margin-top: 4px;
}

.rec-dot {
  width: 8px;
  height: 8px;
  background-color: #dc2626;
  border-radius: 50%;
  animation: recPulse 1.2s infinite ease-in-out;
}

@keyframes recPulse {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.record-toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 14px;
  cursor: pointer;
  user-select: none;
}

.record-toggle-wrap input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
  cursor: pointer;
}

.timer-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.btn-timer {
  appearance: none;
  border: none;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 10px 22px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-timer-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn-timer-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-timer-stop {
  background: #dc2626;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
}

.btn-timer-stop:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-timer-sub {
  background: var(--border);
  color: var(--text-main);
}

.btn-timer-sub:hover {
  filter: brightness(0.95);
  transform: translateY(-1px);
}

.audio-preview-wrap {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-top: 14px;
  text-align: center;
}

.audio-preview-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.audio-preview-wrap audio {
  width: 100%;
  max-width: 440px;
  height: 42px;
}

.diagnosis-box {
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  border-radius: 14px;
  padding: 16px 18px;
  margin-top: 14px;
  animation: fadeInDiag 0.25s ease-out;
}

.diagnosis-box.fast {
  background: #fff7ed;
  border-color: #fed7aa;
}

.diagnosis-box.optimal {
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.diagnosis-box.slow {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

html.dark .diagnosis-box {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(255, 255, 255, 0.1);
}

html.dark .diagnosis-box.fast {
  background: rgba(154, 52, 18, 0.15);
  border-color: rgba(251, 146, 60, 0.3);
}

html.dark .diagnosis-box.optimal {
  background: rgba(4, 120, 87, 0.15);
  border-color: rgba(52, 211, 153, 0.3);
}

html.dark .diagnosis-box.slow {
  background: rgba(22, 101, 52, 0.15);
  border-color: rgba(74, 222, 128, 0.3);
}

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

.diagnosis-badge {
  font-size: 0.82rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
}

.diagnosis-badge.fast {
  background: #fed7aa;
  color: #9a3412;
}

.diagnosis-badge.optimal {
  background: #a7f3d0;
  color: #065f46;
}

.diagnosis-badge.slow {
  background: #bbf7d0;
  color: #166534;
}

.diagnosis-stats {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.diagnosis-desc {
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--text-main);
  margin: 0;
}

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

/* ----------------------------------------------------
   セール割引・消費税計算 (discount) スタイル
---------------------------------------------------- */
.quick-tags {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 6px;
}
.tag-btn {
  background: var(--btn-gray);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--btn-gray-text);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}
.tag-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}
.tax-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 4px;
}
.tax-btn {
  background: var(--btn-gray);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--btn-gray-text);
  cursor: pointer;
  text-align: center;
}
.tax-btn.active {
  background: var(--text-main);
  border-color: var(--text-main);
  color: var(--bg);
}
.result-box {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.result-box.highlight {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.12);
}
.result-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}
.result-price {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--text-main);
  margin: 4px 0;
  letter-spacing: -0.5px;
}
.result-price span {
  font-size: 1.1rem;
  font-weight: 700;
  margin-left: 2px;
}
.result-saved {
  display: inline-block;
  background: var(--discount-bg);
  color: var(--discount-text);
  font-size: 0.88rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid #fca5a5;
}

/* ----------------------------------------------------
   単価比較ツール (price-compare) スタイル
---------------------------------------------------- */
.card.winner {
  background: var(--win-bg);
  border-color: var(--win-border);
}
.card .badge {
  background: var(--btn-clear-bg);
  color: var(--btn-gray-text);
}
.card.winner .badge {
  background: var(--win-border);
  color: #ffffff;
  font-weight: 700;
}
.point-row {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--gray-bg);
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px dashed var(--border);
}
.point-row label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.point-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.point-input-wrap input {
  width: 72px;
  padding: 6px 8px;
  font-size: 0.95rem;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  outline: none;
  background: var(--input-bg);
  color: var(--text-main);
  text-align: right;
  font-weight: 600;
}
.point-input-wrap input:focus {
  border-color: var(--primary);
  background: var(--input-bg-focus);
}
.sub-real {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}
.card.winner .sub-real {
  color: var(--win-text);
}
.unit-price {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.unit-price strong {
  font-size: 1.15rem;
  color: var(--text-main);
}
.card.winner .unit-price strong {
  color: var(--win-text);
}
.result-text {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}
.result-diff {
  font-size: 0.85rem;
  color: var(--win-text);
  font-weight: 600;
  margin-top: 4px;
}

/* ----------------------------------------------------
   コイン・ダイス・乱数 (random) スタイル
---------------------------------------------------- */
.tab-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: var(--btn-clear-bg);
  padding: 4px;
  border-radius: 10px;
}
.tab-btn {
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 10px 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.tab-btn.active {
  background: var(--card-bg);
  color: var(--primary);
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}
.panel {
  display: none;
  flex-direction: column;
  gap: 14px;
}
.panel.active {
  display: flex;
}
.btn-roll {
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 14px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(37,99,235,0.25);
  transition: all 0.15s ease;
  width: 100%;
}
.btn-roll:active {
  transform: scale(0.98);
  background: var(--primary-hover);
}
.btn-roll:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
.history-box {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 22px;
}
.history-badge {
  background: var(--btn-gray);
  border: 1px solid var(--border);
  color: var(--btn-gray-text);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}
.coin-stage {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 800px;
}
.coin {
  width: 100px;
  height: 100px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 1.2s cubic-bezier(0.15, 0.9, 0.35, 1.2);
}
.coin-face {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 900;
  color: #ffffff;
  backface-visibility: hidden;
  box-shadow: inset 0 0 0 6px rgba(255,255,255,0.4), 0 6px 14px rgba(0,0,0,0.15);
  border: 3px dashed rgba(255,255,255,0.6);
}
.coin-front {
  background: radial-gradient(circle, #fcd34d, var(--gold-2));
}
.coin-back {
  background: radial-gradient(circle, #cbd5e1, var(--silver-2));
  transform: rotateY(180deg);
}
.coin-sub {
  font-size: 0.65rem;
  letter-spacing: 1px;
  margin-top: -2px;
  opacity: 0.9;
}
.dice-stage {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dice-box {
  width: 90px;
  height: 90px;
  background: var(--card-bg);
  border: 4px solid var(--primary);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--primary);
  box-shadow: 0 8px 20px rgba(37,99,235,0.15);
  transition: all 0.2s;
}
.dice-box.rolling {
  animation: diceRoll 0.8s ease-in-out infinite;
}
@keyframes diceRoll {
  0% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-25deg) scale(1.1) translateY(-10px); }
  50% { transform: rotate(25deg) scale(0.95) translateY(5px); }
  75% { transform: rotate(-15deg) scale(1.05) translateY(-5px); }
  100% { transform: rotate(0deg) scale(1); }
}
.dice-type-selector {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 6px;
}
.dice-type-btn {
  background: var(--btn-gray);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--btn-gray-text);
  cursor: pointer;
}
.dice-type-btn.active {
  background: var(--text-main);
  color: var(--bg);
  border-color: var(--text-main);
}
.range-inputs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.range-inputs input {
  width: 100%;
  padding: 8px 10px;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text-main);
  outline: none;
}
.range-inputs input:focus {
  border-color: var(--primary);
  background: var(--input-bg-focus);
}
.random-display {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: -1px;
}

/* ----------------------------------------------------
   スマート割り勘 (warikan) スタイル
---------------------------------------------------- */
.round-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 4px;
}
.round-btn {
  background: var(--btn-gray);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--btn-gray-text);
  cursor: pointer;
  text-align: center;
}
.round-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}
.stepper-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}
.step-btn {
  width: 44px;
  height: 44px;
  background: var(--btn-gray);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1.35rem;
  font-weight: bold;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}
.step-btn:active {
  background: var(--btn-clear-bg);
}
.step-count {
  font-size: 1.2rem;
  font-weight: 700;
  min-width: 24px;
  text-align: center;
}
.discount-input-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.discount-input-wrap input {
  width: 76px;
  padding: 6px 8px;
  font-size: 0.95rem;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  background: var(--input-bg);
  color: var(--text-main);
  text-align: right;
  font-weight: 600;
  outline: none;
}
.discount-input-wrap input:focus {
  border-color: var(--primary);
  background: var(--input-bg-focus);
}
.result-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.result-row {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.result-row.drinker {
  border-color: var(--drinker-border);
  background: var(--drinker-bg);
}
.result-row.non-drinker {
  border-color: #a7f3d0;
  background: var(--accent-bg);
}
.result-label {
  display: flex;
  flex-direction: column;
}
.result-label-main {
  font-size: 0.95rem;
  font-weight: 700;
}
.result-label-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.result-amount {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
}
.result-amount span {
  font-size: 0.85rem;
  font-weight: 600;
  margin-left: 2px;
}
.summary-info {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
}
.summary-diff {
  color: #059669;
}
.btn-action.btn-warikan-copy {
  background: #10b981;
}
.btn-action.btn-warikan-copy:active {
  background: #059669;
}

/* ----------------------------------------------------
   固定ページ (privacy, terms, contact) スタイル
---------------------------------------------------- */
.card h1 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 16px;
}
.card h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-top: 24px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
}
.card p, .card ul {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.7;
}
.card ul {
  padding-left: 20px;
}
.card li {
  margin-bottom: 4px;
}
p.intro {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.5;
}
.iframe-container {
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
}
iframe {
  width: 100%;
  height: 750px;
  border: none;
}

/* ----------------------------------------------------
   解説記事・開発者ブログ用スタイル (.article-*)
---------------------------------------------------- */
.article-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px;
  flex: 1;
  width: 100%;
}

.article-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 28px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

@media (max-width: 600px) {
  .article-card {
    padding: 22px 16px;
  }
  .article-title {
    font-size: 1.3rem;
    line-height: 1.45;
  }
}

.article-header {
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 18px;
}

.article-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 12px;
}

.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.category-badge {
  display: inline-block;
  background: #eff6ff;
  color: var(--primary);
  border: 1px solid #bfdbfe;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

.category-badge.dev {
  background: #fdf2f8;
  color: #db2777;
  border-color: #fbcfe8;
}

.category-badge.guide {
  background: #ecfdf5;
  color: #059669;
  border-color: #a7f3d0;
}

.category-badge.column {
  background: #fef3c7;
  color: #b45309;
  border-color: #fde68a;
}

/* --- ブログ＆コラム カテゴリ切り替えタブ --- */
.category-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 auto 26px;
  max-width: 600px;
}

.tab-btn {
  appearance: none;
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.tab-btn:hover {
  color: var(--text-main);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.tab-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.25);
}

.tab-btn.active .tab-count {
  opacity: 0.88;
}

.tab-count {
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0.7;
}

.tab-empty-msg {
  text-align: center;
  padding: 48px 24px;
  background: var(--card-bg);
  border: 1.5px dashed var(--border);
  border-radius: 16px;
  margin: 12px 0;
}

.tab-empty-icon {
  font-size: 2.2rem;
  margin-bottom: 12px;
  display: block;
}

.tab-empty-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}

.tab-empty-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.article-body {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-main);
}

.article-body h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 36px;
  margin-bottom: 14px;
  padding-left: 12px;
  border-left: 4px solid var(--primary);
}

.article-body h3 {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 24px;
  margin-bottom: 10px;
}

.article-body p {
  margin-bottom: 16px;
}

.article-body ul, .article-body ol {
  margin: 14px 0 18px 22px;
  line-height: 1.7;
}

.article-body li {
  margin-bottom: 6px;
}

/* ポイントまとめハイライト枠 */
.highlight-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 18px 20px;
  margin: 26px 0;
}

.highlight-box-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #166534;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.highlight-box p {
  font-size: 0.88rem;
  color: #15803d;
  margin-bottom: 0;
  line-height: 1.6;
}

.highlight-box ul {
  margin: 8px 0 0 20px;
  color: #15803d;
  font-size: 0.88rem;
}

.highlight-box li {
  margin-bottom: 4px;
}

/* アクション誘導ボックス (CTA) */
.action-cta {
  background: var(--gray-bg);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 18px 16px;
  margin: 28px 0 16px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.05);
}

.action-cta h4 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

.action-cta p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  padding: 14px 28px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: all 0.2s ease;
}

.btn-cta:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

/* 記事前後ナビゲーション */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

@media (max-width: 480px) {
  .post-nav {
    grid-template-columns: 1fr;
  }
}

.post-nav-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.2s;
}

.post-nav-item:hover {
  border-color: var(--primary);
  background: var(--gray-bg);
}

.post-nav-item.next {
  text-align: right;
}

.post-nav-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.post-nav-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
}

/* 月別アーカイブ枠 */
.archive-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-top: 24px;
}

.archive-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.archive-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.archive-item a {
  display: inline-block;
  background: var(--btn-gray);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--btn-gray-text);
  text-decoration: none;
  transition: all 0.15s;
}

.archive-item a:hover {
  background: var(--primary);
  color: #ffffff;
}

/* ----------------------------------------------------
   デザイン案確認用スイッチャー (.pattern-switcher)
---------------------------------------------------- */
.pattern-switcher {
  background: #1e293b;
  color: #f8fafc;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 0.8rem;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}
.pattern-switcher-header {
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pattern-switcher-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pattern-switcher-links a {
  display: inline-block;
  background: #334155;
  color: #e2e8f0;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.15s;
}
.pattern-switcher-links a:hover,
.pattern-switcher-links a.active {
  background: var(--primary);
  color: #ffffff;
}

/* ----------------------------------------------------
   目次コンポーネント (TOC)
---------------------------------------------------- */
.toc-box {
  background: var(--gray-bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 24px 0;
}
.toc-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.toc-list li {
  margin-bottom: 6px;
}
.toc-list a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.15s;
}
.toc-list a:hover {
  color: var(--primary);
  text-decoration: underline;
}
.toc-list .toc-sub {
  margin-left: 18px;
  font-size: 0.82rem;
  margin-top: 4px;
}

/* ----------------------------------------------------
   ステップ・フローコンポーネント (.step-*)
---------------------------------------------------- */
.step-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 28px 0;
}
.step-card {
  display: flex;
  gap: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
@media (max-width: 540px) {
  .step-card {
    flex-direction: column;
    gap: 10px;
  }
}
.step-badge {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: #ffffff;
  border-radius: 12px;
  font-size: 1.2rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-content {
  flex: 1;
}
.step-heading {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}
.step-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ----------------------------------------------------
   Before / After 比較カード (.compare-*)
---------------------------------------------------- */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 24px 0;
}
@media (max-width: 560px) {
  .compare-grid {
    grid-template-columns: 1fr;
  }
}
.compare-card {
  border-radius: 10px;
  padding: 16px;
  border: 1px solid var(--border);
  background: var(--card-bg);
}
.compare-card.bad {
  border-color: #fca5a5;
  background: #fff5f5;
}
.compare-card.good {
  border-color: #86efac;
  background: #f0fdf4;
}
.compare-card-title {
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.compare-card.bad .compare-card-title {
  color: #b91c1c;
}
.compare-card.good .compare-card-title {
  color: #15803d;
}
.compare-card p {
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 0;
}

/* ----------------------------------------------------
   テーブル・早見表スタイル (.data-table)
---------------------------------------------------- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 20px 0;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}
.data-table th, .data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.data-table th {
  background: var(--btn-gray);
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}
.data-table tr:last-child td {
  border-bottom: none;
}
.data-table tr:hover td {
  background: var(--gray-bg);
}

/* ----------------------------------------------------
   コードブロック (.code-block)
---------------------------------------------------- */
.code-block {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  margin: 20px 0;
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.code-header {
  background: #1e293b;
  padding: 8px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.code-block pre {
  padding: 14px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0;
}

/* ----------------------------------------------------
   著者情報ボックス (.author-box)
---------------------------------------------------- */
.author-box {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--gray-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin: 28px 0;
}
.author-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}
.author-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
}
.author-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.author-bio {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

/* ----------------------------------------------------
   タイムライン (.timeline)
---------------------------------------------------- */
.timeline {
  position: relative;
  padding-left: 28px;
  margin: 28px 0;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border);
}
.timeline-item {
  position: relative;
  margin-bottom: 22px;
}
.timeline-item:last-child {
  margin-bottom: 0;
}
.timeline-dot {
  position: absolute;
  left: -28px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--card-bg);
  box-shadow: 0 0 0 2px var(--primary);
}
.timeline-date {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 2px;
}
.timeline-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}
.timeline-body {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ----------------------------------------------------
   タグ一覧 (.tag-list)
---------------------------------------------------- */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}
.tag-item {
  background: var(--btn-gray);
  color: var(--btn-gray-text);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  text-decoration: none;
}
.tag-item:hover {
  background: var(--btn-clear-bg);
  color: var(--text-main);
}

/* ----------------------------------------------------
   引用ブロック (blockquote)
---------------------------------------------------- */
blockquote.quote-box {
  background: var(--gray-bg);
  border-left: 4px solid var(--border);
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
  margin: 20px 0;
  font-style: italic;
  color: var(--text-main);
}
blockquote.quote-box p {
  margin-bottom: 4px;
}
.quote-author {
  font-size: 0.8rem;
  font-style: normal;
  font-weight: 700;
  color: var(--text-muted);
  text-align: right;
}

/* ----------------------------------------------------
   FAQ アコーディオン (.faq-list, .faq-item)
---------------------------------------------------- */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 24px 0;
}
.faq-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.faq-item:hover {
  border-color: var(--primary);
}
.faq-item summary {
  padding: 14px 18px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  background: var(--gray-bg);
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary::after {
  content: '▼';
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after {
  transform: rotate(180deg);
}
.faq-answer {
  padding: 16px 18px;
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text-main);
  border-top: 1px solid var(--border);
  background: var(--card-bg);
}
.faq-answer p:last-child {
  margin-bottom: 0;
}

/* ====================================================
   デザインテーマ別スタイル定義 (Theme Variants)
   スマホでの見やすさを最優先にした5種類の見た目・トンマナ
==================================================== */

/* デザイン解説バナー */
.design-info-banner {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.design-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 6px;
}
.design-info-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  background: #1e293b;
  color: #ffffff;
}
.design-info-title {
  font-size: 1.02rem;
  font-weight: 800;
  color: #0f172a;
}
.design-info-desc {
  font-size: 0.82rem;
  color: #475569;
  line-height: 1.5;
  margin-bottom: 8px;
}
.design-info-features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.design-info-feature-item {
  background: #f1f5f9;
  font-size: 0.72rem;
  font-weight: 600;
  color: #334155;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
}

/* ----------------------------------------------------
   【解説案1: Modern Clean】 王道クリーン・信頼のブルー
---------------------------------------------------- */
body[data-theme="modern-clean"] {
  background: var(--bg);
  color: var(--text-main);
}
body[data-theme="modern-clean"] .article-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
body[data-theme="modern-clean"] .article-title {
  color: var(--text-main);
  font-weight: 800;
}
body[data-theme="modern-clean"] .article-body h2 {
  border-left: 4px solid var(--primary);
  padding-left: 12px;
  color: var(--text-main);
}
body[data-theme="modern-clean"] .highlight-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
}
body[data-theme="modern-clean"] .highlight-box-title {
  color: #1e40af;
}
body[data-theme="modern-clean"] .btn-cta {
  background: var(--primary);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

/* modern-clean ダークモード対応 */
html.dark body[data-theme="modern-clean"] .highlight-box {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(59, 130, 246, 0.35);
}
html.dark body[data-theme="modern-clean"] .highlight-box-title {
  color: #93c5fd;
}
@media (prefers-color-scheme: dark) {
  html:not(.light) body[data-theme="modern-clean"] .highlight-box {
    background: rgba(37, 99, 235, 0.12);
    border-color: rgba(59, 130, 246, 0.35);
  }
  html:not(.light) body[data-theme="modern-clean"] .highlight-box-title {
    color: #93c5fd;
  }
}

/* ----------------------------------------------------
   【解説案2: Warm Lifestyle】 温かみ・北欧ナチュラル・アイボリー
---------------------------------------------------- */
body[data-theme="warm-lifestyle"] {
  background: #f7f4ed;
  color: #292524;
}
body[data-theme="warm-lifestyle"] .article-card {
  background: #ffffff;
  border: 1px solid #e7e0d3;
  border-radius: 20px;
  box-shadow: 0 3px 12px rgba(120, 113, 108, 0.07);
}
body[data-theme="warm-lifestyle"] .article-title {
  color: #1c1917;
  font-weight: 800;
}
body[data-theme="warm-lifestyle"] .article-body h2 {
  border-left: none;
  border-bottom: 2px solid #f59e0b;
  padding-left: 0;
  padding-bottom: 6px;
  color: #78350f;
}
body[data-theme="warm-lifestyle"] .category-badge.guide {
  background: #fef3c7;
  color: #b45309;
  border-color: #fde68a;
}
body[data-theme="warm-lifestyle"] .highlight-box {
  background: #fefce8;
  border: 1px solid #fef08a;
  border-radius: 16px;
}
body[data-theme="warm-lifestyle"] .highlight-box-title {
  color: #854d0e;
}
body[data-theme="warm-lifestyle"] .highlight-box p,
body[data-theme="warm-lifestyle"] .highlight-box ul {
  color: #713f12;
}
body[data-theme="warm-lifestyle"] .action-cta {
  background: #fffbeb;
  border: 2px dashed #fde68a;
  border-radius: 18px;
}
body[data-theme="warm-lifestyle"] .btn-cta {
  background: #d97706;
  border-radius: 999px;
  padding: 14px 32px;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
}
body[data-theme="warm-lifestyle"] .btn-cta:hover {
  background: #b45309;
}

/* ----------------------------------------------------
   【解説案3: App & Card Pop】 アプリライク・高コントラスト
---------------------------------------------------- */
body[data-theme="app-pop"] {
  background: #eef2f6;
  color: #111827;
}
body[data-theme="app-pop"] .article-card {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 16px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}
body[data-theme="app-pop"] .article-title {
  color: #0f172a;
  font-weight: 900;
  letter-spacing: -0.5px;
}
body[data-theme="app-pop"] .article-body h2 {
  border-left: none;
  background: #f1f5f9;
  padding: 10px 14px;
  border-radius: 8px;
  color: #0f172a;
  border-left: 6px solid #059669;
}
body[data-theme="app-pop"] .category-badge.guide {
  background: #ecfdf5;
  color: #059669;
  border: 2px solid #a7f3d0;
  font-weight: 800;
}
body[data-theme="app-pop"] .highlight-box {
  background: #ffffff;
  border: 2px solid #10b981;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.1);
}
body[data-theme="app-pop"] .highlight-box-title {
  color: #065f46;
}
body[data-theme="app-pop"] .highlight-box p,
body[data-theme="app-pop"] .highlight-box ul {
  color: #047857;
}
body[data-theme="app-pop"] .action-cta {
  background: #ecfdf5;
  border: 2px solid #6ee7b7;
  border-radius: 16px;
}
body[data-theme="app-pop"] .btn-cta {
  background: #059669;
  font-size: 1.05rem;
  font-weight: 800;
  border-radius: 12px;
  padding: 16px 28px;
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.35);
  border-bottom: 4px solid #047857;
}
body[data-theme="app-pop"] .btn-cta:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
}

/* ----------------------------------------------------
   【解説案4: Flat Minimal】 洗練スイス・フラットミニマル
---------------------------------------------------- */
body[data-theme="flat-minimal"] {
  background: #ffffff;
  color: #18181b;
  line-height: 1.85;
}
body[data-theme="flat-minimal"] .article-container {
  max-width: 680px;
}
body[data-theme="flat-minimal"] .article-card {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 16px 8px;
}
body[data-theme="flat-minimal"] .article-header {
  border-bottom: 2px solid #18181b;
  padding-bottom: 20px;
}
body[data-theme="flat-minimal"] .article-title {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -0.8px;
  color: #18181b;
}
body[data-theme="flat-minimal"] .article-body h2 {
  border-left: none;
  padding-left: 0;
  font-size: 1.35rem;
  font-weight: 800;
  margin-top: 42px;
  border-bottom: 1px solid #e4e4e7;
  padding-bottom: 8px;
  color: #18181b;
}
body[data-theme="flat-minimal"] .category-badge {
  background: #18181b;
  color: #ffffff;
  border: none;
  border-radius: 4px;
}
body[data-theme="flat-minimal"] .highlight-box {
  background: #f4f4f5;
  border: none;
  border-left: 3px solid #18181b;
  border-radius: 0;
  padding: 18px 20px;
}
body[data-theme="flat-minimal"] .highlight-box-title {
  color: #18181b;
}
body[data-theme="flat-minimal"] .highlight-box p,
body[data-theme="flat-minimal"] .highlight-box ul {
  color: #3f3f46;
}
body[data-theme="flat-minimal"] .action-cta {
  background: #fafafa;
  border: 1px solid #18181b;
  border-radius: 4px;
  box-shadow: none;
}
body[data-theme="flat-minimal"] .btn-cta {
  background: #18181b;
  color: #ffffff;
  border-radius: 4px;
  box-shadow: none;
}
body[data-theme="flat-minimal"] .btn-cta:hover {
  background: #27272a;
}

/* ----------------------------------------------------
   【解説案5: Dark Slate】 シック・ダークモード・夜間対応
---------------------------------------------------- */
body[data-theme="dark-slate"] {
  background: #0b0f19;
  color: #cbd5e1;
}
body[data-theme="dark-slate"] .article-card {
  background: #131b2e;
  border: 1px solid #1e293b;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
body[data-theme="dark-slate"] .article-header {
  border-color: #1e293b;
}
body[data-theme="dark-slate"] .article-title {
  color: #f8fafc;
}
body[data-theme="dark-slate"] .article-meta {
  color: #94a3b8;
}
body[data-theme="dark-slate"] .article-body {
  color: #cbd5e1;
}
body[data-theme="dark-slate"] .article-body h2 {
  border-left: 4px solid #38bdf8;
  color: #f1f5f9;
}
body[data-theme="dark-slate"] .article-body h3 {
  color: #e2e8f0;
}
body[data-theme="dark-slate"] .category-badge.guide {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
}
body[data-theme="dark-slate"] .category-badge.dev {
  background: rgba(244, 114, 182, 0.15);
  color: #f472b6;
  border-color: rgba(244, 114, 182, 0.3);
}
body[data-theme="dark-slate"] .highlight-box {
  background: #1e293b;
  border: 1px solid #334155;
}
body[data-theme="dark-slate"] .highlight-box-title {
  color: #38bdf8;
}
body[data-theme="dark-slate"] .highlight-box p,
body[data-theme="dark-slate"] .highlight-box ul {
  color: #94a3b8;
}
body[data-theme="dark-slate"] .action-cta {
  background: #111827;
  border: 1px solid #1e293b;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}
body[data-theme="dark-slate"] .action-cta h4 {
  color: #f8fafc;
}
body[data-theme="dark-slate"] .btn-cta {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}
body[data-theme="dark-slate"] .data-table th {
  background: #1e293b;
  color: #f1f5f9;
  border-color: #334155;
}
body[data-theme="dark-slate"] .data-table td {
  border-color: #1e293b;
  color: #cbd5e1;
}
body[data-theme="dark-slate"] .data-table tr:hover td {
  background: #1a233a;
}
body[data-theme="dark-slate"] .faq-item {
  background: #131b2e;
  border-color: #1e293b;
}
body[data-theme="dark-slate"] .faq-item summary {
  background: #1a233a;
  color: #f1f5f9;
}
body[data-theme="dark-slate"] .faq-answer {
  background: #131b2e;
  color: #cbd5e1;
  border-color: #1e293b;
}
body[data-theme="dark-slate"] .author-box {
  background: #131b2e;
  border-color: #1e293b;
}
body[data-theme="dark-slate"] .author-name {
  color: #f8fafc;
}
body[data-theme="dark-slate"] .author-bio {
  color: #94a3b8;
}

/* ----------------------------------------------------
   開発者ブログ向けテーマスタイル
---------------------------------------------------- */

/* 【ブログ案1: Modern Tech】 GitHub & Zenn風 */
body[data-theme="tech-modern"] {
  background: #f6f8fa;
  color: #1f2328;
}
body[data-theme="tech-modern"] .article-card {
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(31, 35, 40, 0.04);
}
body[data-theme="tech-modern"] .article-title {
  color: #1f2328;
}
body[data-theme="tech-modern"] .article-body h2 {
  border-left: 4px solid #0969da;
  color: #1f2328;
}
body[data-theme="tech-modern"] .category-badge.dev {
  background: #ddf4ff;
  color: #0969da;
  border-color: #54aeff66;
}

/* 【ブログ案2: Editorial Magazine / Note風】 上質マガジン・エッセイ */
body[data-theme="editorial-note"] {
  background: #faf8f5;
  color: #2b2b2b;
  font-family: "Georgia", "游明朝", "Yu Mincho", "Hiragino Mincho ProN", serif;
  line-height: 1.95;
}
body[data-theme="editorial-note"] .article-card {
  background: #ffffff;
  border: 1px solid #ebe5df;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  padding: 36px 30px;
}
body[data-theme="editorial-note"] .article-title {
  font-family: "Georgia", "游明朝", "Yu Mincho", serif;
  font-size: 1.7rem;
  letter-spacing: 0.5px;
  color: #1a1a1a;
}
body[data-theme="editorial-note"] .article-body h2 {
  font-family: "Georgia", "游明朝", "Yu Mincho", serif;
  border-left: none;
  padding-left: 0;
  text-align: center;
  position: relative;
  margin: 40px 0 20px;
  font-weight: 700;
  color: #1a1a1a;
}
body[data-theme="editorial-note"] .article-body h2::after {
  content: '';
  display: block;
  width: 40px;
  height: 2px;
  background: #a87954;
  margin: 8px auto 0;
}
body[data-theme="editorial-note"] blockquote.quote-box {
  background: #f5f2eb;
  border-left: 4px solid #a87954;
  color: #4a453e;
}

/* 【ブログ案3: Notion Document Style】 Notion風ドキュメント */
body[data-theme="notion-style"] {
  background: #ffffff;
  color: #37352f;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif;
}
body[data-theme="notion-style"] .article-container {
  max-width: 700px;
}
body[data-theme="notion-style"] .article-card {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 10px 4px;
}
body[data-theme="notion-style"] .article-header {
  border-bottom: 1px solid #ececed;
}
body[data-theme="notion-style"] .article-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: #37352f;
}
body[data-theme="notion-style"] .article-body h2 {
  border-left: none;
  padding-left: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: #37352f;
}
body[data-theme="notion-style"] .highlight-box {
  background: #f7f6f3;
  border: none;
  border-radius: 6px;
}
body[data-theme="notion-style"] .highlight-box-title {
  color: #37352f;
}
body[data-theme="notion-style"] .highlight-box p,
body[data-theme="notion-style"] .highlight-box ul {
  color: #5f5e5b;
}

/* 【ブログ案4: Cyber Dark】 VS Code風サイバーダーク */
body[data-theme="cyber-dark"] {
  background: #0e1117;
  color: #e6edf3;
}
body[data-theme="cyber-dark"] .article-card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}
body[data-theme="cyber-dark"] .article-title {
  color: #f0f6fc;
}
body[data-theme="cyber-dark"] .article-body h2 {
  border-left: 4px solid #a855f7;
  color: #f0f6fc;
}
body[data-theme="cyber-dark"] .category-badge.dev {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.35);
}
body[data-theme="cyber-dark"] .highlight-box {
  background: #1f242c;
  border: 1px solid #38404a;
}
body[data-theme="cyber-dark"] .highlight-box-title {
  color: #c084fc;
}
body[data-theme="cyber-dark"] .highlight-box p,
body[data-theme="cyber-dark"] .highlight-box ul {
  color: #94a3b8;
}

/* 【ブログ案5: Casual Friendly】 親しみやすい個人開発・ポップ */
body[data-theme="casual-friendly"] {
  background: #fdfbf7;
  color: #334155;
}
body[data-theme="casual-friendly"] .article-card {
  background: #ffffff;
  border: 2px solid #fde68a;
  border-radius: 22px;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.08);
}
body[data-theme="casual-friendly"] .article-title {
  color: #1e293b;
  font-weight: 900;
}
body[data-theme="casual-friendly"] .article-body h2 {
  border-left: none;
  background: #fffbeb;
  padding: 8px 14px;
  border-radius: 999px;
  display: inline-block;
  color: #92400e;
  border: 1px solid #fef08a;
}
body[data-theme="casual-friendly"] .category-badge.dev {
  background: #fef3c7;
  color: #b45309;
  border-color: #fcd34d;
  font-weight: 800;
}
body[data-theme="casual-friendly"] .category-badge.column {
  background: #ecfdf5;
  color: #059669;
  border-color: #a7f3d0;
  font-weight: 800;
}
body[data-theme="casual-friendly"] .tab-btn.active {
  background: #d97706;
  border-color: #d97706;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
}
body[data-theme="casual-friendly"] .highlight-box {
  background: #fffbeb;
  border: 2px dashed #fcd34d;
  border-radius: 16px;
}
body[data-theme="casual-friendly"] .highlight-box-title {
  color: #92400e;
}

/* casual-friendly ダークモード対応 */
html.dark body[data-theme="casual-friendly"] {
  background: var(--bg);
  color: var(--text-main);
}
html.dark body[data-theme="casual-friendly"] .article-card {
  background: var(--card-bg);
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}
html.dark body[data-theme="casual-friendly"] .article-title {
  color: var(--text-main);
}
html.dark body[data-theme="casual-friendly"] .article-body h2 {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}
html.dark body[data-theme="casual-friendly"] .category-badge.dev {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
}
html.dark body[data-theme="casual-friendly"] .category-badge.column {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}
html.dark body[data-theme="casual-friendly"] .tab-btn.active {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #1e293b;
}
html.dark body[data-theme="casual-friendly"] .highlight-box {
  background: rgba(245, 158, 11, 0.08);
  border: 2px dashed rgba(245, 158, 11, 0.35);
}
html.dark body[data-theme="casual-friendly"] .highlight-box-title {
  color: #fbbf24;
}

@media (prefers-color-scheme: dark) {
  html:not(.light) body[data-theme="casual-friendly"] {
    background: var(--bg);
    color: var(--text-main);
  }
  html:not(.light) body[data-theme="casual-friendly"] .article-card {
    background: var(--card-bg);
    border: 1px solid rgba(245, 158, 11, 0.35);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  }
  html:not(.light) body[data-theme="casual-friendly"] .article-title {
    color: var(--text-main);
  }
  html:not(.light) body[data-theme="casual-friendly"] .article-body h2 {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
  }
  html:not(.light) body[data-theme="casual-friendly"] .category-badge.dev {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.4);
  }
  html:not(.light) body[data-theme="casual-friendly"] .category-badge.column {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.4);
  }
  html:not(.light) body[data-theme="casual-friendly"] .tab-btn.active {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #1e293b;
  }
  html:not(.light) body[data-theme="casual-friendly"] .highlight-box {
    background: rgba(245, 158, 11, 0.08);
    border: 2px dashed rgba(245, 158, 11, 0.35);
  }
  html:not(.light) body[data-theme="casual-friendly"] .highlight-box-title {
    color: #fbbf24;
  }
}

/* ----------------------------------------------------
   各ツールページ内の解説ページ誘導カード (.tool-guide-card)
---------------------------------------------------- */
.tool-guide-card {
  margin-top: 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}
.tool-guide-card:hover {
  background: #dcfce7;
  border-color: #86efac;
  transform: translateY(-1px);
}
.tool-guide-card .guide-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}
.tool-guide-card .guide-text {
  flex: 1;
}
.tool-guide-card .guide-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #166534;
  line-height: 1.4;
}
.tool-guide-card .guide-sub {
  font-size: 0.72rem;
  color: #15803d;
  margin-top: 2px;
}
.tool-guide-card .guide-arrow {
  font-size: 0.9rem;
  color: #166534;
  font-weight: bold;
}

/* ----------------------------------------------------
   トップページのブログ・解説記事セクション用スタイル
---------------------------------------------------- */
.blog-banner-card {
  margin-top: 12px;
  background: #fffbeb;
  border: 2px dashed #fcd34d;
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}
.blog-banner-card:hover {
  background: #fef3c7;
  border-color: #f59e0b;
  transform: translateY(-1px);
}
.blog-banner-info h3 {
  font-size: 0.95rem;
  font-weight: 800;
  color: #92400e;
  display: flex;
  align-items: center;
  gap: 6px;
}
.blog-banner-info p {
  font-size: 0.78rem;
  color: #b45309;
  margin-top: 3px;
  line-height: 1.4;
}
.guide-article-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.guide-article-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: all 0.15s ease;
}
.guide-article-item:hover {
  border-color: var(--primary);
  background: var(--gray-bg);
}
.guide-article-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
}
.guide-article-arrow {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: bold;
}

/* ダークモード時のバナー調和スタイル */
html.dark .blog-banner-card {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
}
html.dark .blog-banner-card:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
}
html.dark .blog-banner-info h3 {
  color: #fbbf24;
}
html.dark .blog-banner-info p {
  color: #fcd34d;
}
html.dark .tool-guide-card {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
}
html.dark .tool-guide-card:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
}
html.dark .tool-guide-card .guide-title {
  color: #34d399;
}
html.dark .tool-guide-card .guide-sub {
  color: #a7f3d0;
}
html.dark .tool-guide-card .guide-arrow {
  color: #34d399;
}

@media (prefers-color-scheme: dark) {
  html:not(.light) .blog-banner-card {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
  }
  html:not(.light) .blog-banner-card:hover {
    background: rgba(245, 158, 11, 0.2);
    border-color: #f59e0b;
  }
  html:not(.light) .blog-banner-info h3 {
    color: #fbbf24;
  }
  html:not(.light) .blog-banner-info p {
    color: #fcd34d;
  }
  html:not(.light) .tool-guide-card {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
  }
  html:not(.light) .tool-guide-card:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
  }
  html:not(.light) .tool-guide-card .guide-title {
    color: #34d399;
  }
  html:not(.light) .tool-guide-card .guide-sub {
    color: #a7f3d0;
  }
  html:not(.light) .tool-guide-card .guide-arrow {
    color: #34d399;
  }
}

/* ----------------------------------------------------
   ツール共有（Web Share API & トースト通知）スタイル
---------------------------------------------------- */
.share-wrap {
  margin-top: 14px;
}
.btn-share {
  width: 100%;
  background: var(--card-bg);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
  font-family: inherit;
}
.btn-share:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--btn-hover-bg, rgba(37, 99, 235, 0.04));
  transform: translateY(-1px);
}
.btn-share:active {
  transform: scale(0.98);
}

/* トースト通知 */
.toast-notification {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1e293b;
  color: #f8fafc;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
}
.toast-notification.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* トースト通知のダークモード対応 */
html.dark .toast-notification {
  background: #f8fafc;
  color: #0f172a;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
@media (prefers-color-scheme: dark) {
  html:not(.light) .toast-notification {
    background: #f8fafc;
    color: #0f172a;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  }
}

/* ----------------------------------------------------
   手取り計算＆2社比較ツール (tedori) スタイル
---------------------------------------------------- */
.privacy-note {
  background: var(--accent-bg);
  border: 1px solid var(--win-border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.75rem;
  color: var(--win-text);
  line-height: 1.4;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.input-with-sub {
  position: relative;
  display: flex;
  align-items: center;
}
.input-with-sub input {
  width: 100%;
}
.sub-man {
  position: absolute;
  right: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  pointer-events: none;
}
.option-group {
  margin-top: 10px;
}
.option-group > label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.tag-selector {
  display: flex;
  gap: 6px;
}
.tag-selector .tag-btn {
  flex: 1;
  background: var(--card-bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  text-align: center;
}
.tag-selector .tag-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}
.inner-accordion {
  margin-top: 12px;
  background: var(--gray-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.8rem;
}
.inner-accordion summary {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
}
.inner-content {
  margin-top: 8px;
}
.minashi-result {
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--card-bg);
  border-radius: 6px;
  border-left: 3px solid var(--primary);
  font-size: 0.8rem;
  color: var(--text-main);
}
.minashi-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  background: var(--primary);
  color: #fff;
  padding: 1px 6px;
  border-radius: 4px;
  margin-bottom: 4px;
}
.tedori-preview {
  margin-top: 14px;
  background: var(--accent-bg);
  border: 1px solid var(--win-border);
  border-radius: 8px;
  padding: 10px 14px;
}
.tedori-amount-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tedori-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--win-text);
}
.tedori-val {
  font-size: 1.15rem;
  color: var(--win-text);
}
.tedori-val strong {
  font-size: 1.35rem;
  font-weight: 900;
}
.tedori-sub-row {
  font-size: 0.75rem;
  color: var(--win-text);
  margin-top: 4px;
  opacity: 0.9;
}
.breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 4px;
}
.breakdown-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.breakdown-item.total {
  border-top: 1px dashed var(--border);
  padding-top: 6px;
  font-weight: 800;
  color: var(--text-main);
}
.compare-summary-card {
  border: 2px solid var(--primary);
}
.compare-table-wrap {
  overflow-x: auto;
  margin-top: 10px;
}
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  text-align: right;
}
.compare-table th, .compare-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
}
.compare-table th:first-child, .compare-table td:first-child {
  text-align: left;
}
.compare-table th {
  background: var(--gray-bg);
  color: var(--text-muted);
  font-weight: 700;
}
.compare-table .table-highlight {
  background: var(--accent-bg);
  color: var(--win-text);
  font-weight: 800;
}
.diff-win-a {
  color: #2563eb !important;
}
.diff-win-b {
  color: #16a34a !important;
}
html.dark .diff-win-a {
  color: #60a5fa !important;
}
html.dark .diff-win-b {
  color: #4ade80 !important;
}

/* ====================================================
   PC・大画面向けレスポンシブ最適化 ＆ UX強化
   ==================================================== */

/* --- 1. PC/マウス環境専用ホバーアニメーション --- */
@media (hover: hover) {
  .btn-action:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  }
  .btn-clear:hover {
    background: var(--border);
    color: var(--text-main);
  }
  .btn-roll:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  }
  .btn-share:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
  }
  .tag-btn:not(.active):hover,
  .tax-btn:not(.active):hover,
  .round-btn:not(.active):hover,
  .dice-type-btn:not(.active):hover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
  }
  .step-btn:hover {
    background: var(--border);
    color: var(--text-main);
  }
  details.guide-box summary:hover {
    color: var(--primary);
  }
  .tool-guide-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
  }
  .tool-guide-card:hover .guide-arrow {
    transform: translateX(4px);
  }
  .guide-article-item:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  }
  .guide-article-item:hover .guide-article-arrow {
    transform: translateX(3px);
  }
  .blog-banner-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(217, 119, 6, 0.12);
  }
  .blog-list .article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    border-color: var(--primary);
  }
  .action-cta .btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
  }
  .post-nav-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  }
}

/* --- 2. タイパ向上！キーボード操作フォーカス (:focus-visible) --- */
input:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25) !important;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* --- 3. PC・タブレット大画面向けレイアウト拡張 (min-width: 768px) --- */
@media (min-width: 768px) {
  /* 全体コンテナ */
  .wrapper {
    max-width: 960px;
    padding: 36px 24px;
  }
  
  /* トップページ最適化 */
  .site-header {
    margin-bottom: 32px;
  }
  .site-title {
    font-size: 2rem;
  }
  .site-subtitle {
    font-size: 1rem;
  }
  .tool-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .guide-article-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .blog-banner-card {
    padding: 20px 24px;
  }

  /* --------------------------------------------------
     解説記事・開発者ブログのPC大画面最適化 (.article-container)
     -------------------------------------------------- */
  .article-container {
    max-width: 840px;
    padding: 36px 24px 60px;
  }
  .article-card {
    padding: 44px 40px;
    border-radius: 16px;
  }
  .article-title {
    font-size: 1.85rem;
    line-height: 1.4;
    margin-bottom: 12px;
  }
  .article-body {
    font-size: 1.03rem;
    line-height: 1.85;
  }
  .article-body p {
    margin-bottom: 1.3rem;
  }
  .article-body h2 {
    font-size: 1.4rem;
    margin: 40px 0 18px;
  }

  /* ツール解説記事：3ステップカードの横並び3カラム化！ */
  .step-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }
  .step-card {
    margin-bottom: 0;
    flex-direction: column;
    align-items: flex-start;
    height: 100%;
  }

  /* 開発者ブログポータル（blog/index.html） */
  .blog-list .article-card {
    padding: 28px 32px;
  }

  /* --------------------------------------------------
     各計算ツールの2カラム並列最適化 (:hasセレクタ)
     -------------------------------------------------- */

  /* [A] 単価比較ツール (price-compare): 商品A vs 商品B の完全横並び */
  body:has(#priceA) .container {
    max-width: 880px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 20px;
    row-gap: 16px;
    align-items: start;
  }
  body:has(#priceA) nav#site-nav,
  body:has(#priceA) header,
  body:has(#priceA) .result-box,
  body:has(#priceA) .btn-clear,
  body:has(#priceA) details.guide-box,
  body:has(#priceA) .share-wrap,
  body:has(#priceA) .tool-info-section,
  body:has(#priceA) .tool-guide-card,
  body:has(#priceA) .ad-banner,
  body:has(#priceA) footer {
    grid-column: 1 / -1;
  }
  body:has(#priceA) #cardA {
    grid-column: 1;
    margin: 0;
  }
  body:has(#priceA) #cardB {
    grid-column: 2;
    margin: 0;
  }
  body:has(#priceA) .btn-clear {
    max-width: 360px;
    margin: 8px auto 0;
  }

  /* [B] 手取り計算ツール (tedori): 2社比較時の左右並列＆通常時中央最適化 */
  body:has(#salaryA) .container {
    max-width: 840px;
    transition: max-width 0.25s ease;
  }
  body:has(#salaryA):not(:has(#toggleCompareBtn.active)) .privacy-note,
  body:has(#salaryA):not(:has(#toggleCompareBtn.active)) .result-box,
  body:has(#salaryA):not(:has(#toggleCompareBtn.active)) #cardA,
  body:has(#salaryA):not(:has(#toggleCompareBtn.active)) #toggleCompareBtn,
  body:has(#salaryA):not(:has(#toggleCompareBtn.active)) details.guide-box,
  body:has(#salaryA):not(:has(#toggleCompareBtn.active)) .share-wrap,
  body:has(#salaryA):not(:has(#toggleCompareBtn.active)) .btn-clear {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }
  /* 2社比較トグルON時 */
  body:has(#toggleCompareBtn.active) .container {
    max-width: 960px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 20px;
    row-gap: 16px;
    align-items: start;
  }
  body:has(#toggleCompareBtn.active) nav#site-nav,
  body:has(#toggleCompareBtn.active) header,
  body:has(#toggleCompareBtn.active) .privacy-note,
  body:has(#toggleCompareBtn.active) .result-box,
  body:has(#toggleCompareBtn.active) #toggleCompareBtn,
  body:has(#toggleCompareBtn.active) #compareSummaryCard,
  body:has(#toggleCompareBtn.active) details.guide-box,
  body:has(#toggleCompareBtn.active) .share-wrap,
  body:has(#toggleCompareBtn.active) .tool-info-section,
  body:has(#toggleCompareBtn.active) .tool-guide-card,
  body:has(#toggleCompareBtn.active) .ad-banner,
  body:has(#toggleCompareBtn.active) footer {
    grid-column: 1 / -1;
  }
  body:has(#toggleCompareBtn.active) #cardA {
    grid-column: 1;
    margin: 0;
  }
  body:has(#toggleCompareBtn.active) #cardB {
    grid-column: 2;
    margin: 0;
  }

  /* [C] 文字数＆スピーチ時間 (counter): 入力（左）× 結果（右）のプロ用ワークスペース */
  body:has(#textInput) .container {
    max-width: 920px;
  }
  body:has(#textInput) .counter-workspace {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    column-gap: 20px;
    align-items: start;
    margin-bottom: 20px;
  }
  body:has(#textInput) .counter-result-col .stat-grid {
    margin-top: 0;
  }
  body:has(#textInput) textarea {
    height: 240px;
  }
  body:has(#textInput) .practice-card {
    margin-top: 0;
    padding: 24px 28px;
  }
  body:has(#textInput) .practice-card .timer-box {
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
  }
  body:has(#textInput) .practice-card .diagnosis-box {
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
  }

  /* [D] セール割引計算 (discount): 入力（左）× 支払額・お得額（右） */
  body:has(#basePrice) .container {
    max-width: 840px;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    column-gap: 20px;
    row-gap: 14px;
    align-items: start;
  }
  body:has(#basePrice) nav#site-nav,
  body:has(#basePrice) header,
  body:has(#basePrice) details.guide-box,
  body:has(#basePrice) .share-wrap,
  body:has(#basePrice) .tool-info-section,
  body:has(#basePrice) .tool-guide-card,
  body:has(#basePrice) .ad-banner,
  body:has(#basePrice) footer {
    grid-column: 1 / -1;
  }
  body:has(#basePrice) .card:has(#basePrice) {
    grid-column: 1;
  }
  body:has(#basePrice) .card:has(.tax-selector) {
    grid-column: 1;
  }
  body:has(#basePrice) #resultCard {
    grid-column: 2;
  }
  body:has(#basePrice) .btn-clear {
    grid-column: 2;
  }

  /* [E] 割り勘計算 (warikan): 入力カード群（左）× 集金結果（右） */
  body:has(#totalBill) .container {
    max-width: 880px;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    column-gap: 20px;
    row-gap: 14px;
    align-items: start;
  }
  body:has(#totalBill) nav#site-nav,
  body:has(#totalBill) header,
  body:has(#totalBill) details.guide-box,
  body:has(#totalBill) .share-wrap,
  body:has(#totalBill) .tool-info-section,
  body:has(#totalBill) .tool-guide-card,
  body:has(#totalBill) .ad-banner,
  body:has(#totalBill) footer {
    grid-column: 1 / -1;
  }
  body:has(#totalBill) .card:has(#totalBill) {
    grid-column: 1;
  }
  body:has(#totalBill) .card:has(.round-selector) {
    grid-column: 1;
  }
  body:has(#totalBill) .card:has(#nonDrinkerCountText) {
    grid-column: 1;
  }
  body:has(#totalBill) .result-container {
    grid-column: 2;
  }
  body:has(#totalBill) #copyBtn {
    grid-column: 2;
  }
  body:has(#totalBill) .btn-clear {
    grid-column: 2;
  }

  /* [F] 乱数・ダイス・コイン (random): 黄金比中央配置＆解説セクションワイド最適化 */
  body:has(#coinPanel) .container {
    max-width: 800px;
  }
  body:has(#coinPanel) .tab-group,
  body:has(#coinPanel) .panel,
  body:has(#coinPanel) details.guide-box,
  body:has(#coinPanel) .share-wrap {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }

  /* [G] ポモドーロタイマー (pomodoro): 集中に没頭する中央コンパクト配置＆解説セクションワイド最適化 */
  body:has(#timerContainer) .container,
  body:has(#timerCard) .container {
    max-width: 800px;
  }
  body:has(#timerContainer) .timer-card,
  body:has(#timerContainer) .timer-settings-card,
  body:has(#timerContainer) details.guide-box,
  body:has(#timerContainer) .share-wrap,
  body:has(#timerCard) .timer-card,
  body:has(#timerCard) .timer-settings-card,
  body:has(#timerCard) details.guide-box,
  body:has(#timerCard) .share-wrap {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }

  /* --------------------------------------------------
     ツール本体 情報・解説セクション (.tool-info-section) PC大画面最適化
     -------------------------------------------------- */
  .tool-info-section {
    padding: 32px 36px;
    margin-top: 40px;
    border-radius: 18px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  }
  .tool-info-section h2 {
    font-size: 1.32rem;
    margin-bottom: 14px;
    padding-left: 12px;
    border-left-width: 5px;
  }
  .tool-info-section h3 {
    font-size: 1.08rem;
    margin-top: 28px;
    margin-bottom: 14px;
  }
  .tool-info-desc {
    font-size: 0.94rem;
    line-height: 1.75;
    margin-bottom: 22px;
  }
  .tool-points-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 26px;
  }
  .tool-point-card {
    padding: 16px 16px;
  }
  .tool-point-title {
    font-size: 0.92rem;
    margin-bottom: 6px;
  }
  .tool-point-desc {
    font-size: 0.83rem;
    line-height: 1.6;
  }
  .tool-spec-box {
    padding: 18px 22px;
    font-size: 0.9rem;
    line-height: 1.75;
    margin-bottom: 26px;
  }
  .tool-spec-box ul,
  .tool-spec-box ol {
    margin: 8px 0 0 20px;
  }
  .tool-spec-box li {
    margin-bottom: 6px;
  }
  .faq-list {
    gap: 16px;
    margin-bottom: 22px;
  }
  .faq-item {
    padding-bottom: 16px;
  }
  .faq-q {
    font-size: 0.98rem;
    margin-bottom: 6px;
  }
  .faq-a {
    font-size: 0.9rem;
    line-height: 1.7;
    padding-left: 30px;
  }
  .guide-link-box {
    padding: 16px 20px;
    font-size: 0.92rem;
    margin-top: 20px;
  }
}

/* ==========================================================================
   ポモドーロタイマー（集中＆休憩タイマー）専用スタイル
   ========================================================================== */
.timer-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 20px;
  margin-bottom: 20px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  position: relative;
  transition: border-color 0.3s ease;
}

/* モード切り替えピルタブ */
.timer-mode-tabs {
  display: inline-flex;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 4px;
  margin-bottom: 24px;
  gap: 4px;
}

.timer-mode-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.timer-mode-btn.active {
  background: var(--card-bg);
  color: var(--text-main);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.timer-mode-btn[data-mode="focus"].active {
  color: var(--primary);
}

.timer-mode-btn[data-mode="break"].active {
  color: var(--accent);
}

/* タイマーサークル表示エリア */
.timer-display-wrap {
  position: relative;
  width: 250px;
  height: 250px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timer-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-circle-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 8;
}

.timer-circle-progress {
  fill: none;
  stroke: var(--primary);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 691.15; /* 2 * PI * 110 */
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.5s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.3s ease;
}

/* 休憩モード時のプログレスリング色 */
.timer-card.mode-break .timer-circle-progress {
  stroke: var(--accent);
}

.timer-center-text {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.timer-digits {
  font-size: 3.4rem;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-variant-numeric: tabular-nums;
  color: var(--text-main);
  line-height: 1;
  letter-spacing: -1px;
}

.timer-status-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  margin-top: 8px;
  background: var(--input-bg);
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.timer-card.mode-focus.running .timer-status-badge {
  background: rgba(37, 99, 235, 0.12);
  color: var(--primary);
}

.timer-card.mode-break.running .timer-status-badge {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent);
}

/* コントロールボタン */
.timer-btn-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.btn-timer-main {
  flex: 1;
  max-width: 180px;
  padding: 13px 20px;
  font-size: 1.1rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  background: var(--primary);
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.btn-timer-main:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.timer-card.mode-break .btn-timer-main {
  background: var(--accent);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
}

.timer-card.mode-break .btn-timer-main:hover {
  background: #059669;
}

.btn-timer-main.is-running {
  background: #f59e0b;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.25);
}

.btn-timer-main.is-running:hover {
  background: #d97706;
}

.btn-timer-sub {
  padding: 13px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--input-bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-timer-sub:hover {
  background: var(--border);
  color: var(--text-main);
}

/* 画面消灯防止（Wake Lock）インジケーター案内 */
.wakelock-banner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  margin-top: 4px;
  transition: all 0.3s ease;
}

.wakelock-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  display: inline-block;
  transition: all 0.3s ease;
}

.wakelock-banner.is-active {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--accent);
}

.wakelock-banner.is-active .wakelock-dot {
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

/* 設定・ツールバー（音量ミュート・試聴・完了セッション数） */
.timer-settings-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.timer-setting-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.timer-counter-val {
  font-weight: 700;
  color: var(--text-main);
  background: var(--input-bg);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

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

.btn-audio-toggle,
.btn-audio-test {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-audio-toggle:hover,
.btn-audio-test:hover {
  background: var(--border);
  color: var(--text-main);
}

.btn-audio-toggle.muted {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
}

/* ==========================================================================
   ツール本体 情報・解説セクション (.tool-info-section)
   Thin Content脱却・UX調和型 構造化コンテンツ
   ========================================================================== */
.tool-info-section {
  margin-top: 36px;
  padding: 24px 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text-main);
  text-align: left;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.tool-info-section h2 {
  font-size: 1.18rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 10px;
  border-left: 4px solid var(--primary);
  line-height: 1.4;
}

.tool-info-section h3 {
  font-size: 1.02rem;
  font-weight: 700;
  margin-top: 24px;
  margin-bottom: 12px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.4;
}

.tool-info-desc {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.tool-points-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.tool-point-card {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.tool-point-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

.tool-spec-box {
  background: var(--input-bg);
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 0.86rem;
  line-height: 1.7;
  color: var(--text-main);
  margin-bottom: 22px;
}

.tool-spec-box ul,
.tool-spec-box ol {
  margin: 6px 0 0 18px;
  padding: 0;
}

.tool-spec-box li {
  margin-bottom: 6px;
}

.tool-spec-box li:last-child {
  margin-bottom: 0;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 32px;
}

div.faq-item {
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}

div.faq-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* アコーディオン形式 (details.faq-item) のカードスタイル保護 */
details.faq-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  padding-bottom: 0;
}

details.faq-item:last-child {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.faq-q {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
}

.faq-q-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 2px;
  line-height: 1.3;
}

.faq-a {
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--text-muted);
  padding-left: 28px;
  margin: 0;
}

.guide-link-box {
  background: var(--accent-bg);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-main);
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.guide-link-box .guide-link-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.guide-link-box a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.guide-link-box a:hover {
  color: var(--primary-hover);
}

/* ----------------------------------------------------
   クイック早見表コンポーネント (.quick-table-wrap)
---------------------------------------------------- */
.quick-table-wrap {
  margin: 18px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.quick-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
  min-width: 460px;
}

.quick-table th {
  background: var(--bg);
  color: var(--text-main);
  font-weight: 700;
  padding: 10px 14px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.quick-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  line-height: 1.45;
}

.quick-table tr:last-child td {
  border-bottom: none;
}

.quick-table tr:nth-child(even) td {
  background: rgba(0, 0, 0, 0.015);
}

html.dark .quick-table tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

.quick-table td.highlight {
  font-weight: 800;
  color: var(--primary);
}

.quick-table .badge-table {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  display: inline-block;
  margin-left: 4px;
}

.quick-table-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
}

/* ----------------------------------------------------
   あわせて使える便利ツール (.related-tools-section, .related-tools-box)
---------------------------------------------------- */
.related-tools-section,
.related-tools-box {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px dashed var(--border);
}

.related-tools-box h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}

.related-tools-box > p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.related-tools-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.related-tool-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.related-tool-card:hover {
  border-color: var(--primary);
  background: var(--card-bg);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.related-tool-card-body {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.related-tool-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.related-tool-info {
  min-width: 0;
}

.related-tool-name {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.related-tool-card:hover .related-tool-name {
  color: var(--primary);
}

.related-tool-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.related-tool-arrow {
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: bold;
  margin-left: 8px;
  flex-shrink: 0;
  transition: transform 0.2s ease, color 0.2s ease;
}

.related-tool-card:hover .related-tool-arrow {
  color: var(--primary);
  transform: translateX(3px);
}

/* ========================================================
   [D] 万年カレンダー＆日付・曜日計算機 (calendar)
   ======================================================== */
.cal-workspace {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cal-col-left, .cal-col-right {
  width: 100%;
}
.cal-card {
  padding: 16px;
}
.cal-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cal-nav-btn {
  background: var(--btn-gray);
  color: var(--btn-gray-text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.cal-nav-btn:hover {
  background: var(--input-bg-focus);
  color: var(--primary);
  border-color: var(--primary);
}
.cal-current-wrap {
  text-align: center;
}
.cal-title-main {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--text-main);
  line-height: 1.2;
}
.cal-title-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 700;
  margin-top: 2px;
}
.cal-jump-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.cal-jump-bar select {
  flex: 1;
  padding: 6px 10px;
  font-size: 0.85rem;
  border-radius: 6px;
}
.cal-today-btn {
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.cal-today-btn:hover {
  background: var(--primary-hover);
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-head {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-muted);
  padding: 6px 0;
}
.cal-head.sun { color: #ef4444; }
.cal-head.sat { color: #3b82f6; }
.cal-cell {
  min-height: 52px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  overflow: hidden;
}
.cal-cell:hover {
  background: var(--input-bg-focus);
  border-color: var(--primary);
}
.cal-cell.other-month {
  opacity: 0.35;
  background: transparent;
  cursor: default;
}
.cal-cell-num {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}
.cal-cell.holiday .cal-cell-num {
  color: #ef4444;
}
.cal-cell.saturday .cal-cell-num {
  color: #3b82f6;
}
.cal-cell-hol {
  font-size: 0.62rem;
  color: #ef4444;
  line-height: 1.1;
  text-align: center;
  margin-top: 2px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 1px;
}
.cal-cell.today {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}
.cal-cell.today .cal-cell-num {
  background: var(--primary);
  color: #fff !important;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
}
.cal-cell.selected {
  background: rgba(37, 99, 235, 0.12) !important;
  border-color: var(--primary) !important;
}
.cal-selected-bar {
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.cal-selected-info {
  font-size: 0.85rem;
  color: var(--text-main);
  margin-bottom: 8px;
}
.cal-action-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cal-action-btn {
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--card-bg);
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.cal-action-btn:hover {
  background: var(--primary);
  color: #fff;
}

/* 逆引きカード */
.date-lookup-card, .date-calc-card {
  margin-bottom: 16px;
  padding: 18px 20px;
}
.card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 12px;
}
.lookup-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.lookup-input-row input[type="date"] {
  flex: 1;
  min-width: 140px;
  padding: 8px 10px;
  font-size: 0.95rem;
}
.lookup-shortcuts {
  display: flex;
  gap: 6px;
}
.shortcut-btn {
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--btn-gray);
  color: var(--btn-gray-text);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}
.shortcut-btn:hover {
  background: var(--input-bg-focus);
  color: var(--primary);
}
.lookup-result-box {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}
.lookup-day-badge {
  display: inline-block;
  font-size: 1.5rem;
  font-weight: 900;
  padding: 6px 20px;
  border-radius: 30px;
  margin-bottom: 12px;
}
.lookup-day-badge.weekday { background: rgba(37, 99, 235, 0.12); color: var(--primary); }
.lookup-day-badge.saturday { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.lookup-day-badge.holiday { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

.lookup-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  text-align: left;
}
.lookup-item {
  font-size: 0.88rem;
  color: var(--text-main);
}
.lookup-item.full-width {
  grid-column: 1 / -1;
}
.lookup-label {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-right: 4px;
}
.life-days-box {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}
.life-days-val {
  font-size: 0.92rem;
  color: var(--text-main);
  margin-top: 2px;
}

/* タブ ＆ 日数カウンター */
.tab-pill-wrap {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.tab-pill {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 800;
  background: var(--input-bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}
.tab-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.tab-pane {
  display: none;
}
.tab-pane.active {
  display: block;
}
.span-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.input-block {
  flex: 1;
}
.input-block label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.input-block input[type="date"],
.input-block input[type="number"],
.input-block select {
  width: 100%;
  padding: 8px 10px;
  font-size: 0.9rem;
}
.input-arrow {
  color: var(--text-muted);
  font-weight: bold;
  padding-top: 16px;
}
.span-options-row, .add-options-row, .birth-options-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.82rem;
}
.custom-chk {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: var(--text-main);
  font-weight: 600;
}
.span-result-box, .add-result-box {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}
.span-res-main {
  margin-bottom: 6px;
}
.span-res-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 700;
}
.span-res-val {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1.1;
}
.span-res-val .unit {
  font-size: 0.95rem;
  margin-left: 4px;
}
.span-res-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.add-calc-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.add-res-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 700;
}
.add-res-date {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--text-main);
  margin: 4px 0;
}
.add-res-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ========================================================
   [E] 和暦西暦・満年齢 ＆ 履歴書学歴シミュレーター (wareki)
   ======================================================== */
.wareki-workspace {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.wareki-col-left, .wareki-col-right {
  width: 100%;
}
.birth-card, .resume-card, .converter-card, .milestone-card {
  padding: 18px 20px;
  margin-bottom: 16px;
}
.card-intro {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.4;
}
.birth-input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.chk-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 4px;
}
.birth-status-box {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-top: 12px;
}
.status-badge-main {
  text-align: center;
  margin-bottom: 12px;
}
.badge-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 700;
  margin-right: 6px;
}
.status-badge-main strong {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--primary);
}
.badge-sub {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.status-sub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 0.88rem;
}
.status-item .lbl {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* 履歴書ジェネレーター */
.resume-controls-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.resume-copy-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.btn-copy-all {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-copy-all:hover {
  background: var(--primary-hover);
}
.copy-format-toggle {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.copy-format-toggle label {
  margin-left: 6px;
  color: var(--text-main);
  cursor: pointer;
}
.resume-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.resume-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.resume-table th {
  background: var(--input-bg);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.resume-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
}
.resume-table tbody tr:last-child td {
  border-bottom: none;
}
.resume-table tbody tr:nth-child(even) {
  background: var(--input-bg);
}
.sub-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: normal;
}
.btn-copy-row {
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--btn-gray);
  color: var(--btn-gray-text);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
}
.btn-copy-row:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* 変換電卓 ＆ 節目カード */
.conv-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.conv-item {
  flex: 1;
}
.conv-item label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.conv-eq {
  color: var(--text-muted);
  font-weight: 900;
  font-size: 1.1rem;
  padding-top: 18px;
}
.input-unit-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-unit-wrap input {
  width: 100%;
  padding: 8px 24px 8px 10px;
  font-size: 0.95rem;
}
.input-unit-wrap .unit {
  position: absolute;
  right: 8px;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.wareki-input-combo {
  display: flex;
  gap: 4px;
}
.wareki-input-combo select {
  width: 70px;
  padding: 8px 4px;
  font-size: 0.9rem;
}
.conv-result-banner {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.9rem;
  color: var(--text-main);
  text-align: center;
}
.conv-result-banner strong {
  color: var(--primary);
}

.milestone-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.m-tab {
  flex: 1;
  padding: 6px 8px;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--input-bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}
.m-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.milestone-content {
  font-size: 0.82rem;
  color: var(--text-main);
}
.yaku-block {
  margin-bottom: 10px;
}
.yaku-gender {
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
  font-size: 0.85rem;
}
.yaku-list, .long-list {
  padding-left: 18px;
  margin: 0;
  line-height: 1.5;
  color: var(--text-muted);
}
.yaku-list strong, .long-list strong {
  color: var(--text-main);
}

.age-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--input-bg);
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--primary);
}
.event-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ========================================================
   PCワイド大画面 (min-width: 768px) レスポンシブ最適化
   ======================================================== */
@media (min-width: 768px) {
  body:has(.cal-workspace) .container,
  body:has(.wareki-workspace) .container {
    max-width: 960px;
  }
  .cal-workspace {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    column-gap: 20px;
    align-items: start;
  }
  .wareki-workspace {
    display: grid;
    grid-template-columns: 1.28fr 1fr;
    column-gap: 20px;
    align-items: start;
  }
  .cal-cell {
    min-height: 56px;
  }
}

/* ========================================================
   技術ブログ用 コードブロック & コピーボタン & 注意枠スタイル
   ======================================================== */
.article-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.86em;
  background: var(--input-bg);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--border);
  word-break: break-word;
}

.code-block-wrap {
  margin: 18px 0 24px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #334155;
  background: #0f172a;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.btn-copy-code {
  appearance: none;
  background: #334155;
  color: #f8fafc;
  border: 1px solid #475569;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-copy-code:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.btn-copy-code.copied {
  background: #059669;
  border-color: #059669;
  color: #ffffff;
}

.code-block-wrap pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  font-size: 0.84rem;
  line-height: 1.65;
  color: #f8fafc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.code-block-wrap pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border: none;
  font-size: inherit;
  word-break: normal;
}

.caution-box {
  background: #fff1f2;
  border: 1.5px solid #fda4af;
  border-radius: 12px;
  padding: 18px 20px;
  margin: 26px 0;
}

.caution-box-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #9f1239;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.caution-box ul {
  margin: 8px 0 0 20px;
  color: #881337;
  font-size: 0.88rem;
  line-height: 1.65;
}

.caution-box li {
  margin-bottom: 6px;
}

html.dark .caution-box {
  background: rgba(159, 18, 57, 0.18);
  border-color: rgba(251, 113, 133, 0.4);
}

html.dark .caution-box-title {
  color: #fda4af;
}

html.dark .caution-box ul {
  color: #fecdd3;
}

/* ========================================================
   行ったことある都道府県マップ (travel-map) スタイル
   ======================================================== */
.travel-workspace {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

@media (min-width: 768px) {
  body:has(.travel-workspace) .container {
    max-width: 960px;
  }
  .travel-workspace {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    column-gap: 20px;
    align-items: start;
  }
  .map-section {
    position: sticky;
    top: 20px;
  }
}

.map-section {
  padding: 18px;
  position: relative;
  overflow: hidden;
}

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

.map-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.map-mode-badge {
  font-size: 0.8rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-single {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.badge-compare {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

html.dark .badge-single {
  background: rgba(37, 99, 235, 0.15);
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.3);
}

html.dark .badge-compare {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.3);
}

.map-sub-text {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.btn-clear-map {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-clear-map:hover {
  background: var(--btn-clear-bg);
  color: #ef4444;
  border-color: #fca5a5;
}

/* 凡例 */
.map-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
  flex-shrink: 0;
}

.dot-visited { background: #3b82f6; }
.dot-unvisited { background: #e2e8f0; border: 1px solid #cbd5e1; }
.dot-both { background: #10b981; }
.dot-p1 { background: #3b82f6; }
.dot-p2 { background: #f59e0b; }
.dot-none { background: #f1f5f9; border: 1px solid #cbd5e1; }

html.dark .dot-unvisited { background: #334155; border-color: #475569; }
html.dark .dot-none { background: #1e293b; border-color: #334155; }

/* SVGコンテナ */
.svg-map-container {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.geolonia-svg-map {
  width: 100%;
  height: auto;
  max-height: 520px;
  overflow: visible;
}

/* 都道府県パス 基本スタイル */
.pref-item {
  cursor: pointer;
  outline: none;
}

.pref-item polygon,
.pref-item path {
  fill: #e2e8f0;
  stroke: #94a3b8;
  stroke-width: 1;
  stroke-linejoin: round;
  transition: fill 0.2s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.2s ease, filter 0.15s ease;
}

/* ダークモード時のデフォルト未踏色 */
html.dark .pref-item polygon,
html.dark .pref-item path {
  fill: #27354a;
  stroke: #475569;
}

.pref-item:hover polygon,
.pref-item:hover path {
  filter: brightness(1.1);
  stroke: #1e293b;
  stroke-width: 1.5;
}

html.dark .pref-item:hover polygon,
html.dark .pref-item:hover path {
  filter: brightness(1.2);
  stroke: #94a3b8;
}

.pref-item:focus-visible polygon,
.pref-item:focus-visible path {
  stroke: #2563eb;
  stroke-width: 2.5;
}

/* 単体モード: 訪問済み (通常・ダークモード共通で鮮やかに発色) */
.pref-item.state-visited polygon,
.pref-item.state-visited path,
html.dark .pref-item.state-visited polygon,
html.dark .pref-item.state-visited path {
  fill: #3b82f6 !important;
  stroke: #2563eb !important;
}

/* 突合モード: 4色 (通常・ダークモード共通で鮮やかに発色) */
.pref-item.state-both polygon,
.pref-item.state-both path,
html.dark .pref-item.state-both polygon,
html.dark .pref-item.state-both path {
  fill: #10b981 !important;
  stroke: #059669 !important;
}

.pref-item.state-p1 polygon,
.pref-item.state-p1 path,
html.dark .pref-item.state-p1 polygon,
html.dark .pref-item.state-p1 path {
  fill: #3b82f6 !important;
  stroke: #2563eb !important;
}

.pref-item.state-p2 polygon,
.pref-item.state-p2 path,
html.dark .pref-item.state-p2 polygon,
html.dark .pref-item.state-p2 path {
  fill: #f59e0b !important;
  stroke: #d97706 !important;
}

.pref-item.state-none polygon,
.pref-item.state-none path {
  fill: #f1f5f9;
  stroke: #cbd5e1;
}

html.dark .pref-item.state-none polygon,
html.dark .pref-item.state-none path {
  fill: #182234 !important;
  stroke: #2e3e55 !important;
}

/* 枠線・境界線 (沖縄・小笠原などの区切り) */
.boundary-line line {
  stroke: #cbd5e1 !important;
  stroke-width: 3px !important;
}

html.dark .boundary-line line {
  stroke: #334155 !important;
  stroke-width: 3px !important;
}

/* ツールチップ */
.pref-tooltip {
  position: fixed;
  pointer-events: none;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(4px);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

.pref-tooltip .tt-sub {
  font-size: 0.75rem;
  opacity: 0.85;
  margin-left: 4px;
}

/* 右カラム: パネル群 */
.panel-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 達成度カード */
.stat-card {
  padding: 18px 20px;
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.stat-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
}

.stat-score {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.stat-score strong {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--primary);
}

.progress-bar-wrap {
  width: 100%;
  height: 12px;
  background: var(--input-bg);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.fill-single {
  background: linear-gradient(90deg, #3b82f6, #2563eb);
}

.fill-compare {
  background: linear-gradient(90deg, #10b981, #059669);
}

.stat-percent-text {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: right;
  font-weight: 600;
}

.stat-percent-text .highlight-percent {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--text-main);
}

/* 突合時内訳グリッド */
.compare-breakdown {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}

.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.breakdown-item {
  padding: 8px 10px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
}

.breakdown-num {
  font-size: 1.05rem;
  font-weight: 900;
}

.bg-both { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.bg-p1 { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.bg-p2 { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.bg-none { background: var(--gray-bg); color: var(--text-muted); border: 1px solid var(--border); }

html.dark .bg-both { background: rgba(16, 185, 129, 0.15); color: #34d399; border-color: rgba(52, 211, 153, 0.3); }
html.dark .bg-p1 { background: rgba(37, 99, 235, 0.15); color: #60a5fa; border-color: rgba(96, 165, 250, 0.3); }
html.dark .bg-p2 { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border-color: rgba(251, 191, 36, 0.3); }

.btn-back-single {
  width: 100%;
  padding: 8px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-back-single:hover {
  background: var(--btn-clear-bg);
  border-color: var(--primary);
  color: var(--primary);
}

/* 共有＆突合カード */
.share-compare-card {
  padding: 18px 20px;
}

.card-title-main {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.card-caption {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.4;
}

.share-btn-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.btn-copy-url {
  background: var(--primary);
  color: #ffffff;
}

.btn-copy-url.btn-copied {
  background: #059669;
}

.btn-line-share {
  background: #06c755;
  color: #ffffff;
}

.btn-line-share:hover {
  background: #05b04c;
}

.compare-form-box {
  background: var(--gray-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}

.compare-form-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.compare-input-group {
  display: flex;
  gap: 6px;
}

.compare-input-group input {
  flex: 1;
  padding: 8px 10px;
  font-size: 0.85rem;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  background: var(--input-bg);
  color: var(--text-main);
  outline: none;
}

.compare-input-group input:focus {
  border-color: var(--primary);
}

.btn-compare-action {
  padding: 8px 14px;
  background: #10b981;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.btn-compare-action:hover {
  background: #059669;
}

.compare-error-msg {
  font-size: 0.76rem;
  color: #dc2626;
  margin-top: 6px;
  font-weight: 600;
}

/* 画像保存カード */
.save-card {
  padding: 14px 18px;
}

.save-card-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.save-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-main);
}

.save-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-download-png {
  background: var(--btn-gray);
  border: 1px solid var(--border);
  color: var(--btn-gray-text);
  font-size: 0.8rem;
  padding: 8px 14px;
  white-space: nowrap;
}

.btn-download-png:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* サジェストカード */
.suggest-card {
  padding: 18px 20px;
}

.suggest-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.suggest-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.4;
}

.suggest-region-group {
  margin-bottom: 10px;
}

.suggest-region-group:last-child {
  margin-bottom: 0;
}

.suggest-region-name {
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.suggest-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.suggest-tag {
  background: var(--input-bg);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.suggest-tag:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.empty-unvisited-msg {
  font-size: 0.85rem;
  font-weight: 700;
  color: #059669;
}

/* 地域別クイック選択パネル */
.pref-select-section {
  padding: 22px 20px;
  margin-bottom: 24px;
}

.pref-select-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.pref-select-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.region-blocks-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.region-block {
  background: var(--gray-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}

.region-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.pref-btn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 6px;
}

.pref-pill-btn {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 7px 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
  user-select: none;
}

.pref-pill-btn:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* 単体モード選択中 */
.pref-pill-btn.active {
  background: #3b82f6;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

/* 突合モード時の各色 */
.pref-pill-btn.pill-both {
  background: #10b981;
  border-color: #059669;
  color: #ffffff;
}

.pref-pill-btn.pill-p1 {
  background: #3b82f6;
  border-color: #2563eb;
  color: #ffffff;
}

.pref-pill-btn.pill-p2 {
  background: #f59e0b;
  border-color: #d97706;
  color: #ffffff;
}

.pref-pill-btn.pill-none {
  background: var(--input-bg);
  border-color: var(--border);
  color: var(--text-muted);
  opacity: 0.75;
}
/* 招待ウェルカムバナー */
.invite-banner {
  background: var(--accent-bg);
  border: 1.5px solid var(--accent);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.12);
  animation: fadeIn 0.3s ease;
}

.invite-banner-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.invite-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.invite-text {
  min-width: 0;
}

.invite-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 3px;
}

.invite-desc {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.input-highlight {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
  background: var(--card-bg) !important;
}

html.dark .invite-banner {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.4);
}
