/* Live launcher overlay — sits on top of the design prototype.
   Lets users actually drive the API end-to-end without rewriting all 14 screens. */

/* Titlebar additions: rename input + project switcher + new-project button */
.tb-link {
  background: transparent; border: none; padding: 0;
  color: var(--fg-muted); cursor: pointer; font: inherit;
}
.tb-link:hover { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.tb-rename {
  background: var(--bg-2); border: 1px solid var(--accent); border-radius: 3px;
  color: var(--fg); padding: 1px 6px; font: inherit;
  outline: none; box-shadow: 0 0 0 2px var(--accent-glow);
  min-width: 140px;
}
.tb-rename-target { cursor: text; border-bottom: 1px dashed transparent; }
.tb-rename-target:hover { border-bottom-color: var(--accent-dim); }
.tb-switcher {
  position: absolute;
  top: 32px; left: 130px;
  z-index: 9500;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.5);
  min-width: 320px;
  max-height: 60vh;
  overflow-y: auto;
}
.tb-switcher-head {
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-faint);
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-inset);
}
.tb-switcher-empty {
  padding: 16px 12px;
  color: var(--fg-muted);
  font-size: 12px;
  text-align: center;
}
.tb-switcher-row {
  display: flex; align-items: stretch;
  border-bottom: 1px solid var(--line-soft);
}
.tb-switcher-row:last-child { border-bottom: none; }
.tb-switcher-row.current { background: oklch(0.20 0.04 70 / 0.18); }
.tb-switcher-pick {
  flex: 1;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  background: transparent; border: none;
  padding: 8px 12px;
  cursor: pointer;
  text-align: left;
}
.tb-switcher-pick:hover { background: var(--bg-2); }
.tb-switcher-title { color: var(--fg); font-size: 13px; }
.tb-switcher-meta { color: var(--fg-faint); font-family: var(--font-mono); font-size: 10px; }
.tb-switcher-del {
  background: transparent; border: none; cursor: pointer;
  color: var(--fg-faint); padding: 0 12px;
  font-size: 14px;
}
.tb-switcher-del:hover { color: var(--bad); }

/* EditableField — generic save-on-blur input used by every screen */
.ef-wrap { position: relative; display: inline-flex; align-items: center; width: 100%; gap: 6px; }
.ef-status {
  display: inline-flex; align-items: center; gap: 4px;
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  pointer-events: none;
}
.ef-spin {
  width: 9px; height: 9px;
  border: 1.5px solid var(--bg-3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: ll-spin 0.7s linear infinite;
}
.ef-err {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--bad); pointer-events: auto;
}
.inline-edit.dirty { border-color: var(--accent-dim); }
.inline-edit.has-error { border-color: var(--bad); }

/* Inline-edit dirty indicator */
.dirty-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-left: 6px;
  vertical-align: 2px;
  box-shadow: 0 0 6px var(--accent-glow);
  animation: dirty-pulse 1.4s ease-in-out infinite;
}
@keyframes dirty-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Top live-data banner — appears between filmstrip and screens when in live mode */
.live-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 16px;
  background: linear-gradient(90deg, oklch(0.22 0.04 70 / 0.6), transparent 50%);
  border-bottom: 1px solid var(--accent-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
  letter-spacing: 0.04em;
}
.live-banner .live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 8px var(--accent);
  animation: live-pulse 1.4s ease-in-out infinite;
}
.live-banner code { color: var(--accent); font-size: 11px; }
.live-banner .live-spinner {
  width: 10px; height: 10px;
  border: 1.5px solid var(--accent-dim);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: ll-spin 0.8s linear infinite;
  margin-left: 4px;
}
.live-banner .live-err { color: var(--bad); }
.live-banner .live-exit {
  margin-left: auto;
  background: transparent; border: 1px solid var(--line);
  color: var(--fg-muted);
  padding: 2px 8px; border-radius: 3px;
  font: inherit; cursor: pointer;
}
.live-banner .live-exit:hover { color: var(--fg); border-color: var(--line-strong); }
@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Floating ll-launch removed; the titlebar "+ New Project" button now opens
   the launcher via the cinematon:open-launcher event. */

