/* Make Anyone Sing - interface styles.
   Tokens follow the Windows 11 (Fluent) design language; the accent shades, light/dark theme, text size
   and window material are pushed in live from Windows by gui/app.py. */

:root {
  --font: "Segoe UI Variable Text", "Segoe UI", "Microsoft YaHei UI", system-ui, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI Variable Text", "Segoe UI", "Microsoft YaHei UI", sans-serif;
  --font-small: "Segoe UI Variable Small", "Segoe UI Variable Text", "Segoe UI", "Microsoft YaHei UI", sans-serif;
  --mono: "Cascadia Mono", "Cascadia Code", Consolas, monospace;
  --ease: cubic-bezier(0.1, 0.9, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0, 1);
  --ease-std: cubic-bezier(0.33, 0, 0.67, 1);
  --fast: 83ms; --norm: 167ms; --slow: 250ms; --slower: 333ms;
  --titlebar-h: 40px;
  --sidebar-w: 284px;
  --text-scale: 1;
  --critical: #FF99A4; --critical-fill: #C42B1C; --success: #6CCB5F; --caution: #FCE100;

  /* accent (replaced at start-up with the user's Windows accent palette) */
  --a-light3: #99EBFF; --a-light2: #4CC2FF; --a-light1: #0091F8; --a-base: #0078D4;
  --a-dark1: #005FB8; --a-dark2: #004C87; --a-dark3: #003A6E;
}

/* ------------------------------------------------------------------ dark theme (Fluent dark tokens) */
[data-theme="dark"] {
  color-scheme: dark;
  --text-1: #FFFFFF;
  --text-2: rgba(255, 255, 255, 0.786);
  --text-3: rgba(255, 255, 255, 0.544);
  --text-4: rgba(255, 255, 255, 0.363);
  --layer: rgba(58, 58, 58, 0.30);
  --layer-stroke: rgba(255, 255, 255, 0.07);
  --card: rgba(255, 255, 255, 0.0512);
  --card-hover: rgba(255, 255, 255, 0.0756);
  --card-2: rgba(255, 255, 255, 0.0326);
  --card-stroke: rgba(255, 255, 255, 0.075);
  --card-stroke-strong: rgba(255, 255, 255, 0.11);
  --control: rgba(255, 255, 255, 0.0605);
  --control-hover: rgba(255, 255, 255, 0.0837);
  --control-pressed: rgba(255, 255, 255, 0.0326);
  --control-stroke: rgba(255, 255, 255, 0.07);
  --control-stroke-bottom: rgba(255, 255, 255, 0.035);
  --subtle-hover: rgba(255, 255, 255, 0.0605);
  --subtle-pressed: rgba(255, 255, 255, 0.0419);
  --subtle-selected: rgba(255, 255, 255, 0.0605);
  --divider: rgba(255, 255, 255, 0.0837);
  --solid-base: #202020; --solid-2: #1C1C1C; --solid-3: #282828; --solid-4: #2C2C2C;
  --flyout: rgba(44, 44, 44, 0.985);
  --flyout-stroke: rgba(0, 0, 0, 0.3);
  --composer: rgba(45, 45, 45, 0.97);
  --composer-stroke: rgba(255, 255, 255, 0.085);
  --bubble: rgba(255, 255, 255, 0.075);
  --stage: rgba(0, 0, 0, 0.26);
  --stage-stroke: rgba(255, 255, 255, 0.06);
  --track: rgba(255, 255, 255, 0.12);
  --scroll: rgba(255, 255, 255, 0.24);
  --scroll-hover: rgba(255, 255, 255, 0.40);
  --smoke: rgba(0, 0, 0, 0.42);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.22);
  --shadow-2: 0 2px 8px rgba(0, 0, 0, 0.26);
  --shadow-flyout: 0 8px 24px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(0, 0, 0, 0.25);
  --shadow-dialog: 0 32px 64px rgba(0, 0, 0, 0.56), 0 2px 21px rgba(0, 0, 0, 0.55);
  --shadow-composer: 0 12px 36px rgba(0, 0, 0, 0.34), 0 1px 0 rgba(255, 255, 255, 0.05) inset;
  --focus: #FFFFFF;
  --viz-line: rgba(255, 255, 255, 0.94);
  --viz-dim: rgba(255, 255, 255, 0.40);
  --viz-grid: rgba(255, 255, 255, 0.05);
  --viz-grid-strong: rgba(255, 255, 255, 0.10);
  --accent-fill: var(--a-light2);
  --accent-fill-hover: color-mix(in srgb, var(--a-light2) 90%, transparent);
  --accent-fill-pressed: color-mix(in srgb, var(--a-light2) 80%, transparent);
  --on-accent: #000000;
  --accent-text: var(--a-light3);
  --accent-viz: var(--a-light1);
  --accent-viz-2: var(--a-light2);
  --accent-soft: color-mix(in srgb, var(--a-base) 17%, transparent);
  --accent-soft-hover: color-mix(in srgb, var(--a-base) 24%, transparent);
  --accent-soft-stroke: color-mix(in srgb, var(--a-light1) 36%, transparent);
  --mica-fallback: #202020;
}

