/* =================================================================
   Settings - the landing the rail's foot opens (/ops/admin-dashboard)
   and the pages it leads to, in the new frame (portal-look-and-feel.md
   3.18 - the Settings pass).
   -----------------------------------------------------------------
   Every class here is stg- prefixed and owned by this file alone
   (Tests/ConversationBuilderCssOwnershipTests). The shared pieces come
   from components.css (the KPI tile, tiles and tones, empty states,
   skeletons, the settings layout .wf-form-section, the segmented
   control), root.css (the page header) and wf.css (cards, tables,
   buttons, forms); this file only lays them out.

   TOKENS ONLY, the whole file (Tests/ShellTokensOnlyTests): no hex, no
   rgb() / hsl(), no colour keyword - every colour reads a --wf-*,
   --theme-* or --conv-* token. A state is a word in its state ink;
   the primary is the brand, never a status.
   ================================================================= */

/* ---- The page: cards on the 8px rhythm ---- */
.stg-page { min-width: 0; }
.stg-tab-sub { max-width: 68ch; margin: 0 0 16px; color: var(--theme-text-secondary); font-size: 14px; line-height: 1.5; }

/* The landing's tabs are a swipe row on a narrow page (eight tabs never wrap into a wall). */
.stg-tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.stg-tabs::-webkit-scrollbar { display: none; }
.stg-tabs > .wf-tab { flex: none; white-space: nowrap; }

/* ---- The landing: the selected tab's panel ---- */
.stg-hub { min-width: 0; }

/* ---- The groups: one divided card per group, flowing in balanced columns (no tall gaps beside a short group) ---- */
.stg-groups { column-width: 25rem; column-gap: 20px; }
.stg-group { display: block; width: 100%; margin: 0 0 20px; break-inside: avoid; }
.stg-group,
.stg-card { min-width: 0; overflow: visible; }
.stg-after { margin-top: 20px; }
.stg-group-head { padding: 18px 20px 8px; }
.stg-group-title { margin: 0; color: var(--theme-text-emphasis); font-size: var(--wf-text-h3); font-weight: 650; letter-spacing: -0.005em; }
.stg-group-text { max-width: 60ch; margin: 3px 0 0; color: var(--theme-text-secondary); font-size: 13px; line-height: 1.45; }

