/* ==========================================================================
   モヤモヤ仕分け機 スタイルシート v2 (KatakataLab)
   ========================================================================== */

:root {
  --c-bg: #f8fafc;
  --c-surface: #ffffff;
  --c-surface-hover: #f1f5f9;
  --c-text: #0f172a;
  --c-text-muted: #475569;
  --c-text-light: #64748b;
  --c-border: #cbd5e1;

  /* ブランド・アクセントカラー */
  --c-primary: #4338ca;
  --c-primary-light: #e0e7ff;
  --c-primary-hover: #3730a3;
  --c-green: #059669;
  --c-green-light: #d1fae5;
  --c-green-text: #064e3b;
  --c-gray-badge: #e2e8f0;
  --c-gray-text: #334155;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

/* ダークモード */
body.dark-mode {
  --c-bg: #0b0f19;
  --c-surface: #1e293b;
  --c-surface-hover: #334155;
  --c-text: #f8fafc;
  --c-text-muted: #cbd5e1;
  --c-text-light: #94a3b8;
  --c-border: #475569;
  --c-primary-light: #2e1065;
  --c-green-light: #064e3b;
  --c-green-text: #a7f3d0;
  --c-gray-badge: #334155;
  --c-gray-text: #f1f5f9;
}

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

body {
  font-family: "Outfit", "M PLUS Rounded 1c", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  background-color: var(--c-bg);
  color: var(--c-text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  padding-top: max(0.5rem, env(safe-area-inset-top, 0px));
  padding-right: max(1rem, env(safe-area-inset-right, 0px));
  padding-bottom: calc(3.5rem + env(safe-area-inset-bottom, 0px));
  padding-left: max(1rem, env(safe-area-inset-left, 0px));
  position: relative;
}

:focus-visible {
  outline: 3px solid var(--c-primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(67, 56, 202, 0.2);
}

/* スクリーンリーダー専用ユーティリティ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* 紙吹雪Canvas */
.confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
  will-change: transform;
}

.tool-wrapper {
  max-width: 860px;
  margin: 0 auto;
}

/* パンくずリスト */
.breadcrumbs-tool {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 0.5rem;
}
.breadcrumbs-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.breadcrumbs-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.bc-home {
  color: #ff7675;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.bc-sep { opacity: 0.4; }
.bc-current { font-weight: 700; color: var(--c-text); }
.bc-all-tools, .bc-other-tool {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--c-text-muted);
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  background: var(--c-surface-hover);
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.bc-other-tool {
  color: #d97706;
  background: #fef3c7;
}
body.dark-mode .bc-other-tool {
  background: #451a03;
  color: #fcd34d;
}
.bc-all-tools:hover, .bc-other-tool:hover {
  filter: brightness(0.95);
}

/* ヒーローヘッダー */
.hero-header {
  text-align: center;
  padding: 1.5rem 1rem 2rem;
}
.hero-badge {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  background: var(--c-primary-light);
  color: var(--c-primary);
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 20px;
  margin-bottom: 0.75rem;
}
body.dark-mode .hero-badge {
  color: #c7d2fe;
}
.hero-title {
  font-size: clamp(1.6rem, 4.5vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  color: var(--c-text);
}
.hero-subtitle {
  font-size: 1rem;
  color: var(--c-text-muted);
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.7;
}

/* 共通カード */
.card-container, .result-box, .action-proposal-box, .cheer-box, .history-box, .article-guide, .cross-promo-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  contain: layout style;
}

.card-header, .result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.result-header-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.sub-link-btn {
  background: transparent;
  border: none;
  color: var(--c-primary);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  text-decoration: underline;
  min-height: 44px;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
}

.step-num {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--c-primary);
  color: #fff;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  letter-spacing: 0.05em;
}
.card-title, .result-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--c-text);
}

/* プリセットチップ */
.preset-section {
  margin-bottom: 1.25rem;
}
.preset-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-text-muted);
  margin-bottom: 0.5rem;
}
.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.chip-btn {
  background: var(--c-surface-hover);
  border: 1px solid var(--c-border);
  color: var(--c-text);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 0.95rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  line-height: 1.4;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
@media (hover: hover) {
  .chip-btn:hover {
    background: var(--c-primary-light);
    border-color: var(--c-primary);
    color: var(--c-primary);
    transform: translateY(-1px);
  }
}
.chip-btn.active {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #ffffff;
}

/* 入力エリア */
.input-group {
  margin-bottom: 1.5rem;
}
.input-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}
.input-label {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--c-text);
}
.char-count {
  font-size: 0.78rem;
  color: var(--c-text-light);
  transition: color 0.2s;
}
.char-count-warn { color: #d97706 !important; font-weight: 700; }
.char-count-max { color: #dc2626 !important; font-weight: 800; }
.input-key-hint {
  font-size: 0.78rem;
  color: var(--c-text-light);
  margin-top: 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.input-key-hint kbd {
  background: var(--c-surface-hover);
  border: 1px solid var(--c-border);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-size: 0.72rem;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
  color: var(--c-text);
}
.textarea-input {
  width: 100%;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--c-text);
  background: var(--c-surface);
  resize: vertical;
  min-height: 90px;
  line-height: 1.6;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  word-break: break-word;
}
.textarea-input:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.2);
}

