/* Studio: three-pane app layout (settings · preview · colours). */
.studio-page { height: 100dvh; overflow: hidden; }
.studio-top { height: 58px; display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.studio-top .brand { font-size: 1.1rem; }
.top-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.studio {
  height: calc(100dvh - 58px);
  display: grid; grid-template-columns: 320px minmax(0, 1fr) 340px;
}
.panel { overflow-y: auto; background: var(--surface); }
.controls { border-right: 1px solid var(--line); padding: 6px 0 40px; }
.palette { border-left: 1px solid var(--line); display: flex; flex-direction: column; }

.sec { border-bottom: 1px solid var(--line); }
.sec summary { list-style: none; cursor: pointer; padding: 14px 18px; font-weight: 700; display: flex; align-items: center; gap: 10px; user-select: none; }
.sec summary::-webkit-details-marker { display: none; }
.sec summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s; }
.sec[open] summary::after { transform: rotate(-135deg); }
.sec .num { width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 12px; }
.sec-body { padding: 0 18px 16px; }
.field output { float: right; color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.seg.wide { display: flex; margin-bottom: 14px; }
.seg.wide button { flex: 1; }
.check { display: block; margin: 10px 0; font-size: 14px; }
.check input { margin: 0 8px 0 0; vertical-align: -2px; }
.field.disabled { opacity: .5; }
.info { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; color: var(--ink-2); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .two { grid-template-columns: 1fr; } }

.drop { display: grid; justify-items: center; gap: 4px; text-align: center; border: 2px dashed var(--line); border-radius: var(--radius); padding: 20px 12px; cursor: pointer; transition: .15s; background: var(--bg); }
.drop svg { width: 30px; height: 30px; color: var(--accent); }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.file-info { margin: 8px 0; min-height: 1em; }
.notice { margin: 0 0 10px; line-height: 1.4; }
.samples-label { margin: 6px 0; }
.samples { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.samples button { padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; aspect-ratio: 1; cursor: pointer; background: var(--surface-2); }
.samples button:hover { border-color: var(--accent); }
.samples img { width: 100%; height: 100%; object-fit: cover; display: block; }

.custom-size { display: grid; grid-template-columns: 1fr 1fr 80px; gap: 8px; }
.crop-wrap { margin-bottom: 12px; }
.crop-wrap canvas { width: 100%; height: auto; border-radius: 8px; background: var(--surface-2); touch-action: none; cursor: grab; display: block; margin-bottom: 4px; }

.paint-list { display: grid; gap: 6px; margin-bottom: 10px; }
.paint-row { display: grid; grid-template-columns: 30px 1fr 28px; gap: 8px; align-items: center; }
.paint-row input[type="color"] { width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 50%; overflow: hidden; background: none; cursor: pointer; }
.paint-row input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.paint-row input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.paint-row input[type="text"] { min-height: 32px; padding: 4px 8px; font-size: 13px; }
.paint-row button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; }

/* Stage */
.stage { position: relative; display: flex; flex-direction: column; background: var(--surface-3); min-width: 0; }
.stage-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; flex-wrap: wrap; }
.stage-bar .seg { background: var(--surface); }
.zoom-ctl { display: flex; gap: 2px; background: var(--surface); border-radius: 999px; padding: 2px; }
.viewport { position: relative; flex: 1; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.viewport:active { cursor: grabbing; }
.viewport.dragging-divider, .viewport.dragging-divider:active { cursor: ew-resize; }
.paper { position: absolute; left: 50%; top: 50%; background: #fff; box-shadow: var(--shadow-lg); transform-origin: 0 0; }
.paper .art, .paper .orig { position: absolute; pointer-events: none; -webkit-user-drag: none; }
.paper .orig { z-index: 1; }
.paper .art { z-index: 2; }
.paper .art svg { width: 100%; height: 100%; display: block; }
.paper .orig { object-fit: fill; }
.compare-handle { position: absolute; z-index: 3; top: 0; bottom: 0; width: 0; border-left: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); cursor: ew-resize; }
.compare-handle::after { content: ""; position: absolute; top: 0; bottom: 0; left: -14px; width: 28px; }
.compare-handle span { position: absolute; top: 50%; left: -17px; width: 32px; height: 32px; margin-top: -16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow); }
.compare-handle span::before { content: "⇆"; display: grid; place-items: center; height: 100%; color: var(--ink); font-weight: 700; }
.empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; }
.empty-card { max-width: 420px; text-align: center; background: var(--surface); padding: 32px 28px; border-radius: 22px; box-shadow: var(--shadow-lg); }
.empty-card h2 { font-size: 1.7rem; margin-top: 10px; }
.progress { position: absolute; inset: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--surface-3) 55%, transparent); }
.progress-card { display: flex; gap: 14px; align-items: center; background: var(--surface); padding: 16px 20px; border-radius: 16px; box-shadow: var(--shadow-lg); min-width: 280px; }
.progress .bar { height: 6px; border-radius: 6px; background: var(--surface-2); margin-top: 8px; overflow: hidden; }
.progress .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.focus-info { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 999px; display: flex; gap: 10px; align-items: center; }
.focus-info button { background: none; border: 0; color: inherit; cursor: pointer; text-decoration: underline; font: inherit; }

