File: services/web-ui/public/tweaks-panel.jsx

// tweaks-panel.jsx
// Reusable Tweaks shell + form-control helpers.

const __TWEAKS_STYLE = `
  .twk-panel{position:fixed;right:16px;bottom:16px;z-index:2147483646;width:280px;
    max-height:calc(100vh - 32px);display:flex;flex-direction:column;
    transform:scale(var(--dc-inv-zoom,1));transform-origin:bottom right;
    background:rgba(250,249,247,.78);color:#29261b;
    -webkit-backdrop-filter:blur(24px) saturate(160%);backdrop-filter:blur(24px) saturate(160%);
    border:.5px solid rgba(255,255,255,.6);border-radius:14px;
    box-shadow:0 1px 0 rgba(255,255,255,.5) inset,0 12px 40px rgba(0,0,0,.18);
    font:11.5px/1.4 ui-sans-serif,system-ui,-apple-system,sans-serif;overflow:hidden}
  .twk-hd{display:flex;align-items:center;justify-content:space-between;
    padding:10px 8px 10px 14px;cursor:move;user-select:none}
  .twk-hd b{font-size:12px;font-weight:600;letter-spacing:.01em}
  .twk-x{appearance:none;border:0;background:transparent;color:rgba(41,38,27,.55);
    width:22px;height:22px;border-radius:6px;cursor:default;font-size:13px;line-height:1}
  .twk-x:hover{background:rgba(0,0,0,.06);color:#29261b}
  .twk-body{padding:2px 14px 14px;display:flex;flex-direction:column;gap:10px;
    overflow-y:auto;overflow-x:hidden;min-height:0;
    scrollbar-width:thin;scrollbar-color:rgba(0,0,0,.15) transparent}
  .twk-body::-webkit-scrollbar{width:8px}
  .twk-body::-webkit-scrollbar-track{background:transparent;margin:2px}
  .twk-body::-webkit-scrollbar-thumb{background:rgba(0,0,0,.15);border-radius:4px;
    border:2px solid transparent;background-clip:content-box}
  .twk-body::-webkit-scrollbar-thumb:hover{background:rgba(0,0,0,.25);
    border:2px solid transparent;background-clip:content-box}
  .twk-row{display:flex;flex-direction:column;gap:5px}
  .twk-row-h{flex-direction:row;align-items:center;justify-content:space-between;gap:10px}
  .twk-lbl{display:flex;justify-content:space-between;align-items:baseline;
    color:rgba(41,38,27,.72)}
  .twk-lbl>span:first-child{font-weight:500}
  .twk-val{color:rgba(41,38,27,.5);font-variant-numeric:tabular-nums}
  .twk-sect{font-size:10px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;
    color:rgba(41,38,27,.45);padding:10px 0 0}
  .twk-sect:first-child{padding-top:0}
  .twk-field{appearance:none;box-sizing:border-box;width:100%;min-width:0;height:26px;padding:0 8px;
    border:.5px solid rgba(0,0,0,.1);border-radius:7px;
    background:rgba(255,255,255,.6);color:inherit;font:inherit;outline:none}
  .twk-field:focus{border-color:rgba(0,0,0,.25);background:rgba(255,255,255,.85)}
  select.twk-field{padding-right:22px;
    background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='rgba(0,0,0,.5)' d='M0 0h10L5 6z'/></svg>");
    background-repeat:no-repeat;background-position:right 8px center}
  .twk-slider{appearance:none;-webkit-appearance:none;width:100%;height:4px;margin:6px 0;
    border-radius:999px;background:rgba(0,0,0,.12);outline:none}
  .twk-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;
    width:14px;height:14px;border-radius:50%;background:#fff;
    border:.5px solid rgba(0,0,0,.12);box-shadow:0 1px 3px rgba(0,0,0,.2);cursor:default}
  .twk-slider::-moz-range-thumb{width:14px;height:14px;border-radius:50%;
    background:#fff;border:.5px solid rgba(0,0,0,.12);box-shadow:0 1px 3px rgba(0,0,0,.2);cursor:default}
  .twk-seg{position:relative;display:flex;padding:2px;border-radius:8px;
    background:rgba(0,0,0,.06);user-select:none}
  .twk-seg-thumb{position:absolute;top:2px;bottom:2px;border-radius:6px;
    background:rgba(255,255,255,.9);box-shadow:0 1px 2px rgba(0,0,0,.12);
    transition:left .15s cubic-bezier(.3,.7,.4,1),width .15s}
  .twk-seg.dragging .twk-seg-thumb{transition:none}
  .twk-seg button{appearance:none;position:relative;z-index:1;flex:1;border:0;
    background:transparent;color:inherit;font:inherit;font-weight:500;min-height:22px;
    border-radius:6px;cursor:default;padding:4px 6px;line-height:1.2;
    overflow-wrap:anywhere}
  .twk-toggle{position:relative;width:32px;height:18px;border:0;border-radius:999px;
    background:rgba(0,0,0,.15);transition:background .15s;cursor:default;padding:0}
  .twk-toggle[data-on="1"]{background:#34c759}
  .twk-toggle i{position:absolute;top:2px;left:2px;width:14px;height:14px;border-radius:50%;
    background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.25);transition:transform .15s}
  .twk-toggle[data-on="1"] i{transform:translateX(14px)}
  .twk-num{display:flex;align-items:center;box-sizing:border-box;min-width:0;height:26px;padding:0 0 0 8px;
    border:.5px solid rgba(0,0,0,.1);border-radius:7px;background:rgba(255,255,255,.6)}
  .twk-num-lbl{font-weight:500;color:rgba(41,38,27,.6);cursor:ew-resize;
    user-select:none;padding-right:8px}
  .twk-num input{flex:1;min-width:0;height:100%;border:0;background:transparent;
    font:inherit;font-variant-numeric:tabular-nums;text-align:right;padding:0 8px 0 0;
    outline:none;color:inherit;-moz-appearance:textfield}
  .twk-num input::-webkit-inner-spin-button,.twk-num input::-webkit-outer-spin-button{
    -webkit-appearance:none;margin:0}
  .twk-num-unit{padding-right:8px;color:rgba(41,38,27,.45)}
  .twk-btn{appearance:none;height:26px;padding:0 12px;border:0;border-radius:7px;
    background:rgba(0,0,0,.78);color:#fff;font:inherit;font-weight:500;cursor:default}
  .twk-btn:hover{background:rgba(0,0,0,.88)}
  .twk-btn.secondary{background:rgba(0,0,0,.06);color:inherit}
  .twk-btn.secondary:hover{background:rgba(0,0,0,.1)}
  .twk-swatch{appearance:none;-webkit-appearance:none;width:56px;height:22px;
    border:.5px solid rgba(0,0,0,.1);border-radius:6px;padding:0;cursor:default;
    background:transparent;flex-shrink:0}
  .twk-swatch::-webkit-color-swatch-wrapper{padding:0}
  .twk-swatch::-webkit-color-swatch{border:0;border-radius:5.5px}
  .twk-swatch::-moz-color-swatch{border:0;border-radius:5.5px}
  .twk-chips{display:flex;gap:6px}
  .twk-chip{position:relative;appearance:none;flex:1;min-width:0;height:46px;
    padding:0;border:0;border-radius:6px;overflow:hidden;cursor:default;
    box-shadow:0 0 0 .5px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.06);
    transition:transform .12s cubic-bezier(.3,.7,.4,1),box-shadow .12s}
  .twk-chip:hover{transform:translateY(-1px);
    box-shadow:0 0 0 .5px rgba(0,0,0,.18),0 4px 10px rgba(0,0,0,.12)}
  .twk-chip[data-on="1"]{box-shadow:0 0 0 1.5px rgba(0,0,0,.85),
    0 2px 6px rgba(0,0,0,.15)}
  .twk-chip>span{position:absolute;top:0;bottom:0;right:0;width:34%;
    display:flex;flex-direction:column;box-shadow:-1px 0 0 rgba(0,0,0,.1)}
  .twk-chip>span>i{flex:1;box-shadow:0 -1px 0 rgba(0,0,0,.1)}
  .twk-chip>span>i:first-child{box-shadow:none}
  .twk-chip svg{position:absolute;top:6px;left:6px;width:13px;height:13px;
    filter:drop-shadow(0 1px 1px rgba(0,0,0,.3))}
`;

function useTweaks(defaults) {
  const [values, setValues] = React.useState(defaults);
  const setTweak = React.useCallback((keyOrEdits, val) => {
    const edits = typeof keyOrEdits === 'object' && keyOrEdits !== null
      ? keyOrEdits : { [keyOrEdits]: val };
    setValues((prev) => ({ ...prev, ...edits }));
    window.parent.postMessage({ type: '__edit_mode_set_keys', edits }, '*');
    window.dispatchEvent(new CustomEvent('tweakchange', { detail: edits }));
  }, []);
  return [values, setTweak];
}

function TweaksPanel({ title = 'Tweaks', children }) {
  const [open, setOpen] = React.useState(false);
  const dragRef = React.useRef(null);
  const offsetRef = React.useRef({ x: 16, y: 16 });
  const PAD = 16;

  const clampToViewport = React.useCallback(() => {
    const panel = dragRef.current;
    if (!panel) return;
    const w = panel.offsetWidth, h = panel.offsetHeight;
    const maxRight = Math.max(PAD, window.innerWidth - w - PAD);
    const maxBottom = Math.max(PAD, window.innerHeight - h - PAD);
    offsetRef.current = {
      x: Math.min(maxRight, Math.max(PAD, offsetRef.current.x)),
      y: Math.min(maxBottom, Math.max(PAD, offsetRef.current.y)),
    };
    panel.style.right = offsetRef.current.x + 'px';
    panel.style.bottom = offsetRef.current.y + 'px';
  }, []);

  React.useEffect(() => {
    if (!open) return;
    clampToViewport();
    if (typeof ResizeObserver === 'undefined') {
      window.addEventListener('resize', clampToViewport);
      return () => window.removeEventListener('resize', clampToViewport);
    }
    const ro = new ResizeObserver(clampToViewport);
    ro.observe(document.documentElement);
    return () => ro.disconnect();
  }, [open, clampToViewport]);

  React.useEffect(() => {
    const onMsg = (e) => {
      const t = e?.data?.type;
      if (t === '__activate_edit_mode') setOpen(true);
      else if (t === '__deactivate_edit_mode') setOpen(false);
    };
    window.addEventListener('message', onMsg);
    window.parent.postMessage({ type: '__edit_mode_available' }, '*');
    return () => window.removeEventListener('message', onMsg);
  }, []);

  const dismiss = () => {
    setOpen(false);
    window.parent.postMessage({ type: '__edit_mode_dismissed' }, '*');
  };

  const onDragStart = (e) => {
    const panel = dragRef.current;
    if (!panel) return;
    const r = panel.getBoundingClientRect();
    const sx = e.clientX, sy = e.clientY;
    const startRight = window.innerWidth - r.right;
    const startBottom = window.innerHeight - r.bottom;
    const move = (ev) => {
      offsetRef.current = {
        x: startRight - (ev.clientX - sx),
        y: startBottom - (ev.clientY - sy),
      };
      clampToViewport();
    };
    const up = () => {
      window.removeEventListener('mousemove', move);
      window.removeEventListener('mouseup', up);
    };
    window.addEventListener('mousemove', move);
    window.addEventListener('mouseup', up);
  };

  if (!open) return null;
  return (
    <>

          {title}
          <button className="twk-x" aria-label="Close tweaks"
                  onMouseDown={(e) => e.stopPropagation()}
                  onClick={dismiss}>✕</button>

          {children}

    </>
  );
}