/* ----------------------------------------------------------------- light theme (Fluent light tokens) */
[data-theme="light"] {
  color-scheme: light;
  --text-1: rgba(0, 0, 0, 0.894);
  --text-2: rgba(0, 0, 0, 0.606);
  --text-3: rgba(0, 0, 0, 0.446);
  --text-4: rgba(0, 0, 0, 0.361);
  --layer: rgba(255, 255, 255, 0.50);
  --layer-stroke: rgba(0, 0, 0, 0.06);
  --card: rgba(255, 255, 255, 0.70);
  --card-hover: rgba(255, 255, 255, 0.86);
  --card-2: rgba(246, 246, 246, 0.50);
  --card-stroke: rgba(0, 0, 0, 0.0578);
  --card-stroke-strong: rgba(0, 0, 0, 0.09);
  --control: rgba(255, 255, 255, 0.70);
  --control-hover: rgba(249, 249, 249, 0.50);
  --control-pressed: rgba(249, 249, 249, 0.30);
  --control-stroke: rgba(0, 0, 0, 0.0578);
  --control-stroke-bottom: rgba(0, 0, 0, 0.1622);
  --subtle-hover: rgba(0, 0, 0, 0.0373);
  --subtle-pressed: rgba(0, 0, 0, 0.0241);
  --subtle-selected: rgba(0, 0, 0, 0.0373);
  --divider: rgba(0, 0, 0, 0.0803);
  --solid-base: #F3F3F3; --solid-2: #EEEEEE; --solid-3: #F9F9F9; --solid-4: #FFFFFF;
  --flyout: rgba(250, 250, 250, 0.985);
  --flyout-stroke: rgba(0, 0, 0, 0.06);
  --composer: rgba(255, 255, 255, 0.97);
  --composer-stroke: rgba(0, 0, 0, 0.07);
  --bubble: rgba(0, 0, 0, 0.045);
  --stage: rgba(255, 255, 255, 0.62);
  --stage-stroke: rgba(0, 0, 0, 0.06);
  --track: rgba(0, 0, 0, 0.10);
  --scroll: rgba(0, 0, 0, 0.26);
  --scroll-hover: rgba(0, 0, 0, 0.42);
  --smoke: rgba(0, 0, 0, 0.30);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-2: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-flyout: 0 8px 24px rgba(0, 0, 0, 0.14), 0 0 0 1px rgba(0, 0, 0, 0.05);
  --shadow-dialog: 0 32px 64px rgba(0, 0, 0, 0.19), 0 2px 21px rgba(0, 0, 0, 0.15);
  --shadow-composer: 0 12px 36px rgba(0, 0, 0, 0.10), 0 1px 0 rgba(255, 255, 255, 0.6) inset;
  --focus: rgba(0, 0, 0, 0.894);
  --viz-line: rgba(0, 0, 0, 0.82);
  --viz-dim: rgba(0, 0, 0, 0.36);
  --viz-grid: rgba(0, 0, 0, 0.045);
  --viz-grid-strong: rgba(0, 0, 0, 0.09);
  --accent-fill: var(--a-dark1);
  --accent-fill-hover: color-mix(in srgb, var(--a-dark1) 90%, transparent);
  --accent-fill-pressed: color-mix(in srgb, var(--a-dark1) 80%, transparent);
  --on-accent: #FFFFFF;
  --accent-text: var(--a-dark2);
  --accent-viz: var(--a-base);
  --accent-viz-2: var(--a-dark1);
  --accent-soft: color-mix(in srgb, var(--a-base) 12%, transparent);
  --accent-soft-hover: color-mix(in srgb, var(--a-base) 18%, transparent);
  --accent-soft-stroke: color-mix(in srgb, var(--a-dark1) 30%, transparent);
  --critical: #C42B1C; --success: #0F7B0F; --caution: #9D5D00;
  --mica-fallback: #F3F3F3;
}

/* ------------------------------------------------------------------------------------------- base */
* { box-sizing: border-box; }
html { font-size: calc(14px * var(--text-scale)); }
html, body { height: 100%; }
body {
  margin: 0; overflow: hidden; background: transparent; color: var(--text-1);
  font-family: var(--font); font-size: 1rem; line-height: 1.43;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  user-select: none; cursor: default; font-variant-numeric: tabular-nums;
}
body[data-material="solid"] { background: var(--solid-base); }
body.inactive .titlebar .tb-title, body.inactive .titlebar .tb-session { color: var(--text-4); }
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after {
  animation-delay: 0s !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
  transition-delay: 0s !important; transition-duration: 0s !important;
}
body.reduce-motion .spinner { animation: spin 0.9s linear infinite !important; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: default; border: 0; background: none; padding: 0; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-radius: 6px; }
textarea, input[type="text"] { user-select: text; cursor: text; }
.ico { display: inline-flex; flex: none; line-height: 0; }
.ico svg { display: block; }
kbd { font-family: var(--font-small); font-size: 11px; color: var(--text-3); background: var(--control);
  border: 1px solid var(--control-stroke); border-radius: 4px; padding: 0 5px; line-height: 16px; }
::selection { background: color-mix(in srgb, var(--a-base) 45%, transparent); }

::-webkit-scrollbar { width: 14px; height: 14px; background: transparent; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 7px; border: 5px solid transparent;
  background-clip: padding-box; min-height: 40px; }
::-webkit-scrollbar-thumb:hover { border-width: 4px; background-color: var(--scroll-hover); }
::-webkit-scrollbar-corner { background: transparent; }

/* ----------------------------------------------------------------------------------------- layout */
.app {
  display: grid; height: 100vh;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  grid-template-rows: var(--titlebar-h) minmax(0, 1fr);
  transition: grid-template-columns var(--slower) var(--ease);
}
.app.sidebar-closed { grid-template-columns: 0px minmax(0, 1fr); }

/* title bar: drawn by us, caption buttons drawn by Windows on top of it */
.titlebar {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 4px;
  padding: 0 0 0 4px; min-width: 0; position: relative; z-index: 5;
}
/* caption buttons drawn like Windows 11's own (46 px wide, Segoe Fluent Icons glyphs, red close) */
.caption { display: flex; align-self: stretch; margin-left: 8px; flex: none; }
.cap { width: 46px; height: 100%; display: grid; place-items: center; color: var(--text-1);
  font-family: "Segoe Fluent Icons", "Segoe MDL2 Assets"; font-size: 10px; line-height: 1;
  transition: background var(--fast), color var(--fast); }