/* ボタン群 */
.action-btn-row {
  text-align: center;
}
.primary-btn {
  background: var(--c-primary);
  color: #ffffff;
  border: none;
  font-size: 1.05rem;
  font-weight: 750;
  padding: 0.9rem 2rem;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 52px;
}
@media (hover: hover) {
  .primary-btn:hover {
    background: var(--c-primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
  }
}
.primary-btn:active {
  transform: translateY(0);
}

/* パーソナライズノート */
.personalized-note {
  background: rgba(67, 56, 202, 0.05);
  border-left: 4px solid var(--c-primary);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 1.25rem;
}

/* 結果グリッド */
.hidden {
  display: none !important;
}

.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 680px) {
  .split-grid {
    grid-template-columns: 1fr;
  }
}

.split-card {
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 2px solid;
  display: flex;
  flex-direction: column;
}
.controllable-card {
  background: rgba(5, 150, 105, 0.05);
  border-color: #059669;
}
.uncontrollable-card {
  background: rgba(71, 85, 105, 0.05);
  border-color: #64748b;
}

.split-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}
.split-icon {
  font-size: 1.6rem;
  line-height: 1;
}
.split-title {
  font-size: 1.05rem;
  font-weight: 750;
  color: var(--c-text);
  margin-bottom: 0.2rem;
}
.split-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
}
.tag-green {
  background: var(--c-green-light);
  color: var(--c-green-text);
}
.tag-gray {
  background: var(--c-gray-badge);
  color: var(--c-gray-text);
}

.split-list {
  list-style: none;
  margin-bottom: 1rem;
  flex-grow: 1;
}
.split-list li {
  font-size: 0.92rem;
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--c-border);
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  word-break: break-word;
}
.split-list li:last-child {
  border-bottom: none;
}
.split-desc {
  font-size: 0.82rem;
  color: var(--c-text-muted);
  line-height: 1.5;
  background: var(--c-surface);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--c-border);
}

/* 2分アクション提案 */
.action-proposal-box {
  border: 2px solid var(--c-primary);
  background: linear-gradient(180deg, var(--c-surface) 0%, rgba(67, 56, 202, 0.04) 100%);
}
.proposal-badge {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--c-primary);
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}
body.dark-mode .proposal-badge { color: #818cf8; }
.proposal-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}
.action-science-tip {
  font-size: 0.85rem;
  background: var(--c-primary-light);
  color: var(--c-primary);
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}
body.dark-mode .action-science-tip {
  background: #312e81;
  color: #e0e7ff;
}

.selected-action-card {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.selected-action-card.fade-switch {
  opacity: 0.2;
  transform: translateY(4px);
}
@media (max-width: 500px) {
  .selected-action-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}
.action-main-icon {
  font-size: 2.75rem;
  background: var(--c-primary-light);
  width: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}
.action-step-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--c-primary);
  margin-bottom: 0.25rem;
}
body.dark-mode .action-step-label { color: #a5b4fc; }
.action-step-text {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--c-text);
  line-height: 1.4;
  margin-bottom: 0.35rem;
}
.action-reason {
  font-size: 0.88rem;
  color: var(--c-text-muted);
}

.action-shuffle-row {
  text-align: right;
  margin-bottom: 1rem;
}
.secondary-btn {
  background: var(--c-surface-hover);
  border: 1px solid var(--c-border);
  color: var(--c-text);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 40px;
}
@media (hover: hover) {
  .secondary-btn:hover { background: var(--c-border); }
}

