/* PathKEY — Report Studio: products list, Builder, simulator, section editor
 * and assembly view. Owned by the studio & builder workstream.
 * Role tokens (css/tokens.css) and the components in styles.css only. */

/* ================================================================ products */
.pl-card { gap: 0; }
.pl-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line-soft); }
.pl-toolbar .input-wrap { flex: 1 1 220px; max-width: 320px; }
.pl-card .dt-foot { border-radius: 0 0 var(--r-card) var(--r-card); }
.dt-sub { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin-top: 2px; font-size: var(--fs-12); line-height: var(--lh-12); color: var(--text-muted); max-width: 52ch; }
#products-table .tag { margin-left: var(--sp-2); vertical-align: 1px; }
#products-table td[data-label=""] { width: 1%; }
#products-table .status, #products-table .meter-wrap, #products-table td.num, #products-table td[data-label="Contents"] .dt-sub, #products-table td[data-label="Last saved"] { white-space: nowrap; }
#products-table td[data-label="Product"] { min-width: 240px; }
/* the table's own width decides what it can hold (the rail may be open or closed) */
.pl-card { container-type: inline-size; }
@container (max-width: 1099px) { #products-table td[data-label="Contents"] .dt-sub { display: none; } }
@container (max-width: 999px) { #products-table th:nth-child(7), #products-table td[data-label="Last saved"] { display: none; } }
#products-table .dt-primary { font-weight: var(--fw-semibold); }
.pl-langs { display: inline-flex; gap: var(--sp-1); }
.pl-per { font-size: var(--fs-12); color: var(--text-muted); white-space: nowrap; }
.pl-lang-off { display: inline-flex; border-radius: var(--r-full); }
.pl-lang-off .lang-pill { border-style: dashed; color: var(--text-muted); background: var(--bg-surface); }
.pl-lang-off:focus-visible { box-shadow: var(--focus-ring); }
/* a language named for admins: "Turkish" and its code pill (design §13.3) */
.lang-label, .lang-label-code { display: inline-flex; align-items: center; }
.lang-label { gap: var(--sp-2); }

/* ================================================================ builder */
.b-page { --page-gap: var(--sp-4); }
.b-head .object-title-row { row-gap: var(--sp-2); }
.b-head .object-meta { font-variant-numeric: tabular-nums; }
.b-rename-title { flex: 1 1 320px; min-width: 0; }
.b-rename { display: flex; align-items: center; gap: var(--sp-2); }
.b-rename-input { font: inherit; letter-spacing: inherit; height: 40px; max-width: 460px; }

.b-stepbar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-3) var(--sp-4); padding: var(--sp-3) var(--sp-4); background: var(--bg-surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-card); }
.b-stepper { gap: var(--sp-1); }
.b-stepper .step a { padding: var(--sp-1) var(--sp-2) var(--sp-1) var(--sp-1); transition: background var(--dur-1) var(--ease); }
.b-stepper .step a:hover { background: var(--bg-hover); }
.b-stepper .step a:focus-visible { box-shadow: var(--focus-ring); }
.b-stepper .step-mark { transition: background var(--dur-4) var(--ease), border-color var(--dur-4) var(--ease), color var(--dur-4) var(--ease); }
/* a connector fills only along the run of done steps from the start */
.b-stepper .step + .step::before { background: var(--line-control); }
.b-stepper .step.is-joined::before { background: var(--accent); }
.b-stepbar-end { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); margin-left: auto; }
.b-ready { display: inline-flex; align-items: center; text-decoration: none; color: var(--text-muted); border-radius: var(--r-full); padding: var(--sp-1) var(--sp-2); }
.b-ready:hover { background: var(--bg-hover); }
.b-ready:focus-visible { box-shadow: var(--focus-ring); }

.b-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-5); align-items: start; }
.b-main { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }
.b-aside { display: none; }
@media screen and (min-width: 1280px) {
  .b-layout { grid-template-columns: minmax(0, 1fr) 340px; }
  .b-aside {
    display: block; position: sticky; top: calc(var(--topline-h) + var(--appbar-h) + 48px + var(--sp-3));
    max-height: calc(100vh - var(--topline-h) - var(--appbar-h) - 48px - var(--sp-6)); overflow-y: auto; scrollbar-width: thin; border-radius: var(--r-card);
  }
  .b-sim-trigger { display: none; }
}

.b-steptools { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-3); }
.b-steptools > .grow { flex: 1 1 320px; max-width: 72ch; }
.b-stepnav { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding-top: var(--sp-2); }

/* birth data */
.b-birth { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-3) var(--sp-4); padding: var(--sp-3) var(--sp-4); background: var(--bg-surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-card); }
.b-birth > .grow { flex: 1 1 260px; }
.b-birth-title { font-size: var(--fs-14); font-weight: var(--fw-semibold); }

/* filters above the statements */
.b-filter { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); }
.b-filter .input-wrap { flex: 1 1 180px; max-width: 300px; }
.b-filter-count { white-space: nowrap; }

