/* Studio layout. The existing stylesheet supplies form controls and dialogs. */
body { background: var(--bg); }
header { height: 76px; flex: none; padding: 0 28px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { gap: 12px; }
.brand-icon { width: 38px; height: 38px; border-radius: 10px; }
h1 { font-size: 22px; }
.brand-caption { color: var(--muted); font-size: 11px; margin-top: 5px; }
.store-name { background: var(--surface-muted); border: 0; padding: 9px 16px; }
.layout { grid-template-columns: 398px minmax(0, 1fr); }
.options { display: grid; grid-template-columns: 74px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; border-inline-end: 1px solid var(--line); }
.studio-nav { grid-column: 1; grid-row: 1 / 4; display: flex; flex-direction: column; align-items: stretch; gap: 7px; padding: 18px 8px; border-inline-end: 1px solid var(--line); background: var(--surface-muted); overflow-y: auto; scrollbar-width: none; }
.studio-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; min-height: 62px; flex: none; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font: inherit; font-size: 10px; cursor: pointer; transition: background .18s, color .18s; }
.studio-nav button:hover { color: var(--ink); background: var(--card); }
.studio-nav button[aria-pressed="true"] { background: var(--primary); color: var(--card); }
.studio-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.studio-nav .history-nav { margin-top: auto; }
.inspector-intro { grid-column: 2; grid-row: 1; padding: 25px 22px 20px; }
.inspector-kicker { font-size: 10px; color: var(--muted); margin-bottom: 9px; }
.inspector-intro h2 { font-size: 24px; font-weight: 700; line-height: 1.4; }
.inspector-intro p { font-size: 12px; color: var(--muted); line-height: 1.8; margin-top: 7px; }
.builder { grid-column: 2; grid-row: 2; padding: 0 20px 22px; }
.builder > details { display: none; padding: 0; border: 0; }
.builder > details.studio-active { display: block; }
.builder > details > summary, .builder > details > .section-copy { display: none; }
.advanced-options { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; }
.advanced-options > summary { cursor: pointer; font-size: 14px; color: var(--ink); padding: 12px 0; }
.advanced-options[open] > summary { margin-bottom: 10px; }
.options details[open] { padding: 0; }
.product-summary { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-muted); margin-bottom: 20px; }
.product-summary-title { font-size: 12px; }
.product-summary-icon { width: 32px; height: 32px; background: var(--card); }
.product-summary-action { font-size: 11px; }
.panel-foot { grid-column: 2; grid-row: 3; padding: 16px 20px; }
.generate { background: var(--primary); color: var(--card); border-radius: 12px; font-size: 13px; padding: 14px 10px; box-shadow: none; }
#status:empty { display: none; }
label { font-size: 12px; margin-top: 20px; margin-bottom: 8px; color: var(--ink); }
input[type=text], input[type=tel], select { background: var(--surface-muted); border-color: transparent; border-radius: 9px; padding: 11px 12px; }
.row { gap: 9px; }
.row > div { min-width: 0; }
.segment { border-radius: 10px; background: var(--surface-muted); padding: 3px; gap: 2px; }
.segment button { border: 0; border-radius: 7px; background: transparent; font-size: 11px; }
.segment button.selected { background: var(--card); color: var(--primary); box-shadow: 0 1px 4px #00000012; }
.check { padding: 11px 0; margin: 0; border-bottom: 1px solid var(--line); }
.check input { width: 17px; height: 17px; }
.check label { font-size: 12px; }
.chips { gap: 17px; padding: 8px 4px 20px; }
.paper-options { gap: 8px; }
.paper-opt { font-size: 10px; }
.preview { margin: 20px; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--canvas); }
.canvas { background: var(--canvas); }
.canvas-bar { height: 72px; padding: 0 22px; background: var(--card); border-bottom: 1px solid var(--line); grid-template-columns: 1fr auto; }
.bar-label { font-size: 12px; color: var(--ink); display: flex; flex-direction: column; gap: 5px; }
.bar-label small { color: var(--muted); font-size: 10px; font-weight: 400; }
.page-tabs { position: absolute; bottom: 22px; inset-inline-start: 20px; grid-column: auto; border-radius: 10px; box-shadow: none; }
.page-tabs button { font-size: 11px; padding: 7px 12px; border-radius: 7px; }
.expand-hint { grid-column: 2; font-size: 11px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px; }
.frame-clip { inset: 72px 0 66px; }
.page-navigation { bottom: 16px; justify-content: flex-end; padding-inline: 20px; gap: 6px; }
.page-navigation button { width: 34px; height: 34px; }
.page-navigation span { border: 0; background: transparent; color: var(--muted); padding: 8px; font-size: 11px; }
.canvas.loading::after { top: 92px; bottom: 82px; }
.workspace-format { position: absolute; top: 91px; inset-inline-start: 22px; color: var(--muted); font-size: 10px; direction: ltr; }
@media (max-width: 1100px) and (min-width: 941px) {
  .layout { grid-template-columns: 365px minmax(0, 1fr); }
  .preview { margin: 12px; }
  .page-tabs { inset-inline-start: 10px; }
  .page-tabs button { padding: 7px 8px; }
  .page-navigation { padding-inline: 10px; gap: 3px; }
}
@media (max-width: 940px) {
  body { padding: 0 0 calc(88px + env(safe-area-inset-bottom)); }
  header { height: 66px; padding: 0 18px; }
  h1 { font-size: 19px; }
  .brand-caption { display: none; }
  .layout { gap: 0; }
  .preview { margin: 12px; height: 43dvh; min-height: 300px; border-radius: 14px; }
  .canvas { border: 0; border-radius: 0; }
  .canvas-bar { height: 52px; padding: 0 14px; }
  .canvas-bar .bar-label { display: flex; font-size: 11px; }
  .bar-label small { display: none; }
  .frame-clip { inset: 52px 0 54px; }
  .workspace-format { display: none; }
  .page-tabs { inset-inline-start: 10px; bottom: 12px; padding: 2px; }
  .page-tabs button { padding: 6px 9px; font-size: 10px; }
  .page-navigation { bottom: 11px; padding-inline: 10px; gap: 0; }
  .page-navigation button { width: 30px; height: 32px; }
  .page-navigation span { font-size: 10px; padding: 6px; }
  .options { display: flex; flex-direction: column; background: var(--card); border-top: 1px solid var(--line); }
  .studio-nav { flex-direction: row; padding: 8px 10px; gap: 4px; border-inline-end: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .studio-nav button { min-width: 56px; min-height: 56px; font-size: 9px; gap: 5px; }
  .studio-nav svg { width: 20px; height: 20px; }
  .studio-nav .history-nav { margin: 0; }
  .inspector-intro { padding: 20px 20px 14px; }
  .inspector-kicker { display: none; }
  .inspector-intro h2 { font-size: 21px; }
  .builder { border: 0; border-radius: 0; padding: 0 20px 24px; overflow: visible; }
  .panel-foot { margin: 0; border: 0; border-radius: 0; padding: 0 20px; }
  .export-hint { display: none; }
  .action-bar { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
  .action-bar .generate { font-size: 13px; }
}

/* Legible controls and one clear reading toolbar. */
.inspector-kicker, .brand-caption, .t-description, .workspace-format, .bar-label small { display: none; }
.inspector-intro { padding-top: 20px; padding-bottom: 16px; }
.inspector-intro h2 { font-size: 22px; }
.inspector-intro p:empty { display: none; }
#layout-section > .row { display: block; }
#layout-section > .row label { margin-top: 14px; }
.studio-nav { gap: 10px; }
.studio-nav button { font-size: 12px; }
label, .check label, .segment button, .product-summary-title { font-size: 14px; }
input[type=text], input[type=tel], select { font-size: 14px; min-height: 44px; }
.product-summary-action, .control-hint { font-size: 12px; }
.check { border-bottom: 0; padding: 9px 0; }
#product-picker { width: min(760px, calc(100vw - 24px)); }
#product-picker .product-list { max-height: min(600px, 64dvh); }
.product-row { grid-template-columns: auto 60px minmax(0, 1fr) auto auto; padding: 12px 8px; gap: 12px; }
.product-image { width: 60px; height: 60px; flex: none; }
.product-name { font-size: 15px; line-height: 1.6; color: var(--ink); }
.product-move button { min-width: 30px; min-height: 30px; font-size: 14px; }
.picker-head h2 { font-size: 18px; }
.picker-close { padding: 9px 14px; border-radius: 8px; background: var(--primary-soft); color: var(--ink); font-size: 14px; }
#viewer[open] { padding-top: 64px; box-sizing: border-box; }
#viewer .frame-wrap { height: calc(100dvh - 64px); overflow: auto; direction: ltr; }
.viewer-tools { position: absolute; inset: 0 0 auto; height: 64px; display: flex; align-items: center; justify-content: center; gap: 12px; padding-inline: 90px; background: var(--card); border-bottom: 1px solid var(--line); z-index: 1; }
.viewer-tools button, .viewer-tools select { font: inherit; font-size: 14px; color: var(--ink); border: 0; background: var(--surface-muted); border-radius: 8px; min-height: 40px; padding: 6px 12px; }
.viewer-tools select { width: auto; margin: 0; }
.viewer-tools button:disabled { opacity: .35; }
:is(#text-color, #card-color) { width: 44px; height: 44px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; }
:is(#text-color, #card-color)::-webkit-color-swatch-wrapper { padding: 0; }
:is(#text-color, #card-color)::-webkit-color-swatch { border: 0; border-radius: 6px; }
:is(#text-color, #card-color)::-moz-color-swatch { border: 0; border-radius: 6px; }
:is(#text-color-reset, #card-color-reset) { min-height: 44px; }
#viewer .close { top: 12px; font-weight: 400; }
@media (max-width: 600px) {
  .viewer-tools { justify-content: flex-start; gap: 6px; padding-inline: 12px 80px; }
  .viewer-tools button, .viewer-tools select { font-size: 12px; padding: 6px 8px; }
  .product-row { grid-template-columns: auto 48px minmax(0, 1fr) auto; gap: 8px; }
  .product-image { width: 48px; height: 48px; }
  .product-name { font-size: 14px; }
  .image-number { display: none; }
}
