/* =================================================================
   RCS INVITATIONS - the Message Center's tab (/ops/messages?tab=invitations)
   that invites someone to a conversation on their phone: their number,
   a conversation, Send (docs/claude/MESSAGING.md 5f2 - the Switchboard
   API's own start under the workspace's "require opt-in" switch).
   -----------------------------------------------------------------
   THE DESIGN PASS (2026-11-17, Kirk: "easy for ross and people to
   invite, see what failed/retry"): every block is a card of ONE look -
   the mcx-panel head, a 20px body (16px under 640px of page) - in the
   order a booth rep uses them: INVITE SOMEONE (the form and, beside it,
   the answer), THE INVITATIONS (the status strip and the list as
   people), HOW INVITATIONS BEHAVE (the settings as labelled rows), the
   START CARDS, and on the platform workspace WHO MAY TEXT SENDINVITE.

   Every class here is owned by this file alone
   (Tests/ConversationBuilderCssOwnershipTests): rin-* - the invite card
   (rin-invite-*, the "what will happen" line rin-happen-*, the options,
   the answer rin-said-*), the strip (rin-strip-*), the lists
   (rin-people / rin-person-*, the console's rin-dg-* carrier answer),
   the settings (rin-behave-*, rin-knob-*), THE CARDS panel (the start
   cards design: the summary, the editor's two cards, the picture field,
   the preview drawn as a handset draws a rich card - rin-card-*) and
   the sticky note (rin-toast).
   The shared pieces come from message-center.css (mcx-panel, mcx-state,
   mcx-field, mcx-note, mcx-skel-rows, mcx-inline-failed, mcx-facts) and
   wf.css / components.css (cards, buttons, forms, wf-tile-ic, wf-skel);
   this file lays them out and draws what is the tab's own - it never
   restyles an mcx-* class.

   TOKENS ONLY, the whole file (Tests/ShellTokensOnlyTests): no hex,
   no rgb() / hsl(), no colour keyword - every colour reads a --wf-*
   or --theme-* token, so light and dark both hold. The colour grammar
   holds: a state is a word with a dot in its state ink (sent / started
   / seen / delivered = success, waiting / asked = the brand, retrying /
   not on the tester list = warning, refused / failed = danger, nothing
   known = a neutral dash) - never info, the accent or the offset.

   NOTHING SCROLLS SIDEWAYS: the lists are grids that fold to two
   columns under 760px of page; the form and the answer sit side by side
   where there is room and fall under each other where there is not.
   ================================================================= */

/* ---- The note: sticky, so a save at the bottom of the tab is said where the person is looking - just under the shell bar
   (--wf-sticky-top: 56px while the bar shows, 0 when it does not), never beneath it ---- */
.rin-toast { position: sticky; top: calc(var(--wf-sticky-top, 0px) + 8px); z-index: 6; border-radius: var(--wf-radius-md); box-shadow: var(--wf-elev-2); }

/* ---- INVITE SOMEONE: the form and the answer, side by side where there is room ---- */
.rin-invite { padding-bottom: 20px; }
.rin-invite-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 16px 20px 0; }
.rin-form { min-width: 0; }
.rin-fields { display: flex; flex-direction: column; gap: 14px; }
.rin-fields > .mcx-field { max-width: 36rem; }
.rin-phone-input { height: 44px; font-size: 18px; font-weight: 600; letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.rin-select-skel { height: 38px; }
.rin-row { display: flex; flex-wrap: wrap; gap: 12px; }
.rin-row > .mcx-field { flex: 1 1 12rem; max-width: 17rem; }

/* What will happen: one plain line above Send, and the Options that change it. */
.rin-happen { display: flex; align-items: flex-start; gap: 10px; max-width: 36rem; padding: 10px 8px 10px 12px; border-radius: var(--wf-radius-md); background: var(--wf-inset); }
.rin-happen > .bi { flex: none; margin-top: 2px; color: var(--wf-primary-ink); font-size: 15px; }
.rin-happen-text { flex: 1 1 auto; min-width: 0; margin: 0; color: var(--theme-text); font-size: 13px; line-height: 1.45; }
.rin-happen-toggle { flex: none; display: inline-flex; align-items: center; gap: 6px; margin: -4px 0; }
.rin-happen-chev { font-size: 11px; transition: transform var(--wf-motion); }
.rin-happen-toggle[aria-expanded="true"] .rin-happen-chev { transform: rotate(180deg); }
.rin-options { display: flex; flex-direction: column; gap: 12px; max-width: 36rem; animation: rin-reveal 180ms var(--wf-ease); }
.rin-options > .mcx-field { max-width: 22rem; }
@keyframes rin-reveal { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* The cards that lead, and the two busy-thread answers (marked after a Check met a busy thread). */
.rin-lead { display: flex; flex-direction: column; gap: 4px; min-width: 0; margin: 0; padding: 10px 12px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-md); background: var(--wf-card); }
.rin-lead.is-asked { border-color: color-mix(in srgb, var(--wf-warning-ink) 45%, var(--wf-line)); background: var(--wf-warning-soft); }
.rin-lead-check { margin: 0; font-size: 13px; }
.rin-lead > .form-text { margin: 2px 0 0; }
.rin-lead-set { max-width: 22rem; margin-bottom: 4px; }

/* Send, the one primary act; Check beside it; what Check is. */
.rin-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding-top: 2px; }
.rin-send { min-width: 8.5rem; }
.rin-send > .bi, .rin-send > .spinner-border { margin-right: 6px; }
.rin-actions-hint { display: inline-flex; align-items: center; gap: 5px; flex-basis: 100%; color: var(--theme-text-muted); font-size: 12px; }
.rin-actions-hint > .bi { color: var(--wf-success-ink); }