/* question sets and statements */
.b-sets, .b-algos { display: flex; flex-direction: column; gap: var(--sp-3); }
.b-sets .accordion-head, .b-algos .accordion-head { flex-wrap: wrap; row-gap: var(--sp-1); padding-top: var(--sp-1); padding-bottom: var(--sp-1); }
.b-sets .accordion-title, .b-algos .accordion-title { flex: 1 1 220px; }
@media screen and (min-width: 768px) {
  .b-sets .accordion-head, .b-algos .accordion-head {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "grip title actions" ". chips chips";
    align-items: center; column-gap: var(--sp-2); row-gap: 0; padding-top: var(--sp-2); padding-bottom: var(--sp-2);
  }
  :is(.b-sets, .b-algos) .accordion-head > .drag-handle { grid-area: grip; }
  :is(.b-sets, .b-algos) .accordion-title { grid-area: title; }
  :is(.b-sets, .b-algos) .accordion-actions { grid-area: actions; flex-wrap: nowrap; }
  :is(.b-sets, .b-algos) .accordion-chips { grid-area: chips; padding: 0 0 var(--sp-1) calc(var(--sp-4) + var(--sp-4)); }
}
.b-add-row { display: flex; gap: var(--sp-2); }
.q-list { list-style: none; margin: 0; padding: 0; }
.q-item { display: flex; align-items: stretch; gap: 0; padding-left: var(--sp-2); background: var(--bg-surface); }
.q-item + .q-item { border-top: 1px solid var(--line-soft); }
.q-item > .drag-handle { align-self: center; opacity: 0; transition: opacity var(--dur-1) var(--ease); }
.q-item:hover > .drag-handle, .q-item > .drag-handle:focus-visible, .q-item[data-dnd] > .drag-handle { opacity: 1; }
.q-main {
  flex: 1; min-width: 0; display: grid; grid-template-columns: 30px minmax(0, 1fr) 16px; gap: var(--sp-3); align-items: start;
  padding: var(--sp-3) var(--sp-4) var(--sp-3) var(--sp-1); border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer;
  border-radius: var(--r-8); transition: background var(--dur-1) var(--ease);
}
.q-main:hover { background: var(--bg-hover); }
.q-main:focus-visible { box-shadow: var(--focus-ring-inset); }
.q-num { padding-top: 1px; font-size: var(--fs-12); color: var(--text-muted); text-align: right; }
.q-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.q-stem { font-size: var(--fs-14); line-height: var(--lh-14); overflow-wrap: anywhere; }
.q-chips { display: flex; flex-wrap: wrap; gap: 5px 6px; }
.q-chips:empty { display: none; }
.q-edit { margin-top: 2px; color: var(--icon); opacity: 0; transition: opacity var(--dur-1) var(--ease); }
.q-main:hover .q-edit, .q-main:focus-visible .q-edit { opacity: 1; }
.m-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: var(--r-full); max-width: 100%;
  background: var(--accent-soft); color: var(--accent-text); font-size: var(--fs-12); font-weight: var(--fw-medium); white-space: nowrap;
}
.m-chip .bars i { background: var(--accent-line); }
.m-chip .bars[data-level="1"] i:nth-child(-n + 1), .m-chip .bars[data-level="2"] i:nth-child(-n + 2), .m-chip .bars[data-level="3"] i { background: var(--accent); }
.m-chip.is-lowers { box-shadow: inset 0 0 0 1px var(--accent-line); }
.q-more { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-4); border-top: 1px solid var(--line-soft); background: var(--bg-subtle); }
.q-empty { padding: var(--sp-3); }
.q-empty .empty-state { padding: var(--sp-6) var(--sp-4); }
.b-missing {
  display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4) var(--sp-3) var(--sp-2);
  border: 1px dashed var(--crit); border-radius: var(--r-card); background: var(--crit-soft); color: var(--crit-text); font-size: var(--fs-13);
}
.b-missing .muted { color: var(--text-2); }

/* scorings */
.b-acc-pad { padding: var(--sp-4) var(--sp-5) var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); }

/* what other steps still have to fix: one quiet row */
.b-issues {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); padding: var(--sp-2) var(--sp-4);
  background: var(--bg-surface); border: 1px solid var(--line); border-radius: var(--r-12);
}
.b-issues > .status { flex: none; font-size: var(--fs-13); }
.b-issues-list { flex: 1 1 260px; min-width: 0; font-size: var(--fs-13); line-height: var(--lh-13); color: var(--text-muted); }
.b-issues > .btn { flex: none; }
/* the Builder's own steps: the explainer is help, not a call to action */
.b-main > .explainer { border-left: 1px solid var(--line); }

/* shared parts: one notice, one tone (info), in a set or scoring head and at the top of an editor */
.b-shared-note {
  position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--sp-3); min-width: 0; padding-left: 22px;
  font-size: var(--fs-13); line-height: var(--lh-13); color: var(--text-2);
}
.b-shared-note > .icon { position: absolute; left: 0; top: 2px; color: var(--info); }
.b-shared-text { flex: 0 1 auto; min-width: 0; }
.b-shared-text strong { font-weight: var(--fw-medium); color: var(--text); }
.b-shared-action { flex: none; }
.b-shared-note.is-boxed { padding: var(--sp-3) var(--sp-4) var(--sp-3) calc(var(--sp-4) + 22px); border-radius: var(--r-8); background: var(--info-soft); }
.b-shared-note.is-boxed > .icon { left: var(--sp-4); top: calc(var(--sp-3) + 2px); }
.b-shared-note.is-boxed strong { font-weight: var(--fw-semibold); }
.accordion-chips > .b-shared-note { flex: 1 1 100%; }

/* report outline: the printed report, page by page */
.ol-wrap { display: flex; flex-direction: column; gap: var(--sp-2); }
.ol-eyebrow { padding-left: var(--sp-1); }
.ol { list-style: none; margin: 0; padding: 0; }
.ol-page { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: var(--sp-4); padding-bottom: var(--sp-5); }
.ol-page::before { content: ""; position: absolute; left: 13px; top: 32px; bottom: 4px; width: 2px; border-radius: var(--r-full); background: var(--line); }
.ol-page:last-child { padding-bottom: 0; }
.ol-page:last-child::before { display: none; }
.ol-num {
  position: relative; z-index: 1; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: var(--text-on-accent); font-size: var(--fs-12); font-weight: var(--fw-bold);
  transition: background var(--dur-3) var(--ease), color var(--dur-3) var(--ease), box-shadow var(--dur-3) var(--ease);
}
.ol-page.is-fixed .ol-num { background: var(--bg-surface); color: var(--accent-text); box-shadow: inset 0 0 0 1.5px var(--accent); }
.ol-page.is-off .ol-num { background: var(--bg-surface); color: var(--text-muted); box-shadow: inset 0 0 0 1.5px var(--line-control); }
.ol-main { min-width: 0; display: flex; flex-direction: column; gap: var(--sp-1); }
.ol-head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); min-height: 28px; }
.ol-head > .grow { flex: 1 1 0; }
.ol-title { font-size: 15px; line-height: 22px; font-weight: var(--fw-semibold); letter-spacing: var(--track-tight); }
.ol-page.is-off .ol-title { color: var(--text-muted); }
.ol-fixed { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-11); line-height: var(--lh-11); font-weight: var(--fw-bold); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--text-muted); }
.ol-fixed .icon { color: var(--icon); }
.ol-count { font-size: var(--fs-12); color: var(--text-muted); }
.ol-desc { font-size: var(--fs-13); line-height: var(--lh-13); color: var(--text-2); max-width: 80ch; }
.ol-desc strong { font-weight: var(--fw-semibold); color: var(--text); }
.ol-page.is-off .ol-desc { color: var(--text-muted); }
.ol-hint { display: flex; align-items: flex-start; gap: 6px; font-size: var(--fs-12); line-height: var(--lh-12); color: var(--text-muted); max-width: 80ch; }
.ol-hint .icon { flex: none; margin-top: 3px; color: var(--icon); }
.ol-main > .b-sec-list { margin-top: var(--sp-2); }
.b-sec-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.b-sec { background: var(--bg-surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-card); min-width: 0; }
.b-sec-head { display: flex; align-items: flex-start; gap: var(--sp-2) var(--sp-3); padding: var(--sp-3) var(--sp-4) var(--sp-3) var(--sp-2); }
.b-sec-head > .drag-handle { margin-top: 2px; }
.b-sec-titles { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.b-sec-titles > .b-sec-state { margin-top: var(--sp-2); }
.b-sec-name { font-size: 15px; line-height: 22px; font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
.b-sec-kind { font-size: var(--fs-12); color: var(--text-muted); }
.b-sec-kind strong { color: var(--text-2); font-weight: var(--fw-medium); }
.b-sec-state { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2); }
.b-sec-actions { display: flex; align-items: center; gap: var(--sp-1); margin-left: auto; flex: none; }
.b-sec-body { padding: 0 var(--sp-4) var(--sp-4) calc(var(--grip-w) + var(--sp-2) + var(--sp-3)); }
.b-texts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: var(--sp-2); }
.b-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: var(--sp-3); border: 1px solid var(--line-soft); border-radius: var(--r-12); background: var(--bg-subtle); }
.b-text.is-missing { border-style: dashed; border-color: var(--line-field); background: var(--bg-surface); }
.b-text-label { font-size: var(--fs-11); line-height: var(--lh-11); font-weight: var(--fw-bold); letter-spacing: var(--track-eyebrow); text-transform: uppercase; color: var(--text-eyebrow); font-variant-numeric: tabular-nums; }
.b-text-head { font-size: var(--fs-13); line-height: var(--lh-13); font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
.b-text-body { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; font-size: var(--fs-12); line-height: 18px; color: var(--text-muted); overflow-wrap: break-word; }
.b-text.is-missing .b-text-body { color: var(--warn-text); }
.b-types { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); }

