/* =================================================================
   THE MESSAGE CENTER (/ops/messages) in the new frame
   (portal-look-and-feel.md 3.18 - the third center, after Launch
   Control and the Answer Center), with the pages in its family: the
   Messaging Playground, Messaging Channels and Consent.
   -----------------------------------------------------------------
   Every class here is owned by this file alone
   (Tests/ConversationBuilderCssOwnershipTests): mcx- (the Message
   Center, the Playground, Messaging Channels), mtc- (the kept-turn
   card), csn- (Consent) and qh- (Consent's Quiet hours card - both
   folded in from their scoped sheets). The shared pieces come from
   components.css (the KPI tile, the charts, the segmented control,
   the count, the code chip, tiles, empty states, skeletons) and
   wf.css (cards, buttons, forms, modals); this file lays them out and
   draws what is the Message Center's own.

   TOKENS ONLY, the whole file (Tests/ShellTokensOnlyTests): no hex,
   no rgb() / hsl(), no colour keyword - every colour reads a --wf-*,
   --theme-* or --conv-* token; black / white appear only as a
   color-mix() target. The colour grammar holds: a state is a word with
   a dot in its state ink (delivered / seen / on = success, waiting /
   queued = the brand, pending = warning, failed = danger, closed / off
   = neutral) - never info (the Say family), the accent or the offset.
   The phone picture (MessagePhone) keeps its own channel skins: it is
   a picture of another app (WhatsApp, RCS, Apple Messages), content
   like a QR code, not the Portal's chrome.

   NOTHING SCROLLS SIDEWAYS (3.10 / 3.17): every table stacks into one
   card per row under 760px of page (@container page); above that a
   wide table scrolls inside its own card with a sticky head; the tabs
   become a swipe row on a phone.
   ================================================================= */

/* ---- The page: cards on the 8px rhythm ---- */
.mcx-page { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.mcx-page > .wf-page-header { margin-bottom: 4px; }
.mcx-spacer { flex: 1 1 auto; }
.mcx-iconbtn { min-width: 32px; padding-left: 8px; padding-right: 8px; }
.mcx-lede { max-width: 82ch; margin: 0; color: var(--theme-text-secondary); font-size: 13.5px; }
.mcx-sub { display: block; color: var(--theme-text-muted); font-size: 12px; line-height: 1.35; }
.mcx-mono { font-family: var(--theme-font-mono); font-size: 12px; }
.mcx-hint { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--theme-text-muted); font-size: 12.5px; }
.mcx-w-20 { width: 20%; }
.mcx-w-40 { width: 40%; }
.mcx-w-50 { width: 50%; }
.mcx-w-60 { width: 60%; }

/* The tabs ride the page header; on a phone they become a swipe row. */
.mcx-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.mcx-tabs::-webkit-scrollbar { display: none; }
.mcx-tabs > .wf-tab { flex: none; white-space: nowrap; }

/* A line that says what happened (copied, saved, erased) or what went wrong - calm, never a slab. */
.mcx-note {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 8px 8px 8px 14px;
    border: 1px solid var(--wf-line);
    border-radius: var(--wf-radius-md);
    background: var(--wf-card);
    color: var(--theme-text);
    font-size: 13px;
}
.mcx-note > .bi { color: var(--wf-success-ink); }
.mcx-note.is-error { border-color: color-mix(in srgb, var(--wf-danger-ink) 25%, var(--wf-line)); background: var(--wf-danger-soft); }
.mcx-note.is-error > .bi { color: var(--wf-danger-ink); }
.mcx-note-text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }

/* A state: a word with a dot in its state ink. Never colour alone. */
.mcx-state {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 22px;
    padding: 0 9px;
    border-radius: var(--wf-radius-pill);
    background: var(--wf-neutral-soft);
    color: var(--theme-text-secondary);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.mcx-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.mcx-state.is-success { background: var(--wf-success-soft); color: var(--wf-success-ink); }
.mcx-state.is-brand { background: var(--wf-primary-soft); color: var(--wf-primary-ink); }
.mcx-state.is-warning { background: var(--wf-warning-soft); color: var(--wf-warning-ink); }
.mcx-state.is-danger { background: var(--wf-danger-soft); color: var(--wf-danger-ink); }
/* A neutral tag (a kind, a mode, a count of options) - an icon and words, no dot. */
.mcx-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 22px;
    padding: 0 8px;
    border: 1px solid var(--wf-line);
    border-radius: var(--wf-radius-pill);
    background: var(--wf-card);
    color: var(--theme-text-secondary);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.mcx-tag > .bi { color: var(--theme-text-muted); }
/* A direction and a channel: a glyph beside the word, never a colour. */
.mcx-dir,
.mcx-chan { display: inline-flex; align-items: center; gap: 5px; color: var(--theme-text); white-space: nowrap; }
.mcx-dir > .bi,
.mcx-chan > .bi { color: var(--theme-text-muted); }

/* =================================================================
   THE FILTERS - one strip, and when opened ONE card
   ================================================================= */
.mcx-filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; min-width: 0; }
.mcx-filter-toggle[aria-expanded="true"] { border-color: var(--wf-primary-ink); background: var(--wf-primary-soft); color: var(--wf-primary-ink); }
.mcx-filter-chev { font-size: 11px; opacity: .7; }
.mcx-filter-summary { min-width: 0; overflow: hidden; color: var(--theme-text-muted); font-size: 12.5px; white-space: nowrap; text-overflow: ellipsis; }
.mcx-scope-select { width: auto; max-width: 15rem; }
.mcx-filters { gap: 12px; padding: 14px 16px; overflow: visible; }
.mcx-filters-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.mcx-filters-actions { display: flex; gap: 8px; margin-left: auto; }
.mcx-scopes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--wf-line); color: var(--theme-text-muted); font-size: 12.5px; }
.mcx-scopes-label { font-weight: 600; }
.mcx-scope-name { width: auto; max-width: 13rem; }

/* A field: its label above it (3.11). */
.mcx-field { display: flex; flex-direction: column; gap: 4px; min-width: 9rem; margin: 0; }
.mcx-field.is-grow { flex: 1 1 13rem; }
.mcx-field > .form-label { margin: 0; }
.mcx-field > .form-text { margin: 2px 0 0; }
.mcx-field-short { max-width: 10rem; }
.mcx-field-action { display: flex; align-items: flex-end; }
.mcx-form-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.mcx-check { display: inline-flex; align-items: center; gap: 8px; min-height: 30px; margin: 0; color: var(--theme-text); font-size: 13px; cursor: pointer; }
.mcx-check > .form-check-input { margin: 0; }
.mcx-inline { display: flex; gap: 6px; min-width: 0; }
.mcx-inline > .form-control,
.mcx-inline > .form-select { flex: 1 1 auto; min-width: 0; }

/* =================================================================
   THE NUMBERS - one divided card of the shared KPI tile, then the
   messages over time beside the busiest people
   ================================================================= */
.mcx-pulse { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
/* Six tiles: one row of six, two rows of three, three rows of two - never a dangling tile. */
.mcx-numbers { grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 0; }
.mcx-numbers.is-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* The busiest people: two lines a row (the name and its count, the bar under them) - a long name never squeezes the bar. */
.mcx-bars .wf-hbar-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label value" "track track"; row-gap: 6px; padding: 9px 0; }
.mcx-bars .wf-hbar-label { grid-area: label; }
.mcx-bars .wf-hbar-value { grid-area: value; }
.mcx-bars .wf-hbar-track { grid-area: track; }
.mcx-bars .wf-hbar-label > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.mcx-capped { display: flex; align-items: center; gap: 6px; margin: -6px 0 0; color: var(--theme-text-muted); font-size: 12.5px; }
.mcx-pair { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.mcx-pair.is-single { grid-template-columns: minmax(0, 1fr); }
.mcx-panel { min-width: 0; overflow: visible; }
.mcx-panel-head { display: flex; align-items: flex-start; gap: 10px; padding: 16px 20px 0; }
.mcx-panel-head.is-compact { align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--wf-line); }
.mcx-panel-words { flex: 1 1 auto; min-width: 0; }
.mcx-panel-title { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--theme-text-emphasis); font-size: var(--wf-text-h3); font-weight: 650; }
.mcx-panel-head.is-compact .mcx-panel-title { flex: 0 1 auto; min-width: 0; font-size: 14px; }
.mcx-panel-title > .bi { color: var(--wf-primary-ink); font-size: 14px; }
.mcx-panel-sub { margin: 2px 0 0; color: var(--theme-text-muted); font-size: 12.5px; }
.mcx-panel-empty { margin: 0; padding: 14px 16px; color: var(--theme-text-muted); font-size: 13px; }
.mcx-chart { padding: 8px 20px 18px; }
.mcx-bars { padding: 10px 20px 16px; }
/* SEEN AS A NUMBER - the "Delivered and seen" card: the server's count of every message in the window, by group. */
.mcx-seen .mcx-capped { margin: 0; padding: 4px 20px 16px; }
.mcx-seen-group { flex: 0 0 auto; width: auto; min-width: 150px; }
.mcx-seen-scroll { margin: 8px 20px 4px; }
.mcx-seen-table .is-num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.mcx-seen-table .mcx-muted { color: var(--theme-text-muted); }
.mcx-seen-name { display: block; overflow-wrap: anywhere; }
.mcx-seen-sub { display: block; color: var(--theme-text-muted); font-size: 12px; font-weight: 400; }
/* PARTIAL, SAID (decision A12): an RCS seen count or read rate is a floor - the mark beside the rate, and the note under the card. */
.mcx-seen-partial { display: inline-flex; align-items: center; height: 18px; margin-left: 6px; padding: 0 7px; border-radius: var(--wf-radius-pill); background: var(--wf-warning-soft); color: var(--wf-warning-ink); font-size: 11px; font-weight: 600; white-space: nowrap; vertical-align: 1px; }
.mcx-seen-partial-note .mcx-seen-partial { margin: 0 2px 0 0; }
.mcx-seen-partial-tile { margin-left: 0; }
.mcx-skel-tile { height: 64px; }
.mcx-skel-chart { height: 180px; margin: 16px; }
.mcx-skel-row { display: flex; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--wf-line); }
.mcx-skel-rows { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; }
.mcx-skel-card { height: 72px; margin: 8px; }

