/* PathKEY — Operations (Overview, Coaches, Respondents, Activity, Settings),
 * Content (Languages, Interface text) and "View as coach". Owned by the admin,
 * access & settings workstream.
 * Role tokens (css/tokens.css) and foundation components (styles.css) only. */

/* ---------------------------------------------------------- page frame --- */
.adm-grid { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: var(--sp-5); align-items: start; }
.adm-main, .adm-side { display: flex; flex-direction: column; gap: var(--sp-5); min-width: 0; }
.adm-updated { display: inline-flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-12); color: var(--text-muted); white-space: nowrap; }
.adm-page .kpi-sub { display: block; }
.adm-page .kpi-sub .icon { vertical-align: -2px; margin-right: 3px; }
.adm-sub { font-size: var(--fs-12); line-height: var(--lh-12); color: var(--text-muted); font-weight: var(--fw-regular); }
.adm-sub .icon { color: var(--icon); }
.adm-sub-inline { color: var(--text-muted); font-weight: var(--fw-regular); }
.adm-muted { color: var(--text-muted); font-weight: var(--fw-regular); }
.adm-strong { font-weight: var(--fw-medium); color: var(--text); }
.adm-stack { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.adm-nowrap { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.adm-link { color: var(--text-link); text-decoration: none; font-weight: var(--fw-medium); }
.adm-link:hover { text-decoration: underline; }
.adm-error-text { color: var(--crit-text); display: flex; align-items: center; gap: 5px; }

/* ------------------------------------------------ list report: filters --- */
.adm-list .card-body, .adm-list > .dt-wrap { min-width: 0; }
.adm-filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line-soft); background: var(--bg-surface);
}
.adm-search { flex: 1 1 240px; max-width: 340px; }
.adm-filters .select { width: auto; max-width: 220px; }
.adm-count { margin-left: auto; font-size: var(--fs-12); color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.adm-pager { display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-2); padding: var(--sp-2) var(--sp-4); border-top: 1px solid var(--line-soft); font-size: var(--fs-12); color: var(--text-muted); }
.adm-pager > span { margin-right: auto; }

/* ------------------------------------------------------- table cells --- */
.adm-page .dt-primary { text-decoration: none; }
.adm-page .dt-primary:hover { text-decoration: none; }
.adm-who { display: inline-flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.adm-who-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.adm-who-name { display: inline-flex; align-items: center; gap: var(--sp-2); font-weight: var(--fw-medium); color: var(--text); }
.adm-who-name .tag { height: 18px; padding: 0 7px; font-size: 10px; }
.adm-page tr.is-link:hover .adm-who-name { color: var(--accent-text); }
.adm-row-open {
  display: inline; padding: 0; border: 0; background: none; text-align: left; cursor: pointer;
  font: var(--fw-medium) var(--fs-13)/var(--lh-13) var(--font-ui); color: var(--text); border-radius: var(--r-4);
}
.adm-row-open:hover { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
.adm-row-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: var(--sp-1); width: 100%; }
.adm-page td:has(> .adm-row-actions), .adm-page td:has(> .menu-anchor) { width: 1%; white-space: nowrap; text-align: right; }
.adm-credits { display: inline-flex; justify-content: flex-end; }
.adm-credits .meter { height: 4px; }
.adm-credits .meter-label { min-width: 44px; text-align: left; font-size: var(--fs-13); color: var(--text); }
/* Last active (left-aligned) follows three right-aligned numbers: a gutter between them */
.adm-coaches-dt table.dt :is(th, td):nth-child(6) { padding-left: var(--sp-6); }
.adm-page td:has(> [data-m="act"]) { width: 1%; white-space: nowrap; text-align: right; }
/* the line a phone card shows under a row's name */
.adm-m, .adm-m-inline { display: none; }
.adm-m { font-size: var(--fs-12); line-height: var(--lh-12); color: var(--text-muted); font-weight: var(--fw-regular); }
.adm-m .lang-pill { vertical-align: 1px; }
.adm-m-part { white-space: nowrap; }
.adm-delta { font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; white-space: nowrap; }
.adm-delta[data-sign="up"] { color: var(--ok-text); }
.adm-delta[data-sign="down"] { color: var(--text-2); }

/* ------------------------------------------------------ coach object page --- */
.adm-object .tabbar { margin-top: calc(-1 * var(--sp-2)); }
.adm-tab { display: flex; flex-direction: column; gap: var(--sp-5); min-width: 0; }
.adm-coachpage { display: flex; gap: var(--sp-4); align-items: flex-start; }
.adm-coachpage-text { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; }
.adm-coachpage-name { font-size: var(--fs-16); line-height: var(--lh-16); font-weight: var(--fw-semibold); }
.adm-bio { font-size: var(--fs-13); line-height: 20px; color: var(--text-2); max-width: 64ch; margin-top: var(--sp-1); white-space: pre-line; }
.adm-credit-row { display: flex; flex-direction: column; gap: 6px; }
.adm-credit-row + .adm-credit-row { border-top: 1px solid var(--line-soft); padding-top: var(--sp-4); }
.adm-credit-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); font-size: var(--fs-13); font-weight: var(--fw-medium); }
.adm-credit-head strong { font-size: var(--fs-20); line-height: var(--lh-20); font-weight: var(--fw-bold); color: var(--text-kpi); }
.adm-stackbar { display: flex; gap: 2px; height: 8px; border-radius: var(--r-full); overflow: hidden; background: var(--data-track); }
.adm-stackbar i { display: block; min-width: 4px; transition: flex-grow var(--dur-4) var(--ease-move); }
.adm-stackbar i[data-part="available"], .adm-legend [data-part="available"]::before { background: var(--data-fill); }
.adm-stackbar i[data-part="reserved"], .adm-legend [data-part="reserved"]::before { background: var(--accent-line); }
.adm-stackbar i[data-part="expired"], .adm-legend [data-part="expired"]::before { background: var(--highlight); }
.adm-stackbar i[data-part="used"], .adm-legend [data-part="used"]::before { background: var(--line-control); }
.adm-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); font-size: var(--fs-12); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.adm-legend li { display: inline-flex; align-items: center; gap: 6px; }
.adm-legend li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.adm-legend strong { color: var(--text-2); font-weight: var(--fw-semibold); }
/* an empty state inside a card that has more than it: flat, the wash belongs to whole-card states */
.adm-flat-empty .empty-state, .adm-page .card .dt-empty .empty-state { background: none; }
.adm-flat-empty .empty-state { padding: var(--sp-6) var(--sp-4); }
.adm-facts { margin: 0; display: flex; flex-direction: column; }
.adm-facts > div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: var(--sp-3); padding: var(--sp-2) 0; border-bottom: 1px solid var(--line-soft); }
.adm-facts > div:last-child { border-bottom: 0; }
.adm-facts dt { font-size: var(--fs-12); color: var(--text-muted); }
.adm-facts dd { margin: 0; font-size: var(--fs-13); color: var(--text); overflow-wrap: anywhere; }
.adm-access-row { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-4) 0; border-bottom: 1px solid var(--line-soft); }
.adm-access-row:first-child { padding-top: 0; }
.adm-access-row:last-child { border-bottom: 0; padding-bottom: 0; }
.adm-access-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.adm-access-label { font-size: var(--fs-11); font-weight: var(--fw-bold); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--text-muted); }
.adm-access-value { font-size: var(--fs-14); font-weight: var(--fw-medium); overflow-wrap: anywhere; }
.adm-access-action { flex: none; }

