:root {
  --ink: #25231f;
  --muted: #726e66;
  --paper: #fffdf8;
  --cream: #f7f2e8;
  --cream-deep: #eee5d5;
  --line: #ded6c8;
  --accent: #ff654f;
  --accent-deep: #d94632;
  --teal: #177c75;
  --yellow: #f5c451;
  --shadow: 0 24px 70px rgba(66, 52, 35, .12);
  --soft-shadow: 0 12px 32px rgba(66, 52, 35, .09);
  --radius-xl: 30px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

button, input, select { font: inherit; }
button, select, input[type="range"], label { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
img, canvas { display: block; max-width: 100%; }

.page-glow {
  position: fixed;
  z-index: -1;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(2px);
  opacity: .55;
  pointer-events: none;
}
.page-glow--one { top: -280px; right: -180px; background: radial-gradient(circle, #ffd2a8 0, rgba(255, 210, 168, 0) 70%); }
.page-glow--two { bottom: -320px; left: -220px; background: radial-gradient(circle, #b9e2d8 0, rgba(185, 226, 216, 0) 70%); }

.site-header {
  width: min(1440px, calc(100% - 48px));
  height: 90px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: .02em;
}

.brand-mark {
  width: 38px;
  height: 38px;
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  border-radius: 12px;
  background: var(--ink);
  box-shadow: inset 0 -3px 0 rgba(255,255,255,.08);
}
.brand-mark i { display: block; border-radius: 50%; background: #fff8ed; }
.brand-mark i:nth-child(2) { background: var(--yellow); }
.brand-mark i:nth-child(3) { background: #70c8bb; }
.brand-mark i:nth-child(4) { background: #8fb9f0; }
.brand-mark i:nth-child(5) { background: var(--accent); }
.brand-mark i:nth-child(6) { background: #b39bd8; }

.privacy-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  color: #4c554c;
  background: rgba(255,255,255,.68);
  border: 1px solid rgba(80, 75, 65, .12);
  border-radius: 999px;
  font-size: 13px;
  backdrop-filter: blur(10px);
}
.privacy-dot { width: 8px; height: 8px; border-radius: 50%; background: #4eaa7e; box-shadow: 0 0 0 4px rgba(78,170,126,.13); }

main { width: min(1440px, calc(100% - 48px)); margin: 0 auto; }

.hero {
  min-height: 320px;
  padding: 36px 0 48px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr);
  align-items: end;
  gap: 70px;
}
.eyebrow { margin: 0 0 15px; color: var(--accent-deep); font-size: 12px; font-weight: 900; letter-spacing: .18em; }
.hero h1 { margin: 0; font-size: clamp(48px, 6vw, 82px); line-height: 1.02; letter-spacing: -.055em; }
.hero h1 em { color: var(--accent); font-style: normal; position: relative; white-space: nowrap; }
.hero h1 em::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 8px; border-radius: 50%; background: rgba(245,196,81,.55); transform: rotate(-1deg); z-index: -1; }
.hero-description { max-width: 720px; margin: 25px 0 0; color: var(--muted); font-size: 16px; line-height: 1.9; }

.hero-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0; padding: 0; list-style: none; }
.hero-steps li { min-height: 128px; padding: 18px 16px; display: flex; flex-direction: column; justify-content: flex-end; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(255,253,248,.72); box-shadow: 0 8px 24px rgba(68,54,37,.045); }
.hero-steps span { margin-bottom: auto; color: var(--accent); font-size: 12px; font-weight: 900; }
.hero-steps strong { font-size: 16px; }
.hero-steps small { margin-top: 5px; color: var(--muted); font-size: 12px; }

.workspace { display: grid; grid-template-columns: 390px minmax(0, 1fr); gap: 22px; align-items: start; }
.control-panel, .preview-panel { border: 1px solid rgba(96, 82, 63, .14); background: rgba(255,253,248,.92); box-shadow: var(--shadow); }
.control-panel { position: sticky; top: 18px; padding: 25px; border-radius: var(--radius-xl); }
.preview-panel { min-height: 780px; overflow: hidden; border-radius: var(--radius-xl); }

.panel-heading { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 16px; }
.panel-heading--tight { margin-top: 4px; }
.panel-heading h2 { margin: 1px 0 4px; font-size: 17px; letter-spacing: -.01em; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.section-number { flex: 0 0 auto; width: 29px; height: 29px; display: grid; place-items: center; border-radius: 10px; color: white; background: var(--ink); font-size: 12px; font-weight: 900; }

.drop-zone {
  min-height: 158px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1.5px dashed #b9ad9d;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, #fbf7ef, #f5eee2);
  cursor: pointer;
  transition: border-color .2s ease, transform .2s ease, background .2s ease;
}
.drop-zone:hover, .drop-zone.is-dragging { border-color: var(--accent); background: #fff6ee; transform: translateY(-2px); }
.drop-zone input { position: fixed; top: 0; left: -10000px; width: 1px; height: 1px; opacity: 0; }
.drop-zone strong { margin-top: 12px; font-size: 15px; }
.drop-zone > span:last-child { margin-top: 6px; color: var(--muted); font-size: 12px; }
.upload-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 16px; color: var(--accent); background: white; box-shadow: 0 8px 22px rgba(90,68,44,.1); }
.upload-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.file-card { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto 30px; align-items: center; gap: 12px; margin-top: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.file-card img { width: 64px; height: 64px; object-fit: cover; border-radius: 11px; background: #eee8de; }
.file-card__body { min-width: 0; }
.file-card__body strong, .file-card__body span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-card__body strong { font-size: 13px; }
.file-card__body span { margin-top: 5px; color: var(--muted); font-size: 11px; }
.change-file-button { height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; color: #615b53; background: white; cursor: pointer; font-size: 11px; font-weight: 700; }
.change-file-button:hover { color: white; border-color: var(--accent); background: var(--accent); }
.icon-button { width: 30px; height: 30px; border: 0; border-radius: 50%; background: #f5f0e8; color: #7d756b; cursor: pointer; font-size: 20px; line-height: 1; }
.icon-button:hover { color: white; background: var(--accent); }

.divider { height: 1px; margin: 24px 0 22px; background: var(--line); }
.controls { display: grid; gap: 18px; }
.field { display: block; }
.field-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; font-size: 13px; }
.field-label strong { font-weight: 700; }
.field-label output { color: var(--accent-deep); font-size: 12px; font-weight: 800; }
.field-hint { display: block; margin-top: 7px; color: #928a7f; font-size: 11px; line-height: 1.5; }
select { width: 100%; padding: 12px 38px 12px 13px; appearance: none; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23726e66' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 13px center; outline: none; }
select:focus, input[type="range"]:focus-visible, button:focus-visible { outline: 3px solid rgba(255,101,79,.22); outline-offset: 2px; }

input[type="range"] { width: 100%; height: 6px; appearance: none; border-radius: 999px; background: linear-gradient(90deg, var(--accent) var(--range-progress, 50%), #e7dfd3 var(--range-progress, 50%)); cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { width: 19px; height: 19px; appearance: none; border: 3px solid white; border-radius: 50%; background: var(--accent); box-shadow: 0 2px 8px rgba(126,62,50,.35); }
input[type="range"]::-moz-range-thumb { width: 15px; height: 15px; border: 3px solid white; border-radius: 50%; background: var(--accent); box-shadow: 0 2px 8px rgba(126,62,50,.35); }

.advanced { border: 1px solid var(--line); border-radius: 15px; background: #fcf9f3; overflow: hidden; }
.advanced summary { padding: 13px 14px; cursor: pointer; font-size: 13px; font-weight: 700; list-style: none; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::after { content: "+"; float: right; color: var(--accent); font-size: 18px; line-height: 15px; }
.advanced[open] summary::after { content: "−"; }
.advanced-grid { padding: 0 14px 14px; display: grid; gap: 15px; }
.field--compact .field-label { margin-bottom: 7px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; }
.switch-row strong, .switch-row small { display: block; }
.switch-row strong { font-size: 12px; }
.switch-row small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch-row i { flex: 0 0 auto; position: relative; width: 42px; height: 24px; border-radius: 999px; background: #d8d0c4; transition: background .2s ease; }
.switch-row i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: white; box-shadow: 0 2px 6px rgba(0,0,0,.18); transition: transform .2s ease; }
.switch-row input:checked + i { background: var(--teal); }
.switch-row input:checked + i::after { transform: translateX(18px); }
.switch-row input:focus-visible + i { outline: 3px solid rgba(23,124,117,.2); outline-offset: 2px; }

.primary-button, .secondary-button, .tool-button { border: 0; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease, opacity .18s ease; }
.primary-button { width: 100%; min-height: 54px; margin-top: 24px; padding: 0 20px; display: flex; align-items: center; justify-content: center; gap: 10px; border-radius: 15px; color: white; background: var(--accent); box-shadow: 0 12px 26px rgba(223,75,54,.25); font-weight: 800; }
.primary-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.primary-button:hover:not(:disabled) { transform: translateY(-2px); background: var(--accent-deep); box-shadow: 0 16px 30px rgba(223,75,54,.3); }
.primary-button:disabled { cursor: not-allowed; opacity: .42; box-shadow: none; }
.primary-button--small { width: auto; min-height: 44px; margin: 0; padding: 0 18px; border-radius: 13px; font-size: 13px; }
.shortcut-hint { margin: 11px 0 0; text-align: center; color: #948b7f; font-size: 11px; }
.autosave-note { margin: 9px 0 0; padding: 10px 12px; text-align: center; color: #177c75; background: rgba(23,124,117,.08); border: 1px dashed rgba(23,124,117,.35); border-radius: 12px; font-size: 11px; line-height: 1.6; }

.empty-state { min-height: 780px; padding: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 42%, #fff 0, #fdfaf4 52%, #f7f0e6 100%); }
.empty-illustration { position: relative; width: min(430px, 90%); aspect-ratio: 1.55; }
.empty-board { position: absolute; inset: 20% 10% 5%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; border: 1px solid #ddd2c1; border-radius: 24px; background: rgba(255,255,255,.82); box-shadow: var(--soft-shadow); }
.empty-board svg { width: 34px; height: 34px; margin-bottom: 12px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.empty-board strong { font-size: 17px; }
.empty-board span { max-width: 260px; margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.empty-bead { position: absolute; width: 52px; height: 52px; border: 9px solid; border-radius: 50%; background: white; box-shadow: inset 0 0 0 2px rgba(0,0,0,.08), 0 8px 20px rgba(65,50,34,.12); }
.empty-bead--one { top: 2%; left: 8%; color: #ff806d; transform: rotate(-12deg); }
.empty-bead--two { top: -2%; right: 16%; color: #f5c451; transform: rotate(16deg); }
.empty-bead--three { bottom: 7%; left: 1%; color: #70c8bb; transform: rotate(8deg); }
.empty-bead--four { right: 2%; bottom: 0; color: #8fb9f0; transform: rotate(-20deg); }
.empty-bead--five { right: 34%; bottom: -8%; color: #b39bd8; transform: rotate(22deg); }
.empty-features { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.empty-features span { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: #71695f; background: rgba(255,255,255,.75); font-size: 11px; }

.result-view { padding: 24px; }
.result-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.result-kicker { margin: 0 0 5px; color: var(--accent-deep); font-size: 10px; font-weight: 900; letter-spacing: .16em; }
.result-toolbar h2, .legend-heading h3 { margin: 0; letter-spacing: -.02em; }
.result-toolbar h2 { font-size: 22px; }
.toolbar-actions { display: flex; align-items: center; gap: 7px; }
.tool-button { min-width: 37px; height: 37px; padding: 0 11px; border: 1px solid var(--line); border-radius: 11px; background: white; font-size: 12px; font-weight: 700; }
.tool-button:hover { transform: translateY(-1px); border-color: #bbaa96; }
.tool-button.is-active { color: white; border-color: var(--ink); background: var(--ink); }
.tool-button--wide { min-width: 78px; }

.canvas-shell { position: relative; min-height: 460px; max-height: 760px; padding: 22px; overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; display: grid; place-items: center; place-items: safe center; border-radius: 20px; background-color: #292c2b; background-image: linear-gradient(45deg, rgba(255,255,255,.025) 25%, transparent 25%), linear-gradient(-45deg, rgba(255,255,255,.025) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(255,255,255,.025) 75%), linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.025) 75%); background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0; }
#patternCanvas { width: auto; max-width: none; border-radius: 8px; box-shadow: 0 18px 42px rgba(0,0,0,.28); background: #f8f3e9; image-rendering: auto; }
.processing-overlay { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; color: white; background: rgba(31,34,33,.78); backdrop-filter: blur(8px); }
.processing-overlay[hidden] { display: none; }
.processing-overlay strong { margin-top: 14px; }
.processing-overlay small { margin-top: 6px; color: rgba(255,255,255,.65); }
.processing-spinner { width: 38px; height: 38px; border: 3px solid rgba(255,255,255,.22); border-top-color: white; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px; }
.stat-card { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.stat-card strong, .stat-card span { display: block; }
.stat-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 18px; letter-spacing: -.02em; }
.stat-card span { margin-top: 5px; color: var(--muted); font-size: 10px; }

.legend-heading { margin: 28px 0 13px; display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.legend-heading h3 { font-size: 20px; }
#legendSummary { color: var(--muted); font-size: 11px; }
.legend-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.legend-item { min-width: 0; padding: 10px 12px; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.legend-swatch { width: 26px; height: 26px; border: 2px solid white; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,.14), inset 0 0 0 5px rgba(255,255,255,.22); }
.legend-name { min-width: 0; }
.legend-name strong, .legend-name span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-name strong { font-size: 12px; }
.legend-name span { margin-top: 2px; color: var(--muted); font-size: 9px; letter-spacing: .03em; }
.legend-count { text-align: right; }
.legend-count strong, .legend-count span { display: block; }
.legend-count strong { font-size: 13px; }
.legend-count span { color: var(--muted); font-size: 9px; }

.export-bar { margin-top: 22px; padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-radius: 18px; color: white; background: var(--ink); }
.export-bar strong, .export-bar span { display: block; }
.export-bar strong { font-size: 14px; }
.export-bar span { max-width: 500px; margin-top: 5px; color: rgba(255,255,255,.58); font-size: 11px; line-height: 1.55; }
.export-actions { flex: 0 0 auto; display: flex; gap: 8px; }
.secondary-button { min-height: 44px; padding: 0 16px; border: 1px solid rgba(255,255,255,.18); border-radius: 13px; color: white; background: rgba(255,255,255,.08); font-size: 12px; font-weight: 700; }
.secondary-button:hover { background: rgba(255,255,255,.16); transform: translateY(-1px); }

.notes-section { padding: 110px 0 80px; }
.notes-section > div:first-child { max-width: 650px; }
.notes-section h2 { margin: 0; font-size: clamp(32px, 4vw, 52px); letter-spacing: -.04em; }
.notes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-top: 32px; }
.notes-grid article { min-height: 200px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(255,253,248,.7); }
.notes-grid article > span { color: var(--accent); font-size: 11px; font-weight: 900; }
.notes-grid h3 { margin: 54px 0 10px; font-size: 17px; }
.notes-grid p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.85; }

.site-credit { color: var(--accent-deep); font-weight: 800; letter-spacing: .01em; }
footer { width: min(1440px, calc(100% - 48px)); margin: 0 auto; padding: 26px 0 38px; display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }

.toast { position: fixed; z-index: 20; left: 50%; bottom: 28px; max-width: calc(100% - 32px); padding: 13px 18px; color: white; background: #242724; border-radius: 13px; box-shadow: 0 14px 35px rgba(0,0,0,.24); font-size: 12px; opacity: 0; pointer-events: none; transform: translate(-50%, 18px); transition: opacity .2s ease, transform .2s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: #c63d32; }

@media (max-width: 1180px) {
  .hero { grid-template-columns: 1fr; gap: 35px; }
  .hero-steps { max-width: 720px; }
  .workspace { grid-template-columns: 340px minmax(0, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .export-bar { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 920px) {
  .site-header, main, footer { width: min(100% - 30px, 760px); }
  .privacy-pill { display: none; }
  .workspace { grid-template-columns: 1fr; }
  .control-panel { position: static; }
  .preview-panel { min-height: 600px; }
  .empty-state { min-height: 600px; }
  .notes-grid { grid-template-columns: 1fr; }
  .notes-grid article { min-height: 150px; }
  .notes-grid h3 { margin-top: 30px; }
}

@media (max-width: 620px) {
  .site-header { height: 74px; }
  .hero { min-height: auto; padding: 24px 0 36px; }
  .hero h1 { font-size: clamp(38px, 12.5vw, 54px); }
  .hero h1 em { white-space: normal; }
  .hero-description { font-size: 14px; }
  .hero-steps { grid-template-columns: 1fr; }
  .hero-steps li { min-height: 84px; }
  .control-panel, .result-view { padding: 16px; }
  .preview-panel { border-radius: 22px; min-height: 0; }
  .empty-state { min-height: 420px; padding: 26px 18px; }
  .result-toolbar { align-items: flex-start; flex-direction: column; gap: 12px; }
  .result-toolbar h2 { font-size: 19px; }
  .toolbar-actions { width: 100%; flex-wrap: wrap; gap: 8px; }
  .tool-button { min-width: 46px; height: 46px; padding: 0 12px; font-size: 13px; border-radius: 13px; }
  .tool-button--wide { flex: 1 1 auto; min-width: 96px; }
  .canvas-shell { min-height: 300px; max-height: min(62vh, 540px); padding: 10px; border-radius: 16px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-card strong { font-size: 16px; }
  .legend-heading { margin-top: 24px; flex-direction: column; align-items: flex-start; gap: 5px; }
  .legend-list { grid-template-columns: 1fr; }
  .legend-item { padding: 11px 12px; }
  .legend-name strong { font-size: 13px; }
  .legend-name span, .legend-count span { font-size: 10px; }
  .export-bar { padding: 16px; border-radius: 16px; }
  .export-actions { width: 100%; flex-wrap: wrap; }
  .export-actions button { flex: 1 1 45%; min-height: 48px; }
  .notes-section { padding: 64px 0 48px; }
  .notes-grid article { min-height: 0; padding: 20px; }
  .notes-grid h3 { margin-top: 22px; }
  footer { flex-direction: column; gap: 8px; }
  input[type="range"] { height: 8px; }
  input[type="range"]::-webkit-slider-thumb { width: 26px; height: 26px; }
  input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; }
}

@media (max-width: 480px) {
  .site-header, main, footer { width: calc(100% - 24px); }
  .hero h1 { font-size: clamp(33px, 12vw, 44px); }
  .hero-steps li { min-height: 76px; }
  .control-panel, .result-view { padding: 14px; }
  .panel-heading h2 { font-size: 16px; }
  .canvas-shell { min-height: 260px; max-height: min(58vh, 460px); }
  .tool-button--wide { min-width: 86px; }
  .export-actions button { flex: 1 1 100%; }
  .toast { bottom: 16px; }
}

@media print {
  .page-glow, .site-header, .hero, .control-panel, .notes-section, footer, .export-bar,
  .stats-grid, .legend-heading, .legend-list, .result-toolbar, .toast { display: none !important; }
  body { background: #fff; }
  .workspace { display: block; }
  .preview-panel { border: 0; box-shadow: none; min-height: 0; overflow: visible; }
  .result-view { padding: 0; }
  .canvas-shell { min-height: 0; max-height: none; padding: 0; background: none; border-radius: 0; overflow: visible; }
  #patternCanvas { box-shadow: none; width: 100% !important; height: auto !important; }
}

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