.cap:hover, .cap.hover { background: var(--subtle-hover); }
.cap:active, .cap.pressed { background: var(--subtle-pressed); color: var(--text-2); }
.cap.close:hover, .cap.close.hover { background: #C42B1C; color: #FFFFFF; }
.cap.close:active, .cap.close.pressed { background: rgba(196, 43, 28, 0.9); color: rgba(255, 255, 255, 0.7); }
body.inactive .cap { color: var(--text-4); }
body.inactive .cap.close:hover { color: #FFFFFF; }
body.fullscreen .caption { display: none; }
.tb-btn { width: 40px; height: calc(var(--titlebar-h) - 4px); border-radius: 5px; display: grid; place-items: center;
  color: var(--text-2); transition: background var(--fast); }
.tb-btn:hover { background: var(--subtle-hover); }
.tb-btn:active { background: var(--subtle-pressed); color: var(--text-3); }
.tb-logo { width: 16px; height: 16px; margin: 0 8px 0 6px; flex: none; }
.tb-title { font-family: var(--font-small); font-size: 12px; color: var(--text-1); white-space: nowrap; }
.tb-sep { width: 1px; height: 12px; background: var(--divider); margin: 0 10px; flex: none; }
.tb-session { font-family: var(--font-small); font-size: 12px; color: var(--text-3); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tb-fill { flex: 1; }
.tb-pill { font-family: var(--font-small); font-size: 11px; color: var(--text-3); border: 1px solid var(--divider);
  padding: 1px 8px; border-radius: 10px; white-space: nowrap; }

/* sidebar */
.sidebar { grid-row: 2; grid-column: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.sidebar-inner { width: var(--sidebar-w); display: flex; flex-direction: column; height: 100%;
  transition: opacity var(--slow) var(--ease), transform var(--slower) var(--ease); }
.app.sidebar-closed .sidebar-inner { opacity: 0; transform: translateX(-24px); pointer-events: none; }
.nav-new { margin: 6px 12px 10px 12px; height: 40px; border-radius: 8px; display: flex; align-items: center; gap: 10px;
  padding: 0 10px 0 6px; background: var(--control); border: 1px solid var(--control-stroke);
  border-bottom-color: var(--control-stroke-bottom); box-shadow: var(--shadow-1); transition: background var(--fast); }
.nav-new:hover { background: var(--control-hover); }
.nav-new:active { background: var(--control-pressed); }
.nav-new .plus { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center;
  background: var(--accent-fill); color: var(--on-accent); }
.nav-new .lbl { flex: 1; text-align: left; font-weight: 600; }
.nav-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 0 6px 12px 12px; }
.nav-scroll::-webkit-scrollbar { width: 10px; }
.nav-scroll::-webkit-scrollbar-thumb { border-width: 3px; }
.nav-header { font-family: var(--font-small); font-size: 12px; font-weight: 600; color: var(--text-3);
  padding: 14px 10px 6px; display: flex; align-items: center; justify-content: space-between; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 36px;
  padding: 6px 10px; border-radius: 6px; text-align: left; color: var(--text-1);
  transition: background var(--fast);
}
.nav-item:hover { background: var(--subtle-hover); }
.nav-item:active { background: var(--subtle-pressed); }
.nav-item.selected { background: var(--subtle-selected); }
.nav-item.selected::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 3px; height: 16px; margin-top: -8px;
  border-radius: 2px; background: var(--accent-fill); animation: pillIn var(--slow) var(--ease);
}
@keyframes pillIn { from { transform: scaleY(0.2); opacity: 0; } to { transform: none; opacity: 1; } }
.nav-item .ico { color: var(--text-2); }
.nav-item .txt { flex: 1; min-width: 0; }
.nav-item .t1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item .t2 { font-family: var(--font-small); font-size: 12px; color: var(--text-3); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.nav-item .nav-act { opacity: 0; width: 28px; height: 28px; border-radius: 5px; display: grid; place-items: center;
  color: var(--text-2); flex: none; transition: opacity var(--fast); }
.nav-item:hover .nav-act, .nav-item.menu-open .nav-act { opacity: 1; }
.nav-item .nav-act:hover { background: var(--subtle-hover); }
.nav-item .spinner { width: 14px; height: 14px; }
.nav-empty { color: var(--text-3); font-size: 12px; padding: 6px 10px 2px; line-height: 1.5; }
.ex-ico { width: 32px; height: 32px; flex: none; border-radius: 8px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-text); }
.nav-footer { padding: 8px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav-footer .course { font-family: var(--font-small); font-size: 11px; color: var(--text-4); padding: 6px 10px 0; }

/* main layer (rounded top-left like Windows 11 apps) */
.main {
  grid-row: 2; grid-column: 2; position: relative; min-width: 0; overflow: hidden;
  background: var(--layer); border-top: 1px solid var(--layer-stroke); border-left: 1px solid var(--layer-stroke);
  border-top-left-radius: 8px; transition: border-radius var(--slow);
}
body[data-material="solid"] .main { background: var(--solid-3); }
.app.sidebar-closed .main { border-top-left-radius: 0; border-left-color: transparent; }
.scroller { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth; }
/* songs fade out just above the docked composer instead of sliding under it */
.main.feed-mode .scroller {
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - var(--dock-h, 170px) - 40px),
    transparent calc(100% - var(--dock-h, 170px) + 6px));
}
.scroller.no-smooth { scroll-behavior: auto; }

/* --------------------------------------------------------------------------------------- hero */
.hero { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 40px 56px; }
.hero[hidden] { display: none; }
.hero-art { width: 360px; height: 84px; margin-bottom: 18px; opacity: 0; animation: fadeUp 700ms var(--ease) 80ms forwards; }
.hero h1 { font-family: var(--font-display); font-size: 40px; line-height: 52px; font-weight: 600; margin: 0;
  letter-spacing: -0.2px; text-align: center; opacity: 0; animation: fadeUp 600ms var(--ease) 140ms forwards; }
.hero h1 .grad { background: linear-gradient(100deg, var(--accent-text) 10%, var(--accent-viz) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { color: var(--text-2); font-size: 16px; line-height: 24px; margin: 10px 0 28px; text-align: center;
  max-width: 600px; opacity: 0; animation: fadeUp 600ms var(--ease) 200ms forwards; }
.hero-slot { width: min(760px, 100%); opacity: 0; animation: fadeUp 600ms var(--ease) 260ms forwards; }
.hero-examples { width: min(760px, 100%); margin-top: 28px; opacity: 0; animation: fadeUp 600ms var(--ease) 340ms forwards; }
.hero-examples .lbl { font-family: var(--font-small); font-size: 12px; font-weight: 600; color: var(--text-3);
  margin: 0 4px 10px; display: flex; justify-content: space-between; }
.ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.ex-card {
  text-align: left; padding: 14px 14px 12px; border-radius: 12px; background: var(--card);
  border: 1px solid var(--card-stroke); display: flex; flex-direction: column; gap: 8px; min-height: 118px;
  transition: background var(--norm), transform var(--slow) var(--ease), box-shadow var(--slow), border-color var(--norm);
}
.ex-card:hover { background: var(--card-hover); transform: translateY(-2px); box-shadow: var(--shadow-2);
  border-color: var(--card-stroke-strong); }
.ex-card:active { transform: translateY(0); }
.ex-card .top { display: flex; align-items: center; gap: 10px; }
.ex-card .voice { font-family: var(--font-small); font-size: 12px; color: var(--text-3); }
.ex-card .ttl { font-weight: 600; line-height: 20px; }
.ex-card .sub { font-size: 12px; color: var(--text-2); line-height: 16px; }
.ex-card .tags { margin-top: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-family: var(--font-small); font-size: 11px; line-height: 18px; padding: 0 7px; border-radius: 9px;
  background: var(--control); border: 1px solid var(--control-stroke); color: var(--text-2); white-space: nowrap; }
.tag.accent { background: var(--accent-soft); border-color: var(--accent-soft-stroke); color: var(--accent-text); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* -------------------------------------------------------------------------------------- composer */
.dock { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 32px 14px; pointer-events: none; z-index: 4; }
.dock::before { content: ""; position: absolute; left: 0; right: 14px; bottom: 0; height: 120px; pointer-events: none;
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--mica-fallback) 55%, transparent)); opacity: 0.0; }
.dock[hidden] { display: none; }
.dock-inner { max-width: 860px; margin: 0 auto; pointer-events: auto; position: relative; }
.dock-note { text-align: center; font-family: var(--font-small); font-size: 11px; color: var(--text-4); margin-top: 8px; }
.composer {
  position: relative; border-radius: 22px; background: var(--composer); border: 1px solid var(--composer-stroke);
  box-shadow: var(--shadow-composer); backdrop-filter: blur(28px) saturate(150%);
  transition: border-color var(--norm), box-shadow var(--norm);
}
.composer:focus-within { border-color: color-mix(in srgb, var(--a-base) 40%, var(--composer-stroke)); }
.composer.dragging { border-color: var(--accent-fill); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-composer); }
.cmp-clip { padding: 12px 12px 0 12px; }
.cmp-empty { display: flex; align-items: center; gap: 14px; padding: 4px 4px 2px; }
.rec-btn {
  position: relative; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--accent-fill); color: var(--on-accent); box-shadow: 0 4px 14px color-mix(in srgb, var(--a-base) 35%, transparent);
  transition: transform var(--norm) var(--ease), background var(--fast), box-shadow var(--norm);
}
.rec-btn:hover { background: var(--accent-fill-hover); transform: scale(1.04); }
.rec-btn:active { transform: scale(0.96); background: var(--accent-fill-pressed); }
.rec-btn::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--accent-fill);
  opacity: 0; transform: scale(0.8); }
