/* EPV Teleprompter styles */
:root {
  --bg: #000;
  --fg: #fff;
  --muted: rgba(255, 255, 255, 0.62);
  --line: rgba(255, 255, 255, 0.14);
  --panel: rgba(16, 16, 18, 0.82);
  --sheet: rgba(28, 28, 30, 0.96);
  --accent: #0a84ff;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

button {
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  cursor: pointer;
}

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------------- Script screen ---------------- */
.screen-script {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.topbar { padding: 12px 16px 4px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pill-btn { border: 0; border-radius: 999px; padding: 8px 14px; background: rgba(255, 255, 255, 0.12); font-size: 15px; font-weight: 600; }
.topbar h1 { font-size: 22px; margin: 0; }
.script-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 8px 16px 0; }
.script-panel textarea {
  flex: 1;
  width: 100%;
  resize: none;
  background: #111;
  color: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  font: 17px/1.45 -apple-system, system-ui, sans-serif; /* 16px+ stops iOS from zooming in */
}
.stats { color: var(--muted); font-size: 14px; margin: 8px 2px 0; }
.title-input {
  width: 100%;
  margin-bottom: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #111;
  color: #fff;
  font: 600 17px -apple-system, system-ui, sans-serif;
}
.topbar .link { padding-left: 0; }
.done-toggle[aria-pressed="true"] { background: rgba(48, 209, 88, 0.25); color: #6fe08f; }

/* Home: your scripts */
.script-list { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 16px 12px; }
.slist-head { margin: 14px 2px 8px; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.slist-empty { margin: 0 2px 8px; color: var(--muted); font-size: 15px; }
.srow {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #111;
}
.scheck {
  flex: none;
  width: 48px;
  height: 48px;
  border: 0;
  background: none;
  display: grid;
  place-items: center;
}
.scheck svg {
  width: 28px;
  height: 28px;
  padding: 3px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  fill: transparent;
}
.scheck[aria-pressed="true"] svg { background: #30d158; border-color: #30d158; fill: #000; }
.smain { flex: 1; min-width: 0; padding: 8px 4px; border: 0; background: none; text-align: left; }
.stitle { font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ssub { margin-top: 2px; color: var(--muted); font-size: 14px; }
.srow.done .stitle { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, 0.35); }
.sdel { flex: none; width: 44px; height: 48px; border: 0; background: none; display: grid; place-items: center; }
.sdel svg { width: 22px; height: 22px; fill: rgba(255, 255, 255, 0.45); }
.sdel:active svg { fill: #ff453a; }
.transfer { margin: 28px 2px 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.transfer-row { display: flex; flex-wrap: wrap; gap: 8px; }
.transfer .pill-btn { font-size: 14px; font-weight: 500; color: var(--muted); }
.script-actions { padding: 10px 16px 14px; }
.primary.big {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  font-size: 18px;
  font-weight: 600;
}

/* ---------------- Prompter screen ---------------- */
.prompter {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #000;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;

  --font-size: 44px;
  --lh: calc(var(--font-size) * 1.35);
  --col-w: 72;   /* column width, % of screen */
  --col-x: 0.5;  /* column position: 0 = hard left, 0.5 = centered, 1 = hard right */
  --col-left: calc((100 - var(--col-w)) * var(--col-x) * 1%);
  --rl: 0.2;
  --text-color: #fff;
  /* Where the reading line sits: a fraction of screen height, but never under the Dynamic Island */
  --reading-y: max(calc(var(--rl) * 100%), calc(env(safe-area-inset-top) + var(--lh) * 0.75));
}

.layer { position: absolute; inset: 0; }
#camera-layer { z-index: 0; background: #000; }
#overlay-layer { z-index: 1; pointer-events: none; }

#reading-line {
  position: absolute;
  z-index: 2;
  /* sits just under the line you're reading, like a guide rule */
  top: calc(var(--reading-y) + var(--lh) * 0.5);
  left: env(safe-area-inset-left);
  right: env(safe-area-inset-right);
  height: 0;
  pointer-events: none;
}
#reading-line::before {
  content: "";
  position: absolute;
  top: -1px;
  height: 2px;
  width: calc(var(--col-w) * 1%);
  left: var(--col-left);
  background: linear-gradient(to right, rgba(255,255,255,0), rgba(255,255,255,0.28) 12%, rgba(255,255,255,0.28) 88%, rgba(255,255,255,0));
}
/* small marker on the left edge of the column */
#reading-line::after {
  content: "";
  position: absolute;
  top: calc(var(--lh) * -0.5 - 6px);
  left: max(0px, calc(var(--col-left) - 12px));
  border: 6px solid transparent;
  border-left: 9px solid rgba(255, 255, 255, 0.4);
  border-right: 0;
}
.no-reading-line #reading-line { display: none; }

#text-viewport { z-index: 3; overflow: hidden; touch-action: none; }
#text-track {
  position: absolute;
  left: env(safe-area-inset-left);
  right: env(safe-area-inset-right);
  top: calc(var(--reading-y) - var(--lh) / 2);
  will-change: transform;
}
#text-column {
  width: calc(var(--col-w) * 1%);
  margin: 0 0 0 var(--col-left);
  padding: 0 0.35em;
  font-size: var(--font-size);
  line-height: 1.35;
  font-weight: 600;
  color: var(--text-color);
  overflow-wrap: break-word;
  -webkit-hyphens: auto; /* if a word can't fit a very narrow strip, split it with a hyphen */
  hyphens: auto;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}
#text-column p { margin: 0 0 0.75em; }
#text-column .end-mark {
  margin: 0;
  font-size: 0.6em;
  line-height: 2.25; /* = one full text line tall */
  letter-spacing: 0.2em;
  text-align: center;
  color: rgba(255, 255, 255, 0.35);
}

.start-hint {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--muted);
  font-size: 16px;
  pointer-events: none;
  white-space: nowrap;
}
.prompter:not([data-state="ready"]) .start-hint { display: none; }