/* デュアルアクション選択肢 */
.action-choice-group {
  margin: 1.25rem 0;
  padding: 1.25rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.action-choice-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 0.85rem;
}
.action-choice-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}
.act-now-btn {
  background: var(--c-green);
  color: #ffffff;
  border: none;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 800;
  padding: 0.75rem 1.35rem;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
  transition: all 0.2s ease;
  flex: 1 1 240px;
  max-width: 320px;
}
.act-now-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.act-now-btn:active {
  transform: translateY(0);
}
.timer-toggle-action-btn {
  background: var(--c-primary-light);
  color: var(--c-primary);
  border: 1.5px solid var(--c-primary);
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 0.75rem 1.25rem;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1 1 220px;
  max-width: 320px;
}
body.dark-mode .timer-toggle-action-btn {
  background: rgba(99, 102, 241, 0.15);
  color: #c7d2fe;
  border-color: #6366f1;
}
.timer-toggle-action-btn:hover {
  background: var(--c-border);
}

/* 今すぐ行動完了バナー */
.act-now-banner {
  background: #f0fdf4;
  border: 2px solid #86efac;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin: 1rem 0;
  text-align: left;
  animation: fadeIn 0.3s ease;
}
body.dark-mode .act-now-banner {
  background: rgba(6, 78, 59, 0.25);
  border-color: #059669;
}
.act-now-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.act-now-badge {
  font-size: 0.8rem;
  font-weight: 800;
  color: #059669;
  background: #dcfce7;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}
body.dark-mode .act-now-badge {
  background: #064e3b;
  color: #6ee7b7;
}
.act-now-dismiss-btn {
  background: none;
  border: none;
  color: var(--c-text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  min-height: 44px;
  min-width: 44px;
}
.act-now-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--c-text);
  margin-bottom: 0.5rem;
}
.act-now-text {
  font-size: 0.92rem;
  color: var(--c-text);
  line-height: 1.6;
  margin-bottom: 0.85rem;
}
.primary-btn-mini {
  background: var(--c-green);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.5rem 1.2rem;
  cursor: pointer;
  min-height: 44px;
  transition: all 0.2s;
}
.primary-btn-mini:hover {
  filter: brightness(1.08);
}

/* タイマーコンポーネント */
.timer-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 1.5rem 1rem;
  text-align: center;
}
.timer-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 280px;
  margin: 0 auto 0.75rem;
}
.timer-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--c-text-muted);
}
.sound-toggle-btn {
  background: var(--c-surface-hover);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.4rem 0.85rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--c-text);
  cursor: pointer;
  transition: all 0.2s;
}
.sound-toggle-btn:hover {
  background: var(--c-border);
}
.sound-toggle-btn.muted {
  opacity: 0.85;
  border-style: dashed;
}

.timer-display-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 1rem;
}
.timer-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.timer-circle-bg {
  fill: none;
  stroke: var(--c-surface-hover);
  stroke-width: 8;
}
.timer-circle-progress {
  fill: none;
  stroke: var(--c-primary);
  stroke-width: 8;
  stroke-dasharray: 339.292;
  stroke-dashoffset: 0;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear, stroke 0.3s;
}
.timer-circle-progress.paused {
  animation: pulseOpacity 2s infinite ease-in-out;
}
@keyframes pulseOpacity {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.timer-digits {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.75rem;
  font-weight: 800;
  font-family: monospace;
  font-variant-numeric: tabular-nums;
  color: var(--c-text);
  line-height: 1;
}

.timer-controls {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.timer-btn-primary {
  background: var(--c-green);
  color: #ffffff;
  border: none;
  padding: 0.65rem 1.5rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 750;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
}
.timer-btn-primary:hover {
  filter: brightness(1.08);
}
.timer-btn-sub {
  background: var(--c-surface-hover);
  border: 1px solid var(--c-border);
  color: var(--c-text-muted);
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
}
.timer-encouragement {
  font-size: 0.85rem;
  color: var(--c-text-muted);
  min-height: 24px;
}

/* 応援・肯定カード */
.cheer-box {
  text-align: center;
  background: linear-gradient(180deg, var(--c-surface) 0%, rgba(5, 150, 105, 0.05) 100%);
  border-color: rgba(5, 150, 105, 0.3);
}
.cheer-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}
.cheer-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--c-text);
  margin-bottom: 0.5rem;
}
.cheer-text {
  font-size: 0.95rem;
  color: var(--c-text-muted);
  max-width: 540px;
  margin: 0 auto 1.5rem;
  line-height: 1.7;
}