.cmp-empty:hover .rec-btn::after { animation: ripple 1.8s var(--ease-out) infinite; }
@keyframes ripple { 0% { opacity: 0.55; transform: scale(0.85); } 100% { opacity: 0; transform: scale(1.35); } }
.cmp-empty .msg { flex: 1; min-width: 0; }
.cmp-empty .msg .a { font-weight: 600; font-size: 15px; }
.cmp-empty .msg .b { color: var(--text-3); font-size: 12px; margin-top: 1px; }
.btn {
  height: 32px; padding: 0 12px; border-radius: 6px; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  background: var(--control); border: 1px solid var(--control-stroke); border-bottom-color: var(--control-stroke-bottom);
  transition: background var(--fast), color var(--fast);
}
.btn:hover { background: var(--control-hover); }
.btn:active { background: var(--control-pressed); color: var(--text-2); }
.btn .ico { color: var(--text-2); }
.btn.primary { background: var(--accent-fill); color: var(--on-accent); border-color: transparent;
  box-shadow: 0 1px 0 rgba(0,0,0,.08); }
.btn.primary .ico { color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-fill-hover); }
.btn.primary:active { background: var(--accent-fill-pressed); }
.btn.subtle { background: transparent; border-color: transparent; }
.btn.subtle:hover { background: var(--subtle-hover); }
.btn.danger { color: #fff; background: var(--critical-fill); border-color: transparent; }
.btn:disabled { opacity: 0.45; pointer-events: none; }
.icon-btn { width: 32px; height: 32px; border-radius: 6px; display: grid; place-items: center; color: var(--text-2);
  transition: background var(--fast), color var(--fast); flex: none; }
.icon-btn:hover { background: var(--subtle-hover); color: var(--text-1); }
.icon-btn:active { background: var(--subtle-pressed); }
.icon-btn.on { color: var(--accent-text); }

.clip-chip { display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 6px; border-radius: 14px;
  background: var(--card-2); border: 1px solid var(--card-stroke); animation: fadeUp var(--slow) var(--ease); }
.round-play { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--accent-soft); color: var(--accent-text); transition: background var(--fast), transform var(--norm) var(--ease); }
.round-play:hover { background: var(--accent-soft-hover); transform: scale(1.05); }
.round-play.playing { background: var(--accent-fill); color: var(--on-accent); }
.clip-meta { min-width: 0; width: 170px; flex: none; }
.clip-meta .n { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clip-meta .d { font-size: 12px; color: var(--text-3); }
.clip-wave { flex: 1; height: 36px; min-width: 60px; display: block; }
.rec-live { display: flex; align-items: center; gap: 12px; padding: 6px; border-radius: 14px;
  background: color-mix(in srgb, var(--critical-fill) 12%, transparent); border: 1px solid color-mix(in srgb, var(--critical-fill) 35%, transparent); }
.rec-stop { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff;
  background: var(--critical-fill); position: relative; }
.rec-stop::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--critical-fill);
  animation: ripple 1.4s var(--ease-out) infinite; }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 600; width: 58px; flex: none; }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--critical-fill); flex: none; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.2; } }
.rec-canvas { flex: 1; height: 40px; min-width: 40px; display: block; }
.rec-hint { font-size: 12px; color: var(--text-3); white-space: nowrap; }

.cmp-lyrics-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 16px 2px 18px; }
.cmp-lyrics-row .lbl { font-family: var(--font-small); font-size: 12px; color: var(--text-3); padding-top: 3px; flex: none;
  display: flex; align-items: center; gap: 6px; }
.cmp-lyrics { flex: 1; resize: none; border: 0; background: transparent; padding: 2px 0; line-height: 20px; max-height: 84px;
  min-height: 24px; overflow-y: auto; }
