/* What only this app knows — insights, health, agent, notebook, cohorts
   (insights.js). Same tokens as style.css. */

.insights-card {
  margin-top: 14px;
  padding: 16px 14px 14px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(168, 85, 247, 0.08), rgba(255, 255, 255, 0.02)), var(--bg-2);
  border: 1px solid var(--border);
}
.insights-card:empty { display: none; }
.insights-card .res-stats,
#ideaInsights .res-stats,
.notebook .res-stats { grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); }
.findings { list-style: none; margin: 6px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; line-height: 1.8; }
.find-up { color: #6ee7b7; font-weight: 700; margin-inline-start: 4px; }
.find-down { color: #fca5a5; margin-inline-start: 8px; }
.perf-note { margin-top: -4px; }

.stories { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.story-card { padding: 11px 12px; border-radius: 16px; background: rgba(250, 204, 21, 0.06); border: 1px solid rgba(250, 204, 21, 0.22); font-size: 12.5px; line-height: 1.8; }
.story-head { margin: 0; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.story-head .icon { color: #fbbf24; }
.story-channel { color: var(--accent-2); font-size: 12px; }
.story-facts, .story-video { margin: 2px 0 0; color: var(--text-dim); font-size: 11.5px; }
.story-quote { margin: 6px 0 0; padding: 6px 10px; border-inline-start: 3px solid #fbbf24; background: rgba(255, 255, 255, 0.03); border-radius: 8px; font-size: 12.5px; }

.exits-card { margin-top: 10px; border-radius: 14px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border); padding: 8px 12px; font-size: 12.5px; }
.exits-card summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 5px; font-weight: 700; flex-wrap: wrap; }
.exits-card summary::-webkit-details-marker { display: none; }
.exit-bars { list-style: none; padding: 0; margin: 10px 0 4px; display: flex; flex-direction: column; gap: 6px; }
.exit-bars li { display: grid; grid-template-columns: 1fr 70px 22px; align-items: center; gap: 8px; font-size: 11.5px; }
.exit-bars i { height: 6px; border-radius: 99px; background: linear-gradient(90deg, #fca5a5, #f472b6); width: var(--w); justify-self: start; }
.exit-bars b { text-align: center; }
.exit-notes { margin: 8px 0 0; padding-inline-start: 16px; color: var(--text-dim); font-size: 11.5px; line-height: 1.8; }
.my-exit, .exit-link { margin-top: 10px; font-size: 12px; }
.exit-link { display: block; color: var(--text-dim); }
.exit-reasons { display: flex; flex-direction: column; gap: 4px; margin: 8px 0 10px; }

.health-banner { margin: 10px 0 0; padding: 10px 12px; border-radius: 16px; font-size: 12.5px; line-height: 1.8; border: 1px solid; }
.health-banner.is-watch { background: rgba(250, 204, 21, 0.08); border-color: rgba(250, 204, 21, 0.35); }
.health-banner.is-warning { background: rgba(255, 59, 92, 0.1); border-color: rgba(255, 59, 92, 0.45); }
.health-title { margin: 0 0 4px; display: flex; align-items: center; gap: 5px; }
.health-banner ul { margin: 0; padding-inline-start: 16px; }
.health-banner small { display: block; color: var(--text-dim); font-size: 11.5px; }

.badge-monetized { background: rgba(250, 204, 21, 0.14); color: #fde68a; border-color: rgba(250, 204, 21, 0.35); }
.badge-health-watch { background: rgba(250, 204, 21, 0.12); color: #fde68a; border-color: rgba(250, 204, 21, 0.3); }
.badge-health-warning { background: rgba(255, 59, 92, 0.15); color: #fda4af; border-color: rgba(255, 59, 92, 0.4); }
.badge-locked { background: rgba(34, 211, 238, 0.12); color: #a5f3fc; border-color: rgba(34, 211, 238, 0.35); }
.locked-card { margin-top: 14px; padding: 14px; border-radius: var(--radius-lg); background: linear-gradient(135deg, rgba(34, 211, 238, 0.12), rgba(168, 85, 247, 0.12)); border: 1px solid var(--border-glow); font-size: 13px; line-height: 1.8; }
.locked-card p { margin: 0 0 8px; }
.locked-title { font-weight: 800; display: flex; align-items: center; gap: 6px; }

.agent-points { list-style: none; padding: 0; margin: 8px 0 12px; display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; }
.agent-points li { display: flex; align-items: center; gap: 7px; }
.agent-points .icon { color: var(--accent-2); }
.agent-open-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.agent-preview, .agent-howto { margin-top: 10px; font-size: 12px; }
.agent-preview summary, .agent-howto summary { cursor: pointer; color: var(--text-dim); font-weight: 700; }
.agent-preview pre { max-height: 220px; overflow: auto; white-space: pre-wrap; font-size: 11px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px; }
.agent-howto ol { padding-inline-start: 18px; line-height: 1.9; }
.agent-howto code, .agent-keys code { font-size: 11px; background: var(--surface-strong); padding: 1px 5px; border-radius: 6px; word-break: break-all; }
.agent-key-new { padding: 10px 12px; border-radius: 14px; background: rgba(52, 211, 153, 0.08); border: 1px solid rgba(52, 211, 153, 0.35); margin-bottom: 8px; font-size: 12.5px; }
.agent-key-new p { margin: 0 0 6px; }
.agent-url { display: flex; align-items: center; gap: 8px; width: 100%; margin-bottom: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-2); color: var(--text); font-family: inherit; cursor: pointer; text-align: left; }
.agent-url code { flex: 1; font-size: 11px; word-break: break-all; }
.agent-keys { list-style: none; padding: 0; margin: 6px 0 10px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.agent-keys li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.agent-keys small { color: var(--text-dim); flex-basis: 100%; }
#agentKeyLabel { margin-bottom: 8px; }

.weekly-card { margin: 12px 16px 4px; padding: 13px 14px; border-radius: 20px; background: linear-gradient(135deg, rgba(168, 85, 247, 0.16), rgba(34, 211, 238, 0.1)); border: 1px solid var(--border-glow); font-size: 12.5px; line-height: 1.85; }
.notebook .weekly-card { margin: 0 0 12px; }
.weekly-card p { margin: 0 0 3px; }
.weekly-card .weekly-title { font-weight: 800; font-size: 13.5px; display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.weekly-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
/* home: just the line the button acts on; «کل گزارش» opens the rest */
.weekly-card.is-compact { padding: 11px 14px; }
.weekly-card.is-compact .weekly-title { margin-bottom: 3px; }
.weekly-card.is-compact:not(.is-open) .weekly-line { display: none; }
.weekly-card.is-compact .weekly-actions { margin-top: 6px; font-size: 12px; }

.notebook, .cohort { padding: 16px; animation: fadeIn 0.2s ease; }
.notebook h2, .cohort h2 { font-size: 18px; font-weight: 800; margin: 0 0 14px; }
.notebook .soft-card .draft-textarea, .cohort .soft-card .draft-textarea { margin: 6px 0 8px; min-height: 70px; }
.notebook .soft-card .draft-select, .notebook .soft-card .draft-input, .cohort .soft-card .draft-input { margin-bottom: 8px; }
.nb-milestones { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.nb-idea { margin-top: 10px; padding: 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.nb-idea-title { display: flex; align-items: center; gap: 5px; padding: 0; border: none; background: none; color: var(--text); font-family: inherit; font-size: 13.5px; font-weight: 800; cursor: pointer; margin-bottom: 6px; text-align: start; }
.nb-line { margin: 5px 0 0; font-size: 12px; color: var(--text-dim); line-height: 1.8; }
.nb-line a { color: var(--accent-2); }
.gj-chip.is-warning { color: #fda4af; border-color: rgba(255, 59, 92, 0.4); }
.gj-chip.is-watch { color: #fde68a; border-color: rgba(250, 204, 21, 0.35); }
.journal { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 8px; }
.journal li { padding: 8px 10px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--border); font-size: 12.5px; }
.journal p { margin: 0 0 3px; white-space: pre-wrap; }
.journal small { color: var(--text-dim); margin-inline-end: 8px; }
.timeline { list-style: none; padding: 0; margin: 6px 0 0; border-inline-start: 2px solid var(--border); }
.timeline li { display: grid; grid-template-columns: 18px 1fr; gap: 2px 8px; padding: 6px 12px 6px 0; padding-inline-start: 12px; font-size: 12px; line-height: 1.7; }
.timeline li .icon { color: var(--accent-2); margin-top: 3px; }
.timeline small { grid-column: 2; color: var(--text-dim); font-size: 10.5px; }
.resume-card .toggle-row { margin: 6px 0; }

.cohort-list { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-direction: column; gap: 8px; }
.cohort-member { padding: 11px 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); font-size: 12.5px; }
.cohort-member.is-me { border-color: rgba(168, 85, 247, 0.45); }
.cohort-member-top { display: flex; align-items: center; gap: 8px; }
.cohort-member-top > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cohort-member-top small { color: var(--text-dim); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cohort-week { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px; background: var(--surface-strong); font-weight: 800; }
.cohort-week.has { background: rgba(52, 211, 153, 0.16); color: #6ee7b7; }
.cohort-streak { font-size: 11px; color: #fdba74; white-space: nowrap; }
.cohort-plan, .cohort-blocker { margin: 7px 0 0; line-height: 1.8; }
.cohort-blocker { color: #fde68a; font-size: 12px; }
.cohort-member .chip-btn { margin-top: 6px; }
.cohort-member .chip-btn.active { border-color: rgba(52, 211, 153, 0.5); color: #6ee7b7; }
.cohort-waiting { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-dim); }

.mentor-impact { margin: 6px 0 0; font-size: 11.5px; color: #6ee7b7; display: flex; align-items: center; gap: 4px; }
.proof-quote { margin: 8px 0; }
.admin-health, .admin-stories { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.admin-health > li { padding: 8px 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.admin-health > li.is-warning { border-color: rgba(255, 59, 92, 0.45); }
.admin-health ul { margin: 4px 0 0; padding-inline-start: 16px; color: var(--text-dim); }
.admin-stories li.is-hidden { opacity: 0.5; }
.admin-alert-form .draft-select, .admin-alert-form .draft-textarea { margin-bottom: 6px; }
