/* ---------- Market potential (SA-031) ---------- */
.pot .panel + .panel { margin-top: 20px; }
.pot-intro { padding: 20px 32px; }
.pot-intro .mkt-def { margin: 0 0 10px; max-width: 1100px; }
.pot-legend { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 0.8rem; }
.pot-tag { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 10px; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; white-space: nowrap; border: 1px solid var(--border-strong); color: var(--text-gray); background: var(--white); line-height: 1.5; }
.pot-tag--data { border-color: var(--border-gray); color: var(--text-faint); }
.pot-tag--assumption { border-color: var(--accent); color: var(--accent-dark); }
.pot-tag--found { border-color: var(--primary); background: var(--primary); color: var(--white); }
.pot-tag--yours { border-color: var(--accent); background: var(--accent-wash); color: var(--accent-dark); }
.pot-tag--twins { border-color: var(--primary); color: var(--primary); }
.pot-legend .pot-tag { cursor: pointer; }

.pot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.pot-block { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pot-block__head h3 { font-size: 0.98rem; font-weight: 700; margin: 0; }
.pot-block__note { font-size: 0.82rem; color: var(--text-gray); line-height: 1.45; margin: 0; }
.pot-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-gray); margin-top: 4px; }
.pot-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 0.8rem; }
.pot-row .cell-muted { font-size: 0.78rem; line-height: 1.4; }
.pot-status { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; font-size: 0.78rem; }
.pot-status .badge { min-width: 0; padding: 2px 8px; font-size: 0.68rem; }
.pot-status__err { color: #B42318; font-size: 0.78rem; }
.pot-funnel { display: inline-flex; flex-wrap: wrap; gap: 2px 8px; }
.pot-funnel__changed { color: #B54708; }
.pot-funnel-now { margin: 8px 0 0; font-size: 0.78rem; }
.pot-summary { font-size: 0.82rem; line-height: 1.45; color: var(--ink-soft); margin: 0; }
.pot-progress { display: inline-block; width: 120px; height: 6px; border-radius: 3px; background: var(--light-gray); overflow: hidden; }
.pot-progress__fill { display: block; height: 100%; background: var(--accent); }
.pot-comp { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.pot-comp__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 6px; width: 100%; padding-bottom: 6px; border-bottom: 1px solid var(--border-gray); }
.pot-comp__notes { grid-column: 1 / -1; }
.pot-comp__row .ac-input, .pot-comp__row .fld { min-width: 0; }

.pot-table-panel { overflow: visible; }
.pot-bar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border-gray); font-size: 0.82rem; }
.pot-bar .ac-select { width: 260px; }
.pot-bar__picked { font-weight: 700; }
.pot-table { table-layout: fixed; }
.pot-table th, .pot-table td { padding: 9px 12px; vertical-align: top; }
.pot-table th.pot-tick, .pot-table td.pot-tick { width: 44px; padding-right: 0; }
.pot-table th:nth-child(2) { width: 16%; }
.pot-table th:nth-child(3) { width: 10%; }
.pot-table td { white-space: normal; }
.pot-table .ac-check { gap: 0; }
.pot-table .ac-check__label:empty { display: none; }
.pot-th { white-space: nowrap; }
.pot-table th.num { text-align: right; }
.pot-sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 2px; }
.pot-th.is-sorted .pot-sort { color: var(--primary); }
.pot-th .tip-icon { margin-left: 4px; vertical-align: -2px; }
.pot-segcell { display: table-cell; font-weight: 600; font-size: 0.84rem; line-height: 1.35; }
.pot-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.pot-country { font-size: 0.86rem; }
.pot-cell { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 2px; cursor: pointer; border-radius: 6px; padding: 2px 4px; margin: -2px -4px; position: relative; min-width: 72px; }
.pot-cell:hover, .pot-cell.has-tip--open { background: var(--light-gray); }
.pot-cell__top { display: flex; align-items: center; gap: 5px; justify-content: flex-end; flex-wrap: wrap; }
.pot-cell__v { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 0.9rem; }
.pot-cell__sub { font-size: 0.72rem; color: var(--text-gray); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pot-cell--empty .pot-cell__v { font-weight: 500; color: var(--text-faint); font-size: 0.8rem; }
.pot-cell--edit { outline: 1px dashed transparent; }
.pot-cell--edit:hover { outline-color: var(--border-strong); }
.pot-sizebar { display: block; height: 3px; background: var(--primary); border-radius: 2px; opacity: 0.35; align-self: flex-end; }
.pot-table tr.is-picked td { background: var(--accent-wash); }
.pot-more { margin: 12px 20px 16px; }

.pot-scen__tools .ac-select { width: 260px; }
/* Its buttons stand level with the select between them (ui:check-forms: top and bottom ±1 px). */
.pot-scen__tools > .btn { height: var(--ac-control-h); padding-top: 0; padding-bottom: 0; }
.pot-scen__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: 16px; }
.pot-scard { border: 1px solid var(--border-gray); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pot-scard__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pot-scard__head b { font-size: 0.98rem; }
.pot-scard__note { font-size: 0.78rem; }
.pot-scard__nums { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 4px 0 0; font-size: 0.84rem; }
.pot-scard__nums dt { color: var(--text-gray); }
.pot-scard__nums dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.pot-scard__nums dd .cell-muted { font-weight: 500; font-size: 0.76rem; }
.pot-scard__risk-head { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent-dark); margin-top: 4px; }
.pot-scard__risks { margin: 0; padding-left: 18px; font-size: 0.8rem; line-height: 1.45; display: flex; flex-direction: column; gap: 3px; }