function TweakSection({ label, children }) {
  return (
    <>

{label}

      {children}
    </>
  );
}

function TweakRow({ label, value, children, inline = false }) {
  return (

        {label}
        {value != null && {value}}

      {children}

  );
}

function TweakSlider({ label, value, min = 0, max = 100, step = 1, unit = '', onChange }) {
  return (
    <TweakRow label={label} value={`${value}${unit}`}>
      <input type="range" className="twk-slider" min={min} max={max} step={step}
             value={value} onChange={(e) => onChange(Number(e.target.value))} />
    </TweakRow>
  );
}

function TweakToggle({ label, value, onChange }) {
  return (

{label}

      <button type="button" className="twk-toggle" data-on={value ? '1' : '0'}
              role="switch" aria-checked={!!value}
              onClick={() => onChange(!value)}></button>

  );
}

function TweakRadio({ label, value, options, onChange }) {
  const trackRef = React.useRef(null);
  const [dragging, setDragging] = React.useState(false);
  const valueRef = React.useRef(value);
  valueRef.current = value;

  const labelLen = (o) => String(typeof o === 'object' ? o.label : o).length;
  const maxLen = options.reduce((m, o) => Math.max(m, labelLen(o)), 0);
  const fitsAsSegments = maxLen <= ({ 2: 16, 3: 10 }[options.length] ?? 0);
  if (!fitsAsSegments) {
    const resolve = (s) => {
      const m = options.find((o) => String(typeof o === 'object' ? o.value : o) === s);
      return m === undefined ? s : typeof m === 'object' ? m.value : m;
    };
    return <TweakSelect label={label} value={value} options={options}
                        onChange={(s) => onChange(resolve(s))} />;
  }
  const opts = options.map((o) => (typeof o === 'object' ? o : { value: o, label: o }));
  const idx = Math.max(0, opts.findIndex((o) => o.value === value));
  const n = opts.length;

  const segAt = (clientX) => {
    const r = trackRef.current.getBoundingClientRect();
    const inner = r.width - 4;
    const i = Math.floor(((clientX - r.left - 2) / inner) * n);
    return opts[Math.max(0, Math.min(n - 1, i))].value;
  };

  const onPointerDown = (e) => {
    setDragging(true);
    const v0 = segAt(e.clientX);
    if (v0 !== valueRef.current) onChange(v0);
    const move = (ev) => {
      if (!trackRef.current) return;
      const v = segAt(ev.clientX);
      if (v !== valueRef.current) onChange(v);
    };
    const up = () => {
      setDragging(false);
      window.removeEventListener('pointermove', move);
      window.removeEventListener('pointerup', up);
    };
    window.addEventListener('pointermove', move);
    window.addEventListener('pointerup', up);
  };

  return (
    <TweakRow label={label}>

        <div className="twk-seg-thumb"
             style={{ left: `calc(2px + ${idx} * (100% - 4px) / ${n})`,
                      width: `calc((100% - 4px) / ${n})` }} />
        {opts.map((o) => (
          <button key={o.value} type="button" role="radio" aria-checked={o.value === value}>
            {o.label}
          </button>
        ))}

    </TweakRow>
  );
}

function TweakSelect({ label, value, options, onChange }) {
  return (
    <TweakRow label={label}>
      <select className="twk-field" value={value} onChange={(e) => onChange(e.target.value)}>
        {options.map((o) => {
          const v = typeof o === 'object' ? o.value : o;
          const l = typeof o === 'object' ? o.label : o;
          return <option key={v} value={v}>{l}</option>;
        })}
      </select>
    </TweakRow>
  );
}

function TweakText({ label, value, placeholder, onChange }) {
  return (
    <TweakRow label={label}>
      <input className="twk-field" type="text" value={value} placeholder={placeholder}
             onChange={(e) => onChange(e.target.value)} />
    </TweakRow>
  );
}

function TweakNumber({ label, value, min, max, step = 1, unit = '', onChange }) {
  const clamp = (n) => {
    if (min != null && n < min) return min;
    if (max != null && n > max) return max;
    return n;
  };
  const startRef = React.useRef({ x: 0, val: 0 });
  const onScrubStart = (e) => {
    e.preventDefault();
    startRef.current = { x: e.clientX, val: value };
    const decimals = (String(step).split('.')[1] || '').length;
    const move = (ev) => {
      const dx = ev.clientX - startRef.current.x;
      const raw = startRef.current.val + dx * step;
      const snapped = Math.round(raw / step) * step;
      onChange(clamp(Number(snapped.toFixed(decimals))));
    };
    const up = () => {
      window.removeEventListener('pointermove', move);
      window.removeEventListener('pointerup', up);
    };
    window.addEventListener('pointermove', move);
    window.addEventListener('pointerup', up);
  };
  return (

      {label}
      <input type="number" value={value} min={min} max={max} step={step}
             onChange={(e) => onChange(clamp(Number(e.target.value)))} />
      {unit && {unit}}

  );
}

function __twkIsLight(hex) {
  const h = String(hex).replace('#', '');
  const x = h.length === 3 ? h.replace(/./g, (c) => c + c) : h.padEnd(6, '0');
  const n = parseInt(x.slice(0, 6), 16);
  if (Number.isNaN(n)) return true;
  const r = (n >> 16) & 255, g = (n >> 8) & 255, b = n & 255;
  return r * 299 + g * 587 + b * 114 > 148000;
}

const __TwkCheck = ({ light }) => (
  <svg viewBox="0 0 14 14" aria-hidden="true">
    <path d="M3 7.2 5.8 10 11 4.2" fill="none" strokeWidth="2.2"
          strokeLinecap="round" strokeLinejoin="round"
          stroke={light ? 'rgba(0,0,0,.78)' : '#fff'} />
  </svg>
);

function TweakColor({ label, value, options, onChange }) {
  if (!options || !options.length) {
    return (

{label}

        <input type="color" className="twk-swatch" value={value}
               onChange={(e) => onChange(e.target.value)} />

    );
  }
  const key = (o) => String(JSON.stringify(o)).toLowerCase();
  const cur = key(value);
  return (
    <TweakRow label={label}>

        {options.map((o, i) => {
          const colors = Array.isArray(o) ? o : [o];
          const [hero, ...rest] = colors;
          const sup = rest.slice(0, 4);
          const on = key(o) === cur;
          return (
            <button key={i} type="button" className="twk-chip" role="radio"
                    aria-checked={on} data-on={on ? '1' : '0'}
                    aria-label={colors.join(', ')} title={colors.join(' · ')}
                    style={{ background: hero }}
                    onClick={() => onChange(o)}>
              {sup.length > 0 && (

                  {sup.map((c, j) => )}

              )}
              {on && <__TwkCheck light={__twkIsLight(hero)} />}
            </button>
          );
        })}

    </TweakRow>
  );
}

function TweakButton({ label, onClick, secondary = false }) {
  return (
    <button type="button" className={secondary ? 'twk-btn secondary' : 'twk-btn'}
            onClick={onClick}>{label}</button>
  );
}

Object.assign(window, {
  useTweaks, TweaksPanel, TweakSection, TweakRow,
  TweakSlider, TweakToggle, TweakRadio, TweakSelect,
  TweakText, TweakNumber, TweakColor, TweakButton,
});


File: services/web-ui/public/modal-new-recorder.jsx

// modal-new-recorder.jsx — New Recorder dialog (SRT / RTMP / SDI)

function ProbeResult({ result }) {
  if (!result.ok) {
    return (

        Probe failed: {result.error}

    );
  }
  const d = result.data || {};
  const entries = Object.entries(d).filter(([, v]) => v !== null && typeof v !== 'object');
  if (entries.length === 0) {
    return (

        ✓ Source reachable

    );
  }
  return (

      {entries.map(([k, v]) => (

          {k}
          {String(v)}

      ))}

  );
}