.share-row {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.share-btn {
  padding: 0.7rem 1.35rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: none;
  min-height: 44px;
}
.copy-btn {
  background: var(--c-surface-hover);
  border: 1px solid var(--c-border);
  color: var(--c-text);
}
.copy-btn:hover { background: var(--c-border); }
.x-btn {
  background: #000000;
  color: #ffffff;
}
.x-btn:hover { background: #262626; }
.text-btn {
  background: transparent;
  color: var(--c-primary);
  text-decoration: underline;
}

/* クロスプロモカード */
.cross-promo-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: #fffbeb;
  border: 1.5px solid #fde68a;
}
body.dark-mode .cross-promo-card {
  background: #292524;
  border-color: #78350f;
}
.cross-promo-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
}
.cross-promo-content h4 {
  font-size: 1rem;
  font-weight: 750;
  color: #92400e;
  margin-bottom: 0.25rem;
}
body.dark-mode .cross-promo-content h4 { color: #fde68a; }
.cross-promo-content p {
  font-size: 0.85rem;
  color: var(--c-text-muted);
  line-height: 1.5;
  margin-bottom: 0.6rem;
}
.cross-promo-btn {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #b45309;
  text-decoration: underline;
}

/* 履歴カード */
.history-box {
  border: 1px dashed var(--c-border);
}
.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.history-title {
  font-size: 0.95rem;
  font-weight: 750;
  color: var(--c-text);
}
.clear-history-btn {
  font-size: 0.78rem;
  color: var(--c-text-light);
  background: transparent;
  border: none;
  text-decoration: underline;
  cursor: pointer;
}
.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.history-item {
  font-size: 0.85rem;
  background: var(--c-surface-hover);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.history-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  overflow: hidden;
}
.history-text {
  color: var(--c-text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-action-taken {
  font-size: 0.75rem;
  color: var(--c-primary);
}
body.dark-mode .history-action-taken { color: #a5b4fc; }
.history-del-btn {
  background: transparent;
  border: none;
  color: var(--c-text-light);
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background-color 0.2s;
}
.history-del-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* 読み物・ガイド */
.article-guide {
  margin-top: 2rem;
}
.guide-heading {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  color: var(--c-text);
}
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
}
.guide-item h3 {
  font-size: 0.98rem;
  font-weight: 750;
  margin-bottom: 0.4rem;
  color: var(--c-text);
}
.guide-item p {
  font-size: 0.85rem;
  color: var(--c-text-muted);
  line-height: 1.6;
}

/* 極小画面（320px〜380px）最適化 */
@media (max-width: 380px) {
  body {
    padding-left: max(0.5rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.5rem, env(safe-area-inset-right, 0px));
  }
  .card-container, .result-box, .action-proposal-box, .cheer-box, .history-box, .article-guide, .cross-promo-card {
    padding: 1.15rem 0.85rem;
  }
  .breadcrumbs-tool {
    font-size: 0.8rem;
    padding: 0.5rem 0.65rem;
  }
  .breadcrumbs-right {
    width: 100%;
    justify-content: flex-start;
  }
  .primary-btn {
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    justify-content: center;
  }
  .share-btn {
    width: 100%;
    justify-content: center;
  }
  .chip-btn {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
  }
  .act-now-btn, .timer-toggle-action-btn {
    width: 100%;
    max-width: 100%;
    font-size: 0.88rem;
    justify-content: center;
  }
  .timer-header-row {
    max-width: 100%;
  }
}

/* 動きの軽減（アクセシビリティ対応） */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 印刷用スタイル */
@media print {
  body { background: #fff; color: #000; padding: 0; }
  .breadcrumbs-tool, .action-btn-row, .action-shuffle-row, .timer-controls, .share-row, .cross-promo-card, .history-box, .tool-footer, .preset-section, .confetti-canvas {
    display: none !important;
  }
  .card-container, .result-box, .action-proposal-box {
    border: 1px solid #ccc;
    box-shadow: none;
    page-break-inside: avoid;
  }
}

/* ハイコントラストモード対応（Windows / 支援技術） */
@media (forced-colors: active) {
  :focus-visible {
    outline: 3px solid Highlight !important;
    outline-offset: 3px !important;
  }
  .primary-btn, .timer-btn-primary, .chip-btn.active {
    forced-color-adjust: none;
    background-color: Highlight !important;
    color: HighlightText !important;
    border: 2px solid HighlightText !important;
  }
  .chip-btn, .secondary-btn, .sound-toggle-btn, .sub-link-btn, .history-del-btn, .share-btn {
    border: 1.5px solid ButtonBorder !important;
  }
  .card-container, .result-box, .action-proposal-box, .cheer-box, .history-box, .article-guide, .cross-promo-card, .breadcrumbs-tool {
    border: 2px solid CanvasText !important;
  }
  .split-card {
    border: 2px solid CanvasText !important;
  }
  .textarea-input {
    border: 1.5px solid CanvasText !important;
  }
  .timer-circle-bg {
    stroke: ButtonBorder !important;
  }
  .timer-circle-progress {
    stroke: Highlight !important;
  }
}
