:root {
  color-scheme: light;
  --page: #f3f6f9;
  --panel: #ffffff;
  --ink: #16324b;
  --muted: #718195;
  --line: #dce5ed;
  --line-soft: #edf2f6;
  --blue: #157fe3;
  --blue-dark: #0866bd;
  --blue-soft: #eaf5ff;
  --cyan: #28aee8;
  --green: #199b6a;
  --green-soft: #e9f8f1;
  --amber: #d88913;
  --red: #cc4553;
  --shadow: 0 15px 45px rgba(29, 62, 91, 0.1);
  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-width: 0; max-width: 100%; min-height: 100%; background: var(--page); color: var(--ink); }
body { min-height: 100vh; overflow-x: hidden; }
button, input, select, textarea { font: inherit; }
button, a, label, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid rgba(21, 127, 227, 0.22); outline-offset: 2px; }

.app-header {
  height: 70px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 242px; text-decoration: none; color: var(--ink); }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: #fff; background: linear-gradient(145deg, #32b3ec, #0b70cc); box-shadow: 0 7px 16px rgba(21, 127, 227, .22); font-size: 23px; font-weight: 800; }
.brand-copy { display: grid; line-height: 1.05; }
.brand-copy strong { font-size: 17px; letter-spacing: -.02em; }
.brand-copy small { color: var(--muted); margin-top: 5px; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.header-status { display: flex; align-items: center; gap: 8px; margin: 0 auto; color: var(--muted); font-size: 12px; }
.status-dot { width: 7px; height: 7px; border-radius: 999px; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.header-actions { display: flex; align-items: center; gap: 8px; min-width: 0; }
.order-cta { border-color: #0b7a55; background: #0b7a55; color: #fff; white-space: nowrap; }
.order-cta:hover { border-color: #086344; background: #086344; }
.automatic-check-summary { display: grid; min-width: 190px; max-width: 250px; gap: 2px; padding: 6px 9px; border: 1px solid #bad8ed; border-radius: 9px; color: var(--blue-dark); background: #f4faff; line-height: 1.25; }
.automatic-check-summary strong { font-size: 10px; }
.automatic-check-summary small { color: var(--muted); font-size: 8px; }
.automatic-check-summary[data-state="ready"] { border-color: #b9dfcf; color: #116e4c; background: #f0faf6; }
.automatic-check-summary[data-state="recommendations"] { border-color: #ead49f; color: #855709; background: #fff9e9; }
.automatic-check-summary[data-state="blocked"] { border-color: #e5b5bb; color: #9c2e3b; background: #fff5f6; }
.automatic-check-summary.stale { border-style: dashed; }
.automatic-check-summary.checking small::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 5px; border: 1px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: checking-spin .8s linear infinite; }
.automatic-check-button { max-width: 230px; line-height: 1.2; text-align: center; }
@keyframes checking-spin { to { transform: rotate(360deg); } }

.button { border: 0; min-height: 40px; border-radius: 10px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: 13px; cursor: pointer; text-decoration: none; transition: .18s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.button.primary { background: linear-gradient(145deg, #1995ec, #0868c5); color: #fff; box-shadow: 0 7px 16px rgba(9, 109, 202, .21); }
.button.ghost { background: #f6f9fb; border: 1px solid var(--line); color: var(--ink); }
.button.secondary { color: var(--blue-dark); background: var(--blue-soft); border: 1px solid #cce7fb; }
.button.compact { min-height: 36px; padding-inline: 12px; }
.icon-button { width: 40px; padding: 0; font-size: 20px; }
.full { width: 100%; }
.success-button { background: var(--green); color: #fff; box-shadow: 0 7px 16px rgba(25, 155, 106, .18); }
.danger-link { color: var(--red); background: transparent; min-height: 30px; }

.workspace { min-height: calc(100vh - 70px); display: grid; grid-template-columns: 292px minmax(460px, 1fr) 300px; align-items: stretch; }
.panel { background: var(--panel); min-width: 0; }
.library-panel { border-right: 1px solid var(--line); }
.properties-panel { border-left: 1px solid var(--line); }
.panel-section { padding: 18px 20px; border-bottom: 1px solid var(--line-soft); }
.panel-section h1, .panel-section h2, .panel-section h3 { margin: 0; letter-spacing: -.025em; }
.panel-section h1, .panel-section h2 { font-size: 19px; }
.panel-section h3 { font-size: 14px; }
.eyebrow { margin: 0 0 7px; color: var(--blue); font-weight: 800; font-size: 10px; letter-spacing: .13em; text-transform: uppercase; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.section-heading.small { margin-bottom: 14px; }
.muted, .helper { color: var(--muted); font-size: 12px; line-height: 1.45; }
.muted { margin: 8px 0 0; }
.helper { margin: 8px 0 11px; }
.badge { border-radius: 999px; padding: 4px 8px; color: var(--blue-dark); background: var(--blue-soft); font-size: 10px; font-weight: 800; white-space: nowrap; }
.badge.success { color: var(--green); background: var(--green-soft); }
.selection-type { color: var(--muted); font-size: 11px; background: #f4f7f9; border-radius: 7px; padding: 4px 7px; }

.template-section { min-width: 0; }
.template-section > summary { gap: 10px; }
.template-section > summary strong { max-width: 155px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--blue-dark); font-size: 10px; }
.template-section > summary::before { content: "▾"; color: var(--blue); }
.template-section:not([open]) > summary::before { content: "▸"; }
.template-panel-content { margin-top: 13px; }
.category-scroller { display: flex; width: 100%; max-width: 100%; min-width: 0; gap: 6px; overflow: auto hidden; scrollbar-width: none; padding-bottom: 12px; }
.category-scroller::-webkit-scrollbar { display: none; }
.category-button { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: #fff; padding: 6px 10px; font-size: 11px; cursor: pointer; }
.category-button.active { border-color: var(--blue); color: var(--blue-dark); background: var(--blue-soft); font-weight: 700; }
.template-search { margin-bottom: 9px; }
.template-count { margin: -4px 0 8px; color: var(--muted); font-size: 9px; }
.template-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; max-height: 420px; overflow: auto; padding: 2px; }
.template-card { border: 1px solid var(--line); border-radius: 11px; padding: 6px; background: #fff; text-align: left; cursor: pointer; color: var(--ink); min-width: 0; }
.template-card.active { border: 2px solid var(--blue); padding: 5px; box-shadow: 0 0 0 3px var(--blue-soft); }
.template-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; margin-bottom: 6px; }
.template-preview-side { display: block; min-width: 0; overflow: hidden; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(20,50,70,.1); }
.template-preview-side svg { display: block; width: 100%; aspect-ratio: 96 / 56; }
.template-card strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.template-card small { color: var(--muted); font-size: 9px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

details summary { display: flex; align-items: center; justify-content: space-between; list-style: none; cursor: pointer; font-size: 13px; font-weight: 800; }
details summary::-webkit-details-marker { display: none; }
.element-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.element-button { min-height: 55px; border: 1px solid var(--line); border-radius: 9px; background: #fbfdff; color: var(--ink); display: grid; place-items: center; align-content: center; gap: 3px; cursor: pointer; font-size: 9px; }
.element-button:hover { border-color: var(--blue); background: var(--blue-soft); }
.element-button span { font-size: 17px; color: var(--blue); }

.rights-check { display: grid; grid-template-columns: 18px 1fr; gap: 9px; align-items: start; color: var(--muted); font-size: 10px; line-height: 1.4; margin: 12px 0; }
.rights-check input { width: 17px; height: 17px; accent-color: var(--blue); margin: 1px 0 0; }
.upload-box { min-height: 76px; display: grid; place-items: center; align-content: center; gap: 3px; border: 1.5px dashed #b8cede; border-radius: 11px; background: #f9fcff; cursor: pointer; text-align: center; }
.upload-box:hover { border-color: var(--blue); background: var(--blue-soft); }
.upload-box strong { font-size: 11px; }
.upload-box small, .file-note { color: var(--muted); font-size: 9px; }
.upload-icon { color: var(--blue); font-size: 19px; }
.file-note { margin: 7px 0 0; text-align: center; }
.draft-optin { display: grid; grid-template-columns: 18px 1fr; gap: 9px; align-items: start; margin: 12px 0; color: #506477; font-size: 10px; line-height: 1.4; cursor: pointer; }
.draft-optin input { width: 17px; height: 17px; margin: 0; accent-color: var(--blue); }
.draft-actions { display: grid; gap: 7px; }
.draft-message { margin: 9px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.draft-message.error { color: var(--red); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.editor-shell { min-width: 0; display: flex; flex-direction: column; background: radial-gradient(circle at 50% 30%, #ffffff 0, #f4f8fb 48%, #edf2f6 100%); }
.editor-toolbar { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 20px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .62); }
.side-switcher { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 11px; background: #e9eef3; }
.side-button { min-width: 92px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; cursor: pointer; }
.side-button small { margin-left: 7px; color: #9aa8b5; }
.side-button.active { color: var(--blue-dark); background: #fff; box-shadow: 0 2px 8px rgba(35, 59, 79, .1); }
.toolbar-actions { display: flex; align-items: center; gap: 12px; }
.tool-button { border: 0; background: transparent; color: var(--blue-dark); font-size: 11px; font-weight: 700; cursor: pointer; }
.tool-button:disabled { opacity: .45; cursor: not-allowed; }
.danger-outline { color: var(--red); }
.side-management { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--line-soft); background: rgba(255,255,255,.5); }
.side-management .tool-button { min-height: 30px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.guide-toggle { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; cursor: pointer; }
.guide-toggle input { accent-color: var(--blue); }

.canvas-stage { flex: 1; min-height: 515px; padding: 20px; display: grid; place-items: center; align-content: center; gap: 17px; overflow: hidden; }
.stage-note { color: var(--muted); font-size: 10px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .72); }
.lock-dot { color: var(--green); margin-right: 5px; }
.artboard-wrap { width: min(100%, 720px); transform: scale(var(--artboard-scale, 1)); transform-origin: center; transition: transform .2s ease; }
.card-artboard { display: block; width: 100%; aspect-ratio: 96 / 56; background: #fff; border-radius: 3px; box-shadow: 0 25px 65px rgba(28, 54, 78, .18), 0 0 0 1px rgba(80, 110, 130, .08); touch-action: none; user-select: none; }
.editable-element { cursor: grab; }
.template-element,.background-element { cursor: pointer; }
.selected-layer { filter: drop-shadow(0 0 .75px #087ee1) drop-shadow(0 0 .35px #fff); }
.editable-element:active { cursor: grabbing; }
.selection-outline { fill: none; stroke: #087ee1; stroke-width: .35; stroke-dasharray: 1.4 1; vector-effect: non-scaling-stroke; pointer-events: none; }
.selection-handle { fill: #fff; stroke: #087ee1; stroke-width: .3; vector-effect: non-scaling-stroke; pointer-events: none; }
.selection-handle[data-resize-handle] { cursor: nwse-resize; pointer-events: all; }
.layer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.layer-actions .tool-button { min-height: 36px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.preflight-error-outline { fill: rgba(204, 69, 83, .06); stroke: var(--red); stroke-width: .45; stroke-dasharray: 1.2 .7; vector-effect: non-scaling-stroke; }
.guide-bleed { fill: none; stroke: #5d7c91; stroke-width: .18; stroke-dasharray: 1 1; vector-effect: non-scaling-stroke; opacity: .65; pointer-events: none; }
.guide-trim { fill: none; stroke: #ed5f68; stroke-width: .22; stroke-dasharray: 1.5 .75; vector-effect: non-scaling-stroke; pointer-events: none; }
.guide-safe { fill: rgba(33, 160, 102, .025); stroke: #24a16b; stroke-width: .2; stroke-dasharray: .7 .7; vector-effect: non-scaling-stroke; pointer-events: none; }
.side-thumbnails { display: flex; gap: 9px; }
.side-thumb { display: flex; align-items: center; gap: 7px; width: 105px; border: 1px solid var(--line); border-radius: 9px; padding: 5px; background: rgba(255,255,255,.72); color: var(--muted); cursor: pointer; font-size: 9px; }
.side-thumb.active { border-color: var(--blue); color: var(--blue-dark); box-shadow: 0 0 0 2px var(--blue-soft); }
.side-button.removed,.side-thumb.removed { opacity: .45; text-decoration: line-through; }
.thumb-mini { width: 38px; aspect-ratio: 96 / 56; border-radius: 3px; background: #fff; position: relative; overflow: hidden; }
.thumb-mini svg { display: block; width: 100%; height: 100%; }

.zoom-bar { min-height: 50px; display: flex; align-items: center; justify-content: center; gap: 9px; padding: 8px 18px; border-top: 1px solid var(--line); background: rgba(255, 255, 255, .73); }
.zoom-button { width: 27px; height: 27px; border: 1px solid var(--line); background: #fff; border-radius: 7px; color: var(--ink); cursor: pointer; }
.zoom-bar input { width: 125px; accent-color: var(--blue); }
.zoom-bar output { min-width: 38px; font-size: 10px; color: var(--muted); }
.legend { margin-left: 15px; color: var(--muted); font-size: 9px; display: flex; align-items: center; gap: 7px; }
.legend-item { display: inline-flex; align-items: center; gap: 4px; border-radius: 4px; }
.legend i { width: 13px; border-top: 2px dashed; }
.legend-bleed { border-color: #5d7c91 !important; }.legend-trim { border-color: #ed5f68 !important; }.legend-safe { border-color: #24a16b !important; }

.field-label { display: block; margin: 13px 0 6px; color: #506477; font-size: 10px; font-weight: 750; }
.control { width: 100%; min-height: 39px; border: 1px solid var(--line); border-radius: 9px; background: #fbfdff; color: var(--ink); padding: 8px 10px; font-size: 12px; }
.control:focus { border-color: var(--blue); background: #fff; }
.textarea { resize: vertical; min-height: 66px; line-height: 1.4; }
.field-meta { display: flex; justify-content: space-between; margin-top: 5px; color: var(--muted); font-size: 9px; }
.two-column-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.property-group { margin: 15px 0 0; padding: 0; border: 0; }
.property-group legend { margin-bottom: 8px; color: #506477; font-size: 10px; font-weight: 750; }
.color-list { display: flex; flex-wrap: wrap; gap: 7px; }
.color-swatch { width: 25px; height: 25px; border: 2px solid #fff; border-radius: 999px; background: var(--swatch); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.color-swatch.active { box-shadow: 0 0 0 2px var(--blue); }
.cmyk-value { display: block; margin-top: 8px; color: var(--ink); font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; }
.cmyk-note { margin: 8px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); background: #f1f5f8; border-radius: 9px; padding: 3px; }
.segmented button { border: 0; height: 31px; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; }
.segmented button:nth-child(2) { text-align: center; }.segmented button:nth-child(3) { text-align: right; }
.segmented button.active { border-radius: 7px; background: #fff; color: var(--blue); box-shadow: 0 2px 7px rgba(27, 60, 85, .1); }
.position-section .helper { margin-bottom: 0; }
.image-info { border-radius: 9px; padding: 11px; background: #f5f8fa; color: var(--muted); font-size: 11px; line-height: 1.5; }
.action-section { display: grid; gap: 9px; }
.export-note { margin: 0; text-align: center; color: var(--muted); font-size: 9px; }
.hidden { display: none !important; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translate(-50%, 20px); padding: 10px 14px; border-radius: 9px; color: #fff; background: #18354d; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .2s ease; font-size: 12px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.mobile-action-bar { display: none; }
.toast.error { background: var(--red); }

.modal { width: min(650px, calc(100vw - 28px)); max-width: calc(100vw - 28px); max-height: calc(100dvh - 28px); padding: 0; border: 0; border-radius: 17px; color: var(--ink); overflow: hidden; box-shadow: 0 30px 90px rgba(18, 44, 65, .32); }
.modal::backdrop { background: rgba(16, 42, 62, .55); backdrop-filter: blur(5px); }
.modal-card { max-height: calc(100dvh - 28px); padding: 24px; overflow-y: auto; overscroll-behavior: contain; }
.compact-modal { max-width: 540px; }
.modal-header { position: sticky; top: -24px; z-index: 2; display: flex; justify-content: space-between; gap: 15px; align-items: flex-start; margin: -24px -24px 0; padding: 24px 24px 12px; background: #fff; }
.modal-header h2 { margin: 0; font-size: 22px; }
.close-button { border: 1px solid var(--line); background: #f7f9fa; border-radius: 9px; }
.score-card { display: grid; gap: 4px; margin: 20px 0; border-radius: 13px; padding: 15px; background: var(--blue-soft); font-size: 13px; }
.score-card small { color: var(--muted); font-size: 10px; }
.preflight-groups { display: grid; gap: 12px; max-height: 48vh; overflow: auto; }
.check-group { border: 1px solid var(--line); border-radius: 12px; padding: 13px; }
.check-group h3 { margin: 0 0 9px; font-size: 13px; }
.check-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.check-list li { color: #52687b; font-size: 11px; line-height: 1.4; }
.check-list .critical { color: #a92f3d; }.check-list .warning { color: #9a650f; }.check-list .passed { color: #167d58; }
.check-issue-button { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; width: 100%; padding: 9px; border: 1px solid currentColor; border-radius: 9px; color: inherit; background: #fff; text-align: left; cursor: pointer; }
.check-issue-button > strong { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 99px; color: #fff; background: #52687b; }
.critical .check-issue-button > strong { background: #a92f3d; }
.warning .check-issue-button > strong { background: #9a650f; }
.check-issue-button > span { display: grid; gap: 3px; }
.check-issue-button small { color: var(--muted); font-size: 9px; }
.check-clean { margin: 0; padding: 14px; border: 1px solid #b9dfcf; border-radius: 11px; color: #116e4c; background: #f0faf6; }
.modal-footer { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.modal-open { overflow: hidden; }
.tutorial-modal { width: min(560px, calc(100vw - 28px)); }
.tutorial-modal h3 { margin: 18px 0 7px; font-size: 18px; }
.tutorial-modal p { color: #4f6678; line-height: 1.6; }
.tutorial-spacer { flex: 1; }
.tutorial-highlight { position: relative; z-index: 19; box-shadow: inset 0 0 0 3px rgba(8,126,225,.48), 0 0 0 6px rgba(8,126,225,.14) !important; }
.info-callout { padding: 13px; border-left: 3px solid var(--blue); background: var(--blue-soft); border-radius: 0 9px 9px 0; font-size: 12px; line-height: 1.55; }

@media (max-width: 1450px) {
  .header-status, .header-actions .compact { display: none; }
}

@media (max-width: 1180px) {
  .workspace { grid-template-columns: 245px minmax(430px, 1fr) 270px; }
  .panel-section { padding-inline: 15px; }
  .header-status { display: none; }
  .canvas-stage { padding-inline: 15px; }
  .legend { display: none; }
  .header-status, .header-actions .compact { display: none; }
}

@media (max-width: 1080px) {
  .automatic-check-button { width: 40px; padding: 0; overflow: hidden; color: transparent !important; font-size: 0; }
  .automatic-check-button span { color: #fff; font-size: 15px; }
}

@media (max-width: 900px) {
  .app-header { padding: 8px 14px; height: auto; min-height: 62px; flex-wrap: wrap; }
  .brand { min-width: 0; margin-right: auto; }
  .brand-copy small { display: none; }
  .header-actions { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
  .automatic-check-summary { min-width: 165px; max-width: 210px; }
  .automatic-check-button { width: 40px; padding: 0; overflow: hidden; color: transparent !important; font-size: 0; }
  .automatic-check-button span { color: #fff; font-size: 15px; }
  .workspace { min-height: calc(100vh - 62px); display: flex; flex-direction: column; }
  .editor-shell { order: 1; }
  .library-panel { order: 2; border: 0; border-top: 1px solid var(--line); }
  .properties-panel { order: 3; border: 0; border-top: 1px solid var(--line); }
  .intro-section { display: none; }
  .template-grid { grid-template-columns: repeat(3, minmax(118px, 1fr)); max-height: none; }
  .element-grid { grid-template-columns: repeat(6, 1fr); }
  .canvas-stage { min-height: 430px; padding: 17px 12px; }
  .artboard-wrap { width: min(calc(100vw - 24px), 700px); max-width: 100%; }
  .properties-panel { display: grid; grid-template-columns: 1fr 1fr; }
  .properties-panel .properties-heading, .properties-panel .action-section { grid-column: 1 / -1; }
  .properties-panel .panel-section { border-right: 1px solid var(--line-soft); }
}

@media (max-width: 700px) {
  body { padding-bottom: 68px; }
  .app-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; width: 100%; max-width: 100vw; overflow: visible; }
  .brand-copy strong { font-size: 14px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .header-actions { display: none; }
  .mobile-action-bar { position: fixed; inset: auto 0 0; z-index: 45; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; width: 100%; padding: 7px 6px max(7px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,255,255,.98); box-shadow: 0 -8px 24px rgba(28,54,78,.12); }
  .mobile-action-bar button, .mobile-action-bar a { display: grid; place-items: center; min-width: 0; min-height: 44px; padding: 3px 2px; border: 0; border-radius: 8px; color: var(--ink); background: #f3f7fa; font: 700 9px/1.1 system-ui, sans-serif; text-align: center; text-decoration: none; touch-action: manipulation; }
  .mobile-action-bar .mobile-order { color: #fff; background: #0b7a55; }
  .help-button { min-width: 0; padding-inline: 9px; font-size: 11px; }
  .automatic-check-summary { display: none; }
  .header-actions .button, .header-actions .button.primary { min-height: 44px; min-width: 44px; padding: 0; }
  .header-actions .automatic-check-button { grid-column: 1 / -1; padding-inline: 12px; }
  .workspace, .editor-shell, .library-panel, .properties-panel, .panel-section { width: 100%; max-width: 100%; min-width: 0; }
  .workspace { overflow-x: clip; }
  .editor-toolbar { padding: 8px 10px; min-height: 56px; flex-wrap: wrap; }
  .side-button { min-width: 78px; }
  .toolbar-actions { margin-left: auto; gap: 6px; }
  .toolbar-actions .tool-button { display: inline-flex; min-height: 32px; padding: 5px 8px; font-size: 9px; }
  .guide-toggle span { font-size: 0; }
  .guide-toggle span::after { content: "Линии"; font-size: 9px; }
  .canvas-stage { min-height: 330px; padding: 12px 8px; gap: 12px; }
  .stage-note { font-size: 8px; }
  .side-thumbnails { display: none; }
  .zoom-bar { min-height: 44px; }
  .zoom-bar input { width: 95px; }
  .template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; padding-bottom: 5px; }
  .element-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); min-width: 0; }
  .element-button { width: 100%; min-width: 0; overflow: hidden; }
  .element-button small { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .properties-panel { position: fixed; inset: auto 0 61px; z-index: 42; display: none; max-height: min(68dvh, 620px); overflow: auto; border: 1px solid var(--line); border-radius: 18px 18px 0 0; background: #fff; box-shadow: 0 -20px 60px rgba(20,48,70,.24); overscroll-behavior: contain; }
  body.mobile-properties-open .properties-panel { display: block; }
  .two-column-fields { grid-template-columns: 1fr 1fr; }
  .panel-section { padding: 16px; }
  button, a.button, .tool-button, .side-button, .element-button { min-height: 44px; }
  .modal-card { padding: 18px; }
  .modal-header { top: -18px; margin: -18px -18px 0; padding: 18px 18px 10px; }
  .modal-footer { flex-direction: column-reverse; }
  .modal-footer .button { width: 100%; }
}

@media (max-width: 260px) {
  .app-header { grid-template-columns: minmax(0, 1fr); padding-inline: 8px; }
  .header-status { display: none; }
  .mobile-action-bar { grid-template-columns: repeat(4, minmax(44px, 1fr)); max-height: 116px; overflow-y: auto; }
  body { padding-bottom: 118px; }
  .automatic-check-summary { grid-column: 1 / -1; min-width: 0; padding-inline: 6px; overflow-wrap: anywhere; }
  .brand-copy strong { font-size: 13px; }
  .canvas-stage { padding-inline: 4px; }
  .zoom-bar input { width: min(72px, 45vw); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .automatic-check-summary.checking small::before { animation: none; border-top-color: currentColor; }
}

/* Административная демонстрация */
.admin-body { background: #f4f7fa; }
.admin-header .brand { margin-right: 0; }
.demo-warning { margin: 0 auto; padding: 7px 11px; border-radius: 8px; color: #946109; background: #fff6dc; border: 1px solid #f0dda4; font-size: 11px; font-weight: 700; }
.admin-layout { min-height: calc(100vh - 70px); display: grid; grid-template-columns: 270px 1fr; }
.admin-sidebar { display: flex; flex-direction: column; min-height: calc(100vh - 70px); border-right: 1px solid var(--line); background: #fff; }
.admin-sidebar-heading { display: flex; align-items: center; justify-content: space-between; padding: 22px 18px 12px; }
.admin-sidebar-heading h1 { margin: 0; font-size: 20px; }
.round-add { width: 34px; height: 34px; border: 0; border-radius: 10px; color: #fff; background: var(--blue); cursor: pointer; font-size: 20px; }
.search-field { display: flex; align-items: center; gap: 7px; margin: 0 14px 12px; padding: 0 10px; min-height: 37px; border: 1px solid var(--line); border-radius: 9px; background: #f8fafc; color: var(--muted); }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 11px; }
.admin-template-list { flex: 1; display: grid; align-content: start; gap: 4px; padding: 0 9px 16px; overflow: auto; }
.admin-template-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) 8px; gap: 9px; align-items: center; min-height: 56px; padding: 7px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.admin-template-row:hover { background: #f5f8fa; }
.admin-template-row.active { background: var(--blue-soft); color: var(--blue-dark); }
.admin-template-swatch { height: 30px; border-radius: 5px; background: linear-gradient(125deg, var(--row-bg) 0 63%, var(--row-accent) 64%); box-shadow: inset 0 0 0 1px rgba(30, 70, 90, .09); }
.admin-template-row strong, .admin-template-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-template-row strong { font-size: 11px; }.admin-template-row small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.admin-template-row i { width: 7px; height: 7px; border-radius: 99px; background: #a9b5be; }.admin-template-row i.approved { background: var(--green); }.admin-template-row i.disputed { background: var(--red); }
.admin-sidebar-footer { display: grid; gap: 3px; padding: 12px 9px; border-top: 1px solid var(--line); }
.sidebar-tab { min-height: 40px; display: flex; align-items: center; gap: 10px; border: 0; border-radius: 9px; padding: 0 10px; color: var(--muted); background: transparent; text-align: left; cursor: pointer; font-size: 11px; font-weight: 700; }.sidebar-tab.active { color: var(--blue-dark); background: var(--blue-soft); }
.admin-main { min-width: 0; padding: 26px; }
.admin-titlebar { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 20px; }
.admin-titlebar h2 { margin: 0; font-size: 25px; letter-spacing: -.035em; }
.breadcrumbs { margin: 0 0 9px; color: var(--muted); font-size: 10px; }.breadcrumbs span { color: var(--blue-dark); }
.title-with-status { display: flex; align-items: center; gap: 10px; }
.admin-status { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 8px; background: #eef2f5; color: #677a89; font-size: 9px; font-style: normal; font-weight: 800; }.admin-status.approved { background: var(--green-soft); color: var(--green); }.admin-status.disputed { background: #fdecee; color: var(--red); }
.admin-title-actions { display: flex; gap: 8px; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.admin-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 5px 18px rgba(30, 65, 90, .035); }
.admin-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 15px; }.admin-card-header h3 { margin: 0; font-size: 15px; }.admin-card-header .eyebrow { margin-bottom: 5px; }
.admin-preview-card { grid-row: span 2; }
.admin-preview-stage { display: grid; place-items: center; min-height: 280px; border-radius: 12px; background: radial-gradient(circle, #fff, #edf2f6); overflow: hidden; }
#admin-preview { width: min(95%, 590px); aspect-ratio: 96 / 56; background: #fff; box-shadow: 0 18px 45px rgba(20, 50, 75, .18); }
.admin-side-switcher { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 12px; padding: 4px; border-radius: 9px; background: #edf2f5; }.admin-side-switcher button { height: 33px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; font-size: 10px; font-weight: 700; }.admin-side-switcher button.active { color: var(--blue-dark); background: #fff; box-shadow: 0 2px 7px rgba(30,60,80,.09); }
.admin-lock { color: var(--muted); font-size: 9px; }
.admin-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.immutable-note { display: flex; align-items: flex-start; gap: 9px; margin-top: 14px; padding: 10px; border-radius: 9px; color: #537087; background: #f3f8fb; font-size: 10px; line-height: 1.45; }.immutable-note > span { color: var(--green); font-weight: 900; }.immutable-note p { margin: 0; }
.text-link { border: 0; padding: 3px; background: transparent; color: var(--blue-dark); cursor: pointer; font-size: 10px; font-weight: 750; }
.zone-list, .locked-list { display: grid; gap: 6px; max-height: 250px; overflow: auto; }
.zone-row { display: grid; grid-template-columns: 31px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 8px; border: 1px solid var(--line-soft); border-radius: 9px; background: #fbfcfd; }.zone-icon { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 8px; color: var(--blue-dark); background: var(--blue-soft); font-weight: 800; }.zone-row strong, .zone-row small { display: block; }.zone-row strong { font-size: 10px; }.zone-row small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.mini-check { display: flex; align-items: center; gap: 3px; color: var(--muted); font-size: 8px; }.mini-check input, .font-check input { accent-color: var(--blue); }
.admin-color-list { display: flex; flex-wrap: wrap; gap: 7px; }.admin-color { display: flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 7px; font: 9px ui-monospace, monospace; }.admin-color input { width: 20px; height: 20px; padding: 0; border: 0; background: none; }
.soft-rule { margin: 15px 0; border: 0; border-top: 1px solid var(--line-soft); }
.font-check-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }.font-check { display: flex; align-items: center; gap: 7px; color: #53697b; font-size: 10px; }
.admin-upload { min-height: 92px; margin-bottom: 12px; }
.locked-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 7px; align-items: center; padding: 7px; border-radius: 8px; background: #f7f9fb; }.locked-row code { overflow: hidden; text-overflow: ellipsis; color: #435c70; font-size: 9px; }.locked-row small { color: var(--muted); font-size: 8px; }
.registry-state { color: var(--green); font-size: 9px; font-weight: 800; }
.legal-summary { display: grid; gap: 9px; margin: 0 0 14px; }.legal-summary div { display: grid; grid-template-columns: 90px 1fr; gap: 8px; }.legal-summary dt { color: var(--muted); font-size: 9px; }.legal-summary dd { margin: 0; color: #435b6d; font-size: 10px; }
.full-width-card { width: 100%; }.registry-filters { display: flex; gap: 7px; margin-bottom: 14px; }.table-wrap { overflow: auto; }.registry-table { width: 100%; border-collapse: collapse; min-width: 820px; }.registry-table th, .registry-table td { padding: 10px; border-bottom: 1px solid var(--line-soft); text-align: left; font-size: 10px; }.registry-table th { color: var(--muted); background: #f7f9fb; font-size: 9px; text-transform: uppercase; letter-spacing: .04em; }
.history-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }.history-list li { display: grid; grid-template-columns: 155px 1fr; gap: 16px; padding: 13px; border-bottom: 1px solid var(--line-soft); }.history-list time { color: var(--muted); font-size: 9px; }.history-list strong, .history-list small { display: block; }.history-list strong { font-size: 11px; }.history-list small { margin-top: 3px; color: var(--muted); font-size: 9px; }

@media (max-width: 980px) {
  .admin-layout { grid-template-columns: 220px 1fr; }
  .admin-main { padding: 18px; }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-preview-card { grid-row: auto; }
}

@media (max-width: 700px) {
  .demo-warning { display: none; }
  .admin-layout { display: block; }
  .admin-sidebar { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-template-list { display: flex; overflow-x: auto; }
  .admin-template-row { min-width: 190px; }
  .admin-sidebar-footer { display: flex; overflow-x: auto; }
  .sidebar-tab { flex: 0 0 auto; }
  .admin-titlebar { display: block; }
  .admin-title-actions { margin-top: 12px; }
  .admin-main { padding: 14px; }
  .admin-form-grid { grid-template-columns: 1fr; }
  .history-list li { grid-template-columns: 1fr; gap: 5px; }
}
@font-face {
  font-family: "Noto Sans VV";
  src: url("assets/fonts/NotoSans-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
}

@font-face {
  font-family: "Noto Sans VV";
  src: url("assets/fonts/NotoSans-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Noto Serif VV";
  src: url("assets/fonts/NotoSerif-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
}

@font-face {
  font-family: "Noto Serif VV";
  src: url("assets/fonts/NotoSerif-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