/* publish */
#b-checklist .card-body { gap: 0; }
.check-summary { padding: var(--sp-4) var(--sp-5) var(--sp-2); }
.check-list { list-style: none; margin: 0; padding: 0; }
.check-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: var(--sp-3); align-items: start; padding: var(--sp-3) var(--sp-5); }
.check-list > .check-row + .check-row { border-top: 1px solid var(--line-soft); }
.check-mark { padding-top: 2px; line-height: 0; }
.check-row.is-ok .check-mark { color: var(--ok); }
.check-row.is-fail .check-mark { color: var(--crit); }
.check-row.is-soft .check-mark { color: var(--warn); }
.check-label { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2); font-size: var(--fs-14); font-weight: var(--fw-medium); color: var(--text); }
.check-detail { font-size: var(--fs-13); line-height: var(--lh-13); color: var(--text-muted); overflow-wrap: anywhere; }
.check-fix { align-self: center; }
.check-group { padding: var(--sp-4) var(--sp-5) var(--sp-1); border-top: 1px solid var(--line-soft); }
.b-pub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: var(--sp-4); align-items: stretch; }
.b-facts { margin: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.b-facts > div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: var(--sp-3); }
.b-facts dt { font-size: var(--fs-13); color: var(--text-muted); }
.b-facts dd { margin: 0; font-size: var(--fs-14); overflow-wrap: anywhere; }
.b-fact-sub { display: flex; flex-wrap: wrap; gap: 2px var(--sp-2); margin-top: 2px; font-size: var(--fs-12); color: var(--text-muted); }
.b-fact-names { flex-direction: column; gap: var(--sp-1); margin-top: var(--sp-1); }
.b-fact-name { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--text-2); }
.b-langs { list-style: none; margin: 0; padding: 0; }
.b-lang { display: grid; grid-template-columns: minmax(0, 1fr) 160px auto; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-5); }
.b-lang + .b-lang { border-top: 1px solid var(--line-soft); }
.b-lang-fixed { display: flex; align-items: flex-start; gap: var(--sp-3); }
.b-lang-fixed > .icon { margin-top: 3px; color: var(--icon); }
.pub-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.pub-facts li { display: flex; align-items: flex-start; gap: var(--sp-3); font-size: var(--fs-14); line-height: 21px; color: var(--text-2); }
.pub-facts .icon { color: var(--accent); margin-top: 2px; }

/* retire, archive, delete */
.danger-zone .card-head .icon-tile { background: var(--crit-soft); color: var(--crit); --icon-accent: var(--crit); }
.dz-list { list-style: none; margin: 0; padding: 0; }
.dz-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-4); align-items: center; padding: var(--sp-4) var(--sp-5); }
.dz-row + .dz-row { border-top: 1px solid var(--line-soft); }
.dz-title { font-size: var(--fs-14); font-weight: var(--fw-semibold); }
.dz-sub { font-size: var(--fs-13); line-height: var(--lh-13); color: var(--text-muted); max-width: 72ch; }
.dz-usage { display: flex; align-items: flex-start; gap: 6px; margin-top: var(--sp-2); font-size: var(--fs-12); line-height: var(--lh-12); color: var(--text-2); }
.dz-usage > .icon { flex: none; margin-top: 2px; color: var(--accent); }
.dz-usage.is-loading { color: var(--text-muted); }
.dz-usage.is-error, .dz-usage.is-error .icon { color: var(--crit-text); }

