/* ============================================================ tokens */
/* Marca Kort: preto quente ~60%, branco 20%, Amarelo Corte 12% (só botões e destaques), ciano e magenta 4% */
:root {
  --bg: #0E0D0B;
  --surface: #1A1916;
  --surface-2: #24221E;
  --surface-3: #2C2A25;
  --line: #34312B;
  --line-strong: #423E36;
  --text: #FFFDF6;
  --muted: #A39E92;
  --faint: #6E6A60;

  --accent: #FFD400;
  --accent-hover: #FFE04D;
  --accent-soft: rgba(255, 212, 0, 0.14);
  --on-accent: #0E0D0B;

  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

  --ok: #34d399;
  --ok-soft: rgba(52, 211, 153, 0.13);
  --warn: #FF9F43;
  --warn-soft: rgba(255, 159, 67, 0.13);
  --bad: #f87171;
  --bad-soft: rgba(248, 113, 113, 0.13);
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, 0.13);

  /* uma cor por ferramenta */
  --kind-cuts: #FFD400;
  --kind-edit: #3EC6FF;
  --kind-animation: #FF2E88;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 10px 30px rgba(0, 0, 0, 0.25);
  --sidebar: 240px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.5 var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; letter-spacing: -0.015em; }
/* Títulos das telas: Archivo larga e inclinada, "correndo" como o logo */
h1 { font-size: 30px; font-weight: 900; font-style: italic; font-stretch: 115%; letter-spacing: -0.025em; line-height: 1.05; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
code { background: var(--surface-3); padding: 1px 6px; border-radius: 5px; font-size: 0.92em; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 13px; }
.icon { display: inline-flex; flex: none; }
.icon svg { display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ============================================================ layout */
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.main { padding: 32px clamp(16px, 4vw, 48px) 80px; max-width: 1240px; width: 100%; min-width: 0; margin: 0 auto; outline: none; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 24px;
  padding: 22px 14px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px; }
.brand-mark { width: 30px; height: 30px; display: block; flex: none; }
.brand-name { font-size: 24px; }

/* Wordmark: duas cópias do nome, a metade da direita deslocada pelo corte diagonal */
.wm { position: relative; display: inline-block; font-family: var(--font); font-weight: 900; font-style: italic; font-stretch: 125%; letter-spacing: -0.03em; line-height: 0.9; }
.wm > span { display: block; }
.wm .a { clip-path: polygon(0 0, 57% 0, 47% 100%, 0 100%); }
.wm .b { position: absolute; inset: 0; clip-path: polygon(57% 0, 100% 0, 100% 100%, 47% 100%); transform: translate(0.035em, -0.05em); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--muted); font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--text); }
.nav-item.active .icon { color: var(--accent); }
.nav-label { flex: 1; }
.nav-badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--warn-soft); color: var(--warn); font-size: 12px; font-weight: 700;
  display: grid; place-items: center;
}

.sidebar-status { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 13px; }
.status-row { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.status-row.ok { color: var(--text); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.status-row.ok .status-dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }

/* ============================================================ page header */
.page-header { margin-bottom: 26px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.back:hover { color: var(--text); }
.page-header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-title { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.page-title h1 { overflow-wrap: anywhere; }
.page-title p { margin-top: 4px; max-width: 640px; }
.page-icon {
  width: 44px; height: 44px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--accent);
}
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================================ botões e campos */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--radius-sm);
  font: inherit; font-weight: 600; font-size: 14px; white-space: nowrap;
  border: 1px solid transparent; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s, transform 0.05s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--on-accent); font-weight: 800; box-shadow: 0 6px 18px rgba(255, 212, 0, 0.18); }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn.secondary { background: var(--surface-3); color: var(--text); border-color: var(--line-strong); }
.btn.secondary:hover:not(:disabled) { border-color: var(--faint); }
.btn.ghost { background: transparent; color: var(--muted); padding: 0 10px; }
.btn.ghost:hover:not(:disabled) { color: var(--text); background: var(--surface-2); }
.btn.danger-ghost { background: transparent; color: var(--bad); border-color: transparent; }
.btn.danger-ghost:hover:not(:disabled) { background: var(--bad-soft); }
.btn.loading { position: relative; color: transparent !important; }
.btn.loading::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--text) transparent var(--text) transparent;
  animation: spin 0.8s linear infinite;
}
.btn.primary.loading::after { border-color: var(--on-accent) transparent var(--on-accent) transparent; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--muted); display: grid; place-items: center; cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.icon-btn.danger:hover { color: var(--bad); }

input, textarea, select {
  width: 100%; font: inherit; font-size: 14px; color: var(--text);
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 10px 12px; transition: border-color 0.15s, box-shadow 0.15s;
}
input:hover, textarea:hover, select:hover { border-color: var(--faint); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input:disabled, textarea:disabled, select:disabled { opacity: 0.55; }
textarea { resize: vertical; line-height: 1.5; }
input[type="range"] { padding: 0; height: 36px; accent-color: var(--accent); background: transparent; border: 0; box-shadow: none; }
input[type="checkbox"] { width: auto; accent-color: var(--accent); }
select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b90a0' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.span-2 { grid-column: 1 / -1; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.actions.end { justify-content: flex-end; }

.toggles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin-bottom: 18px; }
.toggle {
  display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none;
  padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2);
  font-size: 14px; font-weight: 500;
}
.toggle:hover { border-color: var(--line-strong); }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.switch { width: 34px; height: 20px; border-radius: 999px; background: var(--line-strong); position: relative; flex: none; transition: background 0.15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.toggle input:checked + .switch { background: var(--accent); }
.toggle input:checked + .switch::after { transform: translateX(14px); }
.toggle input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ============================================================ pills, tags, barras */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-3); color: var(--muted);
}
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1.4s ease-in-out infinite; }

.kind-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); }
.kind-tag.kind-cuts .icon { color: var(--kind-cuts); }
.kind-tag.kind-edit .icon { color: var(--kind-edit); }
.kind-tag.kind-animation .icon { color: var(--kind-animation); }

.bar { height: 4px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width 0.6s ease; }

/* ============================================================ cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card-title { margin-bottom: 16px; }

/* ============================================================ início */
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 16px; margin-bottom: 18px; }
.tool-card {
  --kc: var(--accent);
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 10px;
  padding: 22px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  transition: border-color 0.2s, transform 0.2s;
}
.tool-card::before {
  content: ""; position: absolute; inset: auto -40% -60% auto; width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--kc) 22%, transparent), transparent 70%);
  pointer-events: none;
}
.tool-card:hover { border-color: color-mix(in srgb, var(--kc) 55%, var(--line)); transform: translateY(-2px); }
.tool-card.kind-cuts { --kc: var(--kind-cuts); }
.tool-card.kind-edit { --kc: var(--kind-edit); }
.tool-card.kind-animation { --kc: var(--kind-animation); }
.tool-icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  color: var(--kc); background: color-mix(in srgb, var(--kc) 14%, transparent);
}
.tool-card p { color: var(--muted); font-size: 14px; flex: 1; }
.tool-cta { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; color: var(--kc); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 34px; }
.stat { padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 2px; }
.stat strong { font-size: 28px; font-weight: 900; font-style: italic; font-stretch: 115%; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13px; }

