:root { --bg:#14171c; --panel:#1c2027; --edge:#2a2f38; --fg:#dfe3e8; --dim:#8993a0;
  --accent:#5db3a0; --accent2:#c9a15d; }
* { box-sizing:border-box; margin:0; padding:0; }
body { background:var(--bg); color:var(--fg); font:14px/1.5 system-ui,-apple-system,Segoe UI,Roboto,sans-serif; }

header { display:flex; align-items:center; gap:1rem; padding:1rem 1.5rem;
  background:var(--panel); border-bottom:2px solid var(--accent); }
.brand { font-size:1.4rem; font-weight:800; letter-spacing:.02em; color:var(--accent); }
.tag { color:var(--dim); font-size:.85rem; }
.pill { margin-left:auto; background:#0f1216; border:1px solid var(--edge); border-radius:999px;
  padding:.3rem .9rem; color:var(--dim); font-size:.8rem; }

main { display:grid; grid-template-columns:1fr 1fr; gap:1rem; padding:1.5rem; max-width:1200px; margin:0 auto; }
.panel { background:var(--panel); border:1px solid var(--edge); border-radius:8px; padding:1.2rem; }
.panel.wide { grid-column:1 / -1; }
h2 { font-size:1rem; text-transform:uppercase; letter-spacing:.08em; color:var(--dim); margin-bottom:1rem;
  display:flex; align-items:center; gap:.6rem; }
h3 { font-size:.8rem; text-transform:uppercase; letter-spacing:.08em; color:var(--dim); margin:1rem 0 .6rem; }

.totals { display:flex; gap:1.5rem; margin-bottom:1rem; }
.totals .num { font-size:2rem; font-weight:800; color:var(--fg); }
.totals .num small { display:block; font-size:.7rem; font-weight:400; color:var(--dim); text-transform:uppercase; letter-spacing:.08em; }

.bars .bar { display:flex; align-items:center; gap:.6rem; margin:.3rem 0; }
.bars .bar .name { width:70px; color:var(--dim); font-size:.8rem; }
.bars .bar .track { flex:1; height:14px; background:#0f1216; border-radius:3px; overflow:hidden; }
.bars .bar .fill { height:100%; background:var(--accent); }
.bars .bar .n { width:40px; text-align:right; font-variant-numeric:tabular-nums; }

.kinds { display:flex; flex-wrap:wrap; gap:.4rem; }
.kinds .chip { background:#0f1216; border:1px solid var(--edge); border-radius:4px; padding:.25rem .6rem; font-size:.8rem; }
.kinds .chip b { color:var(--accent2); margin-left:.35rem; }

.actions { display:flex; flex-direction:column; gap:1rem; }
.action-group { display:flex; flex-wrap:wrap; align-items:center; gap:.5rem; }
.action-group .lbl { width:100%; color:var(--dim); font-size:.75rem; text-transform:uppercase; letter-spacing:.08em; }
button, .linkbtn { background:#0f1216; color:var(--fg); border:1px solid var(--edge); border-radius:5px;
  padding:.45rem .8rem; font:inherit; font-size:.85rem; cursor:pointer; text-decoration:none; }
button:hover, .linkbtn:hover { border-color:var(--accent); }
button em { color:var(--dim); font-style:normal; font-size:.75rem; }
button:disabled { opacity:.5; cursor:wait; }
.mini { font-size:.75rem; padding:.2rem .5rem; }

.log { background:#0b0d10; border:1px solid var(--edge); border-radius:5px; padding:.7rem;
  margin-top:1rem; font:12px/1.4 ui-monospace,Menlo,monospace; color:var(--dim); max-height:120px; overflow:auto; white-space:pre-wrap; }

.preview { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:.8rem; }
.pv-card { background:#0f1216; border:1px solid var(--edge); border-radius:6px; overflow:hidden; }
.pv-card video, .pv-card img { width:100%; height:120px; object-fit:cover; background:#000; display:block; }
.pv-card .pv-body { padding:.5rem .6rem; }
.pv-card .pv-kind { font-size:.7rem; text-transform:uppercase; letter-spacing:.06em; color:var(--accent); }
.pv-card .pv-title { font-size:.8rem; color:var(--fg); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pv-card .pv-meta { font-size:.7rem; color:var(--dim); margin-top:.2rem; }
.pv-card.pv-textcard { min-height:170px; display:flex; flex-direction:column; align-items:center;
  justify-content:center; text-align:center; padding:1rem; }
.pv-card.pv-textcard .tc { font-size:.85rem; color:var(--fg); }

@media (max-width:820px){ main{ grid-template-columns:1fr; } }

footer { text-align:center; padding:1.5rem; color:var(--dim); font-size:.8rem; border-top:1px solid var(--edge); margin-top:1rem; }
footer a { color:var(--accent); text-decoration:none; }
footer a:hover { text-decoration:underline; }

/* Browse UI */
.search { margin-left:auto; background:#0f1216; border:1px solid var(--edge); border-radius:5px;
  color:var(--fg); font:inherit; font-size:.85rem; padding:.35rem .7rem; width:180px; }
.filters { display:flex; flex-wrap:wrap; gap:.4rem; margin-bottom:1rem; }
.fchip { background:#0f1216; border:1px solid var(--edge); border-radius:999px; padding:.3rem .8rem;
  font-size:.8rem; color:var(--dim); cursor:pointer; }
.fchip:hover { border-color:var(--accent); }
.fchip.on { background:var(--accent); color:#0b0d10; border-color:var(--accent); font-weight:600; }
.fchip b { margin-left:.4rem; opacity:.7; }
.grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:.8rem; }
.pv-stream { height:120px; display:flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg,#1a2a26,#0f1216); color:var(--accent2); font-weight:700; letter-spacing:.1em; }
#more-row { text-align:center; margin-top:1rem; }
.empty { color:var(--dim); padding:2rem; text-align:center; grid-column:1/-1; }
.pv-card.pv-textcard .tc { white-space:pre-line; line-height:1.35; }

/* Natural-language ask bar */
.askbar { background:linear-gradient(135deg,#1c2530,#1a1f27); border-color:var(--accent); }
.ask-row { display:flex; gap:.6rem; }
.ask { flex:1; background:#0b0d10; border:1px solid var(--edge); border-radius:6px; color:var(--fg);
  font:inherit; font-size:1rem; padding:.7rem 1rem; }
.ask:focus { outline:none; border-color:var(--accent); }
#ask-go { background:var(--accent); color:#0b0d10; border:none; border-radius:6px; font-weight:700;
  padding:0 1.4rem; font-size:.95rem; cursor:pointer; }
#ask-go:disabled { opacity:.5; cursor:wait; }
.ask-result { margin-top:.7rem; font-size:.9rem; min-height:1.2em; }
.ask-result.working { color:var(--accent2); }
.ask-result.done { color:var(--accent); }
.ask-result.err { color:#e07a7a; }
.ask-hints { margin-top:.6rem; color:var(--dim); font-size:.78rem; }
.ask-hints b { color:var(--fg); font-weight:600; }

/* Delete controls. Deliberately low-contrast until hover: destructive actions
   should be reachable without being the first thing the eye lands on. */
.pv-card { position: relative; }
.pv-del { position:absolute; top:.35rem; right:.35rem; z-index:3;
  border:0; border-radius:50%; width:1.55rem; height:1.55rem; line-height:1;
  background:rgba(0,0,0,.55); color:rgba(255,255,255,.55); cursor:pointer;
  font-size:.85rem; opacity:0; transition:opacity .15s ease, background .15s ease, color .15s ease; }
.pv-card:hover .pv-del { opacity:1; }
.pv-del:hover { background:#a33; color:#fff; }
.pv-card.gone { opacity:0; transform:scale(.94); transition:opacity .2s ease, transform .2s ease; }
.fchip.danger { border-color:#a33; color:#e28; }
.fchip.danger:hover { background:#a33; color:#fff; }