.cmp-lyrics::placeholder { color: var(--text-4); }
.link-btn { font-family: var(--font-small); font-size: 12px; color: var(--accent-text); padding: 3px 6px; border-radius: 4px; flex: none; }
.link-btn:hover { background: var(--subtle-hover); }
.cmp-bar { display: flex; align-items: center; gap: 6px; padding: 8px 10px 10px 12px; }
.composer.compact .cmp-lyrics-row { display: none; }
.composer.compact .cmp-bar { padding-top: 10px; }
.hero-slot .words-btn { display: none; }
.cmp-bar .sep { width: 1px; height: 20px; background: var(--divider); margin: 0 4px; flex: none; }
.chip {
  height: 32px; padding: 0 10px 0 9px; border-radius: 16px; display: inline-flex; align-items: center; gap: 7px;
  background: var(--control); border: 1px solid var(--control-stroke); white-space: nowrap; flex: none;
  transition: background var(--fast), border-color var(--fast), color var(--fast);
}
.chip:hover { background: var(--control-hover); }
.chip:active { background: var(--control-pressed); }
.chip .ico { color: var(--text-2); }
.chip .cv { color: var(--text-3); margin-left: -2px; }
.chip.on { background: var(--accent-soft); border-color: var(--accent-soft-stroke); color: var(--accent-text); }
.chip.on .ico { color: var(--accent-text); }
.chip .chip-text { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.cmp-bar .grow { flex: 1; }
.sing-btn {
  height: 40px; padding: 0 18px 0 16px; border-radius: 20px; display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent-fill); color: var(--on-accent); font-weight: 600; font-size: 15px; flex: none;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--a-base) 32%, transparent);
  transition: transform var(--norm) var(--ease), background var(--fast), box-shadow var(--norm), opacity var(--norm);
}
.sing-btn:hover { background: var(--accent-fill-hover); transform: translateY(-1px); }
.sing-btn:active { transform: scale(0.97); background: var(--accent-fill-pressed); }
.sing-btn:disabled { background: var(--control); color: var(--text-4); box-shadow: none; pointer-events: none; }
.sing-btn .spinner { width: 16px; height: 16px; }
.sing-btn.busy { background: var(--control); color: var(--text-1); box-shadow: none; }
.sing-btn.busy:hover { background: var(--control-hover); }

.spinner { display: inline-block; border-radius: 50%; border: 2px solid var(--track); border-top-color: var(--accent-viz);
  animation: spin 0.9s linear infinite; width: 16px; height: 16px; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* -------------------------------------------------------------------------------------------- feed */
.feed { max-width: 860px; margin: 0 auto; padding: 28px 32px 0; }
.feed[hidden] { display: none; }
.feed-end { height: 260px; }
.turn { margin: 0 0 44px; }
.turn.enter .bubble { animation: slideL 420ms var(--ease); }
.turn.enter .reply { animation: fadeUp 520ms var(--ease) 80ms both; }
@keyframes slideL { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.bubble-row { display: flex; justify-content: flex-end; margin-bottom: 18px; }
.bubble { max-width: min(560px, 82%); background: var(--bubble); border-radius: 20px 20px 6px 20px; padding: 10px 14px 10px 10px;
  border: 1px solid var(--card-stroke); }
.bubble-audio { display: flex; align-items: center; gap: 10px; }
.bubble-audio canvas { width: 220px; height: 30px; display: block; }
.bubble-audio .dur { font-size: 12px; color: var(--text-3); width: 34px; text-align: right; }
.bubble-lyrics { margin: 8px 4px 2px 46px; color: var(--text-1); line-height: 20px; user-select: text; }
.bubble-meta { margin: 6px 4px 0 46px; font-size: 12px; color: var(--text-3); display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.bubble-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-4); }

.reply-head { display: flex; align-items: center; gap: 10px; margin: 0 0 10px 2px; }
.reply-head img { width: 24px; height: 24px; }
.reply-head .who { font-weight: 600; }
.reply-head .when { font-size: 12px; color: var(--text-3); }

/* progress ("thinking") block */
.progress { border-radius: 14px; background: var(--card); border: 1px solid var(--card-stroke); overflow: hidden; }
.progress-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.progress-head .lbl { font-weight: 600; flex: 1; min-width: 0; }
.shimmer { background: linear-gradient(90deg, var(--text-3) 0%, var(--text-1) 45%, var(--text-3) 90%);
  background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 1.8s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.progress-head .elapsed { font-size: 12px; color: var(--text-3); }
.stage-list { padding: 0 16px 14px 18px; display: grid; gap: 2px; }
.stage-row { display: flex; align-items: center; gap: 12px; min-height: 26px; color: var(--text-3); transition: color var(--norm); }
.stage-row .mark { width: 18px; height: 18px; display: grid; place-items: center; flex: none; }
.stage-row .mark .dotm { width: 6px; height: 6px; border-radius: 50%; background: var(--text-4); }
.stage-row.active { color: var(--text-1); }
.stage-row.done { color: var(--text-2); }
.stage-row.done .mark { color: var(--accent-text); animation: pop var(--slow) var(--ease); }
.stage-row.skip { opacity: 0.45; text-decoration: line-through; text-decoration-color: var(--text-4); }
.stage-row .nm { flex: 1; }
.stage-row .dt { font-size: 12px; color: var(--text-3); }
.stage-row .det { font-size: 12px; color: var(--text-4); margin-left: 6px; }
@keyframes pop { 0% { transform: scale(0.4); } 70% { transform: scale(1.15); } 100% { transform: none; } }
.progress-bar { height: 2px; background: var(--track); position: relative; overflow: hidden; }
.progress-bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent-viz);
  transition: width var(--slow) var(--ease); border-radius: 0 2px 2px 0; }
.failed-box { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px;
  background: color-mix(in srgb, var(--critical-fill) 12%, transparent); border: 1px solid color-mix(in srgb, var(--critical-fill) 30%, transparent); }
.failed-box .ico { color: var(--critical); margin-top: 1px; }
.failed-box .t { font-weight: 600; }
.failed-box .m { color: var(--text-2); font-size: 13px; margin-top: 2px; user-select: text; }

/* result card */
.result { border-radius: 16px; background: var(--card); border: 1px solid var(--card-stroke); padding: 6px 6px 10px;
  box-shadow: var(--shadow-1); }
.result-top { display: flex; align-items: flex-start; gap: 12px; padding: 10px 10px 10px 12px; }
.result-top .ttl { font-family: var(--font-display); font-size: 20px; line-height: 28px; font-weight: 600; }
.result-top .by { color: var(--text-2); margin-top: 1px; }
.result-top .by b { font-weight: 600; color: var(--text-1); }
.result-top .grow { flex: 1; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: 8px; background: var(--control-pressed);
  border: 1px solid var(--control-stroke); flex: none; }
.seg button { height: 26px; padding: 0 10px; border-radius: 6px; color: var(--text-2); font-size: 13px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px; transition: background var(--fast), color var(--fast); }
.seg button:hover { color: var(--text-1); background: var(--subtle-hover); }
.seg button.on { background: var(--control); color: var(--text-1); box-shadow: var(--shadow-1); border: 1px solid var(--control-stroke); }
.tabs { display: flex; gap: 2px; padding: 0 6px; margin: 2px 0 8px; position: relative; }
.tab { height: 34px; padding: 0 12px; border-radius: 6px; color: var(--text-2); position: relative; display: inline-flex;
  align-items: center; gap: 7px; transition: color var(--fast), background var(--fast); }