.pot-dlg-field { margin-top: 12px; }
.pot-dlg-price { margin-top: 14px; font-weight: 600; }
.pot-checkgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 14px; margin-top: 10px; }
.pot-found { border-top: 1px solid var(--border-gray); padding: 10px 0; }
.pot-found__player { font-size: 0.84rem; line-height: 1.45; margin: 6px 0 0 26px; }
.pot-quote { font-size: 0.8rem; color: var(--text-gray); font-style: italic; margin-top: 2px; }
.pot-h3 { font-size: 0.92rem; font-weight: 700; margin: 18px 0 8px; }
.pot-note { white-space: normal; font-size: 0.82rem; line-height: 1.45; }
.pot-pick-note { margin: 18px 0 8px; }
@media (max-width: 1280px) { .pot-grid { grid-template-columns: 1fr; } }
.pot-scard__nums dd .cell-muted { display: block; line-height: 1.3; }

/* ---------- SA-009: the hypothesis library ---------- */

/* Book Forms' column filter (filter-popup.js) and its period panel, ported
   from admin.css: black and white, the accent for what is on. */
.th-inner { display: inline-flex; align-items: center; gap: 4px; }
.th-inner .tip-icon { margin-left: 0; }
.filter-btn {
    background: none; border: 0; padding: 2px; cursor: pointer; color: var(--text-faint);
    line-height: 0; border-radius: 4px; display: inline-flex;
}
.filter-btn:hover { color: var(--primary); }
.filter-btn.on { color: var(--accent); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: 0.85rem; color: var(--accent-dark); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.filter-pop,
.hint-pop {
    position: absolute; z-index: 60; background: var(--white);
    border: 1px solid var(--border-gray); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
}
.filter-pop { width: 280px; padding: 12px; }
.filter-pop__head { display: flex; gap: 16px; padding-bottom: 10px; margin-bottom: 8px; border-bottom: 1px solid var(--border-gray); }
.filter-pop__search { margin-bottom: 8px; }
/* (2026-10-22) the search box of the popup takes the popup's width (its own 280 px stuck out of the 280 px popup) */
.filter-pop__search .ac-search { display: flex; width: 100%; }
.filter-pop__search .ac-search input.ac-search__input { width: 100%; min-width: 0; }
.ac-search__clear[hidden] { display: none; }
.filter-pop__empty { padding: 12px 4px; color: var(--text-gray); font-size: 0.85rem; }
.filter-pop__list { max-height: 300px; overflow-y: auto; }
.filter-pop__list label { display: flex; align-items: center; gap: 8px; padding: 6px 4px; font-size: 0.88rem; cursor: pointer; border-radius: 6px; }
.filter-pop__list label:hover { background: var(--light-gray); }
.filter-pop__list label[hidden] { display: none; }
.hint-pop { max-width: 340px; padding: 12px 16px; font-size: 0.88rem; line-height: 1.6; }
.pick-list { display: flex; flex-direction: column; max-height: 320px; overflow-y: auto; }
.pick-item {
    border: 0; background: none; font: inherit; font-size: 0.85rem; text-align: left; padding: 7px 10px;
    border-radius: 8px; cursor: pointer; color: var(--primary); white-space: nowrap;
}
.pick-item:hover { background: var(--light-gray); }
.pick-item.is-on { color: var(--accent-dark); font-weight: 600; }
.period-now { font-size: 0.85rem; font-weight: 600; color: var(--primary); padding: 0 10px 8px; }
.period-custom { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--border-gray); }
.period-custom__title { font-size: 0.66rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-gray); padding: 0 10px 8px; }
.period-row { display: flex; align-items: center; gap: 8px; padding: 0 10px 8px; }
.period-row__label { width: 34px; font-size: 0.8rem; color: var(--text-gray); }
.period-row__fields { display: flex; gap: 6px; flex: 1; }
.period-panel .period-row__fields .ac-input { height: 32px; min-height: 32px; padding: 5px 8px; font-size: 0.85rem; }
.period-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px 2px; border-top: 1px solid var(--border-gray); flex-wrap: wrap; }
.period-error { font-size: 0.74rem; color: var(--accent-dark); line-height: 1.2; order: -1; flex: 1 0 100%; }
.period-error:empty { display: none; }
.period-empty { padding: 8px 6px 0; margin-top: 8px; border-top: 1px solid var(--border-gray); }