function NewRecorderModal({ open, onClose }) {
  const { PROJECTS, NODES } = window.ZAMPP_DATA;
  const [name, setName] = React.useState('');
  const [sourceType, setSourceType] = React.useState('SRT');
  const [srtUrl, setSrtUrl] = React.useState('srt://10.0.4.18:4200');
  const [rtmpUrl, setRtmpUrl] = React.useState('rtmp://stream.local/live/cam_a');
  const [sdiDeviceIdx, setSdiDeviceIdx] = React.useState(0);
  const [sdiNodeId, setSdiNodeId] = React.useState(() => {
    const n = window.ZAMPP_DATA.NODES[0];
    return n ? (n.id || n.hostname || '') : '';
  });
  const [sdiDevices, setSdiDevices] = React.useState(null);
  const [recTab, setRecTab] = React.useState('video');
  const [recCodec, setRecCodec] = React.useState('prores_hq');
  const [recContainer, setRecContainer] = React.useState('mov');
  const [proxyOn, setProxyOn] = React.useState(true);
  const [projectId, setProjectId] = React.useState(PROJECTS[0]?.id || '');
  const [submitting, setSubmitting] = React.useState(false);
  const [submitErr, setSubmitErr] = React.useState(null);
  const [probing, setProbing] = React.useState(false);
  const [probeResult, setProbeResult] = React.useState(null);

  React.useEffect(() => {
    if (sourceType !== 'SDI' || sdiDevices !== null) return;
    window.ZAMPP_API.fetch('/cluster/devices/blackmagic')
      .then(d => setSdiDevices(Array.isArray(d) ? d : []))
      .catch(() => setSdiDevices([]));
  }, [sourceType]);

  React.useEffect(() => { setProbeResult(null); }, [sourceType, srtUrl, rtmpUrl]);

  const handleProbe = () => {
    setProbing(true);
    setProbeResult(null);
    const body = sourceType === 'SRT'
      ? { source_type: 'srt', url: srtUrl }
      : { source_type: 'rtmp', url: rtmpUrl };
    window.ZAMPP_API.fetch('/recorders/probe', { method: 'POST', body: JSON.stringify(body) })
      .then(r => { setProbing(false); setProbeResult({ ok: true, data: r }); })
      .catch(e => { setProbing(false); setProbeResult({ ok: false, error: e.message }); });
  };

  const handleCreate = () => {
    if (!name.trim()) { setSubmitErr('Recorder name is required.'); return; }
    if (sourceType === 'SDI' && !sdiNodeId) { setSubmitErr('Select a capture node for SDI.'); return; }
    setSubmitting(true);
    setSubmitErr(null);

    const body = {
      name: name.trim(),
      source_type: sourceType.toLowerCase(),
      project_id: projectId || undefined,
      generate_proxy: proxyOn,
      recording_codec: recCodec,
      recording_container: recContainer,
    };

    if (sourceType === 'SRT') {
      body.source_config = { url: srtUrl };
    } else if (sourceType === 'RTMP') {
      body.source_config = { url: rtmpUrl };
    } else {
      // SDI: device_index and node_id are top-level fields
      body.source_config = {};
      body.device_index = sdiDeviceIdx;
      body.node_id = sdiNodeId || undefined;
    }

    window.ZAMPP_API.fetch('/recorders', { method: 'POST', body: JSON.stringify(body) })
      .then(() => { setSubmitting(false); onClose(); })
      .catch(e => { setSubmitting(false); setSubmitErr(e.message || 'Failed to create recorder'); });
  };

  if (!open) return null;

  return (

 e.stopPropagation()}>

New recorder

Configure source, codec, and destination

          <button className="icon-btn" onClick={onClose}><Icon name="x" /></button>

            Recorder name
            <input className="field-input" placeholder="e.g. Studio A Stage Cam"
              value={name} onChange={e => setName(e.target.value)} />

            Source type

              {[
                { id: 'SRT',  label: 'SRT',  desc: 'Secure Reliable Transport — pull caller', icon: 'signal' },
                { id: 'RTMP', label: 'RTMP', desc: 'Real-Time Messaging Protocol',             icon: 'globe' },
                { id: 'SDI',  label: 'SDI',  desc: 'Blackmagic DeckLink hardware',             icon: 'video' },
              ].map(t => (
                <button key={t.id}
                  className={`source-type-card ${sourceType === t.id ? 'active' : ''}`}
                  onClick={() => setSourceType(t.id)}>

<Icon name={t.icon} size={16} />

{t.label}

{t.desc}

                </button>
              ))}

          {sourceType === 'SRT' && (

              Source URL

                <input className="field-input mono" placeholder="srt://192.168.1.100:4200"
                  value={srtUrl} onChange={e => setSrtUrl(e.target.value)} style={{ flex: 1 }} />
                <button className="btn ghost sm" onClick={handleProbe} disabled={probing}
                  style={{ flexShrink: 0, minWidth: 64 }}>
                  {probing ? '…' : 'Probe'}
                </button>

                Recorder connects out to this URL (caller mode).

              {probeResult && <ProbeResult result={probeResult} />}

          )}

          {sourceType === 'RTMP' && (

              Source URL

                <input className="field-input mono" placeholder="rtmp://server/live/streamkey"
                  value={rtmpUrl} onChange={e => setRtmpUrl(e.target.value)} style={{ flex: 1 }} />
                <button className="btn ghost sm" onClick={handleProbe} disabled={probing}
                  style={{ flexShrink: 0, minWidth: 64 }}>
                  {probing ? '…' : 'Probe'}
                </button>

                Recorder pulls this RTMP stream.

              {probeResult && <ProbeResult result={probeResult} />}

          )}

          {sourceType === 'SDI' && (

              Capture device
              {sdiDevices === null && (

Detecting DeckLink devices…

              )}
              {sdiDevices !== null && sdiDevices.length > 0 && (

                  {sdiDevices.map((dev, di) => (

                        {(dev.model || dev.device || 'DeckLink').toUpperCase()} · {dev.hostname}

                      {Array.from({ length: dev.port_count || 4 }, (_, i) => i).map(idx => (
                        <button key={idx}
                          className={`sdi-mini-port ${sdiDeviceIdx === idx && sdiNodeId === (dev.node_id || dev.hostname || '') ? 'active' : ''}`}
                          onClick={() => { setSdiDeviceIdx(idx); setSdiNodeId(dev.node_id || dev.hostname || ''); }}>

                          SDI {idx + 1}
                          index {idx}
                        </button>
                      ))}

                  ))}

              )}
              {sdiDevices !== null && sdiDevices.length === 0 && (

                    No DeckLink devices auto-detected. Configure manually:

                      Capture node
                      <select className="field-input" value={sdiNodeId}
                        onChange={e => setSdiNodeId(e.target.value)} style={{ appearance: 'auto' }}>
                        {NODES.length === 0
                          ? <option value="">No cluster nodes</option>
                          : NODES.map(n => {
                              const id = n.id || n.hostname || n.name || '';
                              const label = n.hostname || n.name || id;
                              return <option key={id} value={id}>{label}</option>;
                            })}
                      </select>

                      Device index
                      <select className="field-input" value={sdiDeviceIdx}
                        onChange={e => setSdiDeviceIdx(Number(e.target.value))} style={{ appearance: 'auto' }}>
                        {[0, 1, 2, 3].map(i =>
                          <option key={i} value={i}>SDI {i + 1} (index {i})</option>)}
                      </select>

              )}

          )}

              Master recording

                {['video', 'audio', 'container'].map(t => (
                  <button key={t} className={recTab === t ? 'active' : ''} onClick={() => setRecTab(t)}>
                    {t[0].toUpperCase() + t.slice(1)}
                  </button>
                ))}

              {recTab === 'video' && (

                    Video codec
                    <select className="field-input" value={recCodec} onChange={e => setRecCodec(e.target.value)} style={{ appearance: 'auto' }}>
                      <option value="prores_4444xq">ProRes 4444 XQ</option>
                      <option value="prores_4444">ProRes 4444</option>
                      <option value="prores_hq">ProRes 422 HQ</option>
                      <option value="prores">ProRes 422</option>
                      <option value="prores_lt">ProRes 422 LT</option>
                      <option value="prores_proxy">ProRes 422 Proxy</option>
                      <option value="libx264">H.264 (x264)</option>
                      <option value="libx265">H.265 / HEVC (x265)</option>
                      <option value="dnxhd">DNxHD 185x</option>
                      <option value="dnxhr_hq">DNxHR HQ</option>
                      <option value="xdcam_hd422">XDCAM HD422</option>
                    </select>

                  <Field label="Resolution" value="Source (native)" select />
                  <Field label="Color space" value="Rec. 709" select />
                  <Field label="Bit depth" value="10-bit" select />

              )}
              {recTab === 'audio' && (

                  <Field label="Audio codec" value="PCM" select />
                  <Field label="Sample rate" value="48 kHz" select />
                  <Field label="Channels" value="2.0 stereo" select />
                  <Field label="Bit depth" value="24-bit" select />

              )}
              {recTab === 'container' && (

                    Container
                    <select className="field-input" value={recContainer} onChange={e => setRecContainer(e.target.value)} style={{ appearance: 'auto' }}>
                      <option value="mov">MOV (QuickTime)</option>
                      <option value="mxf">MXF (SMPTE)</option>
                      <option value="mkv">MKV (Matroska)</option>
                      <option value="mp4">MP4</option>
                    </select>

                  <Field label="Segment" value="None (single file)" select />

              )}

              <input type="checkbox" checked={proxyOn} onChange={e => setProxyOn(e.target.checked)} />

Generate proxy

                SDI sources record proxy in parallel. Network sources generate proxy after stop.

          {proxyOn && (

Proxy

                  {['H.264', '2 Mbps', 'MP4', '1920×1080', 'AAC 128 kbps'].map(tag => (
                    {tag}
                  ))}

Fixed proxy profile — not configurable.

          )}

Destination

                Project
                <select className="field-input" value={projectId}
                  onChange={e => setProjectId(e.target.value)} style={{ appearance: 'auto' }}>
                  {PROJECTS.length === 0
                    ? <option value="">No projects</option>
                    : PROJECTS.map(p => <option key={p.id} value={p.id}>{p.name}</option>)}
                </select>

          {submitErr && (

{submitErr}

          )}

          <button className="btn ghost" onClick={onClose}>Cancel</button>

          <button className="btn primary" onClick={handleCreate} disabled={submitting}>
            {submitting ? 'Creating…' : 'Create recorder'}
          </button>

  );
}

window.NewRecorderModal = NewRecorderModal;


File: services/web-ui/public/visuals.jsx

// visuals.jsx - reusable visual elements

const _thumbCache = new Map();

function AssetThumb({ asset, size = 'md' }) {
  const aspect = size === 'tall' ? '9 / 16' : '16 / 9';
  const [thumbUrl, setThumbUrl] = React.useState(_thumbCache.get(asset.id) || null);

  React.useEffect(() => {
    if (!asset.id || thumbUrl || !asset.thumbnail_s3_key) return;
    let cancelled = false;
    fetch('/api/v1/assets/' + asset.id + '/thumbnail', { credentials: 'include' })
      .then(r => r.ok ? r.json() : null)
      .then(d => { if (!cancelled && d && d.url) { _thumbCache.set(asset.id, d.url); setThumbUrl(d.url); } })
      .catch(() => {});
    return () => { cancelled = true; };
  }, [asset.id, asset.thumbnail_s3_key]);

  if (asset.type === 'audio' || asset.media_type === 'audio') {
    return (

        <Waveform seed={asset.id ? asset.id.charCodeAt(0) % 60 : 1} />

<Icon name="audio" size={20} style={{ opacity: 0.9 }} />

    );
  }

  return (

      {thumbUrl
        ?
        : <FauxFrame />}
      {asset.status === 'live' && (

      )}

  );
}

function FauxFrame({ seed }) {
  return
;
}

function Waveform({ seed = 1, color = 'var(--accent)', className = '' }) {
  const bars = 60;
  const pts = React.useMemo(() => {
    return Array.from({ length: bars }).map((_, i) => {
      const n = Math.sin(i * 0.7 + seed) * 0.5 + Math.sin(i * 2.1 + seed * 1.3) * 0.3 + Math.sin(i * 4.3 + seed * 0.7) * 0.2;
      return Math.max(0.1, Math.min(1, 0.5 + n * 0.5));
    });
  }, [seed]);
  return (
    <svg viewBox="0 0 60 20" preserveAspectRatio="none" className={'waveform ' + className}>
      {pts.map((p, i) => (
        <rect key={i} x={i} y={10 - p * 9} width="0.6" height={p * 18} fill={color} rx="0.3" />
      ))}
    </svg>
  );
}

function LiveStrip({ seed = 1, count = 8 }) {
  return (

      {Array.from({ length: count }).map((_, i) => (

      ))}

NOW

  );
}

function Sparkline({ data, color = 'var(--accent)', height = 28, fill = true }) {
  const max = Math.max(...data, 1);
  const min = Math.min(...data, 0);
  const range = max - min || 1;
  const w = 100;
  const pts = data.map((d, i) => {
    const x = (i / (data.length - 1)) * w;
    const y = height - ((d - min) / range) * height;
    return x + ',' + y;
  }).join(' ');
  const area = '0,' + height + ' ' + pts + ' ' + w + ',' + height;
  return (
    <svg viewBox={'0 0 ' + w + ' ' + height} preserveAspectRatio="none" style={{ width: '100%', height, display: 'block' }}>
      {fill && <polygon points={area} fill={color} opacity="0.15" />}
      <polyline points={pts} fill="none" stroke={color} strokeWidth="1.5" />
    </svg>
  );
}