.section { margin-bottom: 34px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }

/* ============================================================ grade de projetos */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  height: 34px; padding: 0 14px; border-radius: 999px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  background: transparent; color: var(--muted); border: 1px solid var(--line);
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip[aria-selected="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.search { position: relative; display: flex; align-items: center; width: min(280px, 100%); }
.search .icon { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 36px; height: 38px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.project-card {
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface);
  transition: border-color 0.2s, transform 0.2s;
}
.project-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.thumb { aspect-ratio: 16 / 10; background: #000; overflow: hidden; position: relative; }
.thumb video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.thumb.placeholder { display: grid; place-items: center; color: var(--faint); background: var(--surface-2); }
.thumb.placeholder.kind-cuts { color: var(--kind-cuts); background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--kind-cuts) 18%, transparent), var(--surface-2) 70%); }
.thumb.placeholder.kind-edit { color: var(--kind-edit); background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--kind-edit) 18%, transparent), var(--surface-2) 70%); }
.thumb.placeholder.kind-animation { color: var(--kind-animation); background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--kind-animation) 18%, transparent), var(--surface-2) 70%); }
.project-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.project-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.project-title { font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.project-meta { color: var(--muted); font-size: 13px; }
.project-body .bar { margin-top: 4px; }

.empty {
  grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
  padding: 48px 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface);
}
.empty-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); margin-bottom: 6px; }
.empty p { max-width: 420px; margin-bottom: 8px; }

/* ============================================================ criação */
.create-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  min-height: 190px; padding: 24px; border-radius: var(--radius); cursor: pointer;
  border: 1.5px dashed var(--line-strong); background: var(--surface-2);
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.busy { cursor: progress; border-style: solid; }
.drop-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-3); color: var(--accent); margin-bottom: 4px; }
.dropzone .bar { width: min(320px, 100%); margin-top: 8px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 13px; margin: 16px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.url-row { display: flex; gap: 8px; position: relative; }
.url-row .input-icon { position: absolute; left: 12px; top: 12px; color: var(--muted); pointer-events: none; }
.url-row input { padding-left: 36px; height: 42px; }
.url-row .btn { height: 42px; }

.segmented { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); margin-bottom: 18px; max-width: 100%; overflow-x: auto; }
.segmented button {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 9px; border: 0;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); background: transparent; cursor: pointer; white-space: nowrap;
}
.segmented button:hover { color: var(--text); }
.segmented button[aria-selected="true"] { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); }
.segmented.small { margin-bottom: 18px; }
.segmented.small button { height: 32px; font-size: 13px; }
.pane { display: flex; flex-direction: column; gap: 12px; }
.pane-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pane textarea { font-family: var(--mono); font-size: 13.5px; min-height: 260px; }
.pane .toggle { align-self: flex-start; }

.tips { font-size: 14px; color: var(--muted); }
.tips summary { cursor: pointer; color: var(--text); font-weight: 600; font-size: 14px; }
.tips ul { margin: 10px 0 0; padding-left: 20px; line-height: 1.8; }
.tips pre { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; font-size: 13px; color: var(--text); margin: 10px 0 0; }

/* ============================================================ projeto */
.status-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: -10px 0 18px; }
.stats-text { font-size: 14px; color: var(--muted); }
.status-line .stats-text { color: var(--ok); font-weight: 500; }

.stepper { list-style: none; margin: 0 0 22px; padding: 16px 18px; display: flex; gap: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow-x: auto; }
.stepper li { display: flex; align-items: center; gap: 8px; flex: 1; min-width: max-content; color: var(--faint); font-size: 13px; font-weight: 600; }
.stepper li:not(:last-child)::after { content: ""; flex: 1; min-width: 16px; height: 2px; background: var(--line); border-radius: 2px; }
.stepper li.done { color: var(--muted); }
.stepper li.done::after { background: var(--ok); }
.stepper li.current { color: var(--text); }
.step-dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--surface-3); flex: none; }
.stepper li.done .step-dot { background: var(--ok-soft); color: var(--ok); }
.stepper li.current .step-dot { background: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.step-label small { color: var(--accent); font-weight: 700; }

.alert {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin-bottom: 18px;
  border-radius: var(--radius-sm); background: var(--bad-soft); border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); color: var(--text);
}
.alert .icon { color: var(--bad); margin-top: 2px; }
.alert p { color: var(--muted); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.alert.small { padding: 10px 12px; font-size: 13px; margin: 8px 0; }

.output { display: grid; grid-template-columns: minmax(260px, 420px) minmax(0, 1fr); gap: 20px; align-items: start; }
.output-media { position: sticky; top: 24px; }
.player { background: #000; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 16 / 9; }
.player.vertical { aspect-ratio: 9 / 16; max-height: 78vh; margin: 0 auto; }
.player.square { aspect-ratio: 1; max-height: 78vh; margin: 0 auto; }
.player video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
.player-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); text-align: center; padding: 20px; font-size: 14px; background: var(--surface-2); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line-strong); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }

.panel-title { margin: 22px 0 12px; font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.scenes { display: flex; flex-direction: column; gap: 10px; }
.scene { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; background: var(--surface-2); }
.scene-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.scene-num { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); font-size: 12px; font-weight: 700; color: var(--muted); flex: none; }
.scene-head select { width: auto; flex: 1 1 auto; min-width: 0; max-width: 220px; height: 36px; padding-top: 6px; padding-bottom: 6px; }
.scene-tools { display: flex; gap: 4px; margin-left: auto; flex: none; }
.scene-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.scene-fields .f-title, .scene-fields .f-items { grid-column: 1 / -1; }
.add-scene { margin-top: 10px; align-self: flex-start; }

.channels { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; }
.channel {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface-2); font-size: 14px;
}
.channel:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.channel input { width: 16px; height: 16px; margin: 0 2px 0 6px; }
.channel img, .channel-fallback { width: 24px; height: 24px; border-radius: 50%; flex: none; }
.channel-fallback { display: grid; place-items: center; background: var(--surface-3); font-weight: 700; font-size: 12px; }
.channel small { color: var(--muted); }
.panel > .field { margin-bottom: 14px; }
.scheduled-box { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--info-soft); color: var(--info); }
.scheduled-box strong { color: var(--text); }

/* cortes */
.clips { display: flex; flex-direction: column; gap: 16px; }
.clip { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; padding: 18px; }
.clip.rejected { opacity: 0.55; }
.clip .player.vertical { max-height: 430px; }
.clip-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 10px; }
.score {
  width: 48px; height: 48px; border-radius: 12px; flex: none; display: grid; place-items: center;
  font-size: 18px; font-weight: 800; color: var(--kind-cuts); background: color-mix(in srgb, var(--kind-cuts) 14%, transparent);
}
.clip-title { font-size: 16px; overflow-wrap: anywhere; }
.clip-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; font-size: 13px; }
.reason { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.publish { border-top: 1px solid var(--line); padding-top: 4px; margin-top: 8px; }
.publish .panel-title { margin-top: 14px; }
.publish-row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.publish-row .field { flex: 1 1 200px; }
.clip-edit { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.clip-edit summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); }
.clip-edit summary:hover { color: var(--text); }
.clip-edit[open] summary { color: var(--text); margin-bottom: 12px; }
.clip-form { display: flex; flex-direction: column; gap: 12px; }


