/* =================================================================
   THE ANSWER CENTER (/answer-center) in the new frame
   (portal-look-and-feel.md 3.18 - the second center, after Launch
   Control): the page header, the pulse (the shared KPI tile + the
   shared charts), the command bar, the view bar, the runs as Cards /
   List / Explorer / Map / Jobs, the selection bar, the run drawer and
   its lightbox.
   -----------------------------------------------------------------
   Every class here is ansx- prefixed and owned by this file alone
   (Tests/ConversationBuilderCssOwnershipTests). The shared pieces come
   from components.css (the KPI tile, the pressable chip, the segmented
   control, the count, the code chip, tiles, empty states, skeletons,
   the charts) and wf.css (cards, buttons, forms, modals); this file
   lays them out and draws what is the Answer 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 photo lightbox is a dark room in every
   theme). The colour grammar holds: a run's state is a word with a
   dot in its state ink (done = success, in progress = the brand,
   stopped early = warning, an error = danger, not started = neutral) -
   never info (the Say family), the accent (make something new) or the
   offset (the Flow family).

   NOTHING SCROLLS SIDEWAYS (3.10 / 3.17): the List stacks into one card
   per run under 760px of page (@container page); the Explorer and the
   Jobs grid are spreadsheets that scroll INSIDE their own card; chip
   rows and the presets are swipe lists on a phone.
   ================================================================= */

/* ---- The page: cards on the 8px rhythm ---- */
.ansx-page { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ansx-page > .wf-page-header { margin-bottom: 8px; }
.ansx-spacer { flex: 1 1 auto; }
.ansx-push { margin-left: auto; }
.ansx-muted { color: var(--theme-text-muted); font-size: 12.5px; }
.ansx-nowrap { white-space: nowrap; }
.ansx-iconbtn { min-width: 32px; padding-left: 8px; padding-right: 8px; }

/* A run's state, as an ink and a soft fill (the words carry the meaning; this is only their tone). */
:where(.ansx-page, .ansx-drawer, .ansx-modal) .is-done { --ansx-st: var(--wf-success-ink); --ansx-st-soft: var(--wf-success-soft); }
:where(.ansx-page, .ansx-drawer, .ansx-modal) .is-live { --ansx-st: var(--wf-primary-ink); --ansx-st-soft: var(--wf-primary-soft); }
:where(.ansx-page, .ansx-drawer, .ansx-modal) .is-new { --ansx-st: var(--theme-text-muted); --ansx-st-soft: var(--wf-neutral-soft); }
:where(.ansx-page, .ansx-drawer, .ansx-modal) .is-quit { --ansx-st: var(--wf-warning-ink); --ansx-st-soft: var(--wf-warning-soft); }
:where(.ansx-page, .ansx-drawer, .ansx-modal) .is-error { --ansx-st: var(--wf-danger-ink); --ansx-st-soft: var(--wf-danger-soft); }
.ansx-dot { display: inline-block; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--ansx-st, var(--theme-text-muted)); }

/* =================================================================
   THE PULSE - one divided card of the shared KPI tile, then the runs
   over time beside where people answered.
   ================================================================= */
.ansx-pulse { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
/* The runs tile leads on the left; the other tiles wrap beside it and STRETCH to fill their row, so however many the
   workspace shows (AI summaries and job runs come and go) the card is calm full rows - never a dangling tile. The
   dividers are the shared tile's own 1px shadows (the card clips the ones on its outer edge). */
.ansx-numbers { grid-template-columns: minmax(15rem, 1fr) minmax(0, 3fr); margin: 0; }
.ansx-numbers > .wf-kpi.is-hero { grid-column: auto; justify-content: center; }
.ansx-numbers-rest { display: flex; flex-wrap: wrap; min-width: 0; }
/* --ansx-rest-cols (AnsCenterView.RestColumns, set by AnsPulse) balances the rows - 9 tiles are 3 rows of 3, never 4 + 4 + 1;
   a narrower page wraps sooner, each tile keeping its 10.5rem floor. */
.ansx-numbers-rest > .wf-kpi { flex: 1 1 max(10.5rem, calc(100% / var(--ansx-rest-cols, 4) - 1px)); }
/* The runs tile's pace ("About 10 a day") - a quiet pill on the chart's own wash. */
.ansx-pace { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--wf-radius-pill); background: var(--wf-data-soft); color: var(--theme-text-secondary); font-size: 12.5px; font-weight: 600; }
/* A status tile's glyph wears its state's ink (the word beside it carries the meaning). */
.ansx-status-tile .wf-kpi-label > .bi:first-child { color: var(--ansx-st, var(--wf-primary-ink)); }
.ansx-skel-tile { height: 66px; }
/* WAITING, COUNTED - ONE compact strip under the numbers (never five more tiles): its title, then the shared pressable chips. */
.ansx-wait-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 10px 14px; }
.ansx-wait-title { display: inline-flex; align-items: center; gap: 6px; margin-right: 4px; color: var(--theme-text-secondary); font-size: 12.5px; font-weight: 700; }
.ansx-wait-scope { color: var(--theme-text-secondary); font-size: 12px; }
.ansx-pair { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(17rem, 1fr); gap: 16px; align-items: start; }
.ansx-pair.is-single { grid-template-columns: minmax(0, 1fr); }
.ansx-panel { display: flex; flex-direction: column; min-width: 0; overflow: visible; }
.ansx-panel-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 14px; padding: 18px 20px 0; }
.ansx-panel-words { flex: 1 1 14rem; min-width: 0; }
.ansx-panel-title { margin: 0; color: var(--theme-text-emphasis); font-size: var(--wf-text-h3); font-weight: 650; letter-spacing: -0.005em; }
.ansx-panel-sub { max-width: 68ch; margin: 3px 0 0; color: var(--theme-text-secondary); font-size: 13px; line-height: 1.45; }
.ansx-panel-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: auto; }
.ansx-skel-chart { height: 220px; margin: 18px 20px; }
.ansx-chart { padding: 12px 20px 18px; }
.ansx-chart .wf-cols { gap: 3px; }
.ansx-chart .wf-chart-table { margin-top: 4px; }
/* Where people answered: each channel two lines - its name and its number, then its bar the card's full width. */
.ansx-channel-bars { padding: 10px 20px 16px; }
.ansx-channel-bars .wf-hbar-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label value" "track track"; row-gap: 6px; padding: 9px 0; }
.ansx-channel-bars .wf-hbar-label { grid-area: label; }
.ansx-channel-bars .wf-hbar-value { grid-area: value; }
.ansx-channel-bars .wf-hbar-track { grid-area: track; }

