/* =====================================================================
   GOALS (/goals - SIG-4, docs/claude/GOALS.md "The Portal"; significant-moments-design.md 4.1 + 7.1)
   The Overview's goal cards (each moment a shared KPI tile - components.css owns wf-kpi*), the "What we learned" ledger
   (also the Answer Center run drawer's tab) and Set up (its lists and dialogs). ONE stylesheet owns every gol-* class
   (Tests/ConversationBuilderCssOwnershipTests); colours, lines, radii and shadows are --theme-* / --wf-* tokens only.
   ===================================================================== */

.gol-page { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.gol-page > .wf-page-header { margin-bottom: 4px; }

/* ---- The Overview: a card per goal, two groups, tiles in one divided strip ---- */
.gol-cards { display: grid; gap: 16px; min-width: 0; }
.gol-card { min-width: 0; overflow: hidden; }
.gol-card-head,
.gol-setup-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 20px 12px; }
.gol-card-titles { flex: 1 1 18rem; min-width: 0; }
.gol-card-title { margin: 0; color: var(--theme-text-emphasis); font-size: var(--wf-text-h3); font-weight: 650; overflow-wrap: anywhere; }
.gol-card-sub { margin: 2px 0 0; color: var(--theme-text-secondary); font-size: var(--wf-text-sm); line-height: 1.45; overflow-wrap: anywhere; }
.gol-period { flex: none; }
.gol-group { padding: 0 0 12px; border-top: 1px solid var(--wf-line); }
.gol-group-title { display: flex; align-items: center; gap: 8px; margin: 0; padding: 12px 20px 8px; color: var(--theme-text-secondary); font-size: var(--wf-text-sm); font-weight: 650; }
.gol-group-title > .bi { color: var(--wf-primary-ink); }
.gol-group-empty { margin: 0; padding: 0 20px; color: var(--theme-text-muted); font-size: var(--wf-text-sm); }
.gol-tiles { margin: 0 20px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-tile); }
.gol-tile { min-width: 0; }
/* SIG-8: under a tile's two lines - the change (the shared .wf-delta), the rate, the target's meter + words, the trend spark. */
.gol-tile-more { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.gol-tile-rate { color: var(--theme-text-secondary); font-size: var(--wf-text-xs); line-height: 1.4; overflow-wrap: anywhere; }
.gol-tile-target { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.gol-tile-target-text { color: var(--theme-text-secondary); font-size: var(--wf-text-xs); line-height: 1.4; overflow-wrap: anywhere; }
.gol-tile-trend { min-width: 0; margin-top: 2px; }
.gol-note { margin: 0; color: var(--theme-text-muted); font-size: var(--wf-text-xs); }

/* ---- Journeys that reached a goal (the dispatch core's journey - phase 1b) ---- */
.gol-journeys { display: grid; gap: 12px; padding: 16px; min-width: 0; }
.gol-journeys-title { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--theme-text-emphasis); font-size: var(--wf-text-h3); font-weight: 600; }
.gol-journeys-headline { margin: 0; color: var(--theme-text); }
.gol-journeys-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; min-width: 0; }
.gol-journeys-col { min-width: 0; }
.gol-journeys-sub { margin: 0 0 6px; color: var(--theme-text-secondary); font-size: var(--wf-text-sm); font-weight: 600; }
.gol-journeys-list { margin: 0; padding: 0; list-style: none; }
.gol-journeys-list > li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--theme-border-subtle); font-size: var(--wf-text-sm); }
.gol-journeys-list > li:last-child { border-bottom: 0; }
.gol-journeys-name { min-width: 0; color: var(--theme-text); overflow-wrap: anywhere; }
.gol-journeys-figure { color: var(--theme-text-emphasis); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* SIG-14: THE MIX TILE - a kept moment's answers (two columns wide where the strip has room), its bars on one scale (the shared
   wf-hbar look - the share of the people who answered), the change, a badge only on a real move, a spark per top answer. */