/* ------------------------------------------------------------ timeline --- */
.adm-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.adm-timeline > li { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: var(--sp-3); align-items: start; padding: var(--sp-2) 0; }
.adm-timeline > li:not(:last-child)::before { content: ""; position: absolute; left: 13.5px; top: 40px; bottom: -4px; width: 1px; background: var(--line); }
.adm-tl-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.adm-tl-text { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-13); line-height: 19px; color: var(--text-2); padding-top: 4px; min-width: 0; overflow-wrap: anywhere; }
.adm-tl-text strong { color: var(--text); font-weight: var(--fw-semibold); }
.adm-timeline .adm-delta { padding-top: 5px; font-size: var(--fs-13); }

/* ------------------------------------------------------------ overview --- */
.adm-attention { list-style: none; margin: 0; padding: 0; }
.adm-attention-item {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--sp-3); align-items: center;
  padding: var(--sp-3) var(--sp-5); border-bottom: 1px solid var(--line-soft); transition: background var(--dur-1) var(--ease);
}
.adm-attention-item:last-child { border-bottom: 0; }
.adm-attention-item:hover { background: var(--bg-subtle); }
.adm-attention-item[data-tone="gold"] { box-shadow: inset 3px 0 0 var(--highlight); }
.adm-attention-item[data-tone="crit"] { box-shadow: inset 3px 0 0 var(--crit); }
.adm-attention-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.adm-attention-title { font-size: var(--fs-14); line-height: var(--lh-14); font-weight: var(--fw-medium); color: var(--text); }
.adm-chart { margin: 0; }
.adm-chart-bars { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--sp-3); align-items: end; height: 132px; }
.adm-chart-col { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; }
.adm-chart-value { min-height: 16px; font-size: var(--fs-12); font-weight: var(--fw-medium); color: var(--text-2); }
.adm-chart-bar {
  width: 100%; max-width: 40px; height: max(var(--h), 2px); max-height: calc(100% - 44px); border-radius: var(--r-6) var(--r-6) var(--r-2) var(--r-2);
  background: linear-gradient(to top, var(--data), var(--accent-line)); transform-origin: bottom; animation: adm-rise var(--dur-4) var(--ease-enter) both;
}
.adm-chart-col.is-empty .adm-chart-bar { background: var(--data-track); }
.adm-chart-col:nth-child(2) .adm-chart-bar { animation-delay: var(--stagger); }
.adm-chart-col:nth-child(3) .adm-chart-bar { animation-delay: calc(var(--stagger) * 2); }
.adm-chart-col:nth-child(4) .adm-chart-bar { animation-delay: calc(var(--stagger) * 3); }
.adm-chart-col:nth-child(5) .adm-chart-bar { animation-delay: calc(var(--stagger) * 4); }
.adm-chart-col:nth-child(6) .adm-chart-bar { animation-delay: calc(var(--stagger) * 5); }
.adm-chart-col.is-current .adm-chart-bar { box-shadow: inset 0 3px 0 var(--highlight); }
.adm-chart-col.is-current .adm-chart-value { color: var(--text); font-weight: var(--fw-bold); }
.adm-chart-col.is-current .adm-chart-label { color: var(--text); font-weight: var(--fw-medium); }
.adm-spark { display: inline-block; vertical-align: -3px; margin-right: var(--sp-2); }
.adm-spark rect { fill: var(--accent-line); }
.adm-spark rect.is-current { fill: var(--data); }
.adm-chart-label { font-size: var(--fs-12); color: var(--text-muted); }
@keyframes adm-rise { from { transform: scaleY(0); } to { transform: none; } }
.adm-products { list-style: none; margin: 0; padding: 0; }
.adm-products li { position: relative; display: flex; align-items: center; gap: var(--sp-2); border-bottom: 1px solid var(--line-soft); }
.adm-products li:last-child { border-bottom: 0; }
.adm-products a { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: var(--sp-3) var(--sp-5); text-decoration: none; }
.adm-products a::after { content: ""; position: absolute; inset: 0; }
.adm-products a:focus-visible { box-shadow: none; }
.adm-products li:has(a:focus-visible) { box-shadow: var(--focus-ring-inset); }
.adm-products li:hover { background: var(--bg-subtle); }
.adm-products li > .icon { margin-right: var(--sp-4); color: var(--icon); transition: transform var(--dur-1) var(--ease); }
.adm-products li:hover > .icon { transform: translateX(2px); color: var(--accent); }

