/* Defaults and choices are proposals, independently selected for each side. */
:root{--arrow-outline-width:.028;--arrow-white-fill:#e8ece8;--arrow-white-stroke:#443d36;--arrow-black-fill:#242a31;--arrow-black-stroke:#252b31;--arrow-white-opacity:.56;--arrow-white-reply-opacity:calc(.56 * .48 / .62);--arrow-black-opacity:calc(.52 / 1.618);--arrow-black-reply-opacity:calc(.40 / 1.618);--arrow-outline-opacity:calc(90 / 255 / 1.618);--arrow-white-outline-opacity:.82;--arrow-black-outline-opacity:calc(90 / 255 / 1.618)}
/* Opaque RGB plus one alpha property: no inherited reply/layer multiplication. */
.studio :is(.play-arrows,.lab-analysis-arrows) .spark-arrow{opacity:1;stroke-width:var(--arrow-outline-width)!important;stroke-opacity:var(--arrow-outline-opacity)}
.studio :is(.play-arrows,.lab-analysis-arrows) .spark-arrow.is-white{fill:var(--arrow-white-fill);stroke:var(--arrow-white-stroke);fill-opacity:var(--arrow-white-opacity);stroke-opacity:var(--arrow-white-outline-opacity)}
.studio :is(.play-arrows,.lab-analysis-arrows) .spark-arrow.is-black{fill:var(--arrow-black-fill);stroke:var(--arrow-black-stroke);fill-opacity:var(--arrow-black-opacity);stroke-opacity:var(--arrow-black-outline-opacity)}
.studio :is(.play-arrows,.lab-analysis-arrows) .spark-arrow.is-white.is-reply{fill-opacity:var(--arrow-white-reply-opacity)}
.studio :is(.play-arrows,.lab-analysis-arrows) .spark-arrow.is-black.is-reply{fill-opacity:var(--arrow-black-reply-opacity)}
.studio .arrow-appearance{display:grid;gap:10px;min-width:0;max-width:100%}
.studio .arrow-appearance fieldset{min-width:0;margin:0;padding:10px 12px 12px;border:1px solid var(--warm-border);border-radius:9px;background:var(--warm-surface);color:var(--warm-text)}
.studio .arrow-appearance legend{padding:0 4px;font:700 .86rem/1.3 var(--font-ui)}
.studio .arrow-color-choices{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,148px),1fr));gap:8px}
.studio .arrow-color-choices button{display:flex;align-items:center;gap:6px;min-width:0;min-height:44px;padding:8px;border:1px solid var(--warm-choice-outline);border-radius:7px;background:linear-gradient(var(--warm-button-top),var(--warm-button-bottom));color:var(--warm-button-text);box-shadow:inset 0 1px var(--warm-button-bevel),0 2px 0 var(--warm-button-shadow);font:700 .8rem/1.25 var(--font-ui);cursor:pointer;touch-action:manipulation}
.studio .arrow-color-swatch{width:36px;height:18px;flex:none;overflow:visible;border-radius:2px;background:linear-gradient(90deg,var(--board-light) 50%,var(--board-dark) 50%)}
.studio .arrow-choice-check{width:12px;margin-left:auto;visibility:hidden;flex:none}
.studio .arrow-color-choices button[aria-pressed=true]{background:var(--warm-choice-selected);color:var(--warm-text);box-shadow:inset 0 0 0 1px var(--warm-choice-outline),inset 0 1px var(--warm-choice-bevel),0 2px 0 var(--warm-button-shadow)}
.studio .arrow-color-choices button[aria-pressed=true] .arrow-choice-check{visibility:visible}
.studio .arrow-color-choices button:hover{filter:brightness(1.08)}
.studio .arrow-color-choices button:focus-visible{outline:2px solid var(--warm-focus);outline-offset:3px}
.studio .arrow-color-choices button:active{transform:translateY(2px);box-shadow:inset 0 1px var(--warm-button-bevel)}
/* Columns use actual group width: swatch + full label + persistent checkmark. */

