:root {
  --font-body: 'Montserrat', sans-serif;
  --font-display: 'Gilroy', sans-serif;
  --radius: 8px;
  --focus-outline: 3px solid var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-body); font-size: 14px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
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; }
button:focus, a:focus, summary:focus, input:focus, select:focus, textarea:focus, [tabindex]:focus { outline: var(--focus-outline); outline-offset: 3px; }
h1, h2 { margin: 0; font-family: var(--font-display); font-weight: 800; line-height: 1.15; letter-spacing: -.02em; }
h1 { max-width: 720px; font-size: clamp(28px, 3vw, 42px); }
h2 { font-size: 25px; }
p { margin: 0; }
.skip-link { position: fixed; left: 16px; top: -90px; z-index: 20; padding: 12px; background: var(--yellow); text-decoration: none; }
.skip-link:focus { top: 12px; }
.site-header { min-height: 96px; padding: 22px max(28px, calc((100vw - 1440px) / 2)); border-bottom: 1px solid var(--line-dark); display: flex; justify-content: space-between; align-items: center; gap: 24px; background: var(--ink); }
.logo { display: block; flex: none; line-height: 0; }
.logo img { display: block; width: 202px; height: auto; }
.schema-label { font-size: 12px; color: var(--gray); }
.page, .page-footer { width: 100%; max-width: 1496px; margin: 0 auto; padding: 34px 28px 0; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 24px; }
.eyebrow { margin-bottom: 9px; font-size: 11px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--gray-700); }
.intro { margin-top: 12px; color: var(--gray-700); }
.access-note { font-size: 12px; color: var(--gray-700); white-space: nowrap; }
.button-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.button, .xml-button { border: 1px solid var(--gray); background: var(--white); color: var(--ink); border-radius: var(--radius); min-height: 42px; padding: 10px 15px; font-size: 12px; font-weight: 500; line-height: 1.5; transition: background-color .16s ease, border-color .16s ease; }
.button:hover, .xml-button:hover { border-color: var(--ink); background: var(--paper); }
.button-primary { border-color: var(--yellow); background: var(--yellow); }
.button-primary:hover { border-color: var(--ink); background: var(--yellow); }
.button-quiet { border-color: transparent; background: transparent; color: var(--gray-700); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0 20px; }
.notice { margin-bottom: 8px; padding: 12px 16px; border-left: 3px solid var(--gray); border-radius: 0 var(--radius) var(--radius) 0; background: var(--white); }
.notice:empty { display: none; }
.notice[data-kind="warning"] { border-left-color: var(--yellow); }
.notice[data-kind="error"] { border-left-color: var(--error); }
.example-notice { padding: 12px 16px; margin-bottom: 16px; border: 1px solid var(--line); border-left: 4px solid var(--yellow); background: var(--white); font-size: 12px; }
.draft-prompt { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin: 24px 0; padding: 24px; border: 1px solid var(--gray); border-left: 4px solid var(--yellow); border-radius: var(--radius); background: var(--white); }
.draft-prompt h2 { margin-bottom: 8px; font-size: 22px; }
.workspace { display: grid; grid-template-columns: 288px minmax(0, 1fr); align-items: start; gap: 24px; scroll-margin-top: 24px; }
.steps-panel { position: sticky; top: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); overflow: hidden; }
.progress-heading { display: flex; justify-content: space-between; gap: 8px; padding: 18px 16px 6px; font-size: 11px; font-weight: 500; }
.progress-heading span:last-child { color: var(--gray-700); font-variant-numeric: tabular-nums; }
progress { display: block; width: calc(100% - 32px); height: 4px; margin: 8px 16px 16px; border: 0; appearance: none; -webkit-appearance: none; background: var(--line); }
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--yellow); }
progress::-moz-progress-bar { background: var(--yellow); }
.step-list { margin: 0; padding: 0; list-style: none; }
.step-button { display: flex; gap: 10px; width: 100%; min-height: 48px; padding: 12px 16px; text-align: left; border: 0; border-left: 3px solid transparent; background: var(--white); color: var(--ink); font-size: 12px; line-height: 1.4; align-items: center; }
.step-button:hover { background: var(--paper); }
.step-button.is-current { border-left-color: var(--yellow); background: var(--paper); font-weight: 500; }
.step-number { flex: 0 0 22px; font-variant-numeric: tabular-nums; color: var(--gray-700); font-size: 10px; }
.step-issues { margin-left: auto; min-width: 18px; color: var(--error); font-size: 11px; font-weight: 800; text-align: right; }
.save-note { padding: 18px 16px; margin-top: 12px; border-top: 1px solid var(--line); font-size: 11px; color: var(--gray-700); }
.editor-panel { min-width: 0; min-height: 470px; padding: 28px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.step-heading { margin-bottom: 22px; }
.step-heading > p { margin-top: 10px; color: var(--gray-700); }
.step-heading .required-note { font-size: 11px; }
.xml-field { display: flex; flex-direction: column; gap: 6px; margin: 16px 0; max-width: 760px; }
.xml-field label { font-size: 12px; font-weight: 500; line-height: 1.5; }
.xml-field input, .xml-field select, .xml-field textarea, .xml-choice > select { display: block; width: 100%; min-height: 44px; border: 1px solid var(--gray); border-radius: 5px; padding: 10px 12px; background: var(--white); color: var(--ink); font-size: 13px; line-height: 1.5; }
.xml-field select { padding-right: 26px; }
.xml-field textarea { resize: vertical; min-height: 110px; }
.xml-field input[type="file"] { font-size: 12px; }
.xml-field-hint { font-size: 11px; color: var(--gray-700); line-height: 1.65; }
.xml-field-error { font-size: 12px; color: var(--error); white-space: pre-line; overflow-wrap: anywhere; }
.xml-field-error:empty, .xml-save-status:empty { display: none; }
.xml-field [aria-invalid="true"] { border-color: var(--error); }
.xml-save-status { font-size: 12px; color: var(--gray-700); margin-bottom: 16px; }
.xml-section { margin: 12px 0; border: 1px solid var(--line); border-radius: 6px; }
.xml-section > summary { cursor: pointer; padding: 13px 16px; font-size: 12px; font-weight: 500; overflow-wrap: anywhere; }
.xml-section > .xml-field-error { padding: 0 16px 12px; }
.xml-section[open] > summary { border-bottom: 1px solid var(--line); background: var(--paper); }
.xml-section-body { padding: 0 16px; }
.xml-section-body > .xml-button { margin: 16px 0; }
.xml-repeat, .xml-choice { min-width: 0; padding: 14px; margin: 16px 0; border: 1px solid var(--line); border-radius: 6px; }
.xml-repeat > legend, .xml-choice > legend { max-width: 100%; padding: 0 6px; font-size: 12px; font-weight: 500; }
.xml-repeat-item { padding: 0 0 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.xml-repeat-item > .xml-button[data-action="remove"] { font-size: 11px; min-height: 34px; padding: 6px 10px; }
.xml-button[data-action="add"] { border-style: dashed; max-width: 100%; text-align: left; }
.step-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 24px; margin-top: 28px; border-top: 1px solid var(--line); }
.issues-panel { padding: 16px 20px; margin-top: 24px; background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--error); border-radius: var(--radius); }
.issues-panel summary { cursor: pointer; font-weight: 500; }
.issues-panel ol { padding-left: 24px; }
.issue-link { background: none; color: var(--ink); text-align: left; border: 0; padding: 6px 0; text-decoration: underline; text-underline-offset: 3px; font-size: 12px; }
.issue-link:hover { color: var(--gray-700); }
.document-actions { display: flex; justify-content: space-between; align-items: center; gap: 24px; background: var(--white); padding: 24px; margin-top: 24px; border: 1px solid var(--line); border-radius: var(--radius); }
.document-actions > div:first-child { flex: 1; min-width: 0; }
.document-actions > div:first-child > p:first-child { font-size: 13px; font-weight: 500; }
.document-note { margin-top: 6px; color: var(--gray-700); font-size: 11px; }
.page-footer { padding-top: 24px; padding-bottom: 28px; color: var(--gray-700); font-size: 11px; }
.page-footer p + p { margin-top: 4px; }
.preview-panel { position: fixed; inset: 0; display: flex; flex-direction: column; z-index: 30; background: var(--paper); }
.preview-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 24px; border-bottom: 1px solid var(--line); background: var(--white); }
.preview-toolbar h2 { font-size: 22px; }
.preview-toolbar p { font-size: 12px; color: var(--gray-700); margin-top: 5px; }
.preview-panel iframe { flex: 1; width: 100%; min-height: 0; border: 0; background: var(--white); }
@media (max-width: 1060px) {
  .workspace { grid-template-columns: 240px minmax(0, 1fr); gap: 16px; }
  .editor-panel { padding: 22px; }
  .document-actions { align-items: flex-start; flex-direction: column; }
  .access-note { white-space: normal; max-width: 210px; }
}
@media (max-width: 760px) {
  .site-header { min-height: 80px; padding: 18px; }
  .schema-label { max-width: 160px; font-size: 10px; text-align: right; }
  .logo img { width: 160px; }
  .page, .page-footer { padding-left: 16px; padding-right: 16px; }
  .page { padding-top: 26px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 14px; }
  .access-note { max-width: none; }
  .access-note br { display: none; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .steps-panel { position: static; }
  .step-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step-button { height: 100%; padding: 10px 12px; font-size: 11px; }
  .step-number { flex-basis: 18px; }
  .save-note { padding: 12px 16px; }
  .editor-panel { padding: 20px 16px; }
  .xml-section-body { padding: 0 10px; }
  .xml-repeat, .xml-choice { padding: 10px; }
  .toolbar, .draft-prompt, .preview-toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar { gap: 8px; }
  .button { padding: 9px 12px; }
  .document-actions { padding: 20px 16px; }
  .preview-toolbar { padding: 14px 16px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