/* ============================================================ tema e prévia */
.theme-picker { display: grid; grid-template-columns: repeat(4, minmax(0, 128px)); gap: 10px; }
.theme-option { position: relative; display: flex; flex-direction: column; gap: 6px; cursor: pointer; min-width: 0; }
.theme-option input { position: absolute; opacity: 0; pointer-events: none; }
.theme-swatch {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  aspect-ratio: 4 / 5; padding: 14% 6% 12%; border-radius: var(--radius-sm); overflow: hidden;
  border: 2px solid var(--line); transition: border-color 0.15s, transform 0.15s;
}
.theme-option:hover .theme-swatch { border-color: var(--line-strong); }
.theme-option input:checked + .theme-swatch { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.theme-option input:focus-visible + .theme-swatch { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-option input:checked + .theme-swatch::after {
  content: ""; position: absolute; top: 6px; right: 6px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-11'/%3E%3C/svg%3E") center / 10px no-repeat;
}
.sw-stat {
  font: 800 clamp(15px, 2.2vw, 22px)/1 Montserrat, var(--font); letter-spacing: -0.03em;
  padding: 4px 8px; border-radius: 8px; border: 1px solid transparent;
}
.sw-caption { display: flex; gap: 3px; align-items: center; font: 900 clamp(8px, 1vw, 11px)/1 Montserrat, var(--font); text-transform: uppercase; color: #fff; }
.sw-caption > span:first-child { -webkit-text-stroke: 2px rgba(0, 0, 0, 0.85); paint-order: stroke; }
.sw-pill { padding: 2px 4px; border-radius: 4px; transform: rotate(-2deg); }
.theme-name { font-size: 13px; font-weight: 600; text-align: center; color: var(--muted); }
.theme-option input:checked ~ .theme-name { color: var(--text); }

.preview { margin-top: 16px; }
.preview-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.preview-frame {
  position: relative; margin-top: 12px; border-radius: var(--radius-sm); overflow: hidden; background: #000;
  border: 1px solid var(--line); min-height: 160px; display: grid; place-items: center;
}
.preview-frame img { display: block; max-width: 100%; max-height: 460px; }
.preview-frame img:not([src]) { display: none; }
.preview-loading {
  position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: rgba(14, 13, 11, 0.6); color: var(--text); font-size: 14px;
}
.preview-frame.loading .preview-loading { display: flex; }

.cuts-visual { padding: 0; margin-bottom: 16px; }
.cuts-visual summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 16px 18px; cursor: pointer; font-weight: 600; }
.cuts-visual summary .hint { font-weight: 400; }
.cuts-visual summary .icon { color: var(--kind-cuts); }
.cuts-visual[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.cuts-visual > :not(summary) { margin-left: 18px; margin-right: 18px; }
.cuts-visual > .actions { margin-bottom: 18px; }
/* ============================================================ agenda */
.agenda { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.agenda-item {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--line); transition: border-color 0.15s;
}
.agenda-item:hover { border-color: var(--line-strong); }
.agenda-item > .icon { color: var(--faint); margin-left: auto; }
.agenda-time { display: flex; flex-direction: column; min-width: 54px; }
.agenda-time strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.agenda-time small { color: var(--muted); font-size: 12px; }
.agenda-kind { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.agenda-kind.kind-cuts { color: var(--kind-cuts); background: color-mix(in srgb, var(--kind-cuts) 14%, transparent); }
.agenda-kind.kind-edit { color: var(--kind-edit); background: color-mix(in srgb, var(--kind-edit) 14%, transparent); }
.agenda-kind.kind-animation { color: var(--kind-animation); background: color-mix(in srgb, var(--kind-animation) 14%, transparent); }
.agenda-text { display: flex; flex-direction: column; min-width: 0; }
.agenda-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-days { display: flex; flex-direction: column; gap: 26px; }
.agenda-day h2 { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.agenda-day h2::first-letter { text-transform: uppercase; }
.past { margin-top: 30px; }
.past summary { cursor: pointer; color: var(--muted); font-weight: 600; margin-bottom: 10px; }

/* ============================================================ toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px;
  background: var(--surface-3); border: 1px solid var(--line-strong); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  font-size: 14px; animation: toast-in 0.2s ease-out;
}
.toast .icon { margin-top: 2px; }
.toast.success .icon { color: var(--ok); }
.toast.error { border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.toast.error .icon { color: var(--bad); }
.toast.info .icon { color: var(--info); }
.toast.leaving { opacity: 0; transform: translateY(6px); transition: all 0.35s; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: 0.35; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ============================================================ responsivo */
@media (max-width: 1100px) {
  .tools { grid-template-columns: minmax(0, 1fr); }
  .tool-card { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .tool-card h2 { flex: 1; }
  .tool-card p { flex-basis: 100%; order: 3; }
  .create-layout { grid-template-columns: minmax(0, 1fr); }
  .output { grid-template-columns: 1fr; }
  .output-media { position: static; max-width: 420px; width: 100%; margin: 0 auto; }
}

@media (max-width: 860px) {
  :root { --sidebar: 0px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .main { padding: 20px 16px calc(96px + env(safe-area-inset-bottom)); }
  .sidebar {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 40;
    flex-direction: row; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px);
  }
  .sidebar .brand, .sidebar-status { display: none; }
  .nav { flex-direction: row; width: 100%; gap: 0; }
  .nav-item { flex: 1; flex-direction: column; gap: 3px; padding: 8px 2px; font-size: 11px; text-align: center; position: relative; }
  .nav-item.active { background: transparent; color: var(--accent); }
  .nav-label { flex: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .nav-badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
  h1 { font-size: 25px; }
  .page-icon { width: 38px; height: 38px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .clip { grid-template-columns: 1fr; }
  .clip .player.vertical { max-width: 280px; width: 100%; }
  .scene-fields { grid-template-columns: 1fr; }
  .search { width: 100%; }
  .toasts { bottom: calc(80px + env(safe-area-inset-bottom)); right: 16px; left: 16px; max-width: none; }
  .url-row { flex-wrap: wrap; }
  .url-row .btn { width: 100%; }
  .card { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ============================================================ marca Kort */
.toggle input:checked + .switch::after { background: var(--on-accent); }
.tool-card h2, .empty h3, .section-head h2 { font-weight: 900; font-style: italic; font-stretch: 112%; letter-spacing: -0.02em; }
.tool-card h2 { font-size: 21px; }
.score, .stepper small, .clip-meta .mono, .project-meta, .dropzone .muted { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.score { font-size: 16px; font-weight: 600; }
.project-meta { font-size: 12px; }
.slogan { margin-top: 6px; font-weight: 800; font-style: italic; font-stretch: 112%; font-size: 17px; color: var(--accent); }
.busy-line { margin: -6px 0 18px; color: var(--muted); font-size: 15px; }
.busy-line .mono { color: var(--text); margin-left: 4px; }
.done-line { color: var(--text); font-weight: 700; }
.alert details { margin-top: 6px; font-size: 13px; color: var(--muted); }
.alert summary { cursor: pointer; }
.alert details p { margin-top: 6px; font-family: var(--mono); font-size: 12px; }

/* ============================================================ login */
.auth-page { min-height: 100vh; }
.auth { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); min-height: 100vh; }
.auth-brand {
  background: var(--accent); color: var(--on-accent); padding: clamp(28px, 5vw, 64px);
  display: flex; flex-direction: column; justify-content: center; gap: 18px; position: relative; overflow: hidden;
}
.auth-brand-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; font-weight: 600; position: absolute; top: clamp(20px, 4vw, 40px); left: clamp(28px, 5vw, 64px); right: clamp(28px, 5vw, 64px); }
.auth-brand-top img { border-radius: 10px; box-shadow: 0 0 0 2px var(--on-accent); }
.auth-wm { font-size: clamp(72px, 9.5vw, 170px); align-self: flex-start; }
.auth-slogan { font-weight: 900; font-style: italic; font-stretch: 112%; font-size: clamp(22px, 2.6vw, 34px); line-height: 1.05; letter-spacing: -0.02em; }
.auth-sub { font-size: 16px; opacity: 0.75; max-width: 36ch; }
.auth-track { position: relative; display: flex; height: 30px; margin-top: 14px; border: 2px solid var(--on-accent); border-radius: 6px; overflow: hidden; max-width: 520px; }
.auth-track i { flex: var(--w); border-right: 2px solid var(--on-accent); }
.auth-track i:last-of-type { border-right: 0; }
.auth-track .keep { background: var(--on-accent); }
.auth-track .drop { background: repeating-linear-gradient(-45deg, transparent 0 5px, rgba(14, 13, 11, 0.35) 5px 7px); }
.auth-playhead { position: absolute; top: -2px; bottom: -2px; left: 63%; width: 3px; background: var(--kind-animation); }
@media (prefers-reduced-motion: no-preference) {
  .auth-playhead { animation: scrub 7s linear infinite; }
  @keyframes scrub { from { left: 0%; } to { left: 100%; } }
}

.auth-main { display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-loading { display: grid; place-items: center; min-height: 200px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form h1 { font-size: 36px; }
.auth-lead { margin-top: -6px; font-size: 15px; }
.auth-submit { height: 46px; font-size: 15px; margin-top: 4px; }
.auth-error { color: var(--bad); font-size: 14px; background: var(--bad-soft); padding: 10px 12px; border-radius: var(--radius-sm); }
.auth-footer { text-align: center; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 84px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  height: 30px; padding: 0 10px; border: 0; border-radius: 8px; background: var(--surface-2); color: var(--muted);
  font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
.pw-toggle:hover { color: var(--text); }
input[readonly] { color: var(--muted); background: var(--surface); }

@media (max-width: 860px) {
  .auth { grid-template-columns: minmax(0, 1fr); min-height: auto; }
  .auth-brand { padding: 72px 20px 24px; gap: 10px; }
  .auth-brand-top { left: 20px; right: 20px; top: 20px; }
  .auth-wm { font-size: clamp(64px, 22vw, 110px); }
  .auth-track { display: none; }
  .auth-main { place-items: start center; padding: 28px 16px 40px; }
}

/* ============================================================ conta e admin */
.account { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.account-box { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.account-box:hover { border-color: var(--line-strong); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-weight: 900; font-style: italic; font-size: 14px;
}
.account-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.account-text strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-text small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-status { margin-top: 0; }

.settings { display: grid; gap: 16px; max-width: 760px; }
.settings .card h2 { margin-bottom: 14px; }
.settings .actions { margin-top: 14px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 12px 10px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table td.num { font-family: var(--mono); color: var(--muted); }
.table .who strong { display: block; }
.table .who small { color: var(--muted); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.row-actions .btn { height: 32px; padding: 0 10px; font-size: 13px; }
.role-tag { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 3px 7px; border-radius: 6px; background: var(--surface-3); color: var(--muted); }
.role-tag.admin { background: var(--accent-soft); color: var(--accent); }
.role-tag.off { background: var(--bad-soft); color: var(--bad); }
.invite-form { display: grid; grid-template-columns: minmax(0, 1fr) 160px auto; gap: 10px; align-items: end; }
.link-box { display: flex; gap: 8px; margin-top: 14px; padding: 12px; border-radius: var(--radius-sm); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); flex-wrap: wrap; align-items: center; }
.link-box input { flex: 1 1 260px; font-family: var(--mono); font-size: 12px; background: var(--bg); }
.link-box p { flex-basis: 100%; font-size: 13px; color: var(--muted); }
@media (max-width: 860px) {
  .invite-form { grid-template-columns: minmax(0, 1fr); }
  .account { display: none; }
}
.settings.wide { max-width: 1000px; }
.mobile-only { display: none; }
@media (max-width: 860px) { .mobile-only { display: inline-flex; } }

/* ============================================================ completo */
.tool-card.kind-full { --kc: var(--text); }
.kind-tag.kind-full .icon, .agenda-kind.kind-full { color: var(--text); }
.thumb.placeholder.kind-full { color: var(--text); background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--accent) 14%, transparent), var(--surface-2) 70%); }
.pipeline { margin: 20px 0 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 10px; }
.pipeline li { counter-increment: step; display: flex; gap: 10px; align-items: baseline; color: var(--muted); font-size: 14px; }
.pipeline li::before { content: counter(step); flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 800; }
.pipeline strong { color: var(--text); }
.clips-head { margin-top: 28px; }

/* ============================================================ modelos de layout */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.tpl-card { display: flex; flex-direction: column; gap: 10px; padding: 10px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.tpl-card:hover { border-color: var(--line-strong); }
.tpl-thumb { display: flex; justify-content: center; }
.tpl-editor { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.tpl-form { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tpl-form .card { display: flex; flex-direction: column; gap: 14px; }
.tpl-side { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.tpl-frame { position: relative; overflow: hidden; border-radius: 14px; border: 1px solid var(--line); flex: none; }
.tpl-brand { position: absolute; left: 0; right: 0; display: flex; justify-content: center; align-items: center; font-family: "Montserrat", sans-serif; font-weight: 800; }
.tpl-title { position: absolute; display: flex; align-items: center; justify-content: center; text-align: center; line-height: 1.08; overflow: hidden; }
.tpl-video { position: absolute; display: grid; place-items: center; overflow: hidden; color: rgba(255, 255, 255, 0.55);
  background: linear-gradient(135deg, #3d6b4a 0%, #6b8f5a 35%, #c4b98a 70%, #7a9cc0 100%); }
.tpl-video.contain { background: radial-gradient(circle at 50% 50%, #6b8f5a 0 38%, #2a3a30 60%); }
.tpl-captions { position: absolute; left: 0; right: 0; display: flex; justify-content: center; gap: 0.2em; font-family: "Montserrat", sans-serif; font-weight: 900; color: #fff; text-transform: uppercase; }
.tpl-captions span { -webkit-text-stroke: 0.04em #000; paint-order: stroke; }
.tpl-captions .pill { background: var(--accent); color: var(--on-accent); -webkit-text-stroke: 0; padding: 0 0.15em; border-radius: 0.18em; }
.range-row { display: flex; align-items: center; gap: 10px; }
.range-row input { flex: 1; }
.range-value { font-family: var(--mono); font-size: 12px; color: var(--muted); min-width: 40px; text-align: right; }
input[type="color"] { height: 40px; padding: 4px; cursor: pointer; }
.logo-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hint.link { display: inline-block; margin-top: 6px; color: var(--accent); }
@media (max-width: 960px) {
  .tpl-editor { grid-template-columns: minmax(0, 1fr); }
  .tpl-side { position: static; order: -1; }
}
@media (max-width: 860px) {
  .nav-item { font-size: 10px; }
}

/* ---------------------------------------------------------------- vozes e áudio (VoiceStudio) */
:root { --kind-audio: #9B8CFF; }
.tool-card.kind-audio { --kc: var(--kind-audio); }
.voice-row { display: flex; gap: 8px; margin-top: 6px; }
.voice-row select { flex: 1; min-width: 0; }
.voice-row .btn { flex: none; }
.voice-fields .hint.link { display: inline-block; margin-top: 6px; }
.voice-title { margin-top: 22px; }
.text-foot { display: flex; justify-content: space-between; gap: 10px; margin: 6px 0 14px; flex-wrap: wrap; }
.narrate { display: flex; flex-direction: column; gap: 12px; margin: 14px 0; }
.narrate-fields { display: flex; flex-direction: column; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.narrate-fields[hidden] { display: none; }
.narration-edit { display: flex; flex-direction: column; gap: 14px; }
.voice-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.voice-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.voice-item > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.voice-item .hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-item .icon-btn { color: var(--kind-audio); flex: none; }
.voice-item .icon-btn.loading { opacity: 0.6; }
.voices-box .panel-title:first-child { margin-top: 0; }
.clone-tips { margin-top: 20px; }
.clone-tips summary { display: inline-flex; align-items: center; gap: 6px; }
.clone-tips summary .icon { color: var(--kind-audio); }
.clone-tips > p { margin: 10px 0 14px; }
.clone-form { display: flex; flex-direction: column; gap: 14px; }
.consent { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--text); cursor: pointer; }
.consent input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.audio-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 14px; }
.audio-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.audio-top { display: flex; align-items: flex-start; gap: 12px; }
.audio-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; color: var(--kind-audio); background: color-mix(in srgb, var(--kind-audio) 14%, transparent); }
.audio-head { flex: 1; min-width: 0; }
.audio-head h3 { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audio-card audio { width: 100%; height: 40px; }
.audio-card .row-actions { justify-content: flex-start; }
.audio-busy .busy-line { margin: 0 0 8px; font-size: 14px; }
/* ============================================================ movimento e navegação */
:root {
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.3, 1.35, 0.5, 1);
  interpolate-size: allow-keywords;
}
.content { min-width: 0; display: flex; flex-direction: column; }

/* Barra de carregamento no topo */
.loadbar { position: fixed; top: 0; left: 0; z-index: 100; height: 3px; width: 0; opacity: 0; pointer-events: none;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover)); box-shadow: 0 0 12px rgba(255, 212, 0, 0.6); border-radius: 0 3px 3px 0; }
.loadbar.on { opacity: 1; width: 75%; transition: width 6s cubic-bezier(0.05, 0.7, 0.1, 1); }
.loadbar.on.done { width: 100%; opacity: 0; transition: width 0.2s ease, opacity 0.3s 0.15s; }

/* Entrada de tela: o conteúdo sobe um pouco e aparece, em cascata */
.main > * { animation: page-in 0.38s var(--ease-out) backwards; }
.main > *:nth-child(2) { animation-delay: 40ms; }
.main > *:nth-child(3) { animation-delay: 80ms; }
.main > *:nth-child(n + 4) { animation-delay: 110ms; }
.home > *, .list-view > *, .project-view > *, .settings > *, .tpl-form > *, .create-layout > * { animation: page-in 0.42s var(--ease-out) backwards; }
.home > *:nth-child(2), .list-view > *:nth-child(2), .create-layout > *:nth-child(2), .settings > *:nth-child(2), .tpl-form > *:nth-child(2) { animation-delay: 50ms; }
.home > *:nth-child(3), .list-view > *:nth-child(3), .settings > *:nth-child(3), .tpl-form > *:nth-child(3) { animation-delay: 100ms; }
.home > *:nth-child(n + 4), .list-view > *:nth-child(n + 4), .tpl-form > *:nth-child(n + 4) { animation-delay: 150ms; }
.tool-card { animation: rise 0.5s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 55ms + 60ms); }
.stat { animation: rise 0.45s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 45ms + 140ms); }
.pop-in { animation: rise 0.42s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 40ms); }
.tab-in { animation: fade-in 0.25s var(--ease-out); }
@keyframes page-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(0.98); } }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } }

/* Sidebar: Novo, Buscar e o fundo que desliza até o item ativo */
.sidebar-actions { display: flex; flex-direction: column; gap: 8px; margin-top: -8px; }
.new-btn { width: 100%; height: 42px; }
.search-trigger {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 38px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); color: var(--muted);
  font: inherit; font-size: 13.5px; cursor: pointer; transition: border-color 0.15s, color 0.15s;
}
.search-trigger:hover { border-color: var(--line-strong); color: var(--text); }
kbd {
  display: inline-flex; align-items: center; gap: 2px; font-family: var(--mono); font-size: 11px; line-height: 1;
  padding: 3px 5px; border-radius: 5px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--muted);
}
.search-trigger kbd { margin-left: auto; }
.nav { position: relative; }
.nav-item { position: relative; z-index: 1; }
.nav-item.active, .nav-item.active:hover { background: transparent; }
.nav-item .icon { transition: transform 0.25s var(--ease-spring), color 0.15s; }
.nav-item:hover .icon { transform: scale(1.1); }
.nav-item.active .icon { transform: none; }
.nav-indicator {
  position: absolute; top: 0; left: 0; z-index: 0; border-radius: var(--radius-sm); pointer-events: none;
  background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(255, 212, 0, 0.18);
}
.nav-indicator.ready { transition: transform 0.38s var(--ease-spring), width 0.3s var(--ease-out), height 0.3s var(--ease-out), opacity 0.2s; }
.nav-section { margin: 12px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.nav-create { display: none; }
.nav-badge:not([hidden]) { animation: badge-in 0.35s var(--ease-spring); }
@keyframes badge-in { from { transform: scale(0); } }

/* Topo no celular */
.topbar { display: none; }

/* Botões e cartões com mais resposta ao toque */
.btn { transition: background 0.15s, border-color 0.15s, opacity 0.15s, transform 0.15s var(--ease-spring), box-shadow 0.2s; }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn.primary:hover:not(:disabled) { box-shadow: 0 8px 26px rgba(255, 212, 0, 0.3); }
.icon-btn { transition: color 0.15s, border-color 0.15s, transform 0.15s var(--ease-spring); }
.icon-btn:active { transform: scale(0.92); }
.chip { transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s var(--ease-spring); display: inline-flex; align-items: center; gap: 6px; }
.chip:active { transform: scale(0.95); }
.chip-count { font-family: var(--mono); font-size: 11px; opacity: 0.7; }
.chip-count:empty { display: none; }
.kinds-row { margin-bottom: 10px; }

.tool-card { transition: border-color 0.25s, transform 0.3s var(--ease-spring), box-shadow 0.3s; }
.tool-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35); }
.tool-card::before { transition: transform 0.5s var(--ease-out); }
.tool-card:hover::before { transform: scale(1.25); }
.tool-icon { transition: transform 0.35s var(--ease-spring); }
.tool-card:hover .tool-icon { transform: rotate(-8deg) scale(1.08); }
.tool-cta .icon { transition: transform 0.25s var(--ease-spring); }
.tool-card:hover .tool-cta .icon { transform: translateX(4px); }
.stat { transition: border-color 0.2s, transform 0.25s var(--ease-spring); }
.stat:hover { border-color: var(--line-strong); transform: translateY(-2px); }

.project-card { transition: border-color 0.2s, transform 0.3s var(--ease-spring), box-shadow 0.3s; }
.project-card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(0, 0, 0, 0.35); }
.project-card:active { transform: scale(0.985); }
.thumb video { transition: transform 0.5s var(--ease-out); }
.project-card:hover .thumb video { transform: scale(1.04); }
.thumb-play {
  position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; color: #fff;
  background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(6px); opacity: 0; transform: translateY(4px);
  transition: opacity 0.2s, transform 0.2s var(--ease-out);
}
.project-card:hover .thumb-play { opacity: 1; transform: none; }
.project-card.playing .thumb-play { opacity: 0; }
.project-card.flash { animation: flash 1.4s var(--ease-out); }
@keyframes flash { 0% { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); } }

/* Barras de progresso "vivas" enquanto processa */
.bar.live span {
  background: var(--accent) linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.55) 50%, transparent 100%) no-repeat;
  background-size: 50% 100%; animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer { from { background-position: -100% 0; } to { background-position: 200% 0; } }
.busy { margin: -6px 0 18px; }
.busy .busy-line { margin: 0 0 10px; }
.busy-bar { height: 6px; max-width: 520px; }
.stepper li.current .step-dot { animation: ring 1.8s ease-out infinite; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(255, 212, 0, 0.45); } 100% { box-shadow: 0 0 0 10px rgba(255, 212, 0, 0); } }
.stepper li.done .step-dot .icon { animation: badge-in 0.35s var(--ease-spring); }
.status-line.bump .pill { animation: bump 0.5s var(--ease-spring); }
@keyframes bump { 40% { transform: scale(1.14); } }
.confetti { position: fixed; z-index: 120; width: 7px; height: 11px; border-radius: 2px; pointer-events: none; }

/* Abas com fundo que desliza */
.segmented { position: relative; }
.segmented button { position: relative; z-index: 1; transition: color 0.2s; }
.seg-ind { position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 9px; background: var(--surface-3); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); }
.seg-ind.ready { transition: transform 0.35s var(--ease-spring), width 0.3s var(--ease-out); }
.segmented:has(.seg-ind) button[aria-selected="true"] { background: transparent; box-shadow: none; }

/* Blocos que abrem e fecham deslizando */
details::details-content {
  height: 0; overflow: clip; overflow-clip-margin: 8px;
  transition: height 0.32s var(--ease-out), content-visibility 0.32s allow-discrete;
}
details[open]::details-content { height: auto; }

/* Esqueleto */
.sk {
  display: block; height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%) 0 0 / 400% 100%;
  animation: sk 1.4s ease infinite;
}
@keyframes sk { from { background-position: 100% 0; } to { background-position: 0 0; } }
.sk.w20 { width: 20%; } .sk.w30 { width: 30%; } .sk.w40 { width: 40%; } .sk.w60 { width: 60%; } .sk.w90 { width: 90%; }
.sk.h16 { height: 16px; } .sk.h28 { height: 28px; }
.sk.sq { width: 44px; height: 44px; border-radius: 12px; flex: none; }
.sk.row { height: 58px; border-radius: var(--radius-sm); }
.sk.player-sk { aspect-ratio: 9 / 16; height: auto; max-height: 70vh; border-radius: var(--radius); }
.sk.panel-sk { height: 360px; border-radius: var(--radius); }
.skel-card { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); animation: fade-in 0.3s backwards; animation-delay: calc(var(--i, 0) * 50ms); }
.skel-card .thumb.sk { border-radius: 0; height: auto; }
.skel-card .project-body { gap: 10px; }
.skel-rows { display: flex; flex-direction: column; gap: 8px; }
.skel-project { display: flex; flex-direction: column; gap: 16px; }
.skel-head { display: flex; gap: 14px; align-items: center; }
.skel-col { flex: 1; display: flex; flex-direction: column; gap: 8px; }

/* Avisos */
.toast { align-items: center; animation: toast-in 0.35s var(--ease-spring); }
.toast .icon { margin-top: 0; }
.toast-text { flex: 1; min-width: 0; }
.toast-action { font-weight: 700; color: var(--accent); padding: 4px 8px; border-radius: 8px; white-space: nowrap; }
.toast-action:hover { background: var(--accent-soft); }
.toast-close { display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; flex: none; }
.toast-close:hover { background: var(--surface-2); color: var(--text); }
.toast.leaving { opacity: 0; transform: translateX(24px) scale(0.96); transition: opacity 0.25s, transform 0.25s var(--ease-out); }
@keyframes toast-in { from { opacity: 0; transform: translateX(28px) scale(0.95); } }

/* Janelas: busca rápida e criar */
dialog { padding: 0; border: 0; background: transparent; color: var(--text); max-width: none; max-height: none; }
dialog::backdrop { background: rgba(8, 7, 6, 0.6); backdrop-filter: blur(5px); }
dialog[open] { animation: pop 0.22s var(--ease-out); }
dialog[open]::backdrop { animation: fade 0.22s ease; }
dialog.closing { animation: pop-out 0.17s ease forwards; }
dialog.closing::backdrop { animation: fade-out 0.17s ease forwards; }
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(0.97); } }
@keyframes pop-out { to { opacity: 0; transform: translateY(-6px) scale(0.97); } }
@keyframes fade { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

.palette { margin: 12vh auto auto; width: min(640px, calc(100vw - 24px)); }
.palette-body { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55); overflow: hidden; display: flex; flex-direction: column; max-height: 70vh; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette-input input { border: 0; background: transparent; padding: 4px 0; font-size: 16px; box-shadow: none; }
.palette-input input:focus, .palette-input input:hover { box-shadow: none; border: 0; }
.palette-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; overscroll-behavior: contain; }
.palette-group { padding: 10px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; cursor: pointer; transition: background 0.1s; }
.palette-item[aria-selected="true"] { background: var(--surface-3); }
.palette-item[aria-selected="true"] .pi-icon { color: var(--accent); }
.pi-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--muted); transition: color 0.1s; }
.pi-icon.kind-cuts { color: var(--kind-cuts); }
.pi-icon.kind-edit { color: var(--kind-edit); }
.pi-icon.kind-animation { color: var(--kind-animation); }
.pi-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.pi-text strong { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pi-text small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-empty { padding: 26px; text-align: center; color: var(--muted); }
.palette-foot { display: flex; gap: 16px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.palette-foot span { display: inline-flex; align-items: center; gap: 4px; }

.sheet { margin: auto; width: min(560px, calc(100vw - 24px)); }
.sheet-body { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 20px; padding: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55); }
.sheet-handle { display: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-head h2 { font-size: 22px; font-weight: 900; font-style: italic; font-stretch: 112%; }
.sheet-grid { display: grid; gap: 8px; }
.sheet-tool {
  --kc: var(--accent);
  display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface-2);
  animation: rise 0.35s var(--ease-out) backwards; animation-delay: calc(var(--i) * 40ms + 40ms);
  transition: border-color 0.15s, transform 0.2s var(--ease-spring), background 0.15s;
}
.sheet-tool.kind-cuts { --kc: var(--kind-cuts); }
.sheet-tool.kind-edit { --kc: var(--kind-edit); }
.sheet-tool.kind-animation { --kc: var(--kind-animation); }
.sheet-tool.kind-full { --kc: var(--text); }
.sheet-tool:hover, .sheet-tool:focus-visible { border-color: color-mix(in srgb, var(--kc) 55%, var(--line)); background: var(--surface-3); transform: translateX(3px); }
.sheet-tool:active { transform: scale(0.98); }
.sheet-tool .tool-icon { width: 44px; height: 44px; flex: none; }
.sheet-tool-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.sheet-tool-text strong { font-size: 16px; font-weight: 800; }
.sheet-tool-text small { color: var(--muted); font-size: 13px; }
.sheet-tool > .icon { color: var(--faint); }
.sheet-extra { display: flex; align-items: center; gap: 8px; justify-content: center; margin-top: 12px; padding: 10px; border-radius: 12px; color: var(--muted); font-size: 14px; font-weight: 600; }
.sheet-extra:hover { color: var(--text); background: var(--surface-2); }

/* ============================================================ celular */
@media (max-width: 860px) {
  .sidebar-actions, .nav-tool, .nav-section, .hide-mobile { display: none !important; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    position: sticky; top: 0; z-index: 30; padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
    background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(14px);
    border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
    transition: transform 0.3s var(--ease-out);
  }
  .scrolled-down .topbar { transform: translateY(-100%); }
  .topbar .brand { padding: 0; gap: 8px; }
  .topbar .brand-mark { width: 26px; height: 26px; }
  .topbar .brand-name { font-size: 20px; }
  .topbar-actions { display: flex; align-items: center; gap: 10px; }
  .topbar-btn { width: 38px; height: 38px; border-radius: 12px; }
  .topbar-account .avatar { width: 34px; height: 34px; }
  .main { padding-top: 18px; }

  .nav { justify-content: space-around; }
  .nav-item { font-size: 11px; }
  .nav-item.active:not(.m-active) { color: var(--muted); }
  .nav-item.active:not(.m-active) .icon { color: inherit; }
  .nav-item.m-active { color: var(--accent); }
  .nav-item.m-active .icon { color: var(--accent); transform: translateY(-1px); }
  .nav-indicator { top: -6px; background: var(--accent); border-radius: 0 0 4px 4px; box-shadow: 0 0 10px rgba(255, 212, 0, 0.6); }
  .nav-create { display: flex; background: transparent; border: 0; font: inherit; font-size: 11px; color: var(--muted); cursor: pointer; }
  .nav-create-icon {
    width: 48px; height: 48px; margin-top: -28px; border-radius: 16px; display: grid; place-items: center;
    background: var(--accent); color: var(--on-accent); box-shadow: 0 8px 22px rgba(255, 212, 0, 0.32), 0 0 0 4px var(--bg);
    transition: transform 0.25s var(--ease-spring);
  }
  .nav-create:active .nav-create-icon { transform: scale(0.9) rotate(90deg); }
  .nav-create.m-active { color: var(--accent); }
  .nav-item:hover { background: transparent; }

  .palette { margin-top: calc(10px + env(safe-area-inset-top)); }
  .palette-body { max-height: 78vh; }
  .sheet { margin: auto 0 0; width: 100%; }
  .sheet-body { border-radius: 22px 22px 0 0; border-bottom: 0; padding: 10px 16px calc(18px + env(safe-area-inset-bottom)); }
  .sheet-handle { display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: 0 auto 12px; }
  dialog.sheet[open] { animation: sheet-up 0.32s var(--ease-out); }
  dialog.sheet.closing { animation: sheet-down 0.2s ease forwards; }
  .toast.leaving { transform: translateY(16px) scale(0.96); }
}
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-down { to { transform: translateY(100%); } }

@media (prefers-reduced-motion: reduce) {
  details::details-content { transition: none; }
}

/* Filtros numa linha só no celular, deslizando pro lado */
@media (max-width: 860px) {
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; width: calc(100% + 32px); }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .kinds-row { margin-bottom: 4px; }
}