/* --------------------------------------------------------- person drawer --- */
.adm-person-summary { font-size: var(--fs-13); color: var(--text-2); }
.adm-person-report { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-12); }
.adm-person-report-head { display: flex; align-items: center; gap: var(--sp-2); }
.adm-person-actions { display: flex; flex-wrap: wrap; gap: var(--sp-1); margin-top: var(--sp-1); }
.adm-consequence { padding: var(--sp-2) var(--sp-3); border-radius: var(--r-control); background: var(--bg-selected-row); color: var(--text-2); font-size: var(--fs-13); line-height: var(--lh-13); }
.adm-consequence strong { color: var(--text-kpi); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- settings --- */
.set-form { display: flex; flex-direction: column; gap: var(--sp-5); }
.set-group { display: flex; flex-direction: column; gap: var(--sp-2); }
.set-inline { display: flex; align-items: flex-end; gap: var(--sp-3); flex-wrap: wrap; }
.set-inline .field { flex: 0 1 280px; }
.set-side { position: sticky; top: calc(var(--topline-h) + var(--appbar-h) + var(--sp-4)); }
.set-preview .card-body { gap: 0; }
.set-preview-block { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-4) 0; }
.set-preview-block:first-child { padding-top: 0; }
.set-preview-block:last-child { padding-bottom: 0; }
.set-preview-block + .set-preview-block { border-top: 1px solid var(--line-soft); }
/* the report cover in miniature (report.js): gold bar, lockup, eyebrow, two-tone title, facts at the foot */
.set-cover {
  width: 100%; max-width: 212px; aspect-ratio: 210 / 297; display: flex; flex-direction: column;
  padding: var(--sp-4) var(--sp-4) var(--sp-3); border: 1px solid var(--line); border-top: 4px solid var(--highlight); border-radius: var(--r-6);
  background: var(--bg-surface); box-shadow: var(--shadow-2);
}
.set-cover[data-style="v3"] { background: var(--wash-image) top left / 100% 45% no-repeat, var(--bg-surface); }
.set-cover[data-style="current"] { border-top-color: var(--highlight-text); }
.set-cover-top img { height: 20px; width: auto; display: block; }
.set-cover-body { margin: auto 0; display: flex; flex-direction: column; gap: 4px; }
.set-cover-eyebrow { font-size: 8px; line-height: 12px; font-weight: var(--fw-bold); letter-spacing: var(--track-eyebrow); text-transform: uppercase; color: var(--text-muted); }
.set-cover-title { font-size: 22px; line-height: 1.04; font-weight: var(--fw-bold); letter-spacing: -0.03em; color: var(--text); }
.set-cover[data-style="v3"] .set-cover-eyebrow { color: var(--text-eyebrow); }
.set-cover[data-style="v3"] .set-cover-accent { color: var(--text-heading-accent); }
.set-cover-meta { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding-top: 6px; border-top: 1px solid var(--line-soft); }
.set-cover-meta dt { font-size: 6px; line-height: 8px; font-weight: var(--fw-bold); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.set-cover-meta dd { margin: 1px 0 0; font-size: 8px; line-height: 10px; font-weight: var(--fw-medium); color: var(--text); }
.set-url { font-size: var(--fs-13); line-height: 20px; color: var(--text-muted); overflow-wrap: anywhere; }
.set-quote { font-size: var(--fs-13); line-height: 20px; color: var(--text-2); border-left: 3px solid var(--accent-line); padding-left: var(--sp-3); }
.set-quote .icon { color: var(--accent); vertical-align: -2px; }
.set-quote-check { display: flex; align-items: flex-start; gap: var(--sp-2); }
.set-box { flex: none; width: 14px; height: 14px; margin-top: 3px; border: 1.5px solid var(--line-field); border-radius: 4px; background: var(--bg-surface); }
.set-link-like { color: var(--text-link); text-decoration: underline; text-underline-offset: 2px; }
/* v5.3 UX (A2): everything past Brand, Privacy, Credits and Two-step waits under one closed Advanced. */
.set-advanced { display: flex; flex-direction: column; gap: var(--sp-5); }
.set-advanced-toggle { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: var(--sp-2); row-gap: 2px; width: 100%; padding: var(--sp-4) var(--sp-5);
  text-align: left; font: inherit; color: var(--text); background: var(--bg-surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-card); cursor: pointer; }
.set-advanced-toggle:hover { border-color: var(--line-field); }
.set-advanced-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.set-advanced-toggle .icon { color: var(--text-muted); }
.set-advanced-title { font-weight: var(--fw-bold); }
.set-advanced-sub { grid-column: 2; font-size: var(--fs-13); line-height: 20px; color: var(--text-muted); }
.set-advanced-body { display: flex; flex-direction: column; gap: var(--sp-5); }

/* ------------------------------------------------------- view as coach --- */
.viewas-bar {
  position: fixed; z-index: var(--z-savebar); left: 50%; bottom: var(--sp-4); transform: translateX(-50%);
  display: flex; align-items: center; gap: var(--sp-3); max-width: calc(100vw - 32px); padding: 6px 6px 6px var(--sp-4);
  background: var(--highlight-faint); border: 1px solid var(--highlight-ring); border-radius: var(--r-full); box-shadow: var(--shadow-3);
  font-size: var(--fs-13); color: var(--text-2); animation: adm-bar-in var(--dur-3) var(--ease-enter);
}
@keyframes adm-bar-in { from { opacity: 0; transform: translate(-50%, var(--lift)); } to { opacity: 1; transform: translate(-50%, 0); } }
.viewas-who { display: inline-flex; align-items: center; gap: var(--sp-2); white-space: nowrap; }
.viewas-who .icon { color: var(--highlight-text); }
.viewas-who strong { color: var(--text); font-weight: var(--fw-semibold); }
.viewas-ro { color: var(--highlight-strong-text); }
.viewas-nav { display: flex; gap: 2px; padding-left: var(--sp-3); border-left: 1px solid var(--highlight-soft); }
.viewas-link { padding: 4px 10px; border-radius: var(--r-full); color: var(--text-2); text-decoration: none; font-weight: var(--fw-medium); transition: background var(--dur-1) var(--ease); }
.viewas-link:hover { background: var(--highlight-soft); color: var(--text); }
.viewas-link[aria-current="page"] { background: var(--bg-surface); color: var(--accent-text); box-shadow: var(--shadow-seg); }
body.is-viewing-as .page { padding-bottom: calc(var(--sp-12) + 64px); }

/* ------------------------------------------------------------ languages --- */
.lng-who { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.lng-grip-gap { width: var(--grip-w); flex: none; }
.lng-names { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lng-native { display: inline-flex; align-items: center; gap: var(--sp-2); }
.lng-table td:first-child { padding-left: var(--sp-2); }
.lng-table tr.is-archived .dt-primary, .lng-table tr.is-archived .lng-cov { color: var(--text-muted); }
.lng-cov { display: flex; flex-direction: column; gap: 3px; min-width: 104px; }
.lng-cov .meter-label { min-width: 32px; }
.lng-missing { font-size: var(--fs-12); line-height: var(--lh-12); color: var(--text-link); font-weight: var(--fw-medium); text-decoration: none; width: max-content; }
.lng-missing:hover { text-decoration: underline; }
.lng-done { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-12); line-height: var(--lh-12); color: var(--ok-text); font-weight: var(--fw-medium); }
.lng-base { color: var(--text-muted); font-size: var(--fs-13); white-space: normal; }
.lng-matrix { min-width: 640px; }
.lng-mcell { display: flex; flex-direction: column; gap: 3px; }
.lng-mcell .lng-offer { margin-top: 0; }
.lng-matrix tbody th {
  height: auto; padding: 11px var(--sp-3) 11px var(--sp-4); white-space: normal; text-transform: none; letter-spacing: 0;
  font-size: var(--fs-13); font-weight: var(--fw-regular); color: var(--text); background: transparent; border-bottom: 1px solid var(--line-soft);
}
.lng-matrix tbody th .dt-primary { display: block; }
.lng-matrix tbody tr:last-child th { border-bottom: 0; }
.lng-matrix td { vertical-align: top; }
.lng-colhead { display: inline-flex; align-items: center; gap: 6px; }
.lng-offer { display: block; margin-top: 3px; font-size: var(--fs-11); line-height: var(--lh-11); color: var(--text-muted); }
.lng-offer[data-state="offered"] { color: var(--accent-text); font-weight: var(--fw-medium); }
.lng-offer[data-state="waiting"] { color: var(--warn-text); }
.lng-matrix td.is-not-offered .meter-wrap { opacity: .6; }
.lng-lead { font-size: var(--fs-14); line-height: 22px; color: var(--text-2); max-width: 72ch; }
.lng-object .stepper { margin-bottom: var(--sp-4); }
.lng-check { list-style: none; margin: var(--sp-3) 0 0; padding: 0; display: flex; flex-direction: column; }
.lng-check > li {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto; gap: var(--sp-3); align-items: center;
  padding: var(--sp-3) 0; border-top: 1px solid var(--line-soft);
}
.lng-check-mark { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--warn); color: var(--text-on-accent); }
.lng-check > li.is-done .lng-check-mark { background: var(--accent); border-color: var(--accent); }
.lng-check-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lng-check-count { font-size: var(--fs-12); color: var(--text-2); white-space: nowrap; }
.lng-short { color: var(--warn-text); font-weight: var(--fw-medium); }
.lng-text { font-size: var(--fs-13); line-height: 19px; color: var(--text); font-weight: var(--fw-medium); overflow-wrap: anywhere; }
.lng-sk { display: inline-block; width: 120px; vertical-align: middle; }
.dlg-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: var(--sp-2); font-size: var(--fs-14); line-height: 21px; color: var(--text-2); }