/* The table: fixed layout, fits 1440 without a sideways scroll; the statement
   takes what is left and wraps. */
.hlib-toolbar .tabs { margin-bottom: 0; }
.hlib-search input.ac-search__input { width: 300px; }
.hlib-table { table-layout: fixed; width: 100%; }
.hlib-table th, .hlib-table td { padding-left: 12px; padding-right: 12px; vertical-align: top; }
.hlib-table td { white-space: normal; line-height: 1.4; overflow-wrap: break-word; }
/* Widths that fit at 1280 and 1440 without a horizontal scroll (owner, 2026-09-30): the statement takes the rest. */
.hlib-table th.hlib-statement { width: auto; }
.hlib-table .hlib-segments { width: 16%; }
.hlib-table .hlib-run { width: 108px; }
.hlib-table .hlib-countries { width: 88px; }
.hlib-table .hlib-evidence { width: 142px; }
.hlib-table .hlib-verdict { width: 124px; }
.hlib-table .hlib-date { width: 96px; }
/* The verdict badge stays inside its column (it used to run into "Created"). */
.hlib-table td.hlib-verdict .verdict,
.hlib-table td.hlib-verdict .badge { max-width: 100%; min-width: 0; white-space: normal; text-align: center; line-height: 1.25; }
/* SA-009 fix (owner, 2026-09-29): a header wider than its column (label + sort arrow + filter button) ran past the
   table and, inside the rounded panel, gave a sideways scroll with the header's edge cut off. Headers wrap within
   their column instead. */
.hlib-table th { white-space: normal; }
.hlib-table .th-inner { display: flex; flex-wrap: wrap; max-width: 100%; row-gap: 2px; }
.hlib-statement__text { color: var(--primary); font-weight: 600; text-decoration: none; }
.hlib-statement__text:hover { text-decoration: underline; }
.hlib-sub { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; font-size: 0.76rem; color: var(--text-gray); }
.hlib-kind { font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.66rem; color: var(--primary); }
.hlib-status { font-weight: 600; }
.hlib-status--rejected { color: var(--accent-dark); }
.hlib-row--rejected td { opacity: 0.6; }
.hlib-seg { font-size: 0.82rem; line-height: 1.35; }
.hlib-seg + .hlib-seg { margin-top: 4px; }
.hlib-seg b { font-weight: 600; margin-right: 2px; }
.hlib-seg span { color: var(--text-gray); }
.hlib-arch { margin-left: 6px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-faint) !important; }
.hlib-countries { font-size: 0.82rem; color: var(--text-gray); font-variant-numeric: tabular-nums; }
.hlib-level { font-size: 0.84rem; white-space: nowrap; }
.hlib-none { font-size: 0.8rem; color: var(--text-faint); }
.hlib-date { font-size: 0.84rem; color: var(--text-gray); white-space: nowrap; }
.hlib-link { color: var(--primary); text-decoration: underline; text-decoration-color: var(--border-strong); }
.hlib-link:hover { text-decoration-color: var(--primary); }
.hlib-clear { margin-left: 4px; }

