:root {
  --paper: #f0eadc;
  --paper-deep: #dfd5c2;
  --ink: #121611;
  --muted: #77786f;
  --line: rgba(18, 22, 17, .14);
  --green: #284f31;
  --acid: #ddeb83;
  --blue: #3ca9ef;
  --panel: #f8f4eb;
  --header-h: 74px;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--paper);
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-snap-type: y mandatory; }
body { margin: 0; min-width: 320px; background: var(--paper); overflow-x: hidden; }
main { display: flex; flex-direction: column; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 30; height: var(--header-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 34px; border-bottom: 1px solid rgba(18,22,17,.12);
  background: color-mix(in srgb, var(--paper) 90%, transparent); backdrop-filter: blur(18px);
  transition: color .35s, background .35s, border-color .35s;
}
.brand { grid-column: 2; justify-self: center; display: flex; align-items: center; width: max-content; color: inherit; text-decoration: none; }
.brand img { display: block; width: 116px; max-height: 30px; object-fit: contain; object-position: left center; filter: brightness(0); }
.brand-separator { width: 1px; height: 17px; margin: 0 15px; background: currentColor; opacity: .34; }
.product-name { font-size: 11px; letter-spacing: .25em; font-weight: 800; white-space: nowrap; }
.jump-link { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 15px; color: inherit; text-decoration: none; font-size: 10px; letter-spacing: .16em; font-weight: 800; }
.jump-link .jump-label { white-space: nowrap; }
.jump-link .jump-arrow { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid currentColor; border-radius: 50%; transition: transform .2s, color .2s, background .2s; }
.jump-link:hover .jump-arrow { transform: translateY(-3px); background: var(--ink); color: var(--paper); }
body.preview-visible .jump-link:hover .jump-arrow { transform: translateY(3px); background: white; color: var(--ink); }

.chapter { position: relative; min-height: 100svh; scroll-snap-align: start; scroll-snap-stop: always; padding-top: calc(var(--header-h) + 24px); }
.builder-chapter { order: 2; padding-inline: 0; padding-bottom: 0; background: var(--paper); }
.chapter-mark { position: absolute; left: 26px; top: calc(var(--header-h) + 42px); display: flex; flex-direction: column; align-items: center; gap: 7px; z-index: 3; }
.chapter-mark span, .chapter-mark em { font-size: 9px; font-style: normal; font-weight: 800; letter-spacing: .14em; }
.chapter-mark i { display: block; width: 1px; height: 64px; background: currentColor; opacity: .25; }

.workspace-card {
  display: flex; flex-direction: column; width: 100%; min-height: calc(100svh - var(--header-h) - 24px); margin: 0;
  padding: 26px 32px 22px 74px; border-radius: 0; background: var(--paper);
  box-shadow: none;
}
.workspace-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 24px; }
.eyebrow, .tool-label, .control-label { margin: 0 0 8px; font-size: 9px; line-height: 1; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; }
.workspace-heading h1, .preview-copy h2 { margin: 0; font-family: Georgia, 'Times New Roman', serif; font-size: clamp(42px, 5vw, 76px); line-height: .92; letter-spacing: -.055em; font-weight: 400; }
.dek { max-width: 370px; margin: 0; color: #696a62; font: 17px/1.45 Georgia, serif; }

.builder-layout { display: grid; grid-template-columns: 236px minmax(420px, 1fr) 242px; gap: 24px; align-items: stretch; flex: 1; min-height: 0; }
.toolrail, .inspector { min-height: 0; overflow-y: auto; border-top: 1px solid var(--line); padding: 17px 7px 18px 0; scrollbar-width: thin; }
.fresh-start-button { width: 100%; min-height: 50px; padding: 8px 10px; display: grid; grid-template-columns: 26px 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 8px; border: 1px solid var(--ink); border-radius: 10px; color: white; background: var(--ink); text-align: left; cursor: pointer; }
.fresh-start-button:hover { background: var(--green); border-color: var(--green); }
.fresh-start-button > span { grid-row: 1 / 3; font-size: 22px; font-weight: 300; }
.fresh-start-button strong { font-size: 9px; letter-spacing: .13em; }
.fresh-start-button small { color: rgba(255,255,255,.64); font-size: 9px; }
.fresh-start-button + .tool-section { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.tool-section + .tool-section { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 18px; }
.tool-section-head { display: flex; align-items: baseline; justify-content: space-between; }
.tool-hint { margin: -2px 0 12px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tool-button { min-height: 66px; border: 1px solid var(--line); border-radius: 12px; background: transparent; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 7px; cursor: pointer; font-size: 10px; font-weight: 700; transition: .18s ease; }
.tool-button:hover, .tool-button.active { color: white; background: var(--ink); border-color: var(--ink); transform: translateY(-1px); }
.tool-icon { font: 23px/1 Georgia, serif; }
.photo-upload-icon { width: 25px; height: 25px; }
.photo-upload-icon svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.shape-icon { width: 18px; height: 18px; border: 2px solid currentColor; }
.shape-icon.circle { border-radius: 50%; }
.text-button { border: 0; padding: 2px 0; color: var(--green); background: none; font-size: 9px; letter-spacing: .13em; font-weight: 800; cursor: pointer; }
.natural-button { width: 100%; min-height: 43px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: white; display: grid; grid-template-columns: 25px 1fr auto; align-items: center; gap: 9px; text-align: left; cursor: pointer; }
.natural-button:hover, .natural-button.active { outline: 2px solid var(--ink); outline-offset: -2px; }
.natural-swatch { width: 25px; height: 25px; border-radius: 6px; background: url('./assets/kraft-paper-generated.png') center/cover; }
.natural-button span:nth-child(2) { font-size: 11px; font-weight: 700; }
.natural-button small { font-size: 8px; letter-spacing: .12em; color: var(--muted); }
.color-tree { display: grid; gap: 9px; margin-top: 9px; }
.color-branch { position: relative; padding-left: 10px; border-left: 1px solid rgba(18,22,17,.18); }
.color-branch::before { content: ''; position: absolute; left: -1px; top: 9px; width: 7px; border-top: 1px solid rgba(18,22,17,.18); }
.color-branch-label { display: block; color: var(--muted); font-size: 7px; font-weight: 800; letter-spacing: .13em; }
.swatch-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-top: 5px; }
.color-swatch { position: relative; aspect-ratio: 1; border: 0; border-radius: 8px; background: var(--swatch); cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); transition: transform .15s; }
.color-swatch:hover { transform: scale(.92); }
.color-swatch.selected::after { content: ''; position: absolute; inset: 5px; border: 2px solid white; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.selected-color-row { display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; margin-top: 10px; align-items: baseline; }
.selected-color-row span { grid-row: span 2; color: var(--muted); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }
.selected-color-row strong { font-size: 11px; text-align: right; }
.selected-color-row code { font-size: 9px; text-align: right; color: var(--muted); }
.brush-controls label, .field-row { display: grid; gap: 6px; margin-top: 11px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.brush-controls input[type="color"] { width: 100%; height: 36px; border: 1px solid var(--line); padding: 3px; background: white; }
input[type="range"] { accent-color: var(--green); }
.compact-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.compact-actions button { min-height: 34px; padding: 0 5px; border: 1px solid var(--line); border-radius: 7px; background: transparent; font-size: 9px; text-transform: uppercase; letter-spacing: .05em; cursor: pointer; }
.compact-actions button:hover { background: var(--ink); color: white; }
.compact-actions .danger-action:hover { background: #9d372e; border-color: #9d372e; }
.guide-toggle { display: flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--muted); font-size: 10px; font-weight: 700; cursor: pointer; }
.guide-toggle input { width: 15px; height: 15px; margin: 0; accent-color: var(--green); }

.canvas-column { min-width: 0; }
.canvas-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 9px; letter-spacing: .12em; font-weight: 800; }
.canvas-meta { margin-bottom: 9px; }
.canvas-shell { position: relative; width: min(100%, min(82svh, 720px)); aspect-ratio: 1600 / 1060; margin: auto; overflow: hidden; border-radius: 4px; isolation: isolate; background: #d7bb91; box-shadow: 0 12px 45px rgba(36,29,17,.15); }
.canvas-paper { position: absolute; top: 0; left: 0; width: 100%; aspect-ratio: 1; z-index: 0; background-image: url('./assets/kraft-paper-generated.png'); background-size: cover; background-position: center; }
.canvas-paper::after { content: ''; position: absolute; inset: 0; background: var(--bag-tint, transparent); mix-blend-mode: var(--bag-tint-blend, multiply); opacity: var(--bag-tint-opacity, 0); }
.canvas-container { position: absolute !important; top: 0; left: 0; z-index: 1; width: 100% !important; height: auto !important; aspect-ratio: 1; }
.canvas-container canvas { width: 100% !important; height: 100% !important; }
.guides-overlay { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.guides-overlay[hidden] { display: none; }
.guide-line { position: absolute; display: block; opacity: .82; }
.guide-vertical { left: 50%; top: 0; bottom: 0; border-left: 1px dashed rgba(255,255,255,.95); box-shadow: 1px 0 rgba(21,29,22,.4); }
.guide-caption { position: absolute; padding: 4px 6px; border-radius: 4px; color: white; background: rgba(18,22,17,.70); font-size: 7px; font-weight: 800; letter-spacing: .13em; }
.guide-back { left: 8px; top: 8px; }
.guide-front { left: calc(50% + 8px); top: 8px; }
.drop-message { position: absolute; inset: 22px; z-index: 4; display: none; place-content: center; gap: 8px; text-align: center; border: 2px dashed rgba(255,255,255,.75); border-radius: 14px; color: white; background: rgba(27,42,30,.82); pointer-events: none; }
.canvas-shell.dragging .drop-message { display: grid; }
.drop-message strong { font: 32px Georgia, serif; }
.drop-message span { font-size: 10px; letter-spacing: .16em; }
.builder-actions { display: flex; justify-content: flex-end; align-items: center; gap: 9px; min-height: 52px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.ghost-button, .primary-button { min-height: 39px; padding: 0 14px; border-radius: 999px; font-size: 9px; letter-spacing: .1em; font-weight: 800; cursor: pointer; }
.ghost-button { border: 1px solid var(--line); background: transparent; }
.ghost-button:hover { background: white; }
.primary-button { margin-left: auto; border: 1px solid var(--ink); color: white; background: var(--ink); }
.primary-button span { margin-left: 12px; }

.inspector { min-width: 0; }
.inspector-done { display: none; }
.inspector-empty { min-height: 250px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 20px; border: 1px dashed var(--line); border-radius: 14px; }
.selection-glyph { font-size: 38px; color: var(--paper-deep); }
.inspector h2 { margin: 7px 0 6px; font: 20px/1 Georgia, serif; }
.inspector-empty p { max-width: 160px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.inspector-title-row { display: flex; justify-content: space-between; align-items: start; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.inspector-title-row button { width: 29px; height: 29px; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; font-size: 20px; }
.field-row textarea, .field-row select, .field-split select, .field-split input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px; color: var(--ink); background: white; font-size: 12px; text-transform: none; letter-spacing: 0; }
.field-row textarea { resize: vertical; }
.field-split { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.field-split label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.color-input-wrap { display: grid; grid-template-columns: 42px 1fr; align-items: center; gap: 9px; min-height: 40px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.color-input-wrap input { width: 38px; height: 30px; border: 0; padding: 0; background: none; }
.color-input-wrap code { color: #5e6058; font-size: 11px; text-transform: lowercase; }
.range-with-value { display: grid; grid-template-columns: 1fr auto; gap: 7px; align-items: center; }
.range-with-value output { color: var(--ink); font-size: 11px; }
.position-readout { display: grid; grid-template-columns: 1fr 1fr 1fr; margin-top: 16px; border-block: 1px solid var(--line); }
.position-readout span { display: grid; gap: 3px; padding: 10px 4px; color: var(--muted); font-size: 8px; letter-spacing: .1em; }
.position-readout span + span { border-left: 1px solid var(--line); padding-left: 10px; }
.position-readout b { color: var(--ink); font-size: 10px; font-weight: 700; }
.inspector-tip { color: var(--muted); font-size: 10px; line-height: 1.45; }
.scroll-cue { position: absolute; z-index: 5; left: 50%; bottom: 8px; display: flex; align-items: center; justify-content: center; gap: 15px; width: max-content; margin: 0; transform: translateX(-50%); color: inherit; text-decoration: none; font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.scroll-cue i { font-style: normal; animation: bob 1.7s infinite; }

.preview-chapter { order: 1; overflow: hidden; min-height: 100svh; color: #f3f0e8; background: #0c100e; padding: calc(var(--header-h) + 28px) 28px 24px; }
.preview-chapter::before { display: none; }
.preview-chapter .chapter-mark { left: 30px; }
.chapter-mark.light { color: white; }
.preview-copy { position: absolute; top: calc(var(--header-h) + 47px); left: 94px; z-index: 3; max-width: 350px; }
.preview-copy h2 { font-size: clamp(46px, 5.7vw, 90px); }
.preview-copy > p:last-child { color: #aeb4ad; font: 15px/1.45 Georgia, serif; }
.viewer-wrap { position: relative; height: calc(100svh - var(--header-h) - 152px); min-height: 570px; border-radius: 28px; overflow: hidden; background: #0c100e; }
#bag-viewer { display: block; width: 100%; height: 100%; pointer-events: none; }
.bag-hit-area { position: absolute; z-index: 2; left: 50%; top: 50%; width: 1px; height: 1px; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.bag-hit-area:active { cursor: grabbing; }
.viewer-loader { position: absolute; z-index: 5; inset: 0; display: grid; place-content: center; justify-items: center; gap: 9px; background: #0c100e; transition: opacity .45s, visibility .45s; }
.viewer-loader.done { opacity: 0; visibility: hidden; }
.loader-ring { width: 46px; height: 46px; border: 1px solid rgba(255,255,255,.22); border-top-color: var(--acid); border-radius: 50%; animation: spin 1s linear infinite; }
.viewer-loader strong { margin-top: 8px; font: 24px Georgia, serif; }
.viewer-loader small { color: #929a93; font-size: 9px; letter-spacing: .14em; text-transform: uppercase; }
.viewer-hint { position: absolute; left: 50%; bottom: 23px; display: flex; align-items: center; gap: 10px; transform: translateX(-50%); color: rgba(255,255,255,.5); font-size: 8px; letter-spacing: .16em; pointer-events: none; }
.viewer-hint i { width: 22px; height: 1px; background: currentColor; }
.first-use-cue { position: absolute; z-index: 7; left: 50%; bottom: 126px; display: flex; align-items: center; gap: 14px; padding: 11px 15px 11px 18px; border-radius: 999px; transform: translateX(-50%); color: #10140f; background: var(--acid); box-shadow: 0 12px 42px rgba(0,0,0,.38); text-decoration: none; font-size: 9px; font-weight: 900; letter-spacing: .14em; animation: firstUseFlash 1s ease-in-out infinite; }
.first-use-cue i { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; color: white; background: #10140f; font-style: normal; animation: bob 1s ease-in-out infinite; }
.viewer-controls { position: absolute; z-index: 4; left: 50%; bottom: 39px; transform: translateX(-50%); width: min(1120px, calc(100% - 80px)); min-height: 74px; padding: 11px 13px 11px 18px; display: flex; align-items: center; gap: 18px; border: 1px solid rgba(255,255,255,.11); border-radius: 17px; background: rgba(14,18,16,.76); backdrop-filter: blur(20px); box-shadow: 0 18px 50px rgba(0,0,0,.3); }
.control-group { display: grid; gap: 7px; }
.control-label { margin: 0; color: #929a93; font-size: 8px; }
.segmented { display: flex; gap: 2px; }
.segmented button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 7px; color: #aab0ab; background: transparent; cursor: pointer; font-size: 10px; }
.segmented button:hover, .segmented button.active { color: #10140f; background: var(--acid); }
.exposure-control { display: grid; grid-template-columns: 1fr auto; gap: 6px 9px; align-items: center; min-width: 150px; }
.exposure-control .control-label { grid-column: 1/-1; }
.exposure-control output { font-size: 9px; color: #bfc4bf; }
.control-button, .capture-button { min-height: 40px; border-radius: 999px; cursor: pointer; font-size: 8px; letter-spacing: .12em; font-weight: 800; }
.control-button { padding: 0 13px; border: 1px solid rgba(255,255,255,.16); color: #d8dcd8; background: transparent; }
.control-button[aria-pressed="true"] { color: #10140f; background: white; }
.control-button span, .capture-button span { font-size: 14px; margin-right: 7px; }
.capture-button { margin-left: auto; padding: 0 18px; border: 0; color: #10140f; background: white; }
.capture-button:hover { background: var(--acid); }
.footer-note { position: absolute; z-index: 3; right: 31px; top: calc(var(--header-h) + 40px); margin: 0; font-size: 8px; letter-spacing: .16em; color: #7e8580; }

.toast { position: fixed; z-index: 60; left: 50%; bottom: 24px; transform: translate(-50%, 18px); padding: 11px 16px; border-radius: 999px; color: white; background: #171b17; box-shadow: 0 8px 40px rgba(0,0,0,.25); font-size: 11px; opacity: 0; pointer-events: none; transition: .25s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

body.preview-visible .topbar { color: white; border-color: rgba(255,255,255,.1); background: rgba(9,12,10,.82); }
body.preview-visible .brand img { filter: brightness(0) invert(1); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bob { 50% { transform: translateY(5px); } }
@keyframes firstUseFlash { 50% { opacity: .42; box-shadow: 0 6px 20px rgba(221,235,131,.16); } }

@media (max-width: 1200px) {
  .builder-layout { grid-template-columns: 205px minmax(390px, 1fr); }
  .inspector {
    position: fixed; z-index: 50; right: 18px; bottom: 18px; display: block; width: min(390px, calc(100vw - 36px)); max-height: min(620px, calc(100svh - 36px));
    padding: 22px; overflow-y: auto; border: 1px solid rgba(18,22,17,.16); border-radius: 20px; background: #f8f4eb;
    box-shadow: 0 24px 80px rgba(18,22,17,.28); transform: translateY(calc(100% + 42px)); visibility: hidden; transition: transform .25s ease, visibility .25s;
  }
  body.inspector-active:not(.preview-visible) .inspector { transform: translateY(0); visibility: visible; }
  .inspector-empty { display: none; }
  .inspector-done { display: block; margin: 0 0 12px auto; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; font-size: 9px; font-weight: 800; letter-spacing: .12em; cursor: pointer; }
  .workspace-card { padding-right: 28px; }
  .viewer-controls { gap: 10px; width: calc(100% - 48px); }
  .control-button { padding-inline: 10px; }
}

@media (max-width: 900px) {
  :root { --header-h: 62px; }
  html { scroll-snap-type: y proximity; }
  .topbar { grid-template-columns: 1fr auto 1fr; padding: 0 16px; }
  .brand img { width: 96px; }
  .brand-separator { margin-inline: 10px; }
  .product-name { font-size: 9px; }
  .jump-link { font-size: 0; }
  .jump-link .jump-arrow { font-size: 13px; }
  .builder-chapter { padding-inline: 0; padding-top: var(--header-h); }
  .chapter-mark { display: none; }
  .workspace-card { min-height: calc(100svh - var(--header-h)); padding: 24px 14px 42px; border-radius: 0; }
  .workspace-heading { display: block; }
  .workspace-heading h1 { font-size: 49px; }
  .dek { margin-top: 12px; font-size: 14px; }
  .builder-layout { display: flex; flex-direction: column; min-height: 0; }
  .toolrail { order: 2; overflow: visible; padding-right: 0; }
  .canvas-column { order: 1; }
  .tool-grid { grid-template-columns: repeat(5, 1fr); }
  .tool-button { min-height: 59px; }
  .canvas-shell { width: 100%; }
  .builder-actions { flex-wrap: wrap; margin-top: 22px; padding-top: 15px; }
  .builder-actions .ghost-button { flex: 1; }
  .builder-actions .primary-button { flex: 2; width: auto; order: initial; margin: 0; }
  .preview-chapter { padding: calc(var(--header-h) + 12px) 10px 10px; }
  .preview-copy { top: calc(var(--header-h) + 35px); left: 28px; max-width: 270px; }
  .preview-copy { padding: 15px 18px 17px; border-radius: 14px; background: linear-gradient(135deg, rgba(7,11,9,.92), rgba(7,11,9,.58)); backdrop-filter: blur(9px); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
  .preview-copy .eyebrow { margin-bottom: 6px; }
  .preview-copy h2 { font-size: 45px; line-height: .88; }
  .preview-copy > p:last-child { margin: 9px 0 0; color: #d6dbd6; font-size: 12px; line-height: 1.35; }
  .footer-note { display: none; }
  .viewer-wrap { height: calc(100svh - var(--header-h) - 22px); min-height: 620px; border-radius: 20px; }
  .viewer-controls { bottom: 22px; width: calc(100% - 32px); padding: 10px; flex-wrap: wrap; justify-content: center; }
  .control-group { width: 100%; }
  .segmented button { flex: 1; padding: 0 7px; }
  .exposure-control { flex: 1; min-width: 130px; }
  .capture-button { margin-left: 0; }
  .viewer-hint { bottom: 155px; }
  .first-use-cue { bottom: 210px; }
  .scroll-cue { bottom: 10px; }
  .inspector { right: 10px; bottom: 10px; width: calc(100vw - 20px); max-height: min(68svh, 610px); border-radius: 18px; padding: 18px; }
}

@media (max-width: 520px) {
  .tool-grid { grid-template-columns: repeat(3, 1fr); }
  .ghost-button { flex: 1; padding-inline: 8px; }
  .preview-copy { left: 20px; right: 20px; max-width: 248px; }
  .control-button { font-size: 0; width: 40px; padding: 0; }
  .control-button span { margin: 0; }
  .capture-button { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