/* ============================================================== simulator */
.sim { gap: 0; }
.sim-head { display: flex; flex-direction: column; gap: 6px; padding: var(--sp-4) var(--sp-4) var(--sp-3); border-bottom: 1px solid var(--line-soft); background: var(--bg-wash); }
.sim-title { font-size: var(--fs-16); line-height: var(--lh-16); font-weight: var(--fw-bold); letter-spacing: var(--track-tight); }
.sim-sub { font-size: var(--fs-12); line-height: var(--lh-12); color: var(--text-muted); }
.sim-personas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--sp-1); }
.sim-persona {
  display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: var(--r-full); border: 1px solid var(--line-control);
  background: var(--bg-surface); color: var(--text-2); font: var(--fw-medium) var(--fs-12)/1 var(--font-ui); cursor: pointer;
  transition: background var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
}
.sim-persona:hover { border-color: var(--accent); color: var(--accent-text); }
.sim-persona[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.sim-persona.is-custom { border-style: dashed; cursor: default; color: var(--text-muted); }
.sim-persona:focus-visible { box-shadow: var(--focus-ring); }
.sim-out { list-style: none; margin: 0; padding: var(--sp-1) var(--sp-4) 0; }
.sim-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--sp-2); align-items: center; padding: var(--sp-2) 0; }
.sim-row + .sim-row { border-top: 1px solid var(--line-soft); }
.sim-name { font-size: var(--fs-13); line-height: var(--lh-13); overflow-wrap: anywhere; }
.sim-ver {
  justify-self: end; display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--r-full); white-space: nowrap;
  font-size: var(--fs-11); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums;
  transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
}
.sim-ver.tone-neutral { background: var(--bg-sunken); color: var(--text-2); }
.sim-ver.tone-accent { background: var(--accent-soft); color: var(--accent-text); }
.sim-ver.tone-warn { background: var(--warn-soft); color: var(--warn-text); }
.sim-ver.tone-crit { background: var(--crit-soft); color: var(--crit-text); }
.sim-heading { grid-column: 1 / -1; font-size: var(--fs-12); line-height: var(--lh-12); color: var(--text-muted); overflow-wrap: anywhere; }
.sim-count { padding: var(--sp-2) var(--sp-4) var(--sp-3); font-size: var(--fs-12); color: var(--text-muted); }
.sim-empty { padding: var(--sp-3) var(--sp-4); font-size: var(--fs-13); color: var(--text-muted); }
.sim-adjust { border-top: 1px solid var(--line-soft); }
.sim-adjust > summary {
  list-style: none; display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); cursor: pointer;
  font-size: var(--fs-13); font-weight: var(--fw-medium); color: var(--text-2);
}
.sim-adjust > summary::-webkit-details-marker { display: none; }
.sim-adjust > summary .icon { color: var(--accent); }
.sim-adjust > summary::after { content: ""; margin-left: auto; width: 12px; height: 12px; background: var(--chevron-img) center / 12px 12px no-repeat; transition: transform var(--dur-2) var(--ease); }
.sim-adjust[open] > summary::after { transform: rotate(180deg); }
.sim-adjust > summary:hover { background: var(--bg-hover); }
.sim-adjust > summary:focus-visible { box-shadow: var(--focus-ring-inset); }
.sim-adjust-body { display: flex; flex-direction: column; gap: var(--sp-3); padding: 0 var(--sp-4) var(--sp-4); }
.sim-slider { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px var(--sp-2); align-items: center; }
.sim-label { font-size: var(--fs-12); color: var(--text-2); overflow-wrap: anywhere; }
.sim-val { font-size: var(--fs-13); font-weight: var(--fw-semibold); color: var(--text-kpi); min-width: 2ch; text-align: right; }
.sim-band { font-size: var(--fs-11); font-weight: var(--fw-semibold); color: var(--accent-text); background: var(--accent-soft); border-radius: var(--r-full); padding: 1px 7px; }
.sim-band.is-none { background: var(--bg-sunken); color: var(--text-muted); }
.sim-slider input[type="range"] {
  grid-column: 1 / -1; width: 100%; height: 6px; margin: var(--sp-1) 0; appearance: none; -webkit-appearance: none; border-radius: var(--r-full); cursor: pointer;
  background: linear-gradient(90deg, var(--data) 0 var(--v, 50%), var(--data-track) var(--v, 50%) 100%);
}
.sim-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--bg-surface); border: 2px solid var(--accent); box-shadow: var(--shadow-1);
  transition: transform var(--dur-1) var(--ease);
}
.sim-slider input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--bg-surface); border: 2px solid var(--accent); }
.sim-slider input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.1); }
.sim-slider input[type="range"]:focus-visible { box-shadow: var(--focus-ring); }
.sim-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
.sim-note { font-size: var(--fs-12); line-height: var(--lh-12); color: var(--text-muted); }
.sim-foot { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--line-soft); }
.drawer .sim { border: 0; box-shadow: none; border-radius: 0; margin: calc(-1 * var(--sp-5)); }
.drawer .sim-head { background: var(--bg-surface); }

/* print preview inside the section editor */
.slot-fields { display: flex; flex-direction: column; gap: var(--sp-3); }
.slot-fields[hidden], .slot-print[hidden] { display: none; }
.slot-print { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-4) var(--sp-5); border-radius: var(--r-8); background: var(--bg-subtle); }
.slot-print > * { max-width: 62ch; }
.slot-print-score { display: flex; align-items: center; gap: var(--sp-2); }
.slot-print-band { font-size: var(--fs-11); font-weight: var(--fw-semibold); padding: 1px 8px; border-radius: var(--r-full); background: var(--accent-soft); color: var(--accent-text); }
.slot-print-head { font-size: var(--fs-16); line-height: var(--lh-16); font-weight: var(--fw-bold); letter-spacing: var(--track-tight); color: var(--text); }
.slot-print-body { font-size: var(--fs-13); line-height: 21px; color: var(--text); hyphens: auto; }
.slot-print-empty { font-size: var(--fs-13); color: var(--warn-text); }
.sec-preview-toggle[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); }

/* ======================================================== section editor */
.sec-form { display: flex; flex-direction: column; gap: var(--sp-5); }
.sec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: var(--sp-3) var(--sp-4); }
.sec-bands { display: flex; flex-direction: column; gap: var(--sp-3); }
.sec-bands-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.5fr); gap: var(--sp-3) var(--sp-4); align-items: end; }
.sec-bands-row.is-single { grid-template-columns: minmax(0, 280px); }
.sec-bands > .hint { margin-top: calc(-1 * var(--sp-1)); }
.sec-bands > legend { margin-bottom: var(--sp-3); font-size: var(--fs-13); line-height: var(--lh-13); font-weight: var(--fw-semibold); color: var(--text); }
.sec-form .sec-langs { display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 0; }
/* language tabs that overflow on a phone: snap, and fade the edge that has more */
.sec-langs .tabbar { scroll-snap-type: x proximity; scroll-padding-inline: 32px; }
.sec-langs .tab-item { scroll-snap-align: start; }
.sec-langs .tabbar[data-overflow="end"] { mask-image: linear-gradient(to right, black calc(100% - 32px), transparent); }
.sec-langs .tabbar[data-overflow="start"] { mask-image: linear-gradient(to left, black calc(100% - 32px), transparent); }
.sec-langs .tabbar[data-overflow="both"] { mask-image: linear-gradient(to right, transparent, black 32px, black calc(100% - 32px), transparent); }
.sec-panel { display: flex; flex-direction: column; gap: var(--sp-4); padding-top: var(--sp-4); }
.sec-panel-tools { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: var(--sp-2); }
.slot-ed { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-12); background: var(--bg-surface); }
.slot-head { display: flex; align-items: center; gap: var(--sp-2); }
.slot-label { font-size: var(--fs-13); font-weight: var(--fw-semibold); color: var(--text); }
/* a transparent border, not padding, spaces it: the clamped lines must not show through the padding */
.slot-ref { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; border: var(--sp-2) solid transparent; border-width: var(--sp-2) var(--sp-3); border-radius: var(--r-8); background: var(--bg-subtle); font-size: var(--fs-12); line-height: 18px; color: var(--text-2); }
.slot-words { margin-top: calc(-1 * var(--sp-2)); font-size: var(--fs-12); color: var(--text-muted); text-align: right; font-variant-numeric: tabular-nums; }
.sec-flags { display: flex; flex-direction: column; gap: var(--sp-2); }
.sec-flags:empty { display: none; }