.ll-overlay {
  position: fixed; inset: 0; z-index: 9100;
  background: rgba(0,0,0,0.65);
  display: grid; place-items: center;
  padding: 24px;
}
.ll-modal {
  width: min(720px, 100%);
  max-height: 86vh;
  display: flex; flex-direction: column;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  overflow: hidden;
}
.ll-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  background: var(--bg-inset);
  border-bottom: 1px solid var(--line);
}
.ll-title { font-family: var(--font-serif); font-size: 16px; font-weight: 500; }
.ll-close {
  background: transparent; border: 1px solid var(--line);
  color: var(--fg-muted); cursor: pointer;
  width: 24px; height: 24px; border-radius: 4px;
}
.ll-close:hover { color: var(--fg); border-color: var(--line-strong); }

.ll-body {
  padding: 18px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
}
.ll-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.ll-input, .ll-textarea {
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 12px;
  color: var(--fg);
  font: inherit;
  outline: none;
}
.ll-textarea { font-family: var(--font-serif); font-size: 14px; line-height: 1.55; }
.ll-input:focus, .ll-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.ll-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.ll-btn {
  padding: 8px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--fg);
  border-radius: 4px;
  font: inherit; cursor: pointer;
}
.ll-btn:hover:not([disabled]) { border-color: var(--line-strong); }
.ll-btn.primary {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
  text-decoration: none;
}
.ll-btn.primary:hover { filter: brightness(1.05); }
.ll-btn[disabled] { opacity: 0.4; cursor: not-allowed; }

.ll-loading {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 36px 16px;
  color: var(--fg-muted);
  text-align: center;
}
.ll-spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--bg-3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: ll-spin 0.8s linear infinite;
}
@keyframes ll-spin { to { transform: rotate(360deg); } }

.ll-row { display: flex; gap: 8px; align-items: center; font-size: 12px; }
.ll-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--fg-muted);
}
.ll-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.ll-stat {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 12px;
}
.ll-stat.accent { border-color: var(--accent-dim); }
.ll-stat.bad    { border-color: oklch(0.4 0.1 25); color: var(--bad); }
.ll-stat-lbl {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 4px;
}
.ll-stat-val {
  font-size: 16px;
  font-weight: 500;
  color: var(--fg);
}
.ll-stat.accent .ll-stat-val { color: var(--accent); }

.ll-block {
  background: oklch(0.20 0.04 25 / 0.4);
  border: 1px solid oklch(0.4 0.1 25);
  border-left: 2px solid var(--bad);
  border-radius: 4px;
  padding: 10px 14px;
}
.ll-block-title {
  color: var(--bad);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.ll-block ul { margin: 0; padding-left: 18px; font-size: 12.5px; line-height: 1.6; color: var(--fg); }

.ll-section {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 4px;
}
.ll-jobs {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}
.ll-jobs th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-faint);
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}
.ll-jobs td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
.ll-jobs code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
}
.ll-status { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.04em; }
.ll-status.ll-queued, .ll-status.ll-submitted { color: var(--fg-muted); }
.ll-status.ll-rendering                       { color: var(--accent); }
.ll-status.ll-complete                        { color: var(--good); }
.ll-status.ll-failed, .ll-status.ll-cancelled { color: var(--bad); }

.ll-prog { width: 120px; height: 4px; background: var(--bg-3); border-radius: 2px; overflow: hidden; }
.ll-prog-fill { height: 100%; background: var(--accent); transition: width 200ms ease; }

.ll-export {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.ll-export code { font-family: var(--font-mono); font-size: 11px; color: var(--fg); word-break: break-all; }

.ll-dim { color: var(--fg-faint); font-size: 11px; }

.ll-error {
  margin: 10px 18px 18px;
  padding: 10px 12px;
  background: oklch(0.18 0.04 25);
  border: 1px solid oklch(0.4 0.1 25);
  border-radius: 4px;
  color: var(--bad);
  font-size: 12px;
}
.ll-error pre { font-size: 10.5px; color: var(--fg-muted); margin-top: 8px; max-height: 200px; overflow: auto; }