/* Áudio dentro da navegação nova */
.sheet-tool.kind-audio { --kc: var(--kind-audio); }
.pi-icon.kind-audio { color: var(--kind-audio); }
.audio-view > * { animation: page-in 0.42s var(--ease-out) backwards; }
.audio-view > *:nth-child(2) { animation-delay: 50ms; }
.audio-view > *:nth-child(n + 3) { animation-delay: 100ms; }

/* ============================================================ compilado */
:root { --kind-compilation: #FF7A45; }
.tool-card.kind-compilation, .sheet-tool.kind-compilation { --kc: var(--kind-compilation); }
.kind-tag.kind-compilation .icon, .pi-icon.kind-compilation { color: var(--kind-compilation); }
.agenda-kind.kind-compilation { color: var(--kind-compilation); background: color-mix(in srgb, var(--kind-compilation) 14%, transparent); }
.thumb.placeholder.kind-compilation { color: var(--kind-compilation); background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--kind-compilation) 18%, transparent), var(--surface-2) 70%); }

.comp-layout { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.comp-form { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.pick-hint { margin: -8px 0 14px; }
.pick-filters { margin-bottom: 14px; }
.pick-filters select { width: auto; max-width: 260px; }

/* Grade de cortes para escolher */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.pick-none { grid-column: 1 / -1; padding: 20px; text-align: center; }
.pick-tile {
  display: flex; flex-direction: column; gap: 8px; padding: 6px; text-align: left; cursor: pointer; font: inherit; color: inherit;
  border-radius: var(--radius); border: 1.5px solid var(--line); background: var(--surface-2);
  transition: border-color 0.15s, transform 0.25s var(--ease-spring), box-shadow 0.2s;
}
.pick-tile:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.pick-tile:active { transform: scale(0.97); }
.pick-tile.picked { border-color: var(--kind-compilation); box-shadow: 0 0 0 3px color-mix(in srgb, var(--kind-compilation) 25%, transparent); }
.pick-media { position: relative; display: block; aspect-ratio: 9 / 16; border-radius: 10px; overflow: hidden; background: #000; }
.pick-media.fmt-horizontal { aspect-ratio: 16 / 9; }
.pick-media.fmt-square { aspect-ratio: 1; }
.pick-media video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.pick-check {
  position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.6); color: #fff; font-weight: 900; font-size: 13px; backdrop-filter: blur(6px);
  border: 1.5px solid rgba(255, 255, 255, 0.5); transition: transform 0.25s var(--ease-spring), background 0.15s;
}
.pick-tile.picked .pick-check { background: var(--kind-compilation); border-color: transparent; color: #140700; animation: badge-in 0.3s var(--ease-spring); }
.pick-dur { position: absolute; left: 6px; bottom: 6px; padding: 2px 6px; border-radius: 6px; font-size: 11px; color: #fff; background: rgba(0, 0, 0, 0.6); }
.pick-text { display: flex; flex-direction: column; gap: 2px; padding: 0 4px 4px; min-width: 0; }
.pick-text strong { font-size: 13px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pick-text small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Lista ordenada */
.comp-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.comp-empty { display: flex; align-items: center; gap: 12px; padding: 18px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius-sm); color: var(--muted); font-size: 14px; }
.comp-item {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 6px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2);
  animation: rise 0.3s var(--ease-out) backwards; transition: border-color 0.15s, opacity 0.15s, transform 0.15s;
}
.comp-item:hover { border-color: var(--line-strong); }
.comp-item.dragging { opacity: 0.4; transform: scale(0.98); }
.comp-item.drop-before::before, .comp-item.drop-after::after {
  content: ""; position: absolute; left: 6px; right: 6px; height: 3px; border-radius: 3px; background: var(--kind-compilation);
  box-shadow: 0 0 10px var(--kind-compilation);
}
.comp-item.drop-before::before { top: -6px; }
.comp-item.drop-after::after { bottom: -6px; }
.comp-item.missing { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.comp-grip { color: var(--faint); cursor: grab; display: grid; place-items: center; width: 18px; flex: none; }
.comp-grip:active { cursor: grabbing; }
.comp-rank {
  flex: none; min-width: 38px; height: 30px; padding: 0 6px; border-radius: 8px; display: grid; place-items: center;
  font-family: "Anton", var(--font); font-size: 17px; letter-spacing: 0.01em;
  background: color-mix(in srgb, var(--kind-compilation) 18%, transparent); color: var(--kind-compilation);
}
.comp-rank.plain { font-family: var(--mono); font-size: 13px; background: var(--surface-3); color: var(--muted); }
.comp-thumb { width: 42px; height: 64px; border-radius: 7px; object-fit: cover; background: #000; flex: none; }
.comp-thumb.placeholder { display: grid; place-items: center; color: var(--faint); background: var(--surface-3); }
.comp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.comp-label { height: 34px; padding: 6px 10px; font-weight: 600; }
.comp-missing { color: var(--bad); font-size: 14px; }
.comp-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; }
.comp-meta .hint { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.comp-len { color: var(--text); font-size: 12px; }
.comp-trim { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.comp-trim input { width: 62px; height: 28px; padding: 2px 6px; font-size: 12px; }
.comp-tools { display: flex; flex-direction: column; gap: 4px; flex: none; }
.comp-tools .icon-btn { width: 28px; height: 26px; }
.comp-total { margin-top: 10px; font-family: var(--mono); font-size: 12.5px; }
.comp-name { margin-top: 16px; }

/* Escolhas com desenho (numeração e apresentação) */
.choice-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.choice { position: relative; cursor: pointer; min-width: 0; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-box {
  display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 10px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); background: var(--surface-2); transition: border-color 0.15s, transform 0.2s var(--ease-spring);
}
.choice:hover .choice-box { border-color: var(--line-strong); }
.choice input:checked + .choice-box { border-color: var(--kind-compilation); box-shadow: 0 0 0 3px color-mix(in srgb, var(--kind-compilation) 22%, transparent); }
.choice input:focus-visible + .choice-box { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice-box strong { font-size: 14px; }
.choice-box small { font-size: 12px; color: var(--muted); line-height: 1.35; }
.ill { display: flex; align-items: center; justify-content: center; gap: 6px; height: 54px; margin-bottom: 4px; border-radius: 8px; background: var(--bg); overflow: hidden; }
.ill-rank b { font-family: "Anton", var(--font); font-weight: 400; font-size: 16px; color: var(--muted); }
.ill-rank b.hot { color: var(--kind-compilation); font-size: 22px; }
.ill-rank i { width: 18px; height: 6px; border-radius: 3px; background: var(--line-strong); }
.ill-frame { position: relative; width: 34px; height: 54px; margin: 0 auto 4px; border-radius: 6px; background: linear-gradient(160deg, #3d6b4a, #c4b98a 70%, #7a9cc0); }
.ill-badge { position: absolute; top: 5px; left: 4px; padding: 0 3px; border-radius: 3px; font-family: "Anton", var(--font); font-size: 9px; color: #140700; background: var(--kind-compilation); }
.ill-bar { position: absolute; top: 2px; left: 3px; right: 3px; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.7); }
.ill-card { background: radial-gradient(circle at 30% 20%, #3b1dff, #07070f 70%); display: grid; place-items: center; }
.ill-big { font-family: "Anton", var(--font); font-size: 15px; color: var(--kind-compilation); }
.choice input:checked + .choice-box .ill-rank b:not(.hot) { color: var(--text); }

.bookend { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.bookend .toggle { align-self: flex-start; }
.bookend-fields { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.4fr) minmax(90px, 0.6fr); }

.panel-title.first { margin-top: 0; }
.comp-preview { margin-top: 16px; }
.preview-at { display: flex; align-items: center; gap: 10px; }
.preview-at select { width: auto; min-width: 150px; }
.comp-preview .preview { margin-top: 10px; }

/* Janela "Adicionar cortes" */
.sheet.sheet-wide { width: min(880px, calc(100vw - 24px)); }
.sheet-scroll { max-height: 60vh; overflow-y: auto; margin: 0 -4px; padding: 0 4px 4px; overscroll-behavior: contain; }
.sheet-wide .actions { margin-top: 14px; }

@media (max-width: 1100px) {
  .comp-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .pick-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
  .choice-picker { grid-template-columns: minmax(0, 1fr); }
  .choice-box { flex-direction: row; align-items: center; flex-wrap: wrap; column-gap: 10px; }
  .choice-box .ill { width: 64px; height: 44px; margin: 0; flex: none; }
  .choice-box .ill-frame { width: 28px; height: 44px; margin: 0 18px; }
  .choice-box strong { flex: 1; }
  .choice-box small { flex-basis: 100%; }
  .bookend-fields { grid-template-columns: minmax(0, 1fr); }
  .comp-trim input { width: 54px; }
  .comp-meta .hint { max-width: 120px; }
  .sheet-scroll { max-height: 62vh; }
}
.comp-trims { display: inline-flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 860px) {
  .comp-grip { display: none; }
  .comp-item { padding-left: 8px; gap: 8px; align-items: flex-start; }
  .comp-rank { min-width: 32px; height: 26px; font-size: 15px; }
  .comp-thumb { width: 34px; height: 52px; }
  .comp-meta .hint { max-width: 100%; flex-basis: 100%; }
  .comp-trims { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
  .comp-trim { flex-direction: column; align-items: flex-start; gap: 3px; font-size: 11px; }
  .comp-trim input { width: 100%; }
}
