/* Токены и геометрия контролов приходят из site/; здесь — раскладка конструктора. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 1rem); }
::selection { background: var(--accent); color: var(--accent-ink); }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); font-weight: 400; font-size: var(--fs-body); line-height: var(--lh-body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-wrap: break-word; }
button, input, select, textarea { font: inherit; }
button, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; height: auto; }
button:focus, a:focus, summary:focus, input:focus, select:focus, textarea:focus, [tabindex]:focus { outline: 2px solid var(--text); outline-offset: 3px; }
/* Отдельное правило :focus сохраняет клавиатурный фокус в Safari 15.0–15.3.
 * Адаптации ниже перекрывают и повторно сгенерированные стили site/controls.css. */
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
button:focus:not(:focus-visible), a:focus:not(:focus-visible), summary:focus:not(:focus-visible), input:focus:not(:focus-visible), select:focus:not(:focus-visible), textarea:focus:not(:focus-visible), [tabindex]:focus:not(:focus-visible),
.btn:focus:not(:focus-visible), .field input:focus:not(:focus-visible), .xml-field input:focus:not(:focus-visible), .xml-field select:focus:not(:focus-visible), .xml-field textarea:focus:not(:focus-visible),
.faq__q:focus:not(:focus-visible), .xml-section > summary:focus:not(:focus-visible), .issues-panel > summary:focus:not(:focus-visible), .constructor-guide summary:focus:not(:focus-visible) { outline: none; }
/* Программно фокусируемые заголовки и контейнеры никогда не получают рамку. */
[tabindex="-1"]:focus { outline: none !important; }
/* Текстовый input совпадает с :focus-visible даже после клика в Chromium.
 * Способ ввода уточняется в focus.js; Tab возвращает клавиатурный индикатор. */