/* Last-move controls reuse the same target sizes, volume and chosen checkmark. */
.studio .last-move-swatch{width:36px;height:18px;flex:none;display:flex;gap:4px;padding:2px;background:linear-gradient(90deg,var(--board-light) 50%,var(--board-dark) 50%);border-radius:2px}
.studio .last-move-swatch i{display:block;flex:1;min-width:0;background-image:var(--last-preview-layer,linear-gradient(var(--last-preview-fill),var(--last-preview-fill)));box-shadow:var(--last-preview-shadow,none)}
.studio .last-move-swatch i:first-child{background-image:var(--last-preview-light-layer,var(--last-preview-layer,linear-gradient(var(--last-preview-fill),var(--last-preview-fill))))}
.studio .last-frame-width{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 10px;align-items:center;margin-top:12px;font:650 .8rem/1.3 var(--font-ui)}
.studio .last-frame-width input{grid-column:1;grid-row:2;width:100%;margin:0;min-height:44px;touch-action:manipulation;accent-color:var(--warm-focus)}
.studio .last-frame-width output{grid-column:2;grid-row:2;min-width:3.3em;font-variant-numeric:tabular-nums;text-align:right}
.studio .last-frame-width input:focus-visible{outline:2px solid var(--warm-focus);outline-offset:3px}
.studio .last-frame-width:has(input:disabled){opacity:.6}

/* Keep frame colors a coherent two-by-two choice at every panel width. */
.studio .last-frame-color-choices{grid-template-columns:repeat(2,minmax(0,1fr))}

/* Appearance tab: theme cards and one-open-at-a-time groups. A card is a small
   picture of its own theme (themes.css derives the card's tokens from its
   data-theme); the selection ring keeps the current page theme's focus colour. */
body.studio{--app-ring:var(--warm-focus)}
.studio #panel-appearance{display:grid;gap:10px;align-content:start}
.studio .theme-picker{min-width:0;margin:0;padding:10px 12px 12px;border:1px solid var(--warm-border);border-radius:9px;background:var(--warm-surface);color:var(--warm-text)}
.studio .theme-picker legend{padding:0 4px;font:700 .86rem/1.3 var(--font-ui)}
.studio .theme-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.studio .theme-card{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px 4px;align-items:center;min-width:0;margin:0;padding:6px 7px 7px;border:1px solid var(--warm-border);border-radius:9px;background:var(--warm-workspace);color:var(--theme-menu-text);box-shadow:0 2px 0 var(--warm-button-shadow);font:700 .78rem/1.2 var(--font-ui);text-align:left;cursor:pointer;touch-action:manipulation;transition:transform 120ms ease,box-shadow 120ms ease}
.studio .theme-card-preview{grid-column:1/-1;display:flex;gap:4px;height:40px;min-width:0}
.studio .theme-card-preview i{display:block;min-width:0}
.studio .theme-card-preview .tp-board{display:grid;grid-template-columns:1fr 1fr;flex:0 0 40px;border:2px solid #6a3f24;border-radius:3px;overflow:hidden}
.studio .tp-board i:nth-child(1),.studio .tp-board i:nth-child(4){background:var(--board-light)}
.studio .tp-board i:nth-child(2),.studio .tp-board i:nth-child(3){background:var(--board-dark)}
.studio .theme-card-preview .tp-panel{flex:1;min-width:0;display:grid;grid-template-rows:5px 1fr 1fr;gap:3px;padding:4px;border:1px solid var(--warm-border);border-radius:4px;background:var(--warm-panel)}
.studio .tp-line{width:62%;border-radius:2px;background:var(--warm-text);opacity:.75}
.studio .tp-button{border-radius:2px;background:linear-gradient(var(--warm-button-top),var(--warm-button-bottom))}
.studio .tp-pick{width:70%;border-radius:2px;background:var(--warm-choice-selected);box-shadow:inset 0 0 0 1px var(--warm-choice-outline)}
.studio .theme-card-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.studio .theme-card .arrow-choice-check{width:auto;visibility:hidden;font-size:.9rem}
.studio .theme-card[aria-pressed=true]{outline:3px solid var(--app-ring);outline-offset:2px}
.studio .theme-card[aria-pressed=true] .arrow-choice-check{visibility:visible}
.studio .theme-card:hover{transform:translateY(-1px);box-shadow:0 3px 0 var(--warm-button-shadow)}
.studio .theme-card:active{transform:translateY(1px);box-shadow:0 1px 0 var(--warm-button-shadow)}
.studio .theme-card:focus-visible{outline:2px solid var(--app-ring);outline-offset:3px}
.studio .appearance-group{min-width:0;border:1px solid var(--warm-border);border-radius:9px;background:var(--warm-surface)}
.studio .appearance-group-body{padding:10px}
.studio .appearance-group-body>.arrow-appearance{gap:10px}
@media(max-width:600px){.studio .theme-choices{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(prefers-reduced-motion:reduce){.studio .theme-card{transition:none}}
