/* ================================================================
   Conductor Dashboard — Neo Futura tokens
   純白 (#FFFFFF) を基盤に、電光青 (#1E5BE6) で骨格を引く。
   シアン (#22D3EE) は「今ここ・再生中・進捗」だけの差し色。
   詳細は /design-system/project/colors_and_type.css と CLAUDE.md。
   ================================================================ */
:root {
  /* Neo Futura core */
  --nf-snow:        #ffffff;
  --nf-tint:        #f5f8fc;
  --nf-frost:       #dff0ff;
  --nf-ice:         #8ad9ff;
  --nf-signal:      #22d3ee;
  --nf-iris:        #1e5be6;
  --nf-deep:        #0b2b6b;
  --nf-void:        #030712;
  --nf-line:        #e4ecf5;
  --nf-line-strong: #c9d6e6;
  --nf-fg2:         #4a5568;
  --nf-fg3:         #8a94a6;

  /* Legacy aliases — Neo Futura に寄せる */
  --bg:             var(--nf-tint);
  --card-bg:        var(--nf-snow);
  --text:           var(--nf-void);
  --text-secondary: var(--nf-fg2);
  --border:         var(--nf-line);
  --accent:         var(--nf-iris);
  --accent-light:   var(--nf-frost);
  --accent-deep:    var(--nf-deep);
  --accent-signal:  var(--nf-signal);

  --heart:          #ef4444;
  --heart-bg:       #fef2f2;
  --teach:          var(--nf-iris);     /* 紫 #8b5cf6 を廃止、iris に統合 */
  --teach-bg:       var(--nf-frost);

  --score-high:     #dc2626;
  --score-mid:      #d97706;
  --score-low:      var(--nf-fg3);

  --category-medical:  #059669;
  --category-system:   #0891b2;
  --category-ai:       var(--nf-iris);  /* 旧 #7c3aed 廃止 */
  --category-social:   #d97706;
  --category-thinking: var(--nf-deep);
  --category-life:     #ec4899;

  --gain-bg:        #ecfdf5;
  --gain-border:    #6ee7b7;
  --connection-bg:  #fffbeb;
  --connection-border: #fcd34d;

  /* signature — 1本の補助線。ヘッダ上端・カード上端で使う */
  --sig-line: linear-gradient(90deg, var(--nf-iris) 0%, var(--nf-signal) 60%, transparent 100%);

  --shadow-sm:    0 2px 8px rgba(11, 43, 107, 0.06);
  --shadow-iris:  0 6px 24px rgba(30, 91, 230, 0.18);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Zen Kaku Gothic New', 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  max-width: 800px;
  margin: 0 auto;
  padding: 16px;
  -webkit-font-smoothing: antialiased;
}

/* Header — Neo Futura: 細い電光青の補助線を上端に引く */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  position: relative;
}

.header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 60%;
  bottom: -1px;
  height: 2px;
  background: var(--sig-line);
}

.header h1 {
  font-size: 1.3rem;
  font-weight: 700;
}

.header-date {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-date input[type="date"] {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.9rem;
}

.header-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Today's Question */
.todays-question {
  background: var(--nf-tint);
  border: 1px solid var(--nf-frost);
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  border-radius: 0 10px 10px 0;
  margin-bottom: 20px;
  font-style: italic;
  color: var(--text);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.tab {
  padding: 8px 16px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

/* アクティブタブは「今ここ」 — シアンの細線で印 */
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent-signal);
  font-weight: 700;
}

.tab:hover { color: var(--text); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Topic Card — 純白 + 1px hairline + 微小シャドウ */
.topic-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.topic-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--nf-line-strong);
}

.topic-card.skip-recommended {
  opacity: 0.6;
  border-left: 4px solid #b8b3a8;
}

.topic-card.skip-recommended:hover {
  opacity: 0.85;
}

.skip-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: #efeae0;
  color: #6b6256;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: help;
}

.topic-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  gap: 10px;
}

.score-badge {
  min-width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
}

.score-high { background: var(--score-high); }
.score-mid { background: var(--score-mid); }
.score-low { background: var(--score-low); }

.topic-title-area {
  flex: 1;
  min-width: 0;        /* allow flex child to shrink below content width */
  overflow: hidden;     /* prevent tags from expanding the card */
}

.topic-title {
  font-size: 0.95rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  /* long titles get ... on very narrow screens instead of pushing buttons away */
}