.gol-tile-mix { grid-column: span 2; }
.gol-mix { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.gol-mix-trending { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin: 0; padding: 2px 8px; border-radius: var(--wf-radius-pill); background: var(--wf-success-soft); color: var(--wf-success-ink); font-size: var(--wf-text-xs); font-weight: 650; }
.gol-mix-trending.is-falling { background: var(--wf-neutral-soft); color: var(--theme-text-secondary); }
.gol-mix-trending.is-new { background: var(--wf-primary-soft); color: var(--wf-primary-ink); }
.gol-mix-rows { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.gol-mix-row { min-width: 0; }
.gol-mix-row + .gol-mix-row { border-top: 1px solid var(--wf-line); }
.gol-mix-bar { padding: 5px 0 3px; grid-template-columns: minmax(5rem, 9rem) minmax(0, 1fr) auto; }
.gol-mix-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; padding: 0 0 5px; }
.gol-mix-badge { display: inline-flex; align-items: center; padding: 0 7px; border-radius: var(--wf-radius-pill); background: var(--wf-neutral-soft); color: var(--theme-text-secondary); font-size: var(--wf-text-xs); font-weight: 650; line-height: 18px; }
.gol-mix-badge.is-rising { background: var(--wf-success-soft); color: var(--wf-success-ink); }
.gol-mix-badge.is-new { background: var(--wf-primary-soft); color: var(--wf-primary-ink); }
.gol-mix-spark { flex: 1 1 6rem; min-width: 4rem; max-width: 10rem; }
.gol-mix-note { margin: 0; color: var(--theme-text-muted); font-size: var(--wf-text-xs); line-height: 1.4; }

/* SIG-14: THE INSIGHT LINE - a card's one or two strongest facts, in words, under its title. */
.gol-insights { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0 20px 12px; list-style: none; }
.gol-insight { display: flex; align-items: baseline; gap: 8px; color: var(--theme-text); font-size: var(--wf-text-sm); line-height: 1.45; overflow-wrap: anywhere; }
.gol-insight > .bi { flex: none; color: var(--wf-primary-ink); }

/* SIG-8: the period switch over the cards - each goal's own, or one period for every goal; it scrolls sideways on a phone. */
.gol-overview-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; min-width: 0; }
.gol-period-switch { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.gol-period-switch::-webkit-scrollbar { display: none; }
.gol-zone { margin: 0; color: var(--theme-text-muted); font-size: var(--wf-text-xs); }
.gol-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; color: var(--theme-text-secondary); font-size: var(--wf-text-sm); }
.gol-notice > .bi { color: var(--wf-primary-ink); }

/* The empty Overview: "Start from a goal" and its three suggestions. */
.gol-start { min-width: 0; }
.gol-suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; margin: 0; padding: 0; list-style: none; font-size: var(--wf-text-sm); }

/* ---- The ledger ---- */
.gol-ledger { min-width: 0; }
.gol-ledger-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 20px 8px; }
.gol-panel-title { margin: 0; color: var(--theme-text-emphasis); font-size: var(--wf-text-h3); font-weight: 650; }
.gol-panel-sub { max-width: 680px; margin: 2px 0 0; color: var(--theme-text-secondary); font-size: var(--wf-text-sm); line-height: 1.45; }
.gol-filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 12px; }
.gol-filters > .form-select { flex: 0 1 12rem; width: auto; min-width: 0; }
.gol-failed { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px 20px; color: var(--theme-text-secondary); }
.gol-failed > p { flex: 1 1 16rem; min-width: 0; margin: 0; }
.gol-skel-rows { height: 10rem; margin: 16px; border-radius: var(--wf-radius-md); }
.gol-ledger-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 20px; border-top: 1px solid var(--wf-line); color: var(--theme-text-muted); font-size: var(--wf-text-xs); }

.gol-hits { margin: 0; padding: 0; list-style: none; }
.gol-hit { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 10px 20px; border-top: 1px solid var(--wf-line); }
.gol-hits.is-compact .gol-hit { grid-template-columns: minmax(0, 1fr); padding: 10px 0; }
.gol-hit-what { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; min-width: 0; }
.gol-hit-moment { color: var(--theme-text-emphasis); font-weight: 600; overflow-wrap: anywhere; }
.gol-hit-value { color: var(--theme-text); overflow-wrap: anywhere; }
.gol-hit-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; grid-column: 1; min-width: 0; color: var(--theme-text-muted); font-size: var(--wf-text-xs); }
.gol-hit-from { color: var(--theme-text-secondary); overflow-wrap: anywhere; }
.gol-hit-open { grid-column: 2; grid-row: 1 / span 2; white-space: nowrap; }
.gol-said,
.gol-unstamped,
.gol-corrected { font-size: var(--wf-text-xs); }