/* A read that failed: a calm card and Try again - never "no messages". */
.mcx-failed { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px 14px; padding: 16px 18px; }
.mcx-failed-text { flex: 1 1 18rem; min-width: 0; margin: 0; color: var(--theme-text-secondary); font-size: 13.5px; }
.mcx-inline-failed { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; padding: 10px 16px; color: var(--theme-text-secondary); font-size: 13px; }
.mcx-empty-card { padding: 12px 0; overflow: visible; }

/* =================================================================
   ACTIVITY - the people, every message, a message's details
   ================================================================= */
.mcx-activity { display: grid; grid-template-columns: minmax(14rem, 17rem) minmax(0, 1fr); gap: 16px; align-items: start; min-width: 0; }
.mcx-activity.has-detail { grid-template-columns: minmax(14rem, 16rem) minmax(0, 1fr) minmax(17rem, 21rem); }
.mcx-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.mcx-people,
.mcx-threads,
.mcx-events,
.mcx-detail { min-width: 0; overflow: visible; }
.mcx-people-list { display: flex; flex-direction: column; max-height: 26rem; overflow-y: auto; padding: 6px; }
.mcx-person {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    min-width: 0;
    padding: 9px 10px;
    border: 0;
    border-radius: var(--wf-radius-sm);
    background: transparent;
    color: var(--theme-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.mcx-person:hover { background: var(--wf-card-hover); }
.mcx-person.is-selected { background: var(--wf-primary-soft); box-shadow: inset 3px 0 0 var(--wf-primary-ink); }
.mcx-person:focus-visible { outline: 2px solid var(--wf-primary-ink); outline-offset: -2px; }
.mcx-person-name { display: block; min-width: 0; overflow: hidden; color: var(--theme-text-emphasis); font-size: 13px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.mcx-person-address { min-width: 0; overflow: hidden; color: var(--theme-text-muted); font-family: var(--theme-font-mono); font-size: 11.5px; white-space: nowrap; text-overflow: ellipsis; }
.mcx-person-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--theme-text-muted); font-size: 12px; }
.mcx-threads-list { max-height: 40vh; overflow-y: auto; padding: 8px; }
.mcx-view-seg { flex: none; }
.mcx-view-seg > button { display: inline-flex; align-items: center; gap: 5px; }
.mcx-phone-well { padding: 16px; }

/* THE TABLES (3.10): one card each, the header sticky inside the card's own scroller, sentence case, hairline rows,
   no zebra; selected = primary soft. */
.mcx-table-scroll { min-width: 0; overflow: auto; border-radius: 0 0 var(--wf-radius-md) var(--wf-radius-md); }
.mcx-table-scroll.is-tall { max-height: max(22rem, calc(100vh - 14rem)); }
.mcx-table { width: 100%; border-collapse: separate; border-spacing: 0; color: var(--theme-text); font-size: 13px; }
.mcx-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 9px 12px;
    border-bottom: 1px solid var(--wf-line);
    background: var(--wf-card);
    color: var(--theme-text-muted);
    font-size: 12.5px;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
}
.mcx-table td { padding: 10px 12px; border-bottom: 1px solid var(--wf-line); background: var(--wf-card); vertical-align: middle; white-space: nowrap; }
.mcx-table tbody tr:last-child td { border-bottom: 0; }
.mcx-table tbody tr:hover td { background: var(--wf-card-hover); }
.mcx-table tbody tr.is-selected td { background: var(--wf-primary-soft); }
.mcx-table tbody tr.is-off td { color: var(--theme-text-muted); }
.mcx-table .is-num { font-variant-numeric: tabular-nums; text-align: right; }
.mcx-table td.is-num { color: var(--theme-text-emphasis); font-weight: 600; }
.mcx-events-table tbody tr { cursor: pointer; }
.mcx-events-table tbody tr:focus-visible { outline: 2px solid var(--wf-primary-ink); outline-offset: -2px; }
.mcx-cell-title { min-width: 9rem; }
.mcx-cell-title > .mcx-person-name,
.mcx-cell-title > .mcx-sub { max-width: 16rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
/* A row's tags (Default, the provider application) on their own wrapping line under a cut-short name - never hidden by it. */
.mcx-cell-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.mcx-cell-text { max-width: 22rem; overflow: hidden; text-overflow: ellipsis; }
.mcx-cell-token { color: var(--theme-text-muted); font-family: var(--theme-font-mono); font-size: 11.5px; }
.mcx-col-actions { width: 1%; }
.mcx-cell-actions { width: 1%; }
.mcx-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.mcx-actions.is-words { gap: 6px; }
.mcx-url { max-width: 26rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.mcx-confirm-text { color: var(--theme-text-secondary); font-size: 12.5px; white-space: nowrap; }
.mcx-outcome-row td { white-space: normal; }
.mcx-outcome-text { margin-left: 8px; color: var(--theme-text-secondary); font-size: 12.5px; }

/* A message's details. */
.mcx-detail { padding-bottom: 16px; }
.mcx-facts { display: grid; grid-template-columns: minmax(6.5rem, max-content) minmax(0, 1fr); gap: 6px 14px; margin: 0; padding: 14px 16px 6px; font-size: 13px; }
.mcx-facts > dt { margin: 0; color: var(--theme-text-muted); font-weight: 600; }
.mcx-facts > dd { min-width: 0; margin: 0; color: var(--theme-text); overflow-wrap: anywhere; }
.mcx-facts > dd.is-code { font-family: var(--theme-font-mono); font-size: 12px; }
.mcx-detail-label { display: flex; align-items: center; gap: 6px; margin: 12px 16px 4px; color: var(--theme-text-emphasis); font-size: 12.5px; font-weight: 650; }
.mcx-detail-text { margin: 0 16px; color: var(--theme-text); font-size: 13px; overflow-wrap: anywhere; }
.mcx-detail-row { display: flex; align-items: center; justify-content: space-between; margin: 0 8px 0 0; }
.mcx-pre {
    max-height: 30vh;
    margin: 4px 16px 0;
    padding: 8px 10px;
    overflow: auto;
    border-radius: var(--wf-radius-sm);
    background: var(--wf-inset);
    color: var(--theme-text);
    font-size: 11.5px;
    white-space: pre-wrap;
    word-break: break-word;
}
.mcx-details { margin: 12px 16px 0; font-size: 12.5px; }
.mcx-details > summary { color: var(--theme-text-emphasis); font-weight: 650; cursor: pointer; }
.mcx-details > .mcx-pre { margin: 6px 0 0; }

/* =================================================================
   TEST CENTER - replay a conversation, send a test message beside a
   live phone
   ================================================================= */
.mcx-replay { overflow: visible; }
.mcx-replay-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    width: 100%;
    padding: 12px 16px;
    border: 0;
    border-radius: var(--wf-radius-md);
    background: transparent;
    color: var(--theme-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.mcx-replay-head:hover { background: var(--wf-card-hover); }
.mcx-replay-head:focus-visible { outline: 2px solid var(--wf-primary-ink); outline-offset: -2px; }
.mcx-replay-chev { color: var(--theme-text-muted); font-size: 12px; }
.mcx-replay-ic { color: var(--wf-primary-ink); }
.mcx-replay-title { color: var(--theme-text-emphasis); font-size: 14px; font-weight: 650; }
.mcx-replay-hint { color: var(--theme-text-muted); font-size: 12.5px; }
.mcx-replay-body { display: flex; flex-direction: column; gap: 12px; padding: 4px 16px 16px; border-top: 1px solid var(--wf-line); }
.mcx-replay-body > .mcx-form-row:first-child { padding-top: 12px; }
.mcx-steps { display: flex; flex-direction: column; gap: 6px; }
.mcx-steps-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: var(--theme-text-muted); font-size: 12.5px; }
.mcx-steps-list { display: flex; flex-direction: column; max-height: 18rem; margin: 0; padding: 0; overflow-y: auto; list-style: none; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-sm); }
.mcx-step { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 4px 6px 4px 10px; border-bottom: 1px solid var(--wf-line); font-size: 13px; }
.mcx-step:last-child { border-bottom: 0; }
.mcx-step-check { display: inline-grid; place-items: center; margin: 0; cursor: pointer; }
.mcx-step-check > .form-check-input { margin: 0; }
.mcx-step-time { flex: none; color: var(--theme-text-muted); font-variant-numeric: tabular-nums; }
.mcx-step-text { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.mcx-test { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.mcx-send { overflow: visible; }
.mcx-send-body { display: flex; flex-direction: column; gap: 14px; padding: 16px 20px 20px; }
.mcx-skin { flex-wrap: wrap; }
.mcx-skin > button { display: inline-flex; align-items: center; gap: 5px; }
.mcx-rows { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.mcx-rows > legend { float: none; margin: 0 0 2px; padding: 0; }
.mcx-rows > .form-text { margin: 0; }
.mcx-rows > .btn { align-self: flex-start; }
.mcx-optrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.mcx-optrow > .form-control { flex: 1 1 8rem; min-width: 0; }
.mcx-optrow > .mcx-opt-id { flex: 0 1 6.5rem; }
.mcx-optrow.is-four > .form-control { flex-basis: 7rem; }
.mcx-subcard { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-sm); background: var(--wf-card); }
.mcx-asset { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 4px 4px 4px 10px; border: 1px solid var(--wf-line-strong); border-radius: var(--wf-radius-sm); }
.mcx-asset > .bi { color: var(--theme-text-muted); }
.mcx-asset-name { flex: 1 1 auto; min-width: 0; overflow: hidden; font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
.mcx-send-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.mcx-send-actions > .form-text { margin: 0; }
/* PREVIEW A START CARD (the card sets lane): under the send form - a saved set's card drawn on the phone, nothing sent. */
.mcx-preview-card { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--wf-line); }
.mcx-preview-card-title { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--theme-text-emphasis); font-size: 14px; font-weight: 600; }
.mcx-preview-card-title > .bi { color: var(--wf-primary-ink); }
.mcx-result { display: flex; flex-direction: column; gap: 4px; padding: 10px 14px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-md); font-size: 13px; }
.mcx-result > p { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; overflow-wrap: anywhere; }
.mcx-result.is-ok { background: var(--wf-success-soft); }
.mcx-result.is-ok > p > .bi { color: var(--wf-success-ink); }
.mcx-result.is-error { border-color: color-mix(in srgb, var(--wf-danger-ink) 25%, var(--wf-line)); background: var(--wf-danger-soft); }
.mcx-result.is-error > p > .bi { color: var(--wf-danger-ink); }
.mcx-result-sub { color: var(--theme-text-secondary); font-size: 12.5px; }
.mcx-result .wf-codechip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.mcx-phone-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.mcx-phone-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.mcx-phone-with { min-width: 0; color: var(--theme-text-muted); font-size: 13px; overflow-wrap: anywhere; }
.mcx-phone-with > b { color: var(--theme-text-emphasis); font-weight: 650; }
.mcx-phone-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.mcx-switch { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--theme-text); font-size: 13px; cursor: pointer; }
.mcx-switch > .form-check-input { margin: 0; }
.mcx-switch > span { display: inline-flex; align-items: center; gap: 5px; }