/* =================================================================
   THE COMMAND BAR - one card: which conversations, when, a search; then
   the status and channel chips (the shared pressable chip).
   ================================================================= */
.ansx-filters { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; overflow: visible; }
.ansx-frow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; min-width: 0; }
.ansx-frow-chips { gap: 6px 8px; }
.ansx-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.ansx-fsep { width: 1px; height: 20px; margin: 0 2px; background: var(--wf-line); }
.ansx-chip-st > .ansx-dot { margin-right: 1px; }
.ansx-wfpick-toggle { max-width: 100%; }
.ansx-wfpick-toggle.is-on { border-color: var(--wf-primary-ink); background: var(--wf-primary-soft); color: var(--theme-text-emphasis); }
.ansx-wfpick-toggle > .bi:first-child { color: var(--wf-primary-ink); }
.ansx-wfpick-label { min-width: 0; max-width: 16rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
/* The presets and the views are swipe rows whenever the page is narrower than they are (never the page scrolling). */
.ansx-presets,
.ansx-views { min-width: 0; max-width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.ansx-presets::-webkit-scrollbar,
.ansx-views::-webkit-scrollbar { display: none; }
.ansx-presets > button,
.ansx-views > button { flex: none; }
.ansx-custom { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ansx-custom input { width: 9.5rem; }
.ansx-custom-to { color: var(--theme-text-muted); }
/* a deep link's exact start ("from 4:53 PM" - the home's "since you last looked" door) */
.ansx-custom-time { color: var(--theme-text-muted); font-size: 13px; white-space: nowrap; }
.ansx-select { width: auto; min-width: 7rem; max-width: 100%; }

/* The search well: an inset field that becomes a card on focus (3.10's toolbar). */
.ansx-search {
    display: flex;
    flex: 1 1 16rem;
    align-items: center;
    gap: 8px;
    min-width: 12rem;
    height: 36px;
    padding: 0 10px 0 12px;
    border: 1px solid transparent;
    border-radius: var(--wf-radius-sm);
    background: var(--wf-inset);
    color: var(--theme-text-muted);
    transition: background var(--wf-motion), border-color var(--wf-motion);
}
.ansx-search:focus-within { border-color: var(--wf-primary-ink); background: var(--wf-card); box-shadow: var(--theme-focus-ring); }
.ansx-search-sm { flex: 0 1 16rem; }
.ansx-search-input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: var(--theme-text-emphasis); font: inherit; font-size: 13.5px; }
.ansx-search-input::placeholder { color: var(--theme-text-muted); }
.ansx-search-inans { display: inline-flex; flex: none; align-items: center; gap: 5px; margin: 0; color: var(--theme-text-secondary); font-size: 12.5px; white-space: nowrap; cursor: pointer; }

/* The launch-code pill (a deep link's campaign): the code chip and a clear. */
.ansx-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 4px 0 11px;
    border-radius: var(--wf-radius-pill);
    background: var(--wf-primary-soft);
    color: var(--wf-primary-ink);
    font-size: 13px;
    font-weight: 600;
}
.ansx-pill-x {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    cursor: pointer;
}
.ansx-pill-x:hover { background: color-mix(in srgb, var(--wf-primary-ink) 14%, transparent); }
.ansx-pill-x:focus-visible { outline: 2px solid var(--wf-primary-ink); outline-offset: 1px; }
.ansx-clear { margin-left: auto; }

/* The conversation picker: a searchable menu, each conversation with its live count and completed share. */
.ansx-wfpick-list.wf-action-menu-list { width: min(26rem, calc(100vw - 32px)); max-width: min(26rem, calc(100vw - 32px)); max-height: none; padding: 6px; }
.ansx-wfpick-search { position: relative; margin-bottom: 4px; }
.ansx-wfpick-search > .bi { position: absolute; top: 50%; left: 10px; color: var(--theme-text-muted); transform: translateY(-50%); pointer-events: none; }
.ansx-wfpick-search > input { padding-left: 30px; }
.ansx-wfpick-scroll { max-height: 18rem; overflow-y: auto; }
.ansx-wfpick-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    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;
}
.ansx-wfpick-item:hover { background: var(--wf-card-hover); }
.ansx-wfpick-item:focus-visible { outline: 2px solid var(--wf-primary-ink); outline-offset: -2px; }
.ansx-wfpick-item > .bi { color: var(--theme-text-muted); }
.ansx-wfpick-item.is-on { color: var(--theme-text-emphasis); font-weight: 600; }
.ansx-wfpick-item.is-on > .bi { color: var(--wf-primary-ink); }
.ansx-wfpick-name { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ansx-wfpick-meta { display: inline-flex; flex: none; align-items: center; gap: 8px; }
.ansx-wfpick-count { min-width: 1.5rem; color: var(--theme-text-muted); font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }
.ansx-wfpick-bar { display: inline-block; width: 3rem; height: 4px; overflow: hidden; border-radius: var(--wf-radius-pill); background: var(--wf-success-soft); }
.ansx-wfpick-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--theme-success); }
.ansx-wfpick-empty,
.ansx-wfpick-foot { padding: 8px 10px; color: var(--theme-text-muted); font-size: 12px; }
.ansx-wfpick-foot { margin-top: 4px; border-top: 1px solid var(--wf-line); }

/* =================================================================
   THE VIEW BAR (sticky just under the shell bar) + THE SELECTION BAR
   ================================================================= */
.ansx-viewbar {
    position: sticky;
    /* Right under the shell bar while it is on screen (--wf-sticky-top), never beneath it. */
    top: var(--wf-sticky-top);
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 6px 0;
    background: var(--wf-sheet);
    /* paint the page area's top padding too - nothing scrolls visibly above the bar */
    box-shadow: 0 -8px 0 var(--wf-sheet);
}
.ansx-views > button,
.ansx-jobs-tools .wf-seg > button,
.ansx-source > button { display: inline-flex; align-items: center; gap: 6px; }
.ansx-count { color: var(--theme-text-secondary); font-size: 13px; font-variant-numeric: tabular-nums; }
.ansx-inline-label { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--theme-text-muted); font-size: 12.5px; }