.gol-hit-ending { color: var(--theme-text-secondary); }

/* ---- What people told us (SIG-12): each learned moment's top answers ---- */
.gol-told { padding: 4px 20px 16px; border-top: 1px solid var(--wf-line); }
.gol-told-title { margin: 12px 0 0; color: var(--theme-text-emphasis); font-size: var(--wf-text-h3); font-weight: 650; }
.gol-told-sub { margin: 2px 0 10px; color: var(--theme-text-secondary); font-size: var(--wf-text-sm); }
.gol-told-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); gap: 10px; }
.gol-told-card { min-width: 0; padding: 10px 12px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-tile); background: var(--theme-surface); }
.gol-told-moment { color: var(--theme-text-emphasis); font-weight: 600; font-size: var(--wf-text-sm); overflow-wrap: anywhere; }
.gol-told-note { margin: 4px 0 0; color: var(--theme-text-muted); font-size: var(--wf-text-xs); }
.gol-told-headline { margin: 4px 0 0; color: var(--theme-text-emphasis); font-size: var(--wf-text-sm); font-weight: 650; overflow-wrap: anywhere; }
.gol-told-asked { margin: 0 0 6px; color: var(--theme-text-secondary); font-size: var(--wf-text-xs); }

/* ---- The people (SIG-12): one closed accordion row per person ---- */
.gol-view { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 20px; border-top: 1px solid var(--wf-line); }
.gol-view > .gol-panel-sub { flex: 1 1 18rem; margin: 0; }
.gol-people { margin: 0; padding: 0; list-style: none; }
.gol-person-item { border-top: 1px solid var(--wf-line); }
.gol-person { min-width: 0; }
.gol-person-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 10px 20px; cursor: pointer; list-style: none; color: var(--theme-text-muted); font-size: var(--wf-text-xs); }
.gol-person-head::-webkit-details-marker { display: none; }
.gol-person-head:hover { background: var(--wf-card-hover); }
.gol-person-head:focus-visible { outline: 2px solid var(--wf-primary-ink); outline-offset: -2px; }
.gol-person-chev { color: var(--theme-text-secondary); transition: transform .15s ease; }
.gol-person[open] > .gol-person-head .gol-person-chev { transform: rotate(90deg); }
.gol-person-who { color: var(--theme-text-emphasis); font-size: var(--wf-text-sm); font-weight: 600; overflow-wrap: anywhere; }
.gol-person-fact { color: var(--theme-text-secondary); }
/* The phone / email the Answer Center's card shows beside the who ("Rosco" + "(717) 808-0831") - text, never a link (a tap on the
   accordion's head opens it). */
.gol-who-contact { display: inline-flex; align-items: center; gap: 4px; min-width: 0; color: var(--theme-text-secondary); overflow-wrap: anywhere; }
.gol-who-contact > .bi { color: var(--theme-text-muted); }
.gol-person-seen { margin-left: auto; white-space: nowrap; }
.gol-person-body { padding: 0 0 4px 28px; }

/* ---- Set up ---- */
.gol-setup { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.gol-setup-goal { min-width: 0; overflow: hidden; }
.gol-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.gol-moments { margin: 0 20px; padding: 0; list-style: none; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-tile); }
.gol-moment { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 12px; padding: 10px 14px; }
.gol-moment + .gol-moment { border-top: 1px solid var(--wf-line); }
.gol-moment-body { flex: 1 1 16rem; min-width: 0; }
.gol-moment-name { color: var(--theme-text-emphasis); font-weight: 600; overflow-wrap: anywhere; }
.gol-moment-meta,
.gol-moment-marks { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 2px; color: var(--theme-text-secondary); font-size: var(--wf-text-xs); }
.gol-link { color: var(--wf-primary-ink); text-decoration: none; overflow-wrap: anywhere; }
.gol-link:hover,
.gol-link:focus-visible { text-decoration: underline; }
.gol-link > .bi { margin-right: 4px; }
.gol-add { margin: 8px 20px 0; }
.gol-refused { flex: 1 1 100%; margin: 0 20px 8px; padding: 10px 14px; border-radius: var(--wf-radius-md); background: var(--wf-warning-soft); color: var(--theme-text); font-size: var(--wf-text-sm); }
.gol-moment .gol-refused { margin: 4px 0 0; }
.gol-refused-text { display: flex; align-items: baseline; gap: 8px; margin: 0; }
.gol-refused-text > .bi { color: var(--wf-warning-ink); }
.gol-refused-marks { margin: 6px 0 0; padding-left: 24px; }