html[data-focus-modality="pointer"] :focus { outline: none !important; }
.filefield__input:focus + .filefield__btn { outline: 2px solid var(--text); outline-offset: 2px; }
.filefield__input:focus-visible + .filefield__btn { outline: 2px solid var(--text); outline-offset: 2px; }
.filefield__input:focus:not(:focus-visible) + .filefield__btn { outline: none; }
html[data-focus-modality="pointer"] .filefield__input:focus + .filefield__btn,
html[data-focus-modality="pointer"] .xml-choice-input:focus + .xml-choice-label { outline: none !important; }
h1, h2, h3 { margin: 0; font-family: var(--font-body); font-weight: 500; line-height: var(--lh-body); letter-spacing: normal; }
h1, #step-title { font-family: var(--font-display); font-weight: 800; line-height: var(--lh-heading); letter-spacing: var(--track-display); }
h1 { max-width: var(--maxw-prose); font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p { margin: 0; }
.skip-link { position: fixed; left: 1rem; top: -6rem; z-index: calc(var(--z-header) + 1); padding: .75rem; background: var(--accent); color: var(--accent-ink); text-decoration: none; }
.skip-link:focus { top: .75rem; }
.schema-label { margin-left: auto; font-size: var(--fs-small); color: var(--text-muted); text-align: right; }
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.page { padding-top: calc(var(--section-y) / 2); }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--gutter); margin-bottom: 1.5rem; }
.eyebrow { margin-bottom: .5rem; font-size: var(--fs-small); font-weight: 500; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--text-muted); }
.intro { margin-top: .75rem; max-width: var(--maxw-prose); color: var(--text-muted); }
.access-note { font-size: var(--fs-small); color: var(--text-muted); white-space: nowrap; }
.button-row { display: flex; gap: 1.25rem; flex-wrap: wrap; align-items: center; }
.button, .xml-button { font-size: var(--fs-body); white-space: normal; line-height: var(--lh-body); text-align: center; }
.button-quiet { color: var(--text-muted); }
.btn--link { min-height: 48px; text-decoration: none; transition: color var(--dur-fast) var(--ease-out); }
.btn--link:hover { color: var(--text-muted); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; padding: .5rem 0 1.5rem; }
.toolbar .button { font-size: var(--fs-small); }
.notice { margin-bottom: .75rem; color: var(--text-muted); font-size: var(--fs-small); }
.notice:empty { display: none; }
.notice[data-kind="warning"], .notice[data-kind="error"] { padding: .75rem 1rem; border-left: var(--ybar-w) solid var(--accent); color: var(--text); }
.notice[data-kind="error"] { border-left-color: var(--error); }
.example-notice { padding: .75rem 1rem; margin-bottom: 1rem; border-left: var(--ybar-w) solid var(--accent); font-size: var(--fs-small); }
.draft-prompt { display: flex; justify-content: space-between; align-items: center; gap: var(--gutter); margin: 1.5rem 0; padding: 1rem 0 1rem 1.25rem; border-left: var(--ybar-w) solid var(--accent); }
.draft-prompt h2 { margin-bottom: .5rem; font-size: var(--fs-h3); }
.workspace { display: grid; grid-template-columns: 17rem minmax(0, 1fr); align-items: start; gap: var(--gutter); scroll-margin-top: calc(var(--header-h) + 1rem); }
.steps-panel { position: sticky; top: calc(var(--header-h) + 1rem); min-width: 0; }
.progress-heading { display: flex; justify-content: space-between; gap: .5rem; padding: 0 0 .5rem; font-size: var(--fs-small); font-weight: 500; }
.progress-heading span:last-child { color: var(--text-muted); font-variant-numeric: tabular-nums; }
progress { display: block; width: 100%; height: var(--radius); margin: 0 0 1.25rem; border: 0; appearance: none; -webkit-appearance: none; background: var(--border); }
progress::-webkit-progress-bar { background: var(--border); }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }
.step-list { margin: 0; padding: 0; list-style: none; }
.step-list li + li { margin-top: .25rem; }
.step-toggle { display: none; width: 100%; min-height: 48px; align-items: center; gap: .75rem; padding: .75rem 0; border: 0; background: transparent; color: var(--text); text-align: left; font-size: var(--fs-body); line-height: var(--lh-body); }
.step-toggle > span:first-child { flex: 1; min-width: 0; }
.step-toggle-arrow { flex: none; color: var(--text-muted); }
.step-toggle[aria-expanded="true"] .step-toggle-arrow { transform: rotate(180deg); }
.step-button { display: flex; gap: .75rem; width: 100%; min-height: 48px; padding: .75rem 1rem; text-align: left; border: 0; border-left: var(--ybar-w) solid transparent; border-radius: var(--radius); background: transparent; color: var(--text-muted); font-size: var(--fs-small); line-height: var(--lh-body); align-items: center; transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.step-button:hover { color: var(--text); background: var(--surface); }
.step-button.is-current { border-left-color: var(--accent); background: var(--accent-ink); color: var(--bg); font-weight: 500; }
.step-number { flex: 0 0 2ch; font-variant-numeric: tabular-nums; color: inherit; font-size: var(--fs-small); }
.step-issues { margin-left: auto; min-width: 1ch; color: var(--error); font-size: var(--fs-small); font-weight: 800; text-align: right; }
.save-note { padding-top: 1rem; margin-top: 1.25rem; border-top: 1px solid var(--border); font-size: var(--fs-small); color: var(--text-muted); }
.editor-panel { min-width: 0; padding: var(--gutter); background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.step-heading { margin-bottom: 1.5rem; }
.step-heading > p { margin-top: .75rem; color: var(--text-muted); }
.step-heading .required-note { margin-top: .5rem; font-size: var(--fs-small); }
.xml-field { margin: 0; max-width: var(--maxw-prose); min-width: 0; }
.xml-field-enum { max-width: none; width: 100%; }
.xml-selected-value { margin-top: .375rem; font-size: var(--fs-small); line-height: var(--lh-body); white-space: normal; overflow-wrap: anywhere; }
.xml-field input, .xml-field select, .xml-field textarea { font-family: var(--font-body); font-size: var(--fs-body); line-height: var(--lh-body); transition: border-color var(--dur-fast) var(--ease-out); }
.xml-field input:hover, .xml-field select:hover, .xml-field textarea:hover { border-color: var(--border-strong); }
.xml-field select { appearance: none; -webkit-appearance: none; padding-right: 2.75rem; background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%); background-position: calc(100% - 1.15rem) 50%, calc(100% - .8rem) 50%; background-size: .35rem .35rem; background-repeat: no-repeat; }
.xml-field textarea { resize: vertical; min-height: 7rem; }
.xml-field input[type="file"] { font-size: var(--fs-small); }
.xml-field-error { font-size: var(--fs-small); color: var(--error); white-space: pre-line; overflow-wrap: anywhere; }
.xml-field-error:empty, .xml-save-status:empty { display: none; }
.xml-field input[aria-invalid="true"], .xml-field select[aria-invalid="true"], .xml-field textarea[aria-invalid="true"] { border-color: var(--error); }
.filefield__input[aria-invalid="true"] + .filefield__btn { border-color: var(--error); }
.xml-field-number input { max-width: 12ch; }
.xml-field-code input { max-width: 24ch; }
.xml-date, .xml-boolean { border: 0; padding: 0; }
.xml-date > legend, .xml-boolean > legend, .xml-choice > legend { max-width: 100%; padding: 0; margin-bottom: .375rem; line-height: var(--lh-body); }
.xml-date-row { display: flex; gap: .75rem; }
.xml-date-row label { display: flex; flex-direction: column; gap: .375rem; }
.xml-date-row input { width: calc(4ch + 1.6rem); font-variant-numeric: tabular-nums; }
.xml-date-row input[data-date-part="year"] { width: calc(6ch + 1.6rem); }
.xml-choice { border: 0; padding: 0; margin: 0; min-width: 0; }
.xml-choice[aria-invalid="true"], .xml-boolean[aria-invalid="true"] { border-left: 2px solid var(--error); padding-left: .75rem; }
.xml-choice-options { display: flex; flex-direction: column; gap: .375rem; }
.xml-choice-item { position: relative; min-width: 0; }
.xml-choice-label { display: block; min-height: 48px; padding: .6rem .8rem .6rem 2.75rem; border-radius: var(--radius); background: transparent; color: var(--text); font-size: var(--fs-body); line-height: var(--lh-body); cursor: pointer; transition: background-color var(--dur-fast) var(--ease-out); }
.xml-choice-input:not(:disabled) + .xml-choice-label:hover { background: var(--bg); }
/* --text соответствует фирменному --ink в светлой теме сайта. */
.xml-choice-input, .xml-field .xml-choice-input { appearance: none; -webkit-appearance: none; position: absolute; left: .8rem; top: .875rem; width: 1.25rem; height: 1.25rem; min-height: 0; padding: 0; margin: 0; border: 2px solid var(--ink, var(--text)); background: var(--surface); cursor: pointer; transition: box-shadow var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out); }
.xml-choice-input[type="radio"] { border-radius: var(--radius-pill); }
.xml-choice-input:not(:disabled):hover, .xml-choice-item:hover > .xml-choice-input:not(:disabled) { box-shadow: 0 0 0 .125rem var(--accent); }
.xml-choice-input:checked, .xml-field .xml-choice-input:checked { background: var(--ink, var(--text)); }
.xml-choice-input[type="radio"]:checked { background-image: radial-gradient(circle, var(--accent) 0 .2rem, transparent .23rem); }
.xml-choice-input:checked + .xml-choice-label { background: var(--bg); box-shadow: inset var(--ybar-w) 0 0 var(--accent); }
.xml-choice-input:focus, .xml-field .xml-choice-input:focus { outline: none; }
.xml-choice-input:focus + .xml-choice-label { outline: 2px solid var(--text); outline-offset: 2px; }
.xml-choice-input:focus-visible + .xml-choice-label { outline: 2px solid var(--text); outline-offset: 2px; }
.xml-choice-input:focus:not(:focus-visible) + .xml-choice-label { outline: none; }
.xml-choice-input:disabled { opacity: .45; cursor: not-allowed; }
.xml-choice-input:disabled + .xml-choice-label { opacity: .55; cursor: not-allowed; }
.xml-choice-branch:empty { display: none; }
.xml-boolean .xml-choice-options { flex-direction: row; flex-wrap: wrap; gap: .75rem; }
.xml-combo { position: relative; min-width: 0; }
.xml-combo-list { position: absolute; z-index: 10; left: 0; right: 0; top: calc(100% + .25rem); max-height: 15rem; overflow-y: auto; margin: 0; padding: .25rem; list-style: none; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.xml-combo-list [role="option"] { padding: .6rem .8rem; min-height: 48px; cursor: pointer; border-radius: var(--radius); font-size: var(--fs-body); line-height: var(--lh-body); }
.xml-combo-list [role="option"]:hover, .xml-combo-list .is-active { background: var(--bg); }
.xml-combo-list [aria-selected="true"] { box-shadow: inset var(--ybar-w) 0 0 var(--accent); }
.xml-combo-empty { padding: .75rem; color: var(--text-muted); font-size: var(--fs-small); }
.xml-error-summary { padding: .75rem 1rem; border-left: 2px solid var(--error); }
.xml-error-summary-title { font-size: var(--fs-small); font-weight: 800; }
.xml-error-summary ol { margin: .5rem 0 0; padding-left: 1.25rem; }
.xml-save-status { font-size: var(--fs-small); color: var(--text-muted); }
.xml-section { margin: 0; min-width: 0; }
.xml-section > summary, .issues-panel > summary, .constructor-guide summary, .faq__q, .xml-repeat > legend, .xml-choice > legend, .xml-group-title { font-family: var(--font-body); font-weight: 500; font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: normal; text-transform: none; }
.xml-section > summary { align-items: baseline; overflow-wrap: anywhere; }
.xml-group-description { margin-bottom: .75rem; font-size: var(--fs-small); line-height: var(--lh-body); color: var(--text-muted); overflow-wrap: anywhere; }
.xml-section > .xml-field-error { padding-bottom: .75rem; }
.xml-section-body { min-width: 0; }
.xml-group { display: grid; gap: .75rem; min-width: 0; }
.xml-section-body .xml-section-body, .xml-section-body .xml-choice-branch, .xml-choice-branch .xml-section-body, .xml-choice-branch .xml-choice-branch { margin-top: .75rem; padding-left: 0; border-left: 0; }
.xml-section-body > .xml-section:last-child, .xml-section-body > .xml-choice-branch:last-child > .xml-section:last-child { border-bottom: 0; }
.xml-section-body > .xml-button { justify-self: start; }
.xml-repeat { min-width: 0; padding: 0; margin: 0; border: 0; }
.xml-repeat > legend { max-width: 100%; padding: 0; margin-bottom: .75rem; }
.xml-repeat-item { display: grid; gap: .5rem; min-width: 0; }
.xml-repeat-item + .xml-repeat-item { padding-top: .875rem; margin-top: .875rem; border-top: 1px solid var(--border); }
.xml-repeat-item > .xml-section { border-bottom: 0; }
.xml-repeat-item > .xml-section > summary { padding-block: .75rem; }
.xml-repeat-item > .xml-button[data-action="remove"] { justify-self: end; }
.xml-repeat > .xml-button[data-action="add"] { margin-top: .5rem; }
.xml-button[data-action="add"], .xml-button[data-action="add-section"] { max-width: 100%; text-align: left; justify-content: flex-start; }
.xml-button[data-action="remove"], .xml-button[data-action="remove-section"] { color: var(--text-muted); font-size: var(--fs-small); }
.step-footer { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; padding-top: 1.5rem; }
.step-footer .btn--primary { margin-left: auto; max-width: 80%; }
.issues-panel { padding: .25rem 0 .25rem 1rem; margin-top: 1.5rem; border-left: 2px solid var(--error); }
.issues-panel ol { padding-left: 1.5rem; }
.issue-link { background: none; color: var(--text); text-align: left; border: 0; padding: .375rem 0; text-decoration: none; transition: color var(--dur-fast) var(--ease-out); font-size: var(--fs-small); }
.issue-link:hover { color: var(--text-muted); }
.document-actions { display: flex; justify-content: space-between; align-items: center; gap: var(--gutter); padding: 1.5rem 0; margin-top: 1.5rem; border-top: 1px solid var(--border); }
.document-actions > div:first-child { flex: 1; min-width: 0; }
.document-actions > div:first-child > p:first-child { font-size: var(--fs-small); font-weight: 500; }
.document-note { margin-top: .375rem; color: var(--text-muted); font-size: var(--fs-small); }
.page-footer { padding-top: 1.5rem; padding-bottom: 1.75rem; color: var(--text-muted); font-size: var(--fs-small); }
.page-footer p + p { margin-top: .25rem; }
.preview-panel { position: fixed; inset: 0; display: flex; flex-direction: column; z-index: var(--z-toast); background: var(--bg); }
.preview-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.25rem var(--gutter); border-bottom: 1px solid var(--border); background: var(--surface); }
.preview-toolbar p { font-size: var(--fs-small); color: var(--text-muted); margin-top: .375rem; }
.preview-panel iframe { flex: 1; width: 100%; min-height: 0; border: 0; background: var(--surface); }
.constructor-guide { max-width: var(--maxw-prose); margin-top: var(--section-y); padding-block: 2rem; border-top: 1px solid var(--border); }
.constructor-guide > * + * { margin-top: 1em; }
.constructor-guide h3 { margin-top: 1.5em; }
.constructor-guide ol { padding-left: 1.5em; }
.constructor-guide li + li { margin-top: .75em; }
.constructor-guide a { color: var(--text); font-weight: 500; text-decoration: none; transition: color var(--dur-fast) var(--ease-out); }
.constructor-guide a:hover { color: var(--text-muted); }
.constructor-guide details p { margin: 0 0 1.25rem; color: var(--text-muted); }
@media (max-width: 1219px) {
  .schema-label { display: none; }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
  .steps-panel { position: static; }
  .steps-panel .progress-heading { display: none; }
  .steps-panel progress { margin-bottom: .25rem; }
  .step-toggle { display: flex; }
  .step-toggle[aria-expanded="false"] + .step-list { display: none; }
  .step-list { padding-bottom: .5rem; }
  .save-note { padding-top: 0; margin-top: .25rem; border-top: 0; }
}
@media (max-width: 1060px) {
  .document-actions { align-items: flex-start; flex-direction: column; }
  .access-note { white-space: normal; max-width: 14rem; }
}
@media (max-width: 760px) {
  .page-heading { align-items: flex-start; flex-direction: column; gap: .875rem; }
  .access-note { max-width: none; }
  .access-note br { display: none; }
  .step-footer { gap: 1rem; }
  .step-footer .btn--primary { max-width: 75%; padding-inline: 1rem; }
  .toolbar, .draft-prompt, .preview-toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar { gap: .5rem; }
  .toolbar .button-row { gap: .5rem 1rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; transform: none !important; scroll-behavior: auto !important; } }