/* ------------------------------------------------------- interface text --- */
.txt-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
.txt-toolbar .select { width: auto; max-width: 200px; }
.txt-toolbar .adm-count { margin-left: auto; }
.txt-expand { margin-left: auto; display: inline-flex; gap: var(--sp-1); }
.txt-legend { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4); margin-top: calc(-1 * var(--sp-2)); font-size: var(--fs-12); color: var(--text-muted); }
.txt-legend-keys { display: inline-flex; align-items: center; gap: var(--sp-4); }
.txt-mark { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-12); color: var(--text-2); font-weight: var(--fw-medium); }
.txt-mark .status-mark { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.txt-mark[data-state="done"] .status-mark { background: var(--ok); }
.txt-mark[data-state="later"] .status-mark { background: transparent; border: 1.5px solid var(--line-field); }
.txt-page .accordion .dt-wrap { border-radius: 0 0 var(--r-card) var(--r-card); }
/* a closed group clips everything in it, visually hidden labels included (they would stretch the page) */
.txt-page .accordion-inner { position: relative; }
.txt-page table.dt td:not(:first-child), .txt-page table.dt th:not(:first-child) { width: 112px; }
.txt-page .adm-row-open.lng-text { text-align: left; }
.txt-var {
  display: inline-flex; align-items: center; height: 18px; padding: 0 7px; margin: 0 1px; border-radius: var(--r-full); vertical-align: 1px;
  background: var(--accent-soft); color: var(--accent-text); font-size: var(--fs-11); line-height: 18px; font-weight: var(--fw-medium); white-space: nowrap;
}
.txt-var-btn { border: 1px solid var(--accent-line); cursor: pointer; font-family: var(--font-code); transition: background var(--dur-1) var(--ease); }
.txt-var-btn:hover { background: var(--accent-soft-2); }
.txt-edited { color: var(--accent-text); font-weight: var(--fw-medium); }
.txt-form { display: flex; flex-direction: column; gap: var(--sp-4); }
.txt-english {
  margin: 0; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-control); background: var(--bg-selected-row);
  font-size: var(--fs-14); line-height: 22px; color: var(--text); border-left: 3px solid var(--accent-line);
}
.txt-vars { align-items: flex-start; line-height: 22px; }
.txt-vars .icon { margin-top: 4px; flex: none; }
.txt-field label { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.txt-base { font-size: var(--fs-11); font-weight: var(--fw-regular); color: var(--text-muted); }
.txt-reset { font-size: var(--fs-12); font-weight: var(--fw-medium); }
.txt-error { margin: 0; color: var(--crit-text); font-size: var(--fs-13); }
.txt-pos { align-self: center; margin-right: auto; padding-left: var(--sp-2); font-size: var(--fs-12); line-height: var(--lh-12); color: var(--text-muted); white-space: nowrap; }

/* ------------------------------------------------------------- activity --- */
.act-what { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.act-what > .adm-tl-icon { flex: none; }
.act-page .dt-primary { font-weight: var(--fw-regular); }
.act-page .dt-primary:hover .act-text { text-decoration: underline; text-underline-offset: 2px; }
.act-lines { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.act-text { font-size: var(--fs-13); line-height: 19px; color: var(--text-2); overflow-wrap: anywhere; }
.act-text strong { color: var(--text); font-weight: var(--fw-semibold); }
.act-time { color: var(--text-muted); font-size: var(--fs-12); font-variant-numeric: tabular-nums; }
.lng-object #missing { scroll-margin-top: calc(var(--topline-h) + var(--appbar-h) + 48px + var(--sp-4)); }
.act-page .dt-group th { text-transform: none; letter-spacing: 0; font-size: var(--fs-12); color: var(--text-2); }

/* ------------------------------------------------------------ responsive --- */
@media screen and (max-width: 1099px) {
  .adm-grid { grid-template-columns: minmax(0, 1fr); }
  .set-side { position: static; }
}
@media screen and (max-width: 767px) {
  .adm-filters { padding: var(--sp-3); }
  .adm-search { max-width: none; flex-basis: 100%; }
  .adm-filters .select { flex: 1 1 140px; max-width: none; }
  .adm-count { margin-left: 0; width: 100%; }
  .adm-page .dt-cards td[data-label=""]:empty { display: none; }
  .adm-page .dt-cards td[data-label=""]:not(:empty) { position: absolute; top: var(--sp-2); right: 36px; width: auto; }
  .adm-page .dt-cards td[data-label=""]::before { content: none !important; }
  .adm-page .dt-cards tr:has(> td[data-label=""]:not(:empty)) > td:first-child { padding-right: 96px; }
  .adm-page .dt-cards tr.dt-group { padding: 0; }
  .adm-page .dt-cards tr.dt-group th { display: block; width: 100%; height: auto; padding: var(--sp-2) var(--sp-4); }
  .adm-page .card-head { flex-wrap: wrap; }
  .adm-page .card-head > .card-action { flex-basis: 100%; }
  .act-page .dt-cards td[data-label="Credits"]:empty { display: none; }
  .adm-page .dt-cards table.dt td.num { text-align: left; }
  .adm-attention-item { grid-template-columns: auto minmax(0, 1fr); padding: var(--sp-3) var(--sp-4); }
  .adm-attention-item > .btn { grid-column: 2; justify-self: start; }
  .adm-access-row { flex-wrap: wrap; }
  .adm-facts > div { grid-template-columns: 96px minmax(0, 1fr); }
  .txt-toolbar .adm-search { flex-basis: 100%; max-width: none; }
  .txt-toolbar .select { flex: 1 1 140px; max-width: none; }
  .txt-toolbar .adm-count { margin-left: 0; width: 100%; }
  .txt-legend-note { width: 100%; order: 3; }
  .txt-page table.dt td:not(:first-child) { width: auto; display: inline-flex !important; align-items: center; gap: 4px; margin-right: var(--sp-3); }
  .lng-table td:first-child { padding-left: 0; }
  /* one aligned column of labels and meters per language card */
  .lng-table-wrap.dt-cards table.dt td.lng-cell { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: center; gap: var(--sp-2); padding: 3px 0; }
  .lng-page .lng-table-wrap.dt-cards table.dt td.lng-cell:not(.dt-go)::before { content: attr(data-label); }
  .lng-cov { flex-direction: row; align-items: center; gap: var(--sp-3); display: inline-flex; min-width: 0; }
  /* the product matrix becomes one list per product: a line per language */
  .lng-matrix-wrap { overflow: visible; }
  .lng-page table.dt.lng-matrix, .lng-page table.dt.lng-matrix tbody, .lng-page table.dt.lng-matrix tr { display: block; width: 100%; min-width: 0; }
  .lng-page table.dt.lng-matrix thead { display: none; }
  .lng-page table.dt.lng-matrix tbody tr { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line-soft); }
  .lng-page table.dt.lng-matrix tbody tr:last-child { border-bottom: 0; }
  .lng-page table.dt.lng-matrix tbody th { display: block; width: 100%; padding: 0 0 var(--sp-1); border: 0; }
  .lng-page table.dt.lng-matrix td { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: start; justify-items: start; gap: var(--sp-2);
    width: 100%; padding: 6px 0; border: 0; text-align: left; }
  .lng-page table.dt.lng-matrix td::before { content: attr(data-label); font-size: var(--fs-12); line-height: 20px; color: var(--text-muted); }
  .lng-mcell { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 2px var(--sp-3); }
  .lng-mcell .lng-offer { margin-top: 0; }
  .lng-check > li { grid-template-columns: 22px minmax(0, 1fr) auto; row-gap: 2px; }
  .lng-check > li > .lng-check-text { grid-column: 2 / 4; }
  .lng-check > li > .lng-check-count { grid-column: 2; }
  .lng-check > li > .btn { grid-column: 3; }
  /* the three steps stay on one line: shorter connectors */
  .lng-object .stepper { flex-wrap: nowrap; gap: 6px; }
  .lng-object .step { gap: 6px; font-size: var(--fs-12); white-space: nowrap; }
  .lng-object .step + .step::before { width: 12px; }
  .viewas-bar { left: var(--sp-2); right: var(--sp-2); bottom: var(--sp-2); transform: none; max-width: none; animation: none; }
  .viewas-nav { display: none; }
  .viewas-who { flex: 1; min-width: 0; white-space: normal; }
  /* admin tables as phone cards: the name, one muted line of what matters, the status or change on the right, the row's ⋯ under it */
  .adm-page .adm-dt .dt-cards table.dt tr:not(.dt-empty):not(.dt-group) {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--sp-3); row-gap: 2px; align-items: start;
  }
  .adm-page .adm-dt .dt-cards table.dt td { grid-column: 1; width: auto; padding: 0; }
  .adm-page .adm-dt .dt-cards table.dt td:not(:first-child)::before { content: none; }
  .adm-page .adm-dt .dt-cards table.dt td:not(:first-child):not(:has(> [data-m])) { display: none; }
  .adm-page .adm-dt .dt-cards table.dt tr > td:first-child { grid-row: 1 / span 2; padding-right: 0; }
  .adm-page .adm-dt .dt-cards table.dt td:has(> [data-m="end"]) { grid-column: 2; grid-row: 1; justify-self: end; padding-top: 2px; }
  .adm-page .adm-dt .dt-cards table.dt td:has(> [data-m="act"]) { position: static; grid-column: 2; grid-row: 2; justify-self: end; align-self: end; margin-right: -6px; }
  .adm-page .adm-dt .dt-cards table.dt tr:not(:has(> td > [data-m="end"])) > td:has(> [data-m="act"]) { grid-row: 1 / span 2; align-self: center; }
  .adm-page .adm-dt .adm-m { display: block; margin-top: 2px; }
  .adm-page .adm-dt .adm-m-inline { display: inline; }
  .adm-page .adm-dt .dt-foot { padding: var(--sp-3) var(--sp-4); }
}

/* v5 WS-E: Companies (admin-companies.js): the drawer's sections and lists,
 * and the admin Settings and Overview sections. */
.adm-co-drawer { display: flex; flex-direction: column; gap: var(--sp-6); }
.adm-co-section { display: flex; flex-direction: column; gap: var(--sp-3); }
.adm-co-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.adm-co-head h3 { font-size: var(--fs-14); font-weight: var(--fw-semibold); margin: 0; }
.adm-co-balance strong { font-size: var(--fs-26); line-height: var(--lh-26); font-weight: var(--fw-semibold); color: var(--text-kpi); }
.adm-co-form { display: flex; flex-direction: column; gap: var(--sp-3); }
.adm-co-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.adm-co-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.adm-co-list > li { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) 0; border-bottom: 1px solid var(--line-soft); }
.adm-co-list > li:last-child { border-bottom: 0; }
.adm-co-list > li > .adm-stack { flex: 1; min-width: 0; }
.adm-co-list > li > .adm-co-actions { justify-content: flex-end; }
.adm-co-list > li { flex-wrap: wrap; }

