:root {
  /* Match the responsive Home action height:36px desktop,44px touch. */
  --paper: var(--site-paper);
  --muted: var(--site-muted);
  --ink: var(--site-ink);
  --line: var(--site-line);
  --accent: var(--site-accent);
  --studio-control-height: var(--site-compact-height);
  --studio-control-radius: var(--site-compact-radius);
  --studio-value-size: 14px;
  --studio-reset-duration: 200ms;
  --studio-reset-ease: cubic-bezier(.2,.8,.2,1);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--ink); color: var(--paper); font: 14px Geist, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button, a, input, select, summary, [role=slider] { -webkit-tap-highlight-color: transparent; }
button { border: 0; background: none; cursor: pointer; min-height: var(--studio-control-height); padding: 0 12px; }
button:disabled { opacity: .3; cursor: default; }
a { color: inherit; text-decoration: none; }
.direction-arrow { width: 16px; height: 16px; }
button:hover:not(:disabled), a:hover { color: var(--site-paper-hover); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, [role=slider]:focus-visible { outline: 2px solid var(--paper); outline-offset: 3px; }
input { width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--site-surface); }
input[type=range] { min-height: 44px; padding: 0; border: 0; background: none; accent-color: var(--paper); cursor: pointer; }
summary { display: flex; align-items: center; justify-content: space-between; min-height: var(--studio-control-height); cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; color: var(--muted); font-size: 18px; }
details[open] > summary::after { content: '−'; }
p, h1, h2 { margin: 0; }
p { line-height: 1.55; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip { position: fixed; z-index: 20; top: 10px; left: 10px; padding: 12px; background: var(--paper); color: var(--ink); transform: translateY(-180%); }
.skip:focus { transform: none; }

/* Brand navigation and the workspace title each have a quiet, distinct row. */
.editor-heading { margin-bottom: 22px; }
h1 { font-size: 28px; font-weight: 500; letter-spacing: -.045em; line-height: 1.15; }
.studio-value { margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.4; }
main { padding-block: 24px; }
/* Cover admits the actual page to Safari’s screen edge; keep content safe. */
.site-container { padding-left: max(var(--site-gutter),env(safe-area-inset-left,0px)); padding-right: max(var(--site-gutter),env(safe-area-inset-right,0px)); }
.studio-masthead { padding-top: calc(env(safe-area-inset-top,0px) + var(--site-space-5)); }
.picture-column { grid-column: span 8; position: static; width: 100%; min-width: 0; margin-inline: auto; }
.image-controls { margin-bottom: 16px; }
.image-heading { display: flex; align-items: center; justify-content: space-between; min-height: 44px; gap: 8px; }
.image-heading > label { color: var(--muted); font-size: 10px; letter-spacing: 1.4px; }
.orientation-switch { display: flex; align-items: center; }
.orientation-switch { gap: 2px; }
.orientation-switch button { min-width: 44px; padding-inline: 8px; color: var(--muted); font-size: 12px; }
.orientation-switch button[aria-pressed=true] { color: var(--paper); text-decoration: underline; text-underline-offset: 6px; }

/* Both canvases occupy one identical seat; contain preserves every source pixel. */
.image-seat { --preview-ratio: 9/16; position: relative; width: min(100%, calc(var(--preview-height) * var(--preview-width-factor))); min-height: 0; aspect-ratio: var(--preview-ratio); margin-inline: auto; overflow: hidden; border-radius: 3px; background: #10100f; }
.image-seat[data-orientation=landscape] { --preview-ratio: 16/9; }
.canvas-stack { position: absolute; inset: 0; width: 100%; height: 100%; }
.image-seat[role=button] { cursor: zoom-in; }
.image-seat[role=button]:focus-visible { outline: var(--site-focus-width) solid var(--site-paper); outline-offset: -3px; }
#graded { display: block; width: 100%; height: 100%; object-fit: contain; }
#original { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; clip-path: inset(0 100% 0 0); pointer-events: none; }
#wipe-line { display: none; position: absolute; top: 0; bottom: 0; left: 0; width: 1px; background: rgba(var(--site-paper-rgb), .7); pointer-events: none; }
.compare-bar { display: flex; align-items: center; gap: 16px; min-height: 44px; margin: 8px 0 0; }
.compare-bar button { min-width: 64px; padding-inline: 4px; font-size: 12px; }
.compare-bar button[aria-pressed=true] { color: var(--paper); text-decoration: underline; text-underline-offset: 6px; }
.wipe-control { display: flex; align-items: center; flex: 1; min-width: 0; gap: 12px; color: var(--muted); font-size: 12px; }
.wipe-control input { min-width: 48px; margin: 0; }
.compare-hint { font-size: 16px; }
.image-note { color: var(--muted); font-size: 12px; line-height: 1.5; }

/* One clear authoring rail keeps the picture and editing controls in balance. */
.tools { grid-column: span 4; min-width: 0; container-type: inline-size; }
.preview-feedback { margin-bottom: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--site-radius-control); color: var(--paper); font-size: 13px; line-height: 1.5; }
.starting-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; min-height: 44px; gap: 12px; }
.starting-point label, .save-seat > label { display: block; color: var(--muted); font-size: 10px; letter-spacing: 1.4px; }
.history { display: flex; gap: 2px; }
.history button { display: grid; place-items: center; width: 44px; min-height: var(--studio-control-height); padding: 0; border-radius: var(--site-radius-control); color: var(--paper); }
.history .start-over { display: flex; width: auto; gap: 6px; padding-inline: 8px; font-size: 12px; white-space: nowrap; }
.history button:disabled { color: #85857e; opacity: 1; }
.history button:hover:not(:disabled), .control-reset:hover:not(:disabled) { background: var(--site-control); }
/* Authored web vectors match the native controls' rounded semibold weight.
   The circular reset follows arrow.counterclockwise; history is a mirrored pair. */
.control-icon, .control-reset::before { display: block; flex: none; width: 20px; height: 20px; background: currentColor; -webkit-mask: var(--control-icon) center / contain no-repeat; mask: var(--control-icon) center / contain no-repeat; pointer-events: none; }
.control-icon--undo { --control-icon: url('../assets/control-undo.svg'); }
.control-icon--redo { --control-icon: url('../assets/control-redo.svg'); }
.control-icon--reset, .control-reset::before { --control-icon: url('../assets/control-reset.svg'); width: 18px; height: 18px; }
.starting-point > select, .starting-point > .site-select { margin-top: 4px; }
.starting-point { margin-bottom: 18px; }
.tool-group { padding: 5px 0 12px; border-top: 1px solid var(--line); }
.tool-group summary { font-size: 14px; font-weight: 500; }
.group-state { margin: 0 12px 0 auto; color: var(--accent); font-size: 10px; letter-spacing: .9px; }
.group-body { padding-top: var(--site-space-2); }
.control-scope-note { margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.percent-dial::after { content: "%"; position: absolute; right: 62px; top: 0; line-height: var(--studio-control-height); color: var(--muted); font-size: 11px; pointer-events: none; }
.dial-shell.percent-dial > input { right: 76px; width: 64px; }
.control-section-label { margin: 14px 0 8px; color: var(--muted); font-size: 10px; letter-spacing: 1.2px; }
.dial-shell { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: var(--site-space-2); margin-bottom: var(--site-space-2); }
.dial-shell[hidden] { display: none; }
.dial { --fraction: 50%; --reference: 50%; position: relative; display: flex; align-items: center; gap: 8px; height: var(--studio-control-height); padding: 0 83px 0 12px; overflow: hidden; border: 1px solid #ffffff21; border-radius: var(--studio-control-radius); background: #20201d; touch-action: pan-y; cursor: pointer; -webkit-user-select: none; user-select: none; }
.dial::before { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--fraction); background: #ffffff25; pointer-events: none; }
.dial-edge { position: absolute; top: 0; bottom: 0; left: clamp(0px, calc(var(--fraction) - 2px), 100%); width: 2px; background: #ffffff73; pointer-events: none; }
.dial.is-resetting::before { transition: width var(--studio-reset-duration) var(--studio-reset-ease); }
.dial.is-resetting .dial-edge { transition: left var(--studio-reset-duration) var(--studio-reset-ease); }
@media(prefers-reduced-motion:reduce) { .dial.is-resetting::before,.dial.is-resetting .dial-edge { transition: none; } }
.dial-reference { position: absolute; top: 0; bottom: 0; left: var(--reference); width: 1px; background: #ffffff38; pointer-events: none; }
.dial.reference-at-edge .dial-reference { display: none; }
.dial.active { border-color: #ffffff55; }
.dial.active::before { background: #ffffff38; }
.dial.active .dial-edge { background: #ffffffd9; }
.dial-name { -webkit-user-select: none; user-select: none; position: relative; flex: 1; min-width: 0; color: var(--site-muted); font-size: 12px; font-weight: 500; letter-spacing: .6px; text-transform: uppercase; pointer-events: none; }
.dial-shell > input { touch-action: pan-y; position: absolute; right: 63px; top: 0; width: 67px; height: var(--studio-control-height); min-height: var(--studio-control-height); padding: 0; border: 0; border-radius: 4px; background: none; font-size: var(--studio-value-size); font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; cursor: text; -moz-appearance: textfield; }
.dial-shell > input::-webkit-inner-spin-button, .dial-shell > input::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
.dial-shell > input:focus { width: min(200px, calc(100% - 80px)); padding-left: 8px; background: #20201d; }
.control-reset { display: flex; align-items: center; justify-content: center; width: 44px; height: var(--studio-control-height); min-height: var(--studio-control-height); padding: 0; border-radius: var(--studio-control-radius); color: var(--paper); font-size: 0; }
.control-reset::before { content: ''; }
.tool-select { margin: 0 0 12px; }
.curve-seat { position: relative; height: 180px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 12px; background: #121211; touch-action: pan-y; }
.curve-seat svg { position: absolute; display: block; left: 22px; top: 22px; width: calc(100% - 44px); height: calc(100% - 44px); overflow: visible; }
.curve-grid { stroke: #ffffff13; stroke-width: 1; }
.curve-reference { stroke: #ffffff25; stroke-dasharray: 4 4; }
.curve-path { fill: none; stroke: var(--paper); stroke-width: 2; }
.curve-point { position: absolute; width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 50%; background: radial-gradient(circle, var(--paper) 0 4px, transparent 5px); background-repeat: no-repeat; background-origin: border-box; transform: translate(-50%, 50%); cursor: pointer; touch-action: none; }
.curve-point:focus-visible { outline-offset: 4px; }
.curve-caption { display: flex; justify-content: space-between; margin-bottom: 10px; color: var(--muted); font-size: 10px; }
.save-seat { padding-top: 20px; border-top: 1px solid var(--line); }
.save-seat > label { margin-bottom: 10px; }
.save-seat > input { background: none; font-size: 16px; }
.save-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: 12px; }
.save-actions button { min-height: 44px; border-radius: 12px; font-size: 13px; }
.save-actions .primary { display: flex; align-items: center; justify-content: space-between; width: 100%; padding-inline: 14px; background: var(--paper); color: var(--ink); }
#export-lut { padding-inline: 0; color: var(--muted); font-size: 12px; }
.secondary-actions { display: flex; justify-content: space-between; gap: 12px; }
.secondary-actions button { padding-inline: 0; color: var(--muted); font-size: 12px; }


/* Scopes belong to the picture; support information sits in the shared footer. */
.scope-disclosure { min-width: 0; margin-top: var(--site-space-2); padding: var(--site-space-4); border: 1px solid var(--site-line); border-radius: var(--site-radius-control); }
.scope-disclosure[hidden] { display: none; }
.scope-disclosure .scope-caption { margin: 0 0 var(--site-space-3); }
.scope-disclosure canvas { display: block; width: 100%; height: 112px; background: #121211; }
.scope-disclosure p { margin: 10px 0 14px; color: var(--muted); font-size: 12px; }
.help { min-width: 0; padding-inline: 0; color: var(--muted); font-size: 12px; }
.help summary { justify-content: flex-start; gap: 18px; }
.help p { margin: 0 0 12px; }
.help .community-heading { margin: 20px 0 10px; color: var(--paper); font-size: 13px; font-weight: 500; }
.preview-report-button { margin-top: 4px; padding-inline: 0; color: var(--muted); font-size: 12px; }
.preview-report-output { width: 100%; min-height: 120px; margin-top: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--site-radius-control); background: var(--site-surface); color: var(--paper); font: 16px/1.5 monospace; resize: vertical; }
.status { color: var(--site-muted); font-size: 13px; }
.status.error { margin-bottom: var(--site-space-3); padding: var(--site-space-3); border: 1px solid var(--site-line); border-radius: var(--site-radius-control); overflow-wrap: anywhere; }

@media (max-width: 980px) {
  .picture-column { grid-column: span 7; }
  .tools { grid-column: span 5; }
}
@media (max-width: 780px), (max-width: 1024px) and (max-height: 500px) {
  .editor-heading { margin-bottom: 16px; }
  h1 { font-size: 25px; }
  .studio-value { margin-top: 5px; }
  main { padding-block: 18px 24px; }
  .workspace { grid-template-columns: minmax(0,1fr); }
  .picture-column, .tools { grid-column: 1 / -1; }
  .picture-column { position: static; padding-bottom: 0; }
  .compare-bar { gap: 12px; margin-top: 4px; }
  .compare-bar button { min-width: 60px; }
  .wipe-control { gap: 8px; }
  .tools { width: 100%; border-left: 0; margin-inline: 0; }
  .starting-point { margin-bottom: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; }
}
/* A persistent project and a stable picture are the center of the workspace. */
.editor-heading { display: flex; align-items: baseline; gap: 16px; margin-bottom: 18px; }
.editor-heading h1 { font-size: 24px; }
.project-bar { position: relative; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; padding: 12px 0; background: var(--ink); border-block: 1px solid var(--line); margin-bottom: 20px; }
.project-identity { flex: 1; min-width: 180px; }
.project-identity input { width: 100%; max-width: 340px; padding: 0 8px 0 0; border: 0; border-radius: 4px; background: none; font-size: 19px; font-weight: 500; }
#draft-state { display: block; font-size: 11px; color: var(--muted); }
#draft-state.error { color: #e5b3a0; }
.project-commands { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.project-commands > button { font-size: 12px; border-radius: 12px; }
.primary { display: inline-flex; gap: 18px; align-items: center; justify-content: center; background: var(--paper); color: var(--ink); padding-inline: 18px; }
.primary:hover:not(:disabled) { color: var(--ink); background: var(--site-paper-hover); }
.save-guidance { flex-basis: 100%; color: var(--muted); font-size: 11px; }
.picture-column { align-self: start; }
.workspace { align-items: start; }
.tools { border-left: 1px solid var(--line); padding-left: 22px; }
.viewer-toolbar,.viewer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.viewer-toolbar { margin-bottom: 10px; }
.viewer-toolbar button,.viewer-bottom button { font-size: 11px; padding-inline: 10px; border-radius: 10px; white-space: nowrap; }
.view-modes { display: flex; align-items: center; }
.tool-tabs button[aria-pressed=true] { color: var(--paper); background: var(--site-control); }
.viewer-toolbar button[aria-pressed=false] { color: var(--muted); }
.picture-column { --preview-height: min(65svh, 720px); --preview-width-factor: .5625; }
.picture-column:has(.preview-anchor[data-orientation=landscape]) { --preview-width-factor: 1.777777778; }
.viewer-bottom { width: min(100%,calc(var(--preview-height) * var(--photo-aspect-ratio,var(--preview-width-factor)))); margin: 10px auto 0; container-type: inline-size; }
.viewer-bottom .wipe-control { max-width: 360px; }
.reference-strip { display: flex; align-items: flex-start; overflow-x: auto; gap: var(--site-space-3); padding: var(--site-space-3) 0 var(--site-space-2); scrollbar-width: thin; }
.reference-card { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 7px; flex: none; width: 64px; padding: 0; color: var(--muted); font-size: 10px; line-height: 1.4; text-align: left; }
.reference-card > span:last-child,.reference-upload > span:last-child { display: block; min-height: 2.8em; }
.reference-card img,.reference-card canvas,.chart-thumb { display: block; width: 64px; height: 44px; object-fit: cover; border-radius: 6px; margin-bottom: 0; flex: none; }
.reference-card[aria-pressed=true] img,.reference-card[aria-pressed=true] canvas,.reference-card[aria-pressed=true] .chart-thumb { outline: 2px solid var(--paper); outline-offset: 2px; }
.reference-strip { padding-inline: 5px; margin-inline: -5px; scroll-padding-inline: 5px; overscroll-behavior-x: contain; }
.chart-thumb { background: linear-gradient(90deg,#ebdddd 0 16%,#ddc398 16% 32%,#a7b590 32% 48%,#92b6bf 48% 64%,#a495bf 64% 80%,#b69199 80%); }
.tool-tabs { display: flex; justify-content: flex-start; gap: 1px; overflow-x: auto; margin-bottom: 16px; }
.tool-tabs { padding-inline: 5px; margin-inline: -5px; scroll-padding-inline: 5px; overscroll-behavior-x: contain; }
.tool-tabs button { flex: none; padding-inline: 8px; font-size: 12px; border-radius: 10px; }
.tool-group { border: 0; padding-top: 0; }
.tool-group > summary { display: none; }
.tool-group[hidden] { display: none; }
.tool-group .tool-group > summary { display: flex; }
.control-section-label { margin-top: 8px; }
.wheel-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: 14px; margin: 18px 0; }
.wheel-card { min-width: 0; }
.wheel-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; margin-bottom: 8px; font-size: 12px; }
.wheel-heading > span { margin-right: auto; }
.wheel-heading button { min-height: var(--studio-control-height); font-size: 10px; padding: 0 8px; color: var(--muted); }
.wheel { position: relative; width: min(100%,180px); aspect-ratio: 1; margin: 0 0 12px; border-radius: 50%; background: radial-gradient(circle,#9b9b98,transparent),conic-gradient(from 90deg,#e96661,#dcb970,#83c594,#73cad4,#7c8de4,#d781ce,#e96661); touch-action: none; cursor: crosshair; box-shadow: inset 0 0 0 1px #ffffff3a; }
.wheel::after { content: ''; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; transform: translate(-50%,-50%); border-radius: 50%; background: #eee; }
.wheel-puck { position: absolute; left: 50%; top: 50%; width: 17px; height: 17px; border: 2px solid var(--site-paper); box-shadow: 0 1px 4px #000; border-radius: 50%; transform: translate(-50%,-50%); pointer-events: none; }
.wheel.bypassed { opacity: .35; }
.wheel-values { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
.wheel-values label { font-size: 10px; color: var(--muted); }
.wheel-values input { padding: 0 6px; min-height: 44px; margin-top: 3px; font-size: 12px; }
.wheel-values label:last-child { grid-column: span 2; }
.palette-colors {flex:1;min-width:0;}
.swatch-strip {display:flex;gap:6px;margin:0;padding:4px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;}
.swatch-strip::-webkit-scrollbar {display:none;}
.swatch { scroll-margin-inline:4px;flex:1 0 var(--studio-control-height);width:auto;height:var(--studio-control-height);padding:0;min-width:var(--studio-control-height);min-height:var(--studio-control-height); border-radius: 8px; border: 2px solid transparent; background: var(--swatch); }
.swatch[aria-pressed=true] { border-color: var(--paper); box-shadow: inset 0 0 0 2px var(--ink); }
.curve-seat { height: 260px; }
.curve-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.curve-heading button { font-size: 12px; }
.scope-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-top: 14px; }
.scope-grid span { display: block; margin-bottom: 8px; color: var(--muted); font-size: 10px; letter-spacing: 1px; }
.scope-disclosure .scope-grid canvas { height: 160px; }
#vectorscope { aspect-ratio: 1; object-fit: contain; }
dialog { background: #181816; color: var(--paper); border: 1px solid var(--line); border-radius: 20px; width: min(560px,calc(100% - 32px)); max-height: min(80svh,760px); padding: 20px; }
dialog::backdrop { background: #0009; }
#project-dialog { overscroll-behavior: contain; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.dialog-heading h2,.photo-framer-heading h2 { font-size: 19px; font-weight: 500; }
.dialog-heading button { color: var(--muted); font-size: 12px; }
.project-list-row { display: flex; width: 100%; flex-wrap: wrap; justify-content: space-between; align-items: center; padding: 12px; border-bottom: 1px solid var(--line); text-align: left; }
.project-list-row small { color: var(--muted); font-size: 11px; }
.dialog-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.dialog-note { margin-bottom: 14px; color: var(--muted); font-size: 12px; }
@media(min-width:1300px) { .picture-column { grid-column: span 8; } .tools { grid-column: span 4; } }
@media(max-width:900px) { .project-bar { position: static; } .tools { padding-left: 16px; } .wheel-grid { grid-template-columns: 1fr; } .viewer-toolbar { flex-wrap: wrap; } .project-identity { flex-basis: 100%; } }
@media(max-width:680px) { .editor-heading { justify-content: space-between; } .project-commands { width: 100%; } .project-commands > button { padding-inline: 8px; } .project-commands #save-look { margin-left: auto; } .project-commands #project-duplicate,.project-commands #project-version { font-size: 11px; } .workspace { display: block; } .picture-column { position: static; margin-bottom: 18px; --preview-height: 48svh; } .tools { border-left: 0; padding-left: 0; } .viewer-toolbar button { padding-inline: 8px; } .reference-card,.reference-card img,.reference-card canvas,.chart-thumb { width: 58px; } .tool-tabs { padding-block: 8px; } .viewer-bottom .wipe-control { font-size: 10px; gap: 6px; } }
/* Studio actions and panels use the website's shared control vocabulary. */
button,summary { min-height: var(--studio-control-height); }
button { border-radius: var(--site-radius-control); }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible,[role=slider]:focus-visible,.wheel:focus-visible { outline: var(--site-focus-width) solid var(--site-paper); outline-offset: var(--site-focus-offset); }
button:hover:not(:disabled) { color: var(--site-paper); background-color: var(--site-control-hover); }
button:disabled { opacity: .45; }
.primary { border-radius: var(--site-radius-control); background: var(--site-paper); color: var(--site-ink); font-weight: 500; }
.primary:hover:not(:disabled) { color: var(--site-ink); background: var(--site-paper); opacity: .9; }
.secondary-action { border: 1px solid var(--site-line); background: var(--site-control); color: var(--site-paper); }
.quiet-action { color: var(--site-muted); }
.project-bar { gap: var(--site-space-4); padding-block: var(--site-space-3); margin-bottom: var(--site-space-5); }
.project-commands { gap: var(--site-space-2); }
.project-commands > button { height: var(--studio-control-height); min-height: var(--studio-control-height); padding-inline: var(--site-space-3); border-radius: var(--studio-control-radius); }
.project-identity input { padding-inline: 0; border-radius: var(--site-space-1); }
#draft-state[hidden] { display: none; }
#draft-state.error,.status.error,.import-feedback,.preview-feedback.error { color: var(--site-accent); }
.tools { padding-left: var(--site-space-5); }
.starting-heading { gap: var(--site-space-2); }
.base-look-hint { margin: 0 0 var(--site-space-2); font-size: 12px; line-height: 1.5; color: var(--site-muted); }
.starting-point { margin-bottom: var(--site-space-4); }
.viewer-toolbar { gap: var(--site-space-2); margin-bottom: var(--site-space-3); }
.viewer-toolbar button,.viewer-bottom button,.tool-tabs button { border-radius: var(--site-radius-control); }
.viewer-bottom { margin-top: var(--site-space-2); }
.viewer-bottom .wipe-control { max-width: none; }
.tool-tabs { gap: var(--site-space-4); margin-bottom: var(--site-space-4); }
.tool-tabs button { color: var(--site-muted); }
.wheel-grid { gap: var(--site-space-4); margin-block: var(--site-space-4); }
.wheel-card { container-type: inline-size; padding-bottom: var(--site-space-4); border-bottom: 1px solid var(--site-line); }
.wheel-heading { display: grid; grid-template-columns: minmax(0,1fr) auto auto; margin-bottom: var(--site-space-3); gap: var(--site-space-1); font-size: 14px; }
.wheel-heading > span { min-width: 0; font-weight: 500; }
.wheel-heading button { padding-inline: var(--site-space-2); border-radius: var(--site-space-1); font-size: 12px; background: transparent; }
.wheel-heading button:hover:not(:disabled) { color: var(--site-paper); background: transparent; }
.wheel-heading button[aria-pressed=true] { color: var(--site-paper); text-decoration: underline; text-underline-offset: 4px; }
.wheel { width: min(100% - 16px,200px); }
.wheel-values { gap: var(--site-space-2); }
.wheel-values label { font-size: 12px; line-height: 1.5; }
.wheel-values input { height: var(--studio-control-height); min-height: var(--studio-control-height); margin-top: var(--site-space-1); padding-block: 0; padding-inline: var(--site-space-3); border-radius: var(--studio-control-radius); background: var(--site-surface); font-size: var(--studio-value-size); font-variant-numeric: tabular-nums; }
/* One active tonal wheel uses the complete Color panel at every width. */
@container (max-width: 220px) { .wheel-heading > span { grid-column: 1 / -1; } .wheel-heading { grid-template-columns: minmax(0,1fr) auto; } }
.curve-seat { border-radius: var(--site-radius-control); background: var(--site-ink); }
.curve-point:hover:not(:disabled) { background-color: transparent; background-image: radial-gradient(circle,var(--site-paper) 0 5px,transparent 6px); }
.preview-feedback { padding: var(--site-space-3); border-radius: var(--site-radius-control); }
.reference-card:hover:not(:disabled) { background: transparent; }
.scope-disclosure canvas { background: var(--site-ink); }
dialog { width: min(640px,calc(100% - 48px)); max-height: calc(100svh - 48px); max-height: calc(100dvh - 48px); overflow-y: auto; overscroll-behavior: contain; padding: var(--site-space-6); border-radius: var(--site-space-5); background: var(--site-ink); }
dialog[open] { animation: studio-dialog-in 160ms ease-out; }
@keyframes studio-dialog-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
dialog::backdrop { background: color-mix(in srgb,var(--site-ink) 80%,transparent); }
.dialog-heading { gap: var(--site-space-4); margin-bottom: var(--site-space-5); }
.dialog-heading h2,.photo-framer-heading h2 { font-size: 24px; font-weight: 500; letter-spacing: -.035em; }
.dialog-heading button { flex: none; min-width: var(--site-target); padding-inline: var(--site-space-3); }
#project-dialog-close,.dialog-heading .dialog-close { display: grid; place-items: center; width: var(--site-target); min-height: var(--studio-control-height); padding: 0; color: var(--site-paper); }
.dialog-close-icon { display: block; width: 20px; height: 20px; pointer-events: none; }
.dialog-note { color: var(--site-muted); font-size: 13px; line-height: 1.6; margin-bottom: var(--site-space-4); }
.import-card { padding: var(--site-space-5); border: 1px solid var(--site-line); border-radius: var(--site-radius-control); background: var(--site-surface); }
.import-card + .import-card { margin-top: var(--site-space-4); }
.import-card h3 { margin: 0 0 var(--site-space-2); font-size: 16px; font-weight: 500; letter-spacing: -.02em; }
.import-link-form { display: grid; grid-template-columns: 1fr; gap: var(--site-space-3); }
.import-link-form label { font-size: 12px; color: var(--site-muted); }
.import-link-form input { min-width: 0; background: var(--site-ink); border-radius: var(--site-radius-control); font-size: 14px; }
.import-link-form .primary { justify-self: start; min-width: 144px; justify-content: center; margin-top: var(--site-space-1); }
.import-file-card .secondary-action { min-width: 144px; }
.import-feedback { margin: var(--site-space-4) 0 0; padding: var(--site-space-3); border: 1px solid var(--site-line); border-radius: var(--site-radius-control); font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.export-instruction { margin-bottom: var(--site-space-4); font-size: 17px; line-height: 1.6; }
#project-dialog-content > .primary { min-width: 120px; justify-content: center; }
/* Sharing groups the handoff explanation, portable link and action feedback. */
#project-dialog:has(.share-result) { width: min(560px,calc(100% - 48px)); }
#project-dialog:has(.share-result) .dialog-heading { margin-bottom: var(--site-space-5); }
.share-result { display: grid; gap: var(--site-space-5); min-width: 0; }
.share-explanation { display: grid; gap: var(--site-space-3); }
.share-result .export-instruction { margin: 0; font-size: 16px; line-height: 1.55; }
.share-result .dialog-note { margin: 0; font-size: 13px; line-height: 1.6; }
.share-link-label { display: block; margin-bottom: var(--site-space-2); color: var(--site-muted); font-size: 12px; line-height: 1.5; }
.share-result #shared-look-result { display: block; width: 100%; min-width: 0; min-height: 48px; padding: var(--site-space-3); color: var(--site-muted); font-size: 14px; line-height: 1.5; }
.share-result .dialog-actions { gap: var(--site-space-4); margin-top: var(--site-space-6); }
.share-result .dialog-actions :is(button,.share-open-app) { min-height: var(--studio-control-height); padding-inline: var(--site-space-4); font-size: 14px; }
.share-result .share-open-app { flex-basis: 100%; min-width: 0; }
.share-result .dialog-actions:has(.share-open-app) > button { flex: 1 1 0; min-width: 0; }
.share-result .share-copy { min-width: 120px; }
.share-feedback { min-height: 3.1em; margin: var(--site-space-3) 0 0; color: var(--site-muted); font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.share-feedback:empty { min-height: 0; margin: 0; }
.share-result .share-compatibility-note { margin: var(--site-space-4) 0 0; color: var(--site-muted); font-size: 12px; text-align: center; }
@media(max-width:900px) { .project-identity { flex-basis: auto; } .tools { padding-left: var(--site-space-4); } }
@media(max-width:680px) {
  .project-bar { position: relative; display: block; }
  .project-identity { min-width: 0; margin-bottom: var(--site-space-3); padding-right: 96px; }
  .project-identity input { max-width: none; }
  .project-commands { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: var(--site-space-2); }
  .project-commands .history { position: absolute; top: var(--site-space-3); right: 0; }
  .project-commands > button { width: 100%; padding-inline: var(--site-space-2); justify-content: center; font-size: 11px; }
  .project-commands #save-look { margin-left: 0; gap: var(--site-space-2); }
  .project-commands #save-look .direction-arrow { width: 12px; height: 12px; }
  .viewer-toolbar { flex-wrap: wrap; }
  .viewer-toolbar button { padding-inline: var(--site-space-2); font-size: 10px; }
  .tools { padding-left: 0; }
  dialog { width: calc(100% - 32px); max-height: calc(100svh - 32px); max-height: calc(100dvh - 32px); padding: var(--site-space-5); border-radius: var(--site-space-5); }
  .dialog-heading { margin-bottom: var(--site-space-4); }
  .dialog-heading h2,.photo-framer-heading h2 { font-size: 22px; }
  .import-card { padding: var(--site-space-4); }
  .import-link-form .primary,.import-file-card .secondary-action { width: 100%; }
  #project-dialog:has(.share-result) { width: calc(100% - 32px); }
  .share-result #shared-look-result { font-size: 16px; }
}

.reference-upload { flex: none; width: 88px; padding: var(--site-space-2); font-size: 11px; line-height: 1.45; }
.reference-card[hidden] { display: none; }
.viewer-toolbar :is(.view-modes,.orientation-switch) { gap: 0; }
:is(.viewer-toolbar .view-modes,.viewer-toolbar .orientation-switch,.tool-tabs) button { min-width: var(--site-target); min-height: var(--studio-control-height); font-size: 12px; padding-inline: var(--site-space-2); border-radius: 0; background: transparent; color: var(--site-muted); }
:is(.viewer-toolbar .view-modes,.viewer-toolbar .orientation-switch,.tool-tabs) button[aria-pressed=true] { color: var(--site-paper); text-decoration: underline; text-underline-offset: 8px; text-decoration-thickness: 1px; }
:is(.viewer-toolbar .view-modes,.viewer-toolbar .orientation-switch,.tool-tabs) button:hover:not(:disabled) { background: transparent; color: var(--site-paper); }
/* Content-sized tabs line up with the editing controls, with full touch height. */
.tools .tool-tabs button { padding-inline: 0; text-align: left; }
@media(max-width:680px) { .viewer-toolbar .orientation-switch button { font-size: 10px; } .reference-upload { width: 80px; } }

/* Look actions stay beside the name; Import and Export stay within easy reach. */
.project-identity { display: grid; grid-template-columns: minmax(0,340px) var(--site-target); align-items: center; gap: 0 var(--site-space-1); }
#draft-state { grid-column: 1 / -1; }
.look-actions { position: relative; }
.look-actions > summary { width: var(--site-target); min-width: var(--site-target); justify-content: center; border-radius: var(--site-radius-control); color: var(--site-muted); font-size: 24px; }
.look-actions > summary::after,.look-actions[open] > summary::after { content: none; }
.look-actions > summary:hover,.look-actions[open] > summary { color: var(--site-paper); background: var(--site-control); }
.look-actions-panel { position: absolute; right: 0; top: calc(100% + var(--site-space-1)); z-index: 12; min-width: 160px; padding: var(--site-space-1); border: 1px solid var(--site-line); border-radius: var(--site-radius-control); background: var(--site-surface); }
.look-actions-panel button { width: 100%; text-align: left; white-space: nowrap; color: var(--site-paper); }
.project-commands > button { white-space: nowrap; }
.tools-label { display: none; }
.reference-upload { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 7px; width: 64px; padding: 0; text-align: left; font-size: 10px; line-height: 1.4; color: var(--site-muted); }
.reference-upload-icon { display: grid; place-items: center; height: var(--site-target); flex: none; border: 1px solid var(--site-line); border-radius: var(--site-radius-control); background: var(--site-control); color: var(--site-paper); font-size: 24px; font-weight: 400; }
.reference-upload:hover:not(:disabled) { background: transparent; }
.reference-upload:hover:not(:disabled) .reference-upload-icon { background: var(--site-control-hover); }
.wheel-heading button { min-width: var(--site-target); }
@media(max-width:680px) {
  main { padding-block: var(--site-space-2) var(--site-space-5); }
  .editor-heading { margin-bottom: var(--site-space-1); }
  .editor-heading h1 { font-size: 13px; line-height: 1.5; letter-spacing: 0; color: var(--site-muted); }
  .project-bar { padding: 0; border: 0; margin-bottom: var(--site-space-4); }
  .project-identity { grid-template-columns: minmax(0,1fr) var(--site-target); margin-bottom: var(--site-space-2); padding-right: 0; }
  .project-identity input { font-size: 20px; letter-spacing: -.025em; }
  .project-commands { display: flex; flex-wrap: nowrap; gap: var(--site-space-2); }
  .project-commands .history { position: static; flex: none; }
  .project-commands > button { width: auto; flex: 1; font-size: 12px; padding-inline: var(--site-space-3); }
  .project-commands #save-look { flex: none; min-width: 0; gap: 0; padding-inline: var(--site-space-3); margin-left: auto; }
  .project-commands #save-look .direction-arrow { display: none; }
  .viewer-toolbar { gap: var(--site-space-2); margin-bottom: var(--site-space-2); }
  .viewer-toolbar :is(.view-modes,.orientation-switch) button { font-size: 11px; }
  .reference-upload { width: 58px; }
  .reference-strip { padding-block: var(--site-space-2); }
  .reference-upload-icon { border-radius: var(--site-radius-control); }
  .picture-column { margin-bottom: var(--site-space-5); padding-bottom: 0; }
  .tools { border-top: 1px solid var(--site-line); padding-top: var(--site-space-5); }
  .starting-point { margin-bottom: var(--site-space-5); }
  .starting-heading label { color: var(--site-paper); font-size: 11px; letter-spacing: 1px; }
  .base-look-hint { font-size: 12px; }
  .tools-label { display: block; margin: 0 0 var(--site-space-1); color: var(--site-muted); font-size: 11px; line-height: 1.5; font-weight: 500; letter-spacing: 1px; text-transform: uppercase; }
  .tool-tabs { gap: var(--site-space-3); padding-block: var(--site-space-1); margin-bottom: var(--site-space-4); }
}

/* One frame and one support row carry the Studio from brand to footer. */
.view-options { display: flex; flex: 1 1 280px; min-width: 0; align-items: center; gap: var(--site-space-2); }
.viewer-toggles { display: flex; flex: none; align-items: center; gap: var(--site-space-1); margin-left: auto; }
.scopes-control { display: inline-flex; flex: none; align-items: center; gap: var(--site-space-2); min-height: var(--studio-control-height); padding-inline: var(--site-space-2); color: var(--site-muted); font-size: 12px; cursor: pointer; }
.scopes-control input { flex: none; width: 14px; height: 14px; min-height: 0; margin: 0; padding: 0; accent-color: var(--site-paper); cursor: pointer; }
.scopes-control:has(input:checked) { color: var(--site-paper); }
.scopes-control { white-space: nowrap; }
.scopes-control:has(input:disabled) { opacity: .45; cursor: default; }
.scopes-control input:focus-visible { outline: 2px solid var(--site-paper); outline-offset: 3px; }
.viewer-toolbar { flex-wrap: wrap; }
.viewer-toolbar .orientation-switch { margin-left: auto; }
/* Equal outer columns keep orientation centered over the picture on desktop. */
@media(min-width:1100px) {
  .viewer-toolbar { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); }
  .viewer-toolbar .view-options { display: contents; }
  .viewer-toolbar .view-modes { justify-self: start; }
  .viewer-toolbar .orientation-switch { margin-left: 0; justify-self: center; }
  .viewer-toolbar .viewer-toggles { margin-left: 0; justify-self: end; }
}
.studio-footer .site-footer-inner { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0 var(--site-space-5); padding-top: var(--site-space-2); }
.studio-about { flex: 1 1 auto; min-width: min-content; }
.studio-about[open] { flex-basis: 100%; }
.studio-about > summary { width: fit-content; min-width: var(--site-target); gap: var(--site-space-3); font-size: 13px; }
.studio-about-content { width: min(100%,640px); padding-block: var(--site-space-3) var(--site-space-4); font-size: 13px; line-height: 1.6; }
.studio-about:not([open]) > .studio-about-content { display: none; }
.studio-support-links { display: flex; flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end; gap: var(--site-space-4); margin-left: auto; }
@media(max-width:780px), (max-width:1024px) and (max-height:500px) {
  .workspace { grid-template-columns: minmax(0,1fr); }
  .picture-column,.tools { grid-column: 1 / -1; }
  .picture-column { position: static; }
  .tools { max-width: none; padding-left: 0; border-left: 0; }
  .viewer-toolbar { flex-wrap: wrap; }
}
@media(max-width:680px) {
  .viewer-bottom { gap: var(--site-space-2); }
  .viewer-bottom .wipe-control > span { flex: none; width: 50px; }
  .view-options { flex-basis: 100%; gap: var(--site-space-2); }
  .viewer-toggles { margin-left: 0; }
  .scopes-control { font-size: 11px; }
  .scope-disclosure { padding: var(--site-space-3); }
  .scope-grid { gap: var(--site-space-3); }
  .studio-footer .site-footer-inner { gap: 0 var(--site-space-2); }
  .studio-about > summary { gap: var(--site-space-2); }
  .studio-support-links { gap: var(--site-space-3); }
}
/* Phone controls retain readable values and focus without crowding the picture. */
@media(max-width:460px) {
  .wheel-grid { grid-template-columns: minmax(0,1fr); gap: var(--site-space-5); }
  .wheel { width: min(100% - 16px,220px); }
  .scope-grid { grid-template-columns: minmax(0,1fr); }
  .scope-disclosure #vectorscope { height: 200px; }
}
@media(max-width:900px), (pointer:coarse) {
  .import-link-form input,.share-result #shared-look-result { font-size: 16px; }
}
@media(prefers-reduced-motion:reduce) {
  dialog[open] { animation: none; }
}
@container (max-width: 180px) {
  .viewer-bottom .wipe-control { flex-direction: column; align-items: stretch; gap: 0; }
  .viewer-bottom .wipe-control > span { width: auto; }
}

/* Compact tonal controls keep the picture reachable while editing. */
.wheel-tabs { display: flex; gap: 0; justify-content: space-between; margin-top: var(--site-space-3); }
.wheel-tabs button { position: relative; flex: 1; min-width: 44px; min-height: var(--studio-control-height); padding: 0 5px; color: var(--site-muted); font-size: 11px; background: transparent; }
.wheel-tabs button[aria-pressed=true] { color: var(--site-paper); text-decoration: underline; text-underline-offset: 8px; }
:is(.wheel-tabs,.tool-tabs) button[data-edited=true]::after { content: ''; position: absolute; width: 3px; height: 3px; border-radius: 50%; top: 6px; right: 6px; background: currentColor; }
.tool-tabs button { position: relative; }
.wheel-tabs button[data-bypassed=true]::after { width: 5px; height: 1px; border-radius: 0; }
.wheel-card[hidden] { display: none; }
.wheel-grid { margin-top: var(--site-space-1); }
.wheel-values { width:calc(100% - 44px - var(--site-space-2));margin-inline:0;margin-bottom: var(--site-space-3); }
.wheel-values label:last-child { grid-column: auto; }
.curve-preset { width: 100%; margin-bottom: var(--site-space-3); }
.curve-seat { background: linear-gradient(90deg,var(--ink),color-mix(in srgb,var(--site-paper) 10%,var(--ink))); }
.curve-point.selected { background-image: radial-gradient(circle,var(--site-paper) 0 5px,transparent 6px 8px,var(--site-muted) 9px 10px,transparent 11px); }
.curve-selected-value .dial-name { color: var(--site-paper); text-decoration: underline; text-underline-offset: 4px; }
.picture-access { display: none; min-height: var(--studio-control-height); color: var(--site-muted); background: transparent; font-size: 11px; padding-inline: var(--site-space-2); }
.picture-access:hover { color: var(--site-paper); }

.share-preflight-feedback { flex-basis: 100%; margin: 0; color: var(--site-muted); font-size: 12px; }

.studio-ui-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.studio-ui-panel[hidden] { display: none; }
:is(.tool-tabs,.wheel-tabs) button[data-active],.studio-ui-choice[data-checked] { color: var(--site-paper); text-decoration: underline; text-underline-offset: 8px; text-decoration-thickness: 1px; }
:is(.tool-tabs,.wheel-tabs) button[data-changed]::after { content: ''; position: absolute; width: 3px; height: 3px; border-radius: 50%; top: 6px; right: 6px; background: currentColor; }
.wheel-tabs button[data-bypassed]::after { width: 5px; height: 1px; border-radius: 0; }
.studio-ui-checkbox { width: 14px; height: 14px; border: 1px solid var(--site-muted); border-radius: 2px; display: inline-flex; flex: none; align-items: center; justify-content: center; }
.studio-ui-checkbox[data-checked] { background: var(--site-paper); border-color: var(--site-paper); }
/* Keep the check in its own seat, independent of the label's text baseline. */
.studio-ui-checkbox-indicator { display: flex; width: 12px; height: 12px; align-items: center; justify-content: center; line-height: 0; }
.studio-ui-checkbox-indicator svg { display: block; flex: none; width: 12px; height: 12px; fill: none; stroke: var(--ink); stroke-width: 2; }
.studio-ui-checkbox:focus-visible { outline: 2px solid var(--site-paper); outline-offset: 3px; }
.scopes-control:has(.studio-ui-checkbox[data-checked]) { color: var(--site-paper); }
.scopes-control:has(.studio-ui-checkbox[data-disabled]) { opacity: .45; cursor: default; }


.swatch[data-active] { outline: 1px solid var(--site-paper); outline-offset: 3px; }

.curve-channel-tabs { display: flex; justify-content: flex-start; gap: var(--site-space-1); margin-bottom: var(--site-space-3); }
.curve-channel-tabs button { min-width: 44px; min-height: var(--studio-control-height); padding: 0 8px; color: var(--site-muted); background: transparent; font-size: 11px; }
.curve-channel-tabs button[data-active] { color: var(--site-paper); text-decoration: underline; text-underline-offset: 8px; }
.swatch-strip .swatch { font-size: 0; }

/* Dense desktop fields use the same rhythm; touch keeps full target sizes. */
.tools .site-select-trigger,.tools select:not(.site-select-source) { height: var(--studio-control-height); min-height: var(--studio-control-height); padding-block: 0; border-radius: var(--studio-control-radius); font-size: var(--studio-value-size); }
@media(max-width:780px), (max-width:1024px) and (max-height:500px), (any-pointer:coarse) {
  :root { --studio-value-size: 16px; }
}

/* The image-only anchor keeps the calibrated gate dimensions. Its bottom
   margin reserves the shared Compare row while the full viewer pins natively. */
.preview-anchor { --preview-controls-height: calc(var(--site-target) + var(--site-space-2)); --preview-ratio: var(--photo-aspect-ratio,9/16); width: min(100%,calc(var(--preview-height) * var(--photo-aspect-ratio,var(--preview-width-factor)))); aspect-ratio: var(--preview-ratio); margin-inline: auto; margin-bottom: var(--preview-controls-height); overflow-anchor: none; }
.preview-anchor[data-orientation=landscape] { --preview-ratio: var(--photo-aspect-ratio,16/9); }
.preview-track,.preview-header { width: 100%; height: 100%; }
.preview-dock { position: relative; width: 100%; height: calc(100% + var(--preview-controls-height)); box-shadow: 0 8px 24px #0000; transition: box-shadow 600ms cubic-bezier(.22,.61,.36,1); }
.preview-anchor .image-seat { width: 100%; height: calc(100% - var(--preview-controls-height)); aspect-ratio: auto; }
.preview-dock > .viewer-bottom { width: max(100%,160px); height: var(--site-target); margin: var(--site-space-2) min(0px,calc((100% - 160px) / 2)) 0; }
.preview-dock > .viewer-bottom .wipe-control { height: 100%; flex-direction: row; align-items: center; gap: var(--site-space-2); }
.preview-dock > .viewer-bottom .wipe-control > span { width: auto; }
.preview-dock > .viewer-bottom input { height: var(--site-target); }
@media(max-width:780px), (max-width:1024px) and (max-height:500px) {
  .workspace { position: relative; }
  .picture-column,.preview-anchor { position: static; overflow: visible; }
  .preview-anchor { --preview-pin-top: calc(env(safe-area-inset-top,0px) + var(--site-space-5)); scroll-margin-top: var(--preview-pin-top); }
  :root { scroll-padding-top: calc(var(--preview-dock-height,0px) + 12px); }
  .tool-tabs { padding-block: var(--site-space-1); }
  /* Reserve clearance in both states, so even a short Texture panel can scroll
     its last control below the full picture without a docking layout jump. */
  .tools { padding-bottom: calc(var(--preview-scroll-clearance,0px) + 12px); transition: border-top-color 280ms cubic-bezier(.2,.8,.2,1); }
  .tools :is(input,select,button,[tabindex]) { scroll-margin-top: calc(var(--preview-dock-height,0px) + 12px); }
  /* The workspace owns the carrier's end. The anchor still reserves the exact
     picture size; native sticky owns every scroll position and bottom release. */
  body[data-preview-ready] .preview-track { position: absolute; left: var(--preview-track-left); top: calc(var(--preview-track-start) - var(--preview-pin-top)); bottom: 0; width: var(--preview-dock-width); height: auto; pointer-events: none; }
  /* The real header box owns the viewport edge. Its internal padding retains
     the image's original top clamp, including while sticky is suspended. */
  body[data-preview-ready] .preview-track > .preview-header { position: sticky; z-index: 6; top: 0; width: 100vw; height: calc(var(--preview-frame-height) + var(--preview-pin-top)); padding-top: var(--preview-pin-top); margin-left: calc((var(--preview-dock-width) - 100vw) / 2); pointer-events: none; }
  body[data-preview-ready] .preview-header > .preview-dock { width: var(--preview-dock-width); height: var(--preview-frame-height); margin-inline: auto; pointer-events: auto; }
  body[data-preview-suspended] .preview-track > .preview-header { position: relative; top: 0; }
  body[data-preview-docked] .preview-dock { box-shadow: none; }
  /* Admission stays decorative: natural-flow padding may overlap the toolbar,
     so the opaque cap and interior material appear only on a displaced viewer. */
  body[data-preview-ready][data-preview-docked]:not([data-preview-suspended]):not([data-picture-open]):not(:has(dialog[open])) .preview-header:has(> .preview-dock > .image-seat) { background: linear-gradient(var(--site-surface) 0 var(--preview-pin-top),transparent var(--preview-pin-top)); pointer-events: auto; }
  .preview-header::before {
    content: none; position: absolute; z-index: -1;
    top: var(--preview-pin-top); bottom: calc(-1 * var(--site-space-2));
    left: 0; right: 0;
    background: var(--site-surface); pointer-events: auto;
  }
  body[data-preview-ready][data-preview-docked]:not([data-preview-suspended]):not([data-picture-open]):not(:has(dialog[open])) .preview-header:has(> .preview-dock > .image-seat)::before { content: ''; }
  /* The surface shields immediately. Its separate divider can finish or
     reverse a quiet handoff from the normal-flow Tools divider. */
  .preview-header::after {
    content: ''; position: absolute; left: 0; right: 0;
    bottom: calc(-1 * var(--site-space-2)); height: 1px;
    background: var(--site-line); pointer-events: none; opacity: 0;
    clip-path: inset(0 max(var(--site-gutter),env(safe-area-inset-right,0px)) 0 max(var(--site-gutter),env(safe-area-inset-left,0px)));
    transition: clip-path 280ms cubic-bezier(.2,.8,.2,1), opacity 280ms cubic-bezier(.2,.8,.2,1);
  }
  body[data-preview-ready][data-preview-docked]:not([data-preview-suspended]):not([data-picture-open]):not(:has(dialog[open])) .preview-header:has(> .preview-dock > .image-seat)::after { opacity: 1; clip-path: inset(0); }
  body[data-preview-ready][data-preview-docked]:not([data-preview-suspended]):not([data-picture-open]):not(:has(dialog[open])):has(.preview-header > .preview-dock > .image-seat) .tools { border-top-color: transparent; }
  /* Holds restore the normal-flow presentation immediately, including when
     inspection borrows the image before the controller's next refresh. */
  body:is(:not([data-preview-ready]),[data-preview-suspended],[data-picture-open],:has(dialog[open]),:not(:has(.preview-header > .preview-dock > .image-seat))) .preview-header::after { opacity: 0; transition: none; }
  body:is(:not([data-preview-ready]),[data-preview-suspended],[data-picture-open],:has(dialog[open]),:not(:has(.preview-header > .preview-dock > .image-seat))) .tools { border-top-color: var(--site-line); transition: none; }
  @supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
    body[data-preview-ready][data-preview-docked]:not([data-preview-suspended]):not([data-picture-open]):not(:has(dialog[open])) .preview-header:has(> .preview-dock > .image-seat) { background: linear-gradient(var(--site-ink) 0 var(--preview-pin-top),transparent var(--preview-pin-top)); }
    .preview-header::before {
      background: color-mix(in srgb,var(--site-ink) 84%,transparent);
      -webkit-backdrop-filter: blur(32px); backdrop-filter: blur(32px);
    }
  }
  @media(prefers-reduced-transparency:reduce) {
    body[data-preview-ready][data-preview-docked]:not([data-preview-suspended]):not([data-picture-open]):not(:has(dialog[open])) .preview-header:has(> .preview-dock > .image-seat) { background: linear-gradient(var(--site-surface) 0 var(--preview-pin-top),transparent var(--preview-pin-top)); }
    .preview-header::before { background: var(--site-surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
  }

}
/* Block-layout phones keep the same Compare-to-divider gap before docking.
   Real padding prevents the anchor margin collapsing through its column; the
   one-pixel natural border shares the pinned line's outer eight-pixel seat.
   Scopes keep their existing separate divider, as does the landscape sidebar. */
@media(max-width:680px) {
  @media not all and (min-width:600px) and (max-height:500px) {
    .picture-column:not(:has(> .scope-disclosure:not([hidden]))) { margin-bottom: 0; padding-bottom: calc(var(--site-space-2) - 1px); }
  }
}
/* Landscape has the same quiet breathing room around a docked picture.
   A device safe inset replaces the gutter when it is larger. */
@media(min-width:600px) and (max-width:1024px) and (max-height:500px) {
  .preview-anchor { --preview-pin-top: max(env(safe-area-inset-top,0px),var(--site-space-5)); }
  body[data-preview-ready] .preview-track > .preview-header { margin-left: calc(-1 * var(--preview-track-left)); width: calc(var(--preview-dock-width) + 2 * var(--preview-track-left)); }
  .preview-header::after { clip-path: inset(0); transition: opacity 280ms cubic-bezier(.2,.8,.2,1); }
}

@media(prefers-reduced-motion:reduce) {
  .preview-dock,.preview-header::after,.tools { transition: none; }
}

/* Phone controls keep the compact rhythm with labels readable at arm’s length. */
@media(max-width:780px), (max-width:1024px) and (max-height:500px) {
  .project-commands > button { font-size: 14px; }
  .viewer-toolbar :is(.view-modes,.orientation-switch) button { font-size: 13px; padding-inline: 6px; }
  .view-options { flex-wrap: wrap; }
  .scopes-control,.tool-tabs button,.wheel-tabs button,.curve-channel-tabs button,
  .wheel-heading button,.wheel-values label,.base-look-hint,.picture-access { font-size: 13px; }
  .reference-card,.reference-upload,.curve-caption { font-size: 12px; }
}

/* Exact entry keeps completion and feedback beside the field, never pinned. */
.numeric-done { min-width: var(--site-target); min-height: var(--studio-control-height); padding-inline: var(--site-space-2); justify-self: end; color: var(--site-paper); font-size: 13px; background: transparent; }
.numeric-done:hover:not(:disabled) { background: transparent; color: var(--site-paper-hover); }
.numeric-validation { align-self: center; min-width: 0; margin: 0; color: var(--site-accent); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.numeric-done[hidden],.numeric-validation[hidden] { display: none; }
.dial-shell > .numeric-done { grid-column: 2; grid-row: 2; }
.dial-shell > .numeric-validation { grid-column: 1; grid-row: 2; }
.numeric-field { min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) auto; align-content: start; }
.numeric-field > label { grid-column: 1 / -1; }
.numeric-field > input { grid-column: 1 / -1; grid-row: 2; }
.numeric-field > .numeric-done { grid-column: 2; grid-row: 3; }
.numeric-field > .numeric-validation { grid-column: 1; grid-row: 3; }


/* Frequent mobile actions have a quiet, stable seat independent of page scroll. */
.mobile-actions,.mobile-actions[hidden] { display: none; }
@media(max-width:780px), (max-width:1024px) and (max-height:500px) {
  /* One surface, one transition. Fixed seats never change as the header leaves
     view. Native transitions reverse from the current position without timers. */
  .mobile-actions { position: fixed; z-index: 12; bottom: calc(env(safe-area-inset-bottom,0px) + 8px); inset-inline: 0; margin-inline: auto; display: grid; grid-template-columns: 90px 106px; align-items: center; gap: var(--site-space-2); width: max-content; max-width: calc(100% - 16px); padding: 4px; border: 1px solid var(--site-line); border-radius: var(--site-radius-control); background: var(--site-surface); box-shadow: 0 4px 24px #0006; opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(calc(100% + env(safe-area-inset-bottom,0px) + 16px)); transition: transform 600ms cubic-bezier(.22,.61,.36,1), opacity 400ms ease, visibility 0s linear 600ms; }
  .mobile-actions[hidden] { display: none; }
  .mobile-actions[data-visible] { opacity: 1; visibility: visible; pointer-events: auto; transform: none; transition-delay: 0s; }
  .mobile-actions .history { flex: none; }
  .mobile-actions .history button { flex: none; }
  .mobile-actions .history-vector { display: block; flex: none; width: 20px; height: 20px; pointer-events: none; }
  .mobile-actions .primary { min-height: 44px; padding-inline: 8px; font-size: 13px; border-radius: var(--site-radius-control); white-space: nowrap; }
  body[data-preview-suspended] .mobile-actions,body:has(dialog[open]) .mobile-actions { opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(calc(100% + env(safe-area-inset-bottom,0px) + 16px)); transition: none; }
  .project-commands .history { display: flex; position: static; flex: none; }
    .studio-footer { padding-bottom: calc(80px + env(safe-area-inset-bottom,0px)); }
  .tools { padding-bottom: calc(var(--preview-scroll-clearance,0px) + 80px + env(safe-area-inset-bottom,0px)); }
}

@media(prefers-reduced-motion:reduce) { .mobile-actions { transition: none; } }

/* Short landscape phones keep a full picture beside the editing rail. */
@media(min-width:600px) and (max-width:1024px) and (max-height:500px) {
  .project-bar { display: flex; align-items: center; }
  .project-identity { flex: 1 1 0; min-width: 0; grid-template-columns: minmax(0,1fr) var(--site-target); margin-bottom: 0; padding-right: 0; }
  .project-commands { flex: 0 0 auto; width: auto; display: flex; flex-wrap: nowrap; margin-inline-start: auto; }
  .project-commands > button { flex: none; width: auto; }
  .project-commands #project-open,.project-commands #save-look { margin-inline: 0; }
  .workspace { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 20px; }
  /* Reserve Compare plus its gap, the existing 80px action-bar clearance,
     and the shelf's 8px bottom inset when the landscape viewport is short. */
  .picture-column { grid-column: 1; --preview-height: min(65svh,calc(100svh - max(env(safe-area-inset-top,0px),var(--site-space-5)) - env(safe-area-inset-bottom,0px) - var(--site-target) - var(--site-space-2) - 80px - var(--site-space-2))); }
  .tools { grid-column: 2; padding-top: 0; border-top: 0; padding-left: var(--site-space-4); border-left: 1px solid var(--line); padding-bottom: calc(80px + env(safe-area-inset-bottom,0px)); }
  .viewer-toolbar { gap: 4px; }
  .view-options { flex-basis: 100%; justify-content: space-between; gap: 4px; }
  .viewer-toggles { margin-left: 0; }
  .viewer-toolbar :is(.view-modes,.orientation-switch) button { font-size: 12px; padding-inline: 4px; }
  .tools :is(input,select,button,[tabindex]) { scroll-margin-top: 12px; }
  :root { scroll-padding-top: 12px; }
}

/* Full-picture inspection uses the existing canvas pair and comparison state. */
.picture-dialog { position: fixed; inset: 0; margin: 0; width: 100%; max-width: none; height: 100dvh; max-height: none; box-sizing: border-box; padding: calc(env(safe-area-inset-top,0px) + 8px) calc(env(safe-area-inset-right,0px) + 12px) calc(env(safe-area-inset-bottom,0px) + 12px) calc(env(safe-area-inset-left,0px) + 12px); border: 0; border-radius: 0; background: #10100f; overflow: hidden; }
.picture-dialog[open] { display: flex; flex-direction: column; align-items: center; gap: 8px; animation: none; }
.picture-dialog::backdrop { background: #10100f; }
.picture-dialog > .dialog-heading { display: flex; justify-content: flex-end; width: 100%; margin: 0; flex: none; }
.picture-dialog-close { align-self: flex-end; flex: none; width: 44px; height: var(--studio-control-height); padding: 10px; background: transparent; color: var(--site-paper); }
.picture-dialog-gate { flex: 1; min-height: 0; width: 100%; display: grid; place-items: center; container-type: size; }
.picture-dialog-gate .image-seat { --picture-aspect: var(--photo-aspect-ratio,.5625); width: min(100cqw,calc(100cqh * var(--picture-aspect))); height: min(100cqh,calc(100cqw / var(--picture-aspect))); aspect-ratio: var(--picture-aspect); margin: 0; }
.picture-dialog-gate .image-seat[data-orientation=landscape] { --picture-aspect: var(--photo-aspect-ratio,1.777777778); }
#picture-dialog-comparison { flex: none; width: min(100%,560px); }
.picture-dialog .viewer-bottom { width: 100%; margin: 0; }
.picture-dialog .wipe-control { max-width: none; }
body[data-picture-open] .preview-dock { box-shadow: none; }
/* Short landscape inspection gives the picture the full available height.
   Close and Compare sit beside it rather than shrinking it with stacked rows. */
@media(orientation:landscape) and (max-height:500px) {
  .picture-dialog[open] { display: grid; grid-template-columns: minmax(0,1fr) min(180px,24vw); grid-template-rows: var(--site-target) minmax(0,1fr); align-items: stretch; column-gap: var(--site-space-3); row-gap: var(--site-space-2); }
  .picture-dialog-gate { grid-column: 1; grid-row: 1 / -1; min-width: 0; }
  .picture-dialog > .dialog-heading { grid-column: 2; grid-row: 1; align-self: start; }
  #picture-dialog-comparison { grid-column: 2; grid-row: 2; align-self: end; min-width: 0; width: 100%; }
  .picture-dialog .wipe-control { flex-direction: column; align-items: stretch; gap: 0; }
  .picture-dialog .wipe-control > span { width: auto; }
}


@media(max-width:680px) { .project-identity { padding-right: 0; } .project-commands { grid-template-columns: repeat(2,minmax(0,1fr)); } }

/* Let the picture and the editing rail carry the workspace. Supporting actions
   live in compact menus and keep the shared desktop/touch target dimensions. */
.editor-heading { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.project-bar { gap: var(--site-space-3); padding-block: var(--site-space-2); margin-bottom: var(--site-space-5); border-top: 0; }
.project-identity { flex: 1 1 220px; min-width: 0; grid-template-columns: minmax(0,340px) var(--studio-control-height); }
.project-identity input { max-width: none; min-height: var(--studio-control-height); font-size: 18px; }
.look-actions > summary { width: var(--studio-control-height); min-width: var(--studio-control-height); min-height: var(--studio-control-height); }
.project-commands { flex: none; flex-wrap: nowrap; margin-left: auto; }
.project-commands .history button { width: var(--studio-control-height); min-height: var(--studio-control-height); }
.look-actions-panel { min-width: 172px; box-shadow: 0 12px 28px #0007; }
.look-actions-panel button { min-height: var(--studio-control-height); border-radius: var(--studio-control-radius); font-size: 13px; }
.look-actions-panel button + button { border-top: 1px solid var(--site-line); border-radius: 0 0 var(--studio-control-radius) var(--studio-control-radius); }
/* Quiet reference actions share one baseline at the top of the editing rail.
   Content-sized labels and adjacent chevrons keep attention on the image. */
.viewer-toolbar { position: relative; z-index: auto; display: flex; flex-wrap: nowrap; align-items: center; gap: var(--site-space-1); min-height: var(--studio-control-height); margin-bottom: var(--site-space-2); padding: 0; border: 0; background: transparent; }
.viewer-toolbar .photo-picker-trigger { display: inline-flex; flex: 0 1 auto; align-items: center; justify-content: flex-start; gap: var(--site-space-1); min-width: 0; width: 100%; max-width: 100%; height: var(--studio-control-height); min-height: var(--studio-control-height); padding: 0 var(--site-space-1); border: 0; border-radius: var(--studio-control-radius); background: transparent; color: var(--site-muted); font-size: 12px; text-align: left; }
.photo-picker-image { display: block; flex: none; width: 20px; height: 20px; border-radius: 4px; overflow: hidden; background: linear-gradient(90deg,#ebdddd 0 16%,#ddc398 16% 32%,#a7b590 32% 48%,#92b6bf 48% 64%,#a495bf 64% 80%,#b69199 80%); }
.photo-picker-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-picker-image img[hidden] { display: none; }
#photo-picker-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-suggest-slot { display: flex; align-items: center; flex: none; min-width: 0; }
.photo-suggest-slot:empty { display: none; }
.photo-suggest-slot #suggest-looks { height: var(--studio-control-height); min-height: var(--studio-control-height); padding-inline: var(--site-space-2); border: 0; border-radius: var(--studio-control-radius); background: transparent; color: var(--site-muted); font-size: 12px; white-space: nowrap; }
.photo-suggest-slot #suggest-looks:hover:not(:disabled) { color: var(--site-paper); background: var(--site-control); }
.viewer-toolbar > .view-options-menu { position: relative; flex: none; margin-left: auto; }
.view-options-trigger { justify-content: center; gap: var(--site-space-1); min-width: 58px; height: var(--studio-control-height); min-height: var(--studio-control-height); padding-inline: var(--site-space-2); border-radius: var(--studio-control-radius); color: var(--site-muted); font-size: 12px; }
.view-options-trigger[data-popup-open],.view-options-trigger:hover { color: var(--site-paper); background: transparent; }
.viewer-toolbar :is(.photo-picker-trigger,.view-options-trigger,#suggest-looks):hover:not(:disabled) { color: var(--site-paper); background: color-mix(in srgb,var(--site-paper) 5%,transparent); }
body:has(#suggestion-dialog[open]) #suggest-looks,
.viewer-toolbar :is(.photo-picker-trigger,.view-options-trigger,#suggest-looks):is([aria-expanded=true],[data-popup-open],:focus-visible) { color: var(--site-paper); }
.view-options-panel { width: 228px; max-width: calc(100vw - 32px); padding: var(--site-space-2); border: 1px solid var(--site-line); border-radius: var(--site-radius-control); background: var(--site-surface); box-shadow: 0 12px 28px #0008; }
.view-options-panel .orientation-switch { display: flex; justify-content: space-between; width: 100%; margin: 0 0 var(--site-space-1); }
.view-options-panel .orientation-switch button { flex: 1; min-width: 0; min-height: var(--studio-control-height); font-size: 12px; }
.view-options-panel > div + div { border-top: 1px solid var(--site-line); }
.view-options-panel .scopes-control,.view-options-panel .studio-ui-checkbox-label { display: flex; align-items: center; min-height: var(--studio-control-height); padding-inline: var(--site-space-2); font-size: 12px; white-space: nowrap; }
.view-options-panel .studio-ui-checkbox-label { gap: var(--site-space-2); cursor: pointer; }
.picture-dialog .viewer-bottom { display: flex; }
.photo-picker-dialog { width: min(720px,calc(100% - 48px)); }
.photo-picker-dialog .reference-strip { display: grid; grid-template-columns: repeat(auto-fill,minmax(104px,1fr)); gap: var(--site-space-4); overflow: visible; margin: 0; padding: 4px; }
.photo-picker-dialog .reference-card,.photo-picker-dialog .reference-upload { display: flex; flex-direction: column; width: 100%; min-width: 0; gap: var(--site-space-2); padding: 0; color: var(--site-muted); font-size: 12px; line-height: 1.35; text-align: left; }
.photo-picker-dialog .reference-card[hidden] { display: none; }
.photo-picker-dialog .reference-card img,.photo-picker-dialog .reference-card canvas,.photo-picker-dialog .chart-thumb,.photo-picker-dialog .reference-upload-icon { display: block; width: 100%; height: auto; aspect-ratio: 4/3; border-radius: var(--studio-control-radius); object-fit: cover; }
.photo-picker-dialog .reference-upload-icon { display: grid; place-items: center; font-size: 28px; }
.photo-picker-dialog .reference-card > span:last-child,.photo-picker-dialog .reference-upload > span:last-child { min-height: 0; }
.photo-picker-dialog .reference-card[aria-pressed=true] { color: var(--site-paper); }
.base-look-hint.visually-hidden { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.tools .tool-tabs { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 2px; overflow: visible; width: 100%; margin-inline: 0; padding-inline: 0; }
.tools .tool-tabs button { min-width: 0; min-height: var(--studio-control-height); width: 100%; padding-inline: 2px; text-align: center; white-space: nowrap; font-size: 11px; }
.dial-shell:not(.is-adjusted) > .control-reset { opacity: .3; }
.starting-heading .start-over { height: var(--studio-control-height); min-height: var(--studio-control-height); }
@media(max-width:900px) {
  .viewer-toolbar { display: flex; }
}
@media(max-width:680px) {
  .project-bar { display: flex; flex-wrap: wrap; align-items: center; }
  .project-identity { flex: 1 1 100%; margin-bottom: 0; }
  .project-commands { display: flex; width: 100%; justify-content: space-between; }
  .project-commands .history { position: static; }
  .project-commands > button { flex: none; width: auto; }
  .picture-column { margin-bottom: var(--site-space-4); }
  .photo-picker-dialog { width: calc(100% - 32px); }
  .photo-picker-dialog .reference-strip { grid-template-columns: repeat(3,minmax(0,1fr)); gap: var(--site-space-3); }
  .tools .tool-tabs button { font-size: 10px; }
}
@media(max-width:780px), (max-width:1024px) and (max-height:500px), (any-pointer:coarse) {
  .project-identity input,.project-commands .history button,.look-actions-panel button,
  .viewer-toolbar .photo-picker-trigger,.photo-suggest-slot #suggest-looks,
  .view-options-trigger,.view-options-panel .orientation-switch button,
  .view-options-panel .scopes-control,.view-options-panel .studio-ui-checkbox-label,
  .view-options-trigger { min-height: var(--studio-control-height); }
  .viewer-toolbar .photo-picker-trigger,.photo-suggest-slot #suggest-looks,.view-options-trigger { height: var(--studio-control-height); }
  .project-identity { grid-template-columns: minmax(0,1fr) var(--site-target); }
  .look-actions > summary { width: var(--site-target); min-width: var(--site-target); min-height: var(--studio-control-height); }
  .tools .tool-tabs button { min-height: var(--studio-control-height); font-size: 14px; font-weight: 500; padding-inline: 1px; }
  .photo-picker-image { width: 20px; height: 20px; }
}

/* Real Base UI trigger and popup boundaries share the select icon geometry. */
.viewer-toolbar > .photo-picker-mount { flex: 0 1 auto; min-width: 0; max-width: min(62%,280px); }
.studio-ui-button { display: inline-flex; align-items: center; justify-content: center; gap: var(--site-space-2); }
.studio-ui-chevron { display: block; flex: none; width: 12px; height: 12px; color: var(--site-muted); }
button[aria-expanded=true] > .studio-ui-chevron { transform: rotate(180deg); }
.viewer-toolbar .view-options-trigger { display: inline-flex; align-items: center; font-size: 12px; }
.studio-ui-popover-positioner { z-index: 40; }
.studio-view-popup { outline: none; max-height: var(--available-height); overflow-y: auto; overscroll-behavior: contain; }
.studio-view-popup[data-closed] { display: none; }
.view-options-panel .orientation-switch { gap: var(--site-space-1); }
.view-options-panel .orientation-switch button { border-radius: var(--studio-control-radius); color: var(--site-muted); padding-inline: var(--site-space-2); }
.view-options-panel .orientation-switch button[data-checked] { color: var(--site-paper); background: var(--site-control); text-decoration: none; }
@media (max-width:360px) {
  .viewer-toolbar .photo-picker-trigger { padding-inline: var(--site-space-2); }
  .photo-picker-trigger .photo-picker-image { display: none; }
  .photo-suggest-slot #suggest-looks { padding-inline: var(--site-space-2); font-size: 12px; }
}

/* The toolbar adapts to its picture column, including narrow landscape rails. */
.viewer-toolbar { container-type: inline-size; }
@container (max-width:320px) {
  .photo-picker-trigger .photo-picker-image { display: none; }
  #photo-suggest-slot #suggest-looks { font-size: 12px; padding-inline: var(--site-space-2); }
}
@media(min-width:600px) and (max-width:1024px) and (max-height:500px) {
  main { padding-top: var(--site-space-2); }
  .project-bar { flex-wrap: nowrap; margin-bottom: var(--site-space-3); }
  .project-identity { flex: 1 1 0; }
  .project-commands { width: auto; }
}

/* Stable actions: reset controls remain visible, and project commands are direct. */
.project-identity { grid-template-columns: minmax(0,1fr); }
.project-commands { gap: var(--site-space-2); }
.project-commands .history { margin-right: var(--site-space-2); }
.project-commands > button { min-height: var(--studio-control-height); padding-inline: var(--site-space-3); white-space: nowrap; }
@media(max-width:780px), (max-width:1024px) and (max-height:500px), (any-pointer:coarse) {
  .project-commands > button { min-height: var(--studio-control-height); }
}
.project-action-icon { display: none; width: 20px; height: 20px; flex: none; }
/* Mobile commands share the photo toolbar's spacing and keep full touch targets. */
@media(max-width:780px), (max-width:1024px) and (max-height:500px) {
  .project-bar { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: var(--site-space-2); }
  .project-bar #share-feedback { grid-column: 1 / -1; }
  .project-identity { flex: 1 1 0; margin: 0; }
  .project-identity input { font-size: 16px; text-overflow: ellipsis; }
  .project-commands { width: auto; margin: 0; justify-content: flex-start; gap: var(--site-space-2); }
  .project-commands .history { gap: var(--site-space-2); margin: 0; }
  .project-commands > button { padding-inline: var(--site-space-2); }
  .project-commands #save-look { margin: 0; }
  .project-commands :is(#project-open,#project-new) { display: grid; place-items: center; width: var(--site-target); height: var(--site-target); padding: 0; }
  .project-action-icon { display: block; }
  .project-action-label { display: none; }
}
@media(max-width:340px) {
  .project-bar { margin-inline: calc(-1 * var(--site-space-3)); }
  .project-commands #save-look { width: var(--site-target); padding-inline: 0; font-size: 12px; }
}

/* Pointer focus stays available for restoration without a keyboard-style ring.
   Inputs retain their editing cues; selected Palette swatches retain their own
   outline. A keyboard interaction reveals focus even on a touch device. */
:root[data-studio-focus=pointer] :is(button,a,summary,[role=slider],.wheel,.image-seat[role=button]):focus-visible { outline-color: transparent; }
:root[data-studio-focus=pointer] .swatch[data-active]:focus-visible { outline: 1px solid var(--site-paper); outline-offset: 3px; }
:root[data-studio-focus=pointer] .site-select-trigger:focus-visible { border-color: var(--site-line); }
:root[data-studio-focus=keyboard] :is(button,a,summary,[role=slider],.wheel,.image-seat[role=button]):focus { outline: var(--site-focus-width) solid var(--site-paper); outline-offset: var(--site-focus-offset); }
:root[data-studio-focus=keyboard] .image-seat[role=button]:focus { outline-offset: -3px; }

/* Portrait gives the Look name its own row and groups actions by purpose. */
@media(max-width:780px) and (orientation:portrait) {
  .project-bar { grid-template-columns: minmax(0,1fr); gap: var(--site-space-3); margin-inline: 0; padding-bottom: var(--site-space-3); border-bottom: 1px solid var(--site-line); }
  .project-identity { padding-bottom: var(--site-space-3); border-bottom: 1px solid var(--site-line); }
  .project-identity input { font-size: 22px; }
  .project-commands { width: 100%; }
  .project-commands .history { margin-right: auto; }
  .project-commands :is(#project-open,#project-new,#save-look) { display: inline-flex; width: auto; min-width: var(--site-target); padding-inline: var(--site-space-3); font-size: 14px; }
  .project-action-icon { display: none; }
  .project-action-label { display: inline; }
}
@media(max-width:360px) and (orientation:portrait) {
  .project-commands :is(#project-open,#project-new,#save-look) { font-size: 12px; }
}
@media(max-width:340px) and (orientation:portrait) {
  .project-commands { gap: var(--site-space-1); }
  .project-commands .history { gap: 0; }
}

@media(min-width:600px) and (max-width:700px) and (max-height:500px) {
  .tools .tool-tabs button { font-size: 13px; padding-inline: 0; }
}

/* Project actions belong to the masthead; the name row keeps its history. */
.studio-masthead { gap: var(--site-space-3); flex-wrap: wrap; }
.masthead-actions { display: flex; flex: none; align-items: center; justify-content: flex-end; gap: var(--site-space-2); margin-left: auto; }
.masthead-actions > button { display: inline-flex; flex: none; align-items: center; justify-content: center; gap: var(--site-space-2); height: var(--studio-control-height); min-height: var(--studio-control-height); min-width: var(--site-target); padding-inline: var(--site-space-3); border-radius: var(--studio-control-radius); font-size: 12px; white-space: nowrap; }
.masthead-actions .project-action-icon { display: none; }
.masthead-actions .project-action-label { display: inline; }
.project-bar { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: var(--site-space-2); margin-inline: 0; padding-block: var(--site-space-2); border-top: 0; }
.project-bar .project-identity { min-width: 0; margin: 0; padding: 0; border: 0; }
.project-bar .project-commands { display: flex; flex: none; width: auto; margin: 0; justify-content: flex-end; gap: 0; }
.project-commands .history { position: static; flex: none; gap: 0; margin: 0; }
@media(max-width:359px) {
  .studio-masthead { gap: var(--site-space-2); }
  .masthead-actions { gap: var(--site-space-1); }
  .masthead-actions :is(#project-open,#project-new) { width: var(--site-target); padding-inline: 0; }
  .masthead-actions .project-action-icon { display: block; }
  .masthead-actions .project-action-label { display: none; }
}

/* Reference choices read as a caption; only picture and Compare pin above. */
.picture-column > .viewer-toolbar { margin-top: var(--site-space-2); margin-bottom: 0; }
.viewer-toolbar .photo-picker-trigger .photo-picker-image { display: none; }

/* Base Look owns a full-width selection; enhanced actions live in its popup. */
.tools .starting-point { display: grid; grid-template-columns: minmax(0,1fr); align-items: center; column-gap: var(--site-space-2); row-gap: var(--site-space-1); margin-bottom: var(--site-space-5); }
.tools .starting-point .starting-heading { display: contents; }
.tools .starting-point label { grid-column: 1 / -1; grid-row: 1; }
.tools .starting-point > :is(select,.site-select) { grid-column: 1; grid-row: 2; min-width: 0; margin-top: 0; }
.starting-point > .base-look-actions { grid-column: 1 / -1; grid-row: 3; display:flex;align-items:center;flex-wrap:wrap;gap:var(--site-space-2); }
.base-look-reset { min-height:var(--studio-control-height);padding:0 var(--site-space-2);color:var(--site-muted);font-size:12px;text-align:left; }
.tools .starting-point :is(.site-select-trigger,select:not(.site-select-source)) { height: var(--studio-control-height); min-height: var(--studio-control-height); }

.tool-picker {display:none;margin-bottom:var(--site-space-4);}
.tool-picker > :is(select,.site-select) {width:100%;}
@container(width < 320px){.tools #tool-tabs{display:none;}.tools .tool-picker{display:block;}}
.tools #tool-tabs[hidden],.tools .tool-picker[hidden] {display:none;}

/* Grading categories share one quiet track, distinct from preview toggles.
   Inset fill is decorative; each slot retains the full shared control height.
   Keep ::after available for the existing adjustment dot. */
.tools .tool-tabs { height: var(--studio-control-height); min-height: var(--studio-control-height); gap: 0; padding: 0; border: 0; border-radius: var(--studio-control-radius); background: var(--site-surface); box-shadow: inset 0 0 0 1px var(--site-line); }
.tools .tool-tabs button { height: var(--studio-control-height); min-height: var(--studio-control-height); margin: 0; padding-inline: 0; border: var(--site-space-1) solid transparent; border-radius: var(--studio-control-radius); background: transparent; background-clip: padding-box; text-decoration: none; }
.tools .tool-tabs button:hover:not(:disabled) { background: color-mix(in srgb,var(--site-paper) 5%,transparent); background-clip: padding-box; }
.tools .tool-tabs button:is([data-active],[aria-pressed=true]),.tools .tool-tabs button:is([data-active],[aria-pressed=true]):hover:not(:disabled) { color: var(--site-paper); background: color-mix(in srgb,var(--site-paper) 16%,var(--site-control)); background-clip: padding-box; text-decoration: none; }

@container (max-width: 260px) {
  .tools .tool-tabs button { font-size: 12px; }
}

/* Compact siblings follow the same shared token as the masthead and Home CTA.
   Art tiles, curve handles, Compare and content rows retain their own geometry. */
.site-select-trigger,[data-site-selects] select:not(.site-select-source) { height: var(--studio-control-height); min-height: var(--studio-control-height); padding-block: 0; }
.site-select-option { min-height: var(--studio-control-height); padding-block: var(--site-space-2); }
.cover-editor :is(.cover-pattern,.site-select-trigger,.cover-variation,.cover-stack-arrow),.cover-editor .cover-actions button,.cover-editor .cover-direction-group .studio-ui-choice { height: var(--studio-control-height); min-height: var(--studio-control-height); padding-block: 0; }
.cover-editor .cover-stack-arrow { width: var(--studio-control-height); min-width: var(--studio-control-height); }
.suggestion-dialog .suggestion-card .secondary-action,.suggestion-dialog .suggestion-toolbar .secondary-action { height: var(--studio-control-height); min-height: var(--studio-control-height); }

/* Preview functions stay quiet above the picture; photo choices belong with the base. */
.picture-column > .viewer-toolbar { display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center; justify-content: flex-start; gap: var(--site-space-2); min-height: var(--studio-control-height); margin: 0 0 var(--site-space-3); padding: 0; border: 0; border-radius: 0; background: transparent; }
.viewer-toolbar > div { flex: none; min-width: 0; }
.viewer-toolbar #orientation-controls[hidden] { display: none; }
.viewer-toolbar .preview-orientation,.viewer-toolbar .scopes-control { display: inline-flex; position: relative; flex: none; align-items: center; justify-content: center; gap: 6px; height: var(--studio-control-height); min-height: var(--studio-control-height); min-width: var(--site-target); margin: 0; padding: 0 var(--site-space-1); border: 0; border-radius: var(--studio-control-radius); background: transparent; color: var(--site-muted); font-size: 12px; white-space: nowrap; cursor: pointer; text-decoration: none; }
/* Reserve the longer label so changing orientation never moves its neighbors. */
.viewer-toolbar .preview-orientation { inline-size: calc(10ch + var(--site-space-5)); justify-content: flex-start; color: var(--site-paper); }
.viewer-toolbar > #scopes-control-mount { margin-inline-start: auto; }
.viewer-toolbar .scopes-control:has(.studio-ui-checkbox[data-checked],input:checked) { color: var(--site-paper); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
/* Text toggles keep only their underline state, including Safari's retained
   touch hover. The label still owns the full activation target below. */
.viewer-toolbar .scopes-control { -webkit-tap-highlight-color: transparent; }
.viewer-toolbar .preview-orientation:hover:not(:disabled) { background: var(--site-control-hover); }
/* Keep the real checkbox as the full activation surface, without a second button. */
.viewer-toolbar .scopes-control :is(.studio-ui-checkbox,input[type=checkbox]) { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: inherit; }
.viewer-toolbar .scopes-control:has(:focus-visible),:root[data-studio-focus=keyboard] .viewer-toolbar .scopes-control:has(:focus) { outline: var(--site-focus-width) solid var(--site-paper); outline-offset: var(--site-focus-offset); }
:root[data-studio-focus=pointer] .viewer-toolbar .scopes-control:has(:focus-visible) { outline-color: transparent; }
/* The two top rows share centered text metrics as well as control heights. */
.viewer-toolbar :is(.preview-orientation,.scopes-control) { font-size: 12px; font-weight: 400; line-height: var(--site-space-4); }
.viewer-toolbar .preview-orientation,.viewer-toolbar .scopes-control { gap: var(--site-space-1); }

/* Photo choice stays in the normal-flow toolbar. Orientation belongs to the
   image, outside the inspection button, and never enters the full-screen gate. */
.viewer-toolbar > .photo-picker-mount { flex: none; width: auto; max-width: none; }
.viewer-toolbar .photo-picker-trigger { display: inline-flex; width: auto; height: var(--studio-control-height); min-height: var(--studio-control-height); min-width: var(--site-target); padding: 0 var(--site-space-1); color: var(--site-paper); font-size: 12px; font-weight: 400; line-height: 16px; white-space: nowrap; }
.viewer-toolbar .photo-picker-trigger::before { content: none; }
.preview-dock { container-type: inline-size; container-name: preview-gate; }
.preview-dock > #orientation-controls { position: absolute; z-index: 2; right: var(--site-space-2); bottom: calc(var(--preview-controls-height) + var(--site-space-2)); width: auto; }
.preview-dock:not(:has(> .image-seat)) > #orientation-controls { visibility: hidden; }
.preview-dock .preview-orientation { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: auto; height: var(--studio-control-height); min-height: var(--studio-control-height); min-width: var(--site-target); padding: 0 var(--site-space-2); border: 1px solid #ffffff40; border-radius: var(--studio-control-radius); background: #171714f2; color: var(--site-paper); font-size: 12px; font-weight: 400; line-height: 16px; white-space: nowrap; }
.preview-dock .preview-orientation::before { content: none; }
.preview-dock .preview-orientation:hover:not(:disabled) { background: #292925f2; }
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .preview-dock .preview-orientation { background: #171714c9; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
}
@media(prefers-reduced-transparency:reduce) {
  .preview-dock .preview-orientation { background: var(--site-surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@container preview-gate (max-width:160px) {
  .preview-dock > #orientation-controls { right: var(--site-space-1); bottom: calc(var(--preview-controls-height) + var(--site-space-1)); }
  .preview-dock .preview-orientation { width: auto; min-width: var(--site-target); padding-inline: calc(var(--site-space-1)/2); }
  .preview-dock .preview-orientation-label { display: inline; }
}
/* In the native-select fallback the same real action remains usable below it. */


/* Photo browsing uses the same shallow, perspective stack as cover colors.
   Child translations resolve cqw against the explicit gallery width; the fit
   cap retains a4px gutter beyond both far-card edges in a narrow dialog.
   The centered original button commits; its neighbors only browse. */
.photo-picker-dialog { width: min(640px,calc(100% - 32px)); overflow: hidden; }
.photo-picker-dialog[open] { display: flex; flex-direction: column; }
.photo-picker-dialog > :is(.dialog-heading,.photo-stack-actions) { flex: none; }
.photo-picker-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.photo-picker-dialog .reference-strip.photo-stack { --photo-drag: 0px; --photo-card-height: min(48dvh,290px); --photo-card-width: calc(var(--photo-card-height)*9/16); --photo-step: min(14vw,72px,calc(var(--photo-card-width)*.4),calc((100cqw - var(--photo-card-width)*.72 - 8px)/4)); display: block; position: relative; width: 100%; height: calc(var(--photo-card-height) + 28px); container-type: inline-size; margin: 0; padding: 0; overflow: hidden; isolation: isolate; touch-action: pan-y pinch-zoom; user-select: none; -webkit-user-select: none; }
.photo-picker-dialog .reference-strip.photo-stack[data-orientation=landscape] { --photo-card-width: min(58vw,340px,calc(48dvh*16/9)); --photo-card-height: calc(var(--photo-card-width)*9/16); }
.photo-picker-dialog .photo-stack .reference-card { --photo-yaw: 0deg; position: absolute; top: 12px; left: calc(50% - var(--photo-card-width)/2); display: block; width: var(--photo-card-width); height: var(--photo-card-height); min-width: 44px; min-height: 44px; padding: 0; overflow: hidden; border: 1px solid #ffffff38; border-radius: 18px; background: #171714; color: white; box-shadow: 0 8px 18px #0003; transform: translateX(calc(var(--photo-offset)*var(--photo-step) + var(--photo-drag))) perspective(520px) rotateY(var(--photo-yaw)) scale(.84); transition: transform 280ms cubic-bezier(.2,.8,.2,1),opacity 280ms ease; }
.photo-picker-dialog .photo-stack .reference-card[data-offset='-1'] { --photo-yaw: 20deg; }
.photo-picker-dialog .photo-stack .reference-card[data-offset='1'] { --photo-yaw: -20deg; }
.photo-picker-dialog .photo-stack .reference-card:is([data-offset='-2'],[data-offset='2']) { transform: translateX(calc(var(--photo-offset)*var(--photo-step) + var(--photo-drag))) perspective(520px) rotateY(var(--photo-yaw)) scale(.72); opacity: .78; }
.photo-picker-dialog .photo-stack .reference-card[data-offset='-2'] { --photo-yaw: 32deg; }
.photo-picker-dialog .photo-stack .reference-card[data-offset='2'] { --photo-yaw: -32deg; }
.photo-picker-dialog .photo-stack .reference-card[data-offset='0'] { transform: translateX(var(--photo-drag)) perspective(520px) scale(1); cursor: grab; }
.photo-picker-dialog .photo-stack .reference-card[data-visible=false] { visibility: hidden; pointer-events: none; opacity: 0; }
.photo-picker-dialog .photo-stack .reference-card:not([data-offset='0'])::before { content: ''; position: absolute; z-index: 1; inset: 0; background: linear-gradient(90deg,#ffffff0c,transparent 28%,#00000010); box-shadow: inset 1px 1px 0 #ffffff1c,inset -1px -1px 0 #0003; pointer-events: none; }
.photo-picker-dialog .photo-stack .reference-card :is(img,canvas,.chart-thumb) { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; object-fit: contain; outline: 0; pointer-events: none; }
.photo-picker-dialog .photo-stack .reference-card > span:last-child:not(.chart-thumb) { position: absolute; z-index: 2; inset: auto 0 0; min-height: 0; padding: 24px 12px 12px; color: white; background: linear-gradient(transparent,#000b); text-shadow: 0 1px 2px #0008; font-size: 13px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.photo-picker-dialog .photo-stack[data-dragging] .reference-card { transition: none; cursor: grabbing; }
.photo-stack-navigation { display: grid; grid-template-columns: var(--studio-control-height) minmax(0,1fr) var(--studio-control-height); gap: 8px; align-items: center; }
.photo-stack-navigation button { width: var(--studio-control-height); height: var(--studio-control-height); min-height: var(--studio-control-height); padding: 0; border: 1px solid var(--site-line); border-radius: 50%; color: var(--site-muted); font-size: 24px; line-height: 1; }
#photo-stack-status { margin: 0; color: var(--site-paper); font-size: 12px; line-height: 1.4; text-align: center; }
#photo-stack-help { margin: 8px 0 0; color: var(--site-muted); font-size: 12px; line-height: 1.5; text-align: center; }
.photo-stack-actions { display: flex; justify-content: space-between; gap: var(--site-space-2); margin-top: var(--site-space-3); padding-top: var(--site-space-3); border-top: 1px solid var(--site-line); }
.photo-stack-actions button { flex: none; min-width: var(--studio-control-height); height: var(--studio-control-height); min-height: var(--studio-control-height); padding-inline: var(--site-space-3); font-size: 14px; white-space: nowrap; }
@media(max-width:359px) {
  .photo-stack-actions button { padding-inline: var(--site-space-2); }
}
@media(max-height:500px) and (orientation:landscape) {
  .photo-picker-dialog { width: min(640px,calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 16px; }
  .photo-picker-dialog > .dialog-heading { margin-bottom: 8px; }
  .photo-stack-actions { margin-top: 8px; padding-top: 8px; }
}
@media(prefers-reduced-motion:reduce) { .photo-picker-dialog .photo-stack .reference-card { transition: none; } }

/* Authored unavailable uploads remain absent from layout and accessibility. */
.photo-picker-dialog .photo-stack .reference-card[hidden] { display: none; }

/* Content-width cells share text padding and grow evenly. Two paint pixels
   on each side make the internal gap match the four-pixel outer inset. */
.tools .tool-tabs[data-sliding-indicator] { position: relative; isolation: isolate; display: flex; padding-inline: calc(var(--site-space-1)/2); }
.tools .tool-tabs[data-sliding-indicator] button { z-index: 1; flex: 1 1 auto; width: auto; padding-inline: var(--site-space-2); border-inline-width: calc(var(--site-space-1)/2); }
.tools .tool-tabs[data-sliding-indicator] .studio-ui-tab-indicator { position: absolute; z-index: 0; top: 0; left: 0; width: var(--active-tab-width); height: var(--active-tab-height); border: var(--site-space-1) solid transparent; border-inline-width: calc(var(--site-space-1)/2); border-radius: var(--studio-control-radius); background: color-mix(in srgb,var(--site-paper) 16%,var(--site-control)); background-clip: padding-box; pointer-events: none; transform: translate(var(--active-tab-left),var(--active-tab-top)); transition: transform 280ms cubic-bezier(.2,.8,.2,1),width 280ms cubic-bezier(.2,.8,.2,1); }
.tools .tool-tabs[data-sliding-indicator] .studio-ui-tab-indicator[data-instant] { transition: none; }
.tools .tool-tabs[data-sliding-indicator] button:is([data-active],[aria-pressed=true]),.tools .tool-tabs[data-sliding-indicator] button:is([data-active],[aria-pressed=true]):hover:not(:disabled) { background: transparent; }
@media(prefers-reduced-motion:reduce) { .tools .tool-tabs[data-sliding-indicator] .studio-ui-tab-indicator { transition: none; } }

/* Measured narrow rails need less text and padding, with unchanged hit heights. */
@container (max-width:320px) {
  .tools .tool-tabs[data-sliding-indicator] button { font-size: 12px; padding-inline: 6px; }
}
@container (max-width:260px) {
  .tools .tool-tabs[data-sliding-indicator] button { font-size: 11px; padding-inline: var(--site-space-1); }
}

/* Desktop Base Look shares the original History row. The mobile home keeps
   its label and the existing spacing above grading controls. */
.project-bar .project-commands:has(> .starting-point) { min-width: 0; gap: var(--site-space-3); flex-wrap: nowrap; }
.project-commands > .starting-point { display: flex; align-items: center; gap: var(--site-space-2); min-width: 0; margin: 0; }
.project-commands .starting-point .starting-heading { display: contents; }
.project-commands .starting-point label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.project-commands .starting-point > :is(.site-select,select:not(.site-select-source)) { flex: 0 1 auto; width: clamp(160px,22vw,260px); min-width: 0; margin: 0; }
.project-commands .starting-point:has(> .base-look-actions) {flex-wrap:wrap;}
.project-commands .starting-point > .base-look-actions {flex-basis:100%;}

/* Stretch only the existing grid item; block-layout mobile keeps its top divider. */
.workspace > .tools { align-self: stretch; }


/* Secondary channel tabs rest on one continuous baseline. The selected mark
   belongs to that edge, while adjustment status keeps its existing ::after. */
:is(.curve-channel-tabs,.wheel-tabs) { box-shadow: inset 0 -1px 0 var(--site-line); }
:is(.curve-channel-tabs,.wheel-tabs) button { position: relative; }
:is(.curve-channel-tabs,.wheel-tabs) button[data-active],.wheel-tabs button[aria-pressed=true] { text-decoration: none; }
:is(.curve-channel-tabs,.wheel-tabs) button[data-active]::before,.wheel-tabs button[aria-pressed=true]::before { content: ''; position: absolute; inset-inline: var(--site-space-2); bottom: 0; height: 1px; background: var(--site-paper); pointer-events: none; }

/* Keep compact tab targets intact in the narrow landscape editing rail. */
.tools .tool-tabs[data-sliding-indicator] button { min-width: var(--studio-control-height); }
@media(min-width:600px) and (max-width:700px) and (max-height:500px) {
  .workspace > .tools { padding-left: var(--site-space-3); }
}

/* Normal side-by-side editing gives the five tabs a useful rail instead of
   inheriting the site's twelve-column split. Reserve a 320px picture first;
   smaller rails still use the 320px container-based section picker. */
@media (width > 780px) and (height > 500px), (width > 1024px) {
  .workspace { position: relative; --studio-tools-rail: var(--studio-user-tools-rail,clamp(445px,42%,500px)); grid-template-columns: minmax(0,1fr) minmax(0,min(var(--studio-tools-rail),calc(100% - 320px - var(--site-grid-gap)))); }
  .workspace > .picture-column { grid-column: 1; }
  .workspace > .tools { grid-column: 2; padding-left: var(--site-space-5); }
}

.workspace-splitter { position:absolute;top:0;bottom:0;z-index:3;width:var(--studio-control-height);min-height:44px;transform:translateX(-50%);touch-action:none;cursor:col-resize; }
.workspace-splitter[hidden] { display:none; }
.workspace-splitter::before { content:'';position:absolute;inset-block:0;left:50%;border-left:1px solid transparent;pointer-events:none; }
.workspace-splitter::after { content:'';position:absolute;top:clamp(80px,20vh,160px);left:50%;width:3px;height:32px;border-radius:3px;background:var(--site-line);transform:translateX(-50%); }
.workspace-splitter:hover::before,.workspace-splitter:focus::before,.workspace[data-split-resizing] .workspace-splitter::before { border-color:var(--site-paper); }
.workspace-splitter:hover::after,.workspace-splitter:focus-visible::after,.workspace[data-split-resizing] .workspace-splitter::after { background:var(--site-paper); }
.workspace-splitter:focus { outline:none; }
.workspace[data-split-resizing],.workspace[data-split-resizing] * { cursor:col-resize!important;user-select:none; }

/* Palette precision and saved comparison extend the existing controls. */

.palette-actions {display:flex;align-items:center;gap:8px;min-width:0;margin-bottom:var(--site-space-2);}
.palette-actions>button {flex:none;min-height:var(--studio-control-height);padding-inline:12px;border:1px solid var(--site-line);border-radius:var(--studio-control-radius);background:transparent;color:var(--site-muted);font-size:12px;}
.palette-actions>button[aria-pressed=true] {color:var(--site-paper);background:var(--site-control);}
.palette-range {margin-top:var(--site-space-2);}
.palette-range-title {display:flex;align-items:center;min-height:var(--studio-control-height);margin:0;font-size:12px;font-weight:400;color:var(--site-muted);}
.palette-range>summary {justify-content:flex-start;min-height:var(--studio-control-height);font-size:12px;color:var(--site-muted);}
.palette-range .scopes-control {min-height:var(--studio-control-height);font-size:12px;}
.image-seat.palette-picking {--palette-cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M21 3a4 4 0 0 1 6 6l-4 4 2 2-3 3-2-2L8 28H3v-5L15 11l-2-2 3-3 2 2z' fill='%23171714' stroke='%23fff' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='m7 24 10-10' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E") 3 28,crosshair;cursor:var(--palette-cursor);outline:1px solid var(--site-paper);outline-offset:3px;}
.image-seat.palette-picking,.image-seat.palette-picking canvas {cursor:var(--palette-cursor);touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;}
#palette-loupe {position:fixed;z-index:1000;width:108px;height:108px;border:2px solid var(--site-paper);border-radius:50%;background:var(--site-ink);box-shadow:0 0 0 1px var(--site-ink),0 5px 18px rgb(0 0 0 / .3);pointer-events:none;}
#palette-loupe[hidden] {display:none;}
#palette-pick-feedback {position:absolute;z-index:5;box-sizing:border-box;width:max-content;padding:7px 10px;border:1px solid var(--site-line);border-radius:6px;background:var(--site-ink);color:var(--site-paper);font-size:12px;line-height:1.4;text-align:center;pointer-events:none;}
#palette-pick-feedback[hidden] {display:none;}
#palette-loupe canvas {display:block;width:100%;height:100%;border-radius:50%;}
.palette-loupe-crosshair {position:absolute;left:50%;top:50%;width:15px;height:15px;border:1px solid #fff;box-shadow:0 0 0 1px #171714;transform:translate(-50%,-50%);}
.palette-loupe-crosshair::before,.palette-loupe-crosshair::after {content:'';position:absolute;background:#fff;box-shadow:0 0 0 1px #171714;}
.palette-loupe-crosshair::before {left:6px;top:-5px;width:1px;height:23px;}
.palette-loupe-crosshair::after {left:-5px;top:6px;width:23px;height:1px;}
.palette-loupe-swatch {position:absolute;left:50%;bottom:-8px;width:25px;height:25px;border:2px solid var(--site-paper);border-radius:50%;box-shadow:0 0 0 1px var(--site-ink);transform:translateX(-50%);}
.viewer-bottom#photo-comparison {display:grid;grid-template-columns:minmax(0,1fr);gap:8px;height:auto;min-height:var(--studio-control-height);}
.preview-dock>#photo-comparison {width:100%;margin-inline:0;}
.viewer-bottom#photo-comparison .wipe-control {min-width:0;height:var(--studio-control-height);flex-direction:row;align-items:center;}
.viewer-bottom#photo-comparison .wipe-control>span {flex:none;width:auto;}
.viewer-bottom#photo-comparison .wipe-control input {min-width:0;height:var(--studio-control-height);}
#density-mask {position:absolute;inset:0;width:100%;height:100%;pointer-events:none;}

.swatch-strip .swatch:hover:not(:disabled) {background:var(--swatch);}

/* Precise picked-color Palette retains the shared filled dials. */
.picked-actions {display:block;margin-bottom:16px;}
.picked-actions[hidden] {display:none;}
.picked-target-body>.palette-colors {display:flex;align-items:center;gap:12px;width:100%;min-width:0;margin-bottom:12px;}
.picked-palette .palette-range {margin-bottom:16px;}
.picked-chips {flex:0 1 auto;min-width:0;width:max-content;max-width:100%;}
.picked-chips .picked-chip {flex:0 0 var(--studio-control-height);width:var(--studio-control-height);height:var(--studio-control-height);}
.palette-colors>.picked-add {display:grid;place-items:center;flex:0 0 var(--studio-control-height);width:var(--studio-control-height);height:var(--studio-control-height);min-height:var(--studio-control-height);padding:0;border:1px solid var(--site-line);border-radius:var(--studio-control-radius);background:transparent;color:var(--site-muted);font-size:20px;line-height:1;}
.palette-colors>.picked-add[aria-pressed=true] {color:var(--site-paper);background:var(--site-control);}
.palette-colors>.picked-add[hidden] {display:none;}
.picked-chips .picked-chip {font-size:11px;font-variant-numeric:tabular-nums;}
.picked-chip[aria-pressed=true] {outline:1px solid var(--site-paper);outline-offset:3px;}
.picked-empty {padding:24px 16px;border:1px dashed var(--site-line);border-radius:8px;text-align:center;color:var(--site-muted);font-size:12px;line-height:1.5;}
.picked-targeting {display:flex;align-items:center;gap:16px;margin:2px 0 16px;}
.picked-hue-wheel {position:relative;flex:0 0 144px;width:144px;height:144px;border-radius:50%;touch-action:none;cursor:crosshair;outline:none;}
.picked-hue-wheel:focus-visible {outline:2px solid var(--site-paper);outline-offset:6px;}
.picked-hue-ring {position:absolute;inset:6px;border-radius:50%;background:conic-gradient(#d54d4d,#d4ba4c,#67b14f,#4ba9a5,#4f73c6,#a45fc7,#d54d4d);mask:radial-gradient(transparent 59%,#000 60% 69%,transparent 70%);opacity:.75;pointer-events:none;}
.picked-hue-wheel svg {position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;}
.picked-range-arc {fill:none;stroke:var(--site-paper);stroke-width:2;stroke-linecap:round;}
.picked-hue-marker {position:absolute;width:14px;height:14px;transform:translate(-50%,-50%);border:2px solid var(--site-paper);border-radius:50%;box-shadow:0 0 0 2px var(--site-ink);pointer-events:none;}
.picked-wheel-center {position:absolute;inset:45px;border-radius:50%;display:grid;place-items:center;font-size:12px;font-weight:500;box-shadow:inset 0 0 0 1px #ffffff24;pointer-events:none;}
.picked-selection-actions {display:flex;flex-direction:column;align-items:flex-start;gap:0;min-width:0;}
.picked-selection-actions>button {flex:none;min-height:var(--studio-control-height);padding:0 8px;border:0;border-radius:var(--studio-control-radius);background:transparent;color:var(--site-muted);font-size:12px;white-space:nowrap;}
.picked-selection-actions>button:hover:not(:disabled) {color:var(--site-muted);background:transparent;text-decoration:underline;text-underline-offset:3px;}
.picked-selection-actions>button[aria-pressed=true],.picked-selection-actions>button[aria-pressed=true]:hover:not(:disabled) {color:var(--site-paper);}
.saved-palette {margin-top:20px;border-top:1px solid var(--site-line);}
.saved-palette>summary {min-height:var(--studio-control-height);font-size:12px;color:var(--site-muted);}
.saved-palette-body {padding-top:12px;}
@media(max-width:360px){.picked-targeting{gap:12px;}}

/* Keyboard sampling stays visible without covering or intercepting the picture. */
#palette-sample-point { position:absolute;z-index:4;width:17px;height:17px;border:1px solid #fff;border-radius:50%;box-shadow:0 0 0 1px #171714;transform:translate(-50%,-50%);pointer-events:none; }
#palette-sample-point::before,#palette-sample-point::after { content:"";position:absolute;background:#fff;box-shadow:0 0 0 1px #171714; }
#palette-sample-point::before { width:1px;height:5px;left:7px;top:5px; }
#palette-sample-point::after { width:5px;height:1px;left:5px;top:7px; }

/* Neutral selection shares the hue wheel's footprint and row geometry. */
.picked-hue-wheel[data-neutral=true] .picked-hue-ring {background:conic-gradient(from 225deg,#000 0deg,#808080 135deg,#fff 270deg,transparent 270deg 360deg);opacity:1;filter:drop-shadow(0 0 .6px #aaa);}
.dial-availability {position:absolute;right:12px;color:var(--site-muted);font-size:10px;white-space:nowrap;pointer-events:none;}
.dial-availability[hidden] {display:none;}
.dial-shell.is-disabled .dial {opacity:.6;cursor:default;}
.dial-shell.is-disabled>input {visibility:hidden;}
.dial-shell.is-disabled .dial {touch-action:pan-y;}