/* The answer: a verdict with its mark, one sentence, the one thing to do, the facts. */
.rin-answer { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding-top: 16px; border-top: 1px solid var(--wf-line); }
.rin-answer-title { margin: 0; color: var(--theme-text-secondary); font-size: 13px; font-weight: 600; }
.rin-said { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.rin-said-ic { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: var(--wf-radius-tile); background: var(--wf-neutral-soft); color: var(--theme-text-secondary); font-size: 20px; }
.rin-said-ic.is-success { background: var(--wf-success-soft); color: var(--wf-success-ink); }
.rin-said-ic.is-brand { background: var(--wf-primary-soft); color: var(--wf-primary-ink); }
.rin-said-ic.is-warning { background: var(--wf-warning-soft); color: var(--wf-warning-ink); }
.rin-said-ic.is-danger { background: var(--wf-danger-soft); color: var(--wf-danger-ink); }
.rin-said-ic-skel { flex: none; width: 40px; height: 40px; }
.rin-said-words { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; flex: 1 1 auto; min-width: 0; }
.rin-said.is-busy .rin-said-words { gap: 10px; padding-top: 6px; }
.rin-said-title { margin: 0; color: var(--theme-text-emphasis); font-size: 14px; font-weight: 600; }
.rin-verdict { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.rin-verdict-text { margin: 0; color: var(--theme-text-emphasis); font-size: 14px; font-weight: 600; line-height: 1.4; }
.rin-idle { max-width: 48ch; margin: 0; color: var(--theme-text-muted); font-size: 13px; }
.rin-chain { display: flex; align-items: flex-start; gap: 6px; max-width: 62ch; margin: 0; color: var(--theme-text-secondary); font-size: 13px; }
.rin-chain > .bi { flex: none; margin-top: 2px; color: var(--wf-primary-ink); }
.rin-remedy { display: flex; align-items: flex-start; gap: 6px; max-width: 62ch; margin: 0; padding: 10px 12px; 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; }
.rin-remedy > .bi { flex: none; margin-top: 2px; color: var(--wf-warning-ink); }
.rin-facts { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 12.5px; }
.rin-fact { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.rin-fact > dt { color: var(--theme-text-muted); font-weight: 600; }
.rin-fact > dd { margin: 0; color: var(--theme-text); }

/* ---- THE INVITATIONS: the status strip, the search, the list as people ---- */
.rin-ledger { padding-bottom: 8px; }
.rin-ledger-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 14px 20px 0; }
.rin-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.rin-strip-btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-pill); background: var(--wf-card); color: var(--theme-text-secondary); font: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background-color var(--wf-motion), border-color var(--wf-motion), color var(--wf-motion); }
.rin-strip-btn:hover { background: var(--wf-card-hover); color: var(--theme-text-emphasis); }
.rin-strip-btn:focus-visible { outline: 2px solid var(--wf-primary-ink); outline-offset: 2px; }
.rin-strip-btn[aria-pressed="true"] { border-color: color-mix(in srgb, var(--wf-primary-ink) 55%, var(--wf-line)); background: var(--wf-primary-soft); color: var(--theme-text-emphasis); }
.rin-strip-num { display: inline-flex; align-items: center; gap: 6px; min-width: 1.6em; color: var(--theme-text-emphasis); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rin-strip-num::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--wf-line-strong); }
.rin-strip-btn.is-success .rin-strip-num::before { background: var(--wf-success-ink); }
.rin-strip-btn.is-brand .rin-strip-num::before { background: var(--wf-primary-ink); }
.rin-strip-btn.is-warning .rin-strip-num::before { background: var(--wf-warning-ink); }
.rin-strip-btn.is-danger .rin-strip-num::before { background: var(--wf-danger-ink); }
.rin-strip-btn.is-danger.has-some .rin-strip-num { color: var(--wf-danger-ink); }
.rin-strip-btn.is-warning.has-some .rin-strip-num { color: var(--wf-warning-ink); }
.rin-strip-word { line-height: 1; }
.rin-strip-scope { display: inline-flex; align-items: center; gap: 5px; margin-left: 4px; color: var(--theme-text-muted); font-size: 12px; }
.rin-ledger-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rin-search { position: relative; display: block; margin: 0; }
.rin-search > .bi { position: absolute; top: 50%; left: 10px; color: var(--theme-text-muted); font-size: 13px; transform: translateY(-50%); pointer-events: none; }
.rin-search > .form-control { width: 15rem; max-width: 100%; padding-left: 30px; }