function AudioMeter({ level = 0.7, peak = 0.85, vertical = false }) {
  const segs = 20;
  return (

      {Array.from({ length: segs }).map((_, i) => {
        const v = i / segs;
        const on = v < level;
        const color = v < 0.6 ? 'var(--success)' : v < 0.85 ? 'var(--warning)' : 'var(--danger)';
        return
;
      })}

  );
}

function StatusDot({ status }) {
  const map = {
    online: { color: 'var(--success)', pulse: false },
    recording: { color: 'var(--live)', pulse: true },
    armed: { color: 'var(--accent)', pulse: false },
    idle: { color: 'var(--text-4)', pulse: false },
    error: { color: 'var(--danger)', pulse: true },
    offline: { color: 'var(--text-4)', pulse: false },
    processing: { color: 'var(--warning)', pulse: true },
    ready: { color: 'var(--success)', pulse: false },
    live: { color: 'var(--live)', pulse: true },
    queued: { color: 'var(--text-3)', pulse: false },
    running: { color: 'var(--accent)', pulse: true },
    done: { color: 'var(--success)', pulse: false },
    failed: { color: 'var(--danger)', pulse: false },
    stopped: { color: 'var(--text-4)', pulse: false },
  };
  const s = map[status] || { color: 'var(--text-3)' };
  return ;
}

function Elapsed({ seconds, live = false }) {
  const [t, setT] = React.useState(seconds);
  React.useEffect(() => {
    if (!live) return;
    const i = setInterval(() => setT(x => x + 1), 1000);
    return () => clearInterval(i);
  }, [live]);
  const h = Math.floor(t / 3600);
  const m = Math.floor((t % 3600) / 60);
  const s = t % 60;
  return {String(h).padStart(2,'0')}:{String(m).padStart(2,'0')}:{String(s).padStart(2,'0')};
}

Object.assign(window, { AssetThumb, FauxFrame, Waveform, LiveStrip, Sparkline, AudioMeter, StatusDot, Elapsed });


File: services/web-ui/public/data.jsx

// data.jsx — API client; populates window.ZAMPP_DATA from real endpoints

const API = '/api/v1';

window.ZAMPP_DATA = {
  PROJECTS: [],
  ASSETS: [],
  RECORDERS: [],
  JOBS: [],
  NODES: [],
  USERS: [],
  BINS: [],
  COMMENTS: [],
};

async function apiFetch(path, opts = {}) {
  const res = await fetch(API + path, {
    credentials: 'include',
    headers: { 'Content-Type': 'application/json', ...(opts.headers || {}) },
    ...opts,
  });
  if (!res.ok) throw new Error(res.status + ' ' + res.statusText);
  return res.json();
}

function fmtDuration(ms) {
  if (!ms) return '—';
  const s = Math.round(ms / 1000);
  const h = Math.floor(s / 3600);
  const m = Math.floor((s % 3600) / 60);
  const sec = s % 60;
  if (h > 0) return h + ':' + String(m).padStart(2, '0') + ':' + String(sec).padStart(2, '0');
  return m + ':' + String(sec).padStart(2, '0');
}

function fmtSize(bytes) {
  if (!bytes) return '—';
  if (bytes >= 1e12) return (bytes / 1e12).toFixed(1) + ' TB';
  if (bytes >= 1e9) return (bytes / 1e9).toFixed(1) + ' GB';
  if (bytes >= 1e6) return Math.round(bytes / 1e6) + ' MB';
  return Math.round(bytes / 1e3) + ' KB';
}

function fmtRelative(iso) {
  if (!iso) return '—';
  const diff = (Date.now() - new Date(iso)) / 1000;
  if (diff < 60) return 'just now';
  if (diff < 3600) return Math.floor(diff / 60) + 'm ago';
  if (diff < 86400) return Math.floor(diff / 3600) + 'h ago';
  return Math.floor(diff / 86400) + 'd ago';
}

const PROJECT_COLORS = ['#5B7CFA', '#2DD4A8', '#FF5B5B', '#F5A623', '#B57CFA', '#6B7280'];

function normalizeAsset(a, projectMap) {
  return {
    ...a,
    name: a.display_name || a.filename || 'Untitled',
    type: a.media_type || 'video',
    duration: fmtDuration(a.duration_ms),
    size: fmtSize(a.file_size),
    res: a.resolution || '—',
    updated: fmtRelative(a.updated_at),
    project: (projectMap && projectMap[a.project_id]) || '',
    comments: 0,
    progress: 0,
    tc: a.start_tc || null,
    seed: a.id ? a.id.charCodeAt(0) % 6 : 1,
  };
}

function normalizeRecorder(r) {
  let elapsed = '—';
  if (r.status === 'recording' && r.started_at) {
    const s = Math.floor((Date.now() - new Date(r.started_at)) / 1000);
    elapsed = String(Math.floor(s / 3600)).padStart(2, '0') + ':' +
              String(Math.floor((s % 3600) / 60)).padStart(2, '0') + ':' +
              String(s % 60).padStart(2, '0');
  }
  const cfg = r.source_config || {};
  return {
    ...r,
    source: r.source_type || '—',
    url: cfg.url || cfg.address || cfg.srt_url || cfg.rtmp_url || r.source_type || '—',
    codec: r.recording_codec || '—',
    res: r.recording_resolution || '—',
    node: r.node_id ? r.node_id.slice(0, 8) : 'primary',
    elapsed,
    bitrate: '—',
    health: 100,
    audio: false,
  };
}

function normalizeJob(j) {
  const statusMap = { waiting: 'queued', active: 'running', completed: 'done', failed: 'failed' };
  const kindMap = { proxy: 'Proxy', thumbnail: 'Thumbnail', conform: 'Conform', transcode: 'Transcode' };
  const meta = j.metadata || {};
  return {
    ...j,
    status: statusMap[j.status] || j.status,
    kind: kindMap[j.type] || j.type || 'Job',
    asset: j.asset_name || meta.filename || '—',
    eta: '—',
    node: meta.node || '—',
    priority: meta.priority || 'normal',
    error: j.error || null,
    progress: j.progress || 0,
  };
}

async function loadData() {
  const [projectsR, assetsR, recordersR, jobsR, clusterR, usersR, binsR] = await Promise.allSettled([
    apiFetch('/projects'),
    apiFetch('/assets?limit=500'),
    apiFetch('/recorders'),
    apiFetch('/jobs'),
    apiFetch('/cluster'),
    apiFetch('/users'),
    apiFetch('/bins'),
  ]);

  const projectMap = {};
  if (projectsR.status === 'fulfilled') {
    window.ZAMPP_DATA.PROJECTS = (projectsR.value || []).map((p, i) => ({
      ...p,
      color: PROJECT_COLORS[i % PROJECT_COLORS.length],
      assets: 0,
      updated: fmtRelative(p.updated_at),
    }));
    window.ZAMPP_DATA.PROJECTS.forEach(p => { projectMap[p.id] = p.name; });
  }

  if (assetsR.status === 'fulfilled') {
    const raw = assetsR.value;
    const list = Array.isArray(raw) ? raw : (raw.assets || []);
    window.ZAMPP_DATA.ASSETS = list.map(a => normalizeAsset(a, projectMap));
    const counts = {};
    list.forEach(a => { if (a.project_id) counts[a.project_id] = (counts[a.project_id] || 0) + 1; });
    window.ZAMPP_DATA.PROJECTS = window.ZAMPP_DATA.PROJECTS.map(p => ({ ...p, assets: counts[p.id] || 0 }));
  }

  if (recordersR.status === 'fulfilled') {
    window.ZAMPP_DATA.RECORDERS = (recordersR.value || []).map(normalizeRecorder);
  }

  if (jobsR.status === 'fulfilled') {
    window.ZAMPP_DATA.JOBS = (jobsR.value || []).map(normalizeJob);
  }

  if (clusterR.status === 'fulfilled') {
    window.ZAMPP_DATA.NODES = clusterR.value || [];
  }

  if (usersR.status === 'fulfilled') {
    window.ZAMPP_DATA.USERS = (usersR.value || []).map(u => ({
      ...u,
      name: u.display_name || u.username || u.email || 'Unknown',
      initials: (u.display_name || u.username || '?').slice(0, 2).toUpperCase(),
      role: u.role || 'viewer',
      joined: fmtRelative(u.created_at),
      lastSeen: fmtRelative(u.last_seen || u.updated_at),
    }));
  }

  if (binsR.status === 'fulfilled') {
    window.ZAMPP_DATA.BINS = (binsR.value || []).map(b => ({
      ...b,
      count: b.asset_count || 0,
      icon: b.type || 'grid',
    }));
  }
}

window.ZAMPP_API = { fetch: apiFetch, loadData, fmtDuration, fmtSize, fmtRelative };
// Library re-renders after mutations: expose normalizeAsset so the screen
// can re-fetch /assets and produce rows with the same shape as the boot load.
window.normalizeAsset = normalizeAsset;


Now let me handle the large screens-admin.jsx file and grab the CSS files.


Bash

python3 -c "
import json
with open('/home/node/.claude/projects/-home-node/512de26d-e7df-41bb-aacd-91c5f85e82b5/tool-results/mcp-claude_ai_mcp-server-forgejo_forgejo_get_file-1779508726994.txt') as f:
    data = json.load(f)
content = data['result']
patterns = ['onContextMenu', 'oncontextmenu', 'contextmenu', 'context-menu', 'right-click', 'rightclick', 'ctxMenu', 'ctx-menu']
lines = content.split('\n')
for pat in patterns:
    print(f'=== {pat} ===')
    found = False
    for i, line in enumerate(lines):
        if pat.lower() in line.lower():
            found = True
            start = max(0, i-2)
            end = min(len(lines), i+3)
            for j in range(start, end):
                print(f'  {j+1}: {lines[j]}')
            print('  ---')
    if not found:
        print('  (none)')
"

Search screens-admin.jsx for context menu patterns


=== onContextMenu ===
  (none)
=== oncontextmenu ===
  (none)
=== contextmenu ===
  (none)
=== context-menu ===
  (none)
=== right-click ===
  (none)
=== rightclick ===
  (none)
=== ctxMenu ===
  (none)
=== ctx-menu ===
  (none)


File: services/web-ui/public/styles.css