/* =================================================================
   TURNS - grouped by person, then the kept-turn cards
   ================================================================= */
.mcx-groups { display: flex; flex-direction: column; gap: 14px; }
.mcx-group { overflow: visible; }
.mcx-group-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px 16px; border-bottom: 1px solid var(--wf-line); }
.mcx-group-ic { width: 30px; height: 30px; font-size: 14px; }
.mcx-group-who { display: flex; flex-direction: column; min-width: 0; max-width: 100%; }
.mcx-group-name { min-width: 0; overflow: hidden; color: var(--theme-text-emphasis); font-size: 14px; font-weight: 650; white-space: nowrap; text-overflow: ellipsis; }
.mcx-group-address { max-width: 22rem; overflow: hidden; color: var(--theme-text-muted); font-family: var(--theme-font-mono); font-size: 11.5px; white-space: nowrap; text-overflow: ellipsis; }
.mcx-pin { color: var(--wf-primary-ink); }
.mcx-group-meta { margin-left: auto; color: var(--theme-text-muted); font-size: 12.5px; }
.mcx-pager { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--theme-text-secondary); font-size: 13px; }

/* THE KEPT-TURN CARD (MessageTurnCard): flush inside its group; a head that opens a two-pane workspace. */
.mtc-card { border-bottom: 1px solid var(--wf-line); }
.mtc-card:last-child { border-bottom: 0; }
.mcx-threads-list .mtc-card { margin-bottom: 8px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-sm); }
.mtc-head {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    padding: 12px 16px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.mtc-head:hover { background: var(--wf-card-hover); }
.mtc-head:focus-visible { outline: 2px solid var(--wf-primary-ink); outline-offset: -2px; }
.mtc-head-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; }
.mtc-chev { color: var(--theme-text-muted); font-size: 12px; }
.mtc-pin { color: var(--wf-primary-ink); }
.mtc-title { min-width: 0; overflow: hidden; color: var(--theme-text-emphasis); font-size: 13.5px; font-weight: 650; white-space: nowrap; text-overflow: ellipsis; }
.mtc-head-top > .mcx-state { margin-left: auto; }
.mtc-who { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--theme-text-muted); font-size: 12px; }
.mtc-who > span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; overflow-wrap: anywhere; }
.mtc-who-name { color: var(--theme-text-emphasis); font-weight: 600; }
.mtc-insights { display: flex; flex-wrap: wrap; gap: 6px; }
.mtc-workspace { display: flex; flex-direction: column; gap: 16px; padding: 12px 16px 16px; border-top: 1px solid var(--wf-line); }
.mtc-nav,
.mtc-detail { min-width: 0; }
.mtc-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 8px; }
.mtc-bar > .btn[aria-pressed="true"] { border-color: var(--wf-primary-ink); background: var(--wf-primary-soft); color: var(--wf-primary-ink); }
.mtc-label { color: var(--theme-text-emphasis); font-size: 12.5px; font-weight: 650; }
.mtc-muted { margin: 0 0 8px; color: var(--theme-text-muted); font-size: 12.5px; }
.mtc-stepper { display: inline-flex; align-items: center; gap: 4px; }
.mtc-stepper-pos { color: var(--theme-text-secondary); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.mtc-skel { height: 96px; }
.mtc-chain { display: flex; flex-direction: column; max-height: 28vh; margin: 0 0 8px 6px; padding: 0 0 0 0; overflow-y: auto; list-style: none; border-left: 2px solid var(--wf-line); }
.mtc-chain-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-left: -2px;
    padding: 5px 8px;
    border: 0;
    border-radius: 0 var(--wf-radius-sm) var(--wf-radius-sm) 0;
    background: transparent;
    color: var(--theme-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.mtc-chain-item:hover { background: var(--wf-card-hover); }
.mtc-chain-item.is-active { background: var(--wf-primary-soft); box-shadow: inset 3px 0 0 var(--wf-primary-ink); }
.mtc-chain-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--wf-line-strong); }
.mtc-chain-dot.is-open { background: var(--wf-primary-ink); }
.mtc-chain-time { flex: none; min-width: 5.5rem; color: var(--theme-text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.mtc-chain-body { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; }
.mtc-chain-label { font-size: 12.5px; font-weight: 600; }
.mtc-chain-snip { overflow: hidden; color: var(--theme-text-muted); font-size: 11.5px; white-space: nowrap; text-overflow: ellipsis; }
.mtc-here { flex: none; color: var(--wf-primary-ink); font-size: 11.5px; font-weight: 650; }
.mtc-convo { display: flex; flex-direction: column; max-height: 40vh; padding: 4px; overflow-y: auto; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-sm); background: var(--wf-card); }
.mtc-convo-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
    padding: 6px 8px;
    border: 0;
    border-radius: var(--wf-radius-xs);
    background: transparent;
    color: var(--theme-text);
    font: inherit;
    font-size: 12.5px;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
}
.mtc-convo-row + .mtc-convo-row { border-top: 1px solid var(--wf-line); }
.mtc-convo-row:hover { background: var(--wf-card-hover); }
.mtc-convo-row.is-active { background: var(--wf-primary-soft); }
.mtc-convo-time { flex: none; color: var(--theme-text-muted); font-variant-numeric: tabular-nums; }
.mtc-convo-type { flex: none; min-width: 5rem; color: var(--theme-text-secondary); }
.mtc-convo-text { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mtc-convo-text.is-wrap { white-space: normal; overflow-wrap: anywhere; }
.mtc-role { flex: none; min-width: 4rem; justify-content: center; }
.mtc-detail-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.mtc-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; color: var(--theme-text-muted); font-size: 12.5px; }
.mtc-detail .mcx-facts { padding: 8px 0 4px; }
.mtc-detail .mcx-detail-label { margin: 10px 0 4px; }
.mtc-detail .mcx-detail-text { margin: 0 0 4px; }
/* The JSON explorer's raw fallback (JsonBlock - shared with the Action Center). */
.mtc-pre {
    max-height: 24vh;
    margin-bottom: 8px;
    padding: 6px 8px;
    overflow-y: auto;
    border: 1px solid var(--wf-line);
    border-radius: var(--wf-radius-sm);
    background: var(--wf-inset);
    font-size: 11.5px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* =================================================================
   QUEUES & THREADS, PACKS - cards of tables, the catalog as rows
   ================================================================= */
.mcx-avail { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.mcx-avail-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 16px; border-bottom: 1px solid var(--wf-line); }
.mcx-avail-row:last-child { border-bottom: 0; }
.mcx-avail-words { flex: 1 1 16rem; min-width: 0; }

/* =================================================================
   OVERVIEW - the areas, then cleanup & retention and the Playground
   ================================================================= */
.mcx-overview { display: flex; flex-direction: column; gap: 16px; }
.mcx-overview .mci-title > .bi { margin-right: 6px; }
.mcx-overview > .mci-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mcx-overview-more { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.mcx-cleanup { flex-direction: row; gap: 14px; padding: 18px 20px; }
.mcx-cleanup-words { display: flex; flex: 1 1 auto; flex-direction: column; gap: 4px; min-width: 0; }
.mcx-cleanup-title { margin: 0; color: var(--theme-text-emphasis); font-size: var(--wf-text-h3); font-weight: 650; }
.mcx-cleanup-sub { margin: 0; color: var(--theme-text-secondary); font-size: 13px; }
.mcx-cleanup-hint { margin: 4px 0 0; color: var(--theme-text-muted); font-size: 12.5px; }
.mcx-cleanup-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.mcx-play { flex-direction: row; align-items: center; gap: 14px; padding: 18px 20px; color: inherit; text-decoration: none; }
.mcx-play:hover { text-decoration: none; }
.mcx-play-words { display: flex; flex: 1 1 auto; flex-direction: column; gap: 2px; min-width: 0; }
.mcx-play-title { color: var(--theme-text-emphasis); font-size: 14px; font-weight: 650; }
.mcx-play-sub { color: var(--theme-text-secondary); font-size: 13px; }
.mcx-play-go { color: var(--wf-primary-ink); }
/* The Overview's second column: the Playground and "Try a conversation", one over the other. */
.mcx-play-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.mcx-play-stack > .mcx-play { flex: 1 1 auto; }

/* =================================================================
   THE MENUS, THE DIALOGS
   ================================================================= */
/* A right-click menu (MessageMenu): at the click, on the float surface, clamped inside the window. */
.mcx-menu-backdrop { position: fixed; inset: 0; z-index: 1085; }
.mcx-menu {
    position: fixed;
    z-index: 1086;
    left: clamp(8px, var(--mcx-menu-x, 8px), calc(100vw - 16rem - 8px));
    top: clamp(8px, var(--mcx-menu-y, 8px), calc(100vh - 20rem));
    display: flex;
    flex-direction: column;
    width: 16rem;
    max-width: calc(100vw - 16px);
    padding: 6px;
    border: 1px solid var(--wf-line);
    border-radius: var(--wf-radius-lg);
    background: var(--theme-background-float);
    box-shadow: var(--wf-elev-3);
    animation: mcx-rise 120ms var(--wf-ease);
}
.mcx-menu-head { margin: 2px 6px 6px; overflow: hidden; color: var(--theme-text-muted); font-size: 12px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.mcx-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 34px;
    padding: 0 10px;
    border: 0;
    border-radius: var(--wf-radius-sm);
    background: transparent;
    color: var(--theme-text);
    font: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}
.mcx-menu-item > .bi { width: 16px; color: var(--theme-text-muted); }
.mcx-menu-item:hover,
.mcx-menu-item:focus-visible { background: var(--wf-card-hover); outline: none; }
.mcx-menu-item.is-danger,
.mcx-menu-item.is-danger > .bi { color: var(--wf-danger-ink); }
.mcx-menu-divider { height: 1px; margin: 4px 6px; background: var(--wf-line); }
@keyframes mcx-rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* A dialog over the ONE scrim. */
.mcx-scrim { position: fixed; inset: 0; z-index: 1080; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--wf-scrim); backdrop-filter: blur(3px); }
.mcx-dialog {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(32rem, 100%);
    max-height: calc(100vh - 32px);
    padding: 20px;
    overflow-y: auto;
    border-radius: var(--wf-radius-xl);
    background: var(--theme-background-float);
    color: var(--theme-text);
    box-shadow: var(--wf-elev-3);
}
.mcx-dialog.is-wide { width: min(36rem, 100%); padding: 16px 0 20px; }
.mcx-dialog.is-wide > .mcx-dialog-head { padding: 0 12px 0 20px; }
.mcx-dialog.is-wide .mcx-facts { padding: 4px 20px; }
.mcx-dialog.is-wide .mcx-detail-label { margin-left: 20px; margin-right: 20px; }
.mcx-dialog.is-wide .mcx-detail-text { margin: 0 20px; }
.mcx-dialog.is-wide .mcx-pre { margin: 4px 20px 0; }
.mcx-dialog.is-wide .mcx-detail-row { margin-right: 12px; }
.mcx-dialog-head { display: flex; align-items: center; gap: 4px; }
.mcx-dialog-head > .mcx-dialog-title { flex: 1 1 auto; }
.mcx-dialog-title { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--theme-text-emphasis); font-size: var(--wf-text-h3); font-weight: 650; }
.mcx-dialog-title.is-danger,
.mcx-dialog-title.is-danger > .bi { color: var(--wf-danger-ink); }
.mcx-dialog-text { margin: 0; color: var(--theme-text-secondary); font-size: 13px; }
.mcx-purge-list { display: flex; flex-direction: column; gap: 2px; margin: 0; padding-left: 18px; font-size: 13px; }
.mcx-purge-list b { color: var(--theme-text-emphasis); font-variant-numeric: tabular-nums; }
.mcx-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.mcx-modal { z-index: 1070; background: var(--wf-scrim); backdrop-filter: blur(3px); }
.mcx-modal .modal-title { font-size: var(--wf-text-h3); font-weight: 650; }
.mcx-modal .modal-body { display: flex; flex-direction: column; gap: 14px; }

