:root {
  --cream: #f6f0e4;
  --paper: #fffdf8;
  --ink: #172640;
  --muted: #6b7180;
  --red: #ef5943;
  --red-dark: #ca3e31;
  --yellow: #f0b93d;
  --mint: #afd7cb;
  --line: #d7d0c3;
  --shadow: 0 24px 60px rgba(23, 38, 64, .14);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif; line-height: 1.7; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button, label { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.site-header { position: sticky; top: 0; z-index: 30; display: flex; min-height: 68px; align-items: center; justify-content: space-between; padding: 10px max(5vw, 24px); border-bottom: 1px solid rgba(23,38,64,.1); background: rgba(246,240,228,.92); backdrop-filter: blur(14px); }
.brand { display: flex; gap: 10px; align-items: center; font-family: Arial, sans-serif; font-weight: 800; letter-spacing: .06em; text-decoration: none; }
.brand-mark { display: inline-grid; width: 36px; height: 36px; place-items: center; border-radius: 50%; background: var(--red); color: #fff; transform: rotate(-7deg); }
.beta { color: var(--muted); font-family: Arial, sans-serif; font-size: .7rem; font-weight: 800; letter-spacing: .14em; }

.hero { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; min-height: 670px; align-items: center; padding: 78px max(7vw, 30px) 90px; overflow: hidden; }
.hero::before { content: ""; position: absolute; width: 400px; height: 400px; left: -240px; bottom: -180px; border: 72px solid rgba(239,89,67,.09); border-radius: 50%; }
.hero-copy { position: relative; z-index: 2; }
.eyebrow, .section-heading > p { margin: 0; color: var(--red); font-family: Arial, sans-serif; font-size: .72rem; font-weight: 800; letter-spacing: .16em; }
.hero h1 { margin: 12px 0 24px; font-size: clamp(3rem, 5.8vw, 6.2rem); line-height: 1.08; letter-spacing: -.065em; }
.hero h1 span { position: relative; color: var(--red); white-space: nowrap; }
.hero h1 span::after { content: ""; position: absolute; z-index: -1; left: 0; right: 0; bottom: 2%; height: 14%; background: var(--yellow); transform: rotate(-1deg); }
.hero-copy > p:not(.eyebrow):not(.privacy-note) { max-width: 700px; margin: 0 0 32px; color: #3f495b; font-size: 1.05rem; }
#character-upload { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-button, .primary-button { display: inline-flex; min-height: 56px; align-items: center; justify-content: center; gap: 24px; padding: 13px 28px; border: 0; border-radius: 999px; background: var(--red); color: #fff; box-shadow: 0 12px 28px rgba(239,89,67,.24); font-weight: 800; text-decoration: none; cursor: pointer; transition: transform .2s, background .2s; }
.upload-button:hover, .primary-button:hover { background: var(--red-dark); transform: translateY(-2px); }
.primary-button:disabled { cursor: not-allowed; opacity: .48; transform: none; }
.upload-button:focus-within, .primary-button:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.privacy-note { margin: 10px 0 0 !important; color: var(--muted) !important; font-size: .72rem !important; }
.privacy-note span { color: #3d9b75; }
.hero-sticker { position: relative; width: min(72%, 380px); aspect-ratio: 1; margin: auto; border: 4px solid var(--ink); border-radius: 50%; background: var(--yellow); box-shadow: 22px 22px 0 var(--red); transform: rotate(7deg); }
.hero-sticker::before, .hero-sticker::after { content: ""; position: absolute; border: 3px solid var(--ink); border-radius: 50%; }
.hero-sticker::before { inset: 12%; }
.hero-sticker::after { inset: 25%; background: var(--mint); }
.hero-sticker > b { position: absolute; z-index: 2; inset: 0; display: grid; place-items: center; color: var(--ink); font-family: Arial, sans-serif; font-size: clamp(3rem, 6vw, 5.5rem); line-height: .82; text-align: center; }
.hero-sticker > span { position: absolute; z-index: 4; padding: 5px 12px; border: 2px solid var(--ink); background: var(--paper); font-family: Arial, sans-serif; font-size: .68rem; font-weight: 800; letter-spacing: .12em; }
.hero-sticker > span:nth-child(1) { left: -8%; top: 20%; transform: rotate(-12deg); }
.hero-sticker > span:nth-child(2) { right: -11%; top: 38%; transform: rotate(9deg); }
.hero-sticker > span:nth-child(3) { left: 8%; bottom: 7%; transform: rotate(4deg); }

.fitting { padding: 24px max(5vw, 24px) 90px; background: var(--paper); }
.section-heading { width: min(1220px, 100%); margin: 0 auto 46px; }
.section-heading h2 { margin: 8px 0 12px; font-size: clamp(2.1rem, 4vw, 4rem); line-height: 1.22; letter-spacing: -.055em; }
.section-heading > p:last-child { margin: 0; color: var(--muted); }
.workspace { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(320px, .7fr); width: min(1220px, 100%); margin: auto; gap: 22px; align-items: start; }
.preview-column { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--cream); }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-family: Arial, sans-serif; font-size: .72rem; font-weight: 800; letter-spacing: .12em; }
.preview-size-toggle { display: none; min-height: 32px; padding: 5px 10px; border: 1px solid var(--ink); border-radius: 999px; background: var(--paper); color: var(--ink); font-size: .75rem; font-weight: 700; letter-spacing: 0; cursor: pointer; }
.background-switch { display: flex; gap: 6px; }
.background-switch button { display: grid; width: 34px; height: 34px; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; cursor: pointer; }
.background-switch button[data-bg="checker"] { background: conic-gradient(#d8d8d8 25%, #fff 0 50%, #d8d8d8 0 75%, #fff 0) 0 0 / 12px 12px; }
.background-switch button[data-bg="white"] { background: #fff; }
.background-switch button[data-bg="black"] { background: #000; }
.background-switch button.active { border-color: var(--red); box-shadow: 0 0 0 2px rgba(239,89,67,.2); }
.preview-stage { position: relative; width: 100%; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 16px; touch-action: none; user-select: none; }
.preview-stage.bg-checker { background-color: #fff; background-image: linear-gradient(45deg,#e7e1d7 25%,transparent 25%),linear-gradient(-45deg,#e7e1d7 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#e7e1d7 75%),linear-gradient(-45deg,transparent 75%,#e7e1d7 75%); background-size: 30px 30px; background-position: 0 0,0 15px,15px -15px,-15px 0; }
.preview-stage.bg-white { background: #fff; }
.preview-stage.bg-black { background: #000; }
#character-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transform-origin: center; pointer-events: none; }
.character-empty { position: absolute; z-index: 7; left: 50%; top: 50%; display: grid; min-width: min(78%, 320px); gap: 3px; padding: 15px 18px; border: 1px solid rgba(23,38,64,.18); border-radius: 14px; background: rgba(255,253,248,.9); box-shadow: 0 10px 30px rgba(23,38,64,.1); text-align: center; transform: translate(-50%, -50%); pointer-events: none; backdrop-filter: blur(6px); }
.character-empty strong { font-size: .88rem; }
.character-empty span { color: var(--muted); font-size: .68rem; }
.character-empty[hidden] { display: none; }
#material-layer { position: absolute; z-index: 5; inset: 0; pointer-events: none; }
.material-overlay { position: absolute; left: 50%; top: 50%; width: 52%; transform-origin: center; cursor: grab; filter: none; pointer-events: auto; }
.material-overlay:active { cursor: grabbing; }
.demo-label { position: absolute; z-index: 8; left: 12px; bottom: 12px; padding: 4px 9px; border-radius: 999px; background: rgba(23,38,64,.78); color: #fff; font-size: .65rem; font-weight: 700; pointer-events: none; }
.mobile-hint { display: none; margin-top: 10px; color: var(--muted); text-align: center; font-size: .72rem; }

.control-panel { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--cream); }
.panel-section { min-width: 0; padding: 24px; border-bottom: 1px solid var(--line); }
.panel-section:last-child { border-bottom: 0; }
.panel-title { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.panel-title span { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: var(--ink); color: #fff; font-family: Arial, sans-serif; font-size: .72rem; font-weight: 800; }
.panel-title h3 { margin: 0; font-size: .96rem; }
.panel-upload { width: 100%; min-height: 50px; padding: 11px 18px; font-size: .82rem; box-shadow: none; }
.character-controls { margin-top: 18px; padding-top: 13px; border-top: 1px dashed var(--line); }
.character-reset { width: 100%; min-height: 40px; margin-top: 6px; border: 1px solid var(--ink); border-radius: 99px; background: transparent; color: var(--ink); font-size: .72rem; font-weight: 700; cursor: pointer; }
.character-reset:hover { background: var(--ink); color: #fff; }
.selection-help { margin: -5px 0 12px; color: var(--muted); font-size: .875rem; line-height: 1.55; }
.selected-materials-bar { margin-top: 10px; }
.selected-materials-heading { margin: 0 0 4px; font-size: .875rem; font-weight: 700; }
.selected-materials-heading span { margin-left: 6px; color: var(--red-dark); }
.selected-materials { display: flex; gap: 7px; padding: 2px 2px 6px; margin: 0; overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--red) transparent; }
.selected-chip { display: flex; flex: 0 0 auto; min-width: 0; align-items: stretch; overflow: hidden; border: 1px solid var(--ink); border-radius: 999px; background: var(--paper); }
.selected-chip.active { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.selected-chip-name, .selected-chip-remove { border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.selected-chip-name { max-width: 180px; min-height: 40px; padding: 7px 7px 7px 13px; overflow: hidden; font-size: .875rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.selected-chip.active .selected-chip-name { color: var(--red-dark); }
.selected-chip-remove { width: 40px; min-height: 40px; padding: 0; color: var(--red-dark); font-size: 1rem; font-weight: 800; }
.selected-chip-remove:hover, .selected-chip-remove:focus-visible { background: var(--red); color: #fff; }
.selected-materials-empty { margin: 0; min-height: 40px; display: flex; align-items: center; color: var(--muted); font-size: .875rem; }
.category-filters { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; }
.category-filters button { flex: 0 0 auto; min-height: 42px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); font: inherit; font-size: .875rem; cursor: pointer; }
.category-filters button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.catalog-count { margin: 4px 0 10px; font-size: .875rem; color: var(--muted); }
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.product-card { position: relative; min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); text-align: left; cursor: pointer; }
.product-card img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 8px; background: #f2ece1; }
.product-name { display: block; margin-top: 7px; font-size: .875rem; line-height: 1.5; font-weight: 700; overflow-wrap: anywhere; }
.product-detail { display: block; margin-top: 4px; font-size: .8125rem; color: var(--muted); }
.product-selected { display: inline-block; margin-top: 5px; padding: 2px 6px; border-radius: 6px; background: var(--ink); color: white; font-size: .8125rem; }
.product-card.selected { border-color: var(--ink); }
.product-card:hover { border-color: var(--red); }
.catalog-back { min-height: 44px; margin-bottom: 12px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); font: inherit; font-size: .875rem; cursor: pointer; }
.variant-title { margin: 0 0 14px; font-size: 1rem; }
.product-card[hidden], .product-selected[hidden], .material-card[hidden], #product-browser[hidden], #variant-browser[hidden] { display: none; }
.category-filters button:focus-visible, .product-card:focus-visible, .material-card:focus-visible, .catalog-back:focus-visible, .selected-chip button:focus-visible { outline: 3px solid var(--red-dark); outline-offset: 2px; }
.material-grid { display: grid; grid-template-columns: 1fr 1fr; max-height: 490px; gap: 9px; padding-right: 5px; overflow-y: auto; scrollbar-color: var(--red) transparent; }
.material-card { position: relative; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); cursor: pointer; }
.material-card img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 8px; background: #f2ece1; }
.material-card span { display: block; padding: 5px 2px 1px; font-size: .875rem; font-weight: 700; }
.material-card.selected { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.material-card.selected::after { content: "✓"; position: absolute; top: 13px; right: 13px; display: grid; width: 23px; height: 23px; place-items: center; border-radius: 50%; background: var(--ink); color: #fff; font-size: .72rem; font-weight: 800; }
.material-card.active { border-color: var(--red); box-shadow: inset 0 0 0 2px var(--red); color: var(--red-dark); }
.material-card.active::after { background: var(--red); }
.demo-warning { margin: 10px 0 0; color: var(--muted); font-size: .67rem; }
.range-row { display: block; margin: 13px 0; }
.range-row > span { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: .76rem; font-weight: 700; }
.range-row output { color: var(--red); }
.range-row input { width: 100%; accent-color: var(--red); cursor: pointer; }
.small-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.small-actions button { min-height: 42px; border: 1px solid var(--ink); border-radius: 99px; background: transparent; color: var(--ink); font-size: .73rem; font-weight: 700; cursor: pointer; }
.small-actions button:hover { background: var(--ink); color: #fff; }
.small-actions button:disabled, .range-row input:disabled { cursor: not-allowed; opacity: .4; }
.export-section > p { margin: -5px 0 14px; color: var(--muted); font-size: .76rem; }
.export-section .primary-button, .shop-button { width: 100%; min-height: 50px; }
.export-section .save-help { margin: 7px 2px 12px; color: var(--muted); font-size: .67rem; line-height: 1.55; }
.shop-button { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 8px; border: 2px solid var(--ink); border-radius: 99px; font-size: .78rem; font-weight: 800; text-decoration: none; }
.shop-button:hover { background: var(--ink); color: #fff; }
#status-message { min-height: 1.5em; margin: 7px 0 0; color: #2d805e; text-align: center; font-size: .7rem; }

.trial-note { display: flex; align-items: baseline; gap: 18px; padding: 20px max(5vw, 24px); border-top: 1px solid var(--line); background: var(--cream); color: var(--ink); }
.trial-note strong { flex: 0 0 auto; font-size: .875rem; }
.trial-note p { max-width: 880px; margin: 0; color: var(--muted); font-size: .875rem; line-height: 1.65; }

footer { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 28px max(5vw,24px); background: var(--paper); color: var(--muted); font-size: .72rem; }
footer p { margin: 0; }

@media (min-width: 931px) {
  .preview-column, .control-panel { position: sticky; top: 84px; align-self: start; }
  .preview-toolbar, .preview-stage { width: min(100%, calc(80vh - 192px)); margin-right: auto; margin-left: auto; }
  .control-panel { max-height: calc(100vh - 104px); overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; scrollbar-color: var(--red) transparent; }
}

@media (max-width: 930px) {
  .workspace { grid-template-columns: 1fr; }
  .control-panel { display: grid; grid-template-columns: 1fr 1fr; }
  .panel-section { border-right: 1px solid var(--line); }
  .panel-section:nth-child(even) { border-right: 0; }
}

@media (max-width: 640px), (max-width: 930px) and (max-height: 600px) {
  .site-header { min-height: 60px; }
  .beta { font-size: .58rem; }
  .brand-mark { width: 32px; height: 32px; }
  .fitting { padding: 12px 10px 72px; }
  .workspace { gap: 10px; }
  .preview-column { position: sticky; z-index: 20; top: 60px; align-self: start; padding: 9px; border-radius: 16px; box-shadow: 0 10px 24px rgba(23,38,64,.16); }
  .preview-toolbar, .preview-stage { width: min(100%, 34svh, 340px); margin-right: auto; margin-left: auto; }
  .preview-toolbar { width: 100%; margin-bottom: 4px; }
  .preview-size-toggle { display: inline-block; }
  .preview-column.is-compact .preview-stage { width: min(100%, 25svh, 248px); margin-right: auto; margin-left: auto; }
  .background-switch button { width: 28px; height: 28px; }
  .preview-stage { border-radius: 10px; }
  .mobile-hint { display: block; margin-top: 3px; font-size: .65rem; }
  .selected-materials-bar { margin-top: 4px; }
  .selected-materials-heading { margin-bottom: 0; font-size: .8125rem; }
  .material-grid { max-height: none; overflow: visible; padding-right: 0; }
  .control-panel { display: block; }
  .panel-section { border-right: 0; }
  .panel-section { padding: 22px 16px; }
  .trial-note { display: block; padding: 20px; }
  .trial-note p { margin-top: 5px; }
  footer { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
#catalog-status { font-size: 13px; color: var(--muted); margin-top: 12px; }
#catalog-status button { display: block; margin-top: 8px; padding: 10px 14px; border-radius: 8px; background: white; border: 1px solid #d9dce4; font: inherit; cursor: pointer; }
.admin-link { font-size: 12px; color: #6e7380; }

/* Small screens keep the preview visible while a single tool drawer scrolls. */
.preview-frame { min-width: 0; }
.mobile-nav, .mobile-upload, .mobile-sheet-header, .mobile-adjust-target, .mobile-feedback, .mobile-about { display: none; }
.panel-section[hidden] { display: none !important; }
@media (max-width: 640px), (max-width: 930px) and (max-height: 600px) {
  body { height: 100svh; height: 100dvh; overflow: hidden; }
  .site-header { position: relative; min-height: 48px; height: 48px; padding: 6px 14px; }
  .site-header .brand { font-size: .85rem; }
  .site-header .brand-mark { width: 28px; height: 28px; }
  .site-header .beta { font-size: .5rem; }
  main { height: calc(100svh - 112px - env(safe-area-inset-bottom, 0px)); height: calc(100dvh - 112px - env(safe-area-inset-bottom, 0px)); }
  .fitting { height: 100%; padding: 8px 8px 0; }
  .workspace { height: 100%; display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(0,1fr) auto; gap: 8px; }
  .preview-column { position: relative; top: auto; height: 100%; min-height: 0; padding: 8px; display: grid; grid-template-rows: auto minmax(0,1fr) auto; gap: 3px; align-self: stretch; border-radius: 14px; box-shadow: none; overflow: hidden; }
  .preview-toolbar { width: 100%; min-width: 0; margin: 0; min-height: 36px; gap: 8px; }
  .preview-caption, .preview-size-toggle { display: none; }
  .mobile-upload { display: inline-flex; align-items: center; min-height: 36px; padding: 5px 12px; border: 1px solid var(--ink); border-radius: 99px; background: var(--paper); font-family: inherit; font-size: .75rem; letter-spacing: 0; cursor: pointer; }
  .mobile-upload:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
  .background-switch { margin-left: auto; }
  .background-switch button { width: 32px; height: 32px; }
  .preview-frame { display: flex; justify-content: center; align-items: center; min-height: 0; overflow: hidden; }
  .preview-stage, .preview-column.is-compact .preview-stage { width: min(100%, calc(var(--preview-frame-height, 45dvh) * .8)); aspect-ratio: 4 / 5; height: auto; margin: 0; flex: 0 0 auto; border-radius: 10px; }
  .mobile-hint { display: none; }
  .selected-materials-bar { display: flex; align-items: center; gap: 6px; margin: 0; min-width: 0; }
  .selected-materials-heading { flex: 0 0 auto; width: 42px; margin: 0; font-size: .65rem; line-height: 1.3; }
  .selected-materials { flex: 1; min-width: 0; padding: 2px; gap: 5px; }
  .selected-chip-name { min-height: 36px; max-width: 170px; font-size: .72rem; }
  .selected-chip-remove { min-height: 36px; width: 40px; }
  .selected-materials-empty { min-height: 36px; font-size: .72rem; }
  .mobile-feedback { position: absolute; z-index: 10; bottom: 52px; left: 12px; right: 12px; padding: 6px 10px; border-radius: 8px; background: rgba(255,253,248,.96); pointer-events: none; display: block; font-size: .65rem; line-height: 1.4; margin: 0; color: #286647; text-align: center; overflow-wrap: anywhere; }
  .mobile-feedback:empty { display: none; }
  .control-panel { display: none; position: relative; min-height: 0; height: min(28dvh, 230px); max-height: none; overflow-y: auto; overscroll-behavior: contain; border-radius: 16px 16px 0 0; scrollbar-gutter: auto; }
  .workspace.has-mobile-panel .control-panel { display: block; }
  .mobile-sheet-header { position: sticky; z-index: 2; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 14px; background: var(--cream); border-bottom: 1px solid var(--line); }
  .mobile-sheet-header h2 { font-size: .85rem; margin: 0; }
  .mobile-sheet-header button { min-height: 36px; padding: 6px 12px; font-size: .75rem; border: 1px solid var(--line); border-radius: 99px; background: var(--paper); cursor: pointer; }
  .mobile-adjust-target { display: flex; padding: 8px 14px 0; gap: 8px; }
  .mobile-adjust-target[hidden] { display: none; }
  .mobile-adjust-target button { min-height: 36px; padding: 5px 20px; border: 1px solid var(--line); border-radius: 99px; background: var(--paper); font-size: .78rem; cursor: pointer; }
  .mobile-adjust-target button[aria-pressed="true"] { background: var(--ink); color: white; }
  .panel-section { padding: 10px 14px 16px; border: 0; }
  .panel-title { display: none; }
  .selection-help { font-size: .72rem; margin: 0 0 8px; }
  .category-filters button { min-height: 36px; padding: 5px 12px; font-size: .75rem; }
  .catalog-count { font-size: .72rem; margin: 0 0 6px; }
  .product-grid, .material-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
  .product-card, .material-card { padding: 6px; }
  .product-name, .material-card span { font-size: .72rem; line-height: 1.4; }
  .product-detail, .product-selected { font-size: .65rem; }
  .range-row { margin: 8px 0 16px; }
  .range-row > span { font-size: .8rem; }
  .range-row input { height: 28px; }
  [data-mobile-panel="character"] .panel-upload, [data-mobile-panel="character"] .privacy-note { display: none; }
  .panel-upload { width: 100%; min-height: 42px; font-size: .8rem; }
  .privacy-note { font-size: .65rem !important; }
  .small-actions { margin-top: 10px; }
  .mobile-about { display: block; font-size: .72rem; margin-top: 14px; }
  .mobile-about p { color: var(--muted); }
  .trial-note, footer { display: none; }
  .mobile-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); height: calc(64px + env(safe-area-inset-bottom, 0px)); padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); gap: 6px; border-top: 1px solid var(--line); background: var(--cream); }
  .mobile-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 0; border: 1px solid transparent; border-radius: 10px; background: var(--paper); color: var(--ink); font-size: .75rem; font-weight: 700; cursor: pointer; }
  .mobile-nav button span { font-size: 1.1rem; line-height: 1.1; }
  .mobile-nav button[aria-expanded="true"] { border-color: var(--red); color: var(--red-dark); background: #fff0eb; }
}
@media (max-width: 930px) and (max-height: 500px) {
  .workspace.has-mobile-panel { grid-template-columns: minmax(0,1fr) minmax(240px, 42%); grid-template-rows: minmax(0,1fr); }
  .control-panel { height: 100%; border-radius: 14px; }
  .preview-column { grid-template-rows: auto minmax(0,1fr) auto; }
  .mobile-hint { display: none; }
  .product-grid, .material-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

.gesture-help, .gesture-help[hidden] { display: none; }
.preview-stage.is-character-adjust { cursor: grab; }
.preview-stage.is-character-adjust:active { cursor: grabbing; }
.preview-stage.is-character-adjust .material-overlay { pointer-events: none; }
@media (max-width: 640px), (max-width: 930px) and (max-height: 600px) {
  .workspace.has-mobile-panel .gesture-help:not([hidden]) { display: block; margin: 6px 14px 0; color: var(--muted); font-size: .65rem; }
}

/* Transparent brand logo: high-density image with reserved layout space. */
.site-header .brand-logo { display:block; width:48px; height:48px; flex-shrink:0; object-fit:contain; }
@media (max-width: 640px), (max-width: 930px) and (max-height: 600px) { .site-header .brand-logo { width:36px; height:36px; } }