/* ========== Z-AMPP Design System ========== */
:root {
  /* base palette - dark, gray-leaning, frame.io inspired */
  --bg-0: #0B0D11;
  --bg-1: #14171E;
  --bg-2: #1B1F27;
  --bg-3: #232833;
  --bg-4: #2D3340;
  --hover: rgba(255,255,255,0.04);
  --hover-strong: rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.06);
  --border-strong: rgba(255,255,255,0.10);
  --border-stronger: rgba(255,255,255,0.14);

  /* text */
  --text-1: #F2F3F6;
  --text-2: #A8AEBC;
  --text-3: #6B7280;
  --text-4: #4B5260;

  /* accent (blue, frame.io-ish) */
  --accent: #5B7CFA;
  --accent-hover: #6E8BFF;
  --accent-soft: rgba(91, 124, 250, 0.14);
  --accent-soft-2: rgba(91, 124, 250, 0.22);
  --accent-text: #B4C3FF;

  /* status */
  --success: #2DD4A8;
  --success-soft: rgba(45, 212, 168, 0.14);
  --warning: #F5A623;
  --warning-soft: rgba(245, 166, 35, 0.14);
  --danger: #FF5B5B;
  --danger-soft: rgba(255, 91, 91, 0.14);
  --live: #FF3B30;
  --live-soft: rgba(255, 59, 48, 0.18);
  --purple: #B57CFA;
  --purple-soft: rgba(181, 124, 250, 0.14);

  /* radius */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;

  /* shadow */
  --shadow-pop: 0 12px 32px rgba(0,0,0,0.45), 0 2px 6px rgba(0,0,0,0.25);
  --shadow-card: 0 1px 0 rgba(255,255,255,0.04) inset, 0 1px 2px rgba(0,0,0,0.3);

  /* sizing (density tweakable) */
  --sidebar-w: 232px;
  --row-h: 44px;
  --topbar-h: 56px;
  --gap: 16px;

  /* fonts */
  --font-sans: "Geist", "Söhne", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "Geist Mono", "JetBrains Mono", ui-monospace, monospace;
}

/* density tweak */
[data-density="compact"] {
  --row-h: 36px;
  --topbar-h: 48px;
  --gap: 12px;
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; }
body {
  margin: 0;
  background: var(--bg-0);
  color: var(--text-1);
  font-family: var(--font-sans);
  font-feature-settings: "ss01", "cv11";
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.07); border-radius: 99px; border: 2px solid var(--bg-0); }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.14); }

/* ========== Layout ========== */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
  background: var(--bg-0);
}
.app[data-sidebar="collapsed"] { --sidebar-w: 56px; }

/* ========== Sidebar ========== */
.sidebar {
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar-header {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.brand-mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #FF6B35 0%, #C8362D 50%, #5B2D8A 100%);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  color: white;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(255, 107, 53, 0.25);
}
.brand-name {
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 14px;
  white-space: nowrap;
}
.brand-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-left: auto;
  font-family: var(--font-mono);
  white-space: nowrap;
}
.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
}
.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-4);
  padding: 14px 10px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  height: 32px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 80ms, color 80ms;
  position: relative;
}
.nav-item:hover {
  background: var(--hover);
  color: var(--text-1);
}
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-text);
}
.nav-item.active .nav-icon { color: var(--accent); }
.nav-item.has-children > .nav-caret {
  margin-left: auto;
  opacity: 0.5;
  transition: transform 120ms;
}
.nav-item.has-children.open > .nav-caret { transform: rotate(90deg); }
.nav-icon {
  width: 16px; height: 16px;
  color: var(--text-3);
  flex-shrink: 0;
}
.nav-item:hover .nav-icon { color: var(--text-2); }
.nav-children {
  margin: 2px 0 4px 22px;
  border-left: 1px solid var(--border-strong);
  padding-left: 6px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.nav-children .nav-item {
  height: 28px;
  font-size: 12.5px;
  font-weight: 450;
}
.nav-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  background: var(--bg-3);
  padding: 1px 6px;
  border-radius: 99px;
  line-height: 1.5;
}
.nav-badge.dev {
  color: var(--warning);
  background: var(--warning-soft);
}
.nav-badge.live {
  color: var(--live);
  background: var(--live-soft);
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-badge.live::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--live);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5B7CFA, #B57CFA);
  display: grid; place-items: center;
  font-weight: 600; font-size: 11px;
  color: white;
  flex-shrink: 0;
}
.user-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.user-name { font-size: 12.5px; font-weight: 500; }
.user-role { font-size: 11px; color: var(--text-3); }
.user-meta .user-name, .user-meta .user-role { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ========== Top bar ========== */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.topbar {
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  flex-shrink: 0;
  background: var(--bg-0);
}
.crumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
}
.crumb .sep { color: var(--text-4); }
.crumb .current { color: var(--text-1); font-weight: 500; }
.topbar .spacer { flex: 1; }
.status-pip {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px;
  color: var(--text-3);
  font-family: var(--font-mono);
}
.status-pip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.status-pip.warn .dot { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }

.icon-btn {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  color: var(--text-2);
  transition: background 80ms, color 80ms;
}
.icon-btn:hover { background: var(--hover); color: var(--text-1); }
.icon-btn svg { width: 16px; height: 16px; }

.search {
  position: relative;
  height: 32px;
  width: 280px;
  display: flex; align-items: center;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0 12px 0 32px;
  color: var(--text-2);
  font-size: 12.5px;
  transition: border 80ms, background 80ms;
}
.search:focus-within {
  border-color: var(--accent);
  background: var(--bg-2);
}
.search input { flex: 1; outline: 0; border: 0; background: transparent; min-width: 0; }
.search .search-icon {
  position: absolute;
  left: 10px;
  width: 14px; height: 14px;
  color: var(--text-3);
}
.kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 4px;
  line-height: 1.2;
}

/* ========== Buttons ========== */
.btn {
  height: 32px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 80ms, border 80ms, color 80ms;
  white-space: nowrap;
}
.btn.primary { background: var(--accent); color: white; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--hover); color: var(--text-1); }
.btn.subtle { background: var(--bg-2); color: var(--text-1); border-color: var(--border); }
.btn.subtle:hover { background: var(--bg-3); border-color: var(--border-strong); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.danger:hover { background: rgba(255,91,91,0.22); }
.btn svg { width: 14px; height: 14px; }
.btn.lg { height: 36px; padding: 0 16px; font-size: 13px; }
.btn.sm { height: 26px; padding: 0 10px; font-size: 12px; }
.btn.icon-only { padding: 0; width: 32px; justify-content: center; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ========== Badges ========== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}
.badge.live { background: var(--live-soft); color: var(--live); }
.badge.live::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--live); animation: pulse 1.6s ease-in-out infinite; }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.accent { background: var(--accent-soft); color: var(--accent-text); }
.badge.neutral { background: var(--bg-3); color: var(--text-2); }
.badge.purple { background: var(--purple-soft); color: var(--purple); }
.badge.outline { background: transparent; border: 1px solid var(--border-strong); color: var(--text-2); }

/* ========== Cards / Panels ========== */
.panel {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.panel-header {
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}
.panel-header h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.panel-body { padding: 16px; }

/* ========== Page chrome ========== */
.page {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}
.page-header {
  padding: 24px 28px 8px;
  display: flex;
  align-items: flex-end;
  gap: 16px;
}
.page-header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.page-header .subtitle {
  color: var(--text-3);
  font-size: 13px;
}
.page-header .spacer { flex: 1; }
.page-body { padding: 16px 28px 40px; }

/* ========== Generic utility ========== */
.row { display: flex; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; }
.muted { color: var(--text-3); }
.subtle-text { color: var(--text-2); font-size: 12.5px; }
.mono { font-family: var(--font-mono); }
.divider { height: 1px; background: var(--border); margin: 12px 0; }

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 200ms ease both; }

[data-tip] { position: relative; }
[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-4);
  color: var(--text-1);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
  border: 1px solid var(--border-strong);
}


File: services/web-ui/public/styles-rest.css

/* ========== Projects ========== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.project-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform 120ms, border 80ms;
}
.project-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-stronger);
}
.project-thumb-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  aspect-ratio: 16 / 9;
  background: var(--bg-2);
}
.project-thumb-grid .project-thumb-cell:first-child { grid-row: span 2; }
.project-thumb-cell { position: relative; overflow: hidden; background: var(--bg-2); }
.project-thumb-cell .thumb-svg { width: 100%; height: 100%; }
.project-card-body { padding: 12px 14px; }
.project-meta {
  display: flex; gap: 6px;
  font-size: 11.5px; color: var(--text-3);
  margin-top: 4px;
}
.project-bar {
  margin-top: 10px;
  display: flex;
  height: 4px;
  border-radius: 99px;
  overflow: hidden;
  background: var(--bg-3);
  gap: 1px;
}

/* ========== Upload ========== */
.field-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-4);
  display: block;
  margin-bottom: 6px;
}
.select-faux, .field-input {
  height: 34px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0 10px;
  display: flex; align-items: center; gap: 8px;
  color: var(--text-1);
  font-size: 12.5px;
  width: 100%;
  cursor: pointer;
}
.field-input { font-size: 12.5px; outline: 0; }
.field-input:focus { border-color: var(--accent); background: var(--bg-2); }
.field-input.select { justify-content: space-between; }

.dropzone {
  background: var(--bg-1);
  border: 1.5px dashed var(--border-stronger);
  border-radius: var(--r-lg);
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background 120ms, border 120ms;
}
.dropzone:hover { background: var(--bg-2); border-color: var(--accent); }
.dropzone-formats { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; justify-content: center; }
.upload-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.upload-row:last-child { border-bottom: 0; }

/* ========== Recorders ========== */
.recorders-list { display: flex; flex-direction: column; gap: 10px; }
.recorder-row {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 12px;
  display: grid;
  grid-template-columns: 220px 1fr 380px auto;
  align-items: center;
  gap: 16px;
  transition: border 80ms;
}
.recorder-row:hover { border-color: var(--border-stronger); }
.recorder-row.recording { border-color: rgba(255,59,48,0.25); }
.recorder-row.error { border-color: rgba(255,91,91,0.25); }
.recorder-preview {
  height: 56px;
  border-radius: var(--r-sm);
  background: var(--bg-2);
  overflow: hidden;
  position: relative;
}
.recorder-empty {
  height: 100%;
  display: grid; place-items: center;
  color: var(--text-3);
}
.recorder-audio-prev {
  height: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px;
}
.recorder-audio-prev .waveform { flex: 1; height: 80%; }
.recorder-info { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.recorder-sub {
  font-size: 11.5px;
  color: var(--text-3);
  display: flex; gap: 6px;
}
.recorder-sub.mono { font-family: var(--font-mono); font-size: 11px; }
.recorder-stats {
  display: grid;
  grid-template-columns: 90px 90px 1fr;
  gap: 12px;
}
.recorder-stat .stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--text-4);
  margin-bottom: 3px;
}
.recorder-stat .stat-val { font-size: 12.5px; }
.recorder-actions { display: flex; align-items: center; gap: 4px; }
.rec-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
}