/* One invitation per row: who | what | status | when | the one action; the reason and the carrier's answer under it. */
/* The list owns the columns and every row reads them (subgrid), so the who / what / status / when / action line up row to row.
   The action track is auto, not max-content: its floor is the widest ONE button, so a Didn't go row's Ask the carrier and Retry
   stack where the card is narrow (German too) instead of pushing the row past the card above the 760px fold. The who column's
   floor is the masked number itself (min-content - the number never breaks, .rin-person-phone), so it is never cut in two. */
.rin-people { display: grid; grid-template-columns: minmax(min-content, 1fr) minmax(8rem, 1.5fr) minmax(8rem, 1.1fr) max-content auto; column-gap: 16px; margin: 12px 0 0; padding: 0; list-style: none; }
.rin-people-caption { max-width: 82ch; margin: 12px 20px 0; color: var(--theme-text-muted); font-size: 12.5px; }
.rin-person { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; row-gap: 6px; align-items: start; min-width: 0; padding: 12px 20px; border-top: 1px solid var(--wf-line); transition: background-color var(--wf-motion); }
.rin-person:hover { background: var(--wf-card-hover); }
.rin-person.is-skel { display: flex; flex-direction: column; gap: 8px; }
.rin-person.is-skel:hover { background: none; }
.rin-person-who { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rin-person-what { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rin-person-status { grid-column: 3; grid-row: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
/* A status word can be long ("Expired - every try was turned back"): the pill wraps inside its cell, never over the when column. */
.rin-person-status .mcx-state { max-width: 100%; height: auto; min-height: 22px; border-radius: var(--wf-radius-sm); white-space: normal; overflow-wrap: anywhere; }
.rin-person-status .mcx-state::before { flex: none; }
.rin-person-when { grid-column: 4; grid-row: 1; padding-top: 2px; color: var(--theme-text-muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rin-person-act { grid-column: 5; grid-row: 1; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; min-width: 0; }
.rin-person-phone { color: var(--theme-text-emphasis); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .01em; white-space: nowrap; }
.rin-person-name { color: var(--theme-text); font-size: 13.5px; font-weight: 500; overflow-wrap: anywhere; }
.rin-person-sub { color: var(--theme-text-muted); font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.rin-person-set { display: inline-flex; align-items: center; gap: 4px; }
.rin-person-set > .bi { color: var(--wf-primary-ink); }
.rin-person-note { display: block; max-width: 40ch; overflow: hidden; color: var(--theme-text-secondary); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.rin-person-note > .bi { margin-right: 5px; color: var(--theme-text-muted); }
.rin-person-why { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px 16px; min-width: 0; }
.rin-person-why-text { display: flex; align-items: flex-start; gap: 6px; flex: 1 1 24rem; max-width: 72ch; margin: 0; color: var(--theme-text); font-size: 13px; }
.rin-person-why-text > .bi { flex: none; margin-top: 2px; color: var(--theme-text-muted); }
.rin-person-followup { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 8px 12px; 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); }
.rin-person-followup .btn { white-space: normal; text-align: left; }
.rin-person-followup-lead { color: var(--theme-text); font-size: 13px; font-weight: 600; }
.rin-more { display: flex; justify-content: center; padding: 10px 20px 4px; border-top: 1px solid var(--wf-line); }
.rin-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 18px 20px 12px; }
.rin-empty-title { margin: 4px 0 0; color: var(--theme-text-emphasis); font-size: 14px; font-weight: 600; }
.rin-empty-text { max-width: 62ch; margin: 0; color: var(--theme-text-muted); font-size: 13px; }

/* ---- THE CONSOLE'S PIECES: its note, the hints, and the carrier's answer under a row ---- */
.rin-dg-note { margin: 12px 20px 0; }
.rin-dg-hint { display: inline-flex; align-items: flex-start; gap: 5px; max-width: 40ch; color: var(--theme-text-muted); font-size: 12px; }
.rin-dg-hint > .bi { flex: none; margin-top: 2px; }
.rin-dg-carrier { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 10px 12px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-md); background: var(--wf-inset); }
.rin-dg-carrier-text { flex: 1 1 16rem; max-width: 72ch; margin: 0; color: var(--theme-text); font-size: 13px; }
.rin-dg-carrier-failed { display: flex; align-items: flex-start; gap: 6px; margin: 0; color: var(--wf-danger-ink); font-size: 13px; }
.rin-dg-carrier-failed > .bi { flex: none; margin-top: 2px; }
.rin-dg-facts { margin: 0; padding: 0; }
/* A provider's status word can be long (UNDELIVERABLE_REJECTED_OPERATOR): it wraps inside the facts rather than running off a phone. */
.rin-dg-facts .mcx-state { max-width: 100%; height: auto; min-height: 22px; border-radius: var(--wf-radius-sm); white-space: normal; overflow-wrap: anywhere; }
.rin-dg-act { display: flex; align-items: flex-start; gap: 6px; max-width: 72ch; margin: 0; color: var(--theme-text-secondary); font-size: 13px; }
.rin-dg-act > .bi { flex: none; margin-top: 2px; color: var(--wf-primary-ink); }
.rin-dg-use { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.rin-dg-use > .form-text { max-width: 62ch; margin: 0; }

/* ---- THE QUEUE ON THE TAB (round two): its state line, the "In the queue now" group, a queue row, the line under a row that rides
   the queue, and Take it back's confirm ---- */
.rin-q-state { display: flex; align-items: center; gap: 8px; max-width: 82ch; margin: 10px 20px 0; color: var(--theme-text-muted); font-size: 12.5px; }
.rin-q-state > .bi { flex: none; }
.rin-q-state > .spinner-border { flex: none; width: 12px; height: 12px; border-width: 2px; color: var(--wf-primary-ink); }
.rin-ledger > .mcx-inline-failed { margin: 10px 20px 0; padding: 0; }
.rin-people-group { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding: 14px 20px 8px; border-top: 1px solid var(--wf-line); background: var(--wf-inset); }
.rin-people-group-title { display: inline-flex; align-items: center; gap: 7px; color: var(--theme-text-emphasis); font-size: 12.5px; font-weight: 700; letter-spacing: .01em; }
.rin-people-group-title > .bi { color: var(--wf-primary-ink); }
.rin-people-group-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; margin-left: 2px; padding: 0 6px; border-radius: var(--wf-radius-pill); background: var(--wf-primary-soft); color: var(--wf-primary-ink); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.rin-people-group-sub { color: var(--theme-text-muted); font-size: 12px; }
.rin-person.is-queue .rin-person-phone { color: var(--theme-text-secondary); }
.rin-q-mark { margin-right: 5px; color: var(--wf-primary-ink); }
.rin-q-note { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; min-width: 0; padding: 7px 12px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-md); background: var(--wf-inset); }
.rin-q-note-text { display: flex; align-items: flex-start; gap: 6px; flex: 1 1 22rem; max-width: 72ch; margin: 0; color: var(--theme-text-secondary); font-size: 12.5px; line-height: 1.45; }
.rin-q-note-text > .bi { flex: none; margin-top: 2px; color: var(--wf-primary-ink); }
/* The confirm sits on the card's own surface, ringed in the danger ink, so its Take it back (the solid confirm-step danger button,
   .is-confirm) is the one coloured thing in it. */
.rin-q-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-danger-ink) 45%, var(--wf-line)); border-radius: var(--wf-radius-md); background: var(--wf-card); box-shadow: 0 2px 8px color-mix(in srgb, var(--wf-danger-ink) 10%, transparent); }
.rin-q-confirm-lead { display: flex; align-items: center; gap: 7px; margin: 0; color: var(--theme-text-emphasis); font-size: 13.5px; font-weight: 700; }
.rin-q-confirm-lead > .bi { color: var(--wf-danger-ink); }
.rin-q-confirm-text { max-width: 72ch; margin: 0; color: var(--theme-text); font-size: 13px; line-height: 1.5; }
.rin-q-confirm-note { max-width: 32rem; }
.rin-q-confirm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* The tab's badge (the Message Center's tab bar): the count in the danger ink - something did not go. */
.wf-tab .rin-tab-count.wf-tab-count,
.wf-tab.active .rin-tab-count.wf-tab-count { margin-left: 6px; background: var(--wf-danger-soft); color: var(--wf-danger-ink); }

