/* Card editors: shared field blocks, then the candidate's avatar («Мой Аватар»). One column, cards on the grey page. */
.assets-surface { --measure: 980px; }
.assets-page { max-width: none; }
.assets-page { color: var(--ink); }
.assets-page :is(p, h1, h2, h3, summary) { overflow-wrap: anywhere; }
.assets-header { margin-bottom: 24px; }
.assets-kicker { display: block; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); line-height: 1.3; }
.assets-title { margin: 6px 0 8px; }
.assets-subtext { color: var(--ink-2); line-height: 1.5; margin: 0; text-wrap: pretty; }
/* First visit: one line per block saying what it holds; the English names stay (law 9.3). */
.pa-blocks-key { display: grid; gap: 4px; margin: 12px 0 0; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.pa-blocks-key div { display: flex; flex-wrap: wrap; gap: 0 8px; }
.pa-blocks-key dt { font-weight: 600; color: var(--ink); }
.pa-blocks-key dd { margin: 0; }
.assets-section-heading { margin-bottom: 12px; }
.assets-section-heading h2, .assets-panel > h2 { margin: 0; }
.assets-section-heading .pa-category-intro { margin: 6px 0 0; }
.assets-section-heading > div { min-width: 0; }
.pa-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pa-heading-row > button { flex: none; min-height: 36px; padding: 0 12px; font-size: 14px; }
.assets-field { min-width: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.assets-field > span:first-child { color: var(--ink); font-weight: 600; }
.assets-field > small { font-size: 13px; color: var(--ink-3); text-wrap: pretty; }
.assets-field.is-required > span:first-child::after { content: " *"; color: var(--red); }
.assets-field textarea { min-height: 96px; }
.assets-field small { line-height: 1.5; }
.assets-form-grid { display: grid; gap: 16px; }
.assets-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.assets-badge { border-color: var(--line-2); color: var(--ink-2); font-size: 13px; background: var(--bg); }
.assets-status { color: var(--ink-2); font-size: 14px; margin: 0; line-height: 1.5; }
.assets-error { margin: 12px 0; padding: 10px 14px; background: var(--red-tint); border-radius: var(--r); color: var(--red-dark); font-size: 14px; animation: rise var(--t-med) var(--ease) both; }
.assets-error:empty { display: none; }
.assets-savebar { position: sticky; bottom: 8px; z-index: 3; display: grid; gap: 8px; margin: 20px 0 0; padding: 12px 16px; background: var(--glass-strong); backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur)); border: 1px solid var(--line-2); border-radius: var(--r-xl); box-shadow: var(--shadow-3); }
.assets-savebar button { width: 100%; }
.assets-tabs { display: flex; gap: 4px; overflow-x: auto; margin: 0 calc(-1 * var(--pad)) 12px; padding: 0 var(--pad) 10px; scrollbar-width: none; scroll-padding-inline: var(--pad); mask-image: linear-gradient(90deg, transparent, #000 var(--pad), #000 calc(100% - 28px), transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--pad), #000 calc(100% - 28px), transparent); }
.assets-tabs::-webkit-scrollbar { display: none; }
.assets-tabs button { flex-shrink: 0; border-color: transparent; background: transparent; font-weight: 500; color: var(--ink-2); border-radius: var(--pill); }
.assets-tabs button[aria-current]:not([aria-current='false']) { background: var(--bg-raised); border-color: var(--line-2); color: var(--ink); box-shadow: var(--shadow-1); }
.assets-empty { padding: 16px 18px; border: 1px dashed var(--line-2); border-radius: var(--r-lg); color: var(--ink-2); font-size: 15px; }
.assets-empty p { margin: 0 0 12px; }
.assets-empty button { min-height: 40px; padding: 0 14px; font-size: 14px; }
.assets-button-danger { min-height: 36px; padding: 0 10px; border-color: transparent; background: transparent; color: var(--red-dark); font-size: 14px; }

/* Мой Аватар */
.pa-grid { display: grid; }
.pa-category-intro { color: var(--ink-2); font-size: 15px; line-height: 1.5; margin: -4px 0 14px; }
.pa-asset-list { display: grid; gap: 6px; }
.pa-item { min-width: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-raised); transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.pa-item[open] { border-color: var(--line-2); box-shadow: var(--shadow-1); }
.pa-item > summary { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; list-style: none; padding: 12px 16px; font-weight: 400; line-height: 1.3; }
.pa-item > summary::-webkit-details-marker { display: none; }
.pa-item > summary { cursor: pointer; }
.pa-item > summary::after { content: attr(data-edit); order: 3; margin-left: auto; font-size: 13px; font-weight: 500; color: var(--ink-3); }
.pa-item > summary:hover::after { color: var(--red); }
.pa-item[open] > summary::after { content: attr(data-collapse); }
.pa-item-preview { order: 4; flex-basis: 100%; font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pa-item-preview:empty, .pa-item[open] .pa-item-preview { display: none; }
.pa-add { justify-self: stretch; width: 100%; min-height: 44px; margin-top: 8px; border: 1px dashed var(--line-3); border-radius: var(--r); background: transparent; color: var(--ink-2); font-size: 15px; }
.pa-add:hover:not(:disabled) { border-style: solid; border-color: var(--red); color: var(--ink); background: var(--bg-raised); }
.pa-item-title { flex: 1 1 140px; font-size: 16px; font-weight: 600; }
.pa-item-check { align-self: center; }
.pa-item-editor { display: grid; gap: 16px; padding: 4px 16px 16px; }
.pa-item-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.pa-item-meta > span { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pa-check-note { margin: 0; padding: 10px 14px; border-radius: var(--r); background: var(--ok-tint); font-size: 14px; line-height: 1.5; }
.pa-check-note[data-outcome="partial"] { background: var(--warn-tint); }
.pa-check-note[data-outcome="not_confirmed"] { background: var(--bg-2); }
.pa-check-note small { display: block; margin-top: 4px; color: var(--ink-2); }
.pa-privacy { display: grid; gap: 2px; margin: 12px 0 20px; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.pa-privacy strong { color: var(--ink); }
/* Sub-blocks inside a panel share one rhythm: hairline on top, 16px of air, h3 + one explanatory line. */
.pa-list-block, .pa-factions, .pa-alignment, .pa-taboos, .pa-languages, .pa-market { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.pa-list-block:first-child, .pa-factions:first-child, .pa-languages:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.pa-list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.pa-list-head h3 { margin: 0; }
.pa-list-empty { margin: 0; padding: 10px 12px; border: 1px dashed var(--line-2); border-radius: var(--r); color: var(--ink-3); font-size: 14px; }
.pa-legacy { margin: 0; font-size: 14px; color: var(--ink-2); white-space: pre-wrap; }
.pa-wizard-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 8px; }
/* In the wizard: how soon White Mirror can start. */
.pa-wm-start { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-2); }
.pa-wm-start p { flex: 1 1 16rem; margin: 0; font-size: 14px; line-height: 1.45; }
/* «Something waits for your action» on the avatar page and in the company's cabinet (action-banner.js): calm, not red —
   a request waiting for an answer is not a problem. */
.action-banner { display: grid; gap: 6px; margin: 0 0 16px; padding: 14px 16px; border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: var(--r); background: var(--bg-2); }
.action-banner h2 { margin: 0; font-size: 16px; line-height: 1.3; }
.action-banner p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--ink); }
.action-banner .action-banner-rule { color: var(--ink-2); }
.action-banner button { justify-self: start; margin-top: 4px; min-height: 40px; padding: 0 14px; font-size: 14px; }
.pa-wizard-nav .primary:first-child { grid-column: 2; }
.pa-wizard-nav .quiet { grid-column: 1 / -1; justify-self: center; }
.assets-tabs button[aria-current="step"] { background: var(--bg-raised); border-color: var(--line-2); color: var(--ink); box-shadow: var(--shadow-1); }

/* Ядро: radar + twelve bipolar tracks */
.pa-core-layout { display: grid; gap: 20px; }
.pa-core-chart { margin: 0; display: grid; justify-items: center; gap: 8px; }
.pa-core-chart[data-empty] .pa-radar { opacity: .45; }
.pa-radar { width: min(100%, 368px); height: auto; overflow: visible; stroke: none; }
.pa-radar text { stroke: none; }
.pa-radar .radar-grid { fill: none; stroke: var(--line); stroke-width: 1; }
.pa-radar .radar-edge { stroke: var(--line-2); }
.pa-radar .radar-self { fill: var(--red-tint-2); stroke: var(--red); stroke-width: 2; stroke-linejoin: round; }
.pa-radar .radar-observed { fill: var(--ok-tint); stroke: var(--ok); stroke-width: 1.5; stroke-dasharray: 5 4; stroke-linejoin: round; }
.pa-radar .radar-dot.radar-self { fill: var(--red); stroke: #fff; stroke-width: 1.5; }
.pa-radar .radar-dot.radar-observed { fill: var(--ok); stroke: #fff; stroke-width: 1.5; stroke-dasharray: none; }
.pa-radar .radar-label { font-size: 11px; font-weight: 500; fill: var(--ink-2); }
.pa-radar.ba-radar { width: 120px; }
.pa-radar.is-drawn polygon.radar-self, .pa-radar.is-drawn polygon.radar-observed { transform-origin: 50% 50%; animation: radar-in var(--t-slow) var(--ease) both; }
@keyframes radar-in { from { opacity: 0; transform: scale(.6); } }
.pa-core-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; color: var(--ink-2); }
.pa-core-legend i { width: 14px; height: 3px; border-radius: 2px; background: var(--red); }
.pa-core-legend i.is-observed { background: repeating-linear-gradient(90deg, var(--ok) 0 4px, transparent 4px 7px); }
.pa-core-empty { align-self: center; }
.pa-traits { display: grid; gap: 4px; margin: 0; }
.pa-trait { padding: 10px 0; border-top: 1px solid var(--line); }
.pa-trait dt { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 15px; margin-bottom: 6px; }
.pa-trait-scale { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 4px 10px; margin: 0; font-size: 13px; line-height: 1.3; color: var(--ink-2); }
.pa-trait-scale .pa-track { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
.pa-pole:last-child { text-align: right; }
.pa-track { display: inline-flex; align-items: center; gap: 8px; }
.pa-dot-option { position: relative; display: inline-grid; place-items: center; width: 32px; height: 32px; cursor: pointer; border-radius: 50%; }
.pa-dot-option input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; opacity: 0; cursor: pointer; }
.pa-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--bg-raised); border: 1.5px solid var(--line-3); box-sizing: border-box; transition: transform var(--t-fast), background-color var(--t-fast), border-color var(--t-fast); }
.pa-dot-option:hover .pa-dot { border-color: var(--red); }
/* Sibling selectors, not :has(): the choice must stay lit in older browsers too (Firefox ESR 115 on Windows 7). */
.pa-dot-option input:checked + .pa-dot { background: var(--red); border-color: var(--red); transform: scale(1.3); }
/* A faction left at neutral stays grey, so the ones the person moved stand out in red. */
.pa-faction[data-stance="3"] .pa-dot-option input:checked + .pa-dot { background: var(--ink-3); border-color: var(--ink-3); }
.pa-dot-option input:focus-visible + .pa-dot { box-shadow: var(--focus-ring); }
.pa-track { gap: 0; }
.pa-trait-input { margin-top: 6px; min-height: 36px; padding: 6px 10px; font-size: 14px; }
/* a White Mirror suggestion for this scale: the suggested dot is ringed, the card sits under the scale */
.pa-dot-option.is-suggested .pa-dot { border: 2px dashed var(--ink-2); }
.pa-core-proposal { margin-top: 8px; background: var(--bg-raised); }
.pa-core-proposals-note { margin: 0 0 8px; color: var(--ink-2); }
.pa-trait-note { margin: 6px 0 0; font-size: 13px; color: var(--ink-3); }
.pa-trait-evidence { margin-top: 8px; font-size: 14px; color: var(--ink-2); }
.pa-trait-evidence summary { font-size: 13px; padding: 2px 0; }
.pa-trait-evidence p { margin: 6px 0; }
.pa-trait-evidence small { display: block; color: var(--ink-3); }

/* Райдер: work conditions, factions on a five-point scale, alignment, taboos */
.pa-conditions { display: grid; gap: 12px; margin-bottom: 20px; }
.pa-conditions > h3 { margin: 0; }
.pa-conditions > p { margin: -8px 0 0; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.pa-condition-group { display: grid; gap: 6px; }
.pa-condition-label { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.pa-condition-options { display: flex; flex-wrap: wrap; gap: 8px; }
.pa-condition { min-height: 34px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--pill); background: var(--bg-raised); font-size: 14px; color: var(--ink); }
.pa-condition::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; border: 1.5px solid var(--line-3); vertical-align: 1px; box-sizing: border-box; }
.pa-condition:hover { border-color: var(--ink-3); background: var(--bg-raised); }
.pa-condition[data-state="ok"] { border-color: transparent; background: var(--ok-tint); }
.pa-condition[data-state="ok"]::before { background: var(--ok); border-color: var(--ok); }
.pa-condition[data-state="never"] { border-color: transparent; background: var(--red-tint); color: var(--red-dark); text-decoration: line-through; text-decoration-thickness: 1px; text-decoration-color: var(--red-dark); }
.pa-condition[data-state="never"]::before { background: var(--red); border-color: var(--red); }
/* a chip White Mirror suggests for Rider: a dashed ring, the card sits under the grid */
.pa-condition.is-suggested { border: 1.5px dashed var(--ink-2); }
.pa-rider-proposals { margin-top: 16px; }
.pa-rider-proposals .assets-field input { width: 100%; }
.pa-factions > h3, .pa-alignment > h3 { margin: 0 0 4px; }
.pa-factions > p, .pa-alignment > p { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.pa-faction-legend { margin: -4px 0 10px; font-size: 13px; line-height: 1.5; color: var(--ink-3); }
.pa-faction-legend span { white-space: nowrap; }
.pa-faction-rows { display: grid; gap: 6px; }
.pa-faction { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--r); }
.pa-faction[data-stance="4"], .pa-faction[data-stance="5"] { background: var(--ok-tint); border-color: transparent; }
.pa-faction[data-stance="1"] { background: var(--red-tint); border-color: transparent; }
.pa-faction-name { display: grid; gap: 1px; font-weight: 500; font-size: 14px; }
.pa-faction-state { font-size: 12px; font-weight: 400; color: var(--ink-3); }
.pa-alignment-scale { display: grid; gap: 6px; }
.pa-alignment-option { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r); font-size: 14px; cursor: pointer; }
.pa-alignment-option[data-checked] { border-color: var(--red); background: var(--red-tint); }
.pa-radar-toggle { display: grid; gap: 10px; padding: 14px 16px; margin: 10px 0; border: 1px solid var(--line-2); border-radius: var(--r-lg); }
.pa-radar-toggle[data-on="true"] { background: var(--ok-tint); border-color: transparent; }
.pa-radar-state { font-weight: 600; }
/* Lives inside a gapped grid, so the grid gap plus 4px is its distance from the previous row. */
.pa-languages { display: grid; gap: 8px; margin-top: 4px; }
.pa-languages > h3 { margin: 0; }
.pa-languages > p { margin: -4px 0 4px; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.lang-editor { display: grid; gap: 8px; justify-items: start; }
.lang-editor .lang-rows { width: 100%; }
.lang-editor > button { min-height: 36px; padding: 0 12px; font-size: 14px; }
.lang-rows { display: grid; gap: 8px; }
.lang-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 8px; align-items: center; animation: rise var(--t-med) var(--ease) both; }
.lang-row button { min-height: 36px; padding: 0 10px; font-size: 14px; justify-self: end; }
.lang-badge { justify-self: start; }
.pa-languages > p { font-size: 13px; color: var(--ink-3); }
.lang-badge:empty, .pa-item-check:empty { display: none; }
.pa-rate { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 10px; }
.pa-market h3 { margin: 0 0 8px; }
.pa-market p, .pa-review p { color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.pa-market button { width: 100%; }
.pa-review .assets-actions { margin-top: 12px; }
.pa-review .assets-actions button { flex: 1 1 auto; }
/* White Mirror proposals: one card each, agree or decline. */
.pa-proposals { display: grid; gap: 10px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.pa-proposals > h3, .pa-proposals > p { margin: 0; }
.pa-proposal { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--r); }
.pa-proposal .pa-proposal-text { margin: 0; color: var(--ink); }
.pa-review .pa-proposal .assets-actions { margin-top: 4px; }
.pa-review .pa-proposal .assets-actions button, .pa-proposals > .assets-actions button { flex: 0 0 auto; }
.pa-suggestions { margin: 16px 0; animation: rise var(--t-slow) var(--ease) both; }
.pa-suggestions .assets-section-heading { margin-bottom: 4px; }
.pa-suggestion { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.pa-suggestion > input { margin-top: 2px; }
.pa-suggestion label { display: block; line-height: 1.5; cursor: pointer; font-size: 16px; }
.pa-suggestion .assets-badge { margin: 8px 8px 0 0; }
.pa-suggestion select { width: auto; max-width: 100%; margin-top: 8px; min-height: 40px; padding: 6px 10px; font-size: 14px; }
.pa-suggestion details { font-size: 14px; margin-top: 8px; color: var(--ink-2); }
.pa-conflict { margin: 12px 0; padding: 16px 18px; background: var(--bg-raised); border: 1px solid var(--red-tint-2); border-radius: var(--r-lg); }
.pa-conflict h2 { font-size: 18px; margin: 0 0 8px; }
.pa-conflict p { font-size: 14px; color: var(--ink-2); }
.pa-conflict pre { overflow: auto; max-height: 220px; white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.5 var(--font-mono); }
@media (min-width: 900px) {
  .pa-languages { grid-column: 1 / -1; }
  .assets-savebar { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 14px 20px; }
  .assets-savebar button { width: auto; }
  .assets-tabs { margin-inline: 0; padding-inline: 0; flex-wrap: wrap; mask-image: none; -webkit-mask-image: none; }
  .pa-market button, .pa-review .assets-actions button { width: auto; flex: 0 1 auto; }
  .pa-wizard-nav { grid-template-columns: max-content minmax(0, 1fr) max-content; }
  .pa-wizard-nav .primary:first-child, .pa-wizard-nav .primary { grid-column: 3; grid-row: 1; }
  .pa-wizard-nav .quiet { grid-column: 2; grid-row: 1; }
  .pa-radar-toggle { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
}
/* Licence presets: one click adds the entry, then it is refined in place. */
.pa-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; }
.pa-presets-label { font-size: 13px; color: var(--ink-3); margin-right: 2px; }
.pa-preset { min-height: 30px; padding: 0 12px; border: 1px dashed var(--line-3); border-radius: var(--pill); background: var(--bg-raised); font-size: 13px; color: var(--ink-2); }
.pa-preset:hover:not(:disabled) { border-style: solid; border-color: var(--red); color: var(--ink); background: var(--bg-raised); }
.pa-preset:disabled { opacity: .45; }
/* Own spheres: a name instead of a label, the same five dots, a way to remove. */
.pa-custom-factions { margin-top: 6px; }
.pa-custom-factions .pa-faction { grid-template-columns: minmax(0, 1fr) auto auto; }
.pa-custom-factions .pa-faction-name input { min-height: 34px; padding: 4px 8px; font-size: 14px; font-weight: 500; }
.pa-custom-remove { min-height: 30px; padding: 0 8px; font-size: 18px; color: var(--ink-3); }

/* ---------- layout pass, 13 October ---------- */
/* The save bar docks 12px above the bottom edge of the scroll surface (the page's own end space is in styles.css), so
   nothing peeks out underneath it; focused fields stop above it thanks to the surface's scroll padding. On a phone it is one
   compact row — the state on the left, the button on the right — instead of a block a third of the screen high. */
.assets-savebar { bottom: 12px; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 12px; padding: 10px 10px 10px 16px; }
.assets-savebar button { width: auto; }
.assets-savebar .assets-status { font-size: 13px; line-height: 1.35; }
.assets-page .assets-field :is(input, select, textarea), .assets-page .pa-trait-input { scroll-margin-block: 16px 104px; }
/* Text fields grow with their text instead of hiding lines behind a scrollbar (field-sizing where the browser has it,
   autosizeFields() in ui.js elsewhere); a very long text scrolls inside a field of at most 60% of the screen. */
.assets-field textarea { field-sizing: content; max-height: 60vh; }
/* «Open in full» between Back and Next is a link-like secondary action, not a stray label. */
.pa-wizard-nav .quiet { color: var(--ink-2); font-size: 14px; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line-3); }
.pa-wizard-nav .quiet:hover:not(:disabled) { background: transparent; color: var(--ink); text-decoration-color: currentColor; }
/* An own sphere keeps its five dots in the same column as the listed ones: the remove cross moves to the start of the row. */
.pa-custom-factions .pa-faction { grid-template-columns: auto minmax(0, 1fr) auto; }
.pa-custom-remove { order: -1; margin-left: -6px; }
@media (min-width: 900px) {
  .assets-savebar { padding: 12px 12px 12px 20px; }
  .assets-savebar .assets-status { font-size: 14px; }
}

/* Phone: the level names carry CEFR now, so language and level stack and the level is never cut. */
@media (max-width: 559px) {
  .lang-row { grid-template-columns: minmax(0, 1fr); }
  .lang-row > button { grid-column: 1; justify-self: end; }
}

/* Avatar round 2 (14.10): faction dots coloured by the stance, unset rows, used quick-add chips, disabled reasons. */
/* The chosen dot takes the colour of its meaning: red "not for me", amber "probably not", grey neutral, green interested. */
.pa-faction[data-stance="1"] .pa-dot-option input:checked + .pa-dot { background: var(--red); border-color: var(--red); }
.pa-faction[data-stance="2"] .pa-dot-option input:checked + .pa-dot { background: var(--warn); border-color: var(--warn); }
.pa-faction[data-stance="3"] .pa-dot-option input:checked + .pa-dot { background: var(--ink-3); border-color: var(--ink-3); }
.pa-faction[data-stance="4"] .pa-dot-option input:checked + .pa-dot,
.pa-faction[data-stance="5"] .pa-dot-option input:checked + .pa-dot { background: var(--ok); border-color: var(--ok); }
.pa-faction[data-stance="4"] .pa-dot-option:hover .pa-dot, .pa-faction[data-stance="5"] .pa-dot-option:hover .pa-dot { border-color: var(--ok); }
.pa-faction[data-stance="2"] { background: var(--warn-tint); border-color: transparent; }
/* Not placed yet: dashed outline and a muted name, so it never reads as a chosen neutral. */
.pa-faction[data-stance=""] { border-style: dashed; }
.pa-faction[data-stance=""] .pa-faction-name { color: var(--ink-2); font-weight: 400; }
.pa-faction[data-stance=""] .pa-faction-state { font-style: italic; }
/* A quick-add chip already on the list: solid, with a tick, not faded like an unavailable control. */
.pa-preset.is-added, .pa-preset.is-added:disabled { opacity: 1; border-style: solid; border-color: var(--ok); color: var(--ok); background: var(--ok-tint); cursor: default; }
/* Why a button is disabled, right next to it. */
.pa-disabled-reason { flex-basis: 100%; margin: 4px 0 0; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.pa-approve-actions { flex-wrap: wrap; align-items: center; }
/* The Radar decided in the approval step: a tick next to the button. */
.pa-approve-radar { display: flex; align-items: center; gap: 8px; font-size: 15px; line-height: 1.4; cursor: pointer; }
.pa-approve-radar input { width: 18px; height: 18px; margin: 0; flex: none; }
/* Restoring dismissed suggestions is a real button. */
.pa-proposals .pa-restore { border: 1px solid var(--line-2); background: var(--bg-raised); }
/* With nothing to save, the save button reads "Saved" in a calm outline, not a grey disabled block. */
.assets-savebar button.is-saved:disabled { opacity: 1; background: transparent; border: 1px solid var(--line-2); color: var(--ok); }

/* ---------- shell pass, 14 October ---------- */
/* Phone: amount and currency share a row; the period and "after or before tax" each get the full width, so their longest
   option ("Before tax (gross)") is never cut. */
@media (max-width: 559px) {
  .pa-rate { grid-template-columns: minmax(0, 1fr) 110px; }
  .pa-rate > :nth-child(n+3) { grid-column: 1 / -1; }
}
/* Section tabs wrap onto a second row on a phone instead of scrolling sideways with the last ones out of sight. */
.assets-tabs { flex-wrap: wrap; overflow-x: visible; margin-inline: 0; padding-inline: 0; row-gap: 4px; mask-image: none; -webkit-mask-image: none; }

/* ---------- avatar round 3, 14 October ---------- */
/* The save bar floats only while there is something to save; saved, it rests at the end of the page, so on a phone it
   never covers the bottom of the Core Stats radar. */
.assets-savebar { position: static; }
.assets-savebar[data-pending] { position: sticky; }
/* The chosen alignment is a choice, not a warning: a calm ink outline like a chosen neutral faction, never red. */
.pa-alignment-option[data-checked] { border-color: var(--ink-3); background: var(--bg-2); font-weight: 500; }
.pa-alignment-option input { accent-color: var(--ink-2); }

/* ---------- avatar round 4, 14 October ---------- */
/* The approval step shows what the approval covers: the saved avatar, block by block, in a few calm lines. */
/* It follows the suggestions block, whose own bottom rule separates the two. */
.pa-summary { margin: 0 0 4px; }
.pa-summary h3 { margin: 0 0 10px; }
.pa-summary dl { display: grid; gap: 10px; margin: 0; }
.pa-summary-row { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 4px 16px; }
.pa-summary dt { font-weight: 600; color: var(--ink); font-size: 15px; }
.pa-summary dd { margin: 0; display: grid; gap: 2px; color: var(--ink-2); font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.pa-summary-empty { color: var(--ink-3); font-style: italic; }
@media (max-width: 559px) { .pa-summary-row { grid-template-columns: minmax(0, 1fr); } }

/* ---------- tablet pass, 15 October ---------- */
/* The radar sits beside the scales, and a scale puts its poles on either side of the dots, only when the card itself has the
   room — not whenever the screen passes 900px. A tablet showing the desktop layout at about 1000px left the scales a 240px
   column: every pole word on its own line and the poles running into the dots. */
.pa-core { container: pa-core / inline-size; }
.pa-traits { container: pa-traits / inline-size; }
.pa-pole { min-width: 0; overflow-wrap: anywhere; }
@container pa-core (min-width: 760px) {
  .pa-core-layout { grid-template-columns: 368px minmax(0, 1fr); align-items: start; gap: 32px; }
}
@container pa-traits (min-width: 400px) {
  .pa-trait-scale { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .pa-trait-scale .pa-track { grid-column: auto; grid-row: auto; }
}

/* ---------- content-width pass, 15 October ---------- */
/* Side-by-side layouts inside the page follow the width the content column really has (the "surface" container), not the
   screen. At 900–1100px the 260px sidebar leaves the content 576–776px — less than a tablet's 788px without it — so
   viewport rules gave the "desktop" layout the least room: two-column forms of 135–175px fields, factions of 128px, a cut
   rate select. Measured content widths: 820→788, 900→576, 1024→700, 1100→776, 1280→956, 1440→980. */
.mvp-surface { container: surface / inline-size; }
@container surface (min-width: 640px) {
  .assets-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .assets-form-grid > .assets-wide, .pa-languages { grid-column: 1 / -1; }
  .lang-row { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 6px 8px; }
  .lang-row button { grid-column: 3; grid-row: 1; }
  .lang-badge { grid-column: 1 / 3; }
  .pa-alignment-scale { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* A two-column language row puts «Remove» under the level, at the right edge. */
@container surface (max-width: 639px) { .lang-row > button { grid-column: -2 / -1; } }
@container surface (min-width: 760px) {
  .pa-faction-rows { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Own spheres keep one column: their name is a text field that needs the width. */
  .pa-faction-rows.pa-custom-factions { grid-template-columns: minmax(0, 1fr); }
  .pa-rate { grid-template-columns: minmax(0, 1fr) 110px minmax(0, 1fr) minmax(0, 1fr); }
}
/* Rate on a medium card: two even columns, so "After tax or before tax" never lands in the 110px currency column. */
@container surface (min-width: 520px) and (max-width: 759px) { .pa-rate { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container surface (max-width: 519px) { .pa-rate > :nth-child(n+3) { grid-column: 1 / -1; } }
/* An own sphere on a narrow card: the dots go under the name, so the name field keeps a usable width (it was 65–97px). */
@container surface (max-width: 519px) {
  .pa-custom-factions .pa-faction { grid-template-columns: auto minmax(0, 1fr); }
  .pa-custom-factions .pa-faction > .pa-track { grid-column: 2; justify-self: end; }
}
/* The person's choices in White Mirror's made-up situations: the question muted, the choice and their own words plain. */
.pa-situations .pa-situation-question { margin: 0; color: var(--ink-3); font-size: 0.92em; }
.pa-situations .pa-situation-own { margin: 0; color: var(--ink-2); }
/* The latest White Mirror session's result: its summary, its directions and «Still open», calm and without marks. */
.pa-result h4 { margin: 8px 0 0; font-size: 15px; }
.pa-result .pa-result-meta { margin: 0; color: var(--ink-3); font-size: 14px; }
.pa-result-summary summary { cursor: pointer; color: var(--ink-2); font-size: 14px; }
/* The summary as White Mirror wrote it, drawn from its light Markdown like a chat reply (renderRich in ui.js): the blocks
   as headings with air above them, bold, lists hugging the line before them. */
.pa-result-text { margin-top: 8px; color: var(--ink); }
.pa-result-text > * { margin: 0; }
.pa-result-text > * + * { margin-top: 10px; }
.pa-result-text p { white-space: pre-wrap; overflow-wrap: anywhere; }
.pa-result-text strong { font-weight: 600; }
.pa-result-text .rich-heading { font-size: 1.0625em; font-weight: 600; letter-spacing: -.005em; line-height: 1.4; }
.pa-result-text > * + .rich-heading { margin-top: 18px; }
.pa-result-text > .rich-heading + * { margin-top: 6px; }
.pa-result-text > p + :is(ul, ol) { margin-top: 6px; }
.pa-result-text ul, .pa-result-text ol { padding-left: 22px; }
.pa-result-text li { padding-left: 2px; overflow-wrap: anywhere; }
.pa-result-text li + li { margin-top: 6px; }
.pa-result-text li::marker { color: var(--ink-3); }
.pa-result-text hr { margin-block: 16px; border: 0; border-top: 1px solid var(--line-2); }
.pa-direction { display: grid; gap: 4px; margin: 0; font-size: 14px; }
.pa-direction > div { display: grid; grid-template-columns: minmax(0, 11em) minmax(0, 1fr); gap: 8px; }
.pa-direction dt { color: var(--ink-3); }
.pa-direction dd { margin: 0; color: var(--ink-2); }
@container surface (max-width: 519px) { .pa-direction > div { grid-template-columns: minmax(0, 1fr); gap: 0; } }
.pa-review .pa-direction-note { margin: 0; color: var(--ink-3); font-size: 13px; }
.pa-still-open { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.pa-still-open li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 15px; }
.pa-still-open li[data-done="true"] > span:first-child { color: var(--ink-3); }
.pa-still-open-done { color: var(--ink-3); font-size: 14px; }
/* Entries White Mirror filled in after the conversation (law 3.3), waiting for the person: the same card as an entry of
   the person's own, with a dashed edge and a small mark until confirmed; the banner under the title holds «Confirm all». */
.pa-prefill-banner { display: grid; gap: 8px; margin-top: 12px; padding: 14px 16px; border: 1px dashed var(--line-3); border-radius: var(--r); background: var(--bg-2); }
.pa-prefill-banner p { margin: 0; font-size: 14px; line-height: 1.45; }
.pa-prefill-banner-text { color: var(--ink); font-size: 15px; }
.pa-prefill-note { color: var(--ink-3); font-size: 13px; }
.pa-prefill-mark { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border: 1px dashed var(--line-3); border-radius: 999px; color: var(--ink-2); font-size: 12px; font-weight: 500; line-height: 1.4; }
.pa-prefill-mark::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
.pa-item.pa-prefill { border-style: dashed; border-color: var(--line-3); }
.pa-item.pa-prefill > summary .pa-prefill-mark { order: -1; flex-basis: 100%; }
.pa-item > summary .pa-prefill-count { order: 2; }
.pa-proposal.pa-prefill { border-style: dashed; border-color: var(--line-3); background: var(--bg-raised); }
.pa-prefill-lines { display: grid; gap: 8px; }
.pa-prefill-editor .pa-item-meta { align-items: flex-start; }
.pa-prefill-review { border-bottom: 1px solid var(--line); }
/* a point the conversation pre-set, not yet confirmed: lit like a chosen one, but hollow */
.pa-dot-option.is-prefilled input:checked + .pa-dot { background: var(--bg-raised); border: 2px dashed var(--red); transform: scale(1.3); }

/* The finished reply and its background proposals have separate, readable states. */
.pa-processing { padding: 12px 16px; border: 1px solid var(--line, #e1e2e5); border-radius: 12px; background: var(--surface, #fff); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pa-processing p { margin: 0; flex: 1 1 240px; font-size: 14px; line-height: 1.5; }
.pa-processing[data-status="pending"] { background: #f6f7f8; }
.pa-processing[data-status="error"] { border-color: #e6caca; background: #fff8f8; }
.pa-prefill .assets-badge { white-space: normal; }
.wm-processing-status { line-height: 1.5; }

/* A useful result leads the editor; the five canonical blocks remain available on demand. */
.pa-result-panel { margin-block: 0 20px; min-width: 0; }
.pa-result-panel .pa-result { border: 0; margin: 0; padding: 0; }
.pa-result-lead { font-size: 1.0625rem; line-height: 1.65; }
.pa-result-summary { border-top: 1px solid var(--line-2); padding-top: 12px; margin-top: 14px; }
.pa-result-summary > summary { padding-block: 4px; }
.pa-result-summary > summary:focus-visible { outline: 2px solid var(--ink-3); outline-offset: 4px; border-radius: 3px; }
.pa-episode-note { color: var(--ink-2); line-height: 1.55; padding: 10px 12px; background: var(--bg); border-left: 2px solid var(--line-2); }

/* Result decisions stay with their record, including the required workplace choice. */
.pa-result-state > li { align-items: start; }
.pa-result-actions, .pa-result-workplace, .pa-result-entry-body { flex-basis: 100%; }
.pa-result-entry-body { min-width: 0; overflow-wrap: anywhere; }
.pa-result-entry-body > p { margin: .25rem 0; }
.pa-result-workplace { display: grid; gap: .65rem; width: min(100%, 36rem); padding: .8rem; border: 1px solid var(--line, #d8d8d8); border-radius: .6rem; }
.pa-result-workplace .assets-field { margin: 0; }
.pa-result-workplace > button { justify-self: start; }
.pa-result-next { margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--line, #d8d8d8); }
.pa-result-next p { max-width: 68ch; }

/* Session records use the same restrained list in chat and on the avatar result. */
.pa-session-records { margin-top: 1.25rem; min-width: 0; }
.pa-session-records h4 { margin: 0 0 .75rem; }
.pa-records-list { list-style: none; padding: 0; margin: 0; }
.pa-session-record { border-top: 1px solid var(--line, #deded8); padding: .85rem 0; overflow-wrap: anywhere; }
.pa-record-title { font-weight: 600; margin: .25rem 0; }
.pa-record-details { white-space: pre-wrap; margin: .35rem 0; line-height: 1.55; }
.pa-session-record .assets-kicker { margin: 0; }
.pa-record-state { margin: .35rem 0 0; color: var(--ink-3); font-size: 14px; }
.wm-records-pending { font-size: .9rem; }