/* ========== Capture / DeckLink ========== */
.decklink-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.decklink-head {
  padding: 14px 16px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border);
}
.decklink-body {
  padding: 24px;
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 20px;
  align-items: stretch;
  background:
    radial-gradient(ellipse at top, rgba(91,124,250,0.05), transparent 60%),
    var(--bg-0);
}
.decklink-card-face {
  background: linear-gradient(180deg, #1c1f28, #0d0e13);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  display: flex; flex-direction: column;
  justify-content: space-between;
  padding: 12px 6px;
  position: relative;
}
.decklink-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  color: var(--text-3);
  text-align: center;
  margin: 0 auto;
}
.decklink-leds {
  display: flex; gap: 6px;
  justify-content: center;
}
.decklink-led {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
}
.decklink-led.on {
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}
.bnc-ports { display: flex; flex-direction: column; gap: 10px; }
.bnc-port {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  text-align: left;
  cursor: pointer;
  position: relative;
  transition: background 80ms, border 80ms;
}
.bnc-port:hover { border-color: var(--border-stronger); }
.bnc-port.active { background: var(--bg-3); }
.bnc-port.active.live::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--success);
}
.bnc-port.recording::before { background: var(--live); }
.bnc-port.active { box-shadow: inset 0 0 0 1px var(--accent); border-color: var(--accent); }
.bnc-connector {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle, #1a1d24, #0a0c11);
  display: grid; place-items: center;
  border: 1.5px solid var(--border-stronger);
  position: relative;
}
.bnc-pin {
  width: 6px; height: 6px;
  background: linear-gradient(135deg, #6b7280, #2a2f3a);
  border-radius: 50%;
}
.bnc-ring {
  position: absolute;
  inset: 4px;
  border: 1px dashed rgba(255,255,255,0.08);
  border-radius: 50%;
}
.bnc-port.live .bnc-pin { background: linear-gradient(135deg, #FFC857, #C8862D); box-shadow: 0 0 8px rgba(255,200,87,0.4); }
.bnc-port.recording .bnc-pin { background: linear-gradient(135deg, #FF5C5C, #C8362D); box-shadow: 0 0 8px rgba(255,92,92,0.5); }
.bnc-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bnc-num { font-size: 12.5px; font-weight: 600; }
.bnc-label { font-size: 11px; color: var(--text-2); }
.bnc-sig { font-size: 10.5px; color: var(--text-3); }
.bnc-port.live .bnc-sig { color: var(--success); }
.bnc-rec {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--live);
  animation: pulse 1.2s ease-in-out infinite;
}
.bnc-signal-bar {
  grid-column: 2 / 4;
  height: 3px;
  background: var(--bg-3);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 4px;
}
.bnc-signal-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success), var(--warning), var(--danger));
  background-size: 200% 100%;
  background-position: 0% 0;
  transition: width 200ms;
}
.decklink-foot {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  display: flex; gap: 20px;
  font-size: 11.5px;
  color: var(--text-3);
}
.decklink-foot strong { color: var(--text-1); font-weight: 600; }

.capture-detail {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
}
.capture-detail.empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 80px 24px;
  color: var(--text-3);
}
.capture-preview {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-md);
  overflow: hidden;
  background: #000;
}
.capture-overlay-meters {
  position: absolute;
  right: 8px; top: 8px;
  display: flex; gap: 4px;
}
.capture-tc {
  position: absolute;
  bottom: 8px; right: 8px;
  background: rgba(0,0,0,0.7);
  padding: 3px 8px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: white;
}
.capture-stats {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.capture-stat {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 10px;
}
.capture-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--text-4);
}
.capture-stat-value { font-size: 13px; margin-top: 2px; }

/* ========== Monitors ========== */
.monitors-grid {
  display: grid;
  gap: 10px;
  background: var(--bg-2);
  border-radius: var(--r-lg);
  padding: 10px;
}
.monitor-tile {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  display: flex; flex-direction: column;
  cursor: pointer;
}
.monitor-tile.audio { background: linear-gradient(135deg, hsl(180 30% 12%), hsl(200 25% 6%)); }
.monitor-tile-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 8px 10px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.8));
  display: flex; align-items: center; gap: 6px;
}
.monitor-tile-label .name {
  color: white;
  font-size: 11.5px;
  font-weight: 500;
}
.monitor-tile-label .time {
  margin-left: auto;
  color: white;
  font-family: var(--font-mono);
  font-size: 10.5px;
}

/* ========== Jobs ========== */
.jobs-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.job-row {
  display: grid;
  grid-template-columns: 20px 110px 1fr 90px 200px 70px 80px 90px;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.job-row:last-child { border-bottom: 0; }
.job-row.head {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-4);
}
.job-progress-wrap {
  display: flex; align-items: center; gap: 8px;
}
.job-progress-bar {
  flex: 1;
  height: 5px;
  background: var(--bg-3);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}
.job-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #7C9EFF);
  background-size: 200% 100%;
  animation: shimmer 2s linear infinite;
  transition: width 300ms;
}

/* ========== Editor ========== */
.editor-shell {
  display: flex; flex-direction: column;
  height: 100%;
  background: var(--bg-0);
}
.editor-topbar {
  height: 44px;
  border-bottom: 1px solid var(--border);
  padding: 0 14px;
  display: flex; align-items: center; gap: 10px;
}
.editor-body {
  flex: 1;
  display: grid;
  grid-template-columns: 240px 1fr 240px;
  min-height: 0;
}
.editor-bins, .editor-insp { background: var(--bg-1); border-right: 1px solid var(--border); overflow-y: auto; }
.editor-insp { border-right: 0; border-left: 1px solid var(--border); }
.editor-bin-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px;
  border-radius: var(--r-sm);
  cursor: pointer;
}
.editor-bin-item:hover { background: var(--hover); }
.editor-bin-thumb { width: 48px; aspect-ratio: 16/9; border-radius: 3px; overflow: hidden; background: var(--bg-2); flex-shrink: 0; }
.editor-viewer { background: #000; display: flex; flex-direction: column; }
.editor-canvas {
  flex: 1;
  position: relative;
  background: #050608;
  display: grid; place-items: center;
  overflow: hidden;
  max-height: 50vh;
}
.editor-canvas .thumb-svg { width: 100%; height: 100%; }
.editor-transport {
  height: 44px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 14px;
  background: var(--bg-1);
  border-top: 1px solid var(--border);
}
.editor-timeline {
  background: var(--bg-0);
  border-top: 1px solid var(--border);
  height: 240px;
  display: flex; flex-direction: column;
  position: relative;
  overflow: hidden;
}
.editor-timeline-head {
  height: 32px;
  display: flex; align-items: center;
  padding: 0 12px;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}
.timeline-ruler {
  height: 22px;
  display: flex;
  padding-left: 40px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-1);
}
.ruler-tick {
  flex: 1;
  border-left: 1px solid var(--border);
  font-size: 9.5px;
  color: var(--text-4);
  padding: 4px 4px 0;
}
.timeline-track {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: stretch;
  height: 42px;
  border-bottom: 1px solid var(--border);
}
.timeline-track-label {
  background: var(--bg-1);
  display: grid; place-items: center;
  font-size: 10.5px;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-3);
  border-right: 1px solid var(--border);
}
.timeline-track-lane {
  position: relative;
  background:
    repeating-linear-gradient(90deg, transparent 0 49px, rgba(255,255,255,0.02) 49px 50px);
}
.clip {
  position: absolute;
  top: 4px; bottom: 4px;
  border-radius: 3px;
  overflow: hidden;
  display: flex; align-items: center;
  cursor: pointer;
  border: 1px solid rgba(0,0,0,0.3);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15);
}
.clip-label {
  position: absolute;
  left: 6px; top: 3px;
  font-size: 10px;
  font-weight: 600;
  color: white;
  z-index: 2;
  text-shadow: 0 1px 1px rgba(0,0,0,0.4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.clip-film { display: flex; flex: 1; height: 100%; }
.clip-film-cell { flex: 1; overflow: hidden; }
.clip-film-cell .thumb-svg { width: 100%; height: 100%; }
.clip.audio { background: var(--success) !important; }
.clip-wave { width: 100%; height: 100%; padding: 4px; opacity: 0.6; }
.clip-wave .waveform { width: 100%; height: 100%; }
.timeline-playhead {
  position: absolute;
  top: 32px; bottom: 0;
  width: 1.5px;
  background: var(--live);
  pointer-events: none;
  z-index: 5;
}
.timeline-playhead::before {
  content: "";
  position: absolute;
  top: -4px; left: 50%;
  width: 10px; height: 10px;
  background: var(--live);
  transform: translateX(-50%) rotate(45deg);
}

/* ========== Admin tables ========== */
/* ── Row popover menu (Users, etc.) ────────────────────────────────── */
.row-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  min-width: 180px;
  background: var(--bg-1);
  border: 1px solid var(--border-stronger);
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  padding: 4px;
  display: flex;
  flex-direction: column;
}
.row-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0;
  color: var(--text-1);
  font-size: 12.5px;
  padding: 7px 10px;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
}
.row-menu button:hover { background: var(--bg-3); }
.row-menu button.danger:hover { background: var(--danger-soft); color: var(--danger); }

.user-row, .token-row, .container-row, .schedule-row {
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.user-row { grid-template-columns: 1.5fr 100px 1.5fr 120px 40px; }
.token-row { grid-template-columns: 1.4fr 1.4fr 110px 110px 100px 40px; }
.container-row { grid-template-columns: 1.4fr 1.4fr 140px 140px 100px 1.4fr 110px; }
.schedule-row { grid-template-columns: 1.6fr 1.2fr 1.2fr 90px 110px 110px 150px; }
.user-row.head, .token-row.head, .container-row.head, .schedule-row.head {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-4);
}
.user-row:last-child, .token-row:last-child, .container-row:last-child, .schedule-row:last-child { border-bottom: 0; }
.token-row.revoked { opacity: 0.5; }

/* ========== Cluster ========== */
.cluster-canvas {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

/* ========== Settings ========== */
.settings-nav {
  display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 0;
}
.settings-nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 0 10px;
  height: 32px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 12.5px;
  cursor: pointer;
}
.settings-nav-item:hover { background: var(--hover); color: var(--text-1); }
.settings-nav-item.active { background: var(--accent-soft); color: var(--accent-text); }
.settings-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.settings-card-head {
  padding: 16px;
  display: flex; align-items: flex-start; gap: 12px;
  border-bottom: 1px solid var(--border);
}
.settings-card-icon {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  color: var(--accent);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.settings-card-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field-input-wrap { display: flex; gap: 6px; align-items: center; }
.checkbox-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--text-1);
  cursor: pointer;
}
.checkbox-row input { accent-color: var(--accent); }