.ansx-bulk {
    position: sticky;
    top: calc(var(--wf-sticky-top) + 3.25rem);
    z-index: 19;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    padding: 8px 12px;
    border: 1px solid color-mix(in srgb, var(--wf-primary-ink) 30%, var(--wf-line));
    border-radius: var(--wf-radius-md);
    background: var(--wf-primary-soft);
    box-shadow: var(--wf-elev-2);
    color: var(--theme-text-emphasis);
    animation: ansx-rise 160ms var(--wf-ease);
}
.ansx-bulk-count { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 650; }
.ansx-bulk-count > .bi { color: var(--wf-primary-ink); }
.ansx-bulk-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ansx-export,
.ansx-more { flex: none; }
.ansx-export-list { min-width: 15rem; }
.ansx-toggle { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--theme-text-secondary); font-size: 12.5px; cursor: pointer; }
/* "Include internal moments" - quiet while it is off (the customer copy), amber while it is on (the team copy). */
.ansx-internal-switch { min-height: 32px; padding: 0 10px; border: 1px dashed var(--wf-line-strong); border-radius: var(--wf-radius-sm); }
.ansx-internal-switch.is-on { border-style: solid; border-color: var(--wf-warning-ink); background: var(--wf-warning-soft); color: var(--wf-warning-ink); font-weight: 650; }
.ansx-note {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 8px 8px 14px;
    border: 1px solid color-mix(in srgb, var(--wf-success-ink) 25%, var(--wf-line));
    border-radius: var(--wf-radius-md);
    background: var(--wf-success-soft);
    color: var(--wf-success-ink);
    font-size: 13px;
}
.ansx-note.is-error { border-color: color-mix(in srgb, var(--wf-danger-ink) 25%, var(--wf-line)); background: var(--wf-danger-soft); color: var(--wf-danger-ink); }
.ansx-note-text { flex: 1 1 14rem; min-width: 0; color: var(--theme-text-emphasis); }
@keyframes ansx-rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* =================================================================
   THE BODY - the honest states, then the runs
   ================================================================= */
.ansx-body { min-height: 12rem; min-width: 0; }
/* A read that failed: a calm card and Try again - never "no answers yet". */
.ansx-failed { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px 14px; padding: 16px 18px; }
.ansx-failed-words { flex: 1 1 18rem; min-width: 0; }
.ansx-failed-text { margin: 0; color: var(--theme-text-secondary); font-size: 13.5px; }
.ansx-failed-detail { margin: 2px 0 0; color: var(--theme-text-muted); font-size: 12px; overflow-wrap: anywhere; }
.ansx-empty-card { padding: 12px 0; overflow: visible; }
.ansx-first { padding: 20px 0; overflow: visible; }
.ansx-quiet-line { display: flex; align-items: center; gap: 8px; padding: 10px 0; color: var(--theme-text-muted); font-size: 13px; }
.ansx-quiet-line.is-error { color: var(--wf-danger-ink); }
.ansx-empty-inline { padding: 14px 0; color: var(--theme-text-muted); font-size: 13px; }
.ansx-skel-fill { position: absolute; inset: 0; border-radius: 0; }
.ansx-w-40 { width: 40%; }
.ansx-w-60 { width: 60%; }
.ansx-w-70 { width: 70%; }
.ansx-w-80 { width: 80%; }
.ansx-w-90 { width: 90%; }

/* ---- Cards: the whole card is a door, so it lifts on hover ---- */
.ansx-grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(16.25rem, 1fr)); gap: 16px; }
.ansx-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--wf-line);
    border-radius: var(--wf-radius-md);
    background: var(--wf-card);
    box-shadow: var(--wf-elev-1);
    cursor: pointer;
    transition: transform var(--wf-motion), box-shadow var(--wf-motion), border-color var(--wf-motion);
}
.ansx-card:hover { box-shadow: var(--wf-elev-2); transform: translateY(-1px); }
.ansx-card:focus-visible { outline: 2px solid var(--wf-primary-ink); outline-offset: 2px; }
.ansx-card.is-selected { border-color: var(--wf-primary-ink); box-shadow: 0 0 0 1px var(--wf-primary-ink), var(--wf-elev-1); }
.ansx-card.is-skeleton { cursor: default; }
.ansx-card.is-skeleton:hover { box-shadow: var(--wf-elev-1); transform: none; }
.ansx-card-hero { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--wf-inset); }
.ansx-card-hero > img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 400ms var(--wf-ease); }
.ansx-card:hover .ansx-card-hero > img { transform: scale(1.03); }
/* No photo: a slim band, not a tall empty frame (photo-less workspaces stay dense). */
.ansx-card-hero.is-glyph { height: 3rem; aspect-ratio: auto; border-bottom: 1px solid var(--wf-line); }
.ansx-card-glyph { position: absolute; top: 50%; right: 12px; color: var(--theme-text-muted); font-size: 1.35rem; transform: translateY(-50%); }
.ansx-card-more {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 24px;
    padding: 0 9px;
    border: 0;
    border-radius: var(--wf-radius-pill);
    /* The page colour on an overlay of the emphasis text: dark ink under light words on a light theme, a light
       overlay under dark words on a dark one. Never the primary's label - this pill is not on the primary
       (Tests/OnPrimaryLabelsSitOnThePrimaryTests). */
    background: color-mix(in srgb, var(--theme-text-emphasis) 72%, transparent);
    color: var(--theme-background);
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
}
.ansx-card-check {
    position: absolute;
    top: 8px;
    right: 8px;
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    margin: 0;
    border: 1px solid var(--wf-line);
    border-radius: var(--wf-radius-sm);
    background: color-mix(in srgb, var(--wf-card) 88%, transparent);
    backdrop-filter: blur(4px);
    color: var(--theme-text-secondary);
    opacity: 0;
    cursor: pointer;
    transition: opacity var(--wf-motion);
}
.ansx-card-check > input { position: absolute; opacity: 0; pointer-events: none; }
.ansx-card:hover .ansx-card-check,
.ansx-card:focus-within .ansx-card-check,
.ansx-card-check.is-on { opacity: 1; }
.ansx-card-check.is-on { border-color: var(--wf-primary-ink); color: var(--wf-primary-ink); }
.ansx-card-check:focus-within { outline: 2px solid var(--wf-primary-ink); outline-offset: 1px; }