/* ---- HOW INVITATIONS BEHAVE: one labelled row per setting - its value, where it came from, what it means ---- */
.rin-behave { padding-bottom: 14px; }
.rin-behave-skel { padding: 14px 20px 0; }
.rin-knobs { display: flex; flex-direction: column; margin: 12px 0 0; }
.rin-knob { display: grid; grid-template-columns: minmax(12rem, 16rem) minmax(15rem, 18rem) minmax(0, 1fr); gap: 4px 20px; align-items: baseline; padding: 11px 20px; border-top: 1px solid var(--wf-line); }
.rin-knob-name { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--theme-text-emphasis); font-size: 13.5px; font-weight: 600; }
.rin-knob-name > .bi { flex: none; color: var(--wf-primary-ink); font-size: 14px; }
.rin-knob-value { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0; }
.rin-knob-pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--wf-radius-pill); background: var(--wf-inset); color: var(--theme-text-emphasis); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rin-knob-source { color: var(--theme-text-muted); font-size: 12px; }
.rin-knob-hint { margin: 0; color: var(--theme-text-secondary); font-size: 12.5px; line-height: 1.45; }
.rin-behave-note { max-width: 72ch; margin: 10px 20px 0; color: var(--theme-text-muted); font-size: 12px; }
.rin-behave-form { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 16px; padding: 14px 20px 0; }
.rin-behave-form > .mcx-field { min-width: 14rem; max-width: 22rem; }
.rin-behave-form > .rin-behave-note { flex-basis: 100%; margin: 0; }
.rin-knob-field { display: flex; flex-direction: column; gap: 4px; }
.rin-knob-input { max-width: 8rem; }
.rin-knob-inherit { margin: 0; font-size: 12.5px; }
.rin-behave-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex-basis: 100%; }