/* ---- A row: one setting (the whole row is the link) ---- */
.stg-rows { margin: 0; padding: 4px 8px 8px; list-style: none; }
.stg-rows > li + li { border-top: 1px solid var(--wf-line); }
.stg-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "ic words status go";
    align-items: center;
    gap: 2px 12px;
    width: 100%;
    min-height: 60px;
    padding: 10px 12px;
    border: 0;
    border-radius: var(--wf-radius-sm);
    background: transparent;
    color: var(--theme-text);
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--wf-motion);
}
.stg-row:hover { background: var(--wf-card-hover); color: var(--theme-text); }
.stg-row:focus-visible { outline: 2px solid var(--wf-primary-ink); outline-offset: -2px; }
.stg-row-ic { grid-area: ic; }
.stg-row-num { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stg-row-words { grid-area: words; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stg-row-name { color: var(--theme-text-emphasis); font-size: 14px; font-weight: 600; line-height: 1.35; }
.stg-row-hint { color: var(--theme-text-secondary); font-size: 12.5px; line-height: 1.45; }
.stg-row-status { grid-area: status; color: var(--theme-text-secondary); font-size: 12.5px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stg-row-status.is-muted { color: var(--theme-text-muted); font-weight: 500; }
.stg-row-skel { display: block; width: 64px; }
.stg-row-go { grid-area: go; color: var(--theme-text-muted); font-size: 13px; }
.stg-row:hover .stg-row-go { color: var(--wf-primary-ink); }

/* A narrow card: the live line moves under the purpose. */
@container page (max-width: 640px) {
    .stg-row { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "ic words go" "ic status go"; }
    .stg-row-status { justify-self: start; white-space: normal; }
}

/* ---- The Overview's counts (the shared KPI tile, components.css) ---- */
.stg-kpis { margin: 0; }
.stg-skel-kpi { height: 66px; }

/* ---- The Build tab's illustrated cards (pages.css .mci-*) ---- */
.stg-kings { margin: 0; }

/* ---- Meaning: teach the AI your business ---- */
.stg-essence { display: flex; flex-direction: column; gap: 16px; padding: 20px 22px 22px; }
.stg-essence-head { display: flex; align-items: flex-start; gap: 14px; }
.stg-essence-words { min-width: 0; }
.stg-essence-title { margin: 0; color: var(--theme-text-emphasis); font-size: var(--wf-text-h2); font-weight: 650; letter-spacing: -0.012em; }
.stg-essence-text { max-width: 72ch; margin: 6px 0 0; color: var(--theme-text-secondary); font-size: 14px; line-height: 1.55; }
.stg-essence-count { min-height: 28px; }
.stg-essence-figure { color: var(--theme-text-emphasis); font-size: var(--wf-figure-sm); font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stg-essence-done { display: inline-flex; align-items: center; gap: 8px; color: var(--wf-success-ink); font-weight: 600; }
.stg-essence-muted { color: var(--theme-text-muted); font-size: 13.5px; }
.stg-essence-skel { display: block; width: 260px; max-width: 100%; height: 22px; }
.stg-essence-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.stg-doors { display: flex; flex-wrap: wrap; gap: 8px; }
.stg-how { padding-top: 16px; border-top: 1px solid var(--wf-line); }
.stg-how-title { margin: 0 0 6px; color: var(--theme-text-emphasis); font-size: 14px; font-weight: 650; }
.stg-how-list { margin: 0; padding-left: 1.2rem; color: var(--theme-text-secondary); font-size: 13.5px; line-height: 1.6; }

/* =================================================================
   THE SETTINGS PAGES - the shared parts every page the landing opens
   uses: a stack of cards, a card's head, a labelled figure, a quiet
   list, a table that stacks on a narrow page, an inline failure.
   ================================================================= */
.stg-stack-gap { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.stg-alert { margin: 0 0 16px; }
.stg-card-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 14px; padding: 18px 20px 6px; }
.stg-card-head > :first-child { flex: 1 1 14rem; min-width: 0; }
.stg-card-title { margin: 0; color: var(--theme-text-emphasis); font-size: var(--wf-text-h3); font-weight: 650; letter-spacing: -0.005em; }
.stg-card-sub { max-width: 68ch; margin: 0; color: var(--theme-text-secondary); font-size: 13px; line-height: 1.45; }
.stg-card-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.stg-card-empty { margin: 0; padding: 8px 20px 20px; color: var(--theme-text-muted); font-size: 13.5px; }
.stg-card-body { padding: 12px 20px 20px; min-width: 0; }
.stg-label { color: var(--theme-text-secondary); font-size: 12.5px; font-weight: 600; }
.stg-figure { color: var(--theme-text-emphasis); font-size: var(--wf-figure-md); font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stg-pills { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.stg-amount { color: var(--theme-text-emphasis); font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stg-kpis-inset { margin: 10px 20px 20px; box-shadow: none; }

/* A quiet list inside a card: a title (and a sub-line) on the left, figures and actions on the right. */
.stg-list { margin: 0; padding: 4px 20px 12px; list-style: none; }
.stg-list-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 0; }
.stg-list-row + .stg-list-row { border-top: 1px solid var(--wf-line); }
.stg-list-words { display: flex; flex: 1 1 14rem; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.stg-list-sub { color: var(--theme-text-secondary); font-size: 12.5px; }
.stg-list-end { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; margin-left: auto; }

/* A table inside its card. NO TABLE SCROLLS SIDEWAYS, AT ANY WIDTH (320 to 1600px - design/portal/settings/sweep.html
   measures every .stg-table-wrap): a simple table fits by itself, a wide one by its declared columns (.stg-fixed),
   and each stacks into cards before it would not fit. The box still scrolls as a last resort - never the sheet. */
.stg-table-wrap { position: relative; min-width: 0; padding: 0 8px 8px; overflow-x: auto; } /* relative: an absolutely placed child (a visually-hidden header) scrolls with the table, never the sheet */
.stg-table { margin: 0; }
.stg-table td,
.stg-table th { vertical-align: middle; }

/* THE WIDE TABLES (API Keys, Identity links, Storage Sources, Sync Jobs, the Sheets Center): Launch Control's
   LaunchCodeTable recipe - table-layout: fixed at exactly its card's width, the short columns declared (.stg-col-*, on
   the header cells - the fixed layout reads the widths from the header row) and the text columns (.stg-col-text)
   sharing the rest, so content can never widen the table: a header may take two lines, a long word wraps, a code chip
   ellipsises (its title holds it whole), a pill or a labelled button wraps, the row actions take a second line. Each
   stacks into cards before a text column could fall under 120px: .is-wide under 960px of page, .is-wider under 1100px
   (Tests/SettingsPortalTests pins the arithmetic). */
.stg-fixed { width: 100%; table-layout: fixed; }
.stg-fixed > thead > tr > th { white-space: normal; overflow-wrap: break-word; vertical-align: bottom; }
.stg-fixed > tbody > tr > td { overflow-wrap: anywhere; }
.stg-fixed > tbody > tr > td.stg-row-actions { white-space: normal; }
.stg-table.stg-fixed .wf-codechip { max-width: 100%; }
.stg-fixed .wf-status-pill { max-width: 100%; height: auto; min-height: 22px; white-space: normal; }
.stg-fixed .btn:not(.stg-icon-btn) { max-width: 100%; white-space: normal; }
.stg-fixed .stg-sj-message { max-width: 100%; }
.stg-col-text { width: auto; }
.stg-col-date { width: 6.5rem; }
.stg-col-when { width: 7.5rem; }
.stg-col-state { width: 7.5rem; }
.stg-col-chip { width: 7.5rem; }
.stg-col-num { width: 6rem; }
.stg-col-flag { width: 6.5rem; }
.stg-col-mid { width: 8.5rem; }
.stg-col-wide { width: 10rem; }
.stg-col-act1 { width: 4.25rem; }
/* The action columns are sized for their icon buttons - 30px each, about 8px between, the cell's 24px of padding - so a
   row's actions sit on ONE line: three, four, five. (.stg-col-act5 was 10rem, which holds three and a half: the fourth
   button dropped to a second line under the others.) */
.stg-col-act3 { width: 8.5rem; }
.stg-col-act4 { width: 11rem; }
.stg-col-act5 { width: 13rem; }

/* A table on a narrow page: each row a stacked card - the first cell its title, every other cell a labelled line
   (data-label), an empty cell left out. The header row is kept for assistive tech, visually hidden. Under 760px of
   page (the Answer Center's breakpoint); a wide table sooner (.is-wide / .is-wider, the same rules). */
@container page (max-width: 760px) {
    .stg-stack > thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .stg-stack,
    .stg-stack > tbody { display: block; width: 100%; }
    .stg-stack > tbody > tr { display: flex; flex-direction: column; gap: 4px; padding: 12px 8px; border-bottom: 1px solid var(--wf-line); }
    .stg-stack > tbody > tr > td { display: flex; justify-content: space-between; gap: 12px; min-width: 0; padding: 0; border: 0; text-align: left; overflow-wrap: anywhere; }
    .stg-stack > tbody > tr > td:first-child { display: block; color: var(--theme-text-emphasis); font-weight: 600; }
    .stg-stack > tbody > tr > td[data-label]::before { content: attr(data-label); flex: none; margin-right: auto; color: var(--theme-text-muted); font-size: 12px; font-weight: 600; }
    .stg-stack > tbody > tr > td:empty { display: none; }
    .stg-stack > tbody > tr > td.stg-row-actions { flex-wrap: wrap; justify-content: flex-start; gap: 6px; margin-top: 4px; white-space: normal; }
    .stg-stack .stg-row-actions > .btn + .btn { margin-left: 0; }
    .stg-table.stg-stack .wf-codechip { max-width: 100%; }
    .stg-stack .stg-sj-message { max-width: none; white-space: normal; }
}
@container page (max-width: 960px) {
    .stg-stack.is-wide > thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .stg-stack.is-wide,
    .stg-stack.is-wide > tbody { display: block; width: 100%; }
    .stg-stack.is-wide > tbody > tr { display: flex; flex-direction: column; gap: 4px; padding: 12px 8px; border-bottom: 1px solid var(--wf-line); }
    .stg-stack.is-wide > tbody > tr > td { display: flex; justify-content: space-between; gap: 12px; min-width: 0; padding: 0; border: 0; text-align: left; overflow-wrap: anywhere; }
    .stg-stack.is-wide > tbody > tr > td:first-child { display: block; color: var(--theme-text-emphasis); font-weight: 600; }
    .stg-stack.is-wide > tbody > tr > td[data-label]::before { content: attr(data-label); flex: none; margin-right: auto; color: var(--theme-text-muted); font-size: 12px; font-weight: 600; }
    .stg-stack.is-wide > tbody > tr > td:empty { display: none; }
    .stg-stack.is-wide > tbody > tr > td.stg-row-actions { flex-wrap: wrap; justify-content: flex-start; gap: 6px; margin-top: 4px; white-space: normal; }
    .stg-stack.is-wide .stg-row-actions > .btn + .btn { margin-left: 0; }
    .stg-stack.is-wide .stg-sj-message { max-width: none; white-space: normal; }
}
@container page (max-width: 1100px) {
    .stg-stack.is-wider > thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .stg-stack.is-wider,
    .stg-stack.is-wider > tbody { display: block; width: 100%; }
    .stg-stack.is-wider > tbody > tr { display: flex; flex-direction: column; gap: 4px; padding: 12px 8px; border-bottom: 1px solid var(--wf-line); }
    .stg-stack.is-wider > tbody > tr > td { display: flex; justify-content: space-between; gap: 12px; min-width: 0; padding: 0; border: 0; text-align: left; overflow-wrap: anywhere; }
    .stg-stack.is-wider > tbody > tr > td:first-child { display: block; color: var(--theme-text-emphasis); font-weight: 600; }
    .stg-stack.is-wider > tbody > tr > td[data-label]::before { content: attr(data-label); flex: none; margin-right: auto; color: var(--theme-text-muted); font-size: 12px; font-weight: 600; }
    .stg-stack.is-wider > tbody > tr > td:empty { display: none; }
    .stg-stack.is-wider > tbody > tr > td.stg-row-actions { flex-wrap: wrap; justify-content: flex-start; gap: 6px; margin-top: 4px; white-space: normal; }
    .stg-stack.is-wider .stg-row-actions > .btn + .btn { margin-left: 0; }
    .stg-stack.is-wider .stg-sj-message { max-width: none; white-space: normal; }
}

/* A table row's parts: a two-line title cell, a figure that never wraps, the row actions on the right. A code chip in a
   cell never breaks the table: it stays one line and ellipsises inside its cell - at most 12rem in a table that sizes
   itself, its cell's width in a fixed one or a stacked card - and its title holds the whole value. */
.stg-table .wf-codechip { display: inline-block; min-width: 0; max-width: 12rem; overflow: hidden; line-height: 22px; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.stg-cell-title { display: block; color: var(--theme-text-emphasis); font-weight: 600; overflow-wrap: anywhere; }
.stg-cell-sub { display: block; color: var(--theme-text-secondary); font-size: 12.5px; overflow-wrap: anywhere; }
.stg-nowrap { white-space: nowrap; }
.stg-row-actions { text-align: right; white-space: nowrap; }
.stg-row-actions > .btn + .btn { margin-left: 4px; }
.stg-icon-btn { min-width: 30px; justify-content: center; padding-inline: 7px; }
/* ROW ACTIONS ARE ALWAYS ON THE ROW (Kirk, 2026-11-23: "These buttons being hidden until roll-over is confusing" - "More
   secret buttons only known if you know to roll over"). They were once shown only on the row you pointed at (3.10); a
   button a person cannot see is a button they do not know they have. Never hide a row's actions behind a hover again. */
.stg-cell-goal { max-width: 32rem; color: var(--theme-text-secondary); font-size: 13px; }
/* A row that has ended (a revoked or expired key): its name steps back to the secondary ink - never a dimmed row (the
   old opacity: .5 fell under AA) - and its "Revoked" / "Expired" pill reads at the secondary ink too (components.css's
   ended pill is the muted ink, 4.1:1 on its own fill in light; the contrast pass measured it). */
.stg-row-ended .stg-cell-title { color: var(--theme-text-secondary); }
.stg-page .wf-status-pill.is-ended { color: var(--theme-text-secondary); }

/* A filter row over the cards: a label and a select. */
.stg-filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 16px; }
.stg-filterbar > .form-label { margin: 0; }
.stg-filter-select { width: auto; min-width: 12rem; max-width: 100%; }
/* A sub-heading inside a card (between its tables). */
.stg-subhead { margin: 10px 20px 0; color: var(--theme-text-secondary); font-size: 12.5px; font-weight: 600; }
/* A tick box with what it picks, the whole label a target. */
.stg-pick,
.stg-cat-pick { display: flex; align-items: flex-start; gap: 10px; margin: 0; cursor: pointer; }
.stg-pick > .form-check-input { margin-top: 3px; }
.stg-cat-pick { align-items: center; }

/* An answer inside a card (a test's result). */
.stg-card-alert { margin: 0 20px 20px; }

/* ---- Storage Test ---- */
.stg-st-pick { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.stg-st-field { flex: 1 1 18rem; min-width: 0; }
.stg-st-upload-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 16px; }
.stg-st-browsepath { width: min(100%, 16rem); }
.stg-file { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.stg-file > .bi { color: var(--wf-primary-ink); }

/* ---- Email Templates: the editor beside its preview ---- */
.stg-et-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 0 0 16px; }
.stg-et-import { margin-left: auto; }
.stg-et-theme { align-items: center; flex-wrap: wrap; }
.stg-et-apply { margin-left: auto; }
.stg-swatches { display: inline-flex; gap: 4px; }
.stg-swatch { display: inline-block; width: 14px; height: 14px; border: 1px solid var(--wf-line-strong); border-radius: var(--wf-radius-xs); }
.stg-et-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
@container page (min-width: 1000px) {
    .stg-et-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.stg-et-plain { font-size: 13px; }
.stg-et-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stg-et-frame { display: block; width: 100%; height: 500px; border: 0; border-top: 1px solid var(--wf-line); border-radius: 0 0 var(--wf-radius-md) var(--wf-radius-md); }

/* A form's buttons: Cancel, then the one primary, last. */
.stg-form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.stg-form-actions.is-start { justify-content: flex-start; margin-top: 0; }

/* The settings layout (components.css .wf-form-section) inside ONE card: sections divided by hairlines. */
.stg-settings { padding: 24px 24px 8px; }
.stg-settings > .wf-form-section:last-child { padding-bottom: 16px; }
.stg-inline-failed.is-flush { padding: 0; }
@media (max-width: 767.98px) {
    .stg-settings { padding: 18px 16px 4px; }
}

/* The search well in a card's head: a glyph inside the field. */
.stg-search { position: relative; display: block; width: min(100%, 18rem); margin: 0; }
.stg-search > .bi { position: absolute; top: 50%; left: 11px; color: var(--theme-text-muted); font-size: 13px; transform: translateY(-50%); pointer-events: none; }
.stg-search > .form-control { padding-left: 32px; background: var(--wf-inset); }
.stg-search > .form-control:focus { background: var(--wf-card); }

/* A calm note under the header (not an alert): a glyph and a sentence. */
.stg-note { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 16px; padding: 12px 16px; border-radius: var(--wf-radius-md); background: var(--wf-inset); color: var(--theme-text-secondary); font-size: 13px; line-height: 1.5; }
.stg-note > .bi { margin-top: 2px; color: var(--wf-primary-ink); }

/* A segmented control inside a form (components.css .wf-seg) - its own line, wrapping on a phone. */
.stg-seg { display: inline-flex; flex-wrap: wrap; margin: 6px 0 4px; }
.stg-seg > button > .bi { margin-right: 6px; }

/* ---- Users: the roles cell while it is being edited ---- */
.stg-role-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; max-width: 34rem; }
.stg-role-check { margin: 0; font-size: 12.5px; }
.stg-role-edit-actions { display: inline-flex; gap: 6px; margin-left: 4px; }
.stg-role-count { cursor: help; }

/* A read inside a card that failed on its own (the rest of the page still shows). */
.stg-inline-failed { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 8px 20px 20px; }

/* ---- My Bill ---- */
.stg-bill-hero { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; padding: 20px 22px; }
.stg-bill-plan,
.stg-bill-sofar { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stg-bill-sofar { align-items: flex-end; text-align: right; }
.stg-bill-mode { color: var(--theme-text-emphasis); font-size: var(--wf-text-h2); font-weight: 650; }
@container page (max-width: 520px) {
    .stg-bill-sofar { align-items: flex-start; text-align: left; }
}

/* ---- API Keys ---- */
/* A new key, shown once: the warning ink on the title, the copy row, then its prefix and Done. */
.stg-newkey { margin: 0 0 20px; border-color: var(--wf-warning-ink); }
.stg-newkey .stg-card-title > .bi { color: var(--wf-warning-ink); }
.stg-newkey-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 10px; }
/* The permissions a new key gets: a heading per group, its roles as ticks under it. */
.stg-scopes { max-height: 16rem; padding: 4px 12px 10px; overflow-y: auto; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-md); }
.stg-scope-group { margin: 10px 0 4px; color: var(--theme-text-secondary); font-size: 12px; font-weight: 650; letter-spacing: .02em; text-transform: uppercase; }

/* ---- Users ---- */
.stg-users .stg-cell-sub { max-width: 28rem; }

/* ---- Identity links ---- */
.stg-idl-help > div { min-width: 0; }
.stg-idl-delivery { margin: 0 0 20px; }
.stg-idl-when { margin-top: 8px; }
.stg-idl-when > summary { color: var(--wf-primary-ink); font-weight: 600; cursor: pointer; }
.stg-idl-when > ul { margin: 8px 0 0; padding-left: 1.2rem; }
/* The invite-delivery panel (folded in from the page's old scoped sheet): a real button is the whole header row, with
   its own line-height - a .btn stripped of its padding clipped the label against the card edge. */
.stg-idl-toggle { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 10px 16px; border: 0; border-radius: inherit; background: none; color: var(--theme-text); font-size: 14px; font-weight: 600; line-height: 1.4; text-align: left; cursor: pointer; }
.stg-idl-toggle:hover { background: var(--wf-card-hover); }
.stg-idl-toggle:focus-visible { outline: 2px solid var(--theme-primary); outline-offset: -2px; }
.stg-idl-chev { color: var(--theme-text-muted); font-size: 12px; }
.stg-idl-icon { color: var(--wf-primary-ink); }
.stg-idl-label { min-width: 0; white-space: normal; }
.stg-idl-body { padding: 0 16px 16px; }
.stg-idl-body > .form-text { max-width: 72ch; margin: 0 0 6px; }
.stg-idl-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; margin: 4px 0 10px; }
.stg-idl-input { flex: 1 1 18rem; min-width: 0; max-width: 32rem; }
.stg-idl-saved,
.stg-idl-failed { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; font-size: 13px; }
.stg-idl-saved { color: var(--wf-success-ink); }
.stg-idl-failed { color: var(--wf-danger-ink); }
.stg-idl-reason { max-width: 72ch; margin: 0; padding: 0 20px 12px; color: var(--theme-text-secondary); font-size: 13px; }
/* The pending tab's sweep: the sentence, then its three controls on one line that wraps. */
.stg-idl-sweep { display: flex; flex-direction: column; gap: 8px; padding: 0 20px 14px; border-bottom: 1px solid var(--wf-line); }
.stg-idl-sweep-text { max-width: 72ch; margin: 0; color: var(--theme-text-secondary); font-size: 13px; line-height: 1.45; }
.stg-idl-sweep-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.stg-idl-bucket { margin: 0 0 14px; }
.stg-idl-bucket-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.stg-idl-emails { margin: 6px 0 0; overflow-wrap: anywhere; }
.stg-idl-invited { max-height: 10rem; margin-top: 6px; overflow-y: auto; }
.stg-idl-person { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* ---- Theme ---- */
.stg-th-gen { display: flex; flex-wrap: wrap; gap: 8px; max-width: 40rem; }
.stg-th-gen > .form-control { flex: 1 1 16rem; min-width: 0; }
.stg-th-logo { margin: 0 0 8px; }
.stg-th-logo > img { display: block; max-width: 200px; max-height: 48px; }
.stg-th-sample { padding: 12px 16px; border-radius: var(--wf-radius-md); background: var(--wf-inset); }
.stg-th-radius { max-width: 20rem; }
.stg-th-colors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.stg-th-color { display: flex; align-items: center; gap: 8px; }
.stg-th-color > .form-control-color { flex: none; width: 3rem; height: 38px; padding: 4px; }
.stg-th-color > .form-control:not(.form-control-color) { flex: 1 1 auto; width: auto; min-width: 0; }
.stg-th-swatches { display: flex; gap: 8px; }
.stg-th-swatch { flex: 1 1 0; height: 48px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-sm); }
.stg-th-samples { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stg-th-badge { background: var(--theme-offset-muted); color: var(--theme-offset); }
.stg-th-saved { display: inline-flex; align-items: center; gap: 6px; color: var(--wf-success-ink); font-weight: 600; }
/* What the site said (the brand kit's proposal): the logos to pick from and the tagline to keep. */
.stg-th-found { max-width: 40rem; padding: 12px 16px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-md); background: var(--wf-inset); }
.stg-th-found-title { margin: 0 0 4px; font-size: 1rem; font-weight: 600; }
.stg-th-logos { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.stg-th-logo-pick { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 7.5rem; padding: 8px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-sm); background: var(--theme-background); }
.stg-th-logo-pick.is-active { border-color: var(--theme-primary); box-shadow: 0 0 0 1px var(--theme-primary); }
.stg-th-logo-pick > img { display: block; max-width: 100%; height: 48px; object-fit: contain; }
.stg-th-logo-state { display: inline-flex; align-items: center; gap: 4px; color: var(--wf-success-ink); font-weight: 600; font-size: 0.875rem; }
.stg-th-tagline { margin: 0 0 6px; font-style: italic; }
@container page (max-width: 560px) {
    .stg-th-colors { grid-template-columns: minmax(0, 1fr); }
}

/* ---- Storage Sources ---- */
.stg-ss-signing { margin: 0 0 20px; padding: 14px 18px; }
.stg-ss-signing > .stg-list-sub { max-width: 80ch; }
.stg-ss-linked { margin-right: 4px; color: var(--wf-primary-ink); }
/* A source's shortcuts open under its row, on the inset ground. */
.stg-table > tbody > tr.stg-ss-expanded > td { padding: 0; background: var(--wf-inset); }
.stg-ss-shortcuts { padding: 12px 16px; }
.stg-ss-shortcuts-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0 0 6px; }
.stg-ss-sc-list { padding: 0; }

/* ---- Sync Jobs ---- */
.stg-sj-message { display: block; max-width: 18rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stg-sj-errors { color: var(--wf-danger-ink); font-weight: 600; }
.stg-sj-sync { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--wf-line); }
.stg-sj-danger { color: var(--wf-danger-ink); }
/* The edit and delete dialogs (the Storage Explorer's se-modal frame): their own widths - the edit dialog widens when its
   filters open. Two classes, to outrank storage-explorer-2.css's .se-modal (it loads later). */
.stg-sj-modal.se-modal { max-width: 36rem; transition: max-width .2s; }
.stg-sj-modal.se-modal.is-wide { max-width: 48rem; }
.stg-sj-modal.se-modal.is-small { max-width: 24rem; }
@media (prefers-reduced-motion: reduce) {
    .stg-sj-modal.se-modal { transition: none; }
}

/* ---- Data sync (header and frame): the hub's counts, a sub-page's line under its title ---- */
.stg-ds-kpis { margin: 0 0 20px; }
.stg-ds-kpis-skel { height: 96px; margin: 0 0 20px; border-radius: var(--wf-radius-lg); }
.stg-ds-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: -4px 0 16px; }

/* A skeleton inside a card that already has its frame. */
.stg-skel.stg-skel-flat { border: 0; background: none; box-shadow: none; }

/* ---- A read that failed: a calm line and Try again (SettingsLoadFailed) ---- */
.stg-failed { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px 14px; padding: 16px 18px; }
.stg-failed-words { flex: 1 1 18rem; min-width: 0; }
.stg-failed-text { margin: 0; color: var(--theme-text-secondary); font-size: 13.5px; }
.stg-failed-detail { margin: 2px 0 0; color: var(--theme-text-muted); font-size: 12px; overflow-wrap: anywhere; }

/* ---- Skeletons in the shape of what is coming (SettingsSkeleton) ---- */
.stg-skel { min-width: 0; }
.stg-skel.is-rows { display: flex; flex-direction: column; gap: 10px; padding: 16px 20px 20px; }
.stg-skel.is-summary { padding: 18px 20px; }
.stg-skel-row { height: 44px; }
.stg-skel-summary { height: 140px; }
.stg-skel-section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 16px 32px; padding: 24px 0; border-top: 1px solid var(--wf-line); }
.stg-skel-section:first-child { padding-top: 0; border-top: 0; }
.stg-skel-words { display: flex; flex-direction: column; gap: 8px; }
.stg-skel-title { width: 60%; height: 16px; }
.stg-skel-text { width: 90%; }
.stg-skel-fields { display: flex; flex-direction: column; gap: 12px; }
.stg-skel-field { height: 40px; }
@media (max-width: 767.98px) {
    .stg-skel-section { grid-template-columns: minmax(0, 1fr); }
}

/* ---- Small pieces that used to be inline styles: an icon in the brand's or the offset's ink, an extra-small spinner, a
   scrolling box of choices, the storage connection dialog's protocol row (the height of a field beside it) ---- */
.stg-ink-primary { color: var(--wf-primary-ink); }
/* Action Pack Skills: an installed skill's accent rail says whether it is on (app-cards.css's .pcard-accent is the primary). */
.stg-ap-accent.is-on { background: var(--theme-success); }
.stg-ap-accent.is-off { background: var(--wf-line-strong); }
.stg-ink-offset { color: var(--theme-offset); }
.stg-spin-xs { width: .75rem; height: .75rem; }
.stg-pick-box { max-height: 220px; overflow-y: auto; }
.stg-ss-protocol { height: 38px; }

/* A TOUCH SCREEN (portal-look-and-feel 3.17): 44px targets and a 16px input (a smaller one makes iOS zoom on focus). */
@media (pointer: coarse) {
    .stg-tabs > .wf-tab { min-height: 44px; }
    /* Every segmented control on a Settings page (the Theme's radius choices, the Users invite presets, API Keys'
       All / Mine, the Email Templates language) - 28px in components.css, the Answer Center's 44px here. */
    .stg-page .wf-seg > button { height: 44px; min-width: 44px; }
    /* A tick box or a switch: its row (the label it sits in, or the label beside it) is the 44px target. */
    .stg-page .form-check,
    .stg-page .form-check > .form-check-label { min-height: 44px; }
    .stg-page .form-check > .form-check-label { display: inline-flex; align-items: center; }
    /* Identity links' "When do I add a link?" opener. */
    .stg-idl-when > summary { padding-block: 12px; }
    .stg-failed-retry,
    .stg-doors > .btn,
    .stg-page .btn-sm { min-height: 44px; }
    .stg-icon-btn { min-width: 44px; }
    .stg-search > .form-control { min-height: 44px; font-size: 16px; }
    .stg-page .wf-action-menu-item,
    .stg-idl-toggle { min-height: 44px; }
    .stg-page .form-control,
    .stg-page .form-select { font-size: 16px; }
}

/* ---- THE SIGN-IN PAGE'S BILLBOARDS EDITOR (Platform admin - /ops/sign-in-page; docs/claude/AUTH.md "The sign-in page and its
   billboards"). One row per billboard: the picture (the stage's 16:10 panel, small - drop a photo on it) beside its words. ---- */
.stg-sib-builtin .form-check-label { color: var(--theme-text-emphasis); }

.stg-sib-empty {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: var(--wf-space-4, 16px);
    padding: 14px 16px;
    border: 1px dashed var(--wf-line-strong);
    border-radius: var(--wf-radius-md);
    color: var(--theme-text-secondary);
}

.stg-sib-empty .bi { color: var(--conv-flow); font-size: 18px; }

.stg-sib-row {
    display: grid;
    grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
    align-items: start;
    gap: 20px;
    margin-bottom: 14px;
    padding: 16px;
    border: 1px solid var(--wf-line);
    border-radius: var(--wf-radius-lg);
    background: var(--wf-card);
}

/* The picture box: the panel at a small scale, on the stage's night field; the file input covers it, so a click chooses and a
   drop uploads. */
.stg-sib-picture {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    border-radius: var(--wf-radius-md);
    background:
        radial-gradient(80% 70% at 0% 0%, color-mix(in oklab, var(--conv-ask) 38%, transparent), transparent 70%),
        radial-gradient(70% 80% at 100% 100%, color-mix(in oklab, var(--conv-flow) 32%, transparent), transparent 72%),
        color-mix(in oklab, var(--theme-nav-background) 22%, black);
    box-shadow: var(--wf-elev-1);
}

.stg-sib-picture img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stg-sib-picture.is-empty {
    outline: 2px dashed color-mix(in srgb, white 30%, transparent);
    outline-offset: -8px;
}

.stg-sib-picture:hover.is-empty,
.stg-sib-picture:focus-within.is-empty {
    outline-color: color-mix(in srgb, white 62%, transparent);
}

.stg-sib-picture-empty,
.stg-sib-picture-busy {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 16px;
    color: color-mix(in srgb, white 90%, transparent);
    text-align: center;
}

.stg-sib-picture-empty .bi { font-size: 26px; color: color-mix(in oklab, var(--conv-ask) 40%, white); }

.stg-sib-picture-empty .form-text { color: color-mix(in srgb, white 62%, transparent); }

.stg-sib-picture-busy {
    flex-direction: row;
    background: color-mix(in srgb, black 45%, transparent);
}

.stg-sib-file {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.stg-sib-file:disabled { cursor: progress; }

/* The left column: the picture, then the billboard's words as the stage shows them (2026-11-24). */
.stg-sib-face {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.stg-sib-preview {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border-radius: var(--wf-radius-md);
    background: color-mix(in oklab, var(--theme-nav-background) 22%, black);
    color: color-mix(in srgb, white 94%, transparent);
}

.stg-sib-preview-kicker {
    color: color-mix(in srgb, white 55%, transparent);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.stg-sib-preview-title {
    margin: 0;
    font-size: 15px;
    font-weight: 650;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.stg-sib-preview-body {
    margin: 0;
    color: color-mix(in srgb, white 72%, transparent);
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.stg-sib-preview-link {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 4px;
    color: color-mix(in oklab, var(--conv-ask) 42%, white);
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
    text-underline-offset: 3px;
}

.stg-sib-preview-link:hover {
    color: color-mix(in srgb, white 100%, transparent);
}

.stg-sib-fields { min-width: 0; }

.stg-sib-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.stg-sib-number {
    color: var(--theme-text-emphasis);
    font-weight: 650;
}

.stg-sib-row-tools { display: inline-flex; gap: 6px; }

.stg-sib-links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin-top: 8px;
}

.stg-sib-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
}

.stg-sib-actions-end { margin-left: auto; }

@media (max-width: 760px) {
    .stg-sib-row { grid-template-columns: minmax(0, 1fr); }
}

/* The screen saver's wait (docs/claude/AUTH.md "The screen saver"). */
.stg-sib-saver {
    max-width: 240px;
}

.stg-sib-builtin-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 6px 18px;
    margin-top: 12px;
}

.stg-sib-number { display: inline-flex; align-items: center; gap: 10px; }

.stg-sib-state {
    padding: 2px 10px;
    border-radius: var(--wf-radius-pill);
    font-size: 11.5px;
    font-weight: 600;
}

.stg-sib-state.is-live { background: var(--wf-success-soft); color: var(--wf-success-ink); }
.stg-sib-state.is-scheduled { background: var(--wf-primary-soft); color: var(--wf-primary-ink); }
.stg-sib-state.is-off,
.stg-sib-state.is-ended { background: var(--wf-neutral-soft); color: var(--theme-text-secondary); }
