:root {
  font-family: "Yu Gothic UI", "Hiragino Kaku Gothic ProN", system-ui, sans-serif;
  color: #181818;
  background: #fff;
  --page: #fff;
  --surface: #fff;
  --ink: #181818;
  --muted: #64666a;
  --line: #dbdcde;
  --button: #f3f3f3;
  --selected: #202020;
  --selected-ink: #fff;
  --red: #e51d2d;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background: var(--page); color: var(--ink); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
.logo-color-filter { position: absolute; width: 0; height: 0; overflow: hidden; }
.app-shell { width: min(1220px, 100%); min-height: 100vh; margin: auto; padding: 20px 24px 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 52px; padding: 5px 0 19px; }
.header-brand { display: block; flex: 0 0 auto; width: 168px; max-width: 45vw; height: auto; }
.header-side { display: flex; align-items: center; gap: 12px; }
.language-switch { padding: 3px; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 9px; background: var(--button); }
.language-switch button { min-width: 52px; min-height: 32px; padding: 5px 9px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: .7rem; font-weight: 900; }
.language-switch button.active { color: #fff; background: var(--red); }
.theme-toggle { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--surface); font-size: 1.4rem; }
.workspace { flex: 1; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(330px, .85fr); gap: 34px; align-items: start; }
.site-footer { margin-top: 56px; padding: 24px 0 28px; border-top: 1px solid var(--line); text-align: center; }
.demo-disclaimer { margin: 0 auto 18px; max-width: 60ch; color: var(--muted); font-size: .82rem; line-height: 1.6; }
.footer-brand { display: block; width: 142px; max-width: 55vw; height: auto; margin: 0 auto; }
.preview-panel { position: sticky; top: 18px; min-width: 0; }
.preview-footline { display: flex; justify-content: space-between; gap: 12px; align-items: center; color: var(--muted); font-size: .8rem; }
.preview-footline { padding-top: 10px; }
.fabric { --belt-color: #171717; --preview-bg: #f4f2ef; position: relative; height: clamp(300px, 38vw, 485px); overflow: hidden; border-radius: 12px; background: var(--preview-bg); box-shadow: inset 0 0 0 1px rgba(0,0,0,.1), inset 0 0 30px rgba(0,0,0,.04); }
.fabric[data-orientation="vertical"] { height: clamp(400px, 52vw, 600px); }
.product-art { position: absolute; inset: 50% auto auto 50%; height: auto; overflow: visible; transform: translate(-50%, -50%); filter: none; transition: width .2s ease, transform .25s ease; }
.belt-art { width: 92%; }
.belt-face-left { left: 34.5%; }
.belt-face-right { left: 65.5%; }
.fabric[data-orientation="vertical"] .belt-art { transform: translate(-50%, -50%) rotate(90deg); }
.ozaki-belt-art { display: none; inset: 50% auto auto 50%; transform: translate(-50%, -50%); }
.ozaki-belt-light { fill: url(#ozakiBeltLight); }
.shorinji-logo-tag { position: absolute; z-index: 2; width: clamp(58px, 9vw, 96px); height: clamp(68px, 10vw, 108px); border: 1px solid rgba(0,0,0,.24); border-radius: 3px; background: #fff; transform: translate(-50%, -50%); box-shadow: none; pointer-events: none; }
.shorinji-logo { position: absolute; z-index: 3; width: clamp(38px, 7vw, 72px); max-height: 88px; transform: translate(-50%, -50%); object-fit: contain; pointer-events: none; }
.towel-art { display: none; width: 80%; }
.belt-shadow { fill: rgba(0,0,0,.24); }
.belt-body, .towel-body { fill: var(--belt-color); transition: fill .2s ease; }
.belt-light { fill: url(#beltLight); }
.belt-weave { fill: url(#beltWeave); }
.belt-seam { fill: none; stroke: rgba(255,255,255,.28); stroke-width: 3; stroke-dasharray: 2 4; }
.towel-shadow { fill: rgba(0,0,0,.18); }
.towel-light { fill: url(#towelLight); }
.towel-pile { fill: url(#towelPile); }
.towel-seam { fill: none; stroke: rgba(255,255,255,.34); stroke-width: 5; stroke-dasharray: 3 6; }
.handkerchief-art { display: none; width: 62%; }
.handkerchief-shadow { fill: rgba(0,0,0,.2); }
.handkerchief-body { fill: var(--belt-color); transition: fill .2s ease; }
.handkerchief-light { fill: url(#handkerchiefLight); }
.handkerchief-weave { fill: url(#handkerchiefWeave); }
.handkerchief-seam { fill: none; stroke: rgba(255,255,255,.38); stroke-width: 4; stroke-dasharray: 3 5; }
.product-photo-layer { position: absolute; z-index: 1; inset: 50% auto auto 50%; width: 70%; height: auto; aspect-ratio: 3 / 1; transform: translate(-50%, -50%); filter: none; transition: width .2s ease, height .2s ease, transform .25s ease; }
.belt-shadow, .towel-shadow, .handkerchief-shadow { display: none; }
.ozaki-belt-art g { filter: none; }
.product-photo-layer img, .product-photo-layer span { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.product-photo-layer img { filter: grayscale(.72) contrast(.96) brightness(1.06); }
.product-photo-layer span { display: none; background: var(--belt-color); opacity: .82; mix-blend-mode: multiply; -webkit-mask: var(--product-mask) center / contain no-repeat; mask: var(--product-mask) center / contain no-repeat; }
.product-photo-layer.color-adjustable span { display: block; }
.product-photo-layer.source-color img { filter: none; }
.fabric[data-product="belt"] .product-photo-layer { transform: translate(-50%, -50%); }
#previewCanvas { position: relative; z-index: 2; width: 100%; height: 100%; display: block; }
.controls { min-width: 0; padding-top: 2px; }
.field { display: grid; gap: 9px; }
.field > label, legend, .size-group > label { color: var(--ink); font-size: 1rem; font-weight: 800; }
.text-input-wrap { position: relative; display: block; }
#previewText { width: 100%; min-height: 82px; padding: 13px 16px; resize: vertical; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; box-shadow: inset 0 1px 3px rgba(0,0,0,.04); font-size: 1rem; font-weight: 600; line-height: 1.55; }
.text-input-wrap #previewText { padding-right: 49px; }
#clearText { position: absolute; right: 11px; top: 13px; width: 27px; height: 27px; border: 0; border-radius: 50%; color: #fff; background: var(--muted); font-size: 1.15rem; line-height: 1; }
.field-note { color: var(--muted); font-size: .72rem; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { margin-bottom: 12px; padding: 0; }
.control-group { margin-top: 29px; }
.font-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.font-option { min-height: 57px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--button); text-align: center; transition: border-color .15s ease, background-color .15s ease; }
.font-option:hover { border-color: var(--red); }
.font-option.active { border: 2px solid var(--red); padding: 9px 11px; color: var(--selected-ink); background: var(--selected); }
.font-option strong { display: block; font-size: .94rem; line-height: 1.25; }
.font-option small { display: none; }
.category-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.category-list button { min-height: 58px; padding: 7px; display: grid; place-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--button); }
.category-list button.active { border: 2px solid var(--red); color: #fff; background: var(--red); }
.category-list b { font-size: .8rem; }
.category-list small, .product-option small { font-size: .56rem; font-weight: 900; letter-spacing: .08em; }
.category-list button:not(.active) small { color: var(--red); }
.demo-tag { margin-left: 7px; padding: 3px 6px; border-radius: 5px; color: #fff; background: var(--red); font-size: .58rem; vertical-align: middle; }
.product-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.product-option { min-width: 0; padding: 7px; display: grid; gap: 4px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--surface); text-align: center; font-weight: 800; }
.product-option[hidden] { display: none; }
.product-option.active { border: 2px solid var(--red); padding: 6px; color: var(--ink); background: #fff4f5; }
.product-option small { color: var(--red); }
.layout-template-list button:disabled,
.template-button-grid button:disabled { cursor: not-allowed; opacity: .38; filter: grayscale(1); }
.template-target-label { margin:10px 0; padding:9px 11px; border-left:4px solid var(--red); border-radius:6px; color:var(--ink); background:color-mix(in srgb,var(--red) 7%,var(--surface)); font-size:.78rem; font-weight:900; }
.product-thumb { position: relative; height: 72px; overflow: hidden; display: block; border-radius: 7px; background: color-mix(in srgb, var(--thumb-color) 66%, white); }
.product-thumb img { width: 100%; height: 100%; object-fit: contain; filter: grayscale(1) contrast(.95) brightness(1.04); mix-blend-mode: multiply; }
.registered-product-thumb img { filter: none; mix-blend-mode: normal; }
.vector-thumb { display: grid; place-items: center; }
.belt-vector-thumb::before { width: 82%; height: 25%; border-radius: 5px; background: var(--belt-color, #171717); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 7px 10px rgba(0,0,0,.18); content: ""; }
.dual-text-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dual-text-grid label { display: grid; gap: 6px; font-size: .78rem; font-weight: 900; }
.glyph-box-toggle { min-height: 34px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: var(--button); font-size: .68rem; font-weight: 800; }
.glyph-box-toggle:hover { border-color: var(--red); color: var(--red); }
.single-glyph-box-toggle { width: 100%; min-height: 42px; }
.dual-text-grid textarea { min-width: 0; width: 100%; min-height: 72px; padding: 10px; resize: vertical; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface); font-weight: 700; }
.belt-text-fields[hidden] { display: none; }
.belt-spec-field[hidden] { display: none; }
.belt-spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.belt-spec-grid label { display: grid; gap: 6px; color: var(--ink); font-size: .78rem; font-weight: 900; }
.belt-spec-grid select { width: 100%; min-height: 43px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface); font-weight: 800; }
.belt-spec-summary { margin: 10px 0 6px; padding: 10px 12px; border-left: 4px solid var(--red); border-radius: 6px; background: color-mix(in srgb, var(--red) 7%, var(--surface)); font-size: .78rem; font-weight: 900; }
.glyph-variant-panel { padding: 13px; border: 1px solid color-mix(in srgb, var(--red) 35%, var(--line)); border-radius: 10px; background: color-mix(in srgb, var(--red) 4%, var(--surface)); }
.glyph-variant-heading { display: grid; gap: 2px; margin-bottom: 10px; }
.glyph-variant-heading strong { font-size: .9rem; }
.glyph-variant-heading small { color: var(--muted); font-size: .67rem; }
.glyph-character-strip { display: flex; gap: 7px; overflow-x: auto; padding: 3px 2px 10px; scrollbar-width: thin; }
.glyph-character-box { position: relative; flex: 0 0 52px; min-height: 58px; padding: 5px 3px; display: grid; place-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface); }
.glyph-character-box canvas { width: 46px; height: 46px; }
.glyph-character-box small { max-width: 46px; overflow: hidden; color: var(--muted); font-size: .5rem; text-overflow: ellipsis; white-space: nowrap; }
.glyph-character-box.has-variants::after { position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); content: ""; }
.glyph-character-box.active { border: 2px solid var(--red); padding: 4px 2px; background: color-mix(in srgb, var(--red) 6%, var(--surface)); }
.glyph-candidate-area { padding-top: 10px; border-top: 1px solid var(--line); }
.glyph-selection-summary { margin-bottom: 8px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: .72rem; font-weight: 900; }
.glyph-selection-summary span { color: var(--muted); font-size: .6rem; font-weight: 700; }
.glyph-variant-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.glyph-variant-option { min-width: 0; padding: 7px 5px; display: grid; justify-items: center; gap: 3px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface); }
.glyph-variant-option:hover, .glyph-variant-option.active { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.glyph-variant-option canvas { width: 54px; height: 54px; }
.glyph-variant-option b { font-size: .67rem; }
.glyph-variant-option small { overflow: hidden; max-width: 100%; color: var(--muted); font-size: .55rem; text-overflow: ellipsis; white-space: nowrap; }
.glyph-empty-message { margin: 0; padding: 10px; border-radius: 7px; color: var(--muted); background: var(--button); font-size: .68rem; }
.glyph-search-open { width: 100%; min-height: 44px; margin: 9px 0; border: 1px solid color-mix(in srgb, var(--red) 55%, var(--line)); border-radius: 9px; color: var(--red); background: color-mix(in srgb, var(--red) 6%, var(--surface)); font-weight: 900; }
.quick-text-tools { margin-top: 18px; display: grid; gap: 9px; }
.text-tool-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.text-tool-panel summary { min-height: 58px; padding: 11px 14px; display: flex; justify-content: space-between; gap: 12px; align-items: center; cursor: pointer; list-style: none; }
.text-tool-panel summary::-webkit-details-marker { display: none; }
.text-tool-panel summary span { display: grid; gap: 2px; }
.text-tool-panel summary b { font-size: .86rem; }
.text-tool-panel summary small { color: var(--muted); font-size: .64rem; }
.text-tool-panel summary i { color: var(--red); font-size: 1.25rem; font-style: normal; transition: transform .2s ease; }
.text-tool-panel[open] summary i { transform: rotate(45deg); }
.text-tool-content { padding: 0 14px 14px; border-top: 1px solid var(--line); }
.text-tool-content > p { margin: 11px 0; color: var(--muted); font-size: .68rem; line-height: 1.55; }
.template-button-grid, .phrase-button-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.template-button-grid button, .phrase-button-grid button { min-height: 55px; padding: 8px; display: grid; place-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--button); }
.template-button-grid button:hover, .phrase-button-grid button:hover { border-color: var(--red); }
.template-button-grid button.active { border: 2px solid var(--red); padding: 7px; background: color-mix(in srgb, var(--red) 6%, var(--surface)); }
.template-button-grid b, .phrase-button-grid b { font-size: .86rem; }
.template-button-grid small, .phrase-button-grid small { color: var(--muted); font-size: .55rem; }
.template-lock-preview { margin-top: 12px; padding: 12px; display: flex; align-items: stretch; gap: 7px; border: 1px dashed var(--line); border-radius: 9px; background: var(--button); }
.template-lock-preview[hidden] { display: none; }
.template-lock-preview > span { min-width: 0; flex: 1; padding: 9px 7px; display: grid; place-items: center; gap: 3px; border-radius: 7px; text-align: center; }
.template-lock-preview b { font-size: .82rem; }
.template-lock-preview small { color: var(--muted); font-size: .58rem; }
.locked-segment { border: 1px solid color-mix(in srgb, var(--red) 35%, var(--line)); background: color-mix(in srgb, var(--red) 8%, var(--surface)); }
.editable-segment { border: 1px solid var(--line); background: var(--surface); }
.glyph-search-dialog[hidden] { display: none; }
.glyph-search-dialog { position: fixed; z-index: 100; inset: 0; display: grid; place-items: end center; }
.glyph-search-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(12,16,20,.58); backdrop-filter: blur(3px); }
.glyph-search-sheet { position: relative; width: min(720px, 100%); max-height: min(88vh, 850px); overflow: auto; padding: 13px 20px 22px; border-radius: 20px 20px 0 0; color: var(--ink); background: var(--surface); box-shadow: 0 -18px 50px rgba(0,0,0,.24); }
.glyph-search-handle { width: 48px; height: 5px; margin: 0 auto 13px; border-radius: 999px; background: var(--line); }
.glyph-search-sheet header { display: flex; justify-content: space-between; gap: 15px; align-items: start; }
.glyph-search-sheet header h2 { font-size: 1.12rem; }
.glyph-search-sheet header p { margin: 4px 0 0; color: var(--muted); font-size: .75rem; }
.glyph-search-sheet header button { width: 40px; height: 40px; border: 0; border-radius: 50%; color: var(--ink); background: var(--button); font-size: 1.4rem; }
.glyph-reading-form { margin-top: 17px; display: grid; gap: 7px; font-size: .78rem; font-weight: 900; }
.glyph-reading-form > div { display: grid; grid-template-columns: 1fr 82px; }
.glyph-reading-form input, .glyph-reading-form button { min-height: 48px; border: 1px solid var(--line); }
.glyph-reading-form input { padding: 10px 13px; border-radius: 10px 0 0 10px; color: var(--ink); background: var(--surface); font-size: 1rem; }
.glyph-reading-form button { border-color: var(--red); border-radius: 0 10px 10px 0; color: #fff; background: var(--red); font-weight: 900; }
.glyph-search-message { margin: 12px 0; color: var(--muted); font-size: .75rem; line-height: 1.55; }
.glyph-search-results { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.glyph-search-result { min-width: 0; padding: 9px 5px; display: grid; place-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--surface); }
.glyph-search-result.active { border: 2px solid var(--red); padding: 8px 4px; background: color-mix(in srgb, var(--red) 6%, var(--surface)); }
.glyph-search-result canvas { width: 84px; height: 84px; }
.glyph-search-result b { font: .68rem ui-monospace, monospace; }
.glyph-search-result small { color: var(--muted); font-size: .58rem; }
.glyph-search-confirm { position: sticky; bottom: -22px; margin: 16px -20px -22px; padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: 150px 1fr; gap: 12px; align-items: center; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); }
.glyph-search-confirm > div { display: grid; grid-template-columns: 64px 1fr; grid-template-rows: auto auto; gap: 2px 9px; align-items: center; }
.glyph-search-confirm span { grid-column: 1 / -1; font-size: .62rem; font-weight: 900; }
.glyph-search-confirm canvas { grid-row: 2; width: 58px; height: 58px; }
.glyph-search-confirm small { font: .58rem ui-monospace, monospace; line-height: 1.45; }
.glyph-search-confirm > button { min-height: 54px; border: 0; border-radius: 10px; color: #fff; background: var(--red); font-weight: 900; }
.size-group > label { display: block; margin-bottom: 11px; }
.size-control { display: grid; grid-template-columns: 41px minmax(0, 1fr) 41px 65px; align-items: center; gap: 12px; }
.size-control button { height: 41px; border: 1px solid var(--line); border-radius: 8px; background: var(--button); color: var(--ink); font-size: 1.45rem; line-height: 1; }
.control-group.is-disabled { opacity: .55; }
.control-group.is-disabled input { cursor: not-allowed; }
.size-control button:hover { border-color: var(--red); }
.size-control input { width: 100%; accent-color: var(--red); }
.size-control output { text-align: right; white-space: nowrap; font-size: .9rem; font-weight: 800; }
.line-spacing-control { grid-template-columns: minmax(0, 1fr) 65px; }
.swatches { display: flex; align-items: start; gap: 13px; flex-wrap: wrap; padding: 4px 3px; }
.swatch { width: 54px; min-height: 67px; padding: 0 0 3px; border: 0; border-radius: 0; background: transparent; color: var(--ink); font-size: .58rem; font-weight: 800; line-height: 1.25; text-align: center; }
.swatch::before { content: ""; display: block; width: 43px; height: 43px; margin: 0 auto 5px; border: 1px solid rgba(0,0,0,.14); border-radius: 50%; background: var(--color); }
.swatch.active { outline: 2px solid var(--red); outline-offset: 3px; }
.fabric-swatches .swatch::before { border-radius: 8px; background-image: repeating-linear-gradient(87deg, rgba(0,0,0,.045) 0 1px, transparent 1px 3px); }
.orientation-switch, .product-style-switch { display: grid; gap: 10px; }
.orientation-switch { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.product-style-switch { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.orientation-switch button, .product-style-switch button { min-height: 46px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--button); font-size: .92rem; font-weight: 700; }
.orientation-switch button.active, .product-style-switch button.active { border: 2px solid var(--red); color: var(--selected-ink); background: var(--selected); }
.orientation-switch button:disabled { opacity: .42; cursor: not-allowed; }
.position-field.is-fixed { opacity: .68; }
.position-field.is-fixed .position-switch { pointer-events: none; }
.position-field.is-fixed .position-switch button:not(.active) { opacity: .25; }
.position-switch { position: relative; width: 176px; max-width: 100%; aspect-ratio: 1.45; margin: 4px auto 8px; display: grid; grid-template-columns: repeat(3, 22px); grid-template-rows: repeat(3, 22px); justify-content: space-between; align-content: space-between; }
.position-switch::before { content: ""; position: absolute; inset: 10px; z-index: 0; background: linear-gradient(to right, transparent 0 1%, currentColor 1% 2%, transparent 2% 49%, currentColor 49% 51%, transparent 51% 98%, currentColor 98% 99%, transparent 99%), linear-gradient(to bottom, transparent 0 1%, currentColor 1% 2%, transparent 2% 49%, currentColor 49% 51%, transparent 51% 98%, currentColor 98% 99%, transparent 99%); color: var(--ink); opacity: .65; }
.position-switch button { position: relative; z-index: 1; width: 22px; height: 22px; padding: 0; border: 1.5px solid var(--muted); border-radius: 50%; background: var(--surface); }
.position-switch button.active { border: 5px solid var(--red); background: var(--selected); }
.position-switch.registered-points { width: 100%; aspect-ratio: auto; margin: 4px 0 8px; display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 8px; }
.position-switch.registered-points::before { display: none; }
.position-switch.registered-points button { width: auto; min-height: 38px; height: auto; padding: 7px 12px; border-radius: 8px; color: var(--ink); background: var(--surface); font-size: .76rem; font-weight: 800; }
.position-switch.registered-points button.active { border: 2px solid var(--red); color: var(--selected-ink); background: var(--selected); }
.position-note { display: block; text-align: center; }
#productColorGroup.color-locked { opacity: .58; }
#productColorGroup.color-locked .swatch { cursor: not-allowed; }
#productColorNote { display: block; margin-top: 12px; }
.status-text { margin: 27px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.6; }
.order-meta-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.order-meta-fields label { display: grid; gap: 6px; color: var(--ink); font-size: .78rem; font-weight: 800; }
.order-meta-fields input { min-width: 0; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface); font: inherit; }
.export-actions { margin-top: 24px; padding-top: 22px; display: grid; gap: 9px; border-top: 1px solid var(--line); }
.export-actions button { width: 100%; min-height: 50px; border: 0; border-radius: 9px; background: var(--red); color: #fff; font-weight: 800; font-size: 1rem; }
.order-link { margin: 10px 0 0; padding: 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--surface); font-size: .78rem; line-height: 1.55; word-break: break-all; }
.order-link a { color: inherit; font-weight: 900; }
.export-actions button.secondary { border: 1px solid var(--line); color: var(--ink); background: var(--surface); }
.export-actions button:hover { filter: brightness(.94); }
.export-actions button:disabled { opacity: .5; cursor: wait; }
.order-actions { grid-template-columns: repeat(2,minmax(0,1fr)); }
.order-actions .primary { color: #fff; background: var(--red); }
.file-import-button { position: relative; min-height: 50px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--surface); font-weight: 800; text-align: center; cursor: pointer; }
.file-import-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }
:root[data-theme="dark"] { color-scheme: dark; --page: #141414; --surface: #212121; --ink: #f7f7f7; --muted: #b7b7b7; --line: #414141; --button: #292929; --selected: #202020; --selected-ink: #fff; }
:root[data-theme="dark"] .header-brand, :root[data-theme="dark"] .footer-brand { filter: url(#logo-dark-ink); }
@media (max-width: 850px) {
  /* iOS Safari は 16px 未満の入力欄をタップすると画面を自動拡大する。
     操作中にプレビュー位置を見失わないよう、文字入力系だけを 16px 以上に統一する。 */
  input:not([type="range"]):not([type="checkbox"]):not([type="radio"]),
  textarea,
  select { font-size: 16px !important; }
  .app-shell { --mobile-gutter: 18px; --sticky-header-height: 92px; width: min(620px, 100%); padding: 20px var(--mobile-gutter) 0; }
  .topbar { position: sticky; top: 0; z-index: 30; height: var(--sticky-header-height); min-height: 0; margin: -20px calc(-1 * var(--mobile-gutter)) 0; padding: 20px var(--mobile-gutter) 12px; background: var(--page); }
  .workspace { display: flex; flex-direction: column; gap: 23px; }
  .preview-panel { position: sticky; top: var(--sticky-header-height); z-index: 29; align-self: stretch; width: calc(100% + 2 * var(--mobile-gutter)); margin: 0 calc(-1 * var(--mobile-gutter)); padding: 8px var(--mobile-gutter) 12px; background: var(--page); box-shadow: 0 8px 12px -12px rgba(0,0,0,.35); }
  .preview-footline { min-width: 0; font-size: clamp(.68rem, 2.8vw, .8rem); white-space: nowrap; }
  .controls { width: 100%; }
  .fabric { height: clamp(220px, 44vw, 300px); }
  .fabric[data-orientation="vertical"] { height: clamp(240px, 42dvh, 340px); }
}
@media (max-width: 420px) { .order-meta-fields { grid-template-columns: 1fr; } }
@media (min-width: 851px) {
  html, body { height: 100%; overflow: hidden; }
  .app-shell { height: 100vh; min-height: 0; overflow: hidden; }
  .topbar { flex: 0 0 auto; }
  .workspace { min-height: 0; flex: 1; overflow: hidden; }
  .preview-panel { position: sticky; top: 0; }
  .controls { height: 100%; overflow-y: auto; overscroll-behavior: contain; padding-right: 10px; padding-bottom: 48px; scrollbar-gutter: stable; }
  .site-footer { display: none; }
}
@media (max-width: 480px) {
  .app-shell { --mobile-gutter: 17px; --sticky-header-height: 83px; padding-top: 18px; }
  .topbar { margin-top: -18px; padding-top: 18px; }
  .header-brand { width: 118px; }
  .header-side { gap: 6px; }
  .language-switch button { min-width: 40px; padding-inline: 6px; }
  .theme-toggle { width: 36px; height: 36px; }
  .site-footer { margin-top: 42px; padding: 20px 0 24px; }
  .footer-brand { width: 132px; }
  .fabric { height: 210px; }
  .fabric[data-orientation="vertical"] { height: clamp(240px, 42dvh, 340px); }
  .swatches { justify-content: space-between; gap: 9px; }
  .swatch { width: 48px; min-height: 63px; }
  .swatch::before { width: 40px; height: 40px; }
  .position-switch { width: 164px; }
  .category-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .product-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .glyph-search-sheet { padding-inline: 14px; }
  .glyph-search-results { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .glyph-search-result canvas { width: 72px; height: 72px; }
  .glyph-search-confirm { margin-inline: -14px; padding-inline: 14px; grid-template-columns: 125px 1fr; }
  .order-actions { grid-template-columns: 1fr; }
}