/* ======================================================== question editor */
.q-stem-row { display: flex; align-items: center; gap: var(--sp-2); }
.q-stem-row .input { flex: 1; min-width: 0; }
.q-alts { display: flex; flex-direction: column; gap: var(--sp-1); }
.q-alts:empty { display: none; }
.q-alt {
  text-align: left; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-control); background: var(--bg-subtle);
  font: var(--fw-regular) var(--fs-13)/var(--lh-13) var(--font-ui); color: var(--text); cursor: pointer; transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.q-alt:hover { background: var(--accent-soft); border-color: var(--accent); }
.q-alt:focus-visible { box-shadow: var(--focus-ring); }
.q-langs > summary {
  list-style: none; display: flex; align-items: center; gap: var(--sp-2); width: fit-content; cursor: pointer; padding: var(--sp-1) var(--sp-2) var(--sp-1) 0;
  border-radius: var(--r-control); font-size: var(--fs-13); font-weight: var(--fw-medium); color: var(--text-2);
}
.q-langs > summary::-webkit-details-marker { display: none; }
.q-langs > summary::before { content: ""; flex: none; width: 12px; height: 12px; background: var(--chevron-img) center / 12px 12px no-repeat; transform: rotate(-90deg); transition: transform var(--dur-2) var(--ease); }
.q-langs[open] > summary::before { transform: none; }
.q-langs > summary:hover { color: var(--text); }
.q-langs > summary:focus-visible { box-shadow: var(--focus-ring); }
.q-langs > summary .muted { font-weight: var(--fw-regular); margin-left: var(--sp-1); }
.q-langs[open] > summary { margin-bottom: var(--sp-3); }
.measures { display: flex; flex-direction: column; gap: var(--sp-2); }
.measure-head, .measure-row { display: grid; grid-template-columns: 130px minmax(150px, 1fr) 130px 150px; gap: var(--sp-2); align-items: center; }
.measure-head { font-size: var(--fs-11); font-weight: var(--fw-semibold); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--text-muted); }
.measure-algo { font-size: var(--fs-12); color: var(--text-muted); overflow-wrap: anywhere; }
.measure-new { grid-column: 2 / -1; }
.measure-row .select:disabled { color: var(--text-disabled); background-color: var(--bg-subtle); border-color: var(--line); cursor: not-allowed; }
.q-remove { padding-top: var(--sp-2); border-top: 1px solid var(--line-soft); }
.b-pick { display: flex; flex-direction: column; gap: var(--sp-2); }
.b-pick > .field-legend { margin-bottom: var(--sp-1); }
:where(.b-pick, .measures, .sec-bands) > legend { padding: 0; }
:where(.measures, .b-scale) > legend { margin-bottom: var(--sp-2); }
.b-shared { cursor: default; }
.b-shared .icon { color: var(--icon); }
.ai-review { display: flex; flex-direction: column; gap: var(--sp-2); }
.ai-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) 170px; gap: var(--sp-2); align-items: center; }

/* ================================================= translation drawer */
.tr-top {
  position: sticky; top: calc(-1 * var(--sp-5)); z-index: 2; display: flex; flex-direction: column; gap: var(--sp-3);
  margin: calc(-1 * var(--sp-5)) calc(-1 * var(--sp-5)) 0; padding: var(--sp-3) var(--sp-5); background: var(--bg-surface); border-bottom: 1px solid var(--line-soft);
}
.tr-tools { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); }
.tr-form { display: flex; flex-direction: column; gap: var(--sp-5); }
.tr-group { display: flex; flex-direction: column; }
.tr-group[hidden] { display: none; }
.tr-group-title { padding-bottom: var(--sp-2); }
.tr-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-2) var(--sp-4); align-items: start; padding: var(--sp-3) 0; border-top: 1px solid var(--line-soft); }
.tr-row[hidden] { display: none; }
.tr-src { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tr-label { display: flex; flex-wrap: wrap; gap: 0 var(--sp-2); font-size: var(--fs-11); line-height: var(--lh-11); font-weight: var(--fw-semibold); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--text-muted); }
.tr-where { font-weight: var(--fw-regular); letter-spacing: 0; text-transform: none; }
.tr-en { font-size: var(--fs-13); line-height: var(--lh-13); color: var(--text); overflow-wrap: anywhere; white-space: pre-line; }
.tr-dst { min-width: 0; }
.tr-dst .input, .tr-dst .textarea { width: 100%; }
.tr-row[data-missing] .tr-dst .input:placeholder-shown, .tr-row[data-missing] .tr-dst .textarea:placeholder-shown { border-style: dashed; }

/* two or three pill toggles (drawers render outside the page, so no sliding thumb) */
.b-toggle { display: inline-flex; gap: var(--sp-1); padding: 3px; border-radius: var(--r-full); background: var(--bg-sunken); }
.b-toggle-opt {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border: 0; border-radius: var(--r-full);
  background: none; color: var(--text-2); font: var(--fw-medium) var(--fs-13)/1 var(--font-ui); cursor: pointer;
  transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.b-toggle-opt .num { color: var(--text-muted); font-size: var(--fs-12); }
.b-toggle-opt:hover { color: var(--text); }
.b-toggle-opt[aria-pressed="true"] { background: var(--bg-surface); color: var(--accent-text); box-shadow: var(--shadow-seg); }
.b-toggle-opt:focus-visible { box-shadow: var(--focus-ring); }

/* set details: the answer scale per language */
.b-scale { display: flex; flex-direction: column; gap: var(--sp-2); }
.b-scale > legend { padding: 0; }
.b-scale-table th[scope="row"] { font-size: var(--fs-13); font-weight: var(--fw-medium); letter-spacing: 0; text-transform: none; color: var(--text); white-space: nowrap; }
.b-scale-table th .field-optional { text-transform: none; letter-spacing: 0; }
.b-scale-table td { padding-top: 6px; padding-bottom: 6px; }
.b-scale-table .input { width: 100%; }
.pm-names { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-12); overflow: hidden; }
.pm-head, .pm-row { display: grid; grid-template-columns: 124px minmax(0, 1fr) minmax(0, 1.6fr); gap: var(--sp-3); padding: var(--sp-2) var(--sp-4); }
.pm-head { align-items: center; min-height: 36px; background: var(--bg-subtle); border-bottom: 1px solid var(--line);
  font-size: var(--fs-11); font-weight: var(--fw-semibold); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--text-muted); }
.pm-head .field-optional { text-transform: none; letter-spacing: 0; }
.pm-row { align-items: start; }
.pm-row + .pm-row { border-top: 1px solid var(--line-soft); }
.pm-lang { padding-top: 9px; font-size: var(--fs-13); font-weight: var(--fw-medium); color: var(--text); }
.pm-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pm-cell .input, .pm-cell .textarea { width: 100%; }
.pm-cell .textarea { resize: vertical; min-height: 0; }
.pm-label { display: none; font-size: var(--fs-12); color: var(--text-muted); }
.b-versions .empty-state { padding: var(--sp-6) var(--sp-5); }

