/* Appearance chooser (built by theme.js into #appearance). Uses the active theme's tokens; swatch colours are fixed so
   every option previews itself. ID-scoped so generic button/input/label rules from app.css, enterprise.css and
   themes.css cannot distort it. No animation. */
#appearance{position:relative;display:inline-flex}
#appearance .ap-trigger{display:inline-flex;align-items:center;gap:8px;margin:0;min-height:36px;padding:5px 12px 5px 6px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--text);font:inherit;font-size:13px;line-height:1.2;cursor:pointer;box-shadow:none;filter:none}
#appearance .ap-trigger:hover{border-color:var(--accent);background:var(--soft)}
#appearance .ap-trigger::after{content:"" / "";width:7px;height:7px;margin:0 2px 2px 4px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);opacity:.75}
#appearance .ap-trigger[aria-expanded="true"]::after{transform:rotate(225deg);margin-bottom:-3px}
#appearance .ap-label{color:var(--muted);font-size:12px}
#appearance .ap-current{font-weight:650}
#appearance .ap-panel{position:absolute;z-index:40;top:calc(100% + 8px);right:0;width:min(27rem,calc(100vw - 24px));max-height:min(34rem,calc(100vh - 110px));overflow:auto;padding:14px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--text);box-shadow:0 12px 32px #0006}
#appearance .ap-panel[hidden]{display:none}
#appearance .ap-title{margin:0;font-size:15px;font-weight:650}
#appearance .ap-note{margin:2px 0 10px;font-size:12px;color:var(--muted)}
#appearance .ap-set{margin:0;padding:0;border:0;min-width:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
#appearance .ap-set+.ap-set{margin-top:12px;padding-top:10px;border-top:1px solid var(--line)}
#appearance .ap-set>legend{grid-column:1/-1;float:left;width:100%;margin:0 0 4px;padding:0;font-size:11px;font-weight:650;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
#appearance .ap-option{display:flex;align-items:center;gap:8px;margin:0;padding:7px 8px;border:1px solid var(--line);border-radius:9px;background:transparent;color:var(--text);cursor:pointer;min-width:0;font-size:13px;line-height:1.25}
#appearance .ap-option:hover{background:var(--soft)}
#appearance .ap-option:has(input:checked){border-color:var(--accent);background:var(--soft);box-shadow:inset 0 0 0 1px var(--accent)}
#appearance .ap-option:has(input:focus-visible){outline:2px solid var(--accent);outline-offset:2px}
#appearance .ap-option input[type="radio"]{appearance:auto;flex:none;width:16px;height:16px;min-height:0;margin:0;padding:0;border:0;background:none;accent-color:var(--accent);box-shadow:none}
#appearance .ap-option input[type="radio"]:focus-visible{outline:none}
#appearance .ap-text{display:grid;min-width:0}
#appearance .ap-name{font-weight:600;overflow-wrap:anywhere}
#appearance .ap-desc{font-size:11.5px;color:var(--muted);overflow-wrap:anywhere}

/* Swatch: page colour, panel bar and accent dot of each theme (fixed values; independent of the active theme). */
#appearance .ap-swatch{position:relative;flex:none;width:34px;height:24px;border-radius:6px;background:var(--sw-bg);box-shadow:inset 0 0 0 1px #8888;overflow:hidden}
#appearance .ap-swatch>i:first-child{position:absolute;left:4px;right:4px;bottom:4px;height:8px;border-radius:2px;background:var(--sw-surface)}
#appearance .ap-swatch>i:last-child{position:absolute;right:5px;top:4px;width:8px;height:8px;border-radius:50%;background:var(--sw-accent)}
#appearance .ap-swatch[data-swatch="enterprise"]{--sw-bg:#070e1d;--sw-surface:#17283e;--sw-accent:#36deeb}
#appearance .ap-swatch[data-swatch="light"]{--sw-bg:#edf3f8;--sw-surface:#ffffff;--sw-accent:#00695f}
#appearance .ap-swatch[data-swatch="dark"]{--sw-bg:#172434;--sw-surface:#24354a;--sw-accent:#92e4d6}
#appearance .ap-swatch[data-swatch="system"]{--sw-bg:linear-gradient(135deg,#edf3f8 50%,#172434 50%);--sw-surface:linear-gradient(90deg,#ffffff 50%,#24354a 50%);--sw-accent:#00695f}
#appearance .ap-swatch[data-swatch="classic"]{--sw-bg:#f4f6fa;--sw-surface:#ffffff;--sw-accent:#2854a7}
#appearance .ap-swatch[data-swatch="daylight"]{--sw-bg:#f6f7fb;--sw-surface:#ffffff;--sw-accent:#4338ca}
#appearance .ap-swatch[data-swatch="collective"]{--sw-bg:#040705;--sw-surface:#10281a;--sw-accent:#3ddc84}
#appearance .ap-swatch[data-swatch="bridge"]{--sw-bg:#0a1230;--sw-surface:#18245a;--sw-accent:#ffb347}
#appearance .ap-swatch[data-swatch="terminal"]{--sw-bg:#0b0e0b;--sw-surface:#18261a;--sw-accent:#7ee787}
#appearance .ap-swatch[data-swatch="neon"]{--sw-bg:#121217;--sw-surface:#21212c;--sw-accent:linear-gradient(135deg,#3ee6ff 50%,#ff4fd8 50%)}
#appearance .ap-swatch[data-swatch="deepspace"]{--sw-bg:#060a1a;--sw-surface:#18244c;--sw-accent:#8fb4ff}

@media (max-width:700px){
 #appearance .ap-label{display:none}
 #appearance .ap-panel{left:0;right:auto;width:calc(100vw - 24px);max-height:calc(100vh - 170px)}
 #appearance .ap-set{grid-template-columns:minmax(0,1fr)}
}
@media (pointer:coarse){#appearance .ap-trigger,#appearance .ap-option{min-height:44px}}
@media (forced-colors:active){#appearance .ap-option:has(input:checked){outline:2px solid Highlight}#appearance .ap-swatch{forced-color-adjust:none}}
