/* Standalone AnalysisView — ordinary browser target.
   Structure follows AnalysisView.svelte: title, ad-safety bar, category rows,
   live transcript. Tailwind/flowbite are not used; the classes below stand in
   for the utility soup one-for-one. */

:root {
  color-scheme: light dark;

  --bg:        #FFFFFF;
  --panel:     #F7F8FA;
  --hairline:  #E3E5E9;
  --text:      #16181C;       /* text-black */
  --text-dim:  #4B5563;       /* text-gray-600 */
  --text-mute: #8C929C;
  --badge-bg:  #1F2937;       /* Badge color="dark" */
  --badge-fg:  #F9FAFB;
  --track:     rgba(0,0,0,0.10);   /* bg-black/10 */
  --playhead:  #000000;

  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #0E1013;
    --panel:     #16191E;
    --hairline:  #262A31;
    --text:      #9CA3AF;     /* dark:text-gray-400 */
    --text-dim:  #9CA3AF;
    --text-mute: #6E757F;
    --badge-bg:  #374151;
    --badge-fg:  #F9FAFB;
    --track:     rgba(255,255,255,0.10);
    --playhead:  #FFFFFF;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0; min-height: 100vh; padding: 24px;
  background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* px-4 mt-1 gap-3 flex-col */
.view {
  display: flex; flex-direction: column; gap: 12px;
  max-width: 1100px; margin: 0 auto;
}

.title { font-size: 24px; font-weight: 700; line-height: 1.25; }      /* text-2xl font-bold */
.desc  { font-size: 16px; font-style: italic; color: var(--text-dim); margin-top: -6px; }
.desc:empty { display: none; }

/* ---------------- Ad safety ---------------- */
.timeline { display: flex; align-items: center; gap: 12px; margin-top: 8px; }

.rowlabel { font-size: 16px; font-weight: 700; flex: 0 0 auto; }       /* text-md font-bold */
.rowlabel.nowrap { white-space: nowrap; }
.rowmeta { font-size: 12px; color: var(--text-mute); flex: 0 0 auto; font-variant-numeric: tabular-nums; }

.bar-wrap { position: relative; flex: 1 1 auto; min-width: 0; }
.bar {
  position: relative; width: 100%; height: 6px;                        /* h-1.5 */
  border-radius: 999px; background: var(--track); overflow: hidden;
}
.bar > i { position: absolute; top: 0; height: 100%; display: block; }

.playhead {
  position: absolute; top: 50%; transform: translateY(-50%);
  height: 12px; width: 2px; background: var(--playhead);               /* h-3 w-0.5 */
  pointer-events: none;
}

/* ---------------- Category rows ---------------- */
.results { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }

.row { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.row-items { display: flex; gap: 8px; overflow-x: auto; min-width: 0; scrollbar-width: none; }
.row-items::-webkit-scrollbar { display: none; }

.badge {                                                              /* Badge rounded color="dark" */
  flex: 0 0 auto;
  padding: 3px 12px; border-radius: 999px;
  background: var(--badge-bg); color: var(--badge-fg);
  font-size: 13px; font-weight: 500;
  max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.badge.more { max-width: 80px; }
.badge.na   { opacity: 0.5; }

/* Spinner size="4" — shown until llama analysis lands. */
.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--hairline); border-top-color: var(--text-mute);
  animation: spin 800ms linear infinite; flex: 0 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- Live transcript ---------------- */
.transcript-wrap {
  margin-top: 8px; padding: 14px 16px;
  background: var(--panel); border: 1px solid var(--hairline); border-radius: var(--radius);
}
.transcript-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.transcript-head .rowmeta { margin-left: auto; }

.transcript { max-height: 220px; overflow-y: auto; font-size: 16px; line-height: 1.65; color: var(--text-dim); }
.transcript .placeholder { color: var(--text-mute); font-style: italic; }
.transcript .seg { display: inline; }
.transcript .seg.new { color: var(--text); font-weight: 600; }

/* ---------------- Misc ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  padding: 10px 18px; border-radius: 999px;
  background: var(--badge-bg); color: var(--badge-fg); font-size: 14px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}
.hidden { display: none !important; }

/* transition-all duration-1000 — the original flashes the panel on topic change. */
.results, .timeline { transition: opacity 1000ms ease-in-out; }
.flash .results, .flash .timeline { opacity: 0.3; }

.stale .view { opacity: 0.45; transition: opacity 250ms ease; }