/* ---- Small hooks on the center's controls ---- */
.mcx-cell-when { font-variant-numeric: tabular-nums; }
.mcx-export,
.mcx-group-replay,
.mtc-view { flex: none; }
.mcx-export-list { min-width: 11rem; }
.mcx-field .is-optional { color: var(--theme-text-muted); font-weight: 400; }
/* Code in this family reads at full ink: app.css paints every <code> in the accent, which falls to 2:1 on a light-accent
   brand (HelloFresh's orange) - an identifier is text, not a state. */
.mcx-page code { color: var(--theme-text-emphasis); }

/* =================================================================
   MESSAGING CHANNELS (/ops/tenant/{id}/messaging) - Settings
   ================================================================= */
/* The senders take the page's whole width; the add / edit form is a drawer (below), so nothing sits beside the table. */
.mcx-ch { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; min-width: 0; }
/* The inbound check's note wraps inside its column instead of stretching the table sideways. */
.mcx-cell-note { min-width: 14rem; max-width: 26rem; white-space: normal; }

/* THE FORM DRAWER - slides in from the right on the float surface over the one scrim (the Answer Center's run drawer is
   the precedent). Its body scrolls; the Save footer never does. Full width on a phone. */
.mcx-drawer-backdrop { position: fixed; inset: 0; z-index: 1040; background: var(--wf-scrim); animation: mcx-fade 160ms ease-out; }
.mcx-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1041;
    display: flex;
    flex-direction: column;
    width: min(32rem, 100vw);
    border-left: 1px solid var(--wf-line);
    background: var(--theme-background-float);
    box-shadow: var(--wf-elev-3);
    animation: mcx-slide var(--wf-motion-panel);
}
.mcx-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--wf-line); }
.mcx-drawer-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.mcx-drawer-body > .mcx-note { margin: 14px 20px 0; }
.mcx-drawer-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--wf-line); }
@keyframes mcx-slide { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes mcx-fade { from { opacity: 0; } to { opacity: 1; } }
.mcx-inherit { flex-direction: row; align-items: flex-start; gap: 14px; padding: 16px 18px; }
.mcx-inherit-words { display: flex; flex: 1 1 auto; flex-direction: column; gap: 8px; min-width: 0; }
.mcx-inherit-text { margin: 0; color: var(--theme-text-secondary); font-size: 13px; }
.mcx-inherit-list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.mcx-inherit-list > .mcx-tag { max-width: 100%; height: auto; min-height: 22px; white-space: normal; overflow-wrap: anywhere; }
.mcx-inherit-label { color: var(--theme-text-muted); font-size: 12.5px; font-weight: 600; }
.mcx-inherit-warn { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--wf-warning-ink); font-size: 13px; font-weight: 600; }
.mcx-tag-warn { margin-left: 2px; color: var(--wf-warning-ink); white-space: nowrap; }
.mcx-tag.is-small { height: 20px; padding: 0 6px; font-size: 11px; }
.mcx-muted-word { color: var(--theme-text-muted); }
.mcx-verify { display: flex; flex-direction: column; gap: 12px; min-width: 0; margin: 0; padding: 12px 14px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-md); }
.mcx-verify-title { display: flex; align-items: center; gap: 6px; float: left; width: 100%; margin: 0; padding: 0; color: var(--theme-text-emphasis); font-size: 13px; font-weight: 650; }
.mcx-verify-title > .bi { color: var(--wf-primary-ink); }
.mcx-verify > .form-text { margin: 0; }
.mcx-verify:disabled { opacity: .7; }
.mcx-match { flex-wrap: wrap; align-items: center; color: var(--theme-text-secondary); font-size: 13px; }
.mcx-match > .mcx-match-select { flex: 0 0 auto; width: auto; min-width: 0; }
.mcx-optrow > .mcx-rule-field { flex: 1 1 9rem; }
.mcx-optrow > .mcx-rule-op { flex: 0 1 8rem; }
.mcx-filter-tools { flex-wrap: wrap; align-items: center; }
.mcx-filter-tools > .form-text { margin: 0; }
.mcx-code-input { font-family: var(--theme-font-mono); font-size: 12px; }
.mcx-cell-error { max-width: 18rem; color: var(--wf-danger-ink); white-space: normal; overflow-wrap: anywhere; }
.mcx-dialog.is-log { width: min(64rem, 100%); }
.mcx-table-scroll.is-boxed { max-height: 50vh; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-md); }
.mcx-pre.is-flush { margin: 4px 0 0; }
.mcx-inline-failed.is-flush { padding: 0; }
.mcx-dialog-actions.is-spread { flex-wrap: wrap; align-items: center; justify-content: space-between; }
.mcx-dialog-actions.is-spread > .mcx-inline { flex-wrap: wrap; }
.mcx-dialog .mcx-url { max-width: 100%; }