/* The status: a word with its dot, on its soft tone (never colour alone). */
.ansx-stamp {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 22px;
    padding: 0 9px 0 8px;
    border-radius: var(--wf-radius-pill);
    background: var(--ansx-st-soft, var(--wf-neutral-soft));
    color: var(--ansx-st, var(--theme-text-secondary));
    font-size: 11.5px;
    font-weight: 650;
    white-space: nowrap;
}
.ansx-stamp > .bi { font-size: 11px; }
.ansx-card-hero > .ansx-stamp { position: absolute; top: 9px; left: 9px; box-shadow: 0 0 0 1px var(--wf-line); }
/* Over a photo the stamp sits on the card's own fill so it reads on any picture. */
.ansx-card-hero:not(.is-glyph) > .ansx-stamp { background: color-mix(in srgb, var(--wf-card) 90%, transparent); backdrop-filter: blur(4px); }
.ansx-stamp-sm { height: 20px; padding: 0 8px 0 7px; font-size: 11px; }
.ansx-stamp-dot { width: 8px; height: 8px; padding: 0; background: var(--ansx-st); }

.ansx-card-body { display: flex; flex: 1; flex-direction: column; gap: 8px; padding: 12px 14px 10px; }
.ansx-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ansx-who-text { display: flex; flex: 1; flex-direction: column; gap: 3px; min-width: 0; }
.ansx-who-name { overflow: hidden; color: var(--theme-text-emphasis); font-size: 14px; font-weight: 650; white-space: nowrap; text-overflow: ellipsis; }
.ansx-who-sub { overflow: hidden; color: var(--theme-text-secondary); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; text-overflow: ellipsis; }

/* A person's initials - ONE hue (the brand), its strength varying by person: a tenant palette is not categorical. The
   hue is the fill; the initials are the emphasis ink, legible on every strength in every theme (the brand's own ink
   fell to 3.5:1 on the stronger fills in dark and on a grey primary). Decorative beside the name: aria-hidden. */
.ansx-avatar {
    display: inline-grid;
    flex: none;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ansx-av-bg, var(--wf-primary-soft));
    color: var(--theme-text-emphasis);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.ansx-avatar-sm { width: 26px; height: 26px; font-size: 10px; }
.ansx-avatar-lg { width: 52px; height: 52px; font-size: 17px; }
.ansx-av-0 { --ansx-av-bg: var(--wf-primary-soft); }
.ansx-av-1 { --ansx-av-bg: color-mix(in srgb, var(--wf-primary-ink) 20%, var(--wf-card)); }
.ansx-av-2 { --ansx-av-bg: var(--wf-data-soft); }
.ansx-av-3 { --ansx-av-bg: color-mix(in srgb, var(--wf-primary-ink) 9%, var(--wf-card)); }
.ansx-av-4 { --ansx-av-bg: var(--wf-neutral-soft); }
.ansx-av-5 { --ansx-av-bg: color-mix(in srgb, var(--wf-primary-ink) 26%, var(--wf-card)); }

