/* ANJU HUB — shared queue/history panel. Reuses each page's :root theme vars (with fallbacks),
   so it matches every workflow page automatically. Injected + driven by anju-queue.js. */
:root{ --anju-panelW:360px; }

/* Dock: shift the page left so the fixed panel never overlaps content (wide screens only). */
html.anju-has-queue{ padding-right:var(--anju-panelW); }
@media (max-width:1024px){ html.anju-has-queue{ padding-right:0; } }

.anju-qpanel{
  position:fixed; top:0; right:0; width:var(--anju-panelW); height:100vh;
  background:var(--card,#fff); border-left:1px solid var(--line,#e4e3dd);
  display:flex; flex-direction:column; z-index:45;
  font-family:'Inter','Segoe UI',system-ui,sans-serif;
}
.anju-qhead{ padding:14px 16px 11px; border-bottom:1px solid var(--line,#e4e3dd); }
.anju-qhead h3{ font-size:14.5px; margin:0; display:flex; align-items:center; gap:8px;
  font-family:'Space Grotesk','Segoe UI',system-ui,sans-serif; color:var(--ink,#14141c); }
.anju-live{ width:8px; height:8px; border-radius:50%; background:var(--ok,#1f9d55);
  box-shadow:0 0 0 0 rgba(31,157,85,.5); animation:anju-pulse 1.8s infinite; flex:none; }
.anju-qcount{ margin-left:auto; font-family:'IBM Plex Mono',monospace; font-size:10.5px;
  color:var(--accent-ink,#1c2699); background:var(--accent-soft,#e9ebff); padding:2px 8px; border-radius:999px; }
.anju-qhead p{ margin:5px 0 0; font-size:11.5px; color:var(--muted,#7b7b86); }
.anju-qscroll{ flex:1; overflow-y:auto; padding:12px; display:flex; flex-direction:column; gap:8px; }

.anju-sec{ font-size:10px; letter-spacing:.06em; text-transform:uppercase; color:var(--muted,#7b7b86);
  font-weight:600; margin:5px 2px 0; display:flex; align-items:center; gap:7px; }
.anju-sec::after{ content:''; flex:1; height:1px; background:var(--line,#e4e3dd); }
.anju-now{ text-align:center; font-size:9.5px; color:var(--warm-ink,#8a5a06); font-weight:700; letter-spacing:.1em; margin:1px 0; }
.anju-empty{ text-align:center; font-size:11.5px; color:var(--muted,#7b7b86); padding:5px; }

.anju-item{ border:1px solid var(--line,#e4e3dd); border-radius:12px; padding:9px 10px; display:flex; gap:10px;
  align-items:center; background:var(--card,#fff); animation:anju-fade .28s ease; }
.anju-item.mine{ border-color:var(--accent,#3346ff); background:linear-gradient(0deg,var(--accent-soft,#e9ebff),var(--card,#fff)); }
.anju-item.running{ border-color:var(--warm,#f5a623); background:linear-gradient(0deg,var(--warm-soft,#fdf1dc),var(--card,#fff)); }
.anju-item.clickable{ cursor:pointer; }
.anju-item.clickable:hover{ border-color:var(--accent,#3346ff); }
.anju-thumb{ width:46px; height:46px; border-radius:9px; flex:none; overflow:hidden; background:var(--paper,#f6f7f4);
  display:flex; align-items:center; justify-content:center; color:var(--muted,#7b7b86); font-size:16px; }
.anju-thumb img,.anju-thumb video{ width:100%; height:100%; object-fit:cover; }
.anju-body{ min-width:0; flex:1; }
.anju-title{ font-size:12.5px; font-weight:600; color:var(--ink,#14141c); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.anju-prompt{ font-size:11px; color:var(--muted,#7b7b86); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:2px; }
.anju-meta{ display:flex; align-items:center; gap:6px; margin-top:5px; flex-wrap:wrap; }
.anju-pos{ font-family:'IBM Plex Mono',monospace; font-size:10.5px; font-weight:600; color:var(--accent-ink,#1c2699);
  background:var(--accent-soft,#e9ebff); border-radius:999px; padding:2px 8px; }
.anju-tag{ font-size:9.5px; font-weight:600; padding:2px 7px; border-radius:999px; }
.anju-tag-you{ color:var(--accent-ink,#1c2699); background:var(--card,#fff); border:1px solid var(--accent,#3346ff); }
.anju-tag-other{ color:var(--muted,#7b7b86); background:var(--paper,#f6f7f4); border:1px solid var(--line,#e4e3dd); }
.anju-tag-run{ color:var(--warm-ink,#8a5a06); background:var(--warm-soft,#fdf1dc); }
.anju-tag-done{ color:var(--ok,#1f9d55); background:var(--ok-soft,#e5f5ec); }
.anju-tag-err{ color:var(--seal,#c8372a); background:#fdecea; }
.anju-when{ font-size:10px; color:var(--muted,#7b7b86); }
.anju-spin{ width:15px; height:15px; border:2px solid var(--warm-soft,#fdf1dc); border-top-color:var(--warm,#f5a623);
  border-radius:50%; animation:anju-rot .8s linear infinite; }

/* inline "queued Nth" hint shown under the generate button */
.anju-hint{ font-size:12px; color:var(--accent-ink,#1c2699); background:var(--accent-soft,#e9ebff);
  border-radius:8px; padding:8px 11px; margin-top:12px; display:none; }
.anju-hint.show{ display:block; animation:anju-fade .3s ease; }
.anju-hint.err{ color:var(--seal,#c8372a); background:#fdecea; }

/* mobile drawer + toggle */
.anju-toggle{ display:none; position:fixed; right:16px; bottom:16px; z-index:60; min-width:52px; height:52px;
  padding:0 16px; border-radius:26px; background:var(--ink,#14141c); color:var(--paper,#f6f7f4); border:none;
  cursor:pointer; align-items:center; justify-content:center; gap:8px; font-size:14px; font-weight:600;
  box-shadow:0 6px 18px rgba(0,0,0,.2); font-family:'Inter',system-ui,sans-serif; }
.anju-toggle .anju-badge{ font-family:'IBM Plex Mono',monospace; font-size:11px; background:var(--warm,#f5a623);
  color:#3a2600; border-radius:999px; padding:1px 7px; }
@media (max-width:1024px){
  .anju-qpanel{ top:0 !important; height:100vh; transform:translateX(100%); transition:transform .25s ease;
    box-shadow:-10px 0 30px rgba(0,0,0,.14); }
  .anju-qpanel.open{ transform:none; }
  .anju-toggle{ display:inline-flex; }
}

/* ---------- lightbox (popup viewer for clicked queue/history items) ---------- */
.anju-lightbox{ position:fixed; inset:0; z-index:200; display:none; align-items:center; justify-content:center;
  background:rgba(10,10,15,0.72); -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px); padding:24px;
  font-family:'Inter','Segoe UI',system-ui,sans-serif; }
.anju-lightbox.open{ display:flex; animation:anju-fade .18s ease; }
.anju-lightbox-inner{ position:relative; background:var(--card,#fff); border-radius:16px; padding:14px;
  max-width:min(92vw,900px); max-height:90vh; display:flex; flex-direction:column; gap:10px;
  box-shadow:0 24px 60px rgba(0,0,0,.42); }
.anju-lightbox-media{ display:flex; align-items:center; justify-content:center; overflow:hidden;
  border-radius:10px; background:#000; }
.anju-lightbox-media img, .anju-lightbox-media video{ max-width:100%; max-height:74vh; object-fit:contain; display:block; }
.anju-lightbox-media audio{ width:min(70vw,520px); margin:20px; }
.anju-lightbox-bar{ display:flex; align-items:center; gap:12px; justify-content:space-between; }
.anju-lightbox-cap{ min-width:0; font-size:12.5px; color:var(--muted,#7b7b86); overflow:hidden;
  text-overflow:ellipsis; white-space:nowrap; }
.anju-lightbox-close{ position:absolute; top:-13px; right:-13px; width:34px; height:34px; border-radius:50%;
  border:none; background:var(--ink,#14141c); color:var(--paper,#fff); font-size:20px; line-height:34px; text-align:center;
  cursor:pointer; box-shadow:0 4px 14px rgba(0,0,0,.3); padding:0; }
.anju-lightbox-dl{ font-size:12.5px; font-weight:600; padding:8px 15px; border-radius:8px; flex:none;
  border:1px solid var(--line,#e4e3dd); background:var(--card,#fff); color:var(--ink,#14141c); cursor:pointer;
  white-space:nowrap; }
.anju-lightbox-dl:hover{ border-color:var(--accent,#3346ff); color:var(--accent-ink,#1c2699); }

@keyframes anju-rot{ to{ transform:rotate(360deg); } }
@keyframes anju-pulse{ 0%{box-shadow:0 0 0 0 rgba(31,157,85,.5);}70%{box-shadow:0 0 0 6px rgba(31,157,85,0);}100%{box-shadow:0 0 0 0 rgba(31,157,85,0);} }
@keyframes anju-fade{ from{opacity:0; transform:translateY(5px);} to{opacity:1; transform:none;} }
