/* SilkFX panel styles */

:root, #app[data-theme="dark"] {
  --bg: #1e1e1e;
  --bg-status: #1a1a1a;
  --surface: #262626;
  --surface-2: #2c2c2c;
  --pill: #2a2a2a;
  --pill-active: #3d3d3d;
  --line: #343434;
  --line-strong: #3d3d3d;
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --text-3: #7c7c80;
  --accent: #0a84ff;
  --accent-rgb: 10, 132, 255;
  --on-accent: #fff;
  --accent-press: #0071e3;
  --track: #4a4a4c;
  --star: #ffcc00;
  --ok: #30d158;
  --err: #ff453a;
  --btn-disabled: #4f4f52;
  --btn-disabled-text: #d1d1d6;
  --scroll: #3e3e40;
  --preview-text: #ffffff;
  --shadow: 0 8px 28px rgba(0, 0, 0, .45);
}

#app[data-theme="light"] {
  --bg: #f5f5f7;
  --bg-status: #ececee;
  --surface: #ffffff;
  --surface-2: #f2f2f4;
  --pill: #e8e8ed;
  --pill-active: #ffffff;
  --line: #dcdce0;
  --line-strong: #d0d0d5;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #8e8e93;
  --accent: #007aff;
  --accent-press: #0063d1;
  --track: #d1d1d6;
  --star: #f5b800;
  --ok: #248a3d;
  --err: #d70015;
  --btn-disabled: #d1d1d6;
  --btn-disabled-text: #8e8e93;
  --scroll: #c7c7cc;
  --preview-text: #1d1d1f;
  --shadow: 0 8px 28px rgba(0, 0, 0, .14);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: #1e1e1e;
  overflow: hidden;
}

body {
  font-family: "Inter", "SF Pro Text", -apple-system, "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  font-size: 12px;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

button { font: inherit; color: inherit; cursor: default; }
button:focus { outline: none; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--bg);
  color: var(--text);
}

/* ---------- top bar ---------- */

.topbar {
  position: relative;
  flex: 0 0 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 4px 8px;
  border-bottom: 1px solid var(--line);
}

.logo-btn {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--pill-active);
  color: var(--text);
  padding: 0;
}
.logo-btn svg { width: 19px; height: 19px; margin-top: -1px; }
.logo-btn:hover { filter: brightness(1.12); }

.tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 42px;
  padding: 0 4px;
  border-radius: 21px;
  background: var(--pill);
  border: 1px solid var(--line-strong);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: 0 0 35px;
  width: 35px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 17px;
  background: transparent;
  color: var(--text-2);
  padding: 0;
  transition: background-color .15s, color .15s;
}
.tab svg { width: 20px; height: 20px; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--pill-active); color: var(--text); }

.round-btn {
  margin-left: auto;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text-2);
  padding: 0;
}
.round-btn svg { width: 16px; height: 16px; }
.round-btn:hover { color: var(--text); }

/* ---------- popover ---------- */

.popover {
  position: absolute;
  z-index: 20;
  top: 44px;
  left: 8px;
  min-width: 210px;
  padding: 10px 6px 6px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
}
.pop-title { padding: 0 8px; font-size: 13px; font-weight: 700; }
.pop-title span { color: var(--text-2); font-weight: 500; }
.pop-sub { padding: 2px 8px 8px; color: var(--text-2); font-size: 11px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.pop-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 6px 8px;
  border-radius: 6px;
}
.pop-item:hover { background: var(--accent); color: var(--on-accent); }

/* ---------- main ---------- */

.main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}

/* ---------- sidebar ---------- */

.sidebar {
  flex: 0 0 177px;
  width: 177px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  min-height: 0;
}

