:root {
  color-scheme: light;
  --ground: #faf9f5;
  --ink: #17223b;
  --soft-ink: #536178;
  --line: #e2e3df;
  --blue: #2452e5;
  --blue-ink: #1c42bd;
  --blue-pale: #edf2ff;
  --white: #fff;
  --radius: 16px;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  font: 16px/1.5 "Instrument Sans", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--ground); }
a { color: var(--blue-ink); text-underline-offset: 3px; }
button, input, select { font: inherit; }
button, input[type="color"], summary { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
:focus-visible { outline: 3px solid #537cff; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h2 { letter-spacing: -.035em; font-size: 1.9rem; line-height: 1.15; }
h3 { letter-spacing: -.015em; }
.shell { width: min(1196px, calc(100% - 64px)); margin-inline: auto; }
.skip { position: absolute; left: 16px; top: 8px; z-index: 3; padding: 10px; background: white; transform: translateY(-150%); }
.skip:focus { transform: none; }
.site-header { border-bottom: 1px solid #e7e7e1; background: #fcfbf8; }
.nav, .footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 18px; min-height: 70px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-size: 1.15rem; font-weight: 770; letter-spacing: -.035em; white-space: nowrap; }
.brand-mark { width: 29px; height: 29px; flex: 0 0 auto; display: grid; grid-template-columns: repeat(2,4px); grid-template-rows: repeat(3,4px); gap: 2px; align-content: center; justify-content: center; background: var(--blue); border-radius: 6px; }
.brand-mark i { background: #fff; }
.nav nav, .footer-inner nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 3px 10px; }
.nav nav a, .footer-inner nav a { color: var(--soft-ink); text-decoration: none; padding: 7px 10px; font-size: .875rem; font-weight: 650; border-radius: 7px; white-space: nowrap; }
.nav nav a:is(:hover, [aria-current="page"]), .footer-inner nav a:hover { background: var(--blue-pale); color: var(--blue-ink); }
.intro { padding: 40px 0 23px; }
.intro h1 { font-size: clamp(2.15rem, 4.7vw, 4.3rem); line-height: 1.02; letter-spacing: -.07em; font-weight: 780; }
.intro h1 span { color: var(--blue); }
.intro p { margin-top: 12px; max-width: 710px; color: var(--soft-ink); font-size: clamp(1rem, 1.6vw, 1.16rem); }
.intro .release-note { font-size: .875rem; color: #775317; font-weight: 620; }
.workbench { overflow: clip; background: var(--white); border: 1px solid #dfe2df; border-radius: var(--radius); box-shadow: 0 5px 12px #1d2b4608; scroll-margin-top: 12px; }
.workbench-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; min-height: 62px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.modes, .project-tools, .preview-tools, .wall-examples, .canvas-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.mode-btn, .btn, .preview-tools button, .preset-row button, .text-button {
  border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--soft-ink); font-weight: 680; font-size: .875rem;
  min-height: 38px; padding: 7px 10px; display: inline-flex; justify-content: center; align-items: center; gap: 7px; text-decoration: none; line-height: 1.25;
}
.mode-btn { justify-content: flex-start; padding: 7px 13px; }
.mode-btn[aria-pressed="true"], .preset-row [aria-pressed="true"], .preview-tools [aria-pressed="true"] { color: var(--blue-ink); background: var(--blue-pale); border-color: #dce5ff; }
.mode-btn:hover, .btn.quiet:hover, .preset-row button:hover, .preview-tools button:hover { color: var(--blue-ink); background: #f4f6fc; }
.btn.primary { background: var(--blue); color: white; }
.btn.primary:hover:enabled, a.btn.primary:hover { background: #1a3fc8; }
.btn.muted, .btn.preview-btn { background: #fff; color: var(--ink); border-color: #dadfe6; }
.btn.muted:hover, .btn.preview-btn:hover { background: #f4f6fc; }
.btn.text-button, .text-button { color: var(--blue-ink); padding-inline: 0; justify-content: flex-start; }
.btn.text-button:hover, .text-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.workspace-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(274px, 302px); align-items: stretch; }
.workspace-canvas { position: relative; display: flex; flex-direction: column; min-width: 0; background: #f0f3f9; }
.canvas-top, .canvas-bottom { z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; padding: 10px 17px; font-size: .85rem; color: #47566f; }
.canvas-top { padding-bottom: 4px; min-height: 46px; }
.canvas-caption { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.canvas-bottom { border-top: 1px solid #dfe5ef; min-height: 48px; background: #f7f8fb; }
.canvas-bottom output, .canvas-top output { font: 600 .79rem/1.5 var(--mono); }
.local-note { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.local-note svg { width: 14px; height: 14px; }
.preview-tools { background: #fff; border-radius: 9px; padding: 2px; gap: 2px; }
.preview-tools button { min-height: 31px; font-size: .79rem; padding: 3px 8px; }
.canvas-stage {
  min-height: 417px; flex: 1; padding: 14px 20px 21px; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle, #8c9bab40 1px, transparent 1.1px) 0 0/15px 15px;
}
.paper-surfaces { display: flex; align-items: center; justify-content: center; width: 100%; gap: 14px; min-width: 0; }
.work-paper { width: min(100%, var(--paper-width, 380px)); max-width: 100%; min-width: 0; padding: 13px; background: white; border: 1px solid #e0e4ee; border-radius: 6px; box-shadow: 0 7px 21px #26355416; }
.work-paper canvas { display: block; width: 100%; height: auto; object-fit: contain; max-height: 390px; }
.paper-surfaces.is-compare .work-paper { width: 50%; max-width: 380px; }
.dropzone { max-width: 360px; width: 100%; padding: 28px 20px; border: 1px dashed #8fa4db; border-radius: 12px; text-align: center; background: #f9fbff; display: grid; place-items: center; gap: 9px; }
.dropzone strong { font-size: 1.25rem; }
.dropzone p, .dropzone > span { color: var(--soft-ink); }
.dropzone > span { font-size: .8rem; }
.upload-glyph { color: var(--blue); background: var(--blue-pale); display: grid; place-items: center; width: 44px; aspect-ratio: 1; border-radius: 10px; }
.canvas-stage.is-drop { box-shadow: inset 0 0 0 3px var(--blue); }
.settings { padding: 16px 17px 14px; border-left: 1px solid var(--line); min-width: 0; }
.settings-group { display: grid; gap: 10px; }
.settings h2 { font-size: 1rem; letter-spacing: -.02em; }
.settings-title { display: flex; justify-content: space-between; align-items: center; gap: 5px; min-height: 23px; }
.settings-title .text-button { min-height: 26px; font-size: .8rem; }
.field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.field { display: grid; align-items: center; gap: 4px; min-width: 0; color: #4c5a72; font-size: .875rem; font-weight: 630; }
.field input, .field select, .materials input { width: 100%; min-width: 0; height: 39px; padding: 5px 8px; color: var(--ink); background: white; border-radius: 7px; border: 1px solid #dce0e8; font-weight: 580; }
.field input[type="number"], .materials input { font-family: var(--mono); }
.field select { appearance: none; background: linear-gradient(45deg, transparent 50%, #526078 50%) calc(100% - 13px) 16px/4px 4px no-repeat, linear-gradient(135deg,#526078 50%,transparent 50%) calc(100% - 9px) 16px/4px 4px no-repeat, white; padding-right: 19px; text-overflow: ellipsis; }
.field input[type="color"] { padding: 4px 6px; }
.preset-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
.preset-row button { min-height: 32px; border-color: #e6e8ef; font-family: var(--mono); font-size: .75rem; padding: 5px 2px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 13px; }
.check { display: inline-flex; align-items: center; gap: 5px; font-size: .875rem; color: var(--ink); cursor: pointer; }
.check input { accent-color: var(--blue); width: 16px; height: 16px; margin: 0; }
.pixel-controls { display: grid; gap: 8px; }
.export-group { border-top: 1px solid var(--line); margin-top: 13px; padding-top: 13px; }
.download-main { min-height: 43px; width: 100%; }
.page-count { color: #596981; font: .75rem var(--mono); }
.advanced { margin-top: 11px; border-top: 1px solid var(--line); padding-top: 9px; }
.advanced summary { color: var(--soft-ink); font-size: .875rem; font-weight: 620; }
.advanced-inner { display: grid; gap: 9px; padding-top: 10px; }
.status { color: #465670; font-size: .83rem; }
.status:not(:empty) { margin-top: 8px; }
.status.error { color: #963439; }
.paint-label { display: inline-flex; align-items: center; gap: 4px; }
.paint-label input { width: 25px; height: 25px; border: 0; background: transparent; padding: 0; }
.canvas-actions .btn { min-height: 30px; padding: 3px 7px; }
.canvas-actions .btn.active { color: var(--blue-ink); background: var(--blue-pale); }
.print-dialog { width: min(780px, calc(100% - 24px)); padding: 0; border: 1px solid #e1e5eb; border-radius: 13px; background: white; color: var(--ink); max-height: 92dvh; }
.print-dialog::backdrop { background-color: #14203e88; }
.dialog-head, .dialog-foot { padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.dialog-head h2 { font-size: 1.2rem; }
.dialog-foot output { font-size: .84rem; color: var(--soft-ink); }
.print-stage { background: #eef1f7; padding: 10px; display: grid; place-items: center; }
.print-stage canvas { max-width: 100%; max-height: 62dvh; width: auto; height: auto; box-shadow: 0 5px 18px #22305222; }
.section { margin-block: 35px; }
.section-heading { margin-bottom: 14px; }
.section-heading p, .print-band p { margin-top: 6px; color: var(--soft-ink); }
.sample-list, .template-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.sample, .template { border-radius: 12px; border: 1px solid var(--line); overflow: hidden; background: white; min-width: 0; }
.sample-image { width: 100%; display: grid; place-items: center; height: 145px; border: 0; overflow: hidden; }
.sample-image img { width: 100%; height: 100%; object-fit: contain; }
.mint { background: #e2f0e8; }
.peach { background: #f4ddd0; }
.blue { background: #e1eafd; }
.sample-image img[src*="coastal"] { object-fit: cover; object-position: 50% 44%; }
.sample-image img[src*="koi"] { image-rendering: pixelated; height: 116px; }
.sample-paper, .template-preview span { width: 106px; aspect-ratio: 1; border: 9px solid white; border-radius: 3px; background-color: #fff; background-image: linear-gradient(#7692aa62 1px,transparent 1px),linear-gradient(90deg,#7692aa62 1px,transparent 1px); background-size: calc(100% / var(--cells, 16)) calc(100% / var(--cells, 16)); box-shadow: 0 5px 16px #253d421c; }
.sample-copy, .template-info { padding: 13px 16px; }
.sample-copy p, .template-info p { color: var(--soft-ink); margin-top: 4px; }
.print-band { display: grid; grid-template-columns: 1fr auto; gap: 14px; padding: 18px; background: #eef2fe; border: 1px solid #dfe7fc; border-radius: 12px; }
.print-band .btn { align-self: start; }
.print-shortcuts { grid-column: 1/-1; display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.print-shortcuts article { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 5px; padding: 12px; font-size: .875rem; background: #ffffffc7; border-radius: 8px; }
.print-shortcuts strong { font-family: var(--mono); }
.faq h2 { margin-bottom: 12px; }
.faq-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
.faq-list article { padding: 13px 0; border-top: 1px solid #dddfdc; }
.faq-list h3 { font-size: 1.02rem; }
.faq-list p, .prose p { color: var(--soft-ink); margin-top: 5px; max-width: 70ch; }
.site-footer { margin-top: 42px; border-top: 1px solid var(--line); }
.template-preview { display: grid; place-items: center; min-height: 170px; background: #eaf0fb; }
.template-preview span { width: 127px; }
.template-info h2 { font-size: 1.45rem; }
.downloads { display: grid; gap: 8px; margin-top: 10px; }
.downloads div { display: flex; gap: 10px; flex-wrap: wrap; font-size: .875rem; align-items: baseline; }
.downloads div strong { color: var(--soft-ink); min-width: 64px; }
.prose h2:not(:first-child) { margin-top: 20px; }
.wall-examples strong { margin-right: 4px; }
.wall .workspace-canvas .canvas-stage { min-height: 360px; }
.wall .settings-group > .text-button { justify-self: start; }
.wall-downloads { display: flex; gap: 6px; flex-wrap: wrap; }
.wall-downloads .primary { width: 100%; }
.wall-downloads .muted { flex: 1; }
.materials-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.materials { border-collapse: collapse; min-width: 650px; width: 100%; text-align: left; }
.materials th, .materials td { padding: 8px 11px; border-bottom: 1px solid #e8eaf0; font-size: .875rem; white-space: nowrap; }
.materials thead { background: #f1f4fa; color: #40516d; }
.materials td:not(:first-child) { font-family: var(--mono); }
.materials input { width: 76px; }
.materials td:first-child i { display: inline-block; width: 14px; height: 14px; margin-right: 8px; border-radius: 3px; border: 1px solid #14203c28; vertical-align: -2px; }
.materials td.missing { color: #a03642; font-weight: 700; }
.legal-note { color: var(--soft-ink); font-size: .875rem; }
@media (max-width: 850px) {
  .shell { width: calc(100% - 36px); }
  .workspace-body { grid-template-columns: minmax(0, 1fr) 264px; }
  .mode-btn { padding-inline: 7px; }
  .workbench-bar { flex-wrap: wrap; }
  .canvas-stage { padding-inline: 10px; }
  .local-note { display: none; }
}
@media (max-width: 620px) {
  .shell { width: calc(100% - 24px); }
  .nav, .footer-inner { min-height: 58px; gap: 8px; }
  .brand { font-size: 1rem; }
  .brand-mark { width: 24px; height: 24px; }
  .nav nav, .footer-inner nav { gap: 1px 6px; }
  .nav nav a, .footer-inner nav a { font-size: .78rem; padding: 5px 3px; }
  .nav nav a[aria-current="page"] { display: none; }
  .intro { padding: 20px 0 16px; }
  .intro h1 { letter-spacing: -.062em; }
  .intro p { margin-top: 8px; font-size: 1rem; }
  .workbench { border-radius: 12px; }
  .workbench-bar { padding: 7px; gap: 4px; }
  .modes { width: 100%; display: grid; grid-template-columns: .82fr 1.2fr 1fr; }
  .mode-btn { justify-content: center; text-align: center; min-height: 38px; font-size: .75rem; padding: 4px; gap: 4px; }
  .mode-btn svg { width: 15px; height: 15px; flex: 0 0 auto; }
  .project-tools { order: 1; gap: 6px; }
  .project-tools .btn { min-height: 30px; padding: 4px 7px; font-size: .75rem; }
  .project-tools svg { width: 14px; height: 14px; }
  .workspace-body { display: flex; flex-direction: column; }
  .canvas-top, .canvas-bottom { min-height: 34px; padding: 6px 9px; font-size: .75rem; }
  .canvas-stage { min-height: 225px; padding: 5px 12px 12px; }
  .work-paper { max-width: 275px; padding: 8px; }
  .work-paper canvas { max-height: 272px; }
  .paper-surfaces.is-compare { gap: 6px; }
  .paper-surfaces.is-compare .work-paper { padding: 4px; }
  .preview-tools button { min-height: 27px; padding: 3px 5px; font-size: .71rem; }
  .settings { display: flex; flex-direction: column; border-left: 0; padding: 10px; }
  .settings-group { gap: 8px; }
  .export-group { order: -1; border-top: 0; margin-top: 0; padding-top: 0; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
  .workbench:not(.wall) .export-group { display: grid; grid-template-columns: 1fr 1fr; }
  .workbench:not(.wall) .export-group .settings-title, .workbench:not(.wall) .export-group .field-pair { grid-column: 1/-1; }
  .workbench:not(.wall) .export-group .btn { min-height: 41px; }
  .field input, .field select { font-size: 1rem; }
  .section { margin-block: 24px; }
  .sample-list, .template-list, .faq-list { grid-template-columns: 1fr; gap: 9px; }
  .sample { display: grid; grid-template-columns: 38% auto; }
  .sample-image { height: 100%; min-height: 109px; }
  .sample-image .sample-paper { width: 77px; }
  .sample-image img[src*="koi"] { width: 100%; height: auto; }
  .print-band { grid-template-columns: 1fr; }
  .print-band .btn { justify-self: start; }
  .print-shortcuts { grid-template-columns: 1fr; gap: 6px; }
  .wall .workspace-canvas .canvas-stage { min-height: 240px; }
  .materials { min-width: 580px; }
  .footer-inner { flex-wrap: wrap; padding-block: 10px; }
}
@media (prefers-reduced-motion: no-preference) {
  :focus-visible { scroll-margin-top: 10px; }
}
.bead-controls { display: grid; gap: 13px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.bead-filters { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.bead-inputs { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 8px; }
.bead-gallery { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin-top: 16px; }
.bead-card { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 13px; min-width: 0; }
.bead-card h2 { font-size: 1.16rem; }
.bead-meta, .bead-key { color: var(--soft-ink); font-size: .85rem; margin: 5px 0; }
.bead-art { background: #eef0f7; height: 150px; display: grid; place-items: center; border-radius: 6px; margin: 7px 0; padding: 7px; }
.bead-art canvas { max-width: 100%; max-height: 132px; object-fit: contain; image-rendering: pixelated; }
.bead-card .btn { margin-top: 8px; }
.bead-stock { color: #115c4d; font-size: .84rem; }
.bead-stock.shortage { color: #933240; }
@media (max-width: 700px) {
  .bead-gallery { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .bead-inputs { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

/* Studio visual system */
:root { --ground:#f7f6f2; --ink:#19223e; --soft-ink:#505d76; --blue:#344fd4; --blue-ink:#253daf; --blue-pale:#eef0ff; --line:#dedfdf; }
.site-header { position:relative; z-index:5; background:#fffdf9; }
.brand { font-weight:820; }
.brand-mark { border-radius:4px; box-shadow:2px 2px #1e2b6c; }
.nav-more { position:relative; }
.nav-more summary { list-style:none; padding:7px 10px; color:var(--soft-ink); font-size:.875rem; font-weight:650; }
.nav-more summary::-webkit-details-marker { display:none; }
.nav-more summary::after { content:"";display:inline-block; margin:0 0 3px 8px; width:5px;height:5px;border:solid currentColor;border-width:0 1.5px 1.5px 0;transform:rotate(45deg); }
.nav-more > div { display:grid; position:absolute; z-index:7; right:0; top:100%; min-width:180px; padding:7px; border:1px solid var(--line); border-radius:9px; background:#fff; box-shadow:0 8px 24px #19223e1c; }
.nav-more[open] summary { color:var(--blue-ink);background:var(--blue-pale);border-radius:6px; }
.grid-intro { padding: 26px 0 19px; }
.grid-intro h1 { font-size: clamp(1.9rem, 4vw, 3.6rem); }
.grid-intro p { margin-top: 7px; }
.home-workbench .export-group { margin: 14px 0; padding: 12px 0; border-block: 1px solid var(--line); }
.home-workbench .project-tools { margin-top: 8px; }
.hero-actions,.hero-utility,.art-links,.gallery-filters { display:flex; flex-wrap:wrap; gap:8px 13px; align-items:center; }
.hero-actions .btn { min-height:43px; padding-inline:14px; }
.hero-utility { margin-top:14px; font-size:.9rem; }
.art-meta,.draw-workbench output { font: .78rem var(--mono); color:#56607a; }
.converter-intro .hero-utility { padding-top:3px; }
.studio-section { margin:44px 0; }
.studio-heading { display:flex; align-items:end; justify-content:space-between; gap:12px; margin-bottom:16px; }
.studio-heading p,.tool-cards p,.how-to p { color:var(--soft-ink); margin-top:7px; }
.art-grid,.tool-cards { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.art-card,.tool-cards article { min-width:0; border:1px solid var(--line); background:#fffdf9; border-radius:11px; overflow:hidden; }
.art-thumb,.detail-stage { display:grid; place-items:center; background:#e7e5f0; padding:0; }
.art-thumb { height:170px; overflow:hidden; }
.art-thumb img { display:block; width:100%; height:100%; object-fit:contain; image-rendering:pixelated; }
.art-card[data-theme="Landscapes"] .art-thumb img { object-fit:cover; }
.art-card[data-theme="Food"] .art-thumb { background:#f7ded9; }
.art-card[data-theme="Animals"] .art-thumb { background:#daeae2; }
.art-card[data-theme="Objects"] .art-thumb { background:#eee7f8; }
.art-card[data-theme]:not([data-theme="Landscapes"]) .art-thumb img { width:67%; height:78%; }
.art-card-body,.tool-cards article { padding:13px 14px; }
.art-card h3 { margin:.18rem 0 .44rem; font-size:1.12rem; }
.art-card h3 a,.tool-cards h3 a { color:var(--ink); text-decoration:none; }
.art-card h3 a:hover,.tool-cards h3 a:hover { text-decoration:underline; }
.art-links { font-size:.83rem; }
.tool-cards h2 { font-size:1.16rem; }
.tool-cards article { border-top:3px solid #b3a4e9; }
.tool-cards article:nth-child(2n) { border-top-color:#eec19d; }
.how-to { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:25px; background:#eceafb; border:1px solid #e4e0f3; border-radius:14px; }
.how-to .btn { margin-top:12px; }
.how-to p { max-width:67ch; }
.how-to img { display:block; image-rendering:pixelated; object-fit:contain; }
.gallery-filters { margin-bottom:18px; }
.gallery-filters [aria-pressed=true], .draw-tools [aria-pressed=true] { color:var(--blue-ink); background:var(--blue-pale); border-color:#bdc8ff; }
.pattern-detail,.guide-layout { display:grid; grid-template-columns:minmax(0,1.45fr) minmax(220px,.65fr); gap:16px; }
.detail-stage { min-height:320px; }
.detail-stage img { display:block; max-width:100%; height:auto; image-rendering:pixelated; }
.detail-controls { display:grid; align-content:center; gap:8px; padding:20px; }
.detail-controls dl { margin:0; }
.detail-controls dl div { display:flex; justify-content:space-between; }
.guide-layout aside .art-grid { grid-template-columns:1fr; }
.guide { background:#fffdf9; padding:22px; border:1px solid var(--line); border-radius:10px; }
.guide section + section,.guide nav { margin-top:22px; }
.guide h2 { font-size:1.4rem; }
.draw-layout { display:grid; grid-template-columns:minmax(0,1fr) 270px; }
.draw-canvas { background:#e8e8f3; min-width:0; }
.draw-stage { display:grid; place-items:center; padding:25px 12px; min-height:390px; background-image:radial-gradient(#69759c44 1px,transparent 1px); background-size:14px 14px; overflow:auto; }
.draw-surface { max-width:100%; background:repeating-conic-gradient(#fff 0 25%,#d8dce7 0 50%) 0 0/18px 18px; border:1px solid #8e98bd; box-shadow:0 6px 18px #29294c26; }
.draw-surface canvas { display:block; width:100%; height:auto; touch-action:none; cursor:crosshair; }
.draw-tools,.draw-status { display:flex; flex-wrap:wrap; gap:6px; padding:9px; background:#fffdf9; }
.draw-tools button { min-height:36px; }
kbd { color:#616983; font: .71rem var(--mono); }
.draw-status { border-top:1px solid var(--line); min-height:37px; }
.draw-settings { display:grid; align-content:start; gap:8px; }
.draw-settings h2 + *, .palette-box h3 { margin-top:3px; }
.draw-settings h2:not(:first-child) { margin-top:6px; }
.swatches { display:flex; flex-wrap:wrap; gap:4px; }
.swatches span,.swatches button { width:22px; height:22px; border:1px solid #17223b35; border-radius:3px; }
.swatches button { width:26px; height:26px; }
.palette-box h3 { margin-bottom:5px; font-size:.87rem; }
.palette-box output { font-size:.8rem; margin-left:.4rem; color:var(--soft-ink); }
.resize-stage canvas { max-height:420px; max-width:100%; object-fit:contain; image-rendering:pixelated; }
#resize-empty { display:grid; justify-items:center; text-align:center; gap:8px; }
#workspace,#editor { scroll-margin-top:16px; }
@media(max-width:850px) {
  .art-grid,.tool-cards { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .draw-layout { grid-template-columns:minmax(0,1fr) 223px; }
  .nav { gap:6px; }
  .nav nav { gap:0; }
  .nav nav a,.nav-more summary { padding-inline:6px; }
}
@media(max-width:620px) {
  .nav { flex-direction:column; align-items:flex-start; justify-content:center; gap:6px; padding-block:8px; }
  .nav nav { justify-content:flex-start; width:100%; }
  .nav nav a[aria-current="page"] { display:inline-flex; }
  .nav nav a,.nav-more summary { min-height:26px; font-size:.775rem; padding:5px 6px; }
  .grid-intro { padding: 15px 0 12px; }
  .grid-intro p { line-height: 1.35; }
  .home-workbench .mode-btn { min-height: 44px; }
  .home-workbench .canvas-top:has(.preview-tools[hidden]) { display: none; }
  .home-workbench .canvas-stage { padding-bottom: 7px; }
  .home-workbench .work-paper { max-width: 266px; }
  .home-workbench .export-group { order: 0; margin: 8px 0 11px; padding: 8px 0 11px; }
  .workbench.home-workbench .export-group .btn { min-height: 44px; }
  .studio-heading { align-items:start; flex-direction:column; }
  .studio-section { margin:30px 0; }
  .art-grid,.tool-cards { gap:8px; }
  .art-thumb { height:104px; }
  .art-card-body,.tool-cards article { padding:9px; }
  .art-card h3 { font-size:1rem; }
  .art-links { gap:5px; padding-bottom:3px; }
  .how-to { padding:15px; }
  .how-to img { width:70px; }
  .pattern-detail,.guide-layout,.draw-layout { grid-template-columns:1fr; }
  .detail-stage,.draw-stage { min-height:250px; }
  .draw-tools { gap:4px; }
  .draw-tools button { min-height:35px; }
  .draw-status { min-height:30px; }
  .draw-settings { display:grid; }
  #pixel-scale-wrap { grid-column:1/-1; }
}