/* One hypothesis. */
.hyp__page { margin-left: auto; font-weight: 600; color: var(--accent-dark); text-decoration: none; }
.hyp__page:hover { text-decoration: underline; }
.hyp__head .badge + .hyp__page { margin-left: 0; }
.hpage-headtext { min-width: 0; }
.hpage-title { font-size: 1.3rem; line-height: 1.35; max-width: 820px; }
.hpage-running { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; padding: 14px 20px; color: var(--primary); text-decoration: none; }
.hpage-panel .hpage-field { margin-top: 14px; font-size: 0.9rem; }
.hpage-panel .hpage-field p { margin-top: 2px; line-height: 1.5; }
.hpage-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 24px; }
.hpage-grid .hpage-field { margin-top: 8px; }
.hpage-seg { margin-top: 3px; font-size: 0.9rem; }
.hpage-source { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin: 6px 0 14px; font-size: 0.9rem; }
.hpage-quote { margin-top: 12px; }
.hpage-quote blockquote { margin: 0; padding-left: 12px; border-left: 3px solid var(--accent); font-style: italic; color: var(--ink-soft); line-height: 1.5; }
.hpage-quote cite { font-style: normal; color: var(--text-gray); font-size: 0.84rem; }
.hpage-reply { margin: 6px 0 0 15px; }
.hpage-reply > .fold-details__head { cursor: pointer; font-size: 0.8rem; font-weight: 600; color: var(--text-gray); }
.hpage-reply__text { margin-top: 6px; padding: 10px 14px; background: var(--light-gray); border-radius: 8px; white-space: pre-wrap; font-size: 0.86rem; line-height: 1.55; }
.hpage-test { padding: 16px 0; border-top: 1px solid var(--border-gray); }
.hpage-test:first-of-type { margin-top: 8px; }
.hpage-test__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 0.84rem; }
.hpage-test__head .test-link { margin-left: auto; }
.hpage-test__headline { margin-top: 8px; font-weight: 600; line-height: 1.45; }
.hpage-results { margin-top: 10px; }
.hpage-table .test-cell { min-width: 140px; }
.hpage-history { list-style: none; margin: 10px 0 0; padding: 0; }
.hpage-history__item { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 0; border-top: 1px solid var(--border-gray); font-size: 0.88rem; }
.hpage-history__item:first-child { border-top: 0; }
.hpage-history__date { width: 64px; color: var(--text-gray); font-variant-numeric: tabular-nums; }