/* ========================================================= assembly view */
.asm-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--sp-5); align-items: start; }
@media screen and (max-width: 1060px) { .asm-layout { grid-template-columns: minmax(0, 1fr); } }
.asm-main, .asm-aside { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }
.asm-list { list-style: none; margin: 0; padding: 0; }
.asm-row { display: flex; align-items: center; gap: var(--sp-2) var(--sp-3); min-height: var(--row); padding: var(--sp-2) var(--sp-4) var(--sp-2) var(--sp-2); background: var(--bg-surface); }
.asm-row + .asm-row { border-top: 1px solid var(--line-soft); }
.asm-row.is-missing { background: var(--crit-soft); }
.asm-lock { flex: none; display: inline-grid; place-items: center; width: var(--grip-w); color: var(--icon); }
.asm-card .card-body { gap: 0; }
.asm-fixed + .asm-list { border-top: 1px solid var(--line-soft); }
.asm-num { flex: none; width: 22px; font-size: var(--fs-12); color: var(--text-muted); text-align: right; }
.asm-text { flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; gap: var(--sp-3); }
.asm-name { font-size: var(--fs-14); font-weight: var(--fw-medium); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 32ch; }
.asm-meta { font-size: var(--fs-12); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.asm-chips { display: flex; align-items: center; gap: var(--sp-1); flex: none; }
.asm-chips:empty { display: none; }
.asm-marks { display: inline-flex; align-items: center; gap: var(--sp-1); }
/* Sample and Shared are counted in the card head; a row shows its own on hover or focus */
@media (hover: hover) {
  .asm-marks { opacity: 0; transition: opacity var(--dur-1) var(--ease); }
  .asm-row:hover .asm-marks, .asm-row:focus-within .asm-marks { opacity: 1; }
}
.asm-counts { display: block; margin-top: 2px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.asm-empty { padding: var(--sp-4) var(--sp-5); font-size: var(--fs-13); color: var(--text-muted); }
.asm-langs { display: flex; flex-direction: column; gap: var(--sp-2); }
.asm-note { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2); padding-top: var(--sp-3); border-top: 1px solid var(--line-soft); font-size: var(--fs-13); color: var(--text-2); }
.asm-note .icon { color: var(--icon); }
.asm-note-text { font-size: var(--fs-13); line-height: var(--lh-13); color: var(--text-2); }

/* ================================================================ phones */
@media screen and (max-width: 767px) {
  .b-stepbar { padding: var(--sp-2) var(--sp-3); }
  .b-head .object-header-row > .icon-tile { display: none; }
  .b-stepper .step:not(.is-current) .step-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .b-stepper .step + .step::before { width: 14px; }
  .b-stepnav { flex-wrap: wrap; }
  .q-item { padding-left: 0; }
  .q-main { grid-template-columns: 26px minmax(0, 1fr); padding-right: var(--sp-3); }
  .q-edit { display: none; }
  .b-sec-head { flex-wrap: wrap; padding-left: var(--sp-1); }
  .b-sec-titles { flex-basis: calc(100% - var(--grip-w) - var(--sp-3)); }
  .b-sec-actions { margin-left: calc(var(--grip-w) + var(--sp-2)); }
  .b-sec-body { padding-left: var(--sp-4); }
  .check-row { grid-template-columns: 20px minmax(0, 1fr); padding: var(--sp-3) var(--sp-4); }
  .check-fix { grid-column: 2; justify-self: start; }
  .check-summary { padding: var(--sp-3) var(--sp-4) var(--sp-1); }
  .check-group { padding: var(--sp-3) var(--sp-4) 0; }
  .b-facts > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .b-lang { grid-template-columns: minmax(0, 1fr) auto; padding: var(--sp-3) var(--sp-4); }
  .b-lang > :first-child { grid-column: 1 / -1; }
  .dz-row { grid-template-columns: minmax(0, 1fr); gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); }
  .dz-action { justify-self: start; }
  .measure-head { display: none; }
  .measure-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .measure-row .measure-algo { grid-column: 1 / -1; }
  .measure-row .measure-algo:empty { display: none; }
  .measure-row > select[data-measure-trait] { grid-column: 1 / -1; }
  .sec-bands-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .sec-bands-row > .field:nth-child(3) { grid-column: 1 / -1; }
  .b-page .banner, .asm-page .banner { flex-wrap: wrap; row-gap: var(--sp-1); }
  .b-page .banner > .banner-action, .asm-page .banner > .banner-action { flex-basis: 100%; padding-left: calc(16px + var(--sp-3)); }
  .b-stepbar-end { flex-basis: 100%; margin-left: 0; }
  .b-stepbar-end > .b-sim-trigger { margin-left: auto; }
  .b-stepbar-end > .b-next { flex-basis: 100%; justify-content: center; }
  .pm-head { display: none; }
  .pm-row { grid-template-columns: minmax(0, 1fr); gap: var(--sp-2); padding: var(--sp-3); }
  .pm-lang { padding-top: 0; }
  .pm-label { display: block; }
  .ai-row { grid-template-columns: 20px minmax(0, 1fr); }
  .ai-row select { grid-column: 2; }
  .pl-toolbar { padding: var(--sp-3); }
  .ol-page { grid-template-columns: 24px minmax(0, 1fr); gap: var(--sp-3); }
  .ol-num { width: 24px; height: 24px; font-size: var(--fs-11); }
  .ol-page::before { left: 11px; top: 28px; }
  .tr-row { grid-template-columns: minmax(0, 1fr); }
  .dt.b-scale-table thead { display: none; }
  .dt.b-scale-table, .dt.b-scale-table tbody, .dt.b-scale-table tr { display: block; }
  .dt.b-scale-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-1) var(--sp-3); padding: var(--sp-3) 0; border-top: 1px solid var(--line-soft); background: none; }
  .dt.b-scale-table tr > th[scope="row"] { grid-column: 1 / -1; padding: 0; border: 0; background: none; }
  .dt.b-scale-table tr > td { display: flex; flex-direction: column; gap: 2px; padding: 0; border: 0; background: none; }
  .dt.b-scale-table td::before { content: attr(data-label); font-size: var(--fs-11); color: var(--text-muted); }
  .asm-row { display: grid; grid-template-columns: var(--grip-w) 22px minmax(0, 1fr) auto; align-items: start; padding-right: var(--sp-3); }
  .asm-row > .asm-num { padding-top: 2px; }
  .asm-text { grid-column: 3; flex-direction: column; gap: 0; }
  .asm-name, .asm-meta { white-space: normal; max-width: none; }
  .asm-row > .menu-anchor { grid-column: 4; grid-row: 1; }
  .asm-row > .asm-lock { padding-top: 2px; }
  .asm-chips { grid-column: 3 / -1; grid-row: 2; flex-wrap: wrap; }
  .slot-print { padding: var(--sp-4); }
  /* a product on a phone: name, what it is, where it stands, what coaches get */
  #products-table tr.is-link { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--sp-2); }
  #products-table tr.is-link::after { content: ""; flex-basis: 100%; order: 2; }
  #products-table td { width: auto; }
  #products-table td::before { content: none; }
  #products-table td[data-label="Product"] { flex-basis: 100%; min-width: 0; padding-right: var(--sp-8); padding-bottom: var(--sp-2); }
  #products-table td[data-label="Status"], #products-table td[data-label="Readiness"] { order: 1; }
  #products-table td[data-label="Languages"], #products-table td[data-label="Coaches pay"] { order: 3; padding-top: 6px; }
  #products-table td[data-label="Readiness"]::before, #products-table td[data-label="Coaches pay"]::before { content: "·"; margin-right: var(--sp-2); color: var(--text-muted); }
  #products-table td[data-label="Contents"], #products-table td[data-label="Last saved"], #products-table td.dt-go, #products-table td[data-label="Readiness"]:has(> .pl-na) { display: none; }
  #products-table td[data-label=""] { position: absolute; top: var(--sp-2); right: var(--sp-2); width: auto; }
  .dt-sub { max-width: none; }
}