.ansx-card-wf { display: flex; align-items: baseline; gap: 8px; min-width: 0; font-size: 13px; }
.ansx-card-wfname { flex: 1; min-width: 0; overflow: hidden; color: var(--theme-text-secondary); font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.ansx-card-ago { flex: none; color: var(--theme-text-muted); font-size: 12px; white-space: nowrap; }
.ansx-card-ai {
    display: -webkit-box;
    margin: 0;
    padding: 8px 10px;
    overflow: hidden;
    border-radius: var(--wf-radius-sm);
    background: var(--wf-inset);
    color: var(--theme-text);
    font-size: 13px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}
.ansx-card-ai > .bi { margin-right: 6px; color: var(--wf-primary-ink); }
.ansx-card-hl { display: flex; flex-direction: column; gap: 3px; margin: 0; }
.ansx-hl-row { display: flex; gap: 8px; min-width: 0; font-size: 13px; }
.ansx-hl-row dt { flex: 0 0 40%; max-width: 40%; overflow: hidden; color: var(--theme-text-muted); font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.ansx-hl-row dd { flex: 1; min-width: 0; margin: 0; overflow: hidden; color: var(--theme-text-emphasis); font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
/* The work this run belongs to - leads the card, quieter than the answers under it. */
.ansx-card-facts .ansx-hl-row dd { color: var(--theme-text); font-weight: 650; }
.ansx-card-facts + .ansx-card-hl,
.ansx-card-facts + .ansx-card-ai { padding-top: 6px; border-top: 1px dashed var(--wf-line); }
.ansx-card-quiet { display: flex; align-items: center; gap: 6px; color: var(--theme-text-muted); font-size: 13px; }
.ansx-card-foot { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 9px 14px 11px; border-top: 1px solid var(--wf-line); }
.ansx-meta { display: inline-flex; align-items: center; gap: 5px; color: var(--theme-text-secondary); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ansx-meta > .bi { color: var(--theme-text-muted); }
.ansx-meta-job,
.ansx-meta-code { color: var(--theme-text-secondary); }
/* "Part of Move-in (2 of 4)" - the run's experience (L1). Neutral ink like the other facts: the Answer Center's colours are
   a run's state, never a family hue (3.3). A long name ellipsises, never widens the card. */
.ansx-meta-part { min-width: 0; max-width: 100%; }
.ansx-meta-part-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* =================================================================
   THE TABLES (List / Explorer / the Jobs grid, 3.10): one card each, the
   header sticky inside the card's own scroller, sentence case, hairline
   rows, no zebra; selected = primary soft.
   ================================================================= */
.ansx-table-card { min-width: 0; overflow: visible; }
.ansx-table-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 16px; }
.ansx-table-scroll {
    overflow: auto;
    max-height: calc(100vh - 13rem);
    border-top: 1px solid var(--wf-line);
    border-radius: 0 0 var(--wf-radius-md) var(--wf-radius-md);
}
.ansx-table { width: 100%; border-collapse: separate; border-spacing: 0; color: var(--theme-text); font-size: 13px; }
.ansx-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;
}
.ansx-table td { padding: 10px 12px; border-bottom: 1px solid var(--wf-line); background: var(--wf-card); vertical-align: middle; white-space: nowrap; }
.ansx-table tbody tr { cursor: pointer; }
.ansx-table tbody tr:last-child td { border-bottom: 0; }
.ansx-table tbody tr:hover td { background: var(--wf-card-hover); }
.ansx-table tbody tr.is-selected td { background: var(--wf-primary-soft); }
.ansx-table .is-num { font-variant-numeric: tabular-nums; text-align: right; }
.ansx-table td.is-num { color: var(--theme-text-emphasis); font-weight: 600; }
.ansx-col-check { width: 2.5rem; text-align: center; }
/* A table's select box sits in a label - its hit box (44px on a touch screen). */
.ansx-check-hit { display: inline-grid; place-items: center; margin: 0; cursor: pointer; }
.ansx-th-sort { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.ansx-th-sort > .bi { color: var(--theme-text-muted); font-size: 11px; opacity: .7; }
.ansx-th-sort.is-on,
.ansx-th-sort:hover { color: var(--theme-text-emphasis); }
.ansx-th-sort.is-on > .bi { color: var(--wf-primary-ink); opacity: 1; }
.ansx-th-sort:focus-visible { outline: 2px solid var(--wf-primary-ink); outline-offset: 2px; }
.ansx-cell-who { display: inline-flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; }
.ansx-cell-name { min-width: 0; overflow: hidden; color: var(--theme-text-emphasis); font-weight: 600; text-overflow: ellipsis; }
.ansx-cell-ai { display: inline-block; max-width: 28rem; overflow: hidden; color: var(--theme-text-secondary); white-space: nowrap; text-overflow: ellipsis; }
.ansx-cell-ai > .bi { margin-right: 5px; color: var(--wf-primary-ink); }
.ansx-cell-val { display: inline-block; max-width: 22rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ansx-thumbs { display: inline-flex; gap: 4px; }
.ansx-thumbs > img { width: 38px; height: 38px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-xs); background: var(--wf-inset); object-fit: cover; }
/* The Explorer keeps its first two columns in view while the questions scroll sideways - inside the card. */
.ansx-grid .ansx-sticky-0 { position: sticky; left: 0; z-index: 1; }
.ansx-grid .ansx-sticky-1 { position: sticky; left: 2.5rem; z-index: 1; box-shadow: 1px 0 0 var(--wf-line); }
.ansx-grid th.ansx-sticky-0,
.ansx-grid th.ansx-sticky-1 { z-index: 3; }

.ansx-colpick { min-width: 15rem; max-width: min(20rem, calc(100vw - 32px)); }
.ansx-colpick-wide.wf-action-menu-list { width: min(22rem, calc(100vw - 48px)); max-width: min(22rem, calc(100vw - 48px)); max-height: none; }
.ansx-colpick-scroll { max-height: 18rem; overflow-y: auto; }
.ansx-colpick-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    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;
}
.ansx-colpick-item:hover { background: var(--wf-card-hover); }
.ansx-colpick-item:focus-visible { outline: 2px solid var(--wf-primary-ink); outline-offset: -2px; }
.ansx-colpick-item > .bi { color: var(--theme-text-muted); }
.ansx-colpick-item > .bi-check-square-fill { color: var(--wf-primary-ink); }

/* ---- The Explorer's picker ---- */
.ansx-explore-pick { overflow: visible; padding-bottom: 18px; }
.ansx-explore-pick > .ansx-panel-head > .wf-tile-ic { flex: none; }
.ansx-explore-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 10px; padding: 16px 20px 0; }
.ansx-explore-tile {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--wf-line-strong);
    border-radius: var(--wf-radius-md);
    background: var(--wf-card);
    color: var(--theme-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color var(--wf-motion), background var(--wf-motion);
}
.ansx-explore-tile:hover { border-color: var(--wf-primary-ink); background: var(--wf-card-hover); }
.ansx-explore-tile:focus-visible { outline: 2px solid var(--wf-primary-ink); outline-offset: 2px; }
.ansx-explore-tile-name { overflow: hidden; color: var(--theme-text-emphasis); font-weight: 650; white-space: nowrap; text-overflow: ellipsis; }
.ansx-explore-tile-n { color: var(--theme-text-muted); font-size: 12px; }
.ansx-explore-tile .ansx-wfpick-bar { width: 100%; }
.ansx-explore-title { display: inline-flex; align-items: center; gap: 7px; min-width: 0; color: var(--theme-text-emphasis); font-weight: 650; }
.ansx-explore-title > .bi { color: var(--wf-primary-ink); }

/* ---- The map ---- */
.ansx-map { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 16px; }
.ansx-map-hint { margin: 0; color: var(--theme-text-secondary); font-size: 13px; }
.ansx-map-canvas { height: max(420px, calc(100vh - 18rem)); overflow: hidden; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-md); }

/* ---- The pager ---- */
.ansx-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; color: var(--theme-text-secondary); font-size: 13px; font-variant-numeric: tabular-nums; }

/* =================================================================
   THE JOBS VIEW (jobs tenants)
   ================================================================= */
.ansx-jobs { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ansx-jobs-tools { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px 16px; overflow: visible; }
.ansx-jobs-count { margin-left: auto; }
.ansx-skel-rows { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.ansx-skel-row { height: 52px; }
.ansx-kits { display: flex; flex-direction: column; gap: 10px; }
.ansx-kit { min-width: 0; }
.ansx-kit.is-open { box-shadow: var(--wf-elev-2); }
.ansx-kit-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    width: 100%;
    padding: 12px 16px;
    border: 0;
    background: transparent;
    color: var(--theme-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.ansx-kit-head:hover { background: var(--wf-card-hover); }
.ansx-kit-head:focus-visible { outline: 2px solid var(--wf-primary-ink); outline-offset: -2px; }
.ansx-kit-title { display: flex; flex: 1 1 14rem; flex-direction: column; min-width: 0; }
.ansx-kit-name { overflow: hidden; color: var(--theme-text-emphasis); font-weight: 650; text-overflow: ellipsis; }
.ansx-kit-anchor { color: var(--theme-text-secondary); font-size: 13px; }
.ansx-kit-progress { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-variant-numeric: tabular-nums; }
.ansx-kit-bar { width: 4.5rem; height: 6px; overflow: hidden; border-radius: var(--wf-radius-pill); background: var(--wf-success-soft); }
.ansx-kit-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--theme-success); }
.ansx-kit-chev { color: var(--theme-text-muted); transition: transform var(--wf-motion); }
.ansx-kit.is-open .ansx-kit-chev { transform: rotate(90deg); }
.ansx-kit-body { padding: 4px 16px 16px 62px; border-top: 1px solid var(--wf-line); }
.ansx-kit-steps { position: relative; margin: 0; padding: 0; list-style: none; }
.ansx-kit-steps::before { content: ""; position: absolute; top: 14px; bottom: 14px; left: 4px; width: 2px; background: var(--wf-line); }
.ansx-kit-step { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 0; }
.ansx-kit-step-dot { position: relative; z-index: 1; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--ansx-st, var(--theme-text-muted)); box-shadow: 0 0 0 3px var(--wf-card); }
.ansx-kit-step-main { display: flex; flex: 1 1 12rem; flex-direction: column; min-width: 0; }
.ansx-kit-step-name { color: var(--theme-text-emphasis); font-weight: 600; }
.ansx-kit-reports { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; padding: 12px 14px; border-radius: var(--wf-radius-md); background: var(--wf-inset); }
.ansx-kit-reports-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.ansx-kit-report { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }

