/* Analytics and period reviews (#/insights #/reviews #/portfolio #/case-coverage, board B09) — family rules only.
   The «مِحْوَر» system (tokens, components, icons) is app/public/lifeos.css owned by W0; this file uses its tokens only,
   so light/dark follow .lo[data-theme] and LIGHT/DETAILED follows the root [data-mode] without changing font sizes. */
.an-page { min-inline-size: 0; }
.an-page [hidden] { display: none !important; }
.an-message:empty, .an-drafts:empty, .an-editor-host:empty { display: none; }

/* A button's icon is drawn from the lifeos icon variable (.ic-<name> sets --i), so the label stays its only text. */
.an-bi::before { content: ""; inline-size: 16px; block-size: 16px; flex: none; background: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.btn:not(.btn-sm).an-bi::before { inline-size: 18px; block-size: 18px; }

/* Disclosure: closed in LIGHT, always open in DETAILED (progressive disclosure only). */
.an-more { display: contents; }
.an-more-b { display: none; }
.an-more.is-open > .an-more-b, [data-mode="detailed"] .an-more > .an-more-b { display: flex; flex-direction: column; gap: 10px; }
[data-mode="detailed"] .an-more > .an-more-t { display: none; }
.an-review-aside > .an-more > .an-more-t { align-self: flex-start; }
.an-more-t[aria-expanded="true"] { background: var(--surface-2); color: var(--ink); }

.an-summary { display: flex; align-items: center; gap: 8px; min-block-size: 32px; cursor: pointer; list-style: none; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.an-summary::-webkit-details-marker { display: none; }
.an-summary::after { content: ""; margin-inline-start: auto; inline-size: 7px; block-size: 7px; border-right: 1.75px solid currentColor; border-bottom: 1.75px solid currentColor; transform: rotate(45deg); transition: transform var(--dur) var(--ease); flex: none; }
details[open] > .an-summary::after { transform: rotate(-135deg); }
details.an-fold[open] > .an-summary { margin-block-end: 6px; }
details.an-fold > :not(summary) + :not(summary) { margin-block-start: 10px; }

/* Period, stats and the two separate-column tables */
.an-period .toolbar { row-gap: 10px; }
.an-period .seg button { min-block-size: 32px; }
.an-cards .stat { min-inline-size: 150px; max-inline-size: 260px; }
.an-cards .stat .v strong { font-weight: inherit; }
.an-unknown { color: var(--warn-ink); }
.an-table td { vertical-align: top; }
.an-big { font-size: 17px; font-weight: 600; }
.an-basis-cell { min-inline-size: 180px; max-inline-size: 320px; }
.an-row { flex-wrap: wrap; align-items: flex-start; }
.an-row > .grow { flex: 1 1 240px; }
.an-desc { display: block; }
.an-value { font-weight: 600; white-space: pre-wrap; padding-block-start: 2px; }
.an-lead { display: inline-flex; color: var(--ink-3); padding-block-start: 3px; }
.an-track-unknown { background: repeating-linear-gradient(135deg, var(--surface-3) 0 4px, transparent 4px 8px); box-shadow: inset 0 0 0 1px var(--line-2); }
.an-original { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; }
.an-basis { white-space: pre-wrap; overflow-wrap: anywhere; max-block-size: 320px; overflow: auto; }
.an-hist .h { grid-template-columns: 150px minmax(0, 1fr); }
.an-bullets li { display: flex; gap: 6px; }
.an-bullets li::before { content: "•"; color: var(--ink-3); }
.an-case { padding-block: 14px; border-block-end: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.an-case:last-child { border-block-end: 0; }
.an-evidence { display: flex; flex-direction: column; gap: 10px; }
.an-evidence > li { padding-block: 8px; border-block-end: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.an-evidence > li:last-child { border-block-end: 0; }
.an-review-title { font-size: 22px; }
@media (min-width: 1024px) { .an-review-split { grid-template-columns: minmax(0, 1fr) 380px; } .an-review-aside { position: sticky; inset-block-start: 16px; } }

/* Editor, sources and save states */
.an-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.an-seg { flex-wrap: wrap; }
.an-check { display: flex; gap: 10px; align-items: center; min-block-size: 32px; cursor: pointer; }
.an-check input { inline-size: 18px; block-size: 18px; accent-color: var(--accent); flex: none; }
.an-source-picker, .an-source-browser { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-inline-size: 0; display: flex; flex-direction: column; gap: 8px; }
.an-choice-list, .an-source-selected, .an-source-options { display: flex; flex-direction: column; gap: 6px; max-block-size: 300px; overflow: auto; overscroll-behavior: contain; }
.an-source-selected > li, .an-source-options > li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding-block: 6px; border-block-end: 1px solid var(--line); }
.an-source-meta { flex: 1 1 140px; }
.an-error:empty { display: none; }
.an-error { color: var(--danger-ink); }
.an-error-list { display: flex; flex-direction: column; gap: 4px; }
.an-editor-wrap { display: flex; flex-direction: column; gap: 12px; scroll-margin-block-start: 16px; }
.an-editor-wrap > .an-editor { border-inline-start: 3px solid var(--accent); }
.an-save-feedback .state { white-space: normal; align-items: flex-start; line-height: 1.5; }
.an-compare th[scope="row"] { color: var(--ink-2); font-weight: 600; white-space: nowrap; }

/* Phone widths: 44px touch targets and 16px inputs (no zoom on focus). */
@media(max-width:650px) {
  .an-page .btn, .an-page .tabs button, .an-page .seg button, .an-page .an-summary, .an-page .an-check { min-block-size: 44px; }
  .an-page .input, .an-page .select, .an-page .textarea { min-block-size: 44px; font-size: 16px; }
  .an-two { grid-template-columns: minmax(0, 1fr); }
  .an-hist .h { grid-template-columns: minmax(0, 1fr); }
  .an-cards .stat { max-inline-size: none; }
}
