:root {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  color-scheme: light;
  color: #21324e;
  background: #fff;
  --accent: #0874d8;
  --ink: #21324e;
  --muted: #637da1;
  --line: #dee7f5;
  --active: #eef6ff;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; font-size: 13px; }
button, input { font: inherit; }
button { color: inherit; border: 0; background: none; cursor: pointer; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button:disabled { opacity: .35; cursor: default; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
button svg, .icon { width: 17px; height: 17px; stroke: currentColor; stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
[hidden] { display: none !important; }

.site-header {
  height: 70px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 28px;
  background: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 650; letter-spacing: -.8px; flex-shrink: 0; }
.brand > svg { width: 34px; height: 36px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; }
.brand-dot { color: var(--accent); }
nav { display: flex; align-items: center; gap: 24px; margin-left: auto; height: 100%; font-size: 12px; }
nav > span, nav > button { height: 100%; display: flex; align-items: center; padding: 0 1px; }
nav > button { gap: 8px; color: var(--muted); }
nav > button:hover { color: var(--accent); }
nav .nav-active { color: var(--accent); font-weight: 600; position: relative; }
nav .nav-active::after { content: ""; position: absolute; height: 2px; background: var(--accent); bottom: 0; left: 0; right: 0; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 6px; padding: 10px 13px; font-size: 12px; font-weight: 550; line-height: 17px; white-space: nowrap; transition: background .15s, border-color .15s; }
.button-quiet { color: var(--muted); }
.button-quiet:hover { background: #f3f7fd; color: var(--accent); }
.button-outline { border: 1px solid var(--line); background: #fff; }
.button-outline:hover { background: #f6faff; border-color: #b6d2f3; }
.button-primary { border: 1px solid var(--accent); background: var(--accent); color: #fff; }
.button-primary:hover { background: #0665c0; border-color: #0665c0; }
.button-arrow { margin-left: 8px; }

main { width: 100%; max-width: 1920px; margin: auto; padding: 12px 20px 0; }
.studio { background: #fff; border: 0; border-radius: 0; }
.studio-topbar { height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 0 2px 12px; gap: 14px; }
.project-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.project-icon { color: #7d98ba; }
.project-title input { border: 0; border-bottom: 1px solid transparent; background: none; min-width: 100px; width: 170px; padding: 5px 0; font-size: 13px; font-weight: 600; color: var(--ink); }
.project-title input:hover { border-bottom-color: var(--line); }
.project-state { display: flex; align-items: center; gap: 6px; margin-left: 6px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.status-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #5a9be0; flex-shrink: 0; }
.studio-context { font-size: 12px; color: var(--muted); }
.studio-body { display: grid; grid-template-columns: 280px minmax(350px, 1fr) 290px; min-height: max(620px, calc(100dvh - 170px)); align-items: stretch; }
.controls-panel { padding: 22px 19px 0; margin-right: 20px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.control-section { border-bottom: 1px solid var(--line); padding-bottom: 24px; margin-bottom: 23px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
h2 { margin: 0; font-size: 12px; font-weight: 650; }
h2 > span { color: #8aa1bd; font-weight: 400; font-size: 11px; margin-right: 8px; }
.section-hint { margin: 10px 0 16px; font-size: 11px; color: var(--muted); line-height: 1.55; }
.preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.preset-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 6px; padding: 10px 2px 9px; background: #fff; }
.preset-card svg { width: 40px; height: 38px; overflow: visible; }
.preset-card .preset-silhouette { fill: #e8f0fa; stroke: #8ca9cf; stroke-width: 1.2; stroke-linejoin: round; }
.preset-card span { font-size: 10px; color: var(--muted); }
.preset-card.active { border-color: var(--accent); background: var(--active); }
.preset-card.active span { color: var(--accent); font-weight: 600; }
.preset-card.active .preset-silhouette { fill: #c9e3fc; stroke: var(--accent); }
.preset-card:hover { border-color: #88b9eb; }
.unit-switch { display: flex; gap: 1px; border: 1px solid var(--line); border-radius: 5px; padding: 2px; }
.unit-switch button { border-radius: 3px; color: var(--muted); font-size: 10px; padding: 4px 6px; }
.unit-switch button.active { background: #e8f3ff; color: var(--accent); font-weight: 600; }
.dimension-control { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; gap: 8px; }
.dimension-control > label { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.dimension-icon { font-size: 16px; color: #8aa1bd; }
.number-field { display: flex; align-items: center; width: 79px; height: 36px; padding: 0 9px; gap: 3px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.number-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px #0874d812; }
.number-field input { width: 100%; min-width: 0; border: 0; outline: 0; font-size: 13px; color: var(--ink); background: transparent; appearance: textfield; -moz-appearance: textfield; }
.number-field input::-webkit-inner-spin-button { -webkit-appearance: none; }
.unit-label { font-size: 11px; color: #8aa1bd; }
.range { display: block; width: 100%; height: 4px; margin: 16px 0 5px; appearance: none; background: linear-gradient(to right, var(--accent) var(--range-fill, 40%), #e5edf9 var(--range-fill, 40%)); border-radius: 4px; cursor: pointer; }
.range::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; border: 2px solid #fff; background: var(--accent); box-shadow: 0 0 0 1px #aacff3; border-radius: 50%; }
.range::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #fff; background: var(--accent); border-radius: 50%; }
.construction-section { border: 0; margin-bottom: 0; padding-bottom: 18px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; gap: 6px; }
.setting-row label { color: var(--muted); font-size: 12px; }
.help-dot { display: inline-flex; align-items: center; justify-content: center; width: 13px; height: 13px; border: 1px solid #bfcee3; border-radius: 50%; font-size: 8px; color: #849bbb; margin-left: 3px; vertical-align: middle; cursor: help; }
.stepper { display: flex; align-items: center; height: 36px; border: 1px solid var(--line); border-radius: 5px; }
.stepper button { padding: 5px 9px; color: #6a88b1; font-size: 16px; }
.stepper button:hover { color: var(--accent); }
.stepper output { min-width: 22px; text-align: center; font-size: 13px; }
.number-field.small { width: 79px; height: 36px; }
.micro-note { display: flex; align-items: flex-start; gap: 6px; margin: 17px 0 0; font-size: 10px; line-height: 1.6; color: #8298b6; }
.micro-note svg { width: 12px; height: 12px; margin-top: 2px; }
.sidebar-note { display: flex; align-items: flex-start; gap: 9px; color: #6e89ac; border-top: 1px solid var(--line); padding: 19px 0; margin-top: 8px; }
.sidebar-note svg { width: 17px; height: 17px; margin-top: 3px; }
.sidebar-note p { margin: 0; font-size: 11px; line-height: 1.8; }
.sidebar-note p span { font-size: 10px; color: #8ba0bc; }

.workspace-panel { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-right: 0; border-radius: 12px 0 0 12px; background: #fff; overflow: hidden; }
.workspace-header { height: 54px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 22px; border-bottom: 1px solid var(--line); background: #fff; }
.view-tabs { display: flex; align-items: stretch; gap: 25px; height: 100%; }
.view-tabs button { position: relative; display: flex; align-items: center; gap: 7px; padding: 0; color: var(--muted); font-size: 12px; }
.view-tabs button svg { width: 15px; height: 15px; }
.view-tabs button.active { color: var(--accent); font-weight: 600; }
.view-tabs button.active::after { content: ""; position: absolute; height: 2px; bottom: -1px; left: 0; right: 0; background: var(--accent); }
.workspace-badge { font-size: 9px; letter-spacing: .8px; color: #8da4c1; white-space: nowrap; }
.drawing-view { position: relative; display: flex; flex-direction: column; flex: 1; min-height: 480px; background: #fbfdff; }
.canvas-top-note { display: flex; align-items: center; gap: 7px; margin: 19px 23px 0; color: #819ab9; font-size: 11px; }
.canvas-top-note .status-dot { width: 4px; height: 4px; }
.editor-wrap { display: flex; align-items: center; justify-content: center; flex: 1; min-height: 350px; padding: 0 6px 64px; }
.editor-wrap > svg { display: block; width: 100%; height: 100%; max-height: 480px; overflow: visible; touch-action: none; user-select: none; }
.editor-toolbar { position: absolute; bottom: 54px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 5px; padding: 5px 7px; border: 1px solid #d7e3f3; border-radius: 7px; background: #fff; white-space: nowrap; }
.editor-toolbar button { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 11px; color: #6f8caf; padding: 8px; border-radius: 4px; }
.editor-toolbar button > span:not([data-icon]) { font-size: 11px; }
.editor-toolbar button svg { width: 14px; height: 14px; }
.editor-toolbar button.active { background: #eaf4ff; color: var(--accent); }
.editor-toolbar button:hover { background: #f0f6fd; }
.tool-group { display: flex; gap: 2px; }
.toolbar-divider { width: 1px; height: 19px; margin: 0 4px; background: var(--line); }
.canvas-instruction { font-size: 10px; color: #819ab9; text-align: center; margin: 0 15px 20px; line-height: 1.6; }
.workspace-foot { display: flex; align-items: center; justify-content: center; flex-shrink: 0; gap: 8px; border-top: 1px solid var(--line); min-height: 43px; padding: 10px 17px; background: #f6faff; color: #7893b6; }
.workspace-foot svg { width: 13px; height: 13px; }
.workspace-foot p { margin: 0; font-size: 10px; line-height: 1.6; }
.preview-panel { border: 1px solid var(--line); border-radius: 0 12px 12px 0; padding: 22px 20px 18px; background: #fff; }
.preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.preview-heading h2 { font-size: 12px; }
.live-badge { display: flex; align-items: center; gap: 5px; color: #7196bf; font-size: 9px; letter-spacing: .7px; white-space: nowrap; }
.live-badge .status-dot { width: 4px; height: 4px; }
.preview-canvas-wrap { position: relative; height: 260px; margin-top: 12px; background: radial-gradient(ellipse at 50% 65%, #f0f5fb 0%, #f8fafd 45%, #fff 77%); }
#shape-preview { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
#shape-preview:active { cursor: grabbing; }
.rotate-hint { position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 5px; font-size: 10px; color: #8aa1bf; pointer-events: none; white-space: nowrap; }
.rotate-hint svg { width: 13px; height: 13px; }
.color-row { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 25px; gap: 8px; }
.color-row > span { color: var(--muted); font-size: 11px; }
.swatches { display: flex; gap: 9px; }
.swatches button { width: 15px; height: 15px; background: var(--swatch); border-radius: 50%; position: relative; }
.swatches button.selected::after { content: ""; position: absolute; inset: -3px; border: 1px solid var(--accent); border-radius: 50%; }
.pattern-summary { border-top: 1px solid var(--line); padding-top: 22px; }
.eyebrow { margin: 0; font-size: 10px; font-weight: 600; letter-spacing: 1px; color: #8aa0bd; }
.pattern-summary .eyebrow { font-size: 9px; letter-spacing: .8px; }
.pattern-summary h3 { font-size: 16px; line-height: 1.4; font-weight: 600; letter-spacing: -.2px; margin: 9px 0 20px; }
.pattern-summary dl { margin: 0; }
.pattern-summary dl > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; margin: 17px 0; }
.pattern-summary dt { color: var(--muted); }
.pattern-summary dd { margin: 0; color: #3f5c81; font-size: 11px; font-weight: 550; white-space: nowrap; }
.pattern-summary .help-dot { width: 11px; height: 11px; font-size: 7px; margin-left: 2px; }
.summary-note { display: flex; align-items: center; gap: 10px; border: 1px solid #e4edf9; border-radius: 6px; background: #f5f9ff; padding: 12px; color: #6d8cb2; margin-top: 24px; }
.summary-note > svg { width: 24px; height: 24px; stroke-width: 1.3; }
.summary-note p { margin: 0; font-size: 10px; line-height: 1.8; }
.page-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 18px; min-height: 44px; padding: 14px 2px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.page-footer > a, .page-footer > button { padding: 0; font: inherit; color: inherit; white-space: nowrap; }
.page-footer a:hover, .page-footer button:hover, .page-footer a[aria-current="page"] { color: var(--accent); }
.page-footer #method-button { display: inline-flex; align-items: center; gap: 6px; }
.email-copy { position: relative; display: inline-block; padding: 0; color: var(--accent); font: inherit; line-height: inherit; white-space: nowrap; }
.email-copy-feedback { position: absolute; bottom: calc(100% + 7px); left: 50%; z-index: 20; padding: 5px 8px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--ink); box-shadow: 0 2px 8px #173a5f12; font-size: 11px; line-height: 1.3; opacity: 0; transform: translateX(-50%); pointer-events: none; }
.email-copy[data-copy-state] .email-copy-feedback { opacity: 1; }
.email-copy[data-copy-state="copied"] .email-copy-feedback::before { content: '✓ '; }
.email-copy[data-copy-state="error"] .email-copy-feedback { color: #9a5a0a; }
.legal-page { display: flex; flex-direction: column; min-height: 100dvh; }
.legal-page .site-header { justify-content: space-between; }
.legal-main { flex: 1; width: 100%; max-width: 800px; padding: 48px 28px 40px; }
.legal-main h1 { margin: 10px 0 12px; font-size: 32px; font-weight: 650; line-height: 1.2; letter-spacing: -1px; }
.legal-main .legal-updated { margin: 0 0 36px; color: var(--muted); font-size: 12px; }
.legal-main section { margin: 0 0 28px; font-size: 13px; line-height: 1.85; color: #526d91; }
.legal-main h2 { margin: 0 0 9px; font-size: 15px; line-height: 1.5; color: var(--ink); }
.legal-main p { margin: 0 0 12px; }
.legal-main a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.legal-main code { overflow-wrap: anywhere; font-size: 12px; }
.legal-main .legal-notice { padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: #f7faff; }
.legal-notice p:last-child { margin-bottom: 0; }
.legal-footer { margin: 0 24px; padding: 20px 0; border-top: 1px solid var(--line); }

.pattern-view { display: flex; flex-direction: column; flex: 1; padding: 22px; min-height: 480px; background: #fbfdff; }
.pattern-preview-header { display: flex; justify-content: space-between; gap: 10px; color: #7895b7; font-size: 10px; letter-spacing: .8px; }
.pattern-preview-header > span:last-child { letter-spacing: 0; font-size: 11px; }
#pattern-preview { width: 100%; flex: 1; min-height: 350px; max-height: 550px; }
.pattern-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; margin-top: 10px; font-size: 10px; color: #7793b6; }
.pattern-legend > span { display: flex; align-items: center; gap: 5px; }
.pattern-legend i { display: inline-block; width: 16px; border-top: 1.5px solid var(--accent); }
.pattern-legend i.line-dashed { border-top-style: dashed; border-color: #90a8c5; }

dialog { width: min(500px, calc(100% - 32px)); max-height: calc(100dvh - 40px); overflow: auto; padding: 28px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); box-shadow: 0 20px 70px #21324e22; }
dialog::backdrop { background: #243b5c55; backdrop-filter: blur(3px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.dialog-heading .eyebrow { font-size: 10px; }
.close-dialog { color: #7a95b8; font-size: 25px; line-height: 1; }
.dialog-heading .close-dialog { padding: 0 3px; }
dialog h2 { margin-bottom: 11px; font-size: 23px; font-weight: 650; line-height: 1.3; letter-spacing: -.5px; }
dialog > p { color: var(--muted); font-size: 12px; line-height: 1.7; margin: 0 0 21px; }
.paper-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; border: 0; padding: 0; margin: 24px 0 20px; }
.paper-options legend { margin-bottom: 12px; font-size: 12px; font-weight: 600; }
.paper-card { position: relative; display: grid; grid-template-columns: 35px 1fr; grid-template-rows: 21px 18px; align-items: center; column-gap: 8px; padding: 15px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.paper-card:has(input:checked) { border-color: var(--accent); background: var(--active); }
.paper-card input { position: absolute; opacity: 0; pointer-events: none; }
.paper-card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.paper-symbol { grid-row: 1 / 3; width: 23px; height: 32px; border: 1px solid #9db6d6; margin-left: 2px; background: #fff; box-shadow: 2px 2px 0 #e4edf9; }
.paper-symbol.letter { height: 29px; }
.paper-card strong { font-size: 12px; font-weight: 600; }
.paper-card small { font-size: 10px; color: var(--muted); }
.paper-check { display: none; position: absolute; right: 9px; top: 8px; font-size: 11px; color: var(--accent); }
.paper-card:has(input:checked) .paper-check { display: block; }
.export-info { display: flex; align-items: center; gap: 12px; border-radius: 6px; padding: 14px; background: #f0f7ff; color: #6586b0; }
.export-info > svg { width: 24px; height: 24px; }
.export-info strong { font-size: 12px; font-weight: 600; }
.export-info p { margin: 5px 0 0; font-size: 11px; line-height: 1.6; color: #7c98bb; }
.print-steps { display: grid; gap: 13px; list-style: none; padding: 0; margin: 22px 0; }
.print-steps li { display: flex; align-items: center; gap: 10px; }
.print-steps li > span { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 23px; height: 23px; border-radius: 50%; font-size: 11px; background: #eef5ff; color: #6b8db6; }
.print-steps p { margin: 0; font-size: 12px; line-height: 1.6; color: #6e89ac; }
.print-steps strong { color: #365b88; font-weight: 600; }
dialog .approximation-note { margin: 18px 0; padding: 11px 12px; border-left: 2px solid #9dbfe7; background: #f6f9fd; font-size: 11px; line-height: 1.7; color: #7c94b2; }
.full-width { width: 100%; padding: 13px; font-size: 12px; }
.full-width.close-dialog { font-size: 12px; line-height: 17px; }
.export-privacy { margin: 8px 0 0; text-align: center; font-size: 10px; color: #91a6c0; }
#help-content { font-size: 12px; line-height: 1.8; color: #6e89ac; }
#help-content h3 { margin-top: 22px; font-size: 13px; font-weight: 600; color: #365b88; }
#help-content p { margin: 10px 0 18px; }
#help-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
#help-dialog .full-width { margin-top: 17px; }
#toast { position: fixed; bottom: 25px; left: 50%; transform: translate(-50%, 15px); padding: 13px 22px; max-width: 90%; border-radius: 7px; background: #213c61; color: #fff; font-size: 12px; text-align: center; opacity: 0; pointer-events: none; transition: .2s; z-index: 100; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 1550px) {
  .studio-body { grid-template-columns: 300px minmax(450px, 1fr) 330px; }
  .controls-panel { padding: 25px 23px 0; }
  .preview-panel { padding: 25px; }
  .preview-canvas-wrap { height: 285px; }
}

@media (max-width: 1180px) {
  .site-header { gap: 20px; padding: 0 20px; }
  .brand { font-size: 19px; }
  nav { gap: 17px; }
  .header-actions { gap: 6px; }
  .header-actions .button { padding: 9px 10px; font-size: 11px; }
  .studio-body { grid-template-columns: 250px minmax(300px, 1fr) 260px; }
  .controls-panel { padding: 20px 16px 0; margin-right: 16px; }
  .preview-panel { padding: 20px 16px; }
  .workspace-header { padding: 0 17px; }
  .workspace-badge { display: none; }
  .view-tabs { gap: 20px; }
  .preview-canvas-wrap { height: 245px; }
  .pattern-summary dl > div, .pattern-summary dd { font-size: 10px; }
  .color-row > span { font-size: 10px; }
  .swatches { gap: 8px; }
  .swatches button { width: 13px; height: 13px; }
}

@media (max-width: 1000px) {
  .site-header { flex-wrap: wrap; gap: 12px 20px; height: auto; min-height: 70px; padding-top: 14px; padding-bottom: 14px; }
  nav { margin-left: auto; height: 35px; }
  .header-actions { width: 100%; justify-content: flex-end; border-top: 1px solid #edf2fa; padding-top: 12px; }
  .studio-body { grid-template-columns: 250px minmax(300px, 1fr); min-height: 0; row-gap: 16px; }
  .workspace-panel { border-right: 1px solid var(--line); border-radius: 12px; }
  .preview-panel { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; column-gap: 35px; padding: 22px 25px; border-radius: 12px; position: relative; }
  .preview-heading { grid-column: 1; grid-row: 1; }
  .preview-canvas-wrap { grid-column: 1; grid-row: 2; margin-top: 0; height: 235px; }
  .color-row { grid-column: 1; grid-row: 3; margin: 16px 10px 0; }
  .pattern-summary { grid-column: 2; grid-row: 1 / 4; border-top: 0; padding-top: 0; }
  .pattern-summary dl > div, .pattern-summary dd { font-size: 12px; }
  .pattern-summary h3 { margin-bottom: 24px; }
  .preview-panel::before { content: ""; position: absolute; left: 50%; top: 25px; bottom: 25px; width: 1px; background: var(--line); }
  .drawing-view { min-height: 570px; }
  .project-state { font-size: 10px; }
}

@media (max-width: 620px) {
  .site-header { padding: 13px 16px; gap: 12px; }
  .brand { font-size: 19px; gap: 8px; }
  .brand > svg { width: 30px; height: 32px; }
  nav { gap: 0; font-size: 11px; }
  nav .nav-active { display: none; }
  nav > button { gap: 5px; }
  .header-actions { gap: 6px; padding-top: 12px; justify-content: stretch; }
  .header-actions .button { flex: 1; padding: 9px 6px; gap: 5px; font-size: 10px; }
  .header-actions .button svg { width: 13px; height: 13px; }
  main { padding: 12px 12px 0; }
  .studio-topbar { height: 42px; padding: 0 2px 12px; }
  .project-title { gap: 7px; }
  .project-title input { width: 155px; font-size: 12px; }
  .project-icon svg { width: 14px; height: 14px; }
  .project-state { display: none; }
  .studio-context { font-size: 10px; }
  .studio-body { display: flex; flex-direction: column; gap: 14px; }
  .controls-panel { margin-right: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 22px; padding: 17px 15px 12px; border-radius: 10px; }
  .shape-section { grid-column: 1 / -1; display: flex; align-items: center; gap: 15px; padding-bottom: 17px; margin-bottom: 18px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
  .shape-section > .section-heading { flex: 1; }
  .shape-section > .section-hint { display: none; }
  .preset-grid { width: 200px; gap: 6px; }
  .preset-card { padding: 6px 2px; gap: 3px; }
  .preset-card svg { width: 30px; height: 27px; }
  .preset-card span { font-size: 9px; }
  .control-section { border-bottom: 0; padding-bottom: 0; margin-bottom: 8px; min-width: 0; }
  .shape-section { border-bottom: 1px solid var(--line); padding-bottom: 17px; margin-bottom: 18px; }
  .section-heading h2 { font-size: 11px; white-space: nowrap; }
  .unit-switch button { padding: 3px 4px; font-size: 9px; }
  .dimension-control { margin-top: 15px; gap: 4px; }
  .dimension-control > label { font-size: 11px; gap: 4px; }
  .dimension-icon { font-size: 13px; }
  .number-field, .number-field.small { width: 64px; height: 33px; padding: 0 6px; }
  .number-field input { font-size: 12px; }
  .unit-label { font-size: 10px; }
  .range { margin: 13px 0; }
  .setting-row { margin-top: 18px; gap: 5px; }
  .setting-row label { font-size: 11px; }
  .setting-row .help-dot { display: none; }
  .stepper { height: 33px; }
  .stepper button { padding: 3px 6px; }
  .stepper output { min-width: 18px; font-size: 12px; }
  .micro-note { font-size: 9px; gap: 4px; margin-top: 15px; }
  .micro-note svg { width: 10px; height: 10px; }
  .sidebar-note { display: none; }
  .workspace-panel { border-radius: 10px; }
  .workspace-header { height: 50px; padding: 0 16px; }
  .view-tabs { gap: 23px; }
  .view-tabs button { font-size: 11px; }
  .drawing-view { min-height: 490px; }
  .editor-wrap { min-height: 350px; padding-bottom: 60px; }
  .editor-wrap > svg { max-height: 380px; }
  .canvas-top-note { margin: 17px 16px 0; font-size: 10px; }
  .editor-toolbar { bottom: 55px; padding: 4px 5px; gap: 3px; }
  .editor-toolbar button { padding: 8px 7px; }
  .editor-toolbar button > span:not([data-icon]) { font-size: 10px; }
  .canvas-instruction { font-size: 9px; margin: 0 15px 19px; }
  .workspace-foot { min-height: 42px; padding: 9px 12px; align-items: flex-start; }
  .workspace-foot p { font-size: 9px; }
  .workspace-foot svg { margin-top: 2px; width: 12px; height: 12px; }
  .preview-panel { display: grid; grid-template-columns: 1fr; gap: 0; padding: 20px 18px; border-radius: 10px; }
  .preview-panel::before { display: none; }
  .preview-heading { grid-column: auto; grid-row: auto; }
  .preview-canvas-wrap { grid-column: auto; grid-row: auto; height: 260px; margin-top: 10px; }
  .color-row { grid-column: auto; grid-row: auto; margin: 17px 0 24px; }
  .color-row > span { font-size: 12px; }
  .swatches { gap: 12px; }
  .swatches button { width: 17px; height: 17px; }
  .pattern-summary { grid-column: auto; grid-row: auto; border-top: 1px solid var(--line); padding-top: 22px; }
  .pattern-summary h3 { font-size: 16px; margin-bottom: 19px; }
  .pattern-summary dl > div, .pattern-summary dd { font-size: 12px; }
  .summary-note { margin-top: 20px; }
  .summary-note p { font-size: 11px; }
  .page-footer { gap: 8px 14px; padding: 16px 2px 22px; }
  .legal-page .site-header { padding: 0 16px; gap: 12px; }
  .legal-page .brand { font-size: 18px; gap: 7px; }
  .legal-page .brand > svg { width: 28px; }
  .legal-page .site-header .button { padding: 8px; font-size: 11px; }
  .legal-main { padding: 32px 20px 24px; }
  .legal-main h1 { font-size: 28px; }
  .pattern-view { padding: 20px 14px; min-height: 490px; }
  .pattern-preview-header { font-size: 9px; letter-spacing: .5px; }
  .pattern-preview-header > span:last-child { font-size: 10px; }
  #pattern-preview { min-height: 340px; }
  .pattern-legend { gap: 10px; font-size: 9px; }
  dialog { padding: 23px; }
  dialog h2 { font-size: 21px; }
  .paper-card { padding: 12px 9px; column-gap: 5px; grid-template-columns: 29px 1fr; }
  .paper-card strong { font-size: 11px; }
  .paper-card small { font-size: 9px; }
  .export-info p { font-size: 10px; }
  .print-steps p { font-size: 11px; }
}

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

/* Simple two-piece construction and print options. */
.construction-choice { padding-bottom: 20px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.construction-options { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 13px; }
.construction-options button { width: 100%; padding: 11px 12px; text-align: left; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.construction-options button:hover { border-color: #91bce9; }
.construction-options button.active { border-color: var(--accent); background: var(--active); }
.construction-options strong { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; font-size: 12px; font-weight: 600; line-height: 1.5; }
.construction-options small { display: block; color: var(--muted); font-size: 10px; line-height: 1.6; margin-top: 3px; }
.construction-options button.active strong { color: var(--accent); }
.construction-options strong span { padding: 1px 5px; border-radius: 3px; font-size: 9px; font-weight: 550; color: var(--accent); background: #dceeff; }
.dimension-help { margin: 14px 0 0; font-size: 10px; color: #7c96b7; line-height: 1.7; }
.dimension-control > label { flex-wrap: wrap; }
#simple-design { width: 100%; height: auto; max-width: 740px; max-height: 480px; }
#simple-assembly { display: block; width: 100%; height: 100%; }
.simple-mode .editor-toolbar { display: none; }
.simple-mode .editor-wrap { padding: 12px 10px 10px; }
.simple-mode .canvas-instruction { margin-bottom: 20px; }
.simple-mode .rotate-hint { font-size: 9px; }
.export-format-options { display: grid; gap: 9px; padding: 0; margin: 22px 0 18px; border: 0; }
.export-format-options legend { font-size: 12px; font-weight: 600; margin-bottom: 11px; }
.export-format-options label { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 10px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.export-format-options label:has(input:checked) { border-color: var(--accent); background: var(--active); }
.export-format-options input { margin: 3px 0 0; accent-color: var(--accent); }
.export-format-options strong { display: block; font-size: 12px; font-weight: 600; line-height: 1.5; }
.export-format-options small { display: block; font-size: 10px; color: var(--muted); line-height: 1.6; margin-top: 3px; }
.export-format-options label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (max-width: 620px) {
  .construction-choice { grid-column: 1 / -1; padding-bottom: 17px; margin-bottom: 18px; }
  .construction-options { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 11px; }
  .construction-options button { padding: 10px 9px; }
  .construction-options strong { font-size: 11px; gap: 5px; }
  .construction-options small { font-size: 9px; line-height: 1.55; }
  .construction-options strong span { font-size: 8px; padding: 1px 4px; }
  #custom-shapes { grid-column: 1 / -1; }
  .dimension-help { margin-top: 12px; font-size: 9px; }
  .simple-mode .editor-wrap { min-height: 340px; padding: 12px 5px; }
  #simple-design { max-height: 390px; }
  .export-format-options label { padding: 11px; gap: 8px; }
}