/* =================================================================
   THE RUN DRAWER - slides in on the float surface over the one scrim.
   ================================================================= */
.ansx-drawer-backdrop { position: fixed; inset: 0; z-index: 1040; background: var(--wf-scrim); animation: ansx-fade 160ms var(--wf-ease); }
.ansx-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1041;
    display: flex;
    flex-direction: column;
    width: min(46rem, 100vw);
    border-left: 1px solid var(--wf-line);
    background: var(--theme-background-float);
    box-shadow: var(--wf-elev-3);
    animation: ansx-slide var(--wf-motion-panel) var(--wf-ease);
}
@keyframes ansx-slide { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes ansx-fade { from { opacity: 0; } to { opacity: 1; } }
.ansx-drawer-head { display: flex; flex-direction: column; gap: 12px; padding: 12px 20px 0; border-bottom: 1px solid var(--wf-line); }
.ansx-drawer-nav { display: flex; align-items: center; gap: 6px; }
.ansx-drawer-nav > .ms-auto { margin-left: auto; }
.ansx-drawer-runid { color: var(--theme-text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.ansx-drawer .ansx-iconbtn { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--wf-line-strong); border-radius: var(--wf-radius-sm); background: var(--wf-card); color: var(--theme-text); }
.ansx-drawer .ansx-iconbtn:hover:not(:disabled) { border-color: var(--wf-primary-ink); color: var(--wf-primary-ink); }
.ansx-drawer-who { display: flex; align-items: center; gap: 14px; min-width: 0; }
.ansx-drawer-who-text { min-width: 0; }
.ansx-drawer-name { overflow-wrap: anywhere; color: var(--theme-text-emphasis); font-size: var(--wf-text-h2); font-weight: 650; letter-spacing: -0.012em; line-height: 1.2; }
.ansx-drawer-name a { color: inherit; text-decoration: none; }
.ansx-drawer-contact { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: 13px; }
.ansx-drawer-contact a { color: var(--wf-primary-ink); text-decoration: none; }
.ansx-drawer-contact a:hover { text-decoration: underline; }
.ansx-drawer-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.ansx-drawer-wf { color: var(--theme-text-secondary); font-weight: 650; }
.ansx-drawer-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; }
/* The run's context facts (Dispatch # / PO # / Location ...) - a fact sheet in an inset well, sentence case. */
.ansx-drawer-context { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 8px 16px; margin: 0; padding: 10px 14px; border-radius: var(--wf-radius-md); background: var(--wf-inset); }
.ansx-drawer-context dt { color: var(--theme-text-muted); font-size: 12px; font-weight: 600; }
.ansx-drawer-context dd { margin: 0; overflow-wrap: anywhere; color: var(--theme-text-emphasis); font-weight: 600; }
.ansx-drawer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ansx-drawer-error { color: var(--wf-danger-ink); font-size: 13px; }
.ansx-tabs { display: flex; gap: 2px; margin-top: 2px; overflow-x: auto; scrollbar-width: none; }
.ansx-tabs::-webkit-scrollbar { display: none; }
.ansx-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 12px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--theme-text-secondary);
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}
.ansx-tab:hover { color: var(--theme-text-emphasis); }
.ansx-tab:focus-visible { outline: 2px solid var(--wf-primary-ink); outline-offset: -2px; }
.ansx-tab.is-on { border-bottom-color: var(--wf-primary-ink); color: var(--theme-text-emphasis); }
.ansx-tab-n { min-width: 20px; padding: 0 7px; border-radius: var(--wf-radius-pill); background: var(--wf-neutral-soft); color: var(--theme-text-secondary); font-size: 11.5px; font-weight: 700; line-height: 20px; text-align: center; }
.ansx-tab-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--wf-primary-ink); }
.ansx-drawer-body { flex: 1; min-height: 0; padding: 16px 20px 32px; overflow-y: auto; }
.ansx-drawer-loading { display: flex; align-items: center; gap: 8px; padding: 24px 0; color: var(--theme-text-muted); font-size: 13px; }

.ansx-qa { width: 100%; border-collapse: collapse; font-size: 13px; }
.ansx-qa th,
.ansx-qa td { padding: 9px 6px; border-bottom: 1px solid var(--wf-line); vertical-align: top; }
.ansx-qa th { width: 42%; color: var(--theme-text-secondary); font-weight: 550; }
.ansx-qa td { overflow-wrap: anywhere; color: var(--theme-text-emphasis); font-weight: 600; }
.ansx-qa tr.is-internal th,
.ansx-qa tr.is-internal td { background: var(--wf-warning-soft); }
.ansx-qa-ent { margin-top: 2px; font-weight: 400; }
.ansx-round { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 5px; padding: 0 6px; border-radius: var(--wf-radius-pill); background: var(--wf-neutral-soft); color: var(--theme-text-secondary); font-size: 11px; font-weight: 700; }
.ansx-internal { margin-left: 6px; color: var(--wf-warning-ink); font-size: 11.5px; font-weight: 700; }