.side-head {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  padding: 13px 14px 9px 12px;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .08em;
}
.side-head #catCount { letter-spacing: 0; font-weight: 500; }
.search { flex: 0 0 auto; padding: 0 10px 8px 8px; }
.search input { width: 100%; height: 26px; padding: 0 9px; border-radius: 7px; border: 1px solid var(--line); background: var(--bg-2, rgba(255,255,255,.05)); color: var(--text); font: inherit; font-size: 11.5px; outline: none; }
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .25); }
.search input::placeholder { color: var(--text-3); }
.item-cat { color: var(--accent); font-weight: 600; }
.list-empty { padding: 14px 12px; color: var(--text-3); font-size: 11.5px; line-height: 1.5; }
.pv-bg { position: absolute; inset: 0; border-radius: inherit; }

.list {
  flex: 1 1 auto;
  overflow-y: scroll;
  padding: 0 0 8px 4px;
}

.list::-webkit-scrollbar { width: 8px; }
.list::-webkit-scrollbar-track { background: transparent; }
.list::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 4px; border: 1px solid var(--bg); }
.detail-scroll::-webkit-scrollbar { width: 8px; }
.detail-scroll::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 4px; border: 1px solid var(--bg); }

.item {
  position: relative;
  display: flex;
  align-items: center;
  height: 43px;
  padding: 0 6px 0 22px;
  border-radius: 8px;
}
.item::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 50%;
  width: 5px;
  height: 5px;
  margin-top: -2px;
  border-radius: 50%;
  background: var(--accent);
}
.item:hover { background: var(--surface-2); }
.item.selected { background: var(--accent); }
.item.selected::before { background: var(--on-accent); }

.item-text { flex: 1 1 auto; min-width: 0; }
.item-name {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item-desc {
  font-size: 11px;
  line-height: 14px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item.selected .item-name { color: var(--on-accent); }
.item.selected .item-desc { color: var(--on-accent); opacity: .82; }

.star {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--text-3);
  visibility: hidden;
}
.star svg { width: 15px; height: 15px; fill: none; }
.item:hover .star, .item.selected .star { visibility: visible; }
.item.selected .star { color: var(--on-accent); opacity: .75; }
.star.on { visibility: visible; color: var(--star) !important; }
.star.on svg { fill: currentColor; }

.list-sep {
  height: 1px;
  margin: 8px 6px 8px 4px;
  background: var(--line-strong);
}

.list-empty { padding: 12px; color: var(--text-3); }

/* ---------- detail ---------- */

.detail {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.detail-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 14px 18px 16px;
}

.detail-head {
  display: flex;
  align-items: center;
  height: 58px;
  margin-bottom: 16px;
  gap: 8px;
}
.detail-head h1 {
  flex: 1 1 auto;
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pill-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 10px 0 11px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  font-size: 11.5px;
  font-weight: 500;
}
.pill-btn:hover { background: var(--surface-2); }
.pill-btn:disabled { opacity: .4; }
.replay-ico svg { width: 11px; height: 11px; display: block; }

/* ---------- preview ---------- */

.preview {
  position: relative;
  width: 100%;
  aspect-ratio: 318 / 221;
  min-height: 150px;
  max-height: 340px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.pv-text {
  position: relative;
  white-space: pre;
  color: var(--preview-text);
  font-size: 33px;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.2;
}
.pv-word, .pv-char { display: inline-block; will-change: transform, opacity, filter; }

.pv-card {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  background: var(--accent);
  will-change: transform, opacity, filter;
}

/* Absolutely filled so its height is definite at any panel size; the graph then scales to fit. */
.pv-ease { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 22px; padding: 30px 18px 14px; }
.pv-ease svg.graph { height: 100%; max-height: 210px; max-width: calc(100% - 50px); min-width: 0; overflow: visible; }
.pv-ease .axis { stroke: var(--line-strong); stroke-width: 1; fill: none; }
.pv-ease .curve { stroke: var(--accent); stroke-width: 2.5; fill: none; }
.pv-ease .handle { stroke: var(--text-3); stroke-width: 1; }
.pv-ease .knob { fill: var(--surface); stroke: var(--text-2); stroke-width: 1.4; }
.pv-ease .ball { fill: var(--accent); }
.pv-track { position: relative; flex: 0 0 22px; width: 22px; height: 100%; max-height: 180px; margin: auto 0; }
.pv-track::before { content: ""; position: absolute; left: 10px; top: 0; bottom: 0; width: 2px; border-radius: 1px; background: var(--line-strong); }
.pv-track .dot { position: absolute; left: 0; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%; background: var(--accent); }

.pv-shape svg { display: block; }
.pv-caption {
  position: absolute;
  left: 10px;
  bottom: 8px;
  color: var(--text-3);
  font: 10.5px ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.pv-code {
  align-self: stretch;
  justify-self: stretch;
  margin: 0;
  padding: 12px 14px;
  overflow: auto;
  color: var(--text);
  font: 11px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: text;
}
.pv-note { padding: 0 24px; text-align: center; color: var(--text-2); line-height: 1.5; }

.pv-vignette { position: absolute; inset: 0; pointer-events: none; }
.pv-sound { display: grid; place-items: center; }
.pv-wave { display: block; }
.pv-ticks { position: absolute; left: 0; right: 0; top: 18px; display: flex; justify-content: center; gap: 15px; }
.pv-tick { display: block; width: 9px; height: 9px; background: var(--accent); transform: rotate(45deg); }
.pv-clip { position: absolute; left: 50%; top: 50%; width: 130px; height: 26px; margin: -13px 0 0 -65px; border-radius: 6px; }
.pv-glass-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 22% 30%, #ff375f 0, rgba(255,55,95,0) 32%),
    radial-gradient(circle at 78% 70%, #0a84ff 0, rgba(10,132,255,0) 36%),
    radial-gradient(circle at 70% 22%, #ffd60a 0, rgba(255,214,10,0) 26%),
    radial-gradient(circle at 30% 80%, #30d158 0, rgba(48,209,88,0) 28%),
    #1b1b22;
}
.pv-glass-under { font-size: 46px; letter-spacing: -.03em; }
.pv-glass { position: absolute; width: 58%; height: 52%; border-radius: 22px; background: rgba(255,255,255,.06); }
.pv-grain { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: overlay; }

/* ---------- controls ---------- */

.controls {
  margin-top: 18px;
  padding: 4px 12px 6px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
}
.controls:empty { display: none; }

.ctl { padding: 3px 0 2px; }
.ctl-row { display: flex; align-items: center; min-height: 18px; gap: 8px; }
.ctl.inline { padding: 8px 0 6px; }
.ctl-label { flex: 1 1 auto; font-size: 11.5px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ctl-value {
  display: flex;
  align-items: baseline;
  gap: 0;
  font: 11.5px ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.ctl-value input {
  width: 64px;
  padding: 1px 2px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: right;
  user-select: text;
}
.ctl-value input:hover { border-color: var(--line-strong); }
.ctl-value input:focus { outline: none; border-color: var(--accent); background: var(--bg); }
.ctl-unit { width: 26px; padding-left: 8px; color: var(--text-2); font-size: 11px; }

.ctl-info { min-width: 0; font: 11px ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: text; }
.ctl.inline .ctl-label { flex: 0 0 auto; }
.ctl.inline .ctl-row > :last-child { margin-left: auto; }

/* slider */
.slider { position: relative; height: 14px; margin-top: 0; touch-action: none; }
.slider-track { position: absolute; left: 0; right: 0; top: 5px; height: 4px; border-radius: 2px; background: var(--track); }
.slider-fill { position: absolute; left: 0; top: 5px; height: 4px; border-radius: 2px; background: var(--accent); }
.slider-thumb {
  position: absolute;
  top: 0;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}
.slider:hover .slider-thumb, .slider.drag .slider-thumb { filter: brightness(1.12); }

/* segmented */
.segment {
  display: inline-flex;
  padding: 2px;
  gap: 2px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
}
.segment button {
  min-width: 34px;
  height: 20px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 11.5px;
  font-weight: 600;
}
.segment button:hover { background: var(--surface-2); }
.segment button.on { background: var(--accent); color: var(--on-accent); }

/* colors */
.swatches { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.swatch {
  width: 16px;
  height: 16px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(128, 128, 128, .45);
}
.swatch.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--text); }

/* ---------- action bar ---------- */

.actionbar {
  flex: 0 0 54px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px 0 16px;
  border-top: 1px solid var(--line);
}
.hint {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text-3);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hint.ok { color: var(--ok); }
.hint.err { color: var(--err); }

.apply {
  flex: 0 0 auto;
  min-width: 67px;
  height: 30px;
  padding: 0 16px;
  border: 0;
  border-radius: 15px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 12.5px;
  font-weight: 600;
}
.apply:hover:not(:disabled) { filter: brightness(1.1); }
.apply:active:not(:disabled) { background: var(--accent-press); }
.apply:disabled { background: var(--btn-disabled); color: var(--btn-disabled-text); }
.apply.busy { opacity: .7; }

/* ---------- status bar ---------- */

.statusbar {
  flex: 0 0 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 12px 0 11px;
  background: var(--bg-status);
  border-top: 1px solid var(--line);
  color: var(--text-2);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
}
.statusbar .conn { display: inline-flex; align-items: center; gap: 6px; }
.statusbar .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.statusbar .dot.on { background: var(--ok); }
.statusbar .dot.off { background: var(--err); }
.statusbar .spacer { flex: 1 1 auto; }

/* ---------- narrow panels ---------- */

@media (max-width: 440px) {
  .sidebar { flex-basis: 150px; width: 150px; }
  .topbar { gap: 6px; }
  .tab { flex-basis: 31px; width: 31px; }
  #versionInfo { display: none; }
}

/* ---------- updates ---------- */

.update-pill {
  height: 18px;
  padding: 0 9px;
  border: 0;
  border-radius: 9px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 10.5px;
  font-weight: 600;
}
.update-pill:hover { filter: brightness(1.1); }

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, .55);
}
.modal[hidden] { display: none; }
.modal-card {
  width: 100%;
  max-width: 360px;
  padding: 18px 18px 16px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
}
.modal-card h2 { margin: 0 0 8px; font-size: 15px; font-weight: 700; }
.upd-notes { margin: 0 0 14px; padding-left: 18px; color: var(--text-2); font-size: 11.5px; line-height: 1.5; }
.upd-notes:empty { display: none; }
.upd-label { display: block; margin-bottom: 6px; font-size: 11.5px; font-weight: 600; }
.upd-label span { color: var(--text-3); font-weight: 400; }
.upd-input {
  width: 100%;
  height: 30px;
  padding: 0 9px;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--text);
  font: 12px ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  user-select: text;
}
.upd-input:focus { outline: none; border-color: var(--accent); }
.upd-status { min-height: 16px; margin: 8px 0 12px; font-size: 11.5px; color: var(--text-2); }
.upd-status.ok { color: var(--ok); }
.upd-status.err { color: var(--err); }
.upd-actions { display: flex; justify-content: flex-end; gap: 8px; align-items: center; }
.upd-actions .pill-btn { height: 30px; border-radius: 15px; padding: 0 14px; }

.upd-actions .spacer { flex: 1 1 auto; }
.link-btn { border: 0; background: transparent; padding: 0; color: var(--accent); font-size: 12px; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }
.upd-intro { margin: 0 0 14px; color: var(--text-2); font-size: 12px; line-height: 1.5; }
#app.locked .main, #app.locked .actionbar { filter: blur(3px); pointer-events: none; }

/* ---------- motion ---------- */

:root { --spring: cubic-bezier(.34, 1.56, .64, 1); --smooth: cubic-bezier(.32, .72, 0, 1); }

/* sliding indicators (positioned by js/motion.js) */
.tabs { position: relative; }
.tab { position: relative; z-index: 1; }
.tab.active { background: transparent; }
.tab-ind { position: absolute; left: 0; top: 0; z-index: 0; border-radius: 17px; background: var(--pill-active); pointer-events: none; }

.list { position: relative; }
.item { z-index: 1; }
.item.selected { background: transparent; }
.item.selected:hover { background: transparent; }
.sel-ind { position: absolute; left: 0; top: 0; z-index: 0; border-radius: 8px; background: var(--accent); pointer-events: none; box-shadow: 0 4px 14px -6px rgba(var(--accent-rgb), .7); }
.item-name, .item-desc, .item::before { transition: color .25s var(--smooth), background-color .25s var(--smooth); }

.segment { position: relative; }
.segment button { position: relative; z-index: 1; transition: color .25s var(--smooth), transform .25s var(--spring); }
.segment button.on { background: transparent; }
.segment button:hover:not(.on) { background: transparent; color: var(--accent); }
.seg-thumb { position: absolute; left: 0; top: 0; z-index: 0; border-radius: 6px; background: var(--accent); pointer-events: none; box-shadow: 0 2px 8px -3px rgba(var(--accent-rgb), .8); }

/* press feedback */
.apply, .pill-btn, .round-btn, .logo-btn, .tab, .swatch, .star, .pop-item, .update-pill, .link-btn {
  transition: transform .28s var(--spring), background-color .2s var(--smooth), color .2s var(--smooth), filter .2s, box-shadow .25s var(--smooth);
}
.apply:active:not(:disabled), .pill-btn:active:not(:disabled), .round-btn:active, .logo-btn:active,
.tab:active, .swatch:active, .star:active, .update-pill:active, .segment button:active { transform: scale(.93); }
.apply:hover:not(:disabled) { box-shadow: 0 6px 18px -8px rgba(var(--accent-rgb), .9); }
.apply.done { background: var(--ok); }
.apply.done::before { content: "\2713"; margin-right: 6px; }
.swatch:hover { transform: scale(1.15); }
.round-btn svg { transition: transform .5s var(--spring); }
.round-btn:hover svg { transform: rotate(35deg); }

/* sliders */
.slider-thumb { transition: transform .25s var(--spring), box-shadow .2s; }
.slider:hover .slider-thumb { transform: scale(1.12); }
.slider.drag .slider-thumb { transform: scale(1.25); box-shadow: 0 0 0 5px rgba(var(--accent-rgb), .18), 0 1px 3px rgba(0,0,0,.35); }

/* theme cross-fade */
#app, .topbar, .sidebar, .detail, .preview, .controls, .actionbar, .statusbar, .tabs, .segment, .round-btn, .logo-btn, .popover, .modal-card, .upd-input, .ctl-value input {
  transition: background-color .4s var(--smooth), border-color .4s var(--smooth), color .4s var(--smooth);
}
.hint { transition: color .3s var(--smooth); }

/* ---------- appearance settings ---------- */

.popover-right { left: auto; right: 8px; width: 270px; padding: 12px 10px 8px; }
.set-label { margin: 12px 4px 7px; color: var(--text-3); font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
.popover-right .pop-title { padding: 0 4px; }
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.theme-tile {
  display: flex; flex-direction: column; gap: 5px; align-items: stretch;
  padding: 5px 5px 6px; border: 1px solid var(--line-strong); border-radius: 9px; background: transparent;
  font-size: 10.5px; font-weight: 600; color: var(--text-2); text-align: center;
}
.theme-tile:hover { color: var(--text); border-color: var(--text-3); }
.theme-tile.on { border-color: var(--accent); color: var(--text); box-shadow: 0 0 0 2px rgba(var(--accent-rgb), .35); }
.theme-swatch { position: relative; height: 34px; border-radius: 6px; overflow: hidden; border: 1px solid rgba(128,128,128,.25); }
.theme-swatch i { position: absolute; left: 6px; right: 14px; height: 5px; border-radius: 3px; }
.theme-swatch i:nth-child(1) { top: 7px; }
.theme-swatch i:nth-child(2) { top: 16px; right: 24px; }
.theme-swatch b { position: absolute; right: 6px; bottom: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.theme-swatch.ae::after { content: "Ae"; position: absolute; left: 6px; bottom: 3px; font: 700 9px/1 Inter, sans-serif; opacity: .75; }
.theme-tile span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.accent-row { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 4px 6px; align-items: center; }
.accent-dot { width: 20px; height: 20px; padding: 0; border-radius: 50%; border: 1px solid rgba(128,128,128,.4); }
.accent-dot.on { box-shadow: 0 0 0 2px var(--surface-2), 0 0 0 4px var(--text); }
.accent-dot:hover { transform: scale(1.15); }
.accent-custom { position: relative; width: 20px; height: 20px; border-radius: 50%; overflow: hidden; border: 1px solid rgba(128,128,128,.4);
  background: conic-gradient(#ff453a, #ffd60a, #30d158, #64d2ff, #0a84ff, #bf5af2, #ff375f, #ff453a); transition: transform .28s var(--spring); }
.accent-custom:hover { transform: scale(1.15); }
.accent-custom.on { box-shadow: 0 0 0 2px var(--surface-2), 0 0 0 4px var(--text); }
.accent-custom input { position: absolute; inset: -6px; width: 32px; height: 32px; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.popover-right .pop-item { margin-top: 4px; }

/* ---------- editable preview text + draggable graph ---------- */
.preview-wrap { position: relative; }
.pv-edit-btn {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  width: 26px; height: 26px; display: grid; place-items: center; padding: 0;
  border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text-2);
  opacity: 0; transition: opacity .2s var(--smooth), transform .28s var(--spring), color .2s;
}
.pv-edit-btn svg { width: 14px; height: 14px; }
.preview-wrap:hover .pv-edit-btn, .pv-edit-btn:focus-visible { opacity: 1; }
.pv-edit-btn:hover { color: var(--text); }
.pv-edit-btn:active { transform: scale(.9); }
.preview .pv-text { cursor: text; }
.pv-edit-input {
  position: absolute; left: 50%; top: 50%; z-index: 4; width: 82%; transform: translate(-50%, -50%);
  padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--accent);
  background: rgba(0, 0, 0, .55); color: #fff; text-align: center;
  font: 700 26px/1.2 "Inter", "SF Pro Text", -apple-system, "Segoe UI", sans-serif; letter-spacing: -.01em;
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .25), 0 12px 30px -10px rgba(0,0,0,.6);
  user-select: text;
}
.pv-edit-input:focus { outline: none; }
#app[data-theme="light"] .pv-edit-input { background: rgba(255, 255, 255, .85); color: #1d1d1f; }

.pv-ease svg.graph.editable .hit { fill: transparent; cursor: grab; pointer-events: all; }
.pv-ease svg.graph.dragging .hit { cursor: grabbing; }
.pv-ease svg.graph.editable .knob { fill: var(--accent); stroke: var(--surface); stroke-width: 2; transition: r .2s var(--spring); }
.pv-ease svg.graph.editable .hit:hover + .knob, .pv-ease svg.graph.dragging .knob { r: 7; }
.pv-ease .handle { stroke: var(--text-3); stroke-width: 1.2; stroke-dasharray: 2 2; }
.pv-readout {
  position: absolute; left: 10px; top: 9px; z-index: 2;
  font: 10.5px ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--text-2);
  padding: 2px 7px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line);
}

.pv-glass-text { color: transparent; -webkit-background-clip: text; background-clip: text; font-size: 54px; }