/* =================================================================
   THE MESSAGING PLAYGROUND (/ops/messaging-playground) - a teaching page
   ================================================================= */
.mcx-facts-strip { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; color: var(--theme-text-secondary); font-size: 12.5px; }
.mcx-facts-strip > span { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 5px; min-width: 0; }
.mcx-facts-strip .bi { color: var(--wf-primary-ink); }
.mcx-facts-strip .wf-codechip { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.mcx-play-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; align-items: start; }
.mcx-play-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.mcx-play-out { min-width: 0; overflow: hidden; }
.mcx-rungs { display: flex; flex-direction: column; padding: 8px; }
.mcx-rung {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding: 10px;
    border: 0;
    border-radius: var(--wf-radius-sm);
    background: transparent;
    color: var(--theme-text);
    text-align: left;
    cursor: pointer;
}
.mcx-rung:hover:not(:disabled) { background: var(--wf-card-hover); }
.mcx-rung:focus-visible { outline: 2px solid var(--wf-primary-ink); outline-offset: -2px; }
.mcx-rung:disabled { opacity: .55; cursor: default; }
.mcx-rung > .wf-tile-ic { flex: none; width: 32px; height: 32px; font-size: 15px; }
.mcx-rung-words { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mcx-rung-title { color: var(--theme-text-emphasis); font-size: 13.5px; font-weight: 650; }
.mcx-rung-sub { color: var(--theme-text-secondary); font-size: 12.5px; }
.mcx-log {
    height: min(30rem, 60vh);
    padding: 10px 14px;
    overflow-y: auto;
    background: var(--wf-inset);
    color: var(--theme-text);
    font-family: var(--theme-font-mono);
    font-size: 12px;
    line-height: 1.5;
}
.mcx-log > div { white-space: pre-wrap; overflow-wrap: anywhere; }
.mcx-log-empty { margin: 0; color: var(--theme-text-muted); }
.mcx-code {
    max-height: 28rem;
    margin: 0;
    padding: 14px 16px;
    overflow: auto;
    border-radius: 0 0 var(--wf-radius-md) var(--wf-radius-md);
    background: var(--wf-inset);
    color: var(--theme-text);
    font-family: var(--theme-font-mono);
    font-size: 12px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* =================================================================
   MESSAGING > CONSENT (/messaging/consent) - csn-*, folded in from
   MessagingConsent.razor.css; its Quiet hours card qh-*, from
   ConsentQuietHoursCard.razor.css. The table is the center's stacked
   table (mcx-table): one card per address under 760px of page.
   ================================================================= */
.csn-page { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.csn-page > .wf-page-header { margin-bottom: 4px; }
.csn-rules { padding: 14px 18px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-lg); background: var(--wf-neutral-soft); box-shadow: none; }
.csn-rules-title { margin: 0 0 6px; color: var(--theme-text-emphasis); font-size: 13px; font-weight: 650; }
.csn-rules-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; color: var(--theme-text-secondary); font-size: 13px; }
.csn-rules-list li { display: flex; align-items: baseline; gap: 8px; }
.csn-rules-list i { color: var(--wf-primary-ink); }
.csn-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.csn-search { flex: 1 1 16rem; min-width: 0; }
.csn-select { flex: 0 1 12rem; width: auto; min-width: 0; }
.csn-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; min-width: 0; }
.csn-body.has-history { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.csn-card { min-width: 0; overflow: visible; }
.csn-table td { white-space: normal; }
.csn-table td.csn-address { min-width: 10rem; max-width: 22rem; color: var(--theme-text-emphasis); font-weight: 600; white-space: normal; overflow-wrap: anywhere; }
.csn-row { cursor: pointer; }
.csn-row:focus-visible { outline: 2px solid var(--wf-primary-ink); outline-offset: -2px; }
.csn-address { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.csn-col-source,
.csn-col-updated { color: var(--theme-text-secondary); }
.csn-col-updated { font-variant-numeric: tabular-nums; }
.csn-more { display: flex; justify-content: center; padding: 8px; border-top: 1px solid var(--wf-line); }
.csn-history { min-width: 0; padding: 16px 18px; }
.csn-history-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.csn-history-title { margin: 0; color: var(--theme-text-emphasis); font-size: 15px; font-weight: 650; }
.csn-history-sub,
.csn-history-note,
.csn-history-empty { margin: 2px 0 0; color: var(--theme-text-secondary); font-size: 13px; overflow-wrap: anywhere; }
.csn-history-note { margin: 8px 0 12px; }
.csn-timeline { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.csn-event { display: flex; align-items: flex-start; gap: 10px; }
.csn-event-body { min-width: 0; }
.csn-event-dot { flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--wf-success-ink); }
.csn-event-dot.is-out { background: var(--wf-warning-ink); }
.csn-event-dot.is-quiet { background: var(--theme-text-muted); }
.csn-event-text { color: var(--theme-text); font-size: 13px; overflow-wrap: anywhere; }
.csn-event-when { color: var(--theme-text-muted); font-size: 12px; }
/* THE UNVERIFIED MARK (the consent gate's shared-sender follow-up): beside a fact's status, at the top of its history and
   under each event whose delivery the inbound check could not verify. Quiet, never alarming - the opt-out is honoured. */
.csn-mark { margin-left: 6px; }
.csn-history-mark { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 12px; color: var(--theme-text-secondary); font-size: 13px; }
.csn-event-mark { color: var(--theme-text-secondary); font-size: 12px; }
/* WHAT ANOTHER SYSTEM TOLD US (C2a): the attested revocation's own account, above the timeline - who said so, where it
   reached the team, when the person said it (and when we heard, which is rarely the same) and their own words. Quiet,
   like the mark above it: the opt-out is honoured; only the evidence behind it is weaker. */
.csn-attest { margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-md); background: var(--wf-neutral-soft); }
.csn-attest-title { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--theme-text-emphasis); font-size: 13px; font-weight: 650; }
.csn-attest-lead { margin: 6px 0 0; color: var(--theme-text-secondary); font-size: 12px; }
.csn-attest-grid { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 10px 0 0; font-size: 13px; }
.csn-attest-grid dt { color: var(--theme-text-muted); font-weight: 400; }
.csn-attest-grid dd { margin: 0; color: var(--theme-text); overflow-wrap: anywhere; }
.csn-attest-heard { margin-left: 6px; color: var(--theme-text-muted); font-size: 12px; }
.csn-attest-words { margin: 10px 0 0; }
.csn-attest-quote { margin: 0; padding-left: 10px; border-left: 2px solid var(--wf-line); color: var(--theme-text); font-size: 13px; font-style: italic; overflow-wrap: anywhere; }
.csn-attest-caption { margin: 4px 0 0 12px; color: var(--theme-text-muted); font-size: 12px; }
.csn-attest-ref { margin: 10px 0 0; color: var(--theme-text-muted); font-family: var(--theme-font-mono); font-size: 12px; overflow-wrap: anywhere; }
.csn-failed { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px 18px; }
.csn-failed-text { flex: 1 1 16rem; min-width: 0; margin: 0; color: var(--theme-text-secondary); }
.csn-skel { height: 12rem; margin: 16px; border-radius: var(--wf-radius-md); }
.csn-skel-small { height: 4rem; border-radius: var(--wf-radius-md); }
.csn-dialog { max-width: 32rem; }
/* The modal header paints the workspace's own colours (a primary band in some themes) - the glyph takes its text colour. */
.csn-dialog-icon { color: inherit; }
.csn-dialog fieldset { min-width: 0; padding: 0; border: 0; }
.csn-dialog legend { float: none; width: auto; padding: 0; font-size: 14px; }
.csn-dialog-hint { color: var(--theme-text-secondary); font-size: 13px; }
.csn-proposal { padding: 8px 12px; border-radius: var(--wf-radius-md); background: var(--wf-primary-soft); color: var(--wf-primary-ink); font-size: 13px; }
.csn-dialog-error { margin: 8px 0 0; color: var(--wf-danger-ink); font-size: 13px; }

