/* Shared form primitives; component owners determine placement. */
:root { --control-radius:8px; --control-selected:#244d43; --control-edge:#41685d; --control-help:#77b89b; }
.ui-switch { display:inline-flex; align-items:center; gap:.65rem; min-height:44px; cursor:pointer; }
.ui-switch input[type=checkbox] { appearance:none; flex:0 0 42px; width:42px; height:24px; min-height:0; margin:0; padding:0; border:1px solid #607078; border-radius:20px; background:#26343c; box-shadow:none; position:relative; cursor:pointer; }
.ui-switch input[type=checkbox]::before { content:''; position:absolute; width:18px; height:18px; top:2px; left:2px; border-radius:50%; background:#e9f1ef; box-shadow:0 1px 2px #0004; transition:transform 150ms ease; }
.ui-switch input:checked { background:#357762; border-color:#619d85; }
.ui-switch input[type=checkbox]:checked::before { transform:translateX(18px); }
.ui-switch input:focus-visible, .ui-choice input:focus-visible + span, .ui-help:focus-visible { outline:2px solid #83deb0; outline-offset:2px; }
.ui-switch:has(input:disabled), .ui-choice label:has(input:disabled) { opacity:.5; cursor:not-allowed; }
.ui-switch:has(input[aria-invalid=true]), .ui-choice:has(input[aria-invalid=true]) { outline:2px solid #ef967d; }
.ui-choice { display:flex; gap:3px; padding:3px; border:0; border-radius:var(--control-radius); background:#09131aa6; min-width:0; }
.ui-choice label, .settings-card .ui-choice label { position:relative; display:flex; flex:1 1 0; min-width:0; margin:0; cursor:pointer; color:#b8c8d0; }
.ui-choice input { position:absolute; opacity:0; width:1px; height:1px; }
.ui-choice label > span { display:flex; justify-content:center; align-items:center; text-align:center; padding:6px 9px; min-height:40px; box-sizing:border-box; border:1px solid transparent; border-radius:6px; width:100%; font-size:13px; line-height:1.25; font-weight:600; transition:background-color 150ms,color 150ms; }
.ui-choice input:checked + span { background:var(--control-selected); color:#effbf5; border-color:var(--control-edge); box-shadow:none; }
.ui-choice label:hover > span { color:#fff; }
button.ui-help { display:inline-flex; flex:0 0 32px; align-items:center; justify-content:center; box-sizing:border-box; width:32px; min-width:32px; height:32px; min-height:32px; padding:0; margin:0; border:0; border-radius:50%; background:transparent; color:var(--control-help); box-shadow:none; vertical-align:middle; cursor:pointer; font-size:12px; font-weight:600; }
button.ui-help::before { content:'?'; display:grid; place-items:center; box-sizing:border-box; flex:0 0 18px; width:18px; height:18px; border:1px solid currentColor; border-radius:50%; font-size:12px; font-weight:600; line-height:1; letter-spacing:0; }
button.ui-help:hover, button.ui-help[aria-expanded=true] { color:#a1debf; background:transparent; border:0; box-shadow:none; }
.ui-help-popover { position:fixed; z-index:10050; box-sizing:border-box; width:max-content; max-width:min(340px,calc(100vw - 16px)); max-height:calc(100dvh - 16px); overflow:auto; padding:12px 14px; color:#eff8f2; background:#182a23; border:1px solid #466956; border-radius:8px; box-shadow:0 6px 22px #0006; font-size:13px; line-height:1.5; overflow-wrap:anywhere; }
.ui-field-heading { display:flex; align-items:center; gap:6px; min-width:0; }
.ui-field-heading > :first-child { flex:0 1 auto; min-width:0; margin-block:0; }
.ui-field-heading > .ui-help { margin-left:0; flex-shrink:0; }
.ui-rotary { display:grid; justify-items:center; gap:8px; width:220px; max-width:100%; }
.ui-rotary > .ui-field-heading { justify-self:stretch; font-weight:650; }
.ui-rotary .ui-rotary-value { width:76px; min-height:38px; padding:5px 8px; margin:0; box-sizing:border-box; text-align:center; font-size:20px; font-weight:650; font-variant-numeric:tabular-nums; border:1px solid #41685d; border-radius:8px; color:#e7faef; background:#132821; appearance:textfield; }
.ui-rotary-value::-webkit-inner-spin-button { appearance:none; }
.ui-rotary .ui-dial { position:relative; width:132px; height:132px; margin-top:14px; border-radius:50%; touch-action:none; cursor:grab; }
.ui-dial::before { content:''; position:absolute; inset:0; border-radius:50%; background:repeating-conic-gradient(from 225deg,#91b4a3 0deg 1.5deg,transparent 1.5deg 13.5deg); mask:conic-gradient(from 224deg,#000 0deg 272deg,transparent 272deg); }
.ui-dial-grip { position:absolute; inset:13px; border:1px solid #6f9c85; border-radius:50%; background:radial-gradient(circle at 35% 24%,#486c5b,#213a30 70%); box-shadow:inset 0 1px 2px #c8ffdb33,0 5px 10px #0005; transform:rotate(var(--dial-angle,-135deg)); pointer-events:none; }
.ui-dial-grip::before { content:''; position:absolute; left:calc(50% - 3px); top:9px; width:6px; height:15px; border-radius:3px; background:#c5ffe0; box-shadow:0 0 5px #90e7b650; }
.ui-dial-mid { position:absolute; top:-18px; left:0; right:0; text-align:center; color:#9db9aa; font-size:11px; }
.ui-dial input[type=range] { position:absolute; z-index:1; inset:0; width:100%; height:100%; opacity:0; margin:0; pointer-events:none; }
.ui-dial:focus-within { outline:2px solid #83deb0; outline-offset:4px; }
.is-turning .ui-dial-grip { box-shadow:inset 0 1px 2px #c8ffdb55,0 5px 14px #0006,0 0 12px #619e8030; }
.is-turning input[type=range] { cursor:grabbing; }
.ui-dial-endpoints { display:flex; justify-content:space-between; width:142px; margin-top:-10px; color:#a9beb4; font-size:11px; }
@media (prefers-reduced-motion:reduce) { .ui-switch input::before, .ui-choice label > span { transition:none; } }