/* ===================================================== v5.2 · Studio › Modules */
/* docs/v52-mvp.md 3: a board by group (or a list), cards that open the module's panel. */
.mod-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.mod-toolbar .input-wrap { flex: 1 1 220px; max-width: 320px; }
.mod-setup { margin-bottom: var(--sp-6); }
.mod-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--sp-4); align-items: start; overflow-x: auto; padding-bottom: var(--sp-2); }
.mod-col { min-width: 0; display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-3); background: var(--bg-subtle); border-radius: var(--r-card); }
.mod-col-title { margin: 0; font-size: var(--fs-14); line-height: var(--lh-14); font-weight: var(--fw-semibold); color: var(--text-2); }
.mod-col-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.mod-col-empty { margin: 0; }
.mod-card { position: relative; display: flex; flex-direction: column; gap: var(--sp-1); padding: var(--sp-4); background: var(--bg-surface); border: 1px solid var(--line-soft); border-radius: var(--r-card); box-shadow: var(--shadow-card); transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.mod-card:hover { border-color: var(--line); box-shadow: var(--shadow-2); }
.mod-card-open { position: absolute; inset: 0; border: 0; background: transparent; border-radius: inherit; cursor: pointer; }
.mod-card-open:focus-visible { box-shadow: var(--focus-ring); outline: none; }
.mod-card-name { margin: 0; font-size: var(--fs-16); line-height: var(--lh-16); font-weight: var(--fw-semibold); color: var(--text); }
.mod-card-desc { margin: 0; font-size: var(--fs-13); line-height: var(--lh-13); color: var(--text-2); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.mod-card-price { margin: var(--sp-1) 0 0; font-size: var(--fs-13); font-weight: var(--fw-medium); color: var(--text); }
.mod-card-meta { margin: 0; font-size: var(--fs-12); line-height: var(--lh-12); color: var(--text-muted); }
.mod-card-foot { margin-top: var(--sp-2); padding-top: var(--sp-2); border-top: 1px solid var(--line-soft); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2); font-size: var(--fs-12); line-height: var(--lh-12); color: var(--text-2); }
.mod-card-marks { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.mod-card.is-archived { opacity: .7; }
@media (max-width: 720px) {
  .mod-board { grid-template-columns: 1fr; overflow: visible; }
}

/* The module panel: tabs, then one short form per tab. */
.mp { display: flex; flex-direction: column; gap: var(--sp-4); }
.mp-form { display: flex; flex-direction: column; gap: var(--sp-4); }
.mp-tab { display: flex; flex-direction: column; gap: var(--sp-4); }
.mp-h { margin: 0; font-size: var(--fs-14); line-height: var(--lh-14); font-weight: var(--fw-semibold); color: var(--text); }
.mp-note { margin: 0; }
.mp-price { display: inline-flex; align-items: center; gap: var(--sp-2); }
.mp-price .input { max-width: 120px; }
.mp-suffix { font-size: var(--fs-13); color: var(--text-2); }
.mp-publish { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-3); border: 1px solid var(--line-soft); border-radius: var(--r-md); }
.mp-publish .hint { margin: 0; }
.mp-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); font-size: var(--fs-12); line-height: var(--lh-12); }
.mp-checks li { display: inline-flex; align-items: center; gap: var(--sp-1); color: var(--text-2); }
.mp-checks li.is-ok svg { color: var(--ok-text, var(--text-2)); }
.mp-checks li.is-fail { color: var(--text); font-weight: var(--fw-medium); }
.mp-more > summary { cursor: pointer; font-size: var(--fs-13); font-weight: var(--fw-medium); color: var(--text-link); }
.mp-more-body { display: flex; flex-direction: column; gap: var(--sp-4); padding-top: var(--sp-3); }
.mp-used-list { margin: var(--sp-1) 0 0; padding-left: var(--sp-5); font-size: var(--fs-13); }
.mp-danger { padding-top: var(--sp-3); border-top: 1px solid var(--line-soft); }
.mp-fs { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.mp-set { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-3); border: 1px solid var(--line-soft); border-radius: var(--r-md); }
.mp-birth { margin: 0; display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-13); color: var(--text-2); }
.mp-q-list, .mp-secs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
/* A statement: its text across the row, the "…" menu at the end; its score and Reversed on the line below. */
.mp-q { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: var(--sp-1) var(--sp-2); }
.mp-q-n { font-size: var(--fs-12); color: var(--text-muted); text-align: right; }
.mp-q-score { grid-column: 2 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
.mp-q-score .select { max-width: 260px; }
.mp-q + .mp-q:has(.mp-q-score), .mp-q:has(.mp-q-score) + .mp-q { padding-top: var(--sp-2); border-top: 1px solid var(--line-soft); }
.mp-q-tools { display: inline-flex; flex-wrap: wrap; gap: var(--sp-1); }
.mp-q > .mp-q-tools { flex-wrap: nowrap; }
.mp-q-add { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.mp-sec { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-2) var(--sp-3); border: 1px solid var(--line-soft); border-radius: var(--r-md); }
.mp-sec-name { font-size: var(--fs-13); font-weight: var(--fw-medium); }
.mp-sc { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-3); border: 1px solid var(--line-soft); border-radius: var(--r-md); }
.mp-sc-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.mp-sc-name { margin: 0; font-weight: var(--fw-semibold); }
.mp-scores { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-1); }
.mp-score summary { cursor: pointer; font-size: var(--fs-13); }
.mp-weights { list-style: none; margin: var(--sp-2) 0 var(--sp-2) var(--sp-4); padding: 0; display: flex; flex-direction: column; gap: var(--sp-1); font-size: var(--fs-12); line-height: var(--lh-12); color: var(--text-2); }
.mp-sign { display: inline-block; min-width: 3ch; font-weight: var(--fw-semibold); color: var(--text); }
.mp-sample { border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: var(--sp-3); background: var(--bg-subtle); max-height: 560px; overflow: auto; }
.mp-error { margin: 0; }
@media (max-width: 720px) {
  .mp-q { grid-template-columns: 24px minmax(0, 1fr) auto; }
  .mp-sec { flex-direction: column; align-items: flex-start; }
}
/* About AlignmentKey's photos. */
.rm-photo { gap: var(--sp-3); }
.rm-photo-file { position: relative; cursor: pointer; align-self: end; }
.rm-photo-file.is-busy { opacity: .6; pointer-events: none; }
/* Who can use it (Builder.audienceFieldset, shared with products). */
.rm-fs { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.rm-vis-list { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); }