/* Palette */
.pal-head { padding: 16px 18px 10px; border-bottom: 1px solid var(--line); }
.pal-head h3 { margin: 0 0 4px; font-size: 1.15rem; }
.pal-list { list-style: none; margin: 0; padding: 8px; display: grid; gap: 6px; }
.pal-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--surface); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.pal-item:hover { border-color: var(--muted); }
.pal-item.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pal-top { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; }
.pal-sw { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 17px; border: 1px solid rgba(0,0,0,.08); }
.pal-name { font-weight: 700; line-height: 1.2; }
.pal-meta { font-size: 12px; color: var(--muted); }
.q { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.q.A\+, .q.A { background: #dff1e6; color: var(--ok); }
.q.B { background: #eaf2d9; color: #5b7a1e; }
.q.C { background: #fbefd7; color: var(--warn); }
.q.D { background: #f9dede; color: var(--bad); }
.recipe-line { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; margin-top: 8px; font-size: 12px; color: var(--ink-2); }
.ri { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.dollop { display: inline-grid; place-items: center; border-radius: 50%; font-weight: 800; font-size: 11px; border: 1px solid rgba(0,0,0,.12); flex: none; }
.plus { color: var(--muted); }
.mix-arrow { color: var(--muted); margin-left: 2px; }
.mini-sw { width: 18px; height: 18px; border-radius: 5px; border: 1px solid rgba(0,0,0,.12); display: inline-block; vertical-align: middle; }
.pal-actions { display: flex; gap: 6px; margin-top: 8px; }
.pal-actions .btn { min-height: 30px; font-size: 12px; padding: 0 10px; }
.alt-recipes { margin-top: 6px; font-size: 12px; color: var(--muted); }
.shopping { margin: 6px 12px 24px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.shopping h4 { margin: 0 0 6px; }
.shopping ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 13px; }
.shopping li { display: flex; align-items: center; gap: 8px; }
.shopping li b { margin-left: auto; font-variant-numeric: tabular-nums; }

/* Dialog content */
.export-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.export-opt { text-align: left; display: grid; gap: 4px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; font: inherit; }
.export-opt:hover { border-color: var(--accent); background: var(--accent-soft); }
.export-opt span { font-size: 13px; color: var(--ink-2); }
@media (max-width: 560px) { .export-grid { grid-template-columns: 1fr; } }
.mix-swatches { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sw.big { height: 90px; border-radius: 14px; border: 1px solid var(--line); margin-bottom: 6px; }
.sw.big.unset { background: repeating-linear-gradient(45deg, var(--surface-2) 0 10px, var(--surface) 10px 20px); }
.mix-canvas { width: 100%; border-radius: 10px; margin-top: 8px; cursor: crosshair; touch-action: none; }
.cam-wrap { position: relative; border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 4/3; }
.cam-wrap video { width: 100%; height: 100%; object-fit: cover; display: block; }
.reticle { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 2px rgba(0,0,0,.4); }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; align-items: center; }
.mix-result { margin-top: 12px; padding: 14px; border-radius: 12px; background: var(--surface-2); }
.mix-result .score { display: flex; align-items: baseline; gap: 10px; }
.mix-result .score b { font-size: 1.6rem; font-family: var(--font-display); }
.mix-result ul { margin: 8px 0 0; padding-left: 18px; }
.help ol { padding-left: 20px; display: grid; gap: 8px; }

.mobile-tabs { display: none; }
@media (max-width: 1100px) {
  .studio { grid-template-columns: 300px minmax(0, 1fr); }
  .palette { display: none; }
  .studio[data-tab="palette"] .palette { display: flex; position: absolute; right: 0; top: 58px; bottom: 0; width: min(360px, 100%); z-index: 20; box-shadow: var(--shadow-lg); }
  .mobile-tabs { display: flex; position: fixed; right: 16px; bottom: 16px; z-index: 30; gap: 4px; background: var(--surface); padding: 4px; border-radius: 999px; box-shadow: var(--shadow-lg); }
  .mobile-tabs button { border: 0; background: none; font: 600 13px var(--font-ui); padding: 9px 14px; border-radius: 999px; color: var(--ink-2); cursor: pointer; }
  .mobile-tabs button[data-tab="controls"] { display: none; }
  .studio[data-tab] .mobile-tabs button.on { background: var(--accent); color: #fff; }
}
@media (max-width: 760px) {
  .studio { grid-template-columns: 1fr; grid-template-rows: 1fr; }
  .controls, .stage, .palette { grid-area: 1 / 1; }
  .controls, .palette { display: none; }
  .studio[data-tab="controls"] .controls { display: block; }
  .studio[data-tab="controls"] .stage { visibility: hidden; }
  .studio[data-tab="palette"] .palette { display: flex; position: static; width: auto; box-shadow: none; }
  .studio[data-tab="palette"] .stage { visibility: hidden; }
  .mobile-tabs { left: 50%; right: auto; transform: translateX(-50%); }
  .mobile-tabs button[data-tab="controls"] { display: inline-block; }
  .hide-sm, .studio-badge { display: none; }
  .top-actions .btn { padding: 0 10px; }
  #btnKit { display: none; }
  .controls { padding-bottom: 90px; }
  .focus-info { bottom: 74px; max-width: calc(100% - 24px); }
  .pal-list { padding-bottom: 90px; }
}

/* Pop-art style */
.pop-schemes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.pop-schemes button { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font: 600 12px var(--font-ui); cursor: pointer; text-align: left; }
.pop-schemes button[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); color: var(--ink); }
.pop-schemes .dots { display: flex; }
.pop-schemes .dots i { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--surface); margin-left: -4px; }
.pop-schemes .dots i:first-child { margin-left: 0; }
.link-btn { background: none; border: 0; padding: 0; color: var(--teal); font: inherit; text-decoration: underline; cursor: pointer; }
.paint-note { background: var(--surface-2); border-radius: var(--radius-sm); padding: 9px 11px; margin: -4px 0 12px; color: var(--ink-2); }
.paint-note a { display: block; margin-top: 4px; font-weight: 600; }
.controls .made-by { padding: 14px 18px 0; margin: 0; }

/* Step 7: what you'll need */
.need-ctx { display: grid; gap: 4px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13px; margin-bottom: 10px; }
.need-ctx span { color: var(--ink-2); font-size: 12px; line-height: 1.45; }
.need-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 12px; }
.need { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.need.have { opacity: .55; }
.need.have .need-title > span:first-child { text-decoration: line-through; }
.need-ico { width: 34px; height: 34px; border-radius: 9px; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; }
.need-ico.warn { background: color-mix(in srgb, var(--warn) 16%, var(--surface)); color: var(--warn); }
.need-ico svg { width: 20px; height: 20px; }
.need-main { display: grid; gap: 5px; min-width: 0; }
.need-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-weight: 600; font-size: 14px; }
.need-flag { flex-shrink: 0; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, var(--surface)); padding: 2px 7px; border-radius: 999px; }
.need-why { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.45; }
.need-bars { display: grid; gap: 6px; padding: 2px 0; }
.need-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 8px; font-size: 12px; }
.need-bar > span { display: flex; align-items: center; gap: 6px; min-width: 0; }
.need-bar b { font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.need-bar.over b { color: var(--bad); }
.need-bar > i { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.need-bar > i > i { display: block; height: 100%; background: var(--teal); }
.need-bar.over > i > i { background: var(--bad); }
.need-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 8px; }
.need-actions .check { display: inline-flex; align-items: center; margin: 0; font-size: 13px; }
.need-actions a { font-size: 13px; font-weight: 600; color: var(--teal); text-decoration: none; padding: 6px 0; }
.need-actions a:hover { text-decoration: underline; }
.need-kit { display: grid; gap: 6px; justify-items: start; margin: 12px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-size: 13px; }
.need-kit span { color: var(--ink-2); line-height: 1.45; }
.need-copy { width: 100%; box-sizing: border-box; font: 12px/1.45 var(--font-ui); }