.tab:hover { background: var(--subtle-hover); color: var(--text-1); }
.tab.on { color: var(--text-1); font-weight: 600; }
.tab.on::after { content: ""; position: absolute; left: 50%; bottom: 1px; width: 16px; height: 3px; margin-left: -8px;
  border-radius: 2px; background: var(--accent-fill); animation: pillInH var(--slow) var(--ease); }
@keyframes pillInH { from { transform: scaleX(0.2); opacity: 0; } to { transform: none; opacity: 1; } }
.tab .ico { color: currentColor; opacity: 0.85; }
.stage-wrap { position: relative; border-radius: 12px; overflow: hidden; background: var(--stage); border: 1px solid var(--stage-stroke); margin: 0 4px; }
.stage-wrap canvas.stage { display: block; width: 100%; height: 300px; }
.stage-overlay { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.big-play { pointer-events: auto; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-fill); color: var(--on-accent); box-shadow: 0 10px 30px color-mix(in srgb, var(--a-base) 40%, transparent);
  transition: transform var(--slow) var(--ease), opacity var(--slow); }
.big-play:hover { transform: scale(1.06); }
.big-play.hide { opacity: 0; transform: scale(0.8); pointer-events: none; }
.stage-tools { position: absolute; right: 8px; top: 8px; display: flex; gap: 4px; opacity: 0; transition: opacity var(--norm); }
.stage-wrap:hover .stage-tools { opacity: 1; }
.stage-tools .icon-btn { background: color-mix(in srgb, var(--solid-base) 55%, transparent); backdrop-filter: blur(8px); }
.stage-label { position: absolute; left: 12px; top: 10px; font-family: var(--font-small); font-size: 11px; color: var(--text-3);
  pointer-events: none; display: flex; gap: 8px; align-items: center; }
.panel-stack { display: grid; gap: 10px; margin: 0 4px; }
.panel { border-radius: 12px; background: var(--stage); border: 1px solid var(--stage-stroke); padding: 10px 12px 8px; }
.panel .ph { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.panel .ph .n { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent-text); flex: none; align-self: center; }
.panel .ph .t { font-weight: 600; }
.panel .ph .s { font-size: 12px; color: var(--text-3); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel canvas { display: block; width: 100%; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--text-3); margin-top: 4px; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

/* player bar */
.player { display: flex; align-items: center; gap: 12px; padding: 10px 8px 4px 10px; }
.player .pp { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--accent-fill); color: var(--on-accent); transition: transform var(--norm) var(--ease), background var(--fast); }
.player .pp:hover { background: var(--accent-fill-hover); transform: scale(1.05); }
.player .pp:active { transform: scale(0.95); }
.player .time { font-size: 12px; color: var(--text-2); width: 86px; flex: none; font-variant-numeric: tabular-nums; }
.player .scrub { flex: 1; height: 36px; min-width: 80px; position: relative; }
.player .scrub canvas { width: 100%; height: 100%; display: block; }
.scrub-tip { position: absolute; top: -26px; transform: translateX(-50%); font-size: 11px; padding: 2px 6px; border-radius: 4px;
  background: var(--flyout); border: 1px solid var(--flyout-stroke); box-shadow: var(--shadow-2); pointer-events: none; opacity: 0;
  transition: opacity var(--fast); white-space: nowrap; backdrop-filter: blur(12px); }
.player .scrub:hover .scrub-tip { opacity: 1; }

/* insights */
.insights { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 8px 4px 2px; }
.tile { border-radius: 12px; background: var(--card-2); border: 1px solid var(--card-stroke); padding: 10px 12px; min-width: 0; }
.tile .k { font-family: var(--font-small); font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.tile .v { font-family: var(--font-display); font-size: 22px; line-height: 30px; font-weight: 600; margin-top: 2px; white-space: nowrap; }
.tile .v small { font-family: var(--font); font-size: 13px; font-weight: 400; color: var(--text-2); margin-left: 4px; }
.tile .s { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meter { position: relative; height: 6px; border-radius: 3px; background: var(--track); margin: 9px 0 5px; }
.meter .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; width: 0;
  background: linear-gradient(90deg, var(--text-4), var(--accent-viz)); transition: width 1100ms var(--ease); }
.meter .mk { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  border: 2px solid var(--solid-base); transition: left 1100ms var(--ease); }
.meter .mk.in { background: var(--text-3); }
.meter .mk.out { background: var(--accent-viz); box-shadow: 0 0 0 3px var(--accent-soft); }
.meter-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-4); }

.actions { display: flex; align-items: center; gap: 2px; padding: 8px 6px 0; flex-wrap: wrap; }
.actions .grow { flex: 1; }
.actions .note { font-size: 12px; color: var(--text-3); padding: 0 8px; }