/* ========== Tokens parody ========== */
.token-hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}
.token-burn-card, .token-actual-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.token-burn-card {
  background:
    radial-gradient(ellipse at top right, rgba(255,91,91,0.12), transparent 60%),
    var(--bg-1);
  border-color: rgba(255,91,91,0.18);
}
.token-actual-card {
  background:
    radial-gradient(ellipse at bottom left, rgba(45,212,168,0.10), transparent 60%),
    var(--bg-1);
  border-color: rgba(45,212,168,0.18);
}
.token-card-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--text-4);
  margin-bottom: 8px;
}
.token-counter {
  display: flex; align-items: baseline; gap: 12px;
}
.token-flame { font-size: 32px; line-height: 1; }
.token-big {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #FF9D6B, #FF5B5B);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.05;
}
.token-rate {
  font-size: 12px;
  display: flex; align-items: baseline;
  font-family: var(--font-mono);
}
.token-actual-amount {
  display: flex; align-items: baseline; gap: 0;
  color: var(--success);
  margin-bottom: 8px;
}

.token-comparison {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 0 0 12px;
  margin-bottom: 16px;
  overflow: hidden;
}
.token-compare-chart { padding: 0 16px; }
.token-compare-legend {
  display: flex; gap: 24px;
  padding: 8px 0 0;
  font-size: 12px;
  color: var(--text-2);
}
.token-compare-legend .dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.token-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 14px;
}
.token-event {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.token-event:last-child { border-bottom: 0; }
.token-event.fresh { animation: tokenFresh 800ms ease; }
@keyframes tokenFresh {
  0% { background: rgba(255,91,91,0.15); transform: translateX(-4px); }
  100% { background: transparent; transform: none; }
}
.token-tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.token-tier {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 14px;
  display: flex; flex-direction: column;
  gap: 6px;
  position: relative;
}
.token-tier.popular {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--bg-1) 40%);
  box-shadow: 0 0 24px rgba(91,124,250,0.10);
}
.token-tier-badge {
  position: absolute;
  top: -8px; right: 12px;
  background: var(--accent);
  color: white;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 99px;
}
.token-tier-name { font-size: 13px; font-weight: 700; letter-spacing: -0.01em; }
.token-tier-desc { font-size: 11px; color: var(--text-3); min-height: 32px; line-height: 1.4; }
.token-tier-price { margin-top: 6px; display: flex; align-items: baseline; }
.token-tier-tokens { font-size: 11px; color: var(--text-3); padding-top: 4px; border-top: 1px solid var(--border); }

.token-footnote {
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--warning-soft);
  border: 1px solid rgba(245,166,35,0.2);
  border-radius: var(--r-md);
  display: flex; gap: 12px;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.55;
}
.token-footnote svg { color: var(--warning); flex-shrink: 0; margin-top: 2px; }
.token-footnote strong { color: var(--warning); }

/* ========== Global Search ========== */
.search-wrap {
  position: relative;
  flex-shrink: 0;
}
.search-wrap .search {
  width: 280px;
}
.search-wrap .search.is-open {
  border-color: var(--accent);
  background: var(--bg-2);
}
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 440px;
  max-width: 90vw;
  max-height: 460px;
  overflow-y: auto;
  background: var(--bg-1);
  border: 1px solid var(--border-stronger);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-pop);
  padding: 4px;
  z-index: 60;
}
.search-empty {
  padding: 18px 12px;
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
}
.search-result {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  color: var(--text-1);
}
.search-result.active {
  background: var(--accent-soft);
}
.search-result-icon {
  width: 24px; height: 24px;
  border-radius: 5px;
  background: var(--bg-3);
  color: var(--text-2);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.search-result.active .search-result-icon {
  background: var(--accent-soft-2);
  color: var(--accent-text);
}
.search-result-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.search-result-label {
  font-size: 12.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-result-sub {
  font-size: 11px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-result-kind {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-4);
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 99px;
  flex-shrink: 0;
}
.search-result-kind.kind-asset { color: #B4C3FF; border-color: rgba(91,124,250,0.25); }
.search-result-kind.kind-project { color: #FFD89B; border-color: rgba(245,166,35,0.25); }
.search-result-kind.kind-recorder { color: #FFAFAF; border-color: rgba(255,91,91,0.25); }
.search-result-kind.kind-job { color: #9EE7D2; border-color: rgba(45,212,168,0.25); }
.search-result-kind.kind-user { color: #D5B8FF; border-color: rgba(181,124,250,0.25); }
.search-result-kind.kind-nav { color: var(--text-2); }


File: services/web-ui/public/styles-fixes.css

/* responsive + polish fixes */
.page-header h1 { white-space: nowrap; }
.page-header .subtitle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex-shrink: 1;
}
.page-header { gap: 12px; flex-wrap: wrap; }
.status-pip span { white-space: nowrap; }
.status-pip { white-space: nowrap; }
.rail-item { min-width: 0; }
.rail-item > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-item > span.rail-count, .rail-item > .rail-color-dot { overflow: visible; flex-shrink: 0; }

@media (max-width: 1100px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .jobs-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1280px) {
  .recorder-row {
    grid-template-columns: 180px 1fr;
    grid-template-rows: auto auto;
  }
  .recorder-stats { grid-column: 2 / 3; grid-row: 2; }
  .recorder-actions { grid-column: 1 / 3; grid-row: 3; justify-content: flex-end; padding-top: 4px; border-top: 1px solid var(--border); }
}

.capture-stat-label, .recorder-stat .stat-label, .stat-card .label, .stat-card .delta {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar > * { flex-shrink: 0; }
.topbar .crumb { min-width: 0; overflow: hidden; }
.topbar .crumb > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .spacer { flex: 1; min-width: 8px; }

@media (max-width: 1100px) {
  .topbar .search-wrap { display: none; }
}
@media (max-width: 900px) {
  .topbar .status-pip span:not(.dot) { display: none; }
}

.library-toolbar { flex-wrap: wrap; }
.library-toolbar .search { width: 200px; }

@media (max-width: 1280px) {
  .page-body > div[style*="grid-template-columns: 440px"] {
    grid-template-columns: 1fr !important;
  }
}

.audio-meter.v {
  border-radius: 99px;
  background: rgba(255,255,255,0.04);
  padding: 3px;
}

.recorder-preview { min-height: 56px; }

.activity-text .target { word-break: break-word; }

.asset-card .meta .sub { overflow: hidden; }

.stat-card .label, .stat-card .value, .stat-card .delta { position: relative; z-index: 1; }
.stat-card .spark { z-index: 0; }


File: services/web-ui/public/styles-screens.css

/* ========== Asset thumbnails ========== */
.asset-thumb {
  position: relative;
  width: 100%;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg-2);
  display: block;
}
.asset-thumb.audio {
  background: linear-gradient(135deg, hsl(180 30% 14%), hsl(200 30% 8%));
  display: flex;
  align-items: center;
  justify-content: center;
}
.asset-thumb .thumb-svg { width: 100%; height: 100%; display: block; }
.scanlines {
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(0deg, transparent 0 2px, rgba(0,0,0,0.06) 2px 3px);
  pointer-events: none;
  opacity: 0.4;
}
.thumb-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: white;
}
.thumb-duration {
  position: absolute;
  right: 6px; bottom: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  color: white;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  padding: 2px 6px;
  border-radius: 3px;
  line-height: 1.3;
}
.thumb-status {
  position: absolute;
  left: 6px; top: 6px;
  display: flex; gap: 4px;
}

/* ========== Waveform ========== */
.waveform { width: 70%; height: 50%; opacity: 0.85; }
.audio-meter.h { display: flex; gap: 2px; height: 12px; align-items: stretch; }
.audio-meter.v { display: flex; flex-direction: column-reverse; gap: 2px; width: 6px; height: 60px; }
.audio-seg { flex: 1; border-radius: 1px; transition: opacity 80ms, background 80ms; }
.audio-meter.h .audio-seg { min-width: 3px; }
.audio-meter.v .audio-seg { min-height: 2px; }

/* ========== Live strip ========== */
.live-strip {
  display: flex;
  gap: 2px;
  align-items: stretch;
  height: 56px;
  position: relative;
  overflow: hidden;
  border-radius: var(--r-sm);
  background: var(--bg-2);
}
.live-strip-cell {
  flex: 1;
  position: relative;
  overflow: hidden;
  animation: stripIn 600ms ease;
}
.live-strip-cell .thumb-svg { width: 100%; height: 100%; }
@keyframes stripIn {
  from { transform: translateX(20%); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.live-strip-now {
  position: absolute;
  right: 6px; top: 6px;
  display: flex; align-items: center; gap: 4px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  color: var(--live);
  background: rgba(0,0,0,0.6);
  padding: 2px 6px;
  border-radius: 99px;
  letter-spacing: 0.04em;
}
.live-pulse {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--live);
  animation: pulse 1.6s ease-in-out infinite;
}

/* ========== Status dot ========== */
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.pulse {
  animation: dotpulse 1.6s ease-in-out infinite;
}
@keyframes dotpulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ========== Home dashboard ========== */
.home-hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  padding: 20px 28px;
}
.home-greeting {
  padding: 24px 28px 0;
}
.home-greeting h1 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.home-greeting p { margin: 0; color: var(--text-3); font-size: 13px; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 12px 28px;
}
.stat-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
}
.stat-card .label {
  font-size: 11.5px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.stat-card .value {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-card .delta {
  font-size: 11.5px;
  color: var(--text-3);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-card .delta.up { color: var(--success); }
.stat-card .spark {
  position: absolute;
  right: 0; bottom: 0;
  width: 60%; height: 36px;
  opacity: 0.7;
  pointer-events: none;
}

.home-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  padding: 4px 28px 40px;
}
.live-feed-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.live-feed-tile {
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--bg-2);
  cursor: pointer;
  transition: transform 120ms;
  border: 1px solid var(--border);
}
.live-feed-tile:hover { transform: translateY(-1px); border-color: var(--border-stronger); }
.live-feed-tile-label {
  position: absolute;
  left: 8px; bottom: 8px;
  right: 8px;
  display: flex; align-items: center; gap: 6px;
  z-index: 2;
}
.live-feed-tile-label .name {
  color: white;
  font-size: 12px;
  font-weight: 500;
  background: rgba(0,0,0,0.6);
  padding: 3px 8px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.live-feed-tile-label .time {
  margin-left: auto;
  color: white;
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(0,0,0,0.6);
  padding: 3px 6px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}
.live-feed-tile-badge {
  position: absolute;
  top: 8px; left: 8px;
  z-index: 2;
}
.activity-feed {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.activity-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.activity-row:last-child { border-bottom: 0; }
.activity-icon {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: grid; place-items: center;
  flex-shrink: 0;
  color: var(--text-2);
}
.activity-icon.comment { background: var(--accent-soft); color: var(--accent-text); }
.activity-icon.record { background: var(--live-soft); color: var(--live); }
.activity-icon.job { background: var(--purple-soft); color: var(--purple); }
.activity-icon.upload { background: var(--bg-3); color: var(--text-2); }
.activity-icon.sync { background: var(--success-soft); color: var(--success); }
.activity-icon.approve { background: var(--success-soft); color: var(--success); }
.activity-icon.error { background: var(--danger-soft); color: var(--danger); }
.activity-text { flex: 1; line-height: 1.4; }
.activity-text strong { color: var(--text-1); font-weight: 500; }
.activity-text .target { color: var(--accent-text); }
.activity-time { font-size: 11px; color: var(--text-3); font-family: var(--font-mono); white-space: nowrap; }

/* ========== Library ========== */
.library-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: 100%;
  overflow: hidden;
}
.library-rail {
  border-right: 1px solid var(--border);
  background: var(--bg-0);
  padding: 16px 12px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 16px;
}
.library-rail h4 {
  margin: 0;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-4);
  padding: 0 10px;
}
.rail-list { display: flex; flex-direction: column; gap: 1px; }
.rail-item {
  display: flex; align-items: center; gap: 8px;
  height: 30px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
}
.rail-item:hover { background: var(--hover); color: var(--text-1); }
.rail-item.active { background: var(--accent-soft); color: var(--accent-text); }
.rail-item.active .rail-icon { color: var(--accent); }
.rail-item .rail-icon { color: var(--text-3); }
.rail-item .rail-count { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3); }
.rail-color-dot { width: 8px; height: 8px; border-radius: 50%; }

.library-main {
  display: flex; flex-direction: column;
  overflow: hidden;
}
.library-toolbar {
  padding: 12px 24px;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--border);
}
.library-toolbar .toolbar-title {
  font-size: 14px; font-weight: 600;
  letter-spacing: -0.01em;
}
.library-toolbar .count { color: var(--text-3); font-size: 12.5px; }

.tab-group {
  display: flex;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 2px;
  gap: 2px;
}
.tab-group button {
  height: 24px;
  padding: 0 10px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-3);
  border-radius: 4px;
  display: flex; align-items: center; gap: 4px;
}
.tab-group button:hover { color: var(--text-1); }
.tab-group button.active { background: var(--bg-3); color: var(--text-1); }

.library-grid {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px 32px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  align-content: start;
}
[data-grid-size="lg"] .library-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
[data-grid-size="sm"] .library-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }

.asset-card {
  position: relative;
  cursor: pointer;
  border-radius: var(--r-md);
  transition: transform 120ms;
}
.asset-card:hover { transform: translateY(-2px); }
.asset-card:hover .asset-thumb { box-shadow: 0 0 0 1.5px var(--accent), var(--shadow-pop); }
.asset-card .meta {
  padding: 8px 4px 4px;
}
.asset-card .meta .name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.asset-card .meta .sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
}
.asset-card.selected .asset-thumb { box-shadow: 0 0 0 2px var(--accent); }

