/* fergi-aperture.css — the embedded Fergi aperture.
 *
 * Train: opening-fergi-apertures S6. First and only host today: the Biography
 * folio's local port (`.bio-pane-aperture` inside `.bio-pane-controls`).
 *
 * WHY THE APERTURE WEARS THE ROOM, NOT THE VESSEL
 * -----------------------------------------------
 * Fergi's own window is the dark Mind Console (S7 owns that interior). An
 * aperture is not Fergi's window — it is Fergi's presence inside SOMEONE
 * ELSE'S room, and the room here is the Biographer's Study: warm paper, sepia
 * rules, gold leaf on the primary act. So the aperture is drawn in the folio's
 * own vocabulary with ONE borrowed accent — the vessel's iris teal, used only
 * for the spark and the focus ring — which is enough to read as "Fergi is
 * here" without dropping a dark panel into a lamplit desk.
 *
 * CO-EQUAL IS A LAYOUT FACT, NOT A CLAIM
 * --------------------------------------
 * The aperture is a full-width row INSIDE the sticky pane footer, above the
 * button line. It does not overlay, cover, disable or reorder a single native
 * control: Edit, Import, Export, Listen, Regenerate, Pin, Undo and Marginalia
 * keep the exact geometry they had before this file existed. Nothing in this
 * stylesheet touches `.bio-ctl`.
 */

/* The row itself: a full-width flex line at the TOP of the wrapping footer. */
.bio-pane-aperture {
    flex: 1 0 100%;
    order: -1;
    min-width: 0;
}
/* An aperture that declined to mount leaves an EMPTY container — it must take
   no space at all, or every viewer who is not the subject gets a mystery gap
   above the buttons. */
.bio-pane-aperture:empty { display: none; }