/* SIG-13: COUNT PAST RUNS - the bar at the top of Set up, the per-conversation button in "Marked in", and its dialog's
   progress line and check (a headline, what was not counted, by conversation, by significant moment). */
.gol-count-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 20px; }
.gol-count-bar-text { display: flex; align-items: baseline; gap: 8px; flex: 1 1 20rem; min-width: 0; margin: 0; color: var(--theme-text-secondary); font-size: var(--wf-text-sm); line-height: 1.45; }
.gol-count-bar-text > .bi { color: var(--wf-primary-ink); }
.gol-count-one { padding-top: 0; padding-bottom: 0; line-height: 1; }
.gol-count-dialog { max-width: 40rem; }
.gol-count-progress { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; color: var(--theme-text-secondary); font-size: var(--wf-text-sm); }
.gol-count-progress > .spinner-border { color: var(--wf-primary-ink); }
.gol-count-result { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--wf-line); }
.gol-count-headline { margin: 0; color: var(--theme-text-emphasis); font-size: var(--wf-text-h3); font-weight: 650; line-height: 1.45; overflow-wrap: anywhere; }
.gol-count-subtitle { margin: 12px 0 4px; color: var(--theme-text-secondary); font-size: var(--wf-text-sm); font-weight: 650; }
.gol-count-list { margin: 0; padding: 0; list-style: none; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-tile); }
.gol-count-list > li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; padding: 6px 12px; color: var(--theme-text); font-size: var(--wf-text-sm); }
.gol-count-list > li + li { border-top: 1px solid var(--wf-line); }
.gol-count-name { min-width: 0; color: var(--theme-text-emphasis); font-weight: 600; overflow-wrap: anywhere; }
.gol-count-detail { color: var(--theme-text-secondary); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* ---- The dialogs (the Consent dialog's shape) ---- */
.gol-dialog { max-width: 34rem; }
/* The modal header paints the workspace's own colours (a primary band in some themes) - the glyph takes its text colour. */
.gol-dialog-icon { color: inherit; }
.gol-dialog fieldset { min-width: 0; padding: 0; border: 0; }
.gol-dialog legend { float: none; width: auto; padding: 0; font-size: 14px; }
.gol-dialog-hint { color: var(--theme-text-secondary); font-size: var(--wf-text-sm); }
.gol-field-hint { margin-top: 2px; color: var(--theme-text-muted); font-size: var(--wf-text-xs); }
.gol-target-row { display: flex; flex-wrap: wrap; gap: 8px; }
.gol-target-row > .form-select { flex: 1 1 12rem; width: auto; min-width: 0; }
.gol-target-row > .form-control { flex: 0 1 9rem; min-width: 0; }
.gol-dialog-error { margin: 8px 0 0; color: var(--wf-danger-ink); font-size: var(--wf-text-sm); }
.gol-dialog-error > p { margin: 0; }
.gol-dialog-error > ul { margin: 4px 0 0; padding-left: 18px; }

@media (max-width: 640px) {
    .gol-card-head,
    .gol-setup-head,
    .gol-ledger-head { padding: 14px 16px 10px; }
    .gol-group-title { padding: 12px 16px 8px; }
    .gol-tiles,
    .gol-moments { margin: 0 16px; }
    .gol-tile-mix { grid-column: auto; }
    .gol-insights { padding: 0 16px 12px; }
    .gol-hit { grid-template-columns: minmax(0, 1fr); padding: 10px 16px; }
    .gol-hit-open { grid-column: 1; grid-row: auto; justify-self: start; }
    .gol-told,
    .gol-view { padding-left: 16px; padding-right: 16px; }
    .gol-person-head { padding: 10px 16px; }
    .gol-person-seen { margin-left: 0; }
    .gol-person-body { padding-left: 12px; }
}

/* THE DOWNLOAD MENU (2026-10-15) - the ledger as a file, beside the family switch. */
.gol-ledger-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.gol-export { position: relative; }
.gol-export-list { min-width: 14rem; }
.gol-export-note { margin: 0; padding: 0 20px 8px; color: var(--theme-text-muted); font-size: var(--wf-text-sm); }