/* details tab */
.details { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 4px; }
.kv { border-radius: 12px; background: var(--stage); border: 1px solid var(--stage-stroke); padding: 6px 14px; }
.kv .row { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--divider); font-size: 13px; }
.kv .row:last-child { border-bottom: 0; }
.kv .row .k { color: var(--text-3); width: 128px; flex: none; }
.kv .row .v { flex: 1; min-width: 0; overflow-wrap: anywhere; user-select: text; }
.kv h4 { margin: 8px 0 4px; font-size: 12px; color: var(--text-3); font-weight: 600; font-family: var(--font-small); }
.timing-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; margin: 8px 0 10px; background: var(--track); }
.timing-bar i { display: block; height: 100%; }
.timing-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 12px; font-size: 12px; color: var(--text-2); padding-bottom: 6px; }
.timing-legend span { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timing-legend b { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.timing-legend em { color: var(--text-3); font-style: normal; margin-left: auto; }

/* spectrogram tab */
.spec-row { display: grid; grid-template-columns: 74px 1fr; gap: 10px; align-items: center; }
.spec-row .lab { font-size: 12px; color: var(--text-2); line-height: 16px; }
.spec-row .lab b { display: block; color: var(--text-1); font-weight: 600; font-size: 13px; }
.spec-row canvas { width: 100%; height: 150px; border-radius: 8px; display: block; }

/* ------------------------------------------------------------------------------------ flyouts */
.popover {
  position: fixed; z-index: 50; min-width: 180px; max-width: 520px; border-radius: 8px; padding: 4px;
  background: var(--flyout); backdrop-filter: blur(30px) saturate(160%); box-shadow: var(--shadow-flyout);
  border: 1px solid var(--flyout-stroke); animation: flyIn var(--slow) var(--ease);
}
@keyframes flyIn { from { opacity: 0; transform: translateY(var(--fly-dy, -8px)); } to { opacity: 1; transform: none; } }
.popover.closing { animation: flyOut 120ms var(--ease-std) forwards; }
@keyframes flyOut { to { opacity: 0; transform: translateY(var(--fly-dy, -4px)); } }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 34px; padding: 6px 12px 6px 10px;
  border-radius: 5px; text-align: left; position: relative; transition: background var(--fast); }
.menu-item:hover { background: var(--subtle-hover); }
.menu-item:active { background: var(--subtle-pressed); }
.menu-item .ico { color: var(--text-2); }
.menu-item .txt { flex: 1; min-width: 0; }
.menu-item .t2 { font-size: 12px; color: var(--text-3); }
.menu-item .kbd { font-size: 12px; color: var(--text-3); }
.menu-item.on::before { content: ""; position: absolute; left: 0; top: 50%; width: 3px; height: 16px; margin-top: -8px; border-radius: 2px; background: var(--accent-fill); }
.menu-item.danger { color: var(--critical); }
.menu-item.danger .ico { color: var(--critical); }
.menu-sep { height: 1px; background: var(--divider); margin: 4px -4px; }
.menu-title { font-family: var(--font-small); font-size: 12px; font-weight: 600; color: var(--text-3); padding: 8px 10px 4px; }

.song-pop { width: 680px; padding: 8px; }
.song-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; max-height: min(430px, 56vh); overflow-y: auto; overflow-x: hidden; padding-right: 2px; }
.auto-tile { display: flex; gap: 12px; align-items: flex-start; width: 100%; margin: 0 0 8px; padding: 12px 12px 11px; background: var(--card); border-color: var(--card-stroke); }
.auto-tile:hover { background: var(--card-hover); }
.song-search { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; padding: 6px 10px; border-radius: 6px; background: var(--control); border: 1px solid var(--control-stroke); color: var(--text-3); }
.song-search:focus-within { border-color: var(--accent-soft-stroke); }
.song-search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--text-1); font: inherit; }
.song-sec { grid-column: 1 / -1; font-size: 12px; font-weight: 600; color: var(--text-3); padding: 6px 2px 0; }
.auto-tile .auto-ic { flex: none; color: var(--accent-text); margin-top: 2px; }
.auto-tile .st { white-space: normal; }
.auto-tile .sm { white-space: normal; line-height: 17px; margin-top: 2px; }
.alt-songs { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; }
.alt-songs .link-btn { padding: 0; flex: 0 1 auto; min-width: 0; max-width: 100%; white-space: normal; text-align: left; overflow-wrap: anywhere; }
.song-tile { text-align: left; border-radius: 8px; padding: 10px 10px 8px; border: 1px solid transparent; transition: background var(--fast); position: relative; }
.song-tile:hover { background: var(--subtle-hover); }
.song-tile.on { background: var(--accent-soft); border-color: var(--accent-soft-stroke); }
.song-tile .st { font-weight: 600; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 18px; }
.song-tile .sm { font-size: 12px; color: var(--text-3); }
.song-tile svg { display: block; width: 100%; height: 34px; margin: 6px 0 2px; color: var(--accent-viz); opacity: 0.9; }
.song-tile .chk { position: absolute; right: 8px; top: 9px; color: var(--accent-text); }
.pop-foot { display: flex; align-items: center; gap: 8px; padding: 8px 4px 2px; border-top: 1px solid var(--divider); margin-top: 8px; font-size: 12px; color: var(--text-3); }

.tune-pop { width: 380px; padding: 12px 14px 12px; max-height: calc(100vh - 56px); overflow-y: auto; overscroll-behavior: contain; }
.field { margin-bottom: 14px; }
.field .fl { font-size: 12px; color: var(--text-2); margin-bottom: 6px; display: flex; justify-content: space-between; }
.field .fl b { font-weight: 600; color: var(--text-1); }
.field .seg { width: 100%; }
.seg.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field .ens-select { width: 100%; }
.seg.grid3 button { min-width: 0; justify-content: center; overflow: hidden; text-overflow: ellipsis; }
.field .seg button { flex: 1; justify-content: center; padding: 0 6px; font-size: 12px; }
.field .help { font-size: 11px; color: var(--text-3); margin-top: 5px; line-height: 15px; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 20px; background: transparent; margin: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-fill) var(--pct, 50%), var(--track) var(--pct, 50%)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; margin-top: -8px;
  background: var(--solid-4); border: 1px solid var(--control-stroke); box-shadow: inset 0 0 0 5px var(--solid-4), inset 0 0 0 10px var(--accent-fill), var(--shadow-1);
  transition: box-shadow var(--fast); }
input[type="range"]:hover::-webkit-slider-thumb { box-shadow: inset 0 0 0 4px var(--solid-4), inset 0 0 0 10px var(--accent-fill), var(--shadow-1); }
input[type="range"]:active::-webkit-slider-thumb { box-shadow: inset 0 0 0 6px var(--solid-4), inset 0 0 0 10px var(--accent-fill-pressed), var(--shadow-1); }
.tune-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.tune-foot .help { font-size: 11px; color: var(--text-3); }

/* tooltips */
.tip { position: fixed; z-index: 80; pointer-events: none; padding: 5px 9px 6px; border-radius: 5px; font-size: 12px; line-height: 16px;
  background: var(--flyout); border: 1px solid var(--flyout-stroke); box-shadow: var(--shadow-2); backdrop-filter: blur(20px);
  max-width: 320px; animation: fadeIn var(--norm) var(--ease); color: var(--text-1); }
.tip .k { color: var(--text-3); margin-left: 8px; }