/* ---- Consent's Quiet hours card ---- */
.qh-card { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; }
.qh-head { display: flex; align-items: flex-start; gap: 12px; }
.qh-ic { flex: none; }
.qh-head-text { flex: 1 1 auto; min-width: 0; }
.qh-title { margin: 0; color: var(--theme-text-emphasis); font-size: 15px; font-weight: 650; }
.qh-intro { margin: 2px 0 0; color: var(--theme-text-secondary); font-size: 13px; }
.qh-pill { flex: none; white-space: nowrap; }
.qh-zone { display: flex; align-items: baseline; gap: 8px; margin: 0; padding: 10px 12px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-md); background: var(--wf-neutral-soft); color: var(--theme-text-secondary); font-size: 13px; }
.qh-zone i { color: var(--wf-primary-ink); }
.qh-note { margin: 0; color: var(--theme-text-muted); font-size: 13px; }
.qh-skel { height: 6rem; border-radius: var(--wf-radius-md); }
.qh-skel-ro { height: 3.5rem; }
/* The values in effect, read-only - for a viewer without the settings role (the second fix round's F4). */
.qh-readonly { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 16px; margin: 0; }
.qh-ro-row { min-width: 0; padding: 8px 12px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-md); }
.qh-ro-row dt { margin: 0; color: var(--theme-text-secondary); font-size: 12px; font-weight: 500; }
.qh-ro-row dd { margin: 2px 0 0; color: var(--theme-text-emphasis); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.qh-form { display: grid; gap: 12px; }
.qh-window { min-width: 0; margin: 0; padding: 0; border: 0; }
.qh-window legend { float: none; width: auto; padding: 0; font-size: 14px; }
.qh-modes { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.qh-times { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.qh-times .form-label { margin: 0; }
.qh-time { width: auto; min-width: 7.5rem; }
.qh-caps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.qh-cap .form-control { max-width: 12rem; }
.qh-hint { margin: 4px 0 0; color: var(--theme-text-muted); font-size: 12px; }
.qh-effect { margin: 0; color: var(--theme-text); font-size: 13px; font-variant-numeric: tabular-nums; }
.qh-error { margin: 0; color: var(--wf-danger-ink); font-size: 13px; }
.qh-saved { margin: 0; color: var(--wf-success-ink); font-size: 13px; }
.qh-actions { display: flex; justify-content: flex-end; }
/* WAITING (timebox-design.md T4): the workspace's two defaults - a choice, then a number with its unit. */
.qh-wait { display: grid; gap: 12px; min-width: 0; margin: 0; padding: 12px 0 0; border: 0; border-top: 1px solid var(--wf-line); }
.qh-wait legend { float: none; width: auto; margin: 0; padding: 0; color: var(--theme-text-emphasis); font-size: 14px; font-weight: 600; }
.qh-wait-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.qh-wait-row { display: grid; gap: 4px; min-width: 0; }
.qh-wait-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.qh-wait-mode { width: auto; min-width: 12rem; max-width: 100%; }
.qh-wait-amount { width: 6rem; }
.qh-wait-unit { width: auto; }

/* =================================================================
   NARROWER PAGES (the page area is the size container - .wf-page-area)
   ================================================================= */
@container page (max-width: 1180px) {
    .mcx-activity.has-detail { grid-template-columns: minmax(14rem, 16rem) minmax(0, 1fr); }
    .mcx-activity.has-detail > .mcx-detail { grid-column: 2; }
}

@container page (max-width: 1000px) {
    .mcx-numbers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@container page (max-width: 980px) {
    .mcx-pair,
    .mcx-test,
    .mcx-overview-more,
    .mcx-ch,
    .mcx-play-grid { grid-template-columns: minmax(0, 1fr); }
    .mcx-overview > .mci-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@container page (max-width: 560px) {
    .mcx-numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mcx-numbers.is-three,
    .mcx-overview > .mci-grid { grid-template-columns: minmax(0, 1fr); }
}

@container page (max-width: 860px) {
    .mcx-activity,
    .mcx-activity.has-detail { grid-template-columns: minmax(0, 1fr); }
    .mcx-activity.has-detail > .mcx-detail { grid-column: auto; }
    .mcx-people-list { max-height: 16rem; }
    .csn-body.has-history { grid-template-columns: minmax(0, 1fr); }
    /* The attestation's labels sit above their values once two columns stop reading (a phone number or a system name
       wraps to nothing in the second column of a narrow card). */
    .csn-attest-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .csn-attest-grid dd { margin-bottom: 6px; }
}

/* THE STACKED TABLES (760px of page and narrower - below that a row of columns cannot read): each row becomes a card.
   Its title cell spans the card; every other cell is a labelled line (data-label), a wide one spans the card, an empty
   one is left out; the actions sit on their own row. The header row is hidden (visually). Nothing scrolls sideways. */
@container page (max-width: 760px) {
    .mcx-table-scroll,
    .mcx-table-scroll.is-tall { max-height: none; overflow: visible; }
    .mcx-table,
    .mcx-table > tbody { display: block; width: 100%; }
    .mcx-table > thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .mcx-table > tbody > tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px 14px;
        padding: 14px 16px;
        border-bottom: 1px solid var(--wf-line);
    }
    .mcx-table > tbody > tr:last-child { border-bottom: 0; }
    .mcx-table > tbody > tr > td { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; max-width: none; padding: 0; border: 0; background: transparent; white-space: normal; text-align: left; overflow-wrap: anywhere; }
    .mcx-table > tbody > tr > td.is-num { text-align: left; }
    .mcx-table > tbody > tr > td:empty { display: none; }
    .mcx-table > tbody > tr > td[data-label]::before { content: attr(data-label); color: var(--theme-text-muted); font-size: 11.5px; font-weight: 600; }
    .mcx-table > tbody > tr > td.mcx-cell-title,
    .mcx-table > tbody > tr > td.mcx-cell-wide,
    .mcx-table > tbody > tr > td.mcx-cell-actions { grid-column: 1 / -1; }
    .mcx-table > tbody > tr > td.mcx-cell-title { order: -1; min-width: 0; }
    .mcx-table > tbody > tr > td.mcx-cell-actions { width: auto; }
    .mcx-table > tbody > tr > td.mcx-cell-actions > .mcx-actions { justify-content: flex-start; flex-wrap: wrap; }
    .mcx-table > tbody > tr:hover > td,
    .mcx-table > tbody > tr.is-selected > td { background: transparent; }
    .mcx-table > tbody > tr:hover { background: var(--wf-card-hover); }
    .mcx-table > tbody > tr.is-selected { background: var(--wf-primary-soft); }
    .mcx-cell-text { max-width: none; }
    .mcx-url { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
}

/* THE PHONE */
@container page (max-width: 640px) {
    .mcx-filters { padding: 12px; }
    .mcx-filters-actions { width: 100%; margin-left: 0; }
    .mcx-field { flex: 1 1 100%; min-width: 0; }
    .mcx-field-short { max-width: none; }
    .mcx-scope-select { max-width: 100%; }
    .mcx-panel-head { padding: 14px 16px 0; }
    .mcx-chart { padding: 8px 16px 16px; }
    .mcx-bars { padding: 8px 16px 14px; }
    .mcx-send-body { padding: 14px 16px 16px; }
    .mcx-phone-well { padding: 12px 8px; }
    .mcx-group-meta { margin-left: 0; flex-basis: 100%; }
    .mtc-head { padding: 12px; }
    .mtc-head-top > .mcx-state { margin-left: 0; }
    .mtc-workspace { padding: 12px; }
    .mcx-cleanup,
    .mcx-play,
    .mcx-inherit,
    .csn-rules,
    .csn-history,
    .qh-card { padding: 14px 16px; }
    .mcx-log { height: min(22rem, 55vh); }
    .csn-search,
    .csn-select { flex: 1 1 100%; }
    .qh-caps,
    .qh-wait-rows,
    .qh-readonly { grid-template-columns: minmax(0, 1fr); }
    .qh-cap .form-control { max-width: none; }
    .qh-head { flex-wrap: wrap; }
    .qh-head-text { flex: 1 1 12rem; }
}

@media (min-width: 992px) {
    .mtc-workspace { flex-direction: row; align-items: flex-start; }
    .mtc-nav { flex: 1 1 56%; }
    .mtc-detail {
        position: sticky;
        top: calc(var(--wf-sticky-top) + 8px);
        flex: 1 1 44%;
        max-height: 76vh;
        padding-left: 16px;
        overflow-y: auto;
        border-left: 1px solid var(--wf-line);
    }
}

/* SHARED NUMBERS (docs/claude/AUTH.md "A SHARED PHONE MATCHES THE MOST RECENT") - the chip on a person row, the tab's
   cutoff line and warnings, one card per number (who it counts as, its holders, "This number is"). */
.mcx-shared-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: fit-content;
    height: 20px;
    padding: 0 8px;
    border-radius: var(--wf-radius-pill);
    background: var(--wf-warning-soft);
    color: var(--wf-warning-ink);
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}
.mcx-shared-cutoff,
.mcx-shared-warn { display: flex; align-items: flex-start; gap: 6px; max-width: 82ch; margin: 0; color: var(--theme-text-secondary); font-size: 13px; }
.mcx-shared-warn > .bi { color: var(--wf-warning-ink); }
.mcx-shared-list { display: flex; flex-direction: column; gap: 12px; }
.mcx-shared-number { padding-bottom: 12px; }
.mcx-shared-digits { font-family: var(--theme-font-mono); }
.mcx-shared-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 22px;
    padding: 0 9px;
    border-radius: var(--wf-radius-pill);
    background: var(--wf-primary-soft);
    color: var(--wf-primary-ink);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.mcx-shared-pill.is-stale { background: var(--wf-warning-soft); color: var(--wf-warning-ink); }
.mcx-shared-number > .mcx-shared-warn { padding: 0 16px; }
.mcx-shared-holders-title { margin: 4px 16px 6px; color: var(--theme-text-muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.mcx-shared-holders { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0 16px; list-style: none; }
.mcx-shared-holder {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    padding: 8px 10px;
    border: 1px solid var(--wf-line);
    border-radius: var(--wf-radius-md);
    background: var(--wf-card);
    font-size: 13px;
}
.mcx-shared-holder.is-bound { border-color: color-mix(in srgb, var(--wf-primary-ink) 35%, var(--wf-line)); }
.mcx-shared-holder-name { color: var(--theme-text-emphasis); font-weight: 600; }
.mcx-shared-kind,
.mcx-shared-meta { display: inline-flex; align-items: center; gap: 4px; color: var(--theme-text-muted); font-size: 12px; }
.mcx-shared-meta.is-proven { color: var(--wf-success-ink); }
.mcx-shared-now { display: inline-flex; align-items: center; gap: 4px; color: var(--wf-primary-ink); font-size: 12px; font-weight: 600; }
.mcx-shared-link { margin-left: auto; font-size: 12px; }
.mcx-shared-pick { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; padding: 12px 16px 0; }
.mcx-shared-pick .mcx-field { flex: 0 1 22rem; }
.mcx-shared-note { max-width: 82ch; margin: 10px 16px 0; color: var(--theme-text-muted); font-size: 12px; }

/* FORWARDING (docs/claude/MESSAGING.md 5o) - the tab's context line, the config cards (switches, classes, words,
   commands), the save row with its refusals, the flow (two minute-by-minute charts, the facts, the queue by status) and
   the queue table. Token-only, like everything in this family. */
.mcx-fwd-context { display: flex; align-items: flex-start; gap: 6px; max-width: 82ch; margin: 0; color: var(--theme-text-secondary); font-size: 13px; }
.mcx-fwd-context > .bi { color: var(--wf-primary-ink); }
.mcx-fwd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(22rem, 100%), 1fr)); gap: 12px; align-items: start; }
.mcx-fwd-card { padding-bottom: 14px; }
.mcx-fwd-rows { display: flex; flex-direction: column; gap: 12px; padding: 0 16px; }
.mcx-fwd-switchrow { display: flex; flex-direction: column; gap: 2px; }
.mcx-fwd-hint { max-width: 62ch; margin: 0 0 0 2px; color: var(--theme-text-muted); font-size: 12px; }
.mcx-fwd-fields { display: flex; flex-direction: column; gap: 8px; }
.mcx-fwd-fields .mcx-field { max-width: 30rem; }
.mcx-fwd-rate .form-control { max-width: 9rem; }
.mcx-fwd-link { font-size: 12px; white-space: nowrap; }
.mcx-fwd-words { display: flex; flex-direction: column; gap: 8px; padding: 0 16px; }
.mcx-fwd-word { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; padding: 8px 10px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-md); background: var(--wf-card); }
.mcx-fwd-word .mcx-field { flex: 1 1 10rem; margin: 0; }
.mcx-fwd-word-target { max-width: 10rem; }
.mcx-fwd-word-remove { flex: none; }
.mcx-fwd-cmds { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 2px 10px; padding: 0 16px; }
.mcx-fwd-cmd > code { font-size: 12.5px; }
.mcx-fwd-issues { max-width: 82ch; padding: 10px 14px; border: 1px solid color-mix(in srgb, var(--wf-warning-ink) 35%, var(--wf-line)); border-radius: var(--wf-radius-md); background: var(--wf-warning-soft); color: var(--theme-text); font-size: 13px; }
.mcx-fwd-issues-title { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; color: var(--wf-warning-ink); font-weight: 600; }
.mcx-fwd-issues ul { margin: 0; padding-left: 18px; }
.mcx-fwd-save { display: flex; justify-content: flex-start; }
.mcx-fwd-flow,
.mcx-fwd-queue { padding-bottom: 14px; }
.mcx-fwd-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.mcx-fwd-pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: var(--wf-radius-pill); background: var(--wf-neutral-soft); color: var(--theme-text-secondary); font-size: 12px; font-weight: 600; white-space: nowrap; }
.mcx-fwd-pill.is-warning { background: var(--wf-warning-soft); color: var(--wf-warning-ink); }
.mcx-fwd-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr)); gap: 12px; padding: 0 16px; }
.mcx-fwd-chart { min-width: 0; }
.mcx-fwd-chart-title { margin: 0 0 4px; color: var(--theme-text-muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.mcx-fwd-facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 12px 0 0; padding: 0 16px; }
.mcx-fwd-fact { display: flex; flex-direction: column; gap: 1px; }
.mcx-fwd-fact > dt { color: var(--theme-text-muted); font-size: 12px; font-weight: 500; }
.mcx-fwd-fact > dd { margin: 0; color: var(--theme-text-emphasis); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mcx-fwd-counts { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; padding: 0 16px; }
.mcx-fwd-count { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.mcx-fwd-count > b { color: var(--theme-text-emphasis); font-variant-numeric: tabular-nums; }
.mcx-fwd-error { display: flex; align-items: flex-start; gap: 6px; max-width: 82ch; margin: 10px 0 0; padding: 0 16px; overflow-wrap: anywhere; color: var(--theme-text-secondary); font-size: 12.5px; }
.mcx-fwd-error > .bi { color: var(--wf-danger-ink); }
.mcx-fwd-error-label { color: var(--theme-text-muted); font-weight: 600; white-space: nowrap; }
.mcx-fwd-queue-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.mcx-fwd-queue-tools .mcx-field { margin: 0; }
.mcx-fwd-items .mcx-sub { display: block; }
.mcx-fwd-cls { color: var(--theme-text-emphasis); font-weight: 600; }
.mcx-fwd-cell-error { max-width: 26ch; overflow: hidden; color: var(--theme-text-secondary); font-size: 12.5px; white-space: nowrap; text-overflow: ellipsis; }

/* A TOUCH SCREEN (portal-look-and-feel 3.17): 44px targets and 16px inputs (a smaller one makes iOS zoom on focus).
   wf.css keeps .btn-sm at 30px everywhere; in this family every small button, segmented button, field, menu item,
   row and switch is a 44px target. */
@media (pointer: coarse) {
    .mcx-page .btn-sm,
    .mcx-scrim .btn-sm,
    .mcx-modal .btn-sm,
    .csn-page .btn-sm,
    .csn-dialog .btn-sm { min-height: 44px; min-width: 44px; }
    .mcx-page .form-control,
    .mcx-page .form-select,
    .mcx-page .form-control-sm,
    .mcx-page .form-select-sm,
    .mcx-scrim .form-control,
    .mcx-modal .form-control,
    .mcx-modal .form-select,
    .csn-page .form-control,
    .csn-page .form-select,
    .csn-dialog .form-control,
    .csn-dialog .form-select { min-height: 44px; font-size: 16px; }
    .csn-dialog .form-check,
    .qh-modes .form-check { display: flex; align-items: center; gap: 8px; min-height: 44px; }
    .mcx-rung { min-height: 52px; }
    .mcx-iconbtn { min-width: 44px; min-height: 44px; }
    .mcx-page .wf-seg > button { height: 44px; }
    .mcx-page .wf-tab { min-height: 44px; }
    .mcx-page .wf-action-menu-item,
    .mcx-menu-item { min-height: 44px; }
    .mcx-person,
    .mtc-chain-item,
    .mtc-convo-row { min-height: 44px; }
    .mcx-check,
    .mcx-switch,
    .mcx-step-check { min-height: 44px; min-width: 44px; }
    .mcx-replay-head { min-height: 48px; }
    .mcx-page .btn-close,
    .mcx-scrim .btn-close,
    .csn-page .btn-close,
    .csn-dialog .btn-close { min-width: 44px; min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
    .mcx-menu,
    .mcx-drawer,
    .mcx-drawer-backdrop { animation: none; }
}

/* ── THE PROVIDER'S OWN VERDICT (MESSAGING.md 5q) - the details pane's "Ask the provider" and the
   channel page's sender roster. ─────────────────────────────────────────────────────────────── */
.mcx-provider-ask { margin: 10px 16px 0; }
.mcx-provider-failed { color: var(--wf-danger-ink); }
.mcx-provider-roster > .form-text { margin: 0 16px 10px; }

/* ── WAITING TO SEND (waiting-sends-plan.md; ACTIONS.md 20.6) - Messages > Waiting to send: the zone line, the chips with their
   counts, the rows (who / what / state / when / acts on the row), the details, the inline confirm and the row's answer. The pills
   are .mcx-state above. A row stacks on a phone; its buttons wrap under the state, full width under 480px. ───────────────────── */
.mcx-ws { padding-bottom: 4px; }
.mcx-ws-zone { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; color: var(--theme-text-muted); font-size: 12px; }
.mcx-ws-chips { flex-wrap: wrap; margin: 14px 20px 4px; }
.mcx-ws-count { margin-left: 4px; color: var(--theme-text-muted); font-variant-numeric: tabular-nums; }
.mcx-ws-count.is-brand { color: var(--wf-primary-ink); }
.mcx-ws-count.is-warning { color: var(--wf-warning-ink); }
.mcx-ws-count.is-danger { color: var(--wf-danger-ink); }
.mcx-ws-count.is-success { color: var(--wf-success-ink); }
.mcx-ws-note { display: flex; align-items: center; gap: 6px; margin: 8px 20px 0; color: var(--theme-text-secondary); font-size: 12.5px; }
.mcx-ws-list { margin: 12px 0 0; padding: 0; list-style: none; }
.mcx-ws-row { display: grid; grid-template-columns: minmax(9rem, 1fr) minmax(10rem, 1.2fr) minmax(12rem, 2fr) auto auto; gap: 6px 16px; align-items: start; padding: 12px 20px; border-top: 1px solid var(--wf-line); transition: background-color var(--wf-motion); }
.mcx-ws-row:hover { background: var(--wf-card-hover); }
.mcx-ws-row.mcx-ws-preview { background: var(--wf-inset); }
.mcx-ws-skel { display: flex; flex-direction: column; gap: 8px; }
.mcx-ws-who, .mcx-ws-what, .mcx-ws-state { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mcx-ws-state { align-items: flex-start; }
.mcx-ws-state .mcx-state { max-width: 100%; height: auto; min-height: 22px; white-space: normal; overflow-wrap: anywhere; }
.mcx-ws-addr { color: var(--theme-text-emphasis); font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.mcx-ws-kind { color: var(--theme-text); font-size: 13.5px; overflow-wrap: anywhere; }
.mcx-ws-run { color: var(--wf-primary-ink); font-size: 12px; }
.mcx-ws-line { color: var(--theme-text-secondary); font-size: 12.5px; line-height: 1.4; }
.mcx-ws-why { max-width: 60ch; color: var(--theme-text-muted); font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.mcx-ws-why-label { font-weight: 600; }
.mcx-ws-when { padding-top: 2px; color: var(--theme-text-muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mcx-ws-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; min-width: 0; }
.mcx-ws-detail { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 4px; padding: 8px 12px; border-radius: var(--wf-radius-md); background: var(--wf-inset); color: var(--theme-text); font-size: 13px; }
.mcx-ws-detail .bi { margin-right: 5px; color: var(--theme-text-muted); }
.mcx-ws-confirm { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--wf-primary-ink) 35%, var(--wf-line)); border-radius: var(--wf-radius-md); background: var(--wf-card); }
.mcx-ws-confirm.is-danger { border-color: color-mix(in srgb, var(--wf-danger-ink) 45%, var(--wf-line)); }
.mcx-ws-confirm-lead { margin: 0; color: var(--theme-text-emphasis); font-size: 13.5px; font-weight: 700; }
.mcx-ws-confirm-text { max-width: 72ch; margin: 0; color: var(--theme-text); font-size: 13px; line-height: 1.5; }
.mcx-ws-confirm-link { align-self: flex-start; }
.mcx-ws-confirm-check { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; }
.mcx-ws-confirm-note { max-width: 32rem; }
.mcx-ws-confirm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mcx-ws-answer { grid-column: 1 / -1; margin: 0; }
@media (max-width: 991.98px) {
    .mcx-ws-row { grid-template-columns: 1fr auto; }
    .mcx-ws-who { grid-column: 1; grid-row: 1; }
    .mcx-ws-when { grid-column: 2; grid-row: 1; text-align: right; }
    .mcx-ws-what, .mcx-ws-state { grid-column: 1 / -1; }
    .mcx-ws-acts { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 479.98px) {
    .mcx-ws-row { padding: 12px 16px; }
    .mcx-ws-chips { margin: 12px 16px 4px; }
    .mcx-ws-acts > .btn { flex: 1 1 100%; min-height: 44px; }
}