.bio-aperture {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 10px;
    padding: 9px 11px 10px;
    border: 1px solid rgba(112, 78, 38, 0.30);
    border-radius: 9px 12px 10px 13px;
    background: linear-gradient(168deg, rgba(251, 246, 234, 0.92), rgba(243, 233, 209, 0.86));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

/* ── context disclosure (§ E: "Fergi is helping with ⟨Name⟩'s AI biography") ──
   Not decoration. The member must be able to see, without asking, WHICH
   biography this conversation is about — the same fact the coordinator pins as
   `bio_editor` + context_id. */
.bio-ap-disclosure {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--ffv-body-font, 'Source Sans 3', 'Inter', sans-serif);
    font-size: calc(0.74rem * var(--type-scale, 1));
    letter-spacing: 0.02em;
    color: rgba(78, 58, 32, 0.82);
}
.bio-ap-disclosure strong { color: var(--ffv-ink, #35291a); font-weight: 700; }
.bio-ap-spark { color: #2f9d9a; font-size: 0.9em; }

/* ── the exchange ──────────────────────────────────────────────────────────
   The port holds the LAST exchange (§ G2's built default) and points at the
   full conversation for the rest. It is deliberately not a scroll-back: a
   transcript window inside a biography folio would compete with the biography. */
.bio-ap-log {
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-height: 168px;
    overflow-y: auto;
    font-family: var(--ffv-body-font, 'Source Sans 3', 'Inter', sans-serif);
    font-size: calc(0.8rem * var(--type-scale, 1));
    line-height: 1.45;
}
.bio-ap-line { white-space: pre-wrap; }
.bio-ap-line--member {
    align-self: flex-end;
    max-width: 88%;
    padding: 5px 9px;
    border-radius: 10px 10px 3px 10px;
    background: rgba(217, 154, 61, 0.16);
    color: var(--ffv-ink, #35291a);
}
.bio-ap-line--fergi {
    max-width: 96%;
    color: var(--ffv-ink, #35291a);
}
.bio-ap-line--system {
    color: rgba(78, 58, 32, 0.78);
    font-style: italic;
}

/* A notice is a STATEMENT ABOUT THE MEMBER'S OWN TEXT — the merge outcome.
   `conflict` is the one that matters: their draft was preserved and Fergi's
   change is elsewhere. It is styled to be read, not to alarm; nothing failed. */
.bio-ap-notice {
    padding: 6px 9px;
    border-radius: 7px;
    border-left: 3px solid rgba(217, 154, 61, 0.7);
    background: rgba(240, 198, 106, 0.14);
    font-size: calc(0.76rem * var(--type-scale, 1));
    line-height: 1.45;
    color: rgba(60, 44, 22, 0.94);
}
.bio-ap-notice--rebased { border-left-color: #2f9d9a; background: rgba(47, 157, 154, 0.10); }

/* ── the undo chip (I.5: "visible undo") ───────────────────────────────────
   Offered only when the folio's own guarded undo says it is available AND
   permitted for this caller — a lever that would refuse is a false affordance. */
.bio-ap-undo-chip {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border: 1px solid rgba(112, 78, 38, 0.45);
    border-radius: 999px;
    background: rgba(251, 246, 234, 0.92);
    color: var(--ffv-ink, #35291a);
    font-family: var(--ffv-body-font, 'Source Sans 3', 'Inter', sans-serif);
    font-size: calc(0.76rem * var(--type-scale, 1));
    font-weight: 600;
    cursor: pointer;
}
.bio-ap-undo-chip:hover { border-color: #d99a3d; background: rgba(240, 198, 106, 0.22); }

/* ── the stage line (S5's machine, rendered honestly) ───────────────────────
   Every stage shown here was ENTERED BY A SIGNAL. There is no timer behind it,
   which is why the dot pulses and the words do not march. */
.bio-ap-stage {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: calc(0.76rem * var(--type-scale, 1));
    color: rgba(78, 58, 32, 0.82);
    font-style: italic;
}
.bio-ap-stage-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #2f9d9a;
    animation: bioApPulse 1.4s ease-in-out infinite;
}
@keyframes bioApPulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

/* ── the control board (rendered by FergiInputControlBoard) ───────────────── */
.bio-ap-board.fic-board {
    display: flex;
    align-items: center;
    gap: 6px;
}
.bio-ap-board .fic-text {
    flex: 1 1 auto;
    min-width: 0;
    resize: none;
    min-height: 34px;
    max-height: 96px;
    padding: 7px 10px;
    border: 1px solid rgba(112, 78, 38, 0.38);
    border-radius: 8px;
    background: rgba(255, 252, 245, 0.95);
    color: var(--ffv-ink, #35291a);
    font-family: var(--ffv-body-font, 'Source Sans 3', 'Inter', sans-serif);
    font-size: calc(0.84rem * var(--type-scale, 1));
    line-height: 1.4;
}
/* G-052 (Greg, 2026-10-02): the one-row textarea let its placeholder wrap, so on a 390 px phone the
   member saw a first line and the top half of a second ("Find a passage, f…"). One line, ending in an
   ellipsis; the field still grows for what the member actually types. */
.bio-ap-board .fic-text::placeholder {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bio-ap-board .fic-text:focus {
    outline: none;
    border-color: #2f9d9a;
    box-shadow: 0 0 0 2px rgba(47, 157, 154, 0.22);
}
.bio-ap-board .fic-mic,
.bio-ap-board .fic-conversation,
.bio-ap-board .fic-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    flex: 0 0 auto;
    border: 1px solid rgba(112, 78, 38, 0.38);
    border-radius: 8px;
    background: rgba(251, 246, 234, 0.85);
    color: rgba(60, 44, 22, 0.9);
    cursor: pointer;
}
.bio-ap-board .fic-mic:hover,
.bio-ap-board .fic-send:hover { border-color: #d99a3d; background: rgba(240, 198, 106, 0.2); }
.bio-ap-board .fic-mic.active { border-color: #c0392b; color: #c0392b; }
.bio-ap-board .fic-send { border-color: rgba(185, 138, 55, 0.9); background: linear-gradient(160deg, #f0c66a, #d99a3d); color: #3a2607; }
.bio-ap-board .fic-send.fic-stopping { background: rgba(251, 246, 234, 0.9); color: #8a3a2c; border-color: rgba(138, 58, 44, 0.6); }

/* THE INERT CONVERSATION CONTROL (Joe I.2).
   Present because Joe asked for it in the UI; visibly not-yet-available
   because it is not. It carries `data-fic-inert` and `aria-disabled`, and its
   appearance must MATCH that claim — a control styled as live and behaving as
   inert is the dishonesty this train keeps naming. */
.bio-ap-board .fic-conversation[data-fic-inert="true"] {
    opacity: 0.42;
    cursor: default;
    border-style: dashed;
}

/* ── chips + expansion ─────────────────────────────────────────────────────
   The chips are STEMS, not sends: pressing one writes an opening into the
   composer and the member still says the thing. They are also the only honest
   intent classifier in the system, which is why `intent_label` rides the wire
   on this path and on no other. */
.bio-ap-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
}
/* the chip row and the phone's "More ⋯" side by side; More is display:none off the phone, so elsewhere this
   is just the row */
.bio-ap-chiprow { display: flex; align-items: center; gap: 6px; }
.bio-ap-chiprow > .bio-ap-chips { flex: 1 1 auto; min-width: 0; }
.bio-ap-chip,
.bio-ap-expand {
    padding: 4px 9px;
    border: 1px solid rgba(112, 78, 38, 0.32);
    border-radius: 999px;
    background: rgba(255, 252, 245, 0.7);
    color: rgba(60, 44, 22, 0.9);
    font-family: var(--ffv-body-font, 'Source Sans 3', 'Inter', sans-serif);
    font-size: calc(0.72rem * var(--type-scale, 1));
    cursor: pointer;
}
.bio-ap-chip:hover,
.bio-ap-expand:hover { border-color: #2f9d9a; background: rgba(47, 157, 154, 0.10); }
.bio-ap-expand { margin-left: auto; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
    .bio-ap-stage-dot { animation: none; opacity: 0.85; }
}
