/* base.css — reset, shared controls (buttons, switch, slider, select, segmented, avatar), focus + scrollbars. */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { font: var(--fw-regular) var(--fs-md)/1.4 var(--font-ui); color: var(--text); background: #0f1120; -webkit-font-smoothing: antialiased; user-select: none; cursor: default; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: default; text-align: inherit; }
a { color: var(--accent); } a:hover { color: var(--accent-hover); }
img { display: block; -webkit-user-drag: none; }
h1, h2, h3, p, ul { margin: 0; padding: 0; } ul { list-style: none; }
:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
[hidden] { display: none !important; }
svg.sym { width: var(--sz, 16px); height: var(--sz, 16px); flex: none; }
input, textarea { user-select: text; }
::selection { background: var(--accent-soft-strong); }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }

/* Buttons: outlined by default; primary uses the accent as line + tint. */
.btn { display: inline-flex; align-items: center; gap: var(--sp-3); height: 32px; padding: 0 var(--sp-5); border-radius: var(--r-md); border: 1px solid var(--border-strong); background: var(--surface-2); font-weight: var(--fw-medium); transition: background var(--dur-fast), border-color var(--dur-fast); }
.btn:hover { background: var(--hover); } .btn:active { background: var(--press); }
.btn--primary { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.btn--primary:hover { background: var(--accent-soft-strong); } .btn--primary:active { background: color-mix(in srgb, var(--accent) 40%, transparent); }
.btn--danger { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, transparent); }
.btn--ghost { border-color: transparent; background: transparent; height: 28px; padding: 0 var(--sp-4); color: var(--text-2); }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-sm); color: var(--text-2); transition: background var(--dur-fast); }
.icon-btn:hover:not(:disabled) { background: var(--hover); color: var(--text); } .icon-btn:active:not(:disabled) { background: var(--press); }
.icon-btn:disabled, .btn:disabled { opacity: .4; }
.icon-btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }

.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(145deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--surface-3))); color: var(--on-accent); font-size: var(--fs-sm); font-weight: var(--fw-semibold); letter-spacing: .02em; }
.avatar--lg { width: 48px; height: 48px; font-size: var(--fs-lg); }

/* Switch */
.switch { position: relative; width: 40px; height: 20px; border-radius: var(--r-pill); border: 1px solid var(--border-strong); background: transparent; transition: background var(--dur-base) var(--ease), border-color var(--dur-base); flex: none; }
.switch__thumb { position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--text-2); transition: transform var(--dur-base) var(--ease), background var(--dur-base), width var(--dur-fast); }
.switch:hover .switch__thumb { width: 14px; }
.switch[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.switch[aria-checked="true"] .switch__thumb { background: var(--on-accent); transform: translateX(20px); }
.switch[aria-checked="true"]:hover .switch__thumb { transform: translateX(18px); }

/* Slider (the fill width comes from --val set by JS) */
.slider { -webkit-appearance: none; appearance: none; width: 100%; height: 20px; background: transparent; margin: 0; cursor: default; }
.slider::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--accent) var(--val, 50%), var(--border-strong) var(--val, 50%)); }
.slider::-moz-range-track { height: 4px; border-radius: 2px; background: var(--border-strong); }
.slider::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent); }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; margin-top: -6px; background: var(--surface); border: 4px solid var(--accent); transition: transform var(--dur-fast); }
.slider::-moz-range-thumb { width: 8px; height: 8px; border-radius: 50%; background: var(--surface); border: 4px solid var(--accent); }
.slider:hover::-webkit-slider-thumb { transform: scale(1.12); } .slider:active::-webkit-slider-thumb { transform: scale(.9); }

.select { height: 32px; padding: 0 var(--sp-4); border-radius: var(--r-md); border: 1px solid var(--border-strong); background: var(--surface-2); min-width: 190px; }
.select:hover { background: var(--hover); }

/* Segmented control */
.seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: var(--r-md); border: 1px solid var(--border-strong); background: var(--surface-2); }
.seg__opt { height: 26px; padding: 0 var(--sp-5); border-radius: 6px; color: var(--text-2); transition: background var(--dur-fast); }
.seg__opt:hover { background: var(--hover); }
.seg__opt[aria-checked="true"] { background: var(--accent-soft-strong); color: var(--text); font-weight: var(--fw-medium); box-shadow: inset 0 0 0 1px var(--accent); }

.rename-input { width: 100%; min-width: 0; padding: 1px 4px; border-radius: var(--r-xs); border: 1px solid var(--accent); background: var(--surface); color: var(--text); outline: none; font-size: inherit; text-align: inherit; }
.sym-btn-reset { all: unset; }