/* T2.17: native adaptation of T1.16 header and metric-strip candidates. */
.adm-dashboard-controls { display: flex; flex-wrap: wrap; align-items: end; gap: var(--sp-3); margin-block: var(--sp-4); }
.adm-dashboard-controls > * { min-width: 0; max-width: 100%; }
.adm-dashboard-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border-block: 1px solid var(--line); margin-block: var(--sp-5); }
.adm-dashboard-metrics > div { padding: var(--sp-4); border-inline-start: 1px solid var(--line); }
.adm-dashboard-metrics dt { font-size: var(--fs-13); overflow-wrap: anywhere; }
.adm-dashboard-metrics dd { margin: var(--sp-3) 0 0; font-size: var(--fs-26); color: var(--text-kpi); overflow-wrap: anywhere; }
.adm-dashboard-table { max-width: 100%; min-width: 0; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
.adm-dashboard-table table.dt { width: 100%; table-layout: fixed; }
.adm-dashboard-table table.dt th, .adm-dashboard-table table.dt td { white-space: normal; overflow-wrap: anywhere; }
.adm-dashboard-table table.dt .adm-dashboard-number { text-align: right; font-variant-numeric: tabular-nums; }
.adm-dashboard-table td, .adm-dashboard h2 { overflow-wrap: anywhere; }
.adm-dashboard :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 600px) { .adm-dashboard-controls { display: grid; grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .adm-dashboard *, .adm-dashboard *::before, .adm-dashboard *::after { animation: none; transition: none; } }
/* T1.19: Import assessment workbook (workbook-import.js). The CodeXR drop zone, file row and status
 * (docs/design/codexr-reuse.md #6) adapted as native markup on the existing tokens; codexr.css is not loaded.
 * The progress is the native indeterminate <progress>: no percentage is invented. */
.wbi { display: flex; flex-direction: column; gap: var(--sp-6); max-width: 960px; }
.wbi h2 { font-size: var(--fs-16); font-weight: var(--fw-semibold); margin: 0 0 var(--sp-3); }
.wbi h3 { font-size: var(--fs-14); font-weight: var(--fw-semibold); margin: var(--sp-4) 0 var(--sp-2); }
.wbi-lead { color: var(--text-muted); margin: var(--sp-2) 0 0; }
.wbi-target-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: var(--sp-4); }
.wbi-file-area { display: flex; flex-direction: column; gap: var(--sp-3); }
.wbi-drop {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); padding: var(--sp-8) var(--sp-5) var(--sp-6);
  border: 1.5px dashed var(--line-field); border-radius: var(--r-12); background: var(--bg-surface); text-align: center;
  transition: border-color var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
}
.wbi-drop.is-drag { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }
.wbi-drop-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--r-12); background: var(--accent-soft); color: var(--accent); }
.wbi-drop-title { font-size: var(--fs-16); font-weight: var(--fw-semibold); }
.wbi-drop-sub { font-size: var(--fs-13); line-height: var(--lh-13); color: var(--text-muted); overflow-wrap: anywhere; }
.wbi-drop-sub label { color: var(--text-link); font-weight: var(--fw-semibold); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; border-radius: var(--r-4); }
.wbi-file-input { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); opacity: 0; }
.wbi-drop:has(.wbi-file-input:focus-visible) .wbi-drop-sub label { box-shadow: var(--focus-ring); }
.wbi-file { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-12); background: var(--bg-surface); }
.wbi-file-tile { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-8); background: var(--accent-soft); color: var(--accent); }
.wbi-file-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wbi-file-name { font-size: var(--fs-14); font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
.wbi-file-meta { font-size: var(--fs-12); color: var(--text-muted); }
.wbi-status { display: flex; align-items: flex-start; gap: var(--sp-2); margin: 0; font-size: var(--fs-13); line-height: var(--lh-13);
  color: var(--wbi-ink, var(--status-idle-ink)); }
.wbi-status::before { content: ""; flex: none; width: var(--mark-size); height: var(--mark-size); margin-top: 1px; background-color: currentColor;
  -webkit-mask: var(--wbi-mark, var(--status-idle-mark)) center / contain no-repeat; mask: var(--wbi-mark, var(--status-idle-mark)) center / contain no-repeat; }
.wbi-status-word { font-weight: var(--fw-semibold); }
.wbi-status[data-status="ok"]        { --wbi-ink: var(--status-ok-ink);        --wbi-mark: var(--status-ok-mark); }
.wbi-status[data-status="attention"] { --wbi-ink: var(--status-attention-ink); --wbi-mark: var(--status-attention-mark); }
.wbi-status[data-status="crit"]      { --wbi-ink: var(--status-crit-ink);      --wbi-mark: var(--status-crit-mark); }
.wbi-status[data-status="active"]    { --wbi-ink: var(--status-active-ink);    --wbi-mark: var(--status-active-mark); }
.wbi-progress { width: 100%; height: 6px; accent-color: var(--accent); }
.wbi-problem { margin: 0; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-8); background: var(--crit-soft); color: var(--text-2); }
.wbi-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.wbi-reason { margin: 0; font-size: var(--fs-12); line-height: var(--lh-12); color: var(--text-2); }
.wbi-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: var(--sp-3) var(--sp-5); margin: 0; }
.wbi-facts dt { font-size: var(--fs-12); color: var(--text-muted); }
.wbi-facts dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.wbi-issues { margin: 0; padding-left: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-1); }
.wbi-where { font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
.wbi-cells { overflow-wrap: anywhere; color: var(--text-2); }
.wbi-more summary { cursor: pointer; border-radius: var(--r-4); }
.wbi-formula { white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; }

/* Visible focus on every control, including the aria-disabled Import button that stays focusable for its reason. */
.wbi .btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.wbi .btn-cta:focus-visible { box-shadow: var(--shadow-cta), var(--focus-ring); }
.wbi .btn:disabled:focus-visible, .wbi .btn[aria-disabled="true"]:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.wbi select:focus-visible { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.wbi-more > summary:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* The formula table becomes one card per formula on a narrow screen. */
table.dt.wbi-formulas tbody th { height: auto; padding-top: 11px; padding-bottom: 11px; vertical-align: top; white-space: normal;
  overflow-wrap: break-word; text-transform: none; letter-spacing: 0; font-size: var(--fs-13); font-weight: var(--fw-semibold);
  color: var(--text); background: none; border-bottom: 1px solid var(--line-soft); }
table.dt.wbi-formulas td { vertical-align: top; }
table.dt.wbi-formulas select { min-width: 12rem; }
.wbi-map { container: wbi-map / inline-size; }
@container wbi-map (max-width: 640px) {
  table.dt.wbi-formulas, table.dt.wbi-formulas tbody, table.dt.wbi-formulas tbody tr,
  table.dt.wbi-formulas tbody tr > th, table.dt.wbi-formulas tbody tr > td { display: block; }
  table.dt.wbi-formulas thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table.dt.wbi-formulas tbody tr { display: flex; flex-direction: column; gap: var(--sp-3); margin: 0 0 var(--sp-3);
    padding: var(--sp-3) var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-12); background: var(--bg-surface); }
  table.dt.wbi-formulas tbody tr > th, table.dt.wbi-formulas tbody tr > td,
  table.dt.wbi-formulas tbody tr > td:first-child, table.dt.wbi-formulas tbody tr > td:last-child { padding: 0; border: 0; }
  table.dt.wbi-formulas tbody tr > td[data-label]::before { content: attr(data-label); display: block; margin: 0 0 4px;
    font-size: var(--fs-12); line-height: var(--lh-12); font-weight: var(--fw-medium); color: var(--text-2); }
  table.dt.wbi-formulas select { min-width: 0; width: 100%; }
}