/* ---------- SA-046: Ad messages ---------- */
.adm .panel { padding: 24px 32px; }
.adm .msg-intro { padding: 0; }
.msg-steps { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 0.86rem; line-height: 1.5; color: var(--ink-soft); max-width: 1100px; }
.msg-bar { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; margin-bottom: 14px; }
.msg-bar h2 { font-size: 1.05rem; font-weight: 700; margin: 0; flex: 0 0 auto; align-self: center; }
.msg-bar > .cell-muted { font-size: 0.82rem; align-self: center; }
.msg-seg-pick { width: 360px; }
.msg-country-pick { width: 200px; }
.msg-note { font-size: 0.8rem; color: var(--text-gray); line-height: 1.45; margin: 8px 0 12px; max-width: 1100px; }
.msg-empty { font-size: 0.88rem; color: var(--text-gray); margin: 0; }
.msg-hyp { display: flex; gap: 10px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--border-gray); }
.msg-hyp .ac-check { margin-top: 2px; gap: 0; }
.msg-hyp .ac-check__label:empty { display: none; }
.msg-hyp__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1 1 auto; }
.msg-hyp__title { color: var(--primary); font-weight: 600; text-decoration: none; line-height: 1.4; }
.msg-hyp__title:hover { text-decoration: underline; }
.msg-hyp__sub { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 0.8rem; line-height: 1.4; }
.msg-hyp__sub .badge { min-width: 0; padding: 2px 8px; font-size: 0.68rem; }
.msg-hyp__nums { display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.78rem; }
.msg-chip { padding: 2px 8px; border: 1px solid var(--border-strong); border-radius: 10px; cursor: pointer; font-variant-numeric: tabular-nums; }
.msg-chip--best { border-color: var(--primary); font-weight: 700; }
.msg-form.fgrid { grid-template-columns: minmax(0, 2fr) 140px minmax(0, 2fr); column-gap: 20px; --fgap: 16px; }
.msg-form__hint { font-size: 0.76rem; line-height: 1.4; }
.msg-form .ac-select, .msg-form .ac-input { width: 100%; }
.msg-actions { margin-top: 16px; }
.msg-drafts { margin-top: 14px; }
.msg-draft-pick { width: 320px; }
.adm .pot-status { margin-top: 10px; }
.msg-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; }
.msg-card { border: 1px solid var(--border-gray); border-radius: 10px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; background: var(--white); }
.msg-card--control { background: var(--light-gray); }
.msg-card--winner { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.msg-card--dropped { opacity: 0.55; }
.msg-card__head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.msg-card__label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-gray); }
.msg-card__head .badge { min-width: 0; padding: 2px 8px; font-size: 0.68rem; }
.msg-win { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--white); background: var(--accent); border-radius: 10px; padding: 1px 8px; }
.msg-card__idea { font-weight: 700; margin: 0; line-height: 1.35; }
.msg-card__arg { margin: 0; font-size: 0.85rem; line-height: 1.5; color: var(--ink-soft); overflow-wrap: anywhere; }
.msg-rests { display: flex; flex-direction: column; gap: 2px; font-size: 0.8rem; line-height: 1.4; padding: 8px 10px; border-left: 3px solid var(--border-strong); background: var(--light-gray); border-radius: 0 6px 6px 0; }
.msg-rests__opt { color: var(--ink-soft); overflow-wrap: anywhere; }
.msg-rests__num { font-weight: 600; font-variant-numeric: tabular-nums; }
.msg-field { display: flex; flex-direction: column; }
.msg-field .fld__ctl { display: flex; flex-direction: column; gap: 6px; }
.msg-field .fld__head { align-items: center; justify-content: flex-start; }
.msg-field .fld__head > :not(.fld__label) { margin-left: 0; }
.msg-field__head { display: flex; gap: 8px; align-items: center; }
.msg-field__line { display: flex; gap: 8px; align-items: center; }
.msg-field__line .ac-select { width: 150px; flex: 0 0 auto; }
.msg-field__line .ac-input { flex: 1 1 auto; min-width: 0; }
.msg-field .ac-input--area { min-height: 0; resize: vertical; font-size: 0.86rem; line-height: 1.45; padding-top: 8px; padding-bottom: 8px; }
.msg-why { margin: 0; font-size: 0.78rem; line-height: 1.45; color: var(--text-gray); overflow-wrap: anywhere; }
.msg-texts { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--border-gray); padding-top: 10px; }
.msg-text { display: flex; flex-direction: column; gap: 4px; }
.msg-text__head { display: flex; gap: 8px; align-items: center; font-size: 0.74rem; }
.msg-text__lang { font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.7rem; }
.msg-text__edit { margin-left: auto; border: 0; background: none; font: inherit; font-size: 0.76rem; color: var(--text-gray); text-decoration: underline; cursor: pointer; padding: 0; }
.msg-text__edit:hover { color: var(--primary); }
.msg-text__body { margin: 0; font-size: 0.9rem; line-height: 1.5; overflow-wrap: anywhere; }
.msg-stale { padding-top: 4px; }
.msg-card__foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: auto; padding-top: 6px; font-size: 0.78rem; }
.msg-prompt { margin-top: 10px; }
.msg-prompt .msg-text__edit { margin-left: 0; }
.msg-prompt p { font-size: 0.8rem; margin: 6px 0; }
.msg-prompt__text { white-space: pre-wrap; font-family: inherit; font-size: 0.78rem; line-height: 1.5; background: var(--light-gray); border-radius: 8px; padding: 12px 14px; max-height: 320px; overflow: auto; color: var(--ink-soft); }
.msg-result { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.msg-headline { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 8px; background: var(--light-gray); font-size: 0.88rem; line-height: 1.45; }
.msg-headline--win { background: var(--accent-wash); }
.msg-table-wrap { border: 1px solid var(--border-gray); border-radius: 8px; }
.msg-table { table-layout: fixed; }
.msg-table th, .msg-table td { padding: 9px 12px; vertical-align: top; white-space: normal; }
.msg-table th:nth-child(1) { width: 30%; }
.msg-table th:nth-child(2) { width: 16%; }
.msg-table th.num { width: 10.8%; text-align: right; white-space: normal; }
.msg-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.msg-table td.num b { display: block; }
.msg-table tbody tr { cursor: default; }
.msg-table .msg-row--win td { background: var(--accent-wash); }
.msg-table .msg-row--control td { color: var(--text-gray); }
.msg-range { display: block; font-size: 0.72rem; color: var(--text-faint); }
.msg-up { color: var(--primary); }
.msg-down { color: var(--accent-dark); }
.msg-cell-msg { overflow-wrap: anywhere; }
.msg-langs-result, .msg-quotes { display: flex; flex-direction: column; gap: 6px; font-size: 0.82rem; }
.msg-lang-line { display: flex; flex-wrap: wrap; gap: 4px 12px; line-height: 1.45; }
.msg-quote { margin: 0; line-height: 1.45; }

/* ---------- SA-047: Validation ---------- */
/* The picked files of a dialog (Book Forms' ac-files chips). */
.ac-files { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.ac-files__chips { display: flex; flex-wrap: wrap; gap: 6px; max-width: 100%; }
.ac-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 8px; border: 1px solid var(--border-gray); border-radius: 8px; background: var(--light-gray); font-size: 0.8rem; color: var(--primary); text-decoration: none; }
.ac-chip__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-chip__size { flex: 0 0 auto; color: var(--text-gray); font-variant-numeric: tabular-nums; }
.ac-chip__drop { flex: 0 0 auto; border: 0; padding: 0 2px; background: none; color: var(--text-gray); font-size: 0.95rem; line-height: 1; cursor: pointer; }
.ac-chip__drop:hover { color: var(--accent); }

.val-seg-pick { width: 300px; }
.val-lang-pick { width: 180px; }
.val-bar-end { margin-left: auto; }
.val-winners { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.val-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; align-items: start; }
.val-card { gap: 8px; }
.val-card--proposed { border-style: dashed; border-color: var(--accent); }
.val-card .pot-tag { font-size: 0.68rem; }
.val-changes__list { margin: 4px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.val-scenes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border-top: 1px solid var(--border-gray); }
.val-scene { padding: 8px 0; border-bottom: 1px solid var(--border-gray); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.val-scene:last-child { border-bottom: 0; }
.val-scene__head { display: flex; gap: 8px; align-items: baseline; font-size: 0.8rem; }
.val-scene__edit { margin-left: auto; }
.val-scene__line { margin: 0; font-size: 0.84rem; line-height: 1.45; overflow-wrap: anywhere; }
.val-scene__k { display: inline-block; min-width: 72px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-gray); margin-right: 6px; }
.val-thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.val-thumbs img { max-width: 100%; max-height: 220px; border-radius: 6px; border: 1px solid var(--border-gray); object-fit: contain; background: var(--light-gray); }
.val-video { display: flex; flex-direction: column; gap: 6px; }
.val-video__player { width: 100%; max-height: 320px; border-radius: 8px; background: #000; }
.val-transcript { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 0.8rem; }
.val-transcript .msg-prompt__text { flex: 1 0 100%; margin: 0; }
.val-transcript .pot-row { flex: 1 0 100%; }
.val-dlg-grid.fgrid { --fgap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); column-gap: 16px; margin: 10px 0 calc(10px - var(--fgap)); }
.val-dlg-grid .ac-select, .val-dlg-grid .ac-input { width: 100%; }
.val-static { display: block; padding-top: 10px; font-size: 0.85rem; }
.val-dlg-note { font-size: 0.78rem; line-height: 1.45; }
.val-dlg-list { margin: 6px 0; padding-left: 18px; font-size: 0.8rem; line-height: 1.5; }
.val-dlg-warn { font-size: 0.8rem; color: var(--accent-dark); margin: 4px 0; }
.val-table th:nth-child(1) { width: 24%; }
.val-table th:nth-child(2) { width: 18%; }
.val-table th.num { width: 11.6%; }
.val-h3 { font-size: 0.92rem; font-weight: 700; margin: 6px 0 0; }
.val-maps { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; }
.val-map { border: 1px solid var(--border-gray); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.val-map--control { background: var(--light-gray); }
.val-map__head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: 0.84rem; }
.val-bars { display: flex; gap: 4px; align-items: flex-end; height: 120px; }
.val-bar { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; height: 100%; cursor: pointer; }
.val-bar__v { font-size: 0.66rem; color: var(--text-gray); font-variant-numeric: tabular-nums; }
.val-bar__track { flex: 1 1 auto; width: 100%; max-width: 38px; background: var(--light-gray); border-radius: 4px 4px 0 0; display: flex; align-items: flex-end; overflow: hidden; }
.val-bar__fill { width: 100%; background: var(--primary); }
.val-bar--drop .val-bar__fill { background: var(--accent); }
.val-bar--drop .val-bar__v { color: var(--accent-dark); font-weight: 700; }
.val-bar__k { font-size: 0.7rem; color: var(--text-gray); }
.val-words { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; }
.val-ba { border: 1px solid var(--accent); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.val-ba__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.val-ba__cell { display: flex; flex-direction: column; gap: 2px; font-variant-numeric: tabular-nums; }
.val-ba__cell b { font-size: 1.05rem; }
.val .msg-bar h2 { flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; }
.val-bars { height: 150px; }
.val-ba__maps { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }

