:root {
  --bg: #0a0c10;
  --bg1: #101318;
  --bg2: #161a21;
  --bg3: #1d222b;
  --bg4: #272d38;
  --line: #222832;
  --line2: #2e3542;
  --text: #ecf0f5;
  --muted: #8d97a7;
  --faint: #7a8494; /* 4.5:1 on the panels, readable small text */
  --accent: #ff6a1f;
  --accent-2: #ff8a4c;
  --accent-soft: rgba(255, 106, 31, 0.14);
  --primary: #3d8bff;
  --primary-soft: rgba(61, 139, 255, 0.15);
  --good: #2bd96b;
  --bad: #ff4d4d;
  --purple: #b46cff;
  --sel: #ffb000;
  --r: 10px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 13px/1.45 Inter, "Segoe UI", system-ui, -apple-system, sans-serif; overflow: hidden; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.hidden { display: none !important; }
.spacer { flex: 1; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.center { justify-content: center; }
.ic { flex-shrink: 0; }
a { color: var(--primary); }
kbd { display: inline-block; font: 600 11px/1 "Roboto Mono", Consolas, monospace; background: var(--bg3); border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 5px; padding: 4px 6px; color: var(--text); white-space: nowrap; }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--bg3); border: 1px solid var(--line2); border-radius: 8px; padding: 6px 12px; cursor: pointer; white-space: nowrap; transition: background 0.12s, border-color 0.12s, color 0.12s; }
.btn:hover { background: var(--bg4); }
.btn:active { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.accent { background: linear-gradient(180deg, var(--accent-2), var(--accent)); border-color: var(--accent); color: #fff; font-weight: 600; box-shadow: 0 4px 16px rgba(255, 106, 31, 0.25); }
.btn.accent:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--bg3); }
.btn.on { background: var(--primary-soft); border-color: rgba(61, 139, 255, 0.5); color: #cfe0ff; }
.btn.tiny { padding: 4px 9px; font-size: 12px; gap: 5px; border-radius: 7px; }
.btn.big { padding: 11px 18px; font-size: 14px; border-radius: 10px; }
.btn.full { width: 100%; justify-content: center; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; background: var(--bg3); border: 1px solid var(--line2); border-radius: 8px; width: 32px; height: 32px; cursor: pointer; padding: 0; color: var(--text); transition: background 0.12s; }
.icon-btn:hover { background: var(--bg4); }
.icon-btn.small { width: 28px; height: 28px; }
.icon-btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.icon-btn.ghost:hover { background: var(--bg3); color: var(--text); }
.icon-btn.on { background: var(--primary-soft); border-color: rgba(61, 139, 255, 0.5); color: #cfe0ff; }
.icon-btn.play { width: 40px; height: 40px; border-radius: 50%; background: #fff; color: #111; border: 0; box-shadow: 0 2px 10px rgba(0,0,0,0.4); }
.icon-btn.play:hover { transform: scale(1.04); background: #fff; }
select, input[type=text], input[type=number] { background: var(--bg); border: 1px solid var(--line2); border-radius: 7px; padding: 6px 8px; min-width: 0; outline: none; height: 32px; }
select:focus, input[type=text]:focus, input[type=number]:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
select.small { padding: 3px 6px; font-size: 12px; height: 28px; }
input[type=range] { width: 100%; accent-color: var(--accent); }
input[type=color] { width: 34px; height: 28px; border: 1px solid var(--line2); background: var(--bg); border-radius: 7px; padding: 2px; cursor: pointer; }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line2); border-radius: 8px; padding: 2px; gap: 2px; }
.seg button { background: transparent; border: 0; border-radius: 6px; padding: 4px 10px; cursor: pointer; color: var(--muted); font-size: 12px; transition: background 0.12s, color 0.12s; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--bg4); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,0.3); }
.seg.full { display: flex; }
.seg.full button { flex: 1; }
.switch { position: relative; width: 34px; height: 20px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--bg4); border-radius: 20px; transition: 0.15s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; background: #cfd5de; border-radius: 50%; transition: 0.15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(14px); background: #fff; }
.pill { display: inline-flex; align-items: center; font-size: 11px; color: var(--muted); background: var(--bg3); border: 1px solid var(--line2); border-radius: 20px; padding: 2px 8px; }

/* ---------- top bar ---------- */
.topbar { height: 52px; display: flex; align-items: center; gap: 6px; padding: 0 10px 0 14px; background: var(--bg1); border-bottom: 1px solid var(--line); position: relative; z-index: 20; }
.brand { font-weight: 800; font-size: 16px; letter-spacing: -0.2px; display: flex; align-items: center; gap: 10px; margin-right: 8px; white-space: nowrap; }
.logo { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--accent); position: relative; box-shadow: 0 0 12px rgba(255,106,31,0.35); flex-shrink: 0; }
.logo::after { content: ''; position: absolute; left: 7px; top: 1px; width: 2.5px; height: 9px; background: #fff; border-radius: 2px; transform: rotate(45deg); transform-origin: bottom; }
.file-chip { color: var(--muted); background: var(--bg2); border: 1px solid var(--line); padding: 5px 11px; border-radius: 20px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.btn.accent.busy { background: linear-gradient(90deg, #ff8a4c, #ff6a1f, #ff8a4c); background-size: 200% 100%; animation: busy 1.6s linear infinite; }
@keyframes busy { to { background-position: -200% 0; } }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 260px; background: var(--bg2); border: 1px solid var(--line2); border-radius: 12px; padding: 6px; box-shadow: var(--shadow); z-index: 40; animation: pop 0.12s ease-out; max-height: calc(100vh - 80px); overflow-y: auto; }
.fmt-tabs .menu { left: 50%; right: auto; transform: translateX(-50%); }
@keyframes pop { from { opacity: 0; margin-top: -4px; } }
.menu h4 { margin: 8px 9px 4px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.9px; color: var(--faint); }
.menu button.item { display: flex; width: 100%; align-items: center; gap: 9px; text-align: left; background: none; border: 0; padding: 7px 9px; border-radius: 7px; cursor: pointer; }
.menu button.item:hover { background: var(--bg3); }
.menu .sep { height: 1px; background: var(--line); margin: 6px 0; }
.menu .item-row { display: flex; align-items: center; gap: 2px; }
.menu .item-row .item { flex: 1; min-width: 0; }
.menu details.more summary { padding: 7px 9px; color: var(--muted); font-size: 12px; }
.tpl-save { display: flex; gap: 6px; padding: 6px 4px 2px; }
.tpl-save input { flex: 1; height: 30px; }
.popover { width: 352px; padding: 12px 14px 14px; }
.popover .tab-body { padding: 0; overflow: visible; }
.pop-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 14px; }
.pop-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.pop-row select { flex: 1; height: 30px; }
.pop-row input[type=range] { flex: 1; }
.pop-row .val { font: 500 11.5px "Roboto Mono", monospace; color: var(--muted); width: 38px; text-align: right; }
.pop-label { width: 58px; flex-shrink: 0; color: var(--muted); font-size: 12px; }
details.more { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 4px; }
details.more summary { cursor: pointer; color: var(--muted); font-size: 12.5px; padding: 6px 0; list-style: none; }
details.more summary::before { content: '▸ '; }
details.more[open] summary::before { content: '▾ '; }
details.more[open] summary { margin-bottom: 8px; }

/* format tabs */
.fmt-tabs { display: flex; gap: 3px; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.fmt { position: relative; display: inline-flex; align-items: center; gap: 7px; background: transparent; border: 1px solid transparent; border-radius: 7px; padding: 4px 10px; color: var(--muted); cursor: pointer; font-size: 12.5px; font-weight: 600; height: 30px; }
.fmt:hover { color: var(--text); }
.fmt.on { background: var(--bg3); border-color: var(--line2); color: var(--text); }
.fmt.on .fglyph { border-color: var(--accent); background: var(--accent-soft); }
.fmt.add { color: var(--faint); }
.fmt.add:hover { color: var(--text); }
.fmt .fx { margin-left: 1px; width: 16px; height: 16px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; color: var(--faint); opacity: 0; font-size: 14px; }
.fmt:hover .fx { opacity: 1; }
.fmt .fx:hover { background: var(--bg4); color: var(--text); }
.fglyph { display: inline-block; border: 1.5px solid currentColor; border-radius: 2.5px; flex-shrink: 0; }
.menu .fglyph { margin: 0 4px 0 2px; }

/* ---------- main layout: rail | drawer | stage | inspector ---------- */
.main { display: flex; height: calc(100% - 52px); position: relative; }
.rail { width: 62px; flex-shrink: 0; background: var(--bg1); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0; z-index: 12; }
.rail button { width: 52px; padding: 8px 0 6px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; transition: background 0.12s, color 0.12s; }
.rail button:hover { background: var(--bg3); color: var(--text); }
.rail button.active { background: var(--accent-soft); color: var(--text); }
.rail button.active .ic { color: var(--accent); }
.drawer { width: 304px; flex-shrink: 0; background: var(--bg1); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; z-index: 11; }
.drawer.closed { display: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 8px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.workspace { flex: 1; display: flex; flex-direction: column; min-width: 0; }
/* settings panel: docked and always there on wide screens, so selecting a widget never resizes the video */
.inspector-panel { width: 320px; flex-shrink: 0; overflow: hidden; background: var(--bg1); border-left: 1px solid var(--line); display: flex; flex-direction: column; z-index: 14; }
.inspector-panel .inspector { width: 100%; height: 100%; overflow-y: auto; padding: 0 0 24px; margin: 0; }
.inspector-panel .inspector > * { animation: inspIn 0.14s ease-out; }
@keyframes inspIn { from { opacity: 0.35; } }
.insp-idle { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.idle-lead { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.insp-idle > .btn { align-self: flex-start; }
.idle-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.idle-list button { width: 100%; display: flex; gap: 10px; align-items: center; text-align: left; background: transparent; border: 1px solid transparent; border-radius: 9px; padding: 6px 8px; color: var(--text); font: inherit; cursor: pointer; }
.idle-list button:hover, .idle-list button:focus-visible { background: var(--bg2); border-color: var(--line2); }
.idle-list button.off { opacity: 0.5; }
.idle-list b { display: block; font-size: 12.5px; font-weight: 600; }
.idle-list small { display: block; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.idle-list .wicon { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 7px; background: var(--bg3); font-size: 12px; }
.idle-tips { border-top: 1px solid var(--line); padding-top: 12px; font-size: 11.5px; color: var(--muted); display: flex; flex-direction: column; gap: 5px; }
.idle-tips b { color: var(--text); font-size: 11px; text-transform: uppercase; letter-spacing: 0.7px; }
kbd { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 5px; border: 1px solid var(--line2); border-bottom-width: 2px; background: var(--bg2); color: var(--text); font: 600 10.5px/17px Inter, sans-serif; text-align: center; }

/* stage */
.stage-wrap { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; padding: 58px 18px 18px; min-height: 0; background: radial-gradient(ellipse at 50% 30%, #151b24, #08090c 72%); overflow: hidden; }
.stage-wrap:fullscreen { padding: 0; background: #000; }
.stage-wrap:fullscreen .stage-toolbar, .stage-wrap:fullscreen .widget-bar { display: none; }
.stage { position: relative; background: #000; box-shadow: 0 16px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05); overflow: hidden; border-radius: 3px; }
.stage video { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; object-fit: fill; }
.stage canvas#overlay { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.bg-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: none; }
.bg-canvas.blurred { filter: blur(14px) brightness(0.72) saturate(1.1); transform: scale(1.12); }
.stage.demo { background: linear-gradient(170deg, #4c6580 0%, #2c3c4e 48%, #1b222c 49%, #29323e 100%); }
.stage.novideo { background: repeating-linear-gradient(45deg, #11151b, #11151b 12px, #141921 12px, #141921 24px); }
.stage-msg { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); background: rgba(12,14,18,0.94); border: 1px solid var(--line2); border-radius: 10px; padding: 10px 14px; max-width: 80%; text-align: center; z-index: 5; box-shadow: var(--shadow); }

/* floating toolbar above the video */
.stage-toolbar { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 4px; padding: 5px; background: rgba(20,24,31,0.88); backdrop-filter: blur(10px); border: 1px solid var(--line2); border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,0.45); white-space: nowrap; max-width: calc(100% - 20px); overflow-x: auto; scrollbar-width: none; }
.stage-toolbar::-webkit-scrollbar { display: none; }
.tb { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 9px; background: transparent; border: 1px solid transparent; border-radius: 8px; color: var(--muted); cursor: pointer; font-size: 12.5px; font-weight: 500; }
.tb:hover { background: var(--bg3); color: var(--text); }
.tb.on { background: var(--primary-soft); color: #d4e4ff; border-color: rgba(61,139,255,0.45); }
.tb.primary { background: var(--accent); color: #fff; font-weight: 600; padding: 0 11px; }
.tb.primary:hover { filter: brightness(1.08); background: var(--accent); }
.tb-sep { width: 1px; height: 20px; background: var(--line2); margin: 0 3px; }
.tb-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--faint); font-weight: 700; margin: 0 2px 0 4px; }
.tb-range { width: 92px; }
.tb-seg { padding: 2px; }
.tb-seg button { padding: 3px 8px; }
.stage-toolbar input[type=color] { width: 28px; height: 24px; }

/* floating bar next to the selected widget */
.widget-bar { position: absolute; left: 0; top: 0; z-index: 7; display: flex; align-items: center; gap: 2px; padding: 4px; background: rgba(20,24,31,0.95); backdrop-filter: blur(8px); border: 1px solid var(--line2); border-radius: 10px; box-shadow: 0 6px 22px rgba(0,0,0,0.5); white-space: nowrap; }
.widget-bar .wb-name { font-size: 12px; font-weight: 600; padding: 0 8px 0 6px; color: var(--text); max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.widget-bar button { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 0; border-radius: 7px; color: var(--muted); cursor: pointer; }
.widget-bar button:hover { background: var(--bg3); color: var(--text); }
.widget-bar button.danger:hover { color: var(--bad); }

/* empty state */
.empty-state { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(ellipse at 50% 25%, #19202b, #0a0c10 70%); z-index: 8; overflow-y: auto; }
.drop-card { width: min(640px, 100%); margin: auto; text-align: center; border: 2px dashed var(--line2); border-radius: 20px; padding: 28px 30px 20px; background: rgba(16,19,24,0.75); backdrop-filter: blur(4px); }
.drop-card.over { border-color: var(--accent); background: var(--accent-soft); }
.drop-icon { width: 50px; height: 50px; margin: 0 auto 12px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 24px; box-shadow: 0 0 0 8px rgba(255,106,31,0.06); }
.drop-card h1 { font-size: 26px; margin: 0 0 8px; letter-spacing: -0.4px; }
.drop-card p { color: var(--muted); margin: 0 0 18px; }
.drop-card .fine { font-size: 12px; color: var(--faint); margin: 16px 0 0; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0 4px; text-align: left; }
.features div { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 12px; color: var(--muted); }
.features b { display: block; color: var(--text); font-size: 12.5px; margin-bottom: 2px; }
.faq { text-align: left; margin-top: 16px; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq ul { margin: 10px 0 2px; padding-left: 18px; color: var(--muted); }
.faq li { margin-bottom: 6px; }
.faq b { color: var(--text); }
.drop-overlay { position: absolute; inset: 10px; border: 3px dashed var(--accent); border-radius: 16px; background: rgba(255,106,31,0.08); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; z-index: 20; pointer-events: none; }

/* ---------- timeline ---------- */
.tl-panel { background: var(--bg1); border-top: 1px solid var(--line); }
.tl-toolbar { display: flex; align-items: center; gap: 5px; padding: 7px 12px 5px; }
.time-label { font: 600 13.5px/1 "Roboto Mono", Consolas, monospace; margin: 0 8px; min-width: 150px; color: var(--text); letter-spacing: -0.3px; white-space: nowrap; }
.time-label small { color: var(--faint); font-weight: 400; }
.divider { width: 1px; height: 22px; background: var(--line2); margin: 0 4px; }
.sel-label { font: 500 12px "Roboto Mono", Consolas, monospace; color: var(--sel); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.timeline { display: block; width: 100%; height: 132px; cursor: default; }

/* drawer bodies */
.tab-body { flex: 1; overflow-y: auto; padding: 14px 14px 24px; }
.sec { margin-bottom: 20px; }
.sec-title { display: flex; align-items: center; justify-content: space-between; font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--faint); font-weight: 700; margin: 0 0 9px; }
.card { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; }
.hint { color: var(--muted); font-size: 12px; margin: 4px 0 8px; }
.empty-hint { color: var(--faint); font-size: 12px; text-align: center; padding: 18px 10px; border: 1px dashed var(--line2); border-radius: var(--r); line-height: 1.6; }
.hero-card { background: linear-gradient(135deg, rgba(180,108,255,0.12), rgba(61,139,255,0.06)); border: 1px solid var(--line2); border-radius: 12px; padding: 14px; }
.hero-num { font: 700 30px/1.1 "Barlow Semi Condensed", Inter, sans-serif; letter-spacing: 0.3px; color: #e7d6ff; }
.hero-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }


/* add widget */
.add-btn { width: 100%; justify-content: center; padding: 11px; border-style: dashed; background: transparent; color: var(--text); border-radius: 10px; font-weight: 600; }
.add-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* layer list */
.layers { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.layers li { display: flex; align-items: center; gap: 9px; padding: 6px 6px 6px 9px; border-bottom: 1px solid var(--line); cursor: pointer; background: var(--bg2); transition: background 0.1s; }
.layers li:last-child { border-bottom: 0; }
.layers li:hover { background: var(--bg3); }
.layers li.sel { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.layers li.off .lname, .layers li.off .wicon { opacity: 0.4; }
.layers .wicon { width: 28px; height: 28px; border-radius: 7px; background: var(--bg4); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--accent); flex-shrink: 0; }
.layers .lname { flex: 1; min-width: 0; }
.layers .lname div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.layers .lname small { color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
.layers .acts { display: flex; gap: 0; opacity: 0; transition: opacity 0.1s; }
.layers li:hover .acts, .layers li.sel .acts { opacity: 1; }
.layers .acts button { background: none; border: 0; padding: 4px; border-radius: 5px; cursor: pointer; color: var(--muted); display: flex; }
.layers .acts button:hover { color: var(--text); background: var(--bg4); }
.layers .acts button[data-act="vis"] { opacity: 1; }
.layers li.off .acts { opacity: 1; }

/* inspector */
.insp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.insp-head .wicon { width: 36px; height: 36px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.insp-head h3 { margin: 0; font-size: 14px; flex: 1; }
.insp-head p { margin: 0; color: var(--muted); font-size: 12px; }
.group { border-top: 1px solid var(--line); padding: 12px 0 4px; }
.group > .gt { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--faint); font-weight: 700; margin-bottom: 10px; }
.f { margin-bottom: 12px; }
.f > label, .f > .fl { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.f > label .val { color: var(--text); font-variant-numeric: tabular-nums; }
.f select, .f input[type=text] { width: 100%; }
.f.inline { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.f.inline > label { margin: 0; color: var(--text); font-size: 13px; }
.color-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.color-row .swatch { padding: 0; flex: none; width: 22px; height: 22px; border-radius: 6px; border: 2px solid transparent; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12); }
.color-row .swatch.on { border-color: #fff; }
.pos-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pos-grid label { display: flex; flex-direction: column; gap: 3px; color: var(--muted); font-size: 11px; }
.pos-grid input { width: 100%; padding: 5px 6px; }
.align-row { display: flex; gap: 4px; margin: 10px 0; }
.align-row button { flex: 1; height: 28px; background: var(--bg3); border: 1px solid var(--line2); border-radius: 7px; cursor: pointer; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.align-row button:hover { color: var(--text); background: var(--bg4); }
.help { color: var(--faint); font-size: 11px; margin-top: 4px; line-height: 1.4; word-break: break-word; }
.img-pick { display: flex; gap: 8px; align-items: center; }
.img-pick img { width: 48px; height: 32px; object-fit: contain; background: var(--bg); border: 1px solid var(--line2); border-radius: 5px; }

/* theme gallery */
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.theme-card { background: linear-gradient(160deg, #3b4b5e, #1d2631); border: 1px solid var(--line2); border-radius: 10px; padding: 9px 6px 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; transition: border-color 0.12s, transform 0.12s; }
.theme-card:hover { border-color: var(--muted); transform: translateY(-1px); }
.theme-card.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tc-chip { position: relative; width: 74px; height: 34px; background: color-mix(in srgb, var(--tp) calc(var(--to) * 100%), transparent); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.tc-chip b { color: var(--tt); font-size: 19px; font-weight: 700; letter-spacing: 0.5px; }
.tc-chip i { position: absolute; left: 8px; right: 8px; bottom: 5px; height: 3px; border-radius: 2px; background: var(--ta); }
.tc-name { font: 600 11px Inter, sans-serif; color: var(--text); }

/* gallery dialog */
.gallery { width: min(940px, 94vw); height: min(700px, 88vh); padding: 0; border: 1px solid var(--line2); border-radius: 16px; background: var(--bg1); color: var(--text); box-shadow: var(--shadow); }
.gallery[open] { display: flex; flex-direction: column; animation: pop 0.14s ease-out; }
.gallery::backdrop { background: rgba(0,0,0,0.6); backdrop-filter: blur(3px); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid var(--line); font-size: 15px; }
.gallery-body { flex: 1; overflow-y: auto; padding: 8px 16px 18px; }
.gallery-body h4 { margin: 16px 0 8px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--faint); }
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.gal-card { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; overflow: hidden; text-align: left; padding: 0; transition: border-color 0.12s, transform 0.12s, box-shadow 0.12s; }
.gal-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.35); }
.gal-card canvas { display: block; width: 100%; height: 122px; background: linear-gradient(160deg, #405367, #222c38); }
.gal-card div { padding: 9px 11px 11px; }
.gal-card b { display: block; font-size: 13px; margin-bottom: 2px; }
.gal-card span { color: var(--muted); font-size: 11.5px; line-height: 1.35; display: block; }
.tbl.keys td { padding: 7px 6px; }
.tbl.keys td:first-child { width: 42%; }

/* tables / lists */
.tbl-wrap { overflow-x: auto; margin: 0 -2px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; color: var(--faint); font-weight: 600; font-size: 10.5px; padding: 5px 5px; border-bottom: 1px solid var(--line); text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; }
.tbl td { padding: 5px 5px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl tr.clickable { cursor: pointer; }
.tbl td { padding: 5px 4px; }
.tbl tr:hover td { background: var(--bg2); }
.tbl tr.best td { color: #dcc2ff; }
.tbl tr.slow td { color: var(--faint); }
.tbl tr.cur td { background: var(--primary-soft); }
.tbl tr.ideal td { color: var(--purple); border-bottom: 0; font-style: italic; }
.tbl td.sbest { color: var(--purple); font-weight: 600; }
.tag-best { color: var(--purple); font-weight: 600; }
.tbl .acts { text-align: right; white-space: nowrap; }
.tbl .acts button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 2px 3px; border-radius: 4px; display: inline-flex; }
.tbl .acts button:hover { color: var(--text); background: var(--bg4); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); padding: 9px 11px; }
.stat small { color: var(--muted); font-size: 11px; display: block; }
.stat b { font-size: 17px; font-variant-numeric: tabular-nums; }
.stat a { font-size: 11px; color: var(--muted); text-decoration: none; }
.stat a:hover { color: var(--text); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 12px; }
.kv div:nth-child(odd) { color: var(--muted); }
.kv div:nth-child(even) { text-align: right; }
.clip-item { display: flex; align-items: center; gap: 6px; padding: 7px 8px 7px 10px; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; transition: border-color 0.12s; }
.clip-item:hover { border-color: var(--line2); }
.clip-item.on { border-color: var(--sel); box-shadow: inset 3px 0 0 var(--sel); }
.clip-item input { flex: 1; background: transparent; border: 1px solid transparent; padding: 3px 5px; height: 28px; }
.clip-item input:hover, .clip-item input:focus { border-color: var(--line2); background: var(--bg); }
.clip-item small { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* export */
.opts { display: flex; flex-direction: column; gap: 5px; }
.opt { display: flex; align-items: center; gap: 9px; padding: 8px 10px; background: var(--bg2); border: 1px solid var(--line); border-radius: 9px; cursor: pointer; transition: border-color 0.12s, background 0.12s; }
.opt:hover { border-color: var(--line2); }
.opt.on { border-color: rgba(255,106,31,0.55); background: var(--accent-soft); }
.opt.dis { opacity: 0.45; cursor: default; }
.opt span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt small { color: var(--muted); font: 500 11.5px "Roboto Mono", Consolas, monospace; }
.opt input { accent-color: var(--accent); margin: 0; }
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.preset { text-align: left; background: var(--bg2); border: 1px solid var(--line2); border-radius: 10px; padding: 10px; cursor: pointer; transition: border-color 0.12s; }
.preset:hover { border-color: var(--muted); }
.preset.on { border-color: var(--accent); background: var(--accent-soft); }
.preset b { display: block; font-size: 13px; }
.preset span { color: var(--muted); font-size: 11.5px; }
.summary { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; margin-bottom: 12px; }
.summary > div:first-child { display: flex; justify-content: space-between; align-items: baseline; }
.summary b { font-size: 18px; }
.done-card { margin-top: 10px; border-color: rgba(43,217,107,0.35); background: rgba(43,217,107,0.06); }
.done-card ul { margin: 8px 0 0; padding-left: 18px; }
.done-card li { margin-bottom: 4px; word-break: break-word; }
.done-card .ic { color: var(--good); vertical-align: -3px; }
.progress { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; border: 1px solid var(--line); margin: 10px 0 8px; }
.progress div { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #ffb36b); transition: width 0.3s; }
.warn { background: rgba(255,176,0,0.1); border: 1px solid rgba(255,176,0,0.35); color: #ffd27a; border-radius: 9px; padding: 8px 10px; font-size: 12px; margin: 8px 0; }
.err { background: rgba(255,77,77,0.1); border: 1px solid rgba(255,77,77,0.35); color: #ff9c9c; border-radius: 9px; padding: 8px 10px; font-size: 12px; margin: 8px 0; }

.gallery.small-dlg { width: min(520px, 94vw); height: auto; max-height: 86vh; }
/* inspector (right panel) */
.inspector .insp-head { position: sticky; top: 0; z-index: 2; background: var(--bg1); padding: 14px 12px 12px 16px; border-bottom: 1px solid var(--line); margin: 0; }
.insp-body { padding: 4px 16px 0; }
.insp-body .group:first-child { border-top: 0; }
details.group > summary { cursor: pointer; list-style: none; }
details.group > summary::before { content: '▸ '; }
details.group[open] > summary::before { content: '▾ '; }
.half-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.f.half input { width: 100%; }

/* data-chip text editor */
.tok-editor { min-height: 70px; max-height: 180px; overflow-y: auto; background: var(--bg); border: 1px solid var(--line2); border-radius: 9px; padding: 9px 10px; line-height: 2; font-size: 13.5px; outline: none; white-space: pre-wrap; word-break: break-word; cursor: text; }
.tok-editor:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.tok-editor.over { border-color: var(--accent); background: rgba(255,106,31,0.06); }
.tok { display: inline-block; line-height: 1.5; padding: 0 7px; margin: 0 1px; border-radius: 6px; background: linear-gradient(180deg, rgba(255,106,31,0.28), rgba(255,106,31,0.18)); border: 1px solid rgba(255,106,31,0.55); color: #ffd9c4; font-size: 12px; font-weight: 600; cursor: pointer; user-select: none; vertical-align: 1px; }
.tok:hover { background: rgba(255,106,31,0.4); }
.tok-quick { display: flex; flex-wrap: wrap; gap: 4px; margin: 7px 0 4px; }
.tok-quick .btn { border: 1px dashed var(--line2); }
.palette { margin-top: 8px; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 9px 4px; }
.pgroup { margin-bottom: 6px; }
.pgroup small { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--faint); font-weight: 700; margin-bottom: 4px; }
.pgroup > div { display: flex; flex-wrap: wrap; gap: 4px; }
.pchip { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 6px; background: var(--bg3); border: 1px solid var(--line2); font-size: 11.5px; cursor: grab; user-select: none; }
.pchip:hover { border-color: rgba(255,106,31,0.6); color: #ffd9c4; }
.pchip:active { cursor: grabbing; }

/* export dialog */
.export-dlg { width: min(560px, 94vw); height: auto; max-height: 90vh; }
.export-dlg .tab-body { padding: 4px 0 6px; overflow: visible; }

.toast { position: fixed; top: 112px; left: 50%; transform: translateX(-50%); background: #222a36; border: 1px solid var(--line2); padding: 10px 16px; border-radius: 10px; z-index: 50; box-shadow: var(--shadow); max-width: 70vw; animation: toastIn 0.18s ease-out; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -8px); } }
.toast.error { border-color: #a33; background: #3a1d1d; }
.toast.good { border-color: #2a7a4a; background: #17301f; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--muted); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: -2px; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* recent videos on the start screen */
.recent { margin: 4px 0 6px; text-align: left; }
.recent .sec-title { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 12px; }
.recent-item { display: flex; justify-content: space-between; gap: 10px; padding: 7px 11px; background: var(--bg2); border: 1px solid var(--line); border-radius: 9px; margin-bottom: 5px; font-size: 12.5px; }
.recent-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.recent-item small { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- smaller screens ---------- */
.narrow-note { display: none; }
@media (max-width: 1440px) {
  /* the settings panel slides over the video instead of squeezing it */
  .inspector-panel { width: 290px; }
  .file-chip { max-width: 180px; }
}
@media (max-width: 1280px) {
  /* smaller screens: the panel floats over the video and glides in (no layout change underneath) */
  .inspector-panel { position: absolute; right: 0; top: 0; bottom: 0; width: 310px; box-shadow: -12px 0 40px rgba(0,0,0,0.45); transform: translateX(104%); visibility: hidden; transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0.22s; }
  .inspector-panel.open { transform: none; visibility: visible; transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s; }
  .brand-name { display: none; }
  .file-chip { display: none; }
  .sel-label { display: none; }
}
@media (max-width: 1120px) {
  /* the drawer floats too */
  .drawer { position: absolute; left: 62px; top: 0; bottom: 0; box-shadow: 12px 0 40px rgba(0,0,0,0.45); }
  .topbar .lbl, .fmt .lbl, .tl-toolbar .lbl, .tb .lbl { display: none; }
  .fmt.add .lbl { display: none; }
  .tb.primary .lbl { display: inline; }
  .time-label { min-width: 0; font-size: 12.5px; }
  .tb-range { width: 64px; }
  #tlMetric { max-width: 96px; }
}
@media (max-width: 900px) {
  .rail { width: 52px; }
  .rail button { width: 44px; font-size: 0; gap: 0; }
  .drawer { left: 52px; width: min(304px, calc(100vw - 60px)); }
  .units, #btnHelp, #btnRedo { display: none; }
  .tb-label { display: none; }
  .features { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .narrow-note { display: block; position: fixed; inset: auto 10px 10px 10px; z-index: 60; background: #2a2210; border: 1px solid #6b5520; color: #ffd98a; padding: 10px 12px; border-radius: 10px; font-size: 12px; }
}
@media (max-height: 760px) {
  .topbar { height: 46px; }
  .main { height: calc(100% - 46px); }
  .stage-wrap { padding: 52px 10px 8px; }
  .tl-toolbar { padding: 4px 12px 2px; }
  .timeline { height: 118px; }
}
.pop-row .color-row { flex-wrap: nowrap; gap: 5px; }
.pop-row .swatch { width: 21px; height: 21px; }
.tbl td.lt b { display: block; line-height: 1.2; }
.tbl td.lt small { display: block; font-size: 10.5px; color: var(--muted); line-height: 1.2; }
.tbl tr.best td.lt small, .tbl tr.ideal td.lt small { color: var(--purple); }

/* data logger (RaceChrono etc.) */
.add-log { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; background: var(--bg2); border: 1px dashed var(--line2); border-radius: 12px; padding: 12px; color: var(--text); cursor: pointer; font: inherit; }
.add-log:hover { border-color: var(--accent); background: rgba(255,106,31,0.06); }
.add-log svg { flex: none; margin-top: 2px; color: var(--accent); }
.add-log b { display: block; font-size: 13px; margin-bottom: 3px; }
.add-log small { color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.log-card { background: var(--bg2); border: 1px solid var(--line); border-radius: 11px; padding: 9px 10px; margin-bottom: 8px; }
.log-head { display: flex; align-items: center; gap: 8px; }
.log-head b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.log-meta { color: var(--muted); font-size: 11px; margin: 3px 0 6px; }
.log-chans { display: flex; flex-wrap: wrap; gap: 4px; }
.log-chans span { font-size: 10.5px; padding: 1px 7px; border-radius: 20px; background: var(--bg3); border: 1px solid var(--line2); }
.sync-status { font-size: 11.5px; padding: 6px 9px; border-radius: 8px; margin-bottom: 6px; border: 1px solid; }
.sync-status.ok { color: #9be8b6; border-color: #2a7a4a; background: #142a1c; }
.sync-status.warn { color: #ffd98a; border-color: #6b5520; background: #2a2210; }
.sync-status.bad { color: #ffb0b0; border-color: #7a2a2a; background: #2a1414; }
.sync-canvas { display: block; width: 100%; height: 86px; background: var(--bg); border: 1px solid var(--line2); border-radius: 9px; cursor: ew-resize; touch-action: none; }
.sync-canvas.dragging { cursor: grabbing; border-color: var(--accent); }
.sync-legend { display: flex; gap: 10px; white-space: nowrap; font-size: 10.5px; color: var(--muted); margin: 4px 0 8px; }
.sync-legend span::before { content: ''; display: inline-block; width: 10px; height: 3px; border-radius: 2px; vertical-align: 2px; margin-right: 4px; }
.sync-legend .cam::before { background: #ff6a1f; }
.sync-legend .log::before { background: #3da9ff; }
.sync-legend .hint { margin-left: auto; }
.sync-legend .hint::before { display: none; }
.sync-nudge { gap: 4px; }
.sync-nudge input { width: 72px; text-align: center; flex: 1; min-width: 0; }
.log-here { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 8px; margin: 6px 0; }
.log-here .row { margin-top: 6px; gap: 6px; }
.log-here select { flex: 1; min-width: 0; }
details.more-sec > summary { cursor: pointer; list-style: none; }
details.more-sec > summary::before { content: '▸ '; }
details.more-sec[open] > summary::before { content: '▾ '; }

/* template gallery */
.menu .item.browse { align-items: flex-start; padding: 9px 10px; }
.menu .item.browse span { display: flex; flex-direction: column; gap: 2px; text-align: left; }
.menu .item.browse small { color: var(--muted); font-size: 11px; font-weight: 400; white-space: normal; }
.tpl-gallery { width: min(1100px, 95vw); height: min(780px, 90vh); }
.tpl-cats { position: sticky; top: 0; z-index: 1; display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0 12px; background: var(--bg1); }
.chip { border: 1px solid var(--line2); background: var(--bg2); color: var(--text); border-radius: 20px; padding: 5px 13px; font: 600 12px Inter, sans-serif; cursor: pointer; }
.chip:hover { border-color: var(--muted); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.tpl-grid.tall { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.tpl-card { display: flex; flex-direction: column; padding: 0; text-align: left; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; color: var(--text); font: inherit; transition: border-color 0.12s, transform 0.12s, box-shadow 0.12s; }
.tpl-card:hover, .tpl-card:focus-visible { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.35); }
.tpl-card canvas { display: block; width: 100%; height: auto; background: #1d2631; }
.tpl-card div { padding: 9px 11px 11px; }
.tpl-card b { font-size: 13px; }
.tpl-card em { font-style: normal; font-size: 10px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--accent); margin-left: 6px; }
.tpl-card span { display: block; color: var(--muted); font-size: 11.5px; margin-top: 3px; line-height: 1.4; }

/* accessibility */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.stage:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.tok-help { margin-top: 4px; }
button:focus-visible, select:focus-visible, input:focus-visible, .swatch:focus-visible, summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
@media (forced-colors: active) {
  .tok, .pchip, .chip.on { border: 1px solid CanvasText; }
}

/* ---- v6: Look in the right panel, theme-following colors, per-widget style ---- */
.look-panel .look-body { padding: 14px 16px 24px; }
.look-panel .theme-grid { grid-template-columns: repeat(3, 1fr); }
.look-sub { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.look-hint { color: var(--faint); font-size: 11.5px; line-height: 1.45; margin: 12px 0 2px; }
.look-panel .pop-row .color-row { flex-wrap: wrap; }
.look-panel .pop-label { width: 70px; }
#btnLook.on { background: var(--accent-soft); color: var(--accent); }
.theme-pick { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px 0 5px; border-radius: 7px; border: 1px solid var(--line2); background: var(--bg3); color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.theme-pick .dot { width: 16px; height: 16px; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25); flex: none; }
.theme-pick:hover { color: var(--text); }
.theme-pick.on { border-color: var(--accent); color: var(--text); box-shadow: 0 0 0 1px var(--accent); }
.custom-color { position: relative; width: 26px; height: 26px; border-radius: 7px; border: 1px dashed var(--line2); background: conic-gradient(#ff4d4d, #ffd400, #2bd96b, #00c8ff, #b46cff, #ff4d4d); cursor: pointer; flex: none; overflow: hidden; }
.custom-color.on { border: 2px solid #fff; }
.custom-color input[type=color] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.custom-color:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.gt .badge { margin-left: 6px; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); text-transform: none; letter-spacing: 0; }
.gt .badge.soft { background: var(--bg3); color: var(--faint); }
.insp-idle .row { display: flex; gap: 8px; flex-wrap: wrap; }
.ff-bar { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 14px; background: rgba(255,176,0,0.09); border-bottom: 1px solid rgba(255,176,0,0.3); color: #ffd27a; font-size: 12.5px; }
.ff-bar span { flex: 1; min-width: 0; }
.ff-bar.hidden { display: none; }