.asset-progress-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.7) 100%);
  display: flex;
  align-items: flex-end;
  padding: 8px;
}
.asset-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 99px;
  overflow: hidden;
}
.asset-progress-fill {
  height: 100%;
  background: var(--warning);
  transition: width 200ms;
}

.library-list {
  flex: 1; overflow-y: auto;
  padding: 0 24px 32px;
}
.list-row {
  display: grid;
  grid-template-columns: 80px 2fr 120px 100px 100px 80px 80px 32px;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 12.5px;
}
.list-row:hover { background: var(--hover); }
.list-row.head {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-4);
  cursor: default;
  position: sticky; top: 0;
  background: var(--bg-0);
  z-index: 1;
  padding-top: 12px;
}
.list-row:hover.head { background: var(--bg-0); }
.list-row .thumb {
  width: 80px; aspect-ratio: 16/9;
  border-radius: 4px; overflow: hidden;
}
.list-row .name { font-weight: 500; }
.list-row .col-sub { color: var(--text-3); font-family: var(--font-mono); font-size: 11.5px; }


File: services/web-ui/public/styles-asset.css

/* ========== Asset detail ========== */
.asset-detail {
  display: flex; flex-direction: column;
  height: 100%;
  background: var(--bg-0);
  overflow: hidden;
}
.asset-detail-header {
  height: var(--topbar-h);
  display: flex; align-items: center;
  gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.asset-detail-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 320px;
  overflow: hidden;
  min-height: 0;
}
.player-col {
  display: flex; flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--border);
}
.comment-composer-col {
  background: var(--bg-1);
  display: flex; flex-direction: column;
  overflow: hidden;
}

.player {
  background: #000;
  padding: 16px;
  display: flex; flex-direction: column;
  gap: 8px;
}
.player-canvas {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-md);
  overflow: hidden;
  background: #050608;
  max-height: 52vh;
}
.player-canvas .thumb-svg { width: 100%; height: 100%; display: block; }
.player-play-overlay {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.4));
  transition: background 120ms;
}
.player-play-overlay:hover { background: rgba(0,0,0,0.3); }
.player-play-overlay svg {
  width: 64px; height: 64px;
  color: white;
  background: rgba(0,0,0,0.55);
  border-radius: 50%;
  padding: 16px;
  backdrop-filter: blur(8px);
}
.player-tc {
  position: absolute;
  right: 12px; bottom: 12px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  padding: 4px 10px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: white;
}
.player-overlay-markers {
  position: absolute; inset: 16px;
  pointer-events: none;
}
.player-pin {
  position: absolute;
  left: 30%; top: 40%;
  display: flex; align-items: center; gap: 6px;
  pointer-events: auto;
}
.player-pin-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600; color: white;
  border: 2px solid white;
}
.player-pin-bubble {
  background: var(--accent);
  color: white;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  max-width: 240px;
}

.player-controls {
  display: flex; align-items: center; gap: 8px;
  padding: 0 4px;
}

.playback-bar {
  flex: 1;
  height: 24px;
  position: relative;
  cursor: pointer;
  display: flex; align-items: center;
}
.playback-bar::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 99px;
}
.playback-fill {
  position: absolute;
  height: 4px;
  background: var(--accent);
  border-radius: 99px;
  pointer-events: none;
}
.playback-handle {
  position: absolute;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: white;
  transform: translateX(-50%);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.2);
  pointer-events: none;
}
.playback-marker {
  position: absolute;
  transform: translateX(-50%) translateY(-2px);
  z-index: 2;
}
.marker-avatar {
  display: grid; place-items: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 9px; font-weight: 600;
  border: 1.5px solid var(--bg-0);
}
.playback-marker.resolved .marker-avatar { background: var(--text-4); opacity: 0.5; }

.filmstrip-wrap {
  background: var(--bg-1);
  border-radius: var(--r-sm);
  padding: 8px;
  margin-top: 4px;
}
.filmstrip {
  position: relative;
  display: flex;
  gap: 1px;
  height: 48px;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border);
}
.film-frame {
  flex: 1;
  position: relative;
  overflow: hidden;
}
.film-frame .thumb-svg { width: 100%; height: 100%; }
.filmstrip-playhead {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--accent);
  transform: translateX(-50%);
  pointer-events: none;
  box-shadow: 0 0 6px var(--accent);
}
.filmstrip-playhead::before {
  content: "";
  position: absolute;
  top: -4px; left: 50%;
  transform: translateX(-50%);
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 2px;
  transform: translateX(-50%) rotate(45deg);
}
.filmstrip-pin {
  position: absolute;
  bottom: -6px;
  transform: translateX(-50%);
}
.filmstrip-pin-avatar {
  display: grid; place-items: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 8px;
  font-weight: 600;
  border: 1.5px solid var(--bg-1);
}
.filmstrip-pin.resolved .filmstrip-pin-avatar { background: var(--text-4); }
.filmstrip-tc {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  padding: 0 2px;
  font-size: 10px;
  color: var(--text-4);
}

.asset-detail-tabs {
  display: flex;
  align-items: center;
  padding: 0 20px;
  height: 40px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  gap: 4px;
  background: var(--bg-0);
  flex-shrink: 0;
}
.asset-detail-tabs button {
  height: 40px;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-3);
  position: relative;
  display: flex; align-items: center; gap: 6px;
}
.asset-detail-tabs button:hover { color: var(--text-1); }
.asset-detail-tabs button.active { color: var(--text-1); }
.asset-detail-tabs button.active::after {
  content: ""; position: absolute;
  bottom: -1px; left: 8px; right: 8px;
  height: 2px; background: var(--accent);
}
.asset-detail-tabs .count {
  font-family: var(--font-mono);
  font-size: 10.5px;
  background: var(--bg-3);
  padding: 0 6px;
  border-radius: 99px;
  color: var(--text-3);
}
.asset-detail-tabs button.active .count { background: var(--accent-soft); color: var(--accent-text); }
.tiny-toggle {
  display: flex; align-items: center; gap: 5px;
  font-size: 11.5px;
  color: var(--text-3);
  cursor: pointer;
}
.tiny-toggle input { accent-color: var(--accent); }

.asset-detail-content {
  flex: 1;
  overflow-y: auto;
  padding: 8px 20px 20px;
}

.comments-list { display: flex; flex-direction: column; gap: 4px; }
.comment {
  display: flex; gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.comment.resolved { opacity: 0.55; }
.comment-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 10.5px;
  font-weight: 600;
  color: white;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.comment-body { flex: 1; min-width: 0; }
.comment-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px;
}
.comment-who { font-weight: 600; }
.comment-time {
  display: inline-flex; align-items: center; gap: 3px;
  background: var(--accent-soft);
  color: var(--accent-text);
  padding: 1px 6px;
  border-radius: 99px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  cursor: pointer;
}
.comment-time:hover { background: var(--accent-soft-2); }
.comment-when { color: var(--text-3); font-size: 11px; }
.comment-action { color: var(--text-3); }
.comment-action:hover { color: var(--text-1); }
.comment-text {
  font-size: 12.5px;
  color: var(--text-1);
  margin-top: 4px;
  line-height: 1.5;
}
.comment-resolved {
  font-size: 11px;
  color: var(--success);
  margin-top: 4px;
}

.comment-composer {
  padding: 16px;
  display: flex; flex-direction: column;
  gap: 10px;
  height: 100%;
}
.composer-head {
  display: flex; align-items: center; justify-content: space-between;
}
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -6px; border: 2px solid var(--bg-1); }
.avatar-stack .avatar:first-child { margin-left: 0; }
.add-reviewer {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 1.5px dashed var(--border-stronger);
  display: grid; place-items: center;
  color: var(--text-3);
  margin-left: -2px;
}
.composer-tag {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px;
}
.composer-input {
  width: 100%;
  min-height: 90px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 12px;
  outline: 0;
  font-size: 13px;
  resize: vertical;
  color: var(--text-1);
}
.composer-input:focus { border-color: var(--accent); }
.composer-bar {
  display: flex; align-items: center; gap: 8px;
}
.composer-tools { display: flex; gap: 2px; }

.versions-list { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; }
.version-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-1);
}
.version-thumb {
  width: 120px; aspect-ratio: 16/9;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-2);
}

.meta-table {
  display: flex; flex-direction: column;
  padding: 8px 0;
}
.meta-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  gap: 16px;
}
.meta-row .meta-k { color: var(--text-3); }
.meta-row .meta-v { font-family: var(--font-mono); font-size: 12px; word-break: break-all; }