/* ---- WHO MAY TEXT SENDINVITE (tenant 0 only): the listed handsets as tags, and the add row ---- */
.rin-keyword-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px 20px 16px; }
.rin-keyword-none { margin: 0; color: var(--theme-text-muted); font-size: 13px; }
.rin-keyword-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.rin-keyword-item { padding-right: 2px; }
.rin-keyword-add { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.rin-keyword-add > .mcx-field { min-width: 14rem; }

/* ---- THE CARDS: the summary of what is in force, and the editor (two cards side by side) ---- */
.rin-cards { padding-bottom: 16px; }
.rin-cards-skel { padding: 14px 20px 0; }
.rin-cards-summary { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; padding: 14px 20px 0; list-style: none; }
.rin-cards-summary > li { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; font-size: 13px; }
.rin-cards-summary-name { display: inline-flex; align-items: center; gap: 6px; color: var(--theme-text-emphasis); font-weight: 600; }
.rin-cards-summary-name > .bi { color: var(--wf-primary-ink); }
.rin-cards-summary-source { color: var(--theme-text-muted); }
.rin-cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(24rem, 100%), 1fr)); gap: 12px; align-items: start; padding: 14px 20px 0; }
.rin-cardx { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 12px 14px 14px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-md); background: var(--wf-card); }
.rin-cardx.is-refused { border-color: color-mix(in srgb, var(--wf-danger-ink) 45%, var(--wf-line)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--wf-danger-ink) 45%, var(--wf-line)); }
.rin-cardx-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.rin-cardx-name { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--theme-text-emphasis); font-size: 14px; font-weight: 600; }
.rin-cardx-name > .bi { color: var(--wf-primary-ink); }
.rin-cardx-force { color: var(--theme-text-muted); font-size: 12px; }
.rin-cardx-hint { max-width: 62ch; margin: 0; color: var(--theme-text-secondary); font-size: 12.5px; }
.rin-cardx-fields { display: flex; flex-direction: column; gap: 10px; }
.rin-cardx-fields > .form-text { margin-top: -6px; }
.rin-cardx-reset { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.rin-cards-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 20px 0; }
.rin-cards-note { flex-basis: 100%; max-width: 72ch; color: var(--theme-text-muted); font-size: 12px; }
/* A refused save, said beside Save / Cancel too (the top note is off-screen from the bottom of a tall editor). */
.rin-cards-refused { display: inline-flex; align-items: flex-start; gap: 6px; flex-basis: 100%; max-width: 72ch; color: var(--wf-danger-ink); font-size: 12.5px; }
.rin-cards-refused > .bi { flex: none; margin-top: 2px; }