/* toasts (InfoBar style) */
.toasts { position: fixed; z-index: 70; top: calc(var(--titlebar-h) + 12px); right: 18px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { display: flex; align-items: flex-start; gap: 12px; padding: 12px 12px 12px 14px; border-radius: 8px; min-width: 300px; max-width: 460px;
  background: var(--flyout); backdrop-filter: blur(30px) saturate(160%); border: 1px solid var(--flyout-stroke); box-shadow: var(--shadow-flyout);
  animation: toastIn 380ms var(--ease); }
.toast.out { animation: toastOut 200ms var(--ease-std) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }
.toast .ico.info { color: var(--accent-text); }
.toast .ico.ok { color: var(--success); }
.toast .ico.err { color: var(--critical); }
.toast .body { flex: 1; min-width: 0; }
.toast .t { font-weight: 600; }
.toast .m { color: var(--text-2); font-size: 13px; overflow-wrap: anywhere; }
.toast .acts { display: flex; gap: 6px; margin-top: 8px; }

/* dialogs (ContentDialog) */
.smoke { position: fixed; inset: 0; z-index: 60; background: var(--smoke); display: grid; place-items: center;
  animation: fadeIn var(--slow) var(--ease); }
.smoke.closing { animation: fadeOut 160ms var(--ease-std) forwards; }
@keyframes fadeOut { to { opacity: 0; } }
.dialog { width: min(640px, calc(100vw - 48px)); max-height: calc(100vh - 80px); display: flex; flex-direction: column; border-radius: 10px;
  background: var(--solid-3); border: 1px solid var(--card-stroke-strong); box-shadow: var(--shadow-dialog); overflow: hidden;
  animation: dlgIn var(--slower) var(--ease); }
body[data-theme="dark"] .dialog { background: #2B2B2B; }
.smoke.closing .dialog { animation: dlgOut 160ms var(--ease-std) forwards; }
@keyframes dlgIn { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: none; } }
@keyframes dlgOut { to { opacity: 0; transform: scale(1.03); } }
.dialog .dh { padding: 22px 24px 4px; font-family: var(--font-display); font-size: 20px; font-weight: 600; line-height: 28px; }
.dialog .db { padding: 8px 24px 20px; overflow-y: auto; }
.dialog .df { padding: 20px 24px; background: var(--solid-base); border-top: 1px solid var(--divider); display: flex; gap: 8px; justify-content: flex-end; }
body[data-theme="dark"] .dialog .df { background: #202020; }
.dialog .df .btn { min-width: 110px; justify-content: center; }
.set-group { font-weight: 600; margin: 18px 0 8px; }
.set-group:first-child { margin-top: 6px; }
.set-card { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-radius: 6px; background: var(--card);
  border: 1px solid var(--card-stroke); margin-bottom: 3px; min-height: 64px; }
.set-card > .ico { color: var(--text-1); }
.set-card .txt { flex: 1; min-width: 0; }
.set-card .t2 { font-size: 12px; color: var(--text-3); line-height: 16px; }
.select { height: 32px; padding: 0 30px 0 11px; border-radius: 6px; background: var(--control); border: 1px solid var(--control-stroke);
  border-bottom-color: var(--control-stroke-bottom); appearance: none; -webkit-appearance: none; min-width: 180px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 8l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 16px; }
.select:hover { background-color: var(--control-hover); }
.select option { background: var(--solid-3); color: var(--text-1); }
.toggle { width: 40px; height: 20px; border-radius: 10px; border: 1px solid var(--text-3); position: relative; flex: none;
  transition: background var(--fast), border-color var(--fast); }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--text-2);
  transition: transform var(--norm) var(--ease), width var(--norm) var(--ease), background var(--fast); }
.toggle:hover::after { width: 14px; height: 14px; top: 2px; }
.toggle.on { background: var(--accent-fill); border-color: var(--accent-fill); }
.toggle.on::after { transform: translateX(20px); background: var(--on-accent); }
.toggle.on:hover::after { transform: translateX(18px); }
.swatch { width: 18px; height: 18px; border-radius: 4px; display: inline-block; vertical-align: middle; box-shadow: inset 0 0 0 1px rgba(127,127,127,.3); }
.sync-list { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 12px; align-items: center; font-size: 13px; margin-top: 2px; }
.sync-list .k { color: var(--text-3); }
.live-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--accent-text); background: var(--accent-soft);
  border: 1px solid var(--accent-soft-stroke); border-radius: 10px; padding: 0 8px; line-height: 18px; font-weight: 600; }
.live-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: blink 1.6s steps(2) infinite; }
.about { display: flex; gap: 16px; align-items: center; }
.about img { width: 56px; height: 56px; }
.about .n { font-family: var(--font-display); font-size: 18px; font-weight: 600; }
.about .m { font-size: 12px; color: var(--text-3); line-height: 18px; }

/* drag-and-drop overlay */
.drop-overlay { position: fixed; inset: 0; z-index: 65; display: grid; place-items: center; pointer-events: none; opacity: 0;
  transition: opacity var(--norm); background: color-mix(in srgb, var(--a-base) 10%, transparent); }
.drop-overlay.show { opacity: 1; }
.drop-overlay .box { border: 2px dashed var(--accent-fill); border-radius: 20px; padding: 36px 56px; text-align: center;
  background: var(--flyout); backdrop-filter: blur(30px); box-shadow: var(--shadow-flyout); }
.drop-overlay .box .ico { color: var(--accent-text); margin: 0 auto 10px; justify-content: center; }
.drop-overlay .box .t { font-family: var(--font-display); font-size: 20px; font-weight: 600; }
.drop-overlay .box .m { color: var(--text-2); margin-top: 4px; }

/* presentation (full-screen karaoke) */
.presenter { position: fixed; inset: 0; z-index: 90; background: var(--mica-fallback); display: none; }
.presenter.show { display: block; animation: fadeIn 300ms var(--ease); }
body[data-theme="dark"] .presenter { background: radial-gradient(120% 120% at 50% 0%, #1f1d22 0%, #121114 70%); }
body[data-theme="light"] .presenter { background: radial-gradient(120% 120% at 50% 0%, #fbf8f6 0%, #eeeae8 70%); }
.presenter canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.presenter .pres-head { position: absolute; left: 40px; top: 30px; right: 40px; display: flex; align-items: center; gap: 14px; }
.presenter .pres-head img { width: 40px; height: 40px; }
.presenter .pres-head .t { font-family: var(--font-display); font-size: 26px; font-weight: 600; }
.presenter .pres-head .s { color: var(--text-2); font-size: 15px; }
.presenter .pres-bar { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px;
  padding: 8px 10px 8px 8px; border-radius: 30px; background: var(--flyout); backdrop-filter: blur(30px) saturate(160%);
  border: 1px solid var(--flyout-stroke); box-shadow: var(--shadow-flyout); transition: opacity var(--slow); }
.presenter.idle .pres-bar { opacity: 0; }
.presenter .pres-bar .pp { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-fill); color: var(--on-accent); }
.presenter .pres-bar .time { font-size: 13px; color: var(--text-2); width: 90px; text-align: center; }

/* small screens */
@media (max-width: 1180px) {
  .insights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .details { grid-template-columns: 1fr; }
}