.ansx-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 10px; }
.ansx-photo {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--wf-line);
    border-radius: var(--wf-radius-md);
    background: var(--wf-inset);
    color: var(--theme-text);
    font: inherit;
    text-decoration: none;
    cursor: zoom-in;
}
.ansx-photo:focus-visible { outline: 2px solid var(--wf-primary-ink); outline-offset: 2px; }
.ansx-photo > img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; transition: transform 300ms var(--wf-ease); }
.ansx-photo:hover > img { transform: scale(1.04); }
.ansx-photo.is-sig > img { background: var(--wf-card); object-fit: contain; }
.ansx-photo.is-file { align-items: center; justify-content: center; aspect-ratio: 1 / 1; color: var(--theme-text-muted); font-size: 2rem; cursor: pointer; }
.ansx-photo-cap { padding: 6px 8px; overflow: hidden; background: var(--wf-card); color: var(--theme-text-secondary); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.ansx-ai { display: flex; flex-direction: column; gap: 4px; }
.ansx-ai > .btn { align-self: flex-start; }
.ansx-ai-text { padding: 14px 16px; border-left: 3px solid var(--wf-primary-ink); border-radius: var(--wf-radius-md); background: var(--wf-inset); line-height: 1.55; white-space: pre-line; }

/* The Journey tab (PLAN 4.11) - the threads a run travelled, the one it is on now marked, each one's bindings in order. */
.ansx-journey { display: flex; flex-direction: column; gap: 12px; }
.ansx-journey-thread { padding: 12px 14px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-md); background: var(--wf-inset); font-size: 13px; }
.ansx-journey-thread.is-here { border-left: 3px solid var(--wf-primary-ink); }
.ansx-journey-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 4px; }
.ansx-journey-here { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; color: var(--wf-primary-ink); font-size: 11.5px; font-weight: 700; }
.ansx-journey-moves { margin: 8px 0 0; padding-left: 18px; }
.ansx-journey-moves li { display: flex; flex-wrap: wrap; gap: 6px; padding: 3px 0; }
.ansx-journey-reason { color: var(--theme-text-emphasis); font-weight: 600; }
.ansx-journey-when { margin-left: auto; }
/* A Waiting event among the thread's moves (Waiting, counted): the same line, its hourglass in the quiet ink. */
.ansx-wait-line .ansx-journey-reason { display: inline-flex; align-items: center; gap: 5px; }
.ansx-wait-line .bi { color: var(--theme-text-muted); }
/* A card's Waiting fact - neutral ink, like the experience it is part of. */
.ansx-wait-fact { color: var(--theme-text-secondary); }
.ansx-journey-forget { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; max-width: 420px; }

/* The photo lightbox - a dark room in every theme (a photo reads best on near-black), its words a near-white. */
.ansx-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 32px 64px;
    background: color-mix(in srgb, black 88%, transparent);
    animation: ansx-fade 150ms var(--wf-ease);
}
.ansx-lightbox figure { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 100%; max-height: 100%; margin: 0; }
.ansx-lightbox img { max-width: 100%; max-height: calc(100vh - 8rem); border-radius: var(--wf-radius-sm); box-shadow: var(--wf-elev-3); object-fit: contain; }
.ansx-lightbox figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; color: color-mix(in srgb, white 94%, transparent); font-size: 13px; }
.ansx-lightbox figcaption .ansx-muted { color: color-mix(in srgb, white 65%, transparent); }
.ansx-lightbox-open { color: color-mix(in srgb, white 82%, transparent); text-decoration: none; }
.ansx-lightbox-open:hover { color: color-mix(in srgb, white 100%, transparent); text-decoration: underline; }
.ansx-lightbox-x,
.ansx-lightbox-nav {
    position: absolute;
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: color-mix(in srgb, white 14%, transparent);
    color: color-mix(in srgb, white 94%, transparent);
    cursor: pointer;
}
.ansx-lightbox-x:hover,
.ansx-lightbox-nav:hover { background: color-mix(in srgb, white 26%, transparent); }
.ansx-lightbox-x:focus-visible,
.ansx-lightbox-nav:focus-visible { outline: 2px solid color-mix(in srgb, white 94%, transparent); outline-offset: 2px; }
.ansx-lightbox-x { top: 16px; right: 16px; }
.ansx-lightbox-nav.is-prev { top: 50%; left: 16px; transform: translateY(-50%); }
.ansx-lightbox-nav.is-next { top: 50%; right: 16px; transform: translateY(-50%); }

/* The correction and delete dialogs sit over the ONE scrim. */
.ansx-modal { z-index: 1070; background: var(--wf-scrim); backdrop-filter: blur(3px); }
.ansx-readonly { background: var(--wf-inset); }
.ansx-multi { padding: 8px 12px; border: 1px solid var(--wf-line-strong); border-radius: var(--wf-radius-sm); }

/* =================================================================
   NARROWER PAGES (the page area is the size container - .wf-page-area)
   ================================================================= */
@container page (max-width: 1000px) {
    .ansx-pair { grid-template-columns: minmax(0, 1fr); }
}

/* The runs tile takes the card's top row; the rest wrap under it. */
@container page (max-width: 760px) {
    .ansx-numbers { grid-template-columns: minmax(0, 1fr); }
}

/* THE STACKED LIST (760px of page and narrower - below that a row of columns cannot read): each run becomes a card.
   Who is its title, every other column a labelled line (data-label), the checkbox at the top right; the list stops
   scrolling in its own box and grows with the page. The header row is hidden (visually). Nothing scrolls sideways. */
@container page (max-width: 760px) {
    .ansx-table-scroll:has(> .ansx-runs) { max-height: none; overflow: visible; }
    .ansx-runs,
    .ansx-runs > tbody { display: block; width: 100%; }
    .ansx-runs > thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .ansx-runs > tbody > tr {
        position: relative;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px 14px;
        padding: 14px 52px 14px 16px;
        border-bottom: 1px solid var(--wf-line);
    }
    .ansx-runs > tbody > tr:last-child { border-bottom: 0; }
    .ansx-runs > tbody > tr > td { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; padding: 0; border: 0; background: transparent; white-space: normal; text-align: left; }
    .ansx-runs > tbody > tr > td.is-num { text-align: left; }
    /* A column with nothing to say for this run (no phone, no photos) is left out of its card, label and all. */
    .ansx-runs > tbody > tr > td:empty { display: none; }
    .ansx-runs > tbody > tr:hover > td,
    .ansx-runs > tbody > tr.is-selected > td { background: transparent; }
    .ansx-runs > tbody > tr:hover { background: var(--wf-card-hover); }
    .ansx-runs > tbody > tr.is-selected { background: var(--wf-primary-soft); }
    .ansx-runs > tbody > tr > td.ansx-col-check { position: absolute; top: 10px; right: 8px; display: grid; place-items: center; width: 36px; height: 36px; }
    .ansx-runs > tbody > tr > td.ansx-col-person { grid-column: 1 / -1; }
    .ansx-runs > tbody > tr > td.ansx-col-person::before { display: none; }
    .ansx-runs > tbody > tr > td.ansx-col-ai { grid-column: 1 / -1; }
    .ansx-runs > tbody > tr > td[data-label]::before { content: attr(data-label); color: var(--theme-text-muted); font-size: 11.5px; font-weight: 600; }
    .ansx-runs .ansx-cell-ai { max-width: 100%; white-space: normal; }
    .ansx-runs .ansx-cell-name { white-space: normal; }
}