/* ---- THE SET PICKER (the card sets lane): which set the two cards belong to, + New set / Duplicate / Rename / Delete,
   the inline forms under the bar (a new set's name and slug; a rename; the delete's confirmation in the danger ink). ---- */
.rin-sets { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 14px; padding: 14px 20px 0; }
.rin-sets-pick { flex: 1 1 16rem; max-width: 24rem; }
.rin-sets-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.rin-sets-count { color: var(--theme-text-muted); font-size: 12px; }
.rin-sets-danger { color: var(--wf-danger-ink); }
.rin-sets-hint { flex-basis: 100%; max-width: 82ch; margin: 0; color: var(--theme-text-muted); font-size: 12px; }
.rin-sets-form { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 12px; flex-basis: 100%; padding: 10px 12px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-md); background: var(--wf-inset); }
.rin-sets-form.is-danger { border-color: color-mix(in srgb, var(--wf-danger-ink) 45%, var(--wf-line)); }
.rin-sets-form > .mcx-field { flex: 1 1 14rem; max-width: 22rem; }
.rin-sets-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; flex-basis: 100%; }
.rin-sets-form-actions > .form-text { margin: 0; }
.rin-sets-confirm { flex-basis: 100%; max-width: 72ch; margin: 0; color: var(--theme-text-emphasis); font-size: 13px; }

/* ---- Try it on my phone: beside the summary, one button and what it does ---- */
.rin-try { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 12px 20px 0; }
.rin-try > .form-text { margin: 0; max-width: 62ch; }

/* ---- The picture field: a thumbnail, Choose / Change, Remove (the Portal's one file picker behind it) ---- */
.rin-pic { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.rin-pic-thumb { display: grid; place-items: center; flex: 0 0 auto; width: 72px; height: 72px; overflow: hidden; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-md); background: var(--wf-neutral-soft); color: var(--theme-text-secondary); font-size: 22px; }
.rin-pic-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rin-pic-thumb.is-empty { border-style: dashed; }
.rin-pic-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; }
.rin-pic-actions > .form-text { flex-basis: 100%; margin: 0; }

/* ---- THE PREVIEW: a bare box drawn as a handset draws a rich card - the picture across the top, the title, the body,
   the chips as full-width rows under hairlines. Content, not chrome: the card is a light sheet in every theme, its
   chips read in the brand's ink. ---- */