.topic-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;      /* tags wrap to next line instead of overflowing */
  gap: 4px 8px;
  margin-top: 2px;
  max-height: 2.8em;    /* ~2 lines of tags visible */
  overflow: hidden;     /* extra tags hidden gracefully */
}

.category-badge {
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 4px;
  color: white;
  font-weight: 500;
}

.cat-medical { background: var(--category-medical); }
.cat-system { background: var(--category-system); }
.cat-ai { background: var(--category-ai); }
.cat-social { background: var(--category-social); }
.cat-thinking { background: var(--category-thinking); }
.cat-life { background: var(--category-life); }

.topic-actions {
  display: flex;
  flex-shrink: 0;       /* NEVER shrink — buttons always visible on iPhone */
  gap: 6px;
}

.action-btn {
  width: 36px;
  height: 36px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.action-btn:hover { transform: scale(1.1); }

.action-btn.liked {
  background: var(--heart-bg);
  border-color: var(--heart);
  color: var(--heart);
}

.action-btn.taught {
  background: var(--teach-bg);
  border-color: var(--teach);
  color: var(--teach);
}

.action-btn.submitted {
  position: relative;
}

.action-btn.submitted::after {
  content: '•';
  position: absolute;
  top: -2px;
  right: -2px;
  color: var(--accent);
  font-size: 1.2rem;
  line-height: 1;
}

.action-btn.dd-queued {
  position: relative;
}

.action-btn.dd-queued::after {
  content: '🔬';
  position: absolute;
  top: -6px;
  right: -6px;
  font-size: 0.55rem;
  line-height: 1;
  background: white;
  border-radius: 50%;
  padding: 1px 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

/* Expanded Content */
.topic-body {
  display: none;
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}

.topic-card.expanded .topic-body { display: block; }

.topic-summary {
  margin: 12px 0;
  font-size: 0.9rem;
  line-height: 1.7;
}

.conductor-take {
  background: var(--nf-tint);
  border-left: 3px solid var(--accent);
  padding: 10px 14px;
  margin: 10px 0;
  font-size: 0.88rem;
  border-radius: 0 6px 6px 0;
}

.gain-box {
  background: var(--gain-bg);
  border: 1px solid var(--gain-border);
  padding: 10px 14px;
  margin: 10px 0;
  border-radius: 6px;
  font-size: 0.88rem;
}

.sources {
  margin: 10px 0;
  font-size: 0.85rem;
}

.source-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  text-decoration: none;
  margin-right: 12px;
}

.source-link:hover { text-decoration: underline; }

.source-label {
  font-size: 0.7rem;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 500;
}

/* Unlockable sections (shown after ❤️ or 🎓) */
.unlock-section {
  display: none;
  margin: 10px 0;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
}

.unlock-section.visible { display: block; }

.prediction-box {
  background: #fef3c7;
  border: 1px solid #fcd34d;
}

/* 旧紫 #ede9fe / #c4b5fd は廃止。Neo Futura の frost に統合 */
.deep-dive-box {
  background: var(--nf-frost);
  border: 1px solid var(--nf-ice);
}

.teach-box {
  background: var(--teach-bg);
  border: 1px solid var(--nf-ice);
}

/* Connections */
.connections-section {
  background: var(--connection-bg);
  border: 1px solid var(--connection-border);
  border-radius: 10px;
  padding: 16px;
  margin: 20px 0;
}

.connections-section h3 {
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.connection-item {
  font-size: 0.88rem;
  margin-bottom: 8px;
  padding-left: 16px;
  position: relative;
}

.connection-item::before {
  content: "🔗";
  position: absolute;
  left: 0;
}

/* Stats Tab */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.engagement-list {
  list-style: none;
}

.engagement-list li {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

/* Journal Tab */
.journal-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}

.journal-section h3 {
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.mood-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.mood-btn {
  padding: 6px 16px;
  border: 2px solid var(--border);
  border-radius: 20px;
  background: white;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.mood-btn.selected {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}

.journal-input {
  width: 100%;
  min-height: 60px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 8px;
}

.notion-export {
  background: var(--nf-tint);
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 12px;
  margin-top: 16px;
}

.notion-export textarea {
  width: 100%;
  min-height: 80px;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px;
  font-family: monospace;
  font-size: 0.8rem;
  resize: vertical;
}

.copy-btn {
  margin-top: 8px;
  padding: 6px 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}

.copy-btn:hover { opacity: 0.9; }

/* Notification Banner — チームの声 (2026-04-25 改修) */
.notification-banner {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.notification-item {
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.5;
  padding: 4px 8px;
  border-radius: 6px;
}

.notification-item.notification-error {
  background: #fef2f2;
  color: #b91c1c;
}

.notification-item.notification-warn {
  background: #fffbeb;
  color: #92400e;
}

.notification-item.notification-info {
  background: #eff6ff;
  color: #1e40af;
}

.notification-source-tag {
  display: inline-block;
  font-size: 0.7rem;
  background: rgba(0,0,0,0.06);
  border-radius: 4px;
  padding: 1px 6px;
  margin-right: 6px;
  vertical-align: 1px;
  font-weight: 400;
}

/* Review Queue Warning */
.review-age-warning {
  color: #92400e;
  background: #fef3c7;
  border-left: 3px solid #d97706;
}

/* Loading / Error states */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

.error-msg {
  text-align: center;
  padding: 40px;
  color: var(--score-high);
}

/* Expand arrow */
.expand-arrow {
  transition: transform 0.2s;
  color: var(--text-secondary);
  font-size: 0.8rem;
  flex-shrink: 0;
}

.topic-card.expanded .expand-arrow { transform: rotate(90deg); }

/* Deep Dive List (Journal Tab) */
.deep-dive-list {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}

.deep-dive-list h3 {
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.deep-dive-list-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s;
  gap: 8px;
}

.deep-dive-list-item:last-child { border-bottom: none; }
.deep-dive-list-item:hover { background: var(--accent-light); }

.deep-dive-list-item .dd-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.deep-dive-list-item .dd-title {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 500;
}

.deep-dive-list-item .dd-arrow {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.deep-dive-empty {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 8px 0;
}

/* Closure-as-a-Service: tldr + audio card
   結論1行を最上部に大きく出し、本文へのリンクは控えめに。
   "読まなきゃ"を生まないUI。 */
.deep-dive-closure-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent, #1e5be6);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.deep-dive-closure-card .dd-tldr {
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.55;
  color: var(--text);
  margin-bottom: 10px;
}

.deep-dive-closure-card .dd-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.deep-dive-closure-card .dd-audio-btn {
  background: var(--accent, #1e5be6);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
}

.deep-dive-closure-card .dd-audio-btn:hover {
  opacity: 0.85;
}

.deep-dive-closure-card .dd-body-link {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-decoration: none;
}

.deep-dive-closure-card .dd-body-link:hover {
  color: var(--accent, #1e5be6);
  text-decoration: underline;
}

.deep-dive-closure-card .dd-title-sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 4px;
  opacity: 0.7;
}

/* Deep Dive Viewer Page */
.deep-dive-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}

.deep-dive-back {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.deep-dive-back:hover { text-decoration: underline; }

.deep-dive-date {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.deep-dive-viewer h1 { font-size: 1.4rem; margin: 24px 0 12px; color: var(--text); border-bottom: 2px solid var(--border); padding-bottom: 8px; }
.deep-dive-viewer h2 { font-size: 1.15rem; margin: 20px 0 10px; color: var(--accent); }
.deep-dive-viewer h3 { font-size: 1rem; margin: 16px 0 8px; color: var(--text); }
.deep-dive-viewer h4 { font-size: 0.92rem; margin: 14px 0 6px; color: var(--text-secondary); }

.deep-dive-viewer p {
  font-size: 0.9rem;
  line-height: 1.8;
  margin-bottom: 1em;
}

.deep-dive-viewer ul, .deep-dive-viewer ol {
  margin: 8px 0 16px 20px;
  font-size: 0.9rem;
  line-height: 1.7;
}

.deep-dive-viewer li { margin-bottom: 4px; }

.deep-dive-viewer blockquote {
  background: var(--nf-tint);
  border-left: 3px solid var(--accent);
  padding: 10px 14px;
  margin: 12px 0;
  border-radius: 0 6px 6px 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.deep-dive-viewer table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.85rem;
  display: block;
  overflow-x: auto;
}

.deep-dive-viewer th {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
  text-align: left;
  padding: 8px 12px;
  border: 1px solid var(--border);
}

.deep-dive-viewer td {
  padding: 8px 12px;
  border: 1px solid var(--border);
}

.deep-dive-viewer tr:nth-child(even) td { background: #f9fafb; }

.deep-dive-viewer code {
  background: var(--nf-tint);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.83rem;
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
  color: var(--accent);
}

.deep-dive-viewer pre {
  background: var(--nf-tint);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px;
  overflow-x: auto;
  margin: 12px 0;
}

.deep-dive-viewer pre code {
  background: none;
  padding: 0;
  font-size: 0.82rem;
  line-height: 1.5;
}

.deep-dive-viewer a {
  color: var(--accent);
  text-decoration: none;
}

.deep-dive-viewer a:hover { text-decoration: underline; }

.deep-dive-viewer hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

.deep-dive-viewer strong { font-weight: 600; }

.deep-dive-viewer img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

/* Recall Window — 再会の小窓 */
.recall-window {
  background: linear-gradient(135deg, #fef7ed 0%, #fff8f1 100%);
  border: 1px solid #fdba74;
  border-radius: 12px;
  padding: 16px 20px;
  margin: 16px 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Weekly View — 今週の景色 (Secretary) — Neo Futura frost */
.weekly-view {
  background: var(--nf-frost);
  border: 1px solid var(--nf-ice);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 16px 0;
  box-shadow: var(--shadow-sm);
}
.weekly-view-title {
  margin: 0 0 10px 0;
  font-size: 1rem;
  color: var(--nf-deep);
  letter-spacing: 0.02em;
}
.weekly-view-week {
  font-size: 0.85rem;
  color: var(--accent);
  margin-left: 6px;
  font-weight: normal;
  font-variant-numeric: tabular-nums;
}
.weekly-view-body h4 {
  margin: 10px 0 4px 0;
  font-size: 0.95rem;
  color: var(--nf-deep);
}
.weekly-view-body ul {
  margin: 4px 0 8px 18px;
  padding: 0;
  font-size: 0.9rem;
  color: var(--text);
}
.weekly-view-body p {
  margin: 6px 0;
  font-size: 0.9rem;
  color: var(--text);
}
.weekly-view-stale {
  margin-top: 10px;
  padding: 8px 10px;
  font-size: 0.85rem;
  background: #fff7ed;
  border-left: 3px solid #fb923c;
  color: #9a3412;
  border-radius: 4px;
}

.recall-title {
  margin: 0 0 12px 0;
  font-size: 1rem;
  color: #9a3412;
  letter-spacing: 0.02em;
}

.recall-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recall-item {
  background: #ffffff;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 12px 14px;
}

.recall-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: #9a3412;
  margin-bottom: 4px;
}

.recall-source {
  background: #fff7ed;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid #fed7aa;
}

.recall-date { color: #9a3412; opacity: 0.7; }

.recall-title-line {
  font-weight: 600;
  font-size: 0.95rem;
  color: #1f2937;
  margin: 4px 0;
}

.recall-title-line a { color: #9a3412; text-decoration: none; }
.recall-title-line a:hover { text-decoration: underline; }

.recall-summary {
  font-size: 0.82rem;
  color: #4b5563;
  line-height: 1.5;
  margin: 4px 0;
}

.recall-why {
  font-size: 0.78rem;
  color: #9a3412;
  background: #fff7ed;
  padding: 6px 10px;
  border-radius: 6px;
  margin: 6px 0 8px;
}

.recall-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.recall-btn {
  background: #ffffff;
  border: 1px solid #fed7aa;
  border-radius: 18px;
  padding: 4px 12px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.recall-btn:hover { background: #fff7ed; }
.recall-btn:disabled { cursor: default; opacity: 0.55; }
.recall-btn.active {
  background: #fed7aa;
  border-color: #fb923c;
  transform: scale(1.05);
  opacity: 1;
}

.recall-ack {
  margin-top: 8px;
  padding: 6px 10px;
  font-size: 0.85rem;
  color: #7c2d12;
  background: #fffbeb;
  border-left: 3px solid #fb923c;
  border-radius: 4px;
}

/* Responsive */
@media (max-width: 600px) {
  body { padding: 8px; }
  .header { flex-direction: column; gap: 8px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .deep-dive-viewer table { font-size: 0.78rem; }
  .deep-dive-viewer th, .deep-dive-viewer td { padding: 6px 8px; }
  .recall-window { padding: 12px 14px; }
  .recall-actions { flex-wrap: wrap; }

  /* iPhone fix: tags don't push ❤️🎓 off-screen */
  .topic-header { gap: 6px; padding: 10px 12px; }
  .topic-meta { max-height: 1.6em; }   /* 1 line of tags on narrow screens */
  .action-btn { width: 32px; height: 32px; font-size: 0.9rem; }
  .score-badge { width: 28px; height: 28px; font-size: 0.7rem; line-height: 28px; }
}
