/* ══════════════════════════════════════════════════════════════════════════
   ambient-fergi-rail.css — the Ambient Fergi rail, in every non-Fergi room.

   Train: porting-perimeter-souls S8. Component: app/js/features/ambient-fergi-rail.js

   THE RAIL IS WORKSPACE, NOT CHASSIS. It is the first row of the room's own
   working panel, not part of the sculpted perimeter — so nothing in this file
   touches `.ffvc-*`, `.ffrw-header`, a keep-out, or any measured geometry. The
   ten ported rooms' capture gates and derived keep-outs are untouched by
   construction; this session wrote no theme and no chassis rule.

   IT ALSO DOES NOT COMPETE WITH THE ROOM. One line of controls, one line of
   answer, the room's own colours, and no border that reads as a second window
   inside the window. A rail that announced itself would be exactly the
   "decorative label competing with the artwork" the fleet's law refuses.
   ══════════════════════════════════════════════════════════════════════════ */

.afr-rail {
    display: block;
    margin: 0 0 12px 0;
    padding: 0;
}

.afr-rail .afr-board {
    display: block;
}

/* The shipped control board, laid out as one row. Colours are inherited from
   the room so the rail reads as part of the surface it accelerates. */
.afr-rail .fic-board.afr-fic {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.14));
    border-radius: 10px;
    background: var(--bg-elevated, rgba(255, 255, 255, 0.04));
}

.afr-rail .fic-board.afr-fic .fic-text {
    flex: 1 1 auto;
    min-width: 0;
    resize: none;
    border: 0;
    outline: none;
    background: transparent;
    color: inherit;
    font: inherit;
    line-height: 1.4;
    padding: 4px 2px;
    max-height: 4.5em;
}

.afr-rail .fic-board.afr-fic .fic-text::placeholder {
    color: var(--text-muted, rgba(255, 255, 255, 0.45));
    opacity: 1;
}

.afr-rail .fic-board.afr-fic button {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary, rgba(255, 255, 255, 0.72));
    cursor: pointer;
}

.afr-rail .fic-board.afr-fic button:hover,
.afr-rail .fic-board.afr-fic button:focus-visible {
    background: var(--bg-hover, rgba(255, 255, 255, 0.09));
    color: var(--text-primary, #fff);
}

/* The inert conversation control is honestly inert, and looks it. Joe I.2 put
   it on every manifestation; `aria-disabled` already says so to a screen
   reader, and this says the same thing to an eye. */
.afr-rail .fic-board.afr-fic [data-fic-inert="true"] {
    opacity: 0.42;
    cursor: default;
}

.afr-rail .fic-board.afr-fic [data-fic-role="mic"].active {
    color: var(--accent-danger, #e0574f);
}

/* The board's polite live region: announced, never seen. */
.afr-rail .fic-live {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ── the standing answer ────────────────────────────────────────────────────
   NOT a transcript entry. One line, written once per submit and left there, so
   "a local result must remain usable after the compact transcript collapses"
   is true because there is no transcript to collapse. Empty until there is
   something to say — an empty rail must not reserve a line of the workspace. */
.afr-rail .afr-result {
    margin: 6px 2px 0 2px;
    font-size: 0.86rem;
    line-height: 1.35;
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
}

.afr-rail .afr-result:empty {
    display: none;
}

.afr-rail .afr-result.afr-ok {
    color: var(--accent-success, #6fbf73);
}

.afr-rail .afr-result.afr-warn {
    color: var(--accent-warning, #e0a458);
}

/* Stripped mode stands the decoration down everywhere else in the fleet; the
   rail is a control, so it stays — but it drops the elevated plate so it reads
   as plain furniture on a plain surface. */
.ffrw-stripped .afr-rail .fic-board.afr-fic {
    background: transparent;
}

@media (prefers-reduced-motion: reduce) {
    .afr-rail .fic-board.afr-fic button {
        transition: none;
    }
}

/* ── the degradation line (truly-ambient-fergiai S1, W1.3) ──────────────────
   Fergi saying it could not think. A SECOND line under the answer, deliberately
   quieter than the answer it qualifies: the member still got a real filtered
   list, and this explains why it is a plain one — it does not take the result
   away. Warning-amber would over-read it (a literal fallback is a bad answer,
   not a failure) so it stays in the secondary text colour, set apart by the
   rule above it rather than by hue. Inherits `.afr-result.afr-warn`'s colour on
   a refusal, which is correct: there, both facts are bad news. */
.afr-rail .afr-result .afr-degraded {
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
    font-size: 0.8rem;
    font-style: italic;
    opacity: 0.85;
}
