/* /automation/agents — the Agents feed (docs/product/agents-page, layout 1a).
   Self-contained: every control the page draws is styled here. Colours follow the dashboard tokens where they exist;
   the agent and "waiting" colours come from the design handoff. */

/* Frame and header: .vp-page--narrow / .vp-header (css/page-patterns.css). No bottom padding: the composer is sticky. */
.af-page { padding-bottom: 0; display: flex; flex-direction: column; min-height: 100%; }
.af-muted { color: var(--ai-text-muted, #6A7282); font-size: 14px; }
.af-version { margin: 20px 0 8px; font-size: 11px; color: #98A2B3; }


/* ---- filter chips: .vp-pills / .vp-pill; only the Feed's own modifiers live here ---- */
.af-status { margin: -8px 0 16px; font-size: 13px; color: var(--ai-text-muted, #6A7282); }
.af-chip--waiting { border-style: dashed; border-color: #E6C98F; }
.af-count { min-width: 18px; padding: 0 6px; border-radius: 999px; background: #FBF1DC; color: #7A4E00; font-size: 11px; font-weight: 600; text-align: center; }
.af-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.af-dot--discovery { background: #B07A1A; }
.af-dot--prospecting { background: #3F63B8; }
.af-dot--workflow { background: #2F7D5A; }
.af-chip-icon, .af-agent .agent-icon { display: inline-flex; flex-shrink: 0; }   /* colours: js/agent-registry.js */

/* ---- feed ---- */
.af-feed { flex: 1; }
.af-day { display: flex; align-items: center; gap: 10px; margin: 18px 0 10px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ai-text-muted, #6A7282); }
.af-day::after { content: ''; flex: 1; height: 1px; background: var(--ai-border, #E5E7EB); }
.af-entry { background: #fff; border: 1px solid var(--ai-border, #E5E7EB); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; overflow-wrap: anywhere; }
.af-entry--waiting { border-color: #E6C98F; box-shadow: 0 0 0 3px #FBF1DC; }
.af-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-size: 12px; color: var(--ai-text-muted, #6A7282); }
.af-agent { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.af-agent i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.af-agent--discovery { background: #F6EBD3; color: #7A4E00; }
.af-agent--prospecting { background: #E3E9F7; color: #2B4C9B; }
.af-agent--workflow { background: #E2F1E8; color: #1F5E41; }
.af-line { margin: 0 0 8px; font-size: 14px; line-height: 1.5; color: var(--ai-text-dark, #101828); }
.af-quote { margin: 0 0 8px; padding: 8px 12px; border-left: 3px solid var(--ai-border, #E5E7EB); font-size: 14px; color: #364153; white-space: pre-wrap; }
.af-draft { margin: 0 0 8px; padding: 10px 12px; border-radius: 10px; background: #F9FAFB; font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
.af-label { display: block; margin-bottom: 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ai-text-muted, #6A7282); }
.af-note { margin: 0 0 8px; font-size: 13px; color: #364153; }
.af-code { margin: 0 0 8px; padding: 10px 12px; max-height: 240px; overflow: auto; background: #f8f9fb; border: 1px solid #e5e7eb; border-radius: 8px;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; color: #1f2937; white-space: pre; }
.af-why { margin: 0 0 8px; font-size: 13px; color: #364153; }
.af-why summary { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; font-weight: 600; color: #2F5D50; }
.af-why summary:focus-visible { outline: 2px solid #2F5D50; outline-offset: 2px; border-radius: 4px; }
.af-why-list { margin: 0; padding-left: 18px; line-height: 1.5; }
.af-why-list li + li { margin-top: 6px; }
.af-why-text { display: block; color: var(--ai-text-dark, #101828); }
.af-why-cites { display: block; color: var(--ai-text-muted, #6A7282); overflow-wrap: anywhere; }
.af-weakest { margin: 0 0 8px; padding: 8px 12px; border-radius: 8px; background: #FBF1DC; font-size: 14px; color: var(--ai-text-dark, #101828); }
.af-list { margin: 0 0 8px; padding-left: 18px; font-size: 14px; line-height: 1.6; color: var(--ai-text-dark, #101828); }
.af-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; vertical-align: 1px; }
.af-tag--waiting { background: #FBF1DC; color: #7A4E00; }
.af-tag--ok { background: #E3F1E5; color: #2F6B3A; }
.af-tag--error { background: #FBE7E5; color: #7A221D; }
.af-tag--muted { background: #F2F4F7; color: #475467; }
.af-people { list-style: none; margin: 0 0 8px; padding: 0; border: 1px solid #EFEDE8; border-radius: 10px; }
.af-person + .af-person { border-top: 1px solid #EFEDE8; }
.af-person label { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 10px 12px; cursor: pointer; }
.af-person input { width: 18px; height: 18px; margin: 2px 0 0; flex-shrink: 0; accent-color: #1C1B19; }
.af-person-name { display: block; font-size: 14px; font-weight: 600; color: #101828; }
.af-person-sub { display: block; font-size: 13px; color: var(--ai-text-muted, #6A7282); }
.af-link { color: #2F5D50; text-decoration: underline; }
.af-empty { padding: 32px 20px; border: 1px dashed var(--ai-border, #E5E7EB); border-radius: 12px; text-align: center; font-size: 14px; color: #364153; }

/* ---- buttons ---- */
.af-btn {
    display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 14px; border-radius: 8px;
    font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; border: 1px solid transparent;
}
.af-btn--primary { background: #1C1B19; color: #fff; }
.af-btn:disabled { opacity: .5; cursor: default; }
.af-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.af-textarea {
    display: block; width: 100%; margin: 0 0 4px; padding: 10px 12px; border: 1px solid #D8D4CB; border-radius: 8px;
    font: inherit; font-size: 16px; line-height: 1.5; color: #101828; background: #fff; resize: vertical;
}
.af-textarea:focus { outline: 0; border: 2px solid #1C1B19; padding: 9px 11px; }
.af-count-line { margin: 0 0 8px; font-size: 12px; color: var(--ai-text-muted, #6A7282); text-align: right; }
.af-ok { margin: 0 0 8px; padding: 8px 12px; border-radius: 8px; background: #E3F1E5; color: #2F6B3A; font-size: 13px; }
.af-error { margin: 0 0 8px; padding: 8px 12px; border-radius: 8px; background: #FBE7E5; color: #7A221D; font-size: 13px; }
.af-btn--secondary { background: #fff; border-color: #D8D4CB; color: #1C1B19; }
.af-btn--ghost { background: transparent; color: var(--ai-text-muted, #6A7282); }

/* ---- composer, pinned to the bottom of the column ---- */
.af-composer {
    position: sticky; bottom: 0; display: flex; align-items: center; gap: 8px; margin: 16px 0 0; padding: 8px 8px 8px 12px;
    background: #fff; border: 1px solid var(--ai-border, #E5E7EB); border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.05);
}
.af-context { flex-shrink: 0; padding: 2px 8px; border-radius: 999px; background: #F2F4F7; font-size: 12px; font-weight: 600; color: #364153; }
.af-input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 16px; background: transparent; color: #101828; }
.af-send { flex-shrink: 0; width: 36px; height: 36px; border-radius: 8px; border: 0; background: #1C1B19; color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.af-btn:focus-visible, .af-send:focus-visible { outline: 2px solid #1C1B19; outline-offset: 2px; }

@media (pointer: coarse) {
    .af-btn { min-height: 44px; }
    .af-send { width: 44px; height: 44px; }
}
/* The mobile bottom nav is fixed up to 768px: the composer sticks above it, not under it. */
@media (max-width: 768px) {
    .af-composer { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 640px) {
    .af-btn { width: 100%; }
}

/* Discovery's Reading and Finding entries (read-only) */
.af-score { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.af-delta { margin-left: 6px; font-size: 13px; color: #475467; }
.af-bars { list-style: none; margin: 0 0 8px; padding: 0; }
.af-bar { display: grid; grid-template-columns: 96px 1fr auto; gap: 10px; align-items: center; margin: 0 0 6px; font-size: 13px; }
.af-bar-name { color: #364153; }
.af-bar-track { display: block; height: 6px; border-radius: 3px; background: #F2F4F7; overflow: hidden; }
.af-bar-fill { display: block; height: 100%; background: #B07A1A; }
.af-bar-val { min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; color: #475467; }
@media (max-width: 480px) { .af-bar { grid-template-columns: 84px 1fr auto; } }

/* An agent that is off (each is off until the owner turns it on): its chip reads muted, its filter shows what it does and the switch. */
.af-chip--off { opacity: .6; }
.af-off-title { margin: 0 0 6px; font-size: 15px; font-weight: 600; color: #1C1B19; }
.af-off-text { margin: 0 0 14px; font-size: 14px; line-height: 1.45; color: #4A5565; }
.af-offstrip { margin: 0 0 16px; padding: 16px; border: 1px dashed var(--ai-border, #E5E7EB); border-radius: 12px; }
.af-offlist { list-style: none; margin: 8px 0 0; padding: 0; }
.af-offlist li { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--ai-border, #E5E7EB); }
.af-offlist li:first-child { border-top: 0; }
.af-off-name { grid-column: 1; font-size: 14px; font-weight: 600; color: #1C1B19; }
.af-offlist .af-off-text { grid-column: 1; margin: 2px 0 0; font-size: 13px; }
.af-offlist .af-btn { grid-column: 2; grid-row: 1 / span 2; min-height: 44px; white-space: nowrap; }
@media (max-width: 480px) {
  .af-offlist li { grid-template-columns: 1fr; }
  .af-offlist .af-btn { grid-column: 1; grid-row: auto; margin-top: 8px; width: 100%; }
}

/* Discovery's planned posts: a topic's outline and a published post's checkpoints. */
.af-di-outline, .af-di-checks { margin: 4px 0 8px; padding-left: 18px; font-size: 13px; color: #364153; }
.af-di-outline li, .af-di-checks li { margin-bottom: 2px; }
