/* Exchange status panel — service-owned styles, on the shell's tokens.
   Readable at a glance by a non-engineer: big status pills, plain words. */

.exchange-head {
    margin-bottom: 1.25rem;
}

.exchange-head h1 {
    margin: 0 0 0.25rem;
    font-size: 1.4rem;
}

.exchange-sub {
    margin: 0;
    color: var(--sv-text-muted);
    max-width: 60ch;
}

.exchange-loading {
    color: var(--sv-text-muted);
}

.xc-card {
    background: var(--sv-surface);
    border: 1px solid var(--sv-border);
    border-radius: var(--sv-radius-lg);
    box-shadow: var(--sv-shadow-sm);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.xc-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.xc-card-head h2 {
    margin: 0;
    font-size: 1.1rem;
}

.xc-badge {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: var(--sv-radius);
    border: 1px solid var(--sv-border-strong);
    color: var(--sv-text-muted);
    background: var(--sv-bg);
}

.xc-mode {
    color: var(--sv-primary);
    border-color: var(--sv-primary);
    background: var(--sv-primary-soft);
}

/* Stood down: the operator is not writing — the loudest badge on the card. */
.xc-stood-down {
    color: var(--sv-danger-text);
    border-color: var(--sv-danger-border);
    background: var(--sv-danger-bg);
}

/* The three morning answers. */
.xc-answers {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem 1.5rem;
    margin: 0 0 0.75rem;
}

.xc-answer-wide {
    grid-column: 1 / -1;
}

.xc-answers dt {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--sv-text-muted);
}

.xc-answers dd {
    margin: 0.1rem 0 0;
}

.xc-pill {
    display: inline-block;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: var(--sv-radius);
    font-size: 0.85rem;
}

.xc-ok {
    color: #10643a;
    background: #e2f5ea;
}

.xc-bad {
    color: var(--sv-danger-text);
    background: var(--sv-danger-bg);
}

.xc-unknown,
.xc-neutral {
    color: var(--sv-text-muted);
    background: var(--sv-bg);
}

/* Watch-state chips. */
.xc-chips {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.xc-chip {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--sv-border);
}

.xc-chip.xc-ok {
    border-color: #9bd8b5;
}

.xc-chip.xc-bad {
    border-color: var(--sv-danger-border);
}

/* Errors: verbatim, never truncated. */
.xc-errors summary {
    cursor: pointer;
    color: var(--sv-danger-text);
    font-weight: 600;
}

.xc-error-text {
    white-space: pre-wrap;
    word-break: break-word;
    background: var(--sv-bg);
    border: 1px solid var(--sv-danger-border);
    border-radius: var(--sv-radius);
    padding: 0.6rem 0.75rem;
    margin: 0.5rem 0 0;
    font-size: 0.82rem;
    overflow-x: auto;
}

.xc-muted {
    color: var(--sv-text-muted);
}

/* Recent cycles. */
.xc-recent summary {
    cursor: pointer;
    font-weight: 600;
}

.xc-table-wrap {
    overflow-x: auto;
    margin-top: 0.5rem;
}

.xc-recent-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.xc-recent-table th,
.xc-recent-table td {
    text-align: left;
    padding: 0.35rem 0.6rem;
    border-bottom: 1px solid var(--sv-border);
    white-space: nowrap;
}

.xc-recent-table th {
    color: var(--sv-text-muted);
    font-weight: 600;
}

/* A program's run history is capped and scrolls inside its card: the
   latest cycle is the first row, so it is on screen without scrolling,
   and twenty rows never push the next program out of view. */
.xc-recent-scroll {
    max-height: 16rem;
    overflow-y: auto;
}

.xc-recent-scroll thead th {
    position: sticky;
    top: 0;
    background: var(--sv-surface);
}

.xc-program-link {
    margin: 0 0 0.75rem;
    font-size: 0.85rem;
}

.xc-static {
    opacity: 0.85;
}

.xc-scheduled {
    color: var(--sv-text-muted);
}

.xc-static-note {
    margin: 0;
    color: var(--sv-text-muted);
}

/* Verification pages: the trail back, where verification stands, the side-by-side. */
.xc-crumbs {
    margin: 0 0 0.35rem;
    font-size: 0.82rem;
    color: var(--sv-text-muted);
}

