/* extra.css: library (.l-), jobs (.j-), upload (.u-). Uses tokens from app.css. */
.u-field [hidden], .u-rec [hidden], .j-page [hidden], .j-logerr[hidden] { display: none !important; }

/* ---- upload ---- */
.u-field { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.u-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.u-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 68px; padding: 12px; text-align: center; cursor: pointer;
  border: 2px dashed var(--line); border-radius: var(--radius); background: var(--surface); color: var(--fg);
  transition: border-color .15s, background .15s;
}
.u-drop:hover, .u-drop.u-over { border-color: var(--amber); background: var(--pale); }
.u-drop:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.u-label { font-weight: 700; font-size: .9375rem; color: var(--gold-ink); }
.u-hint { font-size: .8125rem; }
.u-list { display: flex; flex-direction: column; gap: 8px; }
.u-row { display: flex; flex-direction: column; gap: 5px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.u-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-bar { height: 8px; border-radius: 8px; background: var(--raise); overflow: hidden; }
.u-fill { height: 100%; width: 0; background: var(--amber); border-radius: 8px; transition: width .2s linear; }
.u-done .u-fill { background: var(--ok); }
.u-fail .u-fill { background: var(--warn); }
.u-info { font-size: .8125rem; }
.u-fail .u-info { color: var(--warn); }
.u-actions { gap: 8px; }
.u-actions .btn { min-height: 36px; }

.u-rec { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.u-rec .row { align-items: center; }
.u-rec .btn { min-height: 36px; }
.u-rec-msg { font-size: .8125rem; }
.u-rec-rec { border-color: var(--warn); }
.u-rec-rec .u-rec-msg { color: var(--warn); }
.u-rec-clock { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--warn); }
.u-rec-audio { width: 100%; height: 40px; }
.u-rec-bar { height: 6px; }

/* ---- library ---- */
.l-page { min-width: 0; }
.l-head { justify-content: space-between; align-items: center; }
.l-head .h1 { margin: 0; }
.l-head .btn { min-height: 36px; }
.l-chips { gap: 6px; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.l-chips::-webkit-scrollbar { display: none; }
.l-chip { flex: none; }
@media (min-width: 1000px) { .l-chips { flex-wrap: wrap; overflow: visible; } }
.l-chip { min-height: 30px; padding: 0 12px; font: inherit; font-size: .8125rem; cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--fg); display: inline-flex; align-items: center; border-radius: 999px; }
.l-chip.gold { background: var(--pale); color: var(--gold-ink); border-color: #E9CF93; font-weight: 700; }
.l-chip:focus-visible, .l-play:focus-visible, .l-open:focus-visible, .j-open:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.l-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.l-item { padding: 0; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.l-media { position: relative; display: block; width: 100%; aspect-ratio: 1 / 1; padding: 0; margin: 0; border: 0; background: #111; cursor: pointer; overflow: hidden; }
.l-img { width: 100%; height: 100%; object-fit: contain; display: block; background: #111; }
.l-noimg { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .8125rem; padding: 8px; text-align: center; color: #BDBAB0; }
.l-video { width: 100%; height: 100%; display: block; background: #111; object-fit: contain; }
.l-play { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(26, 26, 26, .2); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.l-tri { width: 42px; height: 42px; border-radius: 50%; background: var(--amber); position: relative; box-shadow: 0 2px 10px rgba(0,0,0,.3); }
.l-tri::after { content: ""; position: absolute; left: 16px; top: 12px; border-left: 14px solid #fff; border-top: 9px solid transparent; border-bottom: 9px solid transparent; }
.l-meta { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px 10px; min-width: 0; }
.l-name { font-weight: 700; overflow-wrap: anywhere; }
.l-note { font-size: .8125rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.l-from { font-size: .75rem; }
.l-foot { margin-top: 4px; gap: 6px; align-items: center; }
.l-more { min-height: 36px; }
.l-skel { aspect-ratio: 1 / 1.25; border-radius: var(--radius); }
.l-empty { grid-column: 1 / -1; }
.l-pendbox:empty { display: none; }
.l-pending { display: flex; align-items: center; gap: 10px; }
.l-spin { width: 18px; height: 18px; border: 3px solid var(--line); border-top-color: var(--amber); border-radius: 50%; animation: l-rot .9s linear infinite; flex: none; }
@keyframes l-rot { to { transform: rotate(360deg); } }
.l-sheet { min-width: 0; }
.l-big { width: 100%; max-height: 60vh; object-fit: contain; background: var(--raise); border-radius: 12px; }
.l-sheet .l-video { max-height: 60vh; border-radius: 12px; aspect-ratio: 16 / 10; height: auto; }
.l-sheet .l-note { display: block; -webkit-line-clamp: unset; margin: 0; }
.l-file { overflow-wrap: anywhere; font-size: .8125rem; }
.l-add { min-width: 0; }
.l-lab { font-weight: 600; font-size: .9375rem; }
@media (min-width: 1000px) { .l-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); } }

/* ---- jobs ---- */
.j-page { min-width: 0; }
.j-page .h1 { margin: 0; }
.j-agent { font-size: .9375rem; font-weight: 600; }
.j-list { gap: 8px; }
.j-job { padding: 0; display: flex; flex-direction: column; min-width: 0; }
.j-open { display: flex; flex-direction: column; gap: 6px; width: 100%; min-height: 48px; padding: 12px; text-align: left; font: inherit; color: inherit; background: none; border: 0; border-radius: var(--radius); cursor: pointer; }
.j-top { justify-content: space-between; align-items: flex-start; flex-wrap: nowrap; }
.j-title { font-weight: 700; overflow-wrap: anywhere; flex: 1; min-width: 0; }
.j-top .chip { flex: none; }
.j-progress { color: var(--fg); font-size: .8125rem; }
.j-times { font-size: .75rem; }
.j-video { display: flex; align-items: center; min-height: 36px; padding: 0 12px; color: var(--gold-ink); font-weight: 600; border-top: 1px solid var(--line); text-decoration: none; }
.j-video:hover { text-decoration: underline; }
.j-failed { border-color: var(--warn); }
.j-skel { height: 76px; border-radius: var(--radius); }
.j-log {
  margin: 0; padding: 12px; max-height: 55vh; overflow: auto; background: #1C1C1C; color: #E6E3DA; border: 1px solid var(--line); border-radius: 12px;
  font: 12.5px/1.5 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere;
}
.j-loginfo { font-size: .8125rem; }
@media (min-width: 1000px) { .j-list { max-width: 760px; } }
@media (prefers-reduced-motion: reduce) { .l-spin { animation: none; } .u-fill { transition: none; } }

/* requests page: the person's words and the agent's answer on the card */
.j-ask, .j-answer { margin-top: 8px; text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.j-answer { padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, currentColor 7%, transparent); }
.j-who { font-weight: 600; }
.j-wait { margin-top: 6px; font-size: .9em; }

/* home: talk with the agent */
.hm-chat { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; padding: 4px 2px; }
.hm-b { max-width: 88%; padding: 9px 12px; border-radius: 14px; line-height: 1.45; }
.hm-b-t { white-space: pre-wrap; overflow-wrap: anywhere; }
.hm-b-who { font-size: .78em; color: var(--muted); margin-bottom: 2px; }
.hm-b.me { align-self: flex-end; background: var(--pale); border-bottom-right-radius: 4px; }
.hm-b.agent { align-self: flex-start; background: var(--raise); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.hm-b.wait .hm-b-t { color: var(--muted); font-style: italic; }
.hm-b.warn .hm-b-t { color: var(--warn); }

/* home: Jarayonda (jobs queued or running) */
.g-proc .pr-card { position: relative; overflow: hidden; border-color: color-mix(in srgb, var(--amber) 45%, var(--line)); background: color-mix(in srgb, var(--pale) 45%, var(--surface)); }
.pr-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); margin-left: auto; }
.pr-card.on .pr-dot { background: var(--amber); animation: pulse 1.6s ease-in-out infinite; }
.pr-step { margin-top: 2px; font-size: .875rem; overflow-wrap: anywhere; }
.pr-step strong { font-weight: 700; color: var(--fg); }
.pr-time { font-variant-numeric: tabular-nums; color: var(--wait); font-weight: 600; }
.pr-bar { height: 3px; margin-top: 8px; border-radius: 3px; background: color-mix(in srgb, var(--amber) 14%, transparent); overflow: hidden; position: relative; }
.pr-card.on .pr-bar::after { content: ''; position: absolute; inset: 0 auto 0 0; width: 35%; border-radius: 3px; background: var(--amber); animation: prslide 1.4s ease-in-out infinite; }
@keyframes prslide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
