:root {
  --bg: hsl(232 32% 6%);
  --bg-2: hsl(232 28% 9%);
  --panel: hsl(232 30% 13% / 0.62);
  --panel-solid: hsl(232 26% 13%);
  --line: hsl(232 30% 70% / 0.12);
  --line-strong: hsl(232 30% 75% / 0.22);
  --text: hsl(230 30% 96%);
  --muted: hsl(230 14% 66%);
  --faint: hsl(230 12% 46%);
  --blue: #4285f4;
  --violet: #9b72cb;
  --rose: #d96570;
  --green: hsl(152 62% 52%);
  --amber: hsl(40 95% 60%);
  --red: hsl(356 82% 64%);
  --grad: linear-gradient(110deg, var(--blue), var(--violet) 55%, var(--rose));
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 60px -20px hsl(240 60% 2% / 0.8), inset 0 1px 0 hsl(0 0% 100% / 0.05);
  --font: 'Inter', system-ui, sans-serif;
  --display: 'Outfit', 'Inter', system-ui, sans-serif;
  color-scheme: dark;
  accent-color: var(--violet);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  background: radial-gradient(1200px 700px at 85% -10%, hsl(258 60% 18% / 0.55), transparent 60%), var(--bg);
  color: var(--text);
  display: grid;
  grid-template-columns: 268px 1fr;
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.bg-orbs { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bg-orbs span { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.32; animation: float 22s ease-in-out infinite alternate; }
.bg-orbs span:nth-child(1) { width: 520px; height: 520px; background: var(--blue); top: -160px; left: 20%; }
.bg-orbs span:nth-child(2) { width: 420px; height: 420px; background: var(--violet); bottom: -120px; right: 8%; animation-delay: -8s; }
.bg-orbs span:nth-child(3) { width: 300px; height: 300px; background: var(--rose); top: 40%; left: 55%; opacity: 0.16; animation-delay: -14s; }
@keyframes float { to { transform: translate(60px, 40px) scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .bg-orbs span { animation: none; } }

/* ---------------- Sidebar ---------------- */
.sidebar {
  position: sticky; top: 0; height: 100dvh; z-index: 2;
  display: flex; flex-direction: column; gap: 28px;
  padding: 26px 18px;
  background: hsl(232 32% 7% / 0.7);
  backdrop-filter: blur(18px) saturate(140%);
  border-inline-end: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; padding: 0 8px; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; background: var(--grad); display: grid; place-items: center; box-shadow: 0 8px 24px -6px hsl(260 70% 55% / 0.6); }
.brand-mark svg { width: 18px; fill: #fff; }
.brand strong { display: block; font-family: var(--display); font-size: 1.12rem; letter-spacing: -0.01em; }
.brand small { color: var(--muted); font-size: 0.74rem; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px;
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: 0.94rem;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.nav a svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav a:hover { background: hsl(0 0% 100% / 0.04); color: var(--text); transform: translateX(2px); }
.nav a.active { background: linear-gradient(90deg, hsl(220 90% 60% / 0.18), hsl(270 60% 60% / 0.08)); color: var(--text); box-shadow: inset 2px 0 0 var(--blue); }
.nav-badge { margin-inline-start: auto; background: var(--blue); color: #fff; font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.nav-badge.danger { background: var(--red); }

.status-stack { margin-top: auto; display: grid; gap: 8px; }
.status-pill { display: flex; align-items: center; gap: 10px; font-size: 0.82rem; color: var(--muted); padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: hsl(0 0% 100% / 0.02); }
.status-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); box-shadow: 0 0 0 3px hsl(0 0% 100% / 0.04); }
.status-pill.ok i { background: var(--green); box-shadow: 0 0 12px var(--green); }
.status-pill.bad i { background: var(--red); box-shadow: 0 0 12px var(--red); }
.status-pill.warn i { background: var(--amber); }
.mock-banner { text-align: center; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; padding: 8px; border-radius: 10px; color: hsl(40 95% 70%); background: hsl(40 95% 50% / 0.1); border: 1px dashed hsl(40 95% 60% / 0.4); }

/* ---------------- Main ---------------- */
.main { position: relative; z-index: 1; padding: 34px clamp(18px, 3vw, 44px) 80px; min-width: 0; }
.view { animation: fadeUp 0.45s cubic-bezier(.2,.8,.2,1); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-block-end: 26px; }
.eyebrow { margin: 0 0 6px; color: var(--muted); font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600; }
h1 { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(1.7rem, 2.6vw, 2.5rem); letter-spacing: -0.025em; line-height: 1.1; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.col { display: grid; gap: 22px; min-width: 0; }
@media (max-width: 1180px) { .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 860px) { body { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; } }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(16px) saturate(130%);
  box-shadow: var(--shadow);
  min-width: 0;
}
.card-title { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; font-family: var(--display); font-size: 1.12rem; font-weight: 600; letter-spacing: -0.01em; }
.card-title.mt, .mt { margin-top: 26px; }
.num { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 0.8rem; font-weight: 700; background: hsl(0 0% 100% / 0.06); border: 1px solid var(--line-strong); }
.num.spark { background: var(--grad); border: 0; color: #fff; }

/* ---------------- Form controls ---------------- */
.field { display: grid; gap: 6px; margin-block-end: 16px; min-width: 0; border: 0; padding: 0; }
.field.inline { margin: 0; }
.field.grow { flex: 1; }
label, legend { font-size: 0.84rem; font-weight: 600; color: hsl(230 20% 84%); padding: 0; }
legend { margin-block-end: 8px; }
.hint { font-size: 0.78rem; color: var(--faint); }
code { font-size: 0.85em; padding: 1px 6px; border-radius: 6px; background: hsl(0 0% 100% / 0.07); }
input[type=text], input[type=number], input[type=password], input[type=url], input:not([type]), select, textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--text);
  background: hsl(232 30% 6% / 0.6); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 11px 13px; min-height: 46px; transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
textarea { resize: vertical; line-height: 1.55; }
input:hover, select:hover, textarea:hover { border-color: hsl(230 40% 75% / 0.35); }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--blue); outline-offset: 2px; border-color: transparent; box-shadow: 0 0 0 6px hsl(217 90% 60% / 0.15);
}
input:user-invalid, textarea:user-invalid { border-color: var(--red); }
input[type=color] { width: 100%; height: 46px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: transparent; padding: 4px; }
input[type=range] { width: 100%; min-height: 46px; }
output { margin-inline-start: auto; color: var(--text); font-variant-numeric: tabular-nums; background: hsl(0 0% 100% / 0.07); padding: 0 8px; border-radius: 6px; }
label:has(> output) { display: flex; align-items: center; }
.row { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.row > .field { flex: 1 1 160px; }
.row.tight { gap: 10px; align-items: center; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; margin-block-end: 12px; cursor: pointer; }
.check input { width: 18px; height: 18px; }

.visually-hidden { position: absolute; clip-path: inset(50%); overflow: hidden; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; white-space: nowrap; }

.switch { display: inline-flex; align-items: center; gap: 12px; font-weight: 500; cursor: pointer; margin-block-end: 16px; min-height: 46px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch span { width: 44px; height: 26px; border-radius: 99px; background: hsl(0 0% 100% / 0.12); position: relative; transition: background 0.25s; flex: none; }
.switch span::after { content: ''; position: absolute; inset: 3px auto 3px 3px; width: 20px; border-radius: 50%; background: #fff; transition: translate 0.25s cubic-bezier(.3,1.4,.5,1); }
.switch input:checked + span { background: var(--grad); }
.switch input:checked + span::after { translate: 18px 0; }
.switch input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Buttons */
.btn {
  --b: hsl(0 0% 100% / 0.06);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 0.94rem; color: var(--text); text-decoration: none;
  padding: 0 18px; min-height: 46px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--b); cursor: pointer; transition: transform 0.18s, box-shadow 0.25s, background 0.2s, opacity 0.2s;
  position: relative; overflow: hidden; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); background: hsl(0 0% 100% / 0.1); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn.primary { background: var(--grad); border: 0; box-shadow: 0 10px 30px -10px hsl(260 80% 60% / 0.7); background-size: 200% 100%; }
.btn.primary:hover { background-position: 100% 0; box-shadow: 0 14px 36px -10px hsl(260 80% 60% / 0.9); }
.btn.ghost { background: transparent; border-style: dashed; width: 100%; }
.btn.subtle { background: transparent; }
.btn.danger { color: hsl(356 90% 75%); border-color: hsl(356 80% 60% / 0.35); }
.btn.big { min-height: 52px; padding: 0 26px; font-size: 1rem; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 0.84rem; border-radius: 10px; }
.btn.full { width: 100%; }
.btn[aria-busy=true] { pointer-events: none; opacity: 0.85; }
.btn[aria-busy=true] .btn-label::before { content: ''; display: inline-block; width: 14px; height: 14px; margin-inline-end: 8px; vertical-align: -2px; border: 2px solid #fff6; border-top-color: #fff; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }

/* Segmented control */
.seg { position: relative; display: inline-flex; padding: 5px; border-radius: 14px; background: hsl(232 30% 10% / 0.8); border: 1px solid var(--line); }
.seg-btn { position: relative; z-index: 1; font: inherit; font-weight: 600; font-size: 0.9rem; color: var(--muted); background: none; border: 0; padding: 10px 18px; min-height: 42px; border-radius: 10px; cursor: pointer; transition: color 0.25s; }
.seg-btn.active { color: #fff; }
.seg-ind { position: absolute; z-index: 0; top: 5px; bottom: 5px; border-radius: 10px; background: var(--grad); transition: left 0.35s cubic-bezier(.3,1.2,.4,1), width 0.35s cubic-bezier(.3,1.2,.4,1); box-shadow: 0 6px 18px -6px hsl(260 80% 60% / 0.7); }
.seg.small .seg-btn.active { background: hsl(0 0% 100% / 0.1); }

/* Dropzones */
.dropzone {
  display: grid; justify-items: center; gap: 4px; text-align: center; cursor: pointer;
  padding: 30px 20px; border-radius: var(--radius); border: 1.5px dashed var(--line-strong);
  background: linear-gradient(180deg, hsl(0 0% 100% / 0.025), transparent);
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.dropzone.small { padding: 20px; margin-block-end: 18px; }
.dropzone svg { width: 34px; height: 34px; fill: none; stroke: var(--violet); stroke-width: 1.6; margin-block-end: 6px; }
.dropzone strong { font-size: 0.95rem; }
.dropzone span { font-size: 0.8rem; color: var(--faint); font-weight: 400; }
.dropzone:hover, .dropzone.drag { border-color: var(--violet); background: hsl(270 60% 60% / 0.08); transform: scale(1.005); }
.dropzone:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }

.thumbs { list-style: none; padding: 0; margin: -6px 0 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.thumbs:empty { display: none; }
.thumbs li { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); animation: pop 0.3s cubic-bezier(.3,1.5,.5,1); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.thumbs button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: hsl(0 0% 0% / 0.65); color: #fff; cursor: pointer; font-size: 0.8rem; line-height: 1; }
@keyframes pop { from { transform: scale(0.7); opacity: 0; } }

/* Presets */
.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.presets label { cursor: pointer; }
.presets input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.presets span { display: grid; grid-template-columns: auto auto; column-gap: 8px; align-items: center; padding: 9px 14px; min-height: 46px; border-radius: 12px; border: 1px solid var(--line-strong); font-weight: 600; font-size: 0.9rem; transition: all 0.2s; }
.presets small { grid-column: 2; color: var(--faint); font-size: 0.72rem; font-weight: 500; }
.presets i { grid-row: span 2; border: 2px solid currentColor; border-radius: 3px; opacity: 0.7; }
.ar.r916 { width: 12px; height: 20px; } .ar.r169 { width: 22px; height: 13px; } .ar.r11 { width: 17px; height: 17px; } .ar.r45 { width: 15px; height: 19px; }
.presets input:checked + span { border-color: transparent; background: linear-gradient(var(--panel-solid), var(--panel-solid)) padding-box, var(--grad) border-box; border: 1.5px solid transparent; box-shadow: 0 6px 20px -8px hsl(260 80% 60% / 0.6); }
.presets input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }

.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.radio-card { cursor: pointer; }
.radio-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.radio-card span { display: grid; gap: 2px; height: 100%; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line-strong); transition: all 0.2s; }
.radio-card b { font-size: 0.92rem; }
.radio-card small { color: var(--faint); font-weight: 400; font-size: 0.78rem; }
.radio-card input:checked + span { background: linear-gradient(hsl(232 30% 14%), hsl(232 30% 14%)) padding-box, var(--grad) border-box; border: 1.5px solid transparent; }
.radio-card input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }

.details summary { cursor: pointer; color: var(--muted); font-size: 0.86rem; font-weight: 600; margin-block-end: 8px; }
.details { margin-block-end: 16px; }

/* Clone */
.ref-progress { display: grid; gap: 8px; margin-top: 16px; font-size: 0.86rem; color: var(--muted); }
.ref-head { display: grid; grid-template-columns: 150px 1fr; gap: 16px; margin: 18px 0 14px; }
.ref-head video { width: 100%; aspect-ratio: 9/16; object-fit: cover; border-radius: 14px; background: #000; border: 1px solid var(--line); }
.kpis { display: flex; gap: 10px; flex-wrap: wrap; }
.kpis > div { flex: 1; min-width: 80px; padding: 10px 12px; border-radius: 12px; background: hsl(0 0% 100% / 0.04); border: 1px solid var(--line); }
.kpis b { display: block; font-family: var(--display); font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.kpis small { color: var(--faint); font-size: 0.74rem; }
.kpis.big > div { min-width: 110px; padding: 12px 16px; }
.kpis.big b { font-size: 1.6rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { font-size: 0.76rem; padding: 5px 10px; border-radius: 99px; background: hsl(270 60% 60% / 0.12); border: 1px solid hsl(270 60% 70% / 0.25); color: hsl(270 80% 88%); }
.chip b { color: var(--muted); font-weight: 600; margin-inline-end: 4px; }
.frames { display: flex; gap: 8px; margin-block-end: 16px; }
.frames img { width: 70px; aspect-ratio: 9/16; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }

.scenes-section { margin-block: 14px 10px; }
.scenes-scroller {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 10px 2px;
  scrollbar-width: thin;
}
.scenes-scroller::-webkit-scrollbar { height: 6px; }
.scenes-scroller::-webkit-scrollbar-thumb { background: hsl(0 0% 100% / 0.2); border-radius: 99px; }
.scene-card {
  position: relative;
  flex: 0 0 82px;
  aspect-ratio: 9/16;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  background: #000;
}
.scene-card:hover {
  transform: translateY(-2px) scale(1.03);
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(0,0,0,0.5);
}
.scene-card.selected {
  border: 2px solid var(--accent);
  box-shadow: 0 0 12px hsl(270 90% 65% / 0.5);
}
.scene-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.scene-card .scene-tag {
  position: absolute;
  bottom: 4px;
  left: 3px;
  right: 3px;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 0.64rem;
  font-weight: 600;
  text-align: center;
  padding: 2px 4px;
  border-radius: 4px;
}

.ref-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 14px;
}
.ref-video-item {
  background: hsl(0 0% 100% / 0.03);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
  position: relative;
  transition: border-color 0.2s ease;
}
.ref-video-item:hover {
  border-color: hsl(270 50% 50% / 0.4);
}
.ref-video-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.ref-video-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-del-ref {
  color: #ff5c77 !important;
  border-color: rgba(255, 92, 119, 0.3) !important;
}
.btn-del-ref:hover {
  background: rgba(255, 92, 119, 0.15) !important;
  border-color: #ff5c77 !important;
}

/* Progress bars (custom styled) */
progress {
  appearance: none; border: 0 solid; overflow: clip; width: 100%; height: 8px;
  container-type: inline-size;
  --progress-bar-radius: 1e5px; --progress-bar-indeterminate-size: 30%; --progress-bar-indeterminate-animation-duration: 1.4s;
  border-radius: var(--progress-bar-radius); background: hsl(0 0% 100% / 0.08);
}
@media (prefers-reduced-motion: reduce) { progress { --progress-bar-indeterminate-animation-duration: 10s; } }
progress:indeterminate { --progress-bar-animation: progress-ind var(--progress-bar-indeterminate-animation-duration) infinite linear; }
progress::-webkit-progress-bar { background: transparent; }
progress::-webkit-progress-value { background: var(--progress-fill, var(--grad)); border-radius: var(--progress-bar-radius); transition: inline-size 0.4s; animation: var(--progress-bar-animation, none); }
progress::-moz-progress-bar { background: var(--progress-fill, var(--grad)); border-radius: var(--progress-bar-radius); animation: var(--progress-bar-animation, none); }
@keyframes progress-ind {
  from, to { inline-size: var(--progress-bar-indeterminate-size); margin-right: auto; }
  from { translate: -100%; } to { translate: 100cqi; }
}

/* Items review */
.items-card { margin-top: 22px; }
.items-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-block-end: 16px; }
.items-head .card-title { margin: 0; }
.pill { font-family: var(--font); font-size: 0.76rem; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: hsl(217 90% 60% / 0.15); color: hsl(217 90% 80%); }
.items { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.item {
  position: relative; display: grid; gap: 10px; padding: 16px; border-radius: 16px;
  background: hsl(232 30% 8% / 0.55); border: 1px solid var(--line); animation: fadeUp 0.35s both;
}
.item-top { display: flex; gap: 10px; align-items: center; }
.item-idx { font-family: var(--display); font-weight: 700; color: var(--faint); font-size: 0.85rem; min-width: 26px; }
.item-top input { min-height: 38px; padding: 6px 10px; font-weight: 600; }
.item textarea { min-height: 110px; font-size: 0.92rem; }
.item .rm { flex: none; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: none; color: var(--muted); cursor: pointer; }
.item .rm:hover { color: var(--red); border-color: var(--red); }
.item details summary { font-size: 0.8rem; color: var(--faint); cursor: pointer; }
.item details[open] { display: grid; gap: 8px; }
.item details input { min-height: 38px; font-size: 0.86rem; }
.item .meta { font-size: 0.74rem; color: var(--faint); display: flex; justify-content: space-between; }
.item .img-tag { display: inline-flex; align-items: center; gap: 6px; }
.item .img-tag img { width: 20px; height: 20px; border-radius: 5px; object-fit: cover; }

/* Monitor */
.batch { margin-block-end: 20px; }
.batch-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.batch-head h2 { margin: 0; font-family: var(--display); font-size: 1.15rem; flex: 1; min-width: 200px; }
.batch-head h2 small { display: block; font-family: var(--font); font-weight: 400; color: var(--faint); font-size: 0.78rem; margin-top: 2px; }
.batch-progress { display: flex; align-items: center; gap: 12px; margin: 16px 0; }
.batch-progress progress { height: 10px; }
.batch-progress b { font-variant-numeric: tabular-nums; min-width: 44px; text-align: end; }
.counts { display: flex; gap: 6px; flex-wrap: wrap; }
.count { font-size: 0.74rem; font-weight: 600; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.count.done { color: var(--green); border-color: hsl(152 60% 50% / 0.35); }
.count.failed { color: var(--red); border-color: hsl(356 80% 60% / 0.35); }
.count.running { color: hsl(217 90% 75%); border-color: hsl(217 90% 60% / 0.35); }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.vcard { display: grid; gap: 8px; padding: 12px; border-radius: 14px; background: hsl(232 30% 8% / 0.55); border: 1px solid var(--line); transition: border-color 0.3s; }
.vcard[data-status=running] { border-color: hsl(217 90% 60% / 0.45); box-shadow: 0 0 0 1px hsl(217 90% 60% / 0.12), 0 10px 30px -14px hsl(217 90% 60% / 0.6); }
.vcard[data-status=done] { border-color: hsl(152 60% 50% / 0.3); }
.vcard[data-status=failed] { border-color: hsl(356 80% 60% / 0.4); }
.vcard[data-status=retrying] { border-color: hsl(40 95% 60% / 0.4); }
.vcard h3 { margin: 0; font-size: 0.88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vcard .step { font-size: 0.76rem; color: var(--muted); min-height: 2.4em; }
.vcard .err { font-size: 0.74rem; color: hsl(356 90% 78%); background: hsl(356 80% 50% / 0.08); padding: 6px 8px; border-radius: 8px; word-break: break-word; max-height: 5.5em; overflow: auto; }
.vcard video { width: 100%; max-height: 260px; border-radius: 10px; background: #000; }
.vcard .links { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 0.78rem; }
.vcard .links a { white-space: nowrap; }
.vcard .links a { color: hsl(217 90% 78%); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.queued { color: var(--faint); } .status.running { color: hsl(217 90% 70%); } .status.retrying { color: var(--amber); }
.status.done { color: var(--green); } .status.failed { color: var(--red); } .status.canceled { color: var(--faint); }
.status.running::before { animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }
.vcard progress { height: 6px; }
.vcard[data-status=done] progress { --progress-fill: var(--green); }
.vcard[data-status=failed] progress { --progress-fill: var(--red); }
.empty { color: var(--faint); text-align: center; padding: 60px 0; }
.empty a { color: hsl(217 90% 75%); }

/* Settings */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 22px; align-items: start; }
.drive-box { padding: 14px; border-radius: 14px; background: hsl(0 0% 100% / 0.03); border: 1px solid var(--line); margin-block-end: 18px; }
.drive-box p { margin: 0 0 12px; font-size: 0.88rem; color: var(--muted); }

/* Logs */
.log-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 0.84rem; }
.log-list li { display: grid; grid-template-columns: 150px 1fr; gap: 14px; padding: 10px 12px; border-radius: 10px; background: hsl(0 0% 100% / 0.025); border-inline-start: 3px solid var(--faint); }
.log-list li.error { border-color: var(--red); } .log-list li.warn { border-color: var(--amber); } .log-list li.info { border-color: var(--blue); }
.log-list time { color: var(--faint); font-variant-numeric: tabular-nums; }
.log-list .e { color: hsl(356 90% 78%); display: block; font-family: ui-monospace, monospace; font-size: 0.78rem; margin-top: 4px; word-break: break-word; }

/* Toasts */
.toasts { position: fixed; bottom: 22px; right: 22px; display: grid; gap: 10px; z-index: 50; }
.toast { padding: 13px 18px; border-radius: 14px; background: hsl(232 30% 14% / 0.92); backdrop-filter: blur(14px); border: 1px solid var(--line-strong); box-shadow: var(--shadow); font-size: 0.9rem; max-width: 380px; animation: toastIn 0.35s cubic-bezier(.3,1.4,.5,1); }
.toast.error { border-color: hsl(356 80% 60% / 0.5); }
.toast.ok { border-color: hsl(152 60% 50% / 0.5); }
@keyframes toastIn { from { opacity: 0; translate: 0 14px; scale: 0.96; } }

[hidden] { display: none !important; }

/* ================= v2: Conexões, navegador remoto, login ================= */
.conn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 22px; align-items: start; }
@media (max-width: 520px) { .conn-grid { grid-template-columns: 1fr; } }
.conn-card { position: relative; overflow: hidden; }
.conn-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: var(--grad); opacity: 0.85; }
.conn-card.span-2 { grid-column: 1 / -1; }
.conn-head { display: flex; align-items: center; gap: 14px; margin-block-end: 18px; }
.conn-head .card-title { margin: 0; }
.conn-head p { margin: 2px 0 0; color: var(--faint); font-size: 0.8rem; }
.conn-ico { width: 44px; height: 44px; flex: none; border-radius: 14px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 1.05rem; color: #fff; }
.conn-ico.a { background: linear-gradient(135deg, var(--blue), var(--violet)); }
.conn-ico.b { background: linear-gradient(135deg, hsl(152 60% 42%), var(--blue)); }
.conn-ico.c { background: linear-gradient(135deg, var(--violet), var(--rose)); }
.conn-ico.g { background: linear-gradient(135deg, hsl(40 95% 55%), var(--rose)); }
.badge { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 7px; font-size: 0.74rem; font-weight: 700; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; }
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.ok { color: var(--green); border-color: hsl(152 60% 50% / 0.35); background: hsl(152 60% 50% / 0.08); }
.badge.bad { color: var(--red); border-color: hsl(356 80% 60% / 0.35); background: hsl(356 80% 60% / 0.08); }
.badge.warn { color: var(--amber); border-color: hsl(40 95% 60% / 0.35); background: hsl(40 95% 60% / 0.08); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 0.84rem; margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; background: hsl(0 0% 100% / 0.03); border: 1px solid var(--line); }
.kv dt { color: var(--faint); }
.kv dd { margin: 0; word-break: break-all; }
.tabs-mini { display: flex; gap: 6px; margin-block-end: 14px; flex-wrap: wrap; }
.tabs-mini button { font: inherit; font-size: 0.82rem; font-weight: 600; color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 99px; padding: 6px 14px; min-height: 34px; cursor: pointer; }
.tabs-mini button[aria-selected=true] { color: #fff; background: hsl(0 0% 100% / 0.1); border-color: var(--line-strong); }
.callout { font-size: 0.8rem; color: hsl(40 95% 78%); background: hsl(40 95% 50% / 0.07); border: 1px solid hsl(40 95% 60% / 0.25); border-radius: 12px; padding: 10px 12px; margin-block-end: 16px; }
.callout.info { color: hsl(217 90% 84%); background: hsl(217 90% 60% / 0.07); border-color: hsl(217 90% 60% / 0.25); }
.mono, textarea.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.8rem; }
.copyline { display: flex; gap: 8px; align-items: center; }
.copyline code { flex: 1; overflow: auto; white-space: nowrap; padding: 8px 10px; }

/* Navegador remoto */
.remote { border-radius: 14px; overflow: hidden; border: 1px solid var(--line-strong); background: #05060a; margin-block-end: 14px; }
.remote-bar { display: flex; gap: 6px; align-items: center; padding: 8px; background: hsl(232 30% 10%); border-bottom: 1px solid var(--line); }
.remote-bar button { flex: none; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: none; color: var(--muted); cursor: pointer; font-size: 1rem; }
.remote-bar button:hover { color: var(--text); background: hsl(0 0% 100% / 0.06); }
.remote-bar input { min-height: 36px; padding: 6px 12px; font-size: 0.84rem; border-radius: 99px; }
.remote-stage { position: relative; aspect-ratio: 16 / 10; display: grid; place-items: center; }
.remote-stage canvas { width: 100%; height: 100%; display: block; cursor: default; outline: none; }
.remote-stage canvas:focus-visible { box-shadow: inset 0 0 0 2px var(--blue); }
.remote-overlay { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 14px; text-align: center; padding: 20px; background: radial-gradient(circle at 50% 40%, hsl(258 60% 20% / 0.6), #05060a 70%); color: var(--muted); font-size: 0.88rem; }
.remote-overlay strong { color: var(--text); font-family: var(--display); font-size: 1.1rem; }

.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 10px; }
.shots a { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.shots img { width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; }
.shots small { display: block; padding: 4px 6px; font-size: 0.68rem; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.test-out video { width: 100%; max-height: 360px; border-radius: 12px; background: #000; margin-top: 10px; }
.user-chip { display: flex; align-items: center; gap: 10px; font-size: 0.84rem; }
.user-chip img { width: 30px; height: 30px; border-radius: 50%; }
.logout-link { font: inherit; font-size: 0.8rem; color: var(--faint); background: none; border: 0; cursor: pointer; text-align: center; padding: 6px; }
.logout-link:hover { color: var(--text); }

/* Login */
body.login { display: grid; grid-template-columns: 1fr; place-items: center; padding: 24px; }
.login-card { position: relative; z-index: 1; width: min(420px, 100%); padding: 34px; }
.login-card .brand { padding: 0; margin-block-end: 26px; }
.login-card h1 { font-size: 1.7rem; margin-block-end: 6px; }
.login-card p.sub { color: var(--muted); margin: 0 0 24px; font-size: 0.9rem; }
.login-err { color: hsl(356 90% 78%); font-size: 0.85rem; min-height: 1.3em; margin: 0 0 10px; }
a.status-pill { text-decoration: none; transition: border-color 0.2s, color 0.2s; }
a.status-pill:hover { color: var(--text); border-color: var(--line-strong); }