.xc-verified-line {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
}

.xc-verified-note {
    margin: 0;
    color: var(--sv-text-muted);
    font-size: 0.85rem;
    max-width: 70ch;
}

/* Group chips double as filters, so the selected one has to read as
   pressed and not merely coloured. */
.xc-chip-on {
    border-color: var(--sv-primary);
    background: var(--sv-primary-soft);
    color: var(--sv-primary);
}

a.xc-chip {
    text-decoration: none;
}

.xc-paging {
    display: flex;
    gap: 1rem;
    margin: 0.75rem 0 0;
    font-size: 0.85rem;
}

/* Side by side: agreement is the point of a matching row, so it is drawn
   rather than left blank. Values wrap — a truncated value proves nothing. */
.xc-sides td {
    white-space: normal;
    word-break: break-word;
    vertical-align: top;
}

.xc-side-agrees td {
    background: #f2fbf6;
}

.xc-side-differs td {
    background: var(--sv-danger-bg);
    font-weight: 600;
}

.xc-examples {
    margin: 0.75rem 0 0;
    font-size: 0.85rem;
    color: var(--sv-text-muted);
}

/* Two bad outcomes, drawn apart. A comparison that stopped before it
   compared anything is not a comparison that failed: amber and dashed for
   the instrument, the danger tones kept for a real verdict. */
.xc-halted {
    color: #8a5300;
    background: #fdf1dd;
    border: 1px dashed #d8a24a;
}

.xc-halted-badge {
    color: #8a5300;
    border-color: #d8a24a;
    border-style: dashed;
    background: #fdf1dd;
}

.xc-halted-row td {
    background: #fdf9f1;
    white-space: normal;
}

.xc-halted-note {
    border-left: 3px solid #d8a24a;
    padding-left: 0.75rem;
    margin: 0 0 0.75rem;
}

.xc-halted-line {
    margin: 0;
}

.xc-legend {
    margin: 0 0 0.5rem;
    font-size: 0.82rem;
}

/* The group chips are the run's arithmetic; the break is where a pass
   stops and the reasons a run failed begin. */
.xc-chip-pair {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.xc-chip-break {
    display: inline-block;
    align-self: stretch;
    border-left: 2px solid var(--sv-border-strong);
    margin: 0 0.35rem;
}

.xc-chip-fails {
    color: var(--sv-danger-text);
    border-color: var(--sv-danger-border);
    background: var(--sv-danger-bg);
}

.xc-chip-why {
    font-size: 0.75rem;
    color: var(--sv-text-muted);
}

.xc-chip-legend {
    margin: 0 0 0.5rem;
    font-size: 0.8rem;
}

/* The boundary of the accepted-difference policy reads as a different
   kind of statement from the policy itself. */
.xc-never {
    border-left: 4px solid var(--sv-danger-border);
    background: var(--sv-danger-bg);
}

.xc-never-lead {
    margin: 0 0 0.75rem;
    color: var(--sv-danger-text);
    font-weight: 600;
}

.xc-never-rule {
    margin: 0 0 0.75rem;
}

.xc-never-rule:last-child {
    margin-bottom: 0;
}

/* The roster of scheduled programs. The proposal banner has to be the
   first thing read on the page, so it is loud and it stays loud. */
.xc-proposed {
    border-left: 4px solid var(--sv-primary);
    background: var(--sv-primary-soft);
}

.xc-proposed-head {
    margin: 0 0 0.35rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: var(--sv-primary);
}

.xc-proposed-line {
    margin: 0;
    max-width: 70ch;
}

.xc-proposed-badge {
    color: var(--sv-primary);
    border-color: var(--sv-primary);
    background: var(--sv-primary-soft);
}

/* Reasons are sentences, not codes — they wrap where the other tables'
   cells do not. */
.xc-fate-table .xc-fate-reason {
    white-space: normal;
    min-width: 22ch;
}

.xc-fleet-note {
    font-size: 0.85rem;
    max-width: 70ch;
}

@media (max-width: 640px) {
    .xc-answers {
        grid-template-columns: 1fr;
    }
}