/* The Builder's module list (Report outline step) and cost card. */
#b-modules { margin-bottom: var(--sp-5); }
.rm-b-list { list-style: none; margin: 0; padding: 0; }
.rm-b-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto auto auto; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--line-soft); }
.rm-b-row:first-child { border-top: 0; }
.rm-b-row.is-frame { background: var(--bg-subtle); color: var(--text-2); grid-template-columns: 24px minmax(0, 1fr) auto auto; }
.rm-b-mark { color: var(--text-muted); font-size: var(--fs-12); text-align: center; }
.rm-b-name { margin: 0; font-weight: var(--fw-medium); display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2); }
.rm-b-parts { margin: 0; font-size: var(--fs-12); line-height: var(--lh-12); color: var(--text-muted); }
.rm-b-price { font-size: var(--fs-13); white-space: nowrap; }
.rm-b-noprice { color: var(--highlight-strong-text); }
.rm-b-rule { font-size: var(--fs-12); }
/* Review LOCK-3: a module Start from scratch keeps in every report (locked, in words). */
.rm-b-row.is-global { grid-template-columns: 24px minmax(0, 1fr) auto auto; }

/* T1.20: Edit drafts (draft-edit.js). One column on a phone, a grid of fields from 640px. */
.de { display: flex; flex-direction: column; gap: var(--sp-5); max-width: 960px; }
.de-lead { margin: 0; color: var(--text-2); }
.de-panel, .de-target { display: flex; flex-direction: column; gap: var(--sp-3); }
.de fieldset { margin: 0; padding: var(--sp-4); border: 1px solid var(--line-soft); border-radius: var(--r-8); display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.de legend { padding: 0 var(--sp-2); font-weight: var(--fw-medium); }
.de-grid { display: grid; grid-template-columns: 1fr; gap: var(--sp-3); }
@media (min-width: 640px) { .de-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } }
.de-label-row { display: grid; grid-template-columns: 1fr; gap: var(--sp-2); align-items: end; padding-bottom: var(--sp-2); border-bottom: 1px solid var(--line-soft); }
@media (min-width: 640px) { .de-label-row { grid-template-columns: 120px minmax(0, 1fr) auto; } }
.de-module-row { display: flex; flex-direction: column; gap: var(--sp-2); padding-bottom: var(--sp-3); border-bottom: 1px solid var(--line-soft); }
.de-module-name, .de-dim-key, .de-sub { margin: 0; font-weight: var(--fw-medium); }
.de-flags { display: flex; flex-wrap: wrap; gap: var(--sp-4); align-items: center; }
.de-bands { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-1); }
.de-band { font-family: var(--font-mono, monospace); }
.de-fixed { margin: 0; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-8); background: var(--bg-subtle); color: var(--text-2); }
.de .field-error { margin: 0; color: var(--text-2); }
.de-errors { display: flex; flex-direction: column; gap: var(--sp-1); }
.de-summary, .de-problem { margin: 0; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-8); background: var(--crit-soft); color: var(--text-2); }
.de-summary ul { margin: var(--sp-2) 0 0; padding-left: var(--sp-5); }
.de-where { font-family: var(--font-mono, monospace); font-size: var(--fs-12); }
.de-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.de-status { margin: 0; color: var(--text-2); }
.rm-b-rule:has(.rm-b-locked) { display: flex; flex-direction: column; gap: 2px; }
.rm-b-locked { display: inline-flex; align-items: center; gap: var(--sp-1); font-weight: var(--fw-medium); color: var(--text-2); }
.rm-b-rule .hint { margin: 0; color: var(--text-muted); }
.rm-b-tools { display: inline-flex; gap: var(--sp-1); }
.rm-b-foot { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--line-soft); }
.rm-b-foot .hint { margin: 0; }
.rm-b-empty { padding: var(--sp-2) 0; }
.rm-b-packs { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); margin: 0; padding: var(--sp-3) var(--sp-4); font-size: var(--fs-12); color: var(--text-2); border-top: 1px solid var(--line-soft); }
@media (max-width: 720px) {
  .rm-b-row { grid-template-columns: 24px minmax(0, 1fr) auto; }
  .rm-b-rule, .rm-b-tools { grid-column: 2 / -1; }
}

/* Plan 14.2: the empty sections named in the checklist, and the reuse choice. */
.check-empty { margin-top: var(--sp-2); display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-2); }
.check-empty-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-1); font-size: var(--fs-13); }
.b-scaffold-row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); }
.b-scaffold-row .select { max-width: 240px; }

/* ================================================================= prices */
.price-form, .rm-setup-form { display: flex; flex-direction: column; gap: var(--sp-4); }
.price-packs .input, .rm-setup-table .input { max-width: 120px; margin-left: auto; }
/* fix 5-A (RV5-UX-3): a module's name is the row's header for screen readers, not a column header to the eye. */
.price-packs td:first-child .input, .rm-setup-table td:first-child .input { max-width: none; margin-left: 0; }
.price-history > summary { cursor: pointer; font-size: var(--fs-13); color: var(--text-link); }
.price-history-list { margin: var(--sp-2) 0; padding-left: var(--sp-5); font-size: var(--fs-13); display: flex; flex-direction: column; gap: var(--sp-1); }
.rm-setup-rule { display: inline-block; margin-right: var(--sp-3); font-size: var(--fs-12); color: var(--text-muted); }
.rm-setup-check-title { margin: 0; }