.countdown {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: 46%;
  width: 140px;
  height: 140px;
  margin: -70px 0 0 -70px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.3);
  font-size: 76px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.countdown.pop { animation: pop 1s ease-out; }
@keyframes pop {
  0% { transform: scale(1.3); opacity: 0.2; }
  20% { opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* Progress bars */
.progress { height: 3px; background: rgba(255, 255, 255, 0.15); overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); transform-origin: left center; transform: scaleX(0); }
.controls .progress { position: absolute; top: 0; left: 0; right: 0; }
.progress.mini { position: absolute; z-index: 5; left: 0; right: 0; bottom: 0; display: none; }
.controls-hidden .progress.mini { display: block; }
.controls-hidden .controls { display: none; }

/* Control panel */
.controls {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px calc(12px + env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left));
  background: var(--panel);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.btn-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.ctl {
  min-width: 48px;
  height: 48px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 15px;
}
.ctl:active { background: rgba(255, 255, 255, 0.22); }
.ctl svg { width: 22px; height: 22px; fill: currentColor; flex: none; }
.ctl.play { width: 64px; height: 56px; border-radius: 28px; background: #fff; color: #000; }
.ctl.play svg { width: 30px; height: 30px; }
.ico-pause { display: none; }
[data-state="running"] .ico-play, [data-state="countdown"] .ico-play { display: none; }
[data-state="running"] .ico-pause, [data-state="countdown"] .ico-pause { display: block; }
.time-left {
  position: absolute;
  top: -30px;
  right: calc(12px + env(safe-area-inset-right));
  padding: 3px 9px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.55);
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.time-left::after { content: " left"; }
.ctl.rec { width: 52px; min-width: 52px; height: 52px; padding: 0; border-radius: 26px; background: rgba(255, 255, 255, 0.14); }
.rec-dot { width: 24px; height: 24px; border-radius: 50%; background: #ff3b30; transition: border-radius 0.15s, width 0.15s, height 0.15s; }
.recording .rec-dot, .arming .rec-dot { width: 20px; height: 20px; border-radius: 5px; }
.recording #btn-exit, .arming #btn-exit { visibility: hidden; }
.red { color: #ff453a; }

.sliders { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 16px; margin-top: 6px; }
.slider { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--muted); }
.slider .lbl { display: flex; justify-content: space-between; gap: 4px; white-space: nowrap; }
.slider output { color: var(--fg); font-variant-numeric: tabular-nums; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 34px;
  margin: 0;
  background: transparent;
}
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.25); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  margin-top: -11px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}
input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.25); }
input[type="range"]::-moz-range-thumb { width: 28px; height: 28px; border: 0; border-radius: 50%; background: #fff; }

.show-controls {
  position: absolute;
  z-index: 5;
  right: calc(12px + env(safe-area-inset-right));
  bottom: calc(14px + env(safe-area-inset-bottom));
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 23px;
  background: rgba(255, 255, 255, 0.14);
  display: grid;
  place-items: center;
  opacity: 0.7;
}
.show-controls svg { width: 26px; height: 26px; fill: #fff; }
/* With controls hidden: Back sits in the corner, the "show controls" arrow just left of it */
.float-jump {
  position: absolute;
  z-index: 5;
  right: calc(12px + env(safe-area-inset-right));
  bottom: calc(14px + env(safe-area-inset-bottom));
  height: 52px;
  padding: 0 16px;
  border: 0;
  border-radius: 26px;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  font-weight: 600;
}
.float-jump svg { width: 22px; height: 22px; fill: currentColor; }
.float-jump:active { background: rgba(255, 255, 255, 0.25); }
.controls-hidden .float-jump { display: inline-flex; }
.controls-hidden .show-controls { right: calc(110px + env(safe-area-inset-right)); bottom: calc(17px + env(safe-area-inset-bottom)); }

/* Settings sheet */
.sheet {
  position: absolute;
  z-index: 8;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 62%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 14px calc(16px + env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
  background: var(--sheet);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -6px 30px rgba(0, 0, 0, 0.5);
}
.sheet h2 { display: flex; justify-content: space-between; align-items: center; margin: 0 0 6px; font-size: 18px; }
.link { border: 0; background: none; color: var(--accent); font-size: 17px; font-weight: 600; padding: 8px 4px; }
.group { margin: 14px 0; }
.glabel { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.note { opacity: 0.7; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  flex: 1 1 auto;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 14px;
}
.seg button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); }
.seg.swatches { gap: 10px; }
.seg .swatch { flex: 0 0 40px; width: 40px; height: 40px; min-height: 0; padding: 0; border-radius: 50%; background: var(--c); border: 1px solid rgba(255, 255, 255, 0.35); }
.seg .swatch[aria-pressed="true"] { background: var(--c); box-shadow: 0 0 0 3px var(--sheet), 0 0 0 5px var(--accent); }
input[type="color"] { width: 40px; height: 40px; padding: 0; border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 50%; background: none; overflow: hidden; }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.keys { margin: 0; padding-left: 18px; font-size: 14px; color: var(--muted); line-height: 1.6; }
.keys b { color: var(--fg); font-weight: 600; }

/* Landscape phone: controls in one row, settings as a side panel */
@media (orientation: landscape) and (max-height: 540px) {
  /* One row: "Back to scripts" on the far left, sliders in the middle, the other
     buttons on the right with Back (jump) in the bottom-right corner under your thumb */
  .controls { display: flex; align-items: center; gap: 6px; padding-top: 8px; }
  .btn-row { display: contents; }
  .sliders { flex: 1; order: 1; margin: 0 10px; grid-template-columns: repeat(4, 1fr); gap: 0 12px; }
  .ctl { height: 42px; min-width: 42px; }
  .ctl.play { height: 46px; width: 58px; }
  #btn-exit { order: 0; }
  #btn-settings { order: 2; }
  #btn-hide { order: 3; }
  #btn-rec { order: 4; }
  #btn-play { order: 5; }
  #btn-jump { order: 6; height: 50px; min-width: 76px; font-weight: 600; background: rgba(255, 255, 255, 0.18); }
  .sheet { left: auto; top: 0; width: min(400px, 52%); max-height: none; border-radius: 18px 0 0 18px; padding-top: calc(12px + env(safe-area-inset-top)); }
}
@media (max-width: 380px) {
  .btn-row .ctl { padding: 0 9px; font-size: 14px; }
}

/* ---------------- Camera preview ---------------- */
/* The preview box has the chosen video shape, so you see exactly what's recorded */
#preview-frame {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(100vw, calc(100dvh * var(--ar, 0.5625)));
  height: min(100dvh, calc(100vw / var(--ar, 0.5625)));
  overflow: hidden;
  display: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.camera-on #preview-frame { display: block; }
#camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* mirror view, like a mirror; the saved video is not mirrored */
}
.rec-canvas { position: fixed; left: 0; top: 0; width: 2px; height: 2px; opacity: 0; pointer-events: none; z-index: -1; }

/* Top chips: camera on/off and video shape */
.top-chips {
  position: absolute;
  z-index: 6;
  top: calc(env(safe-area-inset-top) + 6px);
  left: calc(10px + env(safe-area-inset-left));
  right: calc(10px + env(safe-area-inset-right));
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
.chip {
  pointer-events: auto;
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 17px;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 14px;
  font-weight: 600;
}
.chip.off { color: var(--muted); }
.recording .top-chips, .arming .top-chips, .recording .shape-hint, .arming .shape-hint { display: none; }
.shape-hint {
  position: absolute;
  z-index: 6;
  top: calc(env(safe-area-inset-top) + 48px);
  right: calc(10px + env(safe-area-inset-right));
  max-width: 70%;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.55);
  font-size: 13px;
  color: var(--muted);
  pointer-events: none;
}

/* Recording indicator */
.rec-pill {
  position: absolute;
  z-index: 7;
  top: calc(env(safe-area-inset-top) + 6px);
  left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
}
.recording .rec-pill { display: flex; }
.rec-pill .dot { width: 10px; height: 10px; border-radius: 50%; background: #ff3b30; animation: blink 1.2s infinite; }
.rec-pill .size { color: var(--muted); font-weight: 500; }
.rec-pill.warn { background: rgba(170, 110, 0, 0.9); }
.rec-pill.danger { background: rgba(200, 30, 30, 0.92); }
@keyframes blink { 50% { opacity: 0.25; } }
.rec-warn {
  position: absolute;
  z-index: 7;
  top: calc(env(safe-area-inset-top) + 46px);
  left: 50%;
  transform: translateX(-50%);
  width: min(92%, 420px);
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.75);
  font-size: 14px;
  text-align: center;
  pointer-events: none;
}

/* ---------------- Buttons, dialogs, toast ---------------- */
.btn {
  flex: 1;
  min-height: 52px;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 17px;
  font-weight: 600;
}
.btn.primary { background: var(--accent); }
.btn.danger { color: #ff453a; }
.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.6);
}
.dialog {
  width: min(420px, 100%);
  max-height: 85dvh;
  overflow-y: auto;
  padding: 20px;
  border-radius: 18px;
  background: #1c1c1e;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}
.dialog h3 { margin: 0 0 10px; font-size: 19px; }
.dialog p { margin: 0 0 10px; font-size: 16px; line-height: 1.4; color: rgba(255, 255, 255, 0.82); }
.dialog-actions { display: flex; gap: 10px; margin-top: 16px; }
.toast {
  position: fixed;
  z-index: 110;
  left: 50%;
  top: 36%;
  transform: translateX(-50%);
  max-width: 90vw;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(44, 44, 46, 0.96);
  font-size: 15px;
  text-align: center;
  pointer-events: none;
}
.sub { color: var(--muted); font-size: 14px; }

/* ---------------- Review screen ---------------- */
.review {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  background: #000;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.review-head { padding: 12px 16px 6px; }
.review-head h2 { margin: 0 0 2px; font-size: 20px; }
.file-name { margin-top: 2px; font-size: 12px; font-family: ui-monospace, Menlo, monospace; word-break: break-all; opacity: 0.8; }
.review video { flex: 1; min-height: 0; width: 100%; background: #000; object-fit: contain; }
.notice { margin: 6px 16px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 159, 10, 0.18); color: #ffd28a; font-size: 15px; line-height: 1.35; }
.notice a { color: #fff; font-weight: 600; }
.review-actions { display: flex; gap: 10px; padding: 12px 16px 14px; }

/* ---------------- Recordings library ---------------- */
.library {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: flex;
  flex-direction: column;
  background: #000;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.lib-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 8px 12px; }
.lib-head h2 { margin: 0; font-size: 18px; }
.lib-head .link { justify-self: start; }
.lib-storage { margin: 0 16px 10px; }
.lib-list { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; gap: 10px; padding: 0 16px 12px; }
.lib-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #111;
}
.lib-thumb { flex: none; width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: #222; }
.lib-meta { flex: 1; min-width: 0; }
.lib-title { font-weight: 600; font-size: 16px; }
.lib-sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.lib-script { color: var(--muted); font-size: 13px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-badges { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.badge { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 8px; }
.badge.ok { background: rgba(48, 209, 88, 0.2); color: #6fe08f; }
.badge.warn { background: rgba(255, 159, 10, 0.2); color: #ffc260; }
.lib-empty { color: var(--muted); text-align: center; margin-top: 40px; line-height: 1.5; }
.lib-foot { margin: 0; padding: 10px 16px 12px; border-top: 1px solid var(--line); line-height: 1.4; }