/* THE PHONE */
@container page (max-width: 640px) {
    .ansx-pair { gap: 12px; }
    .ansx-panel-head { padding: 16px 16px 0; }
    .ansx-chart { padding: 10px 16px 16px; }
    .ansx-channel-bars { padding: 8px 16px 14px; }
    .ansx-skel-chart { margin: 16px; }
    .ansx-filters { padding: 12px; }
    /* The presets and the chip rows become swipe lists - the command bar stays short. */
    .ansx-presets,
    .ansx-views,
    .ansx-frow-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .ansx-presets::-webkit-scrollbar,
    .ansx-views::-webkit-scrollbar,
    .ansx-frow-chips::-webkit-scrollbar { display: none; }
    .ansx-presets > button,
    .ansx-views > button { flex: none; }
    .ansx-frow-chips { margin: 0 -12px; padding: 0 12px 2px; }
    .ansx-frow-chips .ansx-chips { flex-wrap: nowrap; }
    .ansx-frow-chips > *,
    .ansx-frow-chips .wf-chip-toggle { flex: none; }
    .ansx-clear { margin-left: 0; }
    .ansx-search { flex-basis: 100%; }
    .ansx-wfpick { max-width: 100%; }
    .ansx-viewbar .ansx-spacer { display: none; }
    .ansx-grid-cards { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    /* The selection bar is no longer sticky (it would cover the view bar once both wrap); its count and its switch
       take a row each, so Export starts its own row at the left and its menu opens inward. */
    .ansx-bulk { position: static; }
    .ansx-bulk .ansx-spacer { display: none; }
    .ansx-bulk-count,
    .ansx-internal-switch { flex-basis: 100%; }
    .ansx-table-tools { padding: 10px 12px; }
    .ansx-explore-tiles { grid-template-columns: minmax(0, 1fr); padding: 14px 16px 0; }
    .ansx-jobs-tools { padding: 10px 12px; }
    .ansx-jobs-count { flex-basis: 100%; margin-left: 0; }
    .ansx-kit-head { padding: 12px; }
    .ansx-kit-body { padding: 4px 12px 14px; }
    .ansx-map { padding: 12px; }
    .ansx-drawer-head { padding: 10px 14px 0; }
    .ansx-drawer-body { padding: 14px 14px 28px; }
    .ansx-lightbox { padding: 56px 8px; }
    .ansx-lightbox-nav.is-prev,
    .ansx-lightbox-nav.is-next { top: auto; bottom: 16px; transform: none; }
    .ansx-lightbox-nav.is-prev { left: 30%; }
    .ansx-lightbox-nav.is-next { right: 30%; }
}

/* Where the page header puts its actions at the LEFT (root.css: @media (max-width: 767.98px) - a viewport rule, so
   this one is too), the More menu - the first action - opens from its start, inward, never past the screen. */
@media (max-width: 767.98px) {
    .ansx-more-list[role="menu"] { right: auto; left: 0; max-width: calc(100vw - 32px); }
}

/* 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 (a dense desktop toolbar); on this page and its drawer EVERY small button -
   the header's More / Ask / Start fresh, Show as a table, the conversation picker, the Columns menus, Try again, the
   selection bar's - and every small select and field is a 44px target, and so is every segmented button. */
@media (pointer: coarse) {
    .ansx-page .btn-sm,
    .ansx-drawer .btn-sm,
    .ansx-page .form-select-sm,
    .ansx-page .form-control-sm { min-height: 44px; }
    .ansx-page .btn-sm,
    .ansx-drawer .btn-sm { min-width: 44px; }
    /* The page's menus (More, Export, Columns, the conversation picker) and the drawer's call / mail links. */
    .ansx-page .wf-action-menu-item { min-height: 44px; }
    .ansx-drawer-contact > a,
    .ansx-drawer-name > a { display: inline-flex; align-items: center; min-height: 44px; }
    .ansx-select { min-height: 44px; }
    .ansx-card-check { width: 44px; height: 44px; opacity: 1; }
    .ansx-card-more { height: 44px; padding: 0 14px; }
    /* 46 outside = a 44px input inside its 1px border. */
    .ansx-search { height: 46px; }
    .ansx-search-input { font-size: 16px; }
    /* "in answers": the label is the hit box, the search well's full height. So are Show routes, the internal-moments
       switches, a table's select boxes (their label) and its sort headers. */
    .ansx-search-inans { align-self: stretch; min-height: 44px; padding: 0 4px; }
    .ansx-toggle { min-height: 44px; }
    .ansx-check-hit { min-width: 44px; min-height: 44px; }
    .ansx-th-sort { min-height: 44px; }
    .ansx-iconbtn { min-width: 44px; min-height: 44px; }
    .ansx-drawer .ansx-iconbtn { width: 44px; height: 44px; }
    .ansx-wfpick-item,
    .ansx-colpick-item { min-height: 44px; }
    .ansx-pill-x { width: 36px; height: 36px; }
    .ansx-tab { height: 44px; }
    .ansx-internal-switch { min-height: 44px; }
    .ansx-views > button,
    .ansx-presets > button,
    .ansx-source > button,
    .ansx-jobs-tools .wf-seg > button { height: 44px; }
    /* Start fresh as the remembered-state chip: the chip and its clear are 44px tall (the plain link is a .btn-sm). */
    .ansx-reset.area-remember-chip { min-height: 44px; padding-right: 0; }
    .ansx-reset > .area-remember-clear { align-self: stretch; min-width: 44px; padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .ansx-card,
    .ansx-card-hero > img,
    .ansx-photo > img,
    .ansx-card-check,
    .ansx-search,
    .ansx-kit-chev { transition: none; }
    .ansx-card:hover,
    .ansx-card:hover .ansx-card-hero > img { transform: none; }
    .ansx-bulk,
    .ansx-drawer,
    .ansx-drawer-backdrop,
    .ansx-lightbox { animation: none; }
}