.rin-cardx-preview { display: flex; flex-direction: column; gap: 6px; }
.rin-cardx-preview-label { color: var(--theme-text-muted); font-size: 11.5px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
.rin-cardx-off { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--theme-text-muted); font-size: 12.5px; }
.rin-card { display: flex; flex-direction: column; width: min(100%, 18rem); overflow: hidden; border: 1px solid var(--wf-line-strong); border-radius: var(--wf-radius-lg); background: var(--wf-sheet); box-shadow: var(--wf-elev-1); }
.rin-card.is-off { opacity: .55; filter: grayscale(.6); }
.rin-card-pic { display: grid; place-items: center; width: 100%; height: 9rem; overflow: hidden; background: var(--wf-neutral-soft); color: var(--theme-text-muted); font-size: 28px; }
.rin-card-pic img { width: 100%; height: 100%; object-fit: cover; }
.rin-card-pic .asset-preview,
.rin-card-pic .asset-preview-thumb { display: block; width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; }
.rin-card-pic.is-empty { border-bottom: 1px dashed var(--wf-line); }
.rin-card-body { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 8px; }
.rin-card-title { color: var(--theme-text-emphasis); font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.rin-card-text { color: var(--theme-text); font-size: 12.5px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.rin-card-disclosure { color: var(--theme-text-secondary); font-size: 11.5px; }
.rin-card-chips { display: flex; flex-direction: column; }
.rin-card-chip { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 10px; border-top: 1px solid var(--wf-line); color: var(--wf-primary-ink); font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }

/* ---- WHERE THERE IS ROOM (920px of page and wider): the form and the answer side by side, a hairline between ---- */
@container page (min-width: 920px) {
    .rin-invite-body { grid-template-columns: minmax(0, 1.35fr) minmax(17rem, 1fr); gap: 28px; }
    .rin-answer { padding: 0 0 0 28px; border-top: 0; border-left: 1px solid var(--wf-line); }
}

/* ---- THE FOLDED LISTS (760px of page and narrower): who and when, then what, then the status and the action ---- */
@container page (max-width: 760px) {
    .rin-people { grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; }
    .rin-person-who { grid-column: 1; grid-row: 1; }
    .rin-person-when { grid-column: 2; grid-row: 1; text-align: right; }
    .rin-person-what { grid-column: 1 / -1; grid-row: 2; }
    .rin-person-status { grid-column: 1 / -1; grid-row: 3; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
    .rin-person-act { grid-column: 1 / -1; grid-row: 4; justify-content: flex-start; }
    .rin-person-act:empty { display: none; }
    .rin-person-note { max-width: none; }
    .rin-knob { grid-template-columns: minmax(0, 1fr); gap: 6px; }
    .rin-strip-scope { flex-basis: 100%; margin-left: 2px; }
    .rin-dg-facts { grid-template-columns: minmax(0, 1fr); row-gap: 2px; }
    .rin-dg-facts > dd + dt { margin-top: 6px; }
}

/* ---- A PHONE (640px of page and narrower): the bodies line up with the 16px card head ---- */
@container page (max-width: 640px) {
    .rin-invite-body,
    .rin-ledger-bar,
    .rin-behave-form,
    .rin-sets,
    .rin-cards-summary,
    .rin-cards-grid,
    .rin-cards-actions,
    .rin-try,
    .rin-cards-skel,
    .rin-behave-skel { padding-left: 16px; padding-right: 16px; }
    .rin-person, .rin-knob, .rin-empty, .rin-more, .rin-keyword-body { padding-left: 16px; padding-right: 16px; }
    .rin-people-caption, .rin-dg-note, .rin-behave-note, .rin-q-state, .rin-ledger > .mcx-inline-failed { margin-left: 16px; margin-right: 16px; }
    .rin-people-group { padding-left: 16px; padding-right: 16px; }
    .rin-q-confirm-actions .btn { flex: 1 1 auto; }
    .rin-ledger-tools, .rin-search, .rin-search > .form-control { width: 100%; }
    .rin-search { flex: 1 1 auto; }
    .rin-strip { width: 100%; }
    .rin-strip-btn { flex: 1 1 auto; justify-content: center; }
    .rin-happen { flex-wrap: wrap; }
    .rin-happen-toggle { margin: 0 0 0 auto; }
    .rin-send { flex: 1 1 auto; }
}

/* A TOUCH SCREEN: every button on the tab is a 44px target, like the rest of the family. */
@media (pointer: coarse) {
    .rin-actions .btn,
    .rin-happen-toggle,
    .rin-strip-btn,
    .rin-behave .btn-sm,
    .rin-keyword-add .btn-sm,
    .rin-cards-actions .btn-sm,
    .rin-pic-actions .btn-sm,
    .rin-cardx-reset .btn-sm,
    .rin-ledger-tools .btn-sm,
    .rin-person-act .btn-sm,
    .rin-person-followup .btn-sm,
    .rin-dg-use .btn-sm,
    .rin-q-note .btn-sm,
    .rin-q-confirm .btn-sm,
    .rin-more .btn-sm { min-height: 44px; min-width: 44px; }
}

@media (prefers-reduced-motion: reduce) {
    .rin-options { animation: none; }
    .rin-happen-chev, .rin-strip-btn, .rin-person { transition: none; }
}
