:root {
  color-scheme: light;
  --bg: #f5f7f5;
  --surface: #fcfdfc;
  --text: #17201d;
  --muted: #5f6c67;
  --line: #d9e0dc;
  --primary: #1f5b4c;
  --primary-hover: #17463b;
  --selected: #e9f2ee;
  --error: #b42318;
  --error-bg: #fff1f0;
  --success: #2e6f55;
  --warning: #9a6700;
  --warning-bg: #fff8df;
  --focus: #2d7e69;
  --shadow: 0 14px 42px rgba(23, 32, 29, .07);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--bg); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: var(--primary); }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 50%, transparent); outline-offset: 2px; }

.app-shell { min-height: 100dvh; }
.app-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px max(24px, calc((100vw - 1320px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(252, 253, 252, .96);
  position: sticky;
  top: 0;
  z-index: 20;
}
.product-name { margin: 0; font-size: 1rem; font-weight: 760; letter-spacing: -.01em; }
.save-status { margin: 3px 0 0; color: var(--muted); font-size: .82rem; }

.app-layout { width: min(1320px, calc(100% - 40px)); margin: 0 auto; display: grid; grid-template-columns: 260px minmax(0, 860px); gap: 48px; justify-content: center; padding: 40px 0 80px; }
.step-sidebar { min-width: 0; align-self: start; position: sticky; top: 104px; }
.progress-copy { display: flex; align-items: baseline; gap: 7px; margin-bottom: 10px; }
.progress-copy strong { font-size: 1.3rem; }
.progress-copy span { color: var(--muted); font-size: .9rem; }
.progress-track { height: 7px; overflow: hidden; background: #e5eae7; border-radius: 999px; margin-bottom: 20px; }
.progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--primary); transition: width .2s ease; }
#stepNav { display: grid; gap: 5px; }
.step-link { width: 100%; min-height: 48px; border: 0; background: transparent; border-radius: 12px; padding: 10px 12px; text-align: left; color: var(--muted); display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: center; }
.step-link:hover { background: #edf1ee; color: var(--text); }
.step-link.active { background: var(--selected); color: var(--primary); font-weight: 720; }
.step-link.done .step-number { background: var(--primary); color: #fff; }
.step-number { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); font-size: .78rem; font-weight: 760; }

.site-outline { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.outline-head { display: grid; gap: 4px; margin-bottom: 12px; }
.outline-head strong { font-size: .92rem; }
.outline-head span { color: var(--muted); font-size: .76rem; line-height: 1.4; }
.outline-pages { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 10px; padding-bottom: 2px; scrollbar-width: thin; }
.outline-page-tab { flex: 0 0 auto; max-width: 150px; min-height: 36px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--muted); font-size: .76rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.outline-page-tab:hover { border-color: #9eada6; color: var(--text); }
.outline-page-tab.active { border-color: var(--primary); background: var(--selected); color: var(--primary); }
.outline-frame { padding: 10px; border: 1px solid #c8d1cc; border-radius: 14px; background: var(--surface); box-shadow: 0 8px 24px rgba(23, 32, 29, .05); }
.outline-browser-bar { height: 16px; display: flex; align-items: center; gap: 4px; margin: -2px -2px 8px; padding: 0 6px; border-radius: 7px 7px 3px 3px; background: #edf1ee; }
.outline-browser-bar i { width: 4px; height: 4px; border-radius: 50%; background: #aeb9b4; }
.outline-browser-bar span { height: 5px; flex: 1; margin-left: 4px; border-radius: 999px; background: #d6ded9; }
.outline-frame-title { display: flex; align-items: center; gap: 7px; min-width: 0; margin-bottom: 8px; font-size: .78rem; font-weight: 760; }
.outline-frame-title::before { content: ""; width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #aeb9b4; }
.outline-frame-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.outline-stack { display: grid; gap: 5px; }
.outline-node { width: 100%; min-height: 40px; display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 7px; align-items: center; padding: 7px 8px; border: 1px dashed #bcc7c1; border-radius: 9px; background: #f8faf8; color: var(--muted); text-align: left; }
button.outline-node { cursor: pointer; }
button.outline-node:hover { border-color: #8fa099; background: #f0f4f1; }
.outline-node::before { content: ""; width: 9px; height: 9px; border: 2px solid #aeb9b4; border-radius: 50%; }
.outline-node-copy { display: grid; min-width: 0; gap: 1px; }
.outline-node-copy strong { color: inherit; font-size: .76rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.outline-node-copy small { color: inherit; font-size: .68rem; line-height: 1.3; opacity: .86; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.outline-node.done { border-style: solid; border-color: #a9c9bc; background: var(--selected); color: var(--primary); }
.outline-node.done::before { border-color: var(--primary); background: var(--primary); box-shadow: inset 0 0 0 2px var(--selected); }
.outline-node.active { border-style: solid; border-color: #d7b761; background: var(--warning-bg); color: #72510a; box-shadow: inset 3px 0 0 #d1a83d; }
.outline-node.active::before { border-color: #b48218; background: #b48218; box-shadow: inset 0 0 0 2px var(--warning-bg); }
.outline-node.client-managed { box-shadow: inset -3px 0 0 #3577a8; }
.outline-node.client-managed .outline-node-copy small { color: #245f8b; font-weight: 700; opacity: 1; }
.outline-node.compact { min-height: 34px; padding-block: 5px; }
.outline-empty { padding: 12px; border: 1px dashed #bcc7c1; border-radius: 10px; color: var(--muted); font-size: .74rem; line-height: 1.4; text-align: center; }
.outline-connector { width: 1px; height: 5px; margin: -5px auto 0; background: #cbd4d0; }
.outline-wire-page { overflow: hidden; border: 1px solid #b9c5bf; border-radius: 8px; background: #fff; }
.outline-wire-section { width: 100%; display: grid; gap: 5px; padding: 7px 8px; border: 0; border-bottom: 1px solid #cbd4d0; border-radius: 0; background: #fff; color: var(--muted); text-align: left; }
.outline-wire-section:last-child { border-bottom: 0; }
button.outline-wire-section { cursor: pointer; }
button.outline-wire-section:hover { background: #f4f7f5; }
.wire-section-label { display: grid; min-width: 0; gap: 1px; }
.wire-section-label strong { color: var(--text); font-size: .69rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wire-section-label small { color: var(--muted); font-size: .6rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wire-pattern { width: 100%; min-height: 32px; display: flex; align-items: center; gap: 5px; padding: 5px; border: 1px solid #c5cfca; background: #f7f9f8; color: #a0ada7; }
.wire-header { min-height: 54px; }
.wire-header .wire-pattern { min-height: 18px; padding: 3px 5px; }
.wire-header .wire-mark { width: 24%; height: 8px; border: 1px solid currentColor; }
.wire-header .wire-short { width: 13%; height: 3px; border-radius: 999px; background: currentColor; }
.wire-header .wire-action { width: 18%; height: 10px; margin-left: auto; border: 1px solid currentColor; border-radius: 999px; }
.wire-banner .wire-pattern, .wire-slider .wire-pattern { min-height: 76px; }
.wire-banner .wire-pattern, .wire-slider .wire-pattern { display: grid; grid-template-columns: 1.15fr .85fr; align-items: stretch; }
.wire-copy { display: grid; align-content: center; gap: 4px; }
.wire-copy i, .wire-footer-col i { height: 4px; border-radius: 999px; background: currentColor; }
.wire-copy i:first-child { width: 82%; height: 7px; }
.wire-copy i:last-child { width: 64%; }
.wire-copy.wide { width: 100%; padding: 5px 3px; }
.wire-media { display: block; min-height: 48px; border: 1px solid currentColor; background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(160,173,167,.12) 6px 7px); }
.wire-dots { grid-column: 1 / -1; display: flex; justify-content: center; gap: 4px; }
.wire-dots i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.wire-gallery .wire-pattern, .wire-cards .wire-pattern { min-height: 58px; align-items: stretch; }
.wire-tile, .wire-card { flex: 1; border: 1px solid currentColor; background: rgba(160,173,167,.06); }
.wire-card { border-radius: 3px; }
.wire-form .wire-pattern { min-height: 68px; }
.wire-form .wire-form { width: 78%; display: grid; gap: 5px; margin: auto; }
.wire-form .wire-form i { height: 10px; border: 1px solid currentColor; background: #fff; }
.wire-form .wire-form i:last-child { width: 42%; margin-left: auto; border-radius: 999px; background: rgba(160,173,167,.16); }
.wire-video .wire-pattern { min-height: 68px; }
.wire-video .wire-video { width: 100%; height: 54px; display: grid; place-items: center; border: 1px solid currentColor; background: rgba(160,173,167,.08); }
.wire-video .wire-video i { width: 0; height: 0; border-top: 7px solid transparent; border-bottom: 7px solid transparent; border-left: 11px solid currentColor; }
.wire-footer { min-height: 76px; background: #f4f6f5; }
.wire-footer .wire-pattern { min-height: 40px; align-items: stretch; background: #edf1ee; }
.wire-footer-col { flex: 1; display: grid; align-content: start; gap: 4px; padding: 3px; }
.wire-footer-col i:first-child { width: 72%; height: 6px; }
.wire-footer-col i:last-child { width: 55%; }
.outline-wire-section.done { background: var(--selected); box-shadow: inset 3px 0 0 var(--primary); }
.outline-wire-section.done .wire-pattern { border-color: #a9c9bc; color: #679786; }
.outline-wire-section.active { background: var(--warning-bg); box-shadow: inset 3px 0 0 #d1a83d; }
.outline-wire-section.active .wire-pattern { border-color: #d7b761; color: #b48218; }
.outline-wire-section.client-managed { box-shadow: inset -3px 0 0 #3577a8; }
.outline-wire-section.client-managed.done { box-shadow: inset 3px 0 0 var(--primary), inset -3px 0 0 #3577a8; }
.wire-empty-block { opacity: .78; }

.form-main { min-width: 0; }
.step-head { margin-bottom: 28px; }
.step-head h1 { max-width: 760px; margin: 0 0 10px; font-size: clamp(2rem, 4vw, 3.15rem); line-height: 1.06; letter-spacing: -.045em; }
.step-head p { max-width: 680px; margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.55; }
.privacy-note { display: grid; gap: 5px; margin: -8px 0 18px; padding: 14px 16px; border: 1px solid #b9d5ca; border-radius: 14px; background: var(--selected); }
.privacy-note strong { color: var(--primary); font-size: .92rem; }
.privacy-note span { color: var(--muted); font-size: .84rem; line-height: 1.5; }
.privacy-inline { margin: 0 0 18px; padding: 11px 13px; border-left: 3px solid #c28b18; border-radius: 8px; background: var(--warning-bg); color: #6f500d; font-size: .84rem; line-height: 1.5; }
.privacy-field-hint { color: #77550d; }
.section-note { margin: -2px 0 16px; color: var(--muted); font-size: .84rem; line-height: 1.5; }

.section-card, .nested-card { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 16px; }
.section-card { padding: 28px; margin-bottom: 18px; }
.nested-card { padding: 20px; box-shadow: none; margin-top: 12px; }
.subitems-section { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.subitem-card { background: #f8faf8; }
.section-title { display: flex; justify-content: space-between; align-items: start; gap: 18px; margin-bottom: 20px; }
.section-title h2, .section-title h3 { margin: 0; font-size: 1.22rem; line-height: 1.25; }
.section-title p { margin: 5px 0 0; color: var(--muted); line-height: 1.45; font-size: .9rem; }
.section-title.compact { margin-bottom: 12px; }

.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label, .field-label { display: block; margin-bottom: 7px; font-size: .9rem; font-weight: 690; line-height: 1.35; }
.required::after { content: "\00a0*"; color: var(--error); white-space: nowrap; }
.hint { display: block; color: var(--muted); margin: 7px 0 0; font-size: .8rem; line-height: 1.45; }
.input, .textarea, .select {
  width: 100%; min-height: 48px; border: 1px solid #bfc9c4; border-radius: 12px; color: var(--text); background: #fff; padding: 11px 13px;
}
.textarea { min-height: 112px; resize: vertical; line-height: 1.5; }
.input:hover, .textarea:hover, .select:hover { border-color: #8fa099; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--focus); outline: 3px solid color-mix(in srgb, var(--focus) 18%, transparent); }
.input.invalid, .textarea.invalid, .select.invalid { border-color: var(--error); }
.field-error { color: var(--error); font-size: .8rem; margin-top: 6px; }

.choice-grid { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; }
.choice { position: relative; display: inline-flex; }
.choice input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.choice label { min-height: 44px; display: inline-flex; align-items: center; gap: 9px; padding: 6px 2px; border: 0; border-radius: 8px; background: transparent; font-weight: 600; line-height: 1.35; cursor: pointer; }
.choice label::before { content: ''; width: 18px; height: 18px; flex: 0 0 18px; border: 2px solid #8d9d95; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 4px #fff; }
.choice input:checked + label { color: var(--primary); background: transparent; box-shadow: none; }
.choice input:checked + label::before { border-color: var(--primary); background: var(--primary); }
.choice input:focus-visible + label { outline: 3px solid color-mix(in srgb, var(--focus) 40%, transparent); outline-offset: 2px; }

.button { min-height: 44px; border-radius: 12px; border: 1px solid transparent; padding: 10px 16px; font-weight: 700; line-height: 1.2; }
.button-primary { background: var(--primary); color: #fff; }
.button-primary:hover { background: var(--primary-hover); }
.button-secondary { border-color: var(--primary); background: transparent; color: var(--primary); }
.button-secondary:hover { background: var(--selected); }
.button-quiet { border-color: var(--line); background: var(--surface); color: var(--text); }
.button-quiet:hover { background: #edf1ee; }
.button-danger { background: transparent; color: var(--error); border-color: #efc5c1; }
.button-danger:hover { background: var(--error-bg); }
.button-small { min-height: 40px; padding: 8px 12px; font-size: .86rem; }
.icon-button { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font-size: 1rem; }
.icon-button:hover { background: #edf1ee; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.lockable-fields { min-width: 0; margin: 0; padding: 0; border: 0; }
.lockable-fields:disabled { opacity: .72; }
.saved-card { border-color: #a9c9bc; }
.saved-summary { background: linear-gradient(180deg, var(--surface), #f8fbf9); }
.summary-list { display: grid; gap: 0; margin: 0; }
.summary-list > div { display: grid; grid-template-columns: minmax(130px, .42fr) minmax(0, 1fr); gap: 18px; padding: 11px 0; border-top: 1px solid var(--line); }
.summary-list > div:first-child { border-top: 0; padding-top: 0; }
.summary-list dt { color: var(--muted); font-size: .82rem; line-height: 1.45; }
.summary-list dd { min-width: 0; margin: 0; font-weight: 650; line-height: 1.45; overflow-wrap: anywhere; }
.summary-note { margin: 16px 0 0; color: var(--muted); font-size: .86rem; line-height: 1.5; }
.saved-banner { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; padding: 14px 16px; border: 1px solid #b9d5ca; border-radius: 14px; background: var(--selected); }
.saved-banner p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.4; }
.tilda-note { grid-column: 1 / -1; margin: 0; padding: 12px 14px; border: 1px solid #bfd4e4; border-radius: 12px; background: #eef6fb; color: #245f8b; font-size: .82rem; line-height: 1.45; }
.conditional-group { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.conditional-group > .field + .field, .conditional-group > .field + .repeat-list { margin-top: 16px; }
.branch-hint { margin: 18px 0 0; padding: 14px 16px; border: 1px dashed #bfc9c4; border-radius: 12px; color: var(--muted); background: #f8faf8; line-height: 1.5; }
.advanced-details { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.advanced-details summary { min-height: 44px; display: flex; align-items: center; color: var(--primary); font-weight: 720; cursor: pointer; }
.advanced-details[open] summary { margin-bottom: 14px; }
.shared-element-card { overflow: hidden; }
.element-explainer { display: grid; grid-template-columns: 132px minmax(0, 1fr); align-items: center; gap: 14px; margin: 4px 0 18px; padding: 12px; border: 1px solid #cbd4d0; border-radius: 12px; background: #f8faf8; }
.element-explainer p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.element-explainer strong { color: var(--text); }
.element-mini-wireframe { height: 42px; display: flex; align-items: center; gap: 7px; padding: 7px; border: 1px solid #aeb9b4; background: #fff; }
.element-mini-wireframe .mini-logo { width: 28px; height: 13px; border: 1px solid #7e8d86; }
.element-mini-wireframe span { width: 17px; height: 3px; border-radius: 999px; background: #9ca9a3; }
.element-mini-wireframe .mini-button { width: 28px; height: 14px; margin-left: auto; border: 1px solid #7e8d86; border-radius: 999px; }
.element-type-field { margin-bottom: 18px; }
.composition-section { margin-top: 20px; }
.composition-picker { min-width: 0; margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #f8faf8; }
.composition-picker legend { padding: 0 6px; font-weight: 750; font-size: 1rem; }
.composition-picker > .hint { display: block; margin: 0 0 10px; }
.composition-options { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.composition-choice { display: flex; align-items: center; gap: 9px; min-height: 44px; max-width: 100%; cursor: pointer; font-size: .9rem; line-height: 1.35; }
.composition-choice input { flex: 0 0 18px; width: 18px; height: 18px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.composition-choice input:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.composition-choice:has(input:checked) { color: var(--primary); font-weight: 700; }
.composition-summary { margin: 12px 0 16px; font-size: .83rem; line-height: 1.5; overflow-wrap: anywhere; color: var(--muted); }
.phone-element-note { grid-column: 1 / -1; margin: 0; padding: 12px; background: var(--selected); border-radius: 10px; font-size: .85rem; line-height: 1.5; }
.field-grid > .field-error.full { grid-column: 1 / -1; }
.element-type-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.element-type-option { position: relative; min-width: 0; }
.element-type-option input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.element-type-option label { min-height: 72px; display: grid; place-items: center; align-content: center; gap: 5px; padding: 8px 5px; border: 1px solid #c5cfca; border-radius: 10px; background: #fff; color: var(--muted); text-align: center; cursor: pointer; }
.element-type-option label:hover { border-color: #8fa099; background: #f8faf8; }
.element-type-icon { width: 22px; height: 22px; }
.element-type-option label span { font-size: .7rem; font-weight: 680; line-height: 1.2; }
.element-type-option input:checked + label { border-color: var(--primary); background: var(--selected); color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.element-type-option input:focus-visible + label { outline: 3px solid color-mix(in srgb, var(--focus) 40%, transparent); outline-offset: 2px; }
.element-example { margin: 0 0 16px; padding: 10px 12px; border-left: 3px solid #77a493; background: var(--selected); color: var(--muted); font-size: .82rem; line-height: 1.45; }
.element-example strong { color: var(--text); }
.invalid-choice { padding: 3px; border: 1px solid var(--error); border-radius: 14px; }
.draft-controls { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-top: 1px solid var(--line); background: #f8faf8; }
.section-card > .draft-controls { margin: 24px -28px -28px; border-radius: 0 0 16px 16px; }

.repeat-list { display: grid; gap: 12px; }
.item-toolbar { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.empty-state { padding: 28px; text-align: center; border: 1px dashed #bfc9c4; border-radius: 16px; color: var(--muted); background: rgba(252,253,252,.55); }
.empty-state p { margin: 0 0 14px; }

.page-workspace { display: grid; grid-template-columns: 230px minmax(0,1fr); gap: 18px; align-items: start; }
.page-list { position: sticky; top: 104px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
.page-list-head { padding: 8px 8px 12px; }
.page-list-head strong { display: block; }
.page-list-head span { color: var(--muted); font-size: .8rem; }
.page-tab { width: 100%; min-height: 52px; border: 0; border-radius: 10px; background: transparent; text-align: left; padding: 9px; display: grid; gap: 3px; color: var(--text); }
.page-tab:hover { background: #edf1ee; }
.page-tab.active { background: var(--selected); color: var(--primary); }
.page-tab small { color: var(--muted); }
.page-tab.active small { color: var(--primary); }
.page-editor { min-width: 0; }
.block-card { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); margin-bottom: 14px; overflow: hidden; }
.block-head { padding: 15px 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); background: #f8faf8; }
.block-head strong { line-height: 1.3; }
.block-body { padding: 20px; }
.block-index { color: var(--muted); font-size: .82rem; display: block; margin-bottom: 3px; }
.status { display: inline-flex; align-items: center; min-height: 28px; border-radius: 999px; padding: 4px 9px; font-size: .76rem; font-weight: 760; background: #edf1ee; color: var(--muted); }
.status.done { background: var(--selected); color: var(--success); }
.status.warning { background: var(--warning-bg); color: var(--warning); }

.error-summary { margin-bottom: 20px; padding: 18px; border-radius: 16px; border: 1px solid #efc5c1; background: var(--error-bg); }
.error-summary h2 { margin: 0 0 8px; font-size: 1.05rem; }
.error-summary ul { margin: 0; padding-left: 22px; }
.error-summary li + li { margin-top: 5px; }
.error-summary button { border: 0; padding: 0; background: transparent; color: var(--error); text-decoration: underline; text-align: left; }

.review-list { display: grid; gap: 12px; }
.review-page { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.review-page-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.review-page h3 { margin: 0; font-size: 1.05rem; }
.review-page ul { color: var(--error); margin: 12px 0 0; padding-left: 20px; }

.step-actions { margin-top: 26px; display: flex; justify-content: space-between; gap: 12px; padding-top: 22px; border-top: 1px solid var(--line); }
.actions-right { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 24px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; background: var(--text); color: #fff; padding: 11px 15px; border-radius: 12px; box-shadow: var(--shadow); transition: opacity .18s ease, transform .18s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.print-document { display: none; }

@media (max-width: 920px) {
  .app-layout { grid-template-columns: 1fr; width: min(760px, calc(100% - 28px)); gap: 18px; padding-top: 22px; }
  .step-sidebar { position: static; }
  #stepNav { grid-auto-flow: column; grid-auto-columns: minmax(165px, 1fr); overflow-x: auto; padding-bottom: 6px; }
  .step-link { min-width: 165px; }
  .site-outline { margin-top: 14px; padding-top: 14px; }
  .outline-frame { max-width: 520px; }
  .page-workspace { grid-template-columns: 1fr; }
  .page-list { position: static; display: flex; overflow-x: auto; gap: 6px; }
  .page-list-head { min-width: 145px; }
  .page-tab { min-width: 170px; }
}

@media (max-width: 640px) {
  .app-header { position: static; padding: 14px; align-items: flex-start; }
  .app-layout { width: min(100% - 20px, 620px); padding-top: 16px; }
  .step-head h1 { font-size: 2rem; }
  .section-card { padding: 18px; }
  .nested-card, .block-body { padding: 16px; }
  .field-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .block-head { align-items: flex-start; }
  .item-toolbar { justify-content: flex-start; }
  .step-actions { flex-direction: column-reverse; }
  .step-actions > .button, .actions-right, .actions-right .button { width: 100%; }
  .button-row .button { flex: 1 1 180px; }
  .saved-banner, .draft-controls { align-items: stretch; flex-direction: column; }
  .summary-list > div { grid-template-columns: 1fr; gap: 3px; }
  .draft-controls .button { width: 100%; }
  .section-card > .draft-controls { margin: 20px -18px -18px; }
  .outline-frame { max-width: none; }
  .element-explainer { grid-template-columns: 1fr; }
  .element-type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

@media print {
  @page { size: A4; margin: 16mm; }
  body { background: #fff; color: #111; font-size: 10.5pt; }
  .app-shell, .toast { display: none !important; }
  .print-document { display: block !important; }
  .print-cover { page-break-after: always; }
  .print-document h1 { font-size: 24pt; margin: 0 0 12mm; }
  .print-document h2 { font-size: 17pt; margin: 10mm 0 4mm; break-after: avoid; }
  .print-document h3 { font-size: 13pt; margin: 7mm 0 3mm; break-after: avoid; }
  .print-document h4 { font-size: 11pt; margin: 5mm 0 2mm; break-after: avoid; }
  .print-document p, .print-document li { line-height: 1.45; }
  .print-document a { color: #17463b; overflow-wrap: anywhere; }
  .print-page { page-break-before: always; }
  .print-block { break-inside: avoid; border-top: 1px solid #ccc; padding-top: 4mm; }
  .print-meta { display: grid; grid-template-columns: 38mm 1fr; gap: 2mm 5mm; }
  .print-meta dt { color: #555; }
  .print-meta dd { margin: 0; }
}
