:root {
  color-scheme: dark;
  --bg: #0c0f12;
  --surface: #14191d;
  --surface-2: #1b2126;
  --surface-3: #222a30;
  --ink: #f7f4ee;
  --muted: #9aa4aa;
  --muted-2: #6e7980;
  --line: #2b343a;
  --line-strong: #3b464d;
  --accent: #ff6b35;
  --accent-hover: #ff8359;
  --teal: #21b89d;
  --lime: #c7f36b;
  --danger: #ff5b67;
  --warning: #f5b942;
  --shadow: 0 24px 70px rgba(0, 0, 0, .34);
  --sidebar: 244px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
img, video { max-width: 100%; }
.icon { width: 19px; height: 19px; stroke-width: 1.9; flex: 0 0 auto; }
.icon-sm { width: 16px; height: 16px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.boot-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 16px; color: var(--muted); }
.brand-mark { display: flex; align-items: end; gap: 4px; width: 34px; height: 34px; }
.brand-mark span { display: block; width: 8px; border-radius: 2px; background: var(--accent); animation: pulse-bars 1s ease-in-out infinite alternate; }
.brand-mark span:nth-child(1) { height: 17px; }
.brand-mark span:nth-child(2) { height: 30px; animation-delay: .15s; }
.brand-mark span:nth-child(3) { height: 23px; animation-delay: .3s; background: var(--teal); }
@keyframes pulse-bars { to { opacity: .38; transform: translateY(-2px); } }

.btn { min-height: 42px; border: 1px solid transparent; border-radius: 6px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-weight: 720; cursor: pointer; transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease; text-decoration: none; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .46; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); color: #1d100a; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface-2); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--line-strong); background: var(--surface-3); }
.btn-quiet { background: transparent; color: var(--muted); }
.btn-quiet:hover { color: var(--ink); background: var(--surface-2); }
.btn-danger { color: #ffb4ba; background: rgba(255, 91, 103, .1); border-color: rgba(255, 91, 103, .28); }
.btn-sm { min-height: 34px; padding: 0 11px; font-size: 13px; }
.icon-btn { width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); display: inline-grid; place-items: center; cursor: pointer; }
.icon-btn:hover { border-color: var(--line-strong); background: var(--surface-3); }

.field { display: grid; gap: 7px; }
.field label, .field-label { color: #cbd1d4; font-size: 13px; font-weight: 700; }
.input, .textarea, .select { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: #101519; color: var(--ink); outline: none; transition: border-color .18s ease, box-shadow .18s ease; }
.input, .select { height: 46px; padding: 0 13px; }
.textarea { min-height: 112px; padding: 12px 13px; line-height: 1.55; resize: vertical; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 107, 53, .12); }
.input::placeholder, .textarea::placeholder { color: #606b72; }
.field-hint { margin: 0; color: var(--muted-2); font-size: 12px; line-height: 1.45; }
.field-error { color: #ff9aa3; font-size: 12px; margin: 0; }
.form-grid { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
/* O aceite dos termos e obrigatorio para concluir o cadastro: errar o toque aqui
   trava a inscricao. A area sensivel cobre a linha inteira, e o quadrado sobe a
   20px com folga vertical para dar altura de dedo sem mexer no texto. */
.check-row { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; color: var(--muted); font-size: 13px; line-height: 1.45; cursor: pointer; }
.check-row input { width: 20px; height: 20px; flex: none; margin: 0; accent-color: var(--accent); }

.auth-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(390px, 520px) 1fr; }
.auth-panel { padding: clamp(28px, 6vw, 72px); display: flex; flex-direction: column; min-height: 100vh; background: var(--bg); }
.brand { display: inline-flex; align-items: center; gap: 12px; min-height: 40px; text-decoration: none; font-weight: 820; font-size: 21px; }
.brand .brand-mark { width: 25px; height: 25px; gap: 3px; }
.brand .brand-mark span { width: 6px; }
.brand .brand-mark span:nth-child(1) { height: 13px; }
.brand .brand-mark span:nth-child(2) { height: 23px; }
.brand .brand-mark span:nth-child(3) { height: 18px; }
.auth-card { width: min(100%, 410px); margin: auto 0; padding: 48px 0; }
.auth-card h1 { margin: 0 0 10px; font-size: clamp(28px, 4vw, 38px); line-height: 1.1; letter-spacing: 0; }
.auth-card > p { color: var(--muted); margin: 0 0 28px; line-height: 1.55; }
.auth-card .btn { width: 100%; margin-top: 4px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 4px; margin-bottom: 24px; }
.auth-tab { height: 37px; border: 0; background: transparent; border-radius: 5px; color: var(--muted); cursor: pointer; font-weight: 700; }
.auth-tab.active { background: var(--surface-3); color: var(--ink); }
.auth-link { border: 0; background: transparent; color: #f2a17f; padding: 0; cursor: pointer; text-align: left; font-weight: 650; }
.auth-footer { color: var(--muted-2); font-size: 12px; line-height: 1.55; margin-top: auto; }
.auth-footer a { color: var(--muted); }
.auth-visual { position: relative; min-height: 100vh; overflow: hidden; background: #11181b url('/assets/cenaflux-social.png') center/cover no-repeat; border-left: 1px solid var(--line); }
.auth-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(12,15,18,.22), transparent 42%), linear-gradient(0deg, rgba(12,15,18,.76), transparent 55%); }
.auth-visual-copy { position: absolute; z-index: 1; left: clamp(34px, 7vw, 92px); right: clamp(34px, 7vw, 92px); bottom: clamp(38px, 7vw, 86px); max-width: 580px; }
.auth-visual-copy strong { display: block; font-size: clamp(34px, 5vw, 68px); line-height: 1; max-width: 10ch; }
.auth-visual-copy p { color: #d9ddde; font-size: 17px; line-height: 1.5; max-width: 44ch; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line); background: #0e1215; padding: 22px 14px 16px; display: flex; flex-direction: column; z-index: 20; }
.sidebar-head { min-height: 46px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 0 2px 13px 10px; }
.sidebar-head .brand { min-width: 0; }
.sidebar-close { display: none; flex: 0 0 auto; width: 34px; height: 34px; }
.nav-label { color: var(--muted-2); font-size: 10px; font-weight: 800; text-transform: uppercase; margin: 18px 10px 7px; }
.nav-list { display: grid; gap: 4px; }
.nav-item { height: 43px; border: 1px solid transparent; border-radius: 6px; padding: 0 11px; display: flex; align-items: center; gap: 11px; color: var(--muted); background: transparent; cursor: pointer; text-align: left; font-weight: 680; }
.nav-item:hover { color: var(--ink); background: var(--surface); }
.nav-item.active { color: var(--ink); background: var(--surface-2); border-color: var(--line); }
.nav-item.active .icon { color: var(--accent); }
.sidebar-user { margin-top: auto; border-top: 1px solid var(--line); padding: 14px 8px 0; display: grid; grid-template-columns: 36px minmax(0,1fr) 34px; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--teal); color: #071512; font-weight: 850; text-transform: uppercase; }
.sidebar-user strong, .sidebar-user span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user strong { font-size: 13px; }
.sidebar-user span { color: var(--muted-2); font-size: 11px; margin-top: 3px; }
.sidebar-user .icon-btn { width: 34px; height: 34px; border: 0; background: transparent; color: var(--muted); }

.workspace { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 15; height: 68px; border-bottom: 1px solid var(--line); background: rgba(12, 15, 18, .91); backdrop-filter: blur(16px); display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(18px, 3.5vw, 44px); }
.topbar-left, .topbar-actions { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mobile-menu { display: none; }
.page-title { font-size: 16px; font-weight: 780; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.credit-pill { min-height: 37px; padding: 0 12px; border: 1px solid rgba(199, 243, 107, .25); border-radius: 6px; color: var(--lime); background: rgba(199, 243, 107, .07); display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 760; }
.main { padding: 34px clamp(18px, 3.5vw, 44px) 56px; max-width: 1540px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.page-head h1 { margin: 0; font-size: clamp(25px, 3vw, 34px); line-height: 1.15; }
.page-head p { margin: 8px 0 0; color: var(--muted); line-height: 1.5; }
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.page-actions-result { justify-content: center; margin-top: 16px; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 28px; }
.metric { min-height: 120px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); padding: 18px; display: grid; align-content: space-between; gap: 15px; }
.metric-head { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 13px; font-weight: 650; }
.metric-head .icon { color: var(--teal); }
.metric-value { font-size: 30px; font-weight: 820; }
.metric-foot { color: var(--muted-2); font-size: 12px; }

.section { margin-top: 30px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 13px; }
.section-head h2 { margin: 0; font-size: 17px; }
.section-head a, .section-head button { color: #e29b7e; }
.panel { border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.panel-head { min-height: 57px; border-bottom: 1px solid var(--line); padding: 0 17px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-head h2, .panel-head h3 { margin: 0; font-size: 15px; }
.panel-body { padding: 18px; }
.empty { padding: 46px 20px; display: grid; justify-items: center; text-align: center; color: var(--muted); }
.empty .icon { width: 30px; height: 30px; color: var(--muted-2); margin-bottom: 12px; }
.empty strong { color: var(--ink); margin-bottom: 7px; }
.empty p { margin: 0 0 18px; max-width: 44ch; line-height: 1.5; }

.job-list { display: grid; }
.job-row { min-height: 78px; display: grid; grid-template-columns: minmax(190px, 1.5fr) minmax(130px,.8fr) minmax(100px,.6fr) auto; gap: 16px; align-items: center; padding: 13px 17px; border-bottom: 1px solid var(--line); }
.job-row:last-child { border-bottom: 0; }
.job-main { min-width: 0; }
.job-main strong, .job-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.job-main span, .job-meta { color: var(--muted); font-size: 12px; margin-top: 5px; }
.status { min-height: 27px; width: fit-content; border-radius: 99px; padding: 0 9px; display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.status-completed { color: #72dfc8; background: rgba(33, 184, 157, .12); }
.status-failed { color: #ff9ba3; background: rgba(255, 91, 103, .11); }
.status-active { color: #ffd079; background: rgba(245, 185, 66, .11); }
.status-draft { color: #bbc3c7; background: rgba(154,164,170,.1); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.studio-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .72fr); gap: 18px; align-items: start; }
.studio-main { min-width: 0; display: grid; gap: 18px; }
.dropzone { min-height: 260px; border: 1px dashed var(--line-strong); border-radius: 7px; background: #101519; display: grid; place-content: center; justify-items: center; padding: 28px; text-align: center; cursor: pointer; transition: border-color .18s ease, background .18s ease; }
.dropzone:hover, .dropzone.dragging { border-color: var(--accent); background: rgba(255,107,53,.04); }
.dropzone .icon { width: 34px; height: 34px; color: var(--accent); margin-bottom: 13px; }
.dropzone strong { font-size: 16px; }
.dropzone p { color: var(--muted); margin: 8px 0 0; font-size: 13px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 14px; }
.media-item { position: relative; aspect-ratio: 9/12; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface-2); }
.media-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-index { position: absolute; left: 7px; top: 7px; width: 25px; height: 25px; border-radius: 5px; display: grid; place-items: center; background: rgba(12,15,18,.82); font-size: 11px; font-weight: 800; }
.media-remove { position: absolute; right: 7px; top: 7px; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 5px; display: grid; place-items: center; background: rgba(12,15,18,.84); cursor: pointer; }
.media-remove .icon { width: 15px; height: 15px; }
.studio-settings { position: sticky; top: 86px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: #101519; border: 1px solid var(--line); border-radius: 7px; padding: 4px; }
.segment { min-height: 40px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 720; }
.segment.active { background: var(--surface-3); color: var(--ink); }
.range-wrap { display: grid; grid-template-columns: 1fr 50px; align-items: center; gap: 12px; }
/* No toque, arrastar um controle de 16px e impreciso. A area sensivel cresce sem
   mudar a aparencia: o padding vertical entra na altura do alvo, nao no visual. */
input[type="range"] { width: 100%; accent-color: var(--accent); height: 40px; cursor: pointer; }
.range-value { height: 38px; border: 1px solid var(--line); border-radius: 5px; display: grid; place-items: center; font-weight: 750; background: #101519; }
.cost-box { border-top: 1px solid var(--line); padding-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.cost-box span { color: var(--muted); font-size: 13px; }
.cost-box strong { color: var(--lime); font-size: 21px; }
.studio-settings .btn-primary { width: 100%; margin-top: 14px; }
.preset-row { display: flex; flex-wrap: wrap; gap: 7px; }
.preset { min-height: 33px; border: 1px solid var(--line); border-radius: 99px; background: transparent; color: var(--muted); padding: 0 11px; cursor: pointer; font-size: 12px; }
.preset:hover { color: var(--ink); border-color: var(--line-strong); }
.generation-progress { padding: 18px; display: grid; gap: 14px; }
.progress-track { height: 7px; background: #0d1215; border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--accent); transition: width .4s ease; }
.progress-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); }
/* Vertical a 390px de largura da 693px de altura: ocupava a tela inteira e empurrava
   as acoes e a lista de geracoes para muito abaixo da dobra. O teto por altura mantem
   o video grande e o resto da pagina alcancavel sem rolar. */
.video-result {
  width: min(100%, 390px); max-height: min(58vh, 693px); aspect-ratio: 9/16;
  display: block; margin: 0 auto; background: #090b0d; border-radius: 7px;
}

.clip-studio-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr); gap: 18px; align-items: start; }
.clip-source-panel { min-width: 0; }
.clip-settings { position: sticky; top: 86px; }
.clip-settings .btn-primary { width: 100%; }
.clip-dropzone { min-height: 420px; }
.clip-dropzone .dropzone-icon { width: 64px; height: 64px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); display: grid; place-items: center; margin-bottom: 18px; }
.clip-dropzone .dropzone-icon .icon { margin: 0; }
.clip-source-preview { min-height: 420px; position: relative; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: #080b0d; }
.clip-source-preview video { width: 100%; max-height: 560px; display: block; background: #080b0d; }
.clip-source-meta { position: absolute; left: 12px; right: 12px; bottom: 12px; min-width: 0; padding: 11px 13px; border: 1px solid rgba(255,255,255,.11); border-radius: 6px; background: rgba(8,11,13,.88); backdrop-filter: blur(10px); }
.clip-source-meta strong, .clip-source-meta span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clip-source-meta span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.clip-value-row { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; margin-top: 14px; }
.clip-value-row span { min-height: 52px; border: 1px solid var(--line); border-radius: 6px; padding: 9px 11px; color: var(--muted); display: flex; align-items: center; gap: 9px; font-size: 12px; line-height: 1.35; }
.clip-value-row .icon { color: var(--teal); }
.textarea-compact { min-height: 88px; }
.segmented-three { grid-template-columns: repeat(3, 1fr); }
.input-suffix { position: relative; }
.input-suffix .input { padding-right: 34px; }
.input-suffix > span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 12px; pointer-events: none; }
.clip-upload-progress { padding: 4px 0; }
.clip-project-list { border: 1px solid var(--line); border-radius: 7px; background: var(--surface); overflow: hidden; }
.clip-project-row { min-height: 78px; padding: 11px 14px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0,1fr) 64px 150px 40px; align-items: center; gap: 13px; }
.clip-project-row:last-child { border-bottom: 0; }
.clip-project-open { min-width: 0; border: 0; padding: 0; background: transparent; text-align: left; display: grid; grid-template-columns: 44px minmax(0,1fr); align-items: center; gap: 12px; cursor: pointer; }
.clip-project-icon { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 6px; background: #101519; display: grid; place-items: center; color: var(--accent); }
.clip-project-copy { min-width: 0; }
.clip-project-copy strong, .clip-project-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clip-project-copy small { color: var(--muted); margin-top: 5px; }
.clip-project-count { color: var(--muted); font-size: 12px; text-align: center; }
.section-subtitle { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.process-panel { margin-bottom: 20px; }
.process-panel .panel-body { display: grid; gap: 16px; }
.process-copy { display: grid; grid-template-columns: 44px minmax(0,1fr) auto; align-items: center; gap: 13px; }
.process-icon { width: 44px; height: 44px; border: 1px solid rgba(255,107,53,.3); border-radius: 6px; background: rgba(255,107,53,.08); display: grid; place-items: center; color: var(--accent); }
.process-copy strong, .process-copy p { margin: 0; }
.process-copy p { margin-top: 4px; color: var(--muted); font-size: 12px; }
.process-copy > span:last-child { color: var(--lime); font-weight: 800; }
.ai-clip-grid { display: grid; gap: 14px; }
.ai-clip-card { min-width: 0; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); overflow: hidden; display: grid; grid-template-columns: 300px minmax(0,1fr); }
.ai-clip-media { position: relative; min-height: 520px; display: grid; place-items: center; background: #080b0d; }
.ai-clip-media video { width: 100%; height: 100%; max-height: 620px; object-fit: contain; display: block; background: #080b0d; }
.clip-render-state { display: grid; justify-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.clip-render-state .icon { width: 30px; height: 30px; color: var(--accent); }
.clip-score { position: absolute; left: 12px; top: 12px; width: 62px; min-height: 58px; border: 1px solid rgba(199,243,107,.3); border-radius: 6px; background: rgba(12,15,18,.9); display: grid; place-content: center; text-align: center; }
.clip-score strong { color: var(--lime); font-size: 21px; line-height: 1; }
.clip-score small { margin-top: 4px; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.ai-clip-body { min-width: 0; padding: 21px; display: flex; flex-direction: column; }
.ai-clip-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.ai-clip-title span { color: var(--teal); font-size: 11px; font-weight: 760; text-transform: uppercase; }
.ai-clip-title h3 { margin: 7px 0 0; font-size: 20px; line-height: 1.25; }
.ai-clip-body > p { margin: 12px 0 17px; color: var(--muted); line-height: 1.55; }
.ai-clip-body blockquote { margin: 18px 0 0; padding: 11px 13px; border-left: 3px solid var(--accent); background: rgba(255,107,53,.06); color: #e4d9d3; font-size: 13px; line-height: 1.5; }
.score-details { display: grid; gap: 9px; }
.score-row { display: grid; grid-template-columns: 66px minmax(0,1fr) 28px; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; }
.score-row > div { height: 5px; border-radius: 99px; overflow: hidden; background: #0d1215; }
.score-row i { display: block; height: 100%; border-radius: inherit; background: var(--teal); }
.score-row strong { color: #d9dddf; text-align: right; }
.score-rationale { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; gap: 9px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.score-rationale .icon { color: var(--accent); margin-top: 1px; }
.clip-card-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: auto; padding-top: 20px; }
.disabled-link { pointer-events: none; opacity: .42; }

.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 13px; }
.project-card { border: 1px solid var(--line); border-radius: 7px; background: var(--surface); overflow: hidden; cursor: pointer; transition: transform .18s ease, border-color .18s ease; }
.project-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.project-preview { aspect-ratio: 16/9; display: grid; place-items: center; background: #101519; overflow: hidden; }
.project-preview video { width: 100%; height: 100%; object-fit: cover; }
.project-preview .icon { width: 30px; height: 30px; color: var(--muted-2); }
.project-copy { padding: 15px; }
.project-copy h3 { margin: 0 0 8px; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-copy-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; }

.billing-cycle-wrap { display: grid; justify-items: center; gap: 10px; margin: 0 0 22px; }
.billing-cycle { display: grid; grid-template-columns: repeat(2, minmax(112px, 1fr)); gap: 3px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); padding: 4px; }
.billing-cycle-option { min-height: 42px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); padding: 0 16px; font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.billing-cycle-option.active { background: var(--surface-3); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.28); }
.billing-cycle-option span { display: inline-block; margin-left: 5px; border-radius: 4px; background: rgba(33,184,157,.14); color: #73dec7; padding: 3px 5px; font-size: 10px; line-height: 1; }
.billing-cycle-wrap > p { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 0; color: var(--muted); font-size: 12px; text-align: center; }
.billing-cycle-wrap > p .icon { color: var(--teal); flex: 0 0 auto; }
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 13px; }
.plan { border: 1px solid var(--line); border-radius: 7px; background: var(--surface); padding: 21px; display: flex; flex-direction: column; min-height: 430px; }
.plan.featured { border-color: rgba(255,107,53,.58); box-shadow: inset 0 3px 0 var(--accent); }
.plan-label { color: var(--teal); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.plan h3 { margin: 9px 0 7px; font-size: 21px; }
.plan > p { color: var(--muted); min-height: 44px; line-height: 1.45; margin: 0; }
.plan-credit { color: #d8dddf; font-size: 12px; margin-top: 15px; }
.plan-price { margin: 17px 0 2px; }
.plan-price strong { font-size: 32px; }
.plan-price span { color: var(--muted); }
.plan-billing-note { min-height: 18px; color: var(--muted-2); font-size: 11px; }
.plan-saving { display: flex; align-items: center; gap: 6px; min-height: 29px; margin-top: 8px; color: #73dec7; font-size: 12px; font-weight: 800; }
.plan-saving .icon { color: var(--teal); }

.billing-usage { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 13px; margin-top: 18px; }
.billing-usage article { display: flex; align-items: flex-start; gap: 10px; padding: 15px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--muted); font-size: 13px; line-height: 1.5; }
.billing-usage .icon { flex: none; margin-top: 2px; color: var(--accent); }
.billing-usage strong { display: block; margin-bottom: 2px; color: var(--ink); }

.pack-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 13px; }
.pack { display: flex; flex-direction: column; gap: 5px; padding: 17px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.pack strong { font-size: 14px; }
.pack-price { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.pack-status { color: var(--muted-2); font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
/* O preco por credito e o unico numero que deixa o cliente comparar pacote com plano
   sem fazer conta de cabeca — e comparar e o que decide a compra. */
.pack-unit { color: var(--muted); font-size: 12px; }
.pack.is-available { border-color: var(--line-strong); }
/* O botao desce para a base para os tres cartoes alinharem, independente do texto. */
.pack .btn { margin-top: auto; align-self: flex-start; }


.feature-list { display: grid; gap: 11px; margin: 18px 0 24px; padding: 0; list-style: none; color: #c7cdd0; font-size: 13px; }
.feature-list li { display: flex; gap: 8px; align-items: flex-start; }
.feature-list .icon { color: var(--teal); width: 16px; height: 16px; margin-top: 1px; }
.plan .btn { margin-top: auto; width: 100%; }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; align-items: start; }
.ledger { width: 100%; border-collapse: collapse; }
.ledger th, .ledger td { text-align: left; padding: 13px 15px; border-bottom: 1px solid var(--line); font-size: 13px; }
.ledger th { color: var(--muted-2); font-size: 11px; text-transform: uppercase; }
.ledger tr:last-child td { border-bottom: 0; }
.credit-positive { color: #73dec7; }
.credit-negative { color: #ff9b7b; }

.admin-status { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.service { border: 1px solid var(--line); border-radius: 6px; background: #101519; padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; }
.service-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 4px rgba(255,91,103,.09); }
.service-dot.on { background: var(--teal); box-shadow: 0 0 0 4px rgba(33,184,157,.09); }
.toolbar { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.toolbar .input { width: min(320px, 70vw); }
.data-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table th, .data-table td { padding: 13px 15px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13px; }
.data-table th { color: var(--muted-2); font-size: 11px; text-transform: uppercase; }
.data-table tr:last-child td { border-bottom: 0; }
.cell-main strong, .cell-main span { display: block; }
.cell-main span { color: var(--muted); font-size: 11px; margin-top: 4px; }
.table-actions { display: flex; gap: 6px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(3,5,6,.74); backdrop-filter: blur(8px); display: grid; place-items: center; padding: 18px; }
.modal { width: min(100%, 520px); max-height: min(760px, calc(100vh - 36px)); overflow: auto; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.modal-head { min-height: 62px; padding: 0 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-head .icon-btn { border: 0; }
.modal-body { padding: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.toast-region { position: fixed; z-index: 200; right: 18px; bottom: 18px; width: min(390px, calc(100vw - 36px)); display: grid; gap: 8px; }
.toast { border: 1px solid var(--line-strong); border-radius: 7px; background: #171d21; box-shadow: var(--shadow); padding: 13px 15px; display: grid; grid-template-columns: 20px 1fr auto; align-items: start; gap: 10px; font-size: 13px; line-height: 1.45; }
.toast .icon { color: var(--teal); }
.toast.error .icon { color: var(--danger); }
.toast button { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 0; }
.alert { border: 1px solid rgba(245,185,66,.25); background: rgba(245,185,66,.07); color: #f2d394; border-radius: 6px; padding: 13px 14px; display: flex; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 1.5; }
.alert-danger { border-color: rgba(255,91,103,.25); background: rgba(255,91,103,.07); color: #ffb2b8; }
.alert-spaced { margin-bottom: 18px; }
.skeleton { min-height: 80px; border-radius: 6px; background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: skeleton 1.25s infinite linear; }
.skeleton-title { width: 220px; min-height: 34px; }
.skeleton-panel { min-height: 260px; }
@keyframes skeleton { to { background-position: -200% 0; } }

.mobile-nav { display: none; }
@media (max-width: 1080px) {
  .metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .project-grid, .plan-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .billing-usage, .pack-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .studio-grid { grid-template-columns: 1fr; }
  .studio-settings { position: static; }
  .clip-studio-grid { grid-template-columns: 1fr; }
  .clip-settings { position: static; }
  .admin-status { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 960px) {
  :root { --sidebar: 0px; }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-panel { min-height: 100vh; padding: 24px; }
  .auth-card { padding: 40px 0; margin: auto; }
  .sidebar { position: fixed; left: -270px; width: 244px; height: 100dvh; padding-bottom: calc(16px + env(safe-area-inset-bottom)); transition: left .2s ease; box-shadow: var(--shadow); }
  .sidebar.open { left: 0; }
  .sidebar-close { display: inline-grid; }
  .sidebar-overlay { position: fixed; inset: 0; z-index: 19; background: rgba(0,0,0,.55); }
  .app-shell { display: block; }
  .mobile-menu { display: inline-grid; }
  .topbar { height: 64px; padding: env(safe-area-inset-top) 14px 0; }
  .topbar .btn-primary span { display: none; }
  .topbar .btn-primary { width: 40px; padding: 0; }
  .credit-pill span:first-of-type { display: none; }
  .main { padding: 24px 18px calc(92px + env(safe-area-inset-bottom)); }
  .page-head { align-items: flex-start; flex-direction: column; }
  .job-row { grid-template-columns: 1fr auto; }
  .job-row > :nth-child(2), .job-row > :nth-child(3) { display: none; }
  .settings-grid { grid-template-columns: 1fr; }
  .btn-sm { min-height: 40px; }
  .icon-btn { width: 44px; height: 44px; }
  .mobile-nav { position: fixed; z-index: 18; left: 0; right: 0; bottom: 0; min-height: 65px; padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line); background: rgba(14,18,21,.96); backdrop-filter: blur(16px); }
  .mobile-nav button { min-width: 0; min-height: 64px; border: 0; background: transparent; color: var(--muted); display: grid; place-content: center; justify-items: center; gap: 4px; font-size: 10px; }
  .mobile-nav button.active { color: var(--accent); }
  .mobile-nav .icon { width: 20px; height: 20px; }
  .toast-region { bottom: calc(80px + env(safe-area-inset-bottom)); }
}

@media (max-width: 700px) {
  .main { padding-inline: 14px; }
  .topbar-actions { gap: 6px; }
  .page-title { max-width: 31vw; }
  .page-head > .btn { width: 100%; }
  .project-grid, .plan-grid { grid-template-columns: 1fr; }
  .admin-cards { grid-template-columns: 1fr; }
  .ficha-lista li { grid-template-columns: 1fr auto; }
  .dossie-destaque { grid-template-columns: 1fr; }
  .ficha-lista small { grid-column: 1 / -1; }
  .row-2 { grid-template-columns: 1fr; gap: 0; }
  /* A barra de abas rola no toque; esconder os rotulos deixaria so icones sem significado. */
  .admin-tab { padding: 0 12px; font-size: 12.5px; }
  .billing-usage, .pack-grid { grid-template-columns: 1fr; }
  /* Em coluna unica o cartao e largo: botao curto no canto fica solto. */
  .pack .btn { align-self: stretch; justify-content: center; }
  .ai-clip-card { grid-template-columns: 1fr; }
  .ai-clip-media { min-height: 0; aspect-ratio: 9/16; max-height: 680px; }
  .ai-clip-media video { max-height: 680px; }
  .process-copy { grid-template-columns: 40px minmax(0,1fr); }
  .process-copy > span:last-child { grid-column: 2; }
  .panel-head { min-height: 54px; padding: 8px 14px; flex-wrap: wrap; }
  .clip-project-row { grid-template-columns: minmax(0,1fr) auto 44px; }
  .clip-project-row > .status { display: none; }
}

@media (max-width: 520px) {
  .billing-cycle { width: 100%; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .billing-cycle-option { padding: 0 8px; }
  .billing-cycle-option span { display: block; width: max-content; margin: 3px auto 0; }
  .billing-cycle-wrap > p { align-items: flex-start; text-align: left; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric { min-height: 102px; padding: 13px; }
  .metric-value { font-size: 25px; }
  .metric-foot { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .input, .textarea, .select { font-size: 16px; }
  .admin-status { grid-template-columns: 1fr; }
  .panel-body { padding: 14px; }
  .media-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dropzone { min-height: 205px; padding: 22px 14px; }
  .clip-dropzone, .clip-source-preview { min-height: 300px; }
  .clip-value-row { grid-template-columns: 1fr; }
  .clip-project-row { grid-template-columns: minmax(0,1fr) 44px; }
  .clip-project-count { display: none; }
  .ai-clip-media { max-height: 640px; }
  .ai-clip-media video { max-height: 640px; }
  .clip-project-head .btn-danger { width: auto; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .page-title { display: none; }
  .credit-pill { width: 44px; padding: 0; justify-content: center; }
  .credit-pill strong { display: none; }
  .segmented-three .segment { min-width: 0; padding-inline: 5px; font-size: 12px; }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal { width: 100%; max-height: calc(100dvh - 24px); border-radius: 8px 8px 0 0; border-bottom: 0; }
  .modal-body { padding: 17px 14px calc(20px + env(safe-area-inset-bottom)); }
  .modal-actions { display: grid; grid-template-columns: 1fr; }
  .modal-actions .btn { width: 100%; }
  .toast-region { right: 10px; width: calc(100vw - 20px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.legal-page { min-height: 100vh; background: var(--bg); color: var(--ink); }
.legal-header { height: 72px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 clamp(18px, 5vw, 64px); background: rgba(12, 15, 18, .94); position: sticky; top: 0; z-index: 5; }
.legal-header .btn { min-height: 38px; }
.legal-main { width: min(100% - 36px, 860px); margin: 0 auto; padding: 64px 0 92px; }
.legal-main h1 { margin: 0 0 10px; font-size: clamp(30px, 5vw, 46px); line-height: 1.08; }
.legal-main > p:first-of-type { margin: 0 0 48px; color: var(--muted); }
.legal-section { padding: 26px 0; border-top: 1px solid var(--line); }
.legal-section h2 { margin: 0 0 12px; font-size: 19px; }
.legal-section p, .legal-section li { color: #bdc5c9; line-height: 1.7; }
.legal-section ul { padding-left: 20px; }
.legal-notice { border: 1px solid rgba(245,185,66,.28); background: rgba(245,185,66,.07); border-radius: 7px; padding: 15px 17px; color: #f2d394; line-height: 1.55; margin-bottom: 30px; }

/* ---------------------------------------------------------- administracao */
/* Quebra linha em vez de rolar: com 8 abas e a barra de rolagem escondida, as
   ultimas ficavam fora da borda sem nenhum sinal de que existiam. */
.admin-tabs {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; padding: 4px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
}
.admin-tab {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  min-height: 38px; padding: 0 14px; border: 0; border-radius: 6px;
  background: transparent; color: var(--muted); font-family: inherit;
  font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.admin-tab:hover { color: var(--ink); }
.admin-tab.active { background: var(--surface-3); color: var(--ink); }
.admin-tab .icon { flex: none; }

.pill {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.pill-ok { background: rgba(33,184,157,.15); color: #7de4cf; }
.pill-bad { background: rgba(255,91,103,.14); color: #ffb2b8; }
.pill-wait { background: rgba(245,185,66,.14); color: #f2d394; }
.pill-off { background: var(--surface-3); color: var(--muted); }

.cell-sub { display: block; margin-top: 3px; color: var(--muted-2); font-size: 11px; }
.cell-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; color: var(--muted); }

.admin-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 13px; }
.admin-card {
  display: flex; flex-direction: column; gap: 13px; padding: 18px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
}
.admin-card.is-off { opacity: .62; }
.admin-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.admin-card-head strong { font-size: 15px; }
.admin-kv { display: grid; gap: 8px; margin: 0; }
.admin-kv > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.admin-kv dt { color: var(--muted); font-size: 12.5px; }
.admin-kv dd { margin: 0; font-size: 13px; font-weight: 600; text-align: right; word-break: break-word; }
.admin-card .btn { margin-top: auto; }

.service-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check-line { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; cursor: pointer; }
.check-line input { width: 16px; height: 16px; accent-color: var(--accent); }

/* A tabela larga rola dentro do painel em vez de estourar a pagina no celular.
   As sombras nas bordas aparecem so quando ainda ha conteudo para o lado: sem elas
   a tabela corta no meio de uma coluna e parece defeito, nao rolagem. */
.data-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background:
    linear-gradient(to right, var(--surface) 30%, rgba(20, 25, 29, 0)) left center / 36px 100% no-repeat local,
    linear-gradient(to left, var(--surface) 30%, rgba(20, 25, 29, 0)) right center / 36px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, .45), rgba(0, 0, 0, 0)) left center / 14px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, .45), rgba(0, 0, 0, 0)) right center / 14px 100% no-repeat scroll;
}
.data-scroll .data-table { min-width: 620px; }

/* -------------------------------------------------------- ficha do usuario */
.ficha { display: grid; gap: 18px; max-height: 62vh; overflow-y: auto; padding-right: 4px; }
.ficha-bloco h4 {
  margin: 0 0 9px; color: var(--muted-2); font-size: 11px;
  font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
}
.ficha-vazio { margin: 0; color: var(--muted-2); font-size: 13px; }
.ficha-lista { display: grid; gap: 1px; margin: 0; padding: 0; list-style: none; border-radius: 6px; overflow: hidden; }
.ficha-lista li {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px;
  padding: 10px 12px; background: var(--surface-2); font-size: 13px;
}
.ficha-lista li > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ficha-lista small { color: var(--muted-2); font-size: 11px; white-space: nowrap; }

/* Aviso definido pela administracao. Avisa sem impedir o uso. */
.maintenance-banner {
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 20px;
  padding: 13px 15px; border: 1px solid rgba(245, 185, 66, .28);
  border-radius: 6px; background: rgba(245, 185, 66, .08);
  color: #f2d394; font-size: 13.5px; line-height: 1.5;
}
.maintenance-banner .icon { flex: none; margin-top: 1px; }

/* ------------------------------------------------------- dossie de disputa */
.dossie { display: grid; gap: 14px; }
.dossie-destaque { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.dossie-destaque > div {
  padding: 13px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface-2); text-align: center;
}
.dossie-destaque small { display: block; color: var(--muted-2); font-size: 11px; }
.dossie-destaque strong { display: block; margin-top: 4px; font-size: 19px; letter-spacing: -.02em; }
.dossie-texto {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px; line-height: 1.55; resize: vertical;
}
.acoes-pedido { display: flex; gap: 6px; white-space: nowrap; }

/* Campo-armadilha: fora da tela em vez de display:none, porque automacao simples
   costuma pular o que esta explicitamente escondido. Quem usa o site nunca o alcanca
   (sem tabindex, fora do fluxo); quem varre o HTML preenche e se identifica. */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.turnstile-slot {
  min-height: 65px;
  display: flex;
  align-items: center;
}
.turnstile-slot .field-error {
  margin: 0;
  color: #ffb4b4;
  font-size: 12.5px;
  line-height: 1.45;
}

/* ---------------------------------------------- verificação em duas etapas */
.panel-wide { grid-column: 1 / -1; }
.mfa-setup { display: grid; gap: 18px; }
.mfa-steps { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.mfa-steps li { margin-bottom: 4px; }

/* O QR é um SVG do servidor: fundo claro fixo porque leitor de código precisa de
   contraste, e o tema escuro do app deixaria o padrão ilegível na câmera. */
.mfa-qr {
  display: inline-flex;
  padding: 14px;
  background: #fff;
  border-radius: 12px;
  width: max-content;
  max-width: 100%;
}
.mfa-qr svg { display: block; width: 100%; height: auto; max-width: 220px; }

.mfa-manual { margin: 0; font-size: 13px; color: var(--muted); }
.mfa-manual code {
  display: inline-block;
  padding: 3px 8px;
  background: var(--surface-2);
  border-radius: 6px;
  font-size: 13px;
  letter-spacing: .06em;
  word-break: break-all;
}

.mfa-recovery {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}
.mfa-recovery strong { display: block; margin-bottom: 10px; font-size: 14px; }
.mfa-recovery ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}
.mfa-recovery code { font-size: 14px; letter-spacing: .05em; }
.mfa-recovery .field-hint { margin: 0; }

.mfa-on { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; color: var(--teal); font-size: 14px; }

@media (max-width: 640px) {
  .mfa-qr { width: 100%; justify-content: center; }
  .mfa-recovery ul { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
}

/* ---------------------------------------------- paginação e ações destrutivas */
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; color: var(--muted); font-size: 13px; }
.pager .btn[disabled] { opacity: .45; pointer-events: none; }

/* Excluir conta fica em vermelho e só no hover: destaque permanente numa lista de
   ações vizinhas convida ao clique errado, e conta apagada não volta. */
.icon-btn-danger:hover, .icon-btn-danger:focus-visible { color: var(--danger); border-color: var(--danger); }

@media (max-width: 700px) {
  /* Cinco ações na mesma linha estouram a coluna no celular. */
  .table-actions { flex-wrap: wrap; gap: 4px; }
}

.resumo { display: grid; gap: 1px; margin: 0 0 16px; border-radius: 6px; overflow: hidden; }
.resumo > div {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 13px; background: var(--surface-2); font-size: 13px;
}
.resumo dt { color: var(--muted-2); }
.resumo dd { margin: 0; font-weight: 600; text-align: right; }

/* ---------------------------------------------------------------- acervo */
.acervo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 22px; }
.acervo-lista { display: grid; gap: 1px; margin: 0 0 14px; padding: 0; list-style: none; border-radius: 6px; overflow: hidden; }
.acervo-lista li {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px;
  padding: 10px 12px; background: var(--surface-2); font-size: 13px;
}
.acervo-lista li > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acervo-lista small { color: var(--muted-2); font-size: 11.5px; white-space: nowrap; }
.upload-inline label { cursor: pointer; }
.section-hint { color: var(--muted-2); font-size: 12.5px; }

/* ---------------------------------------------------------------- remontagem */
.renders { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.renders h3 { margin: 0 0 10px; font-size: 13px; font-weight: 700; color: var(--muted-2); text-transform: uppercase; letter-spacing: .07em; }
.renders-lista { display: grid; gap: 1px; margin: 0; padding: 0; list-style: none; border-radius: 6px; overflow: hidden; }
.renders-lista li {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; background: var(--surface-2); font-size: 13px;
}
.renders-lista li > span:nth-child(2) { flex: 1; min-width: 120px; color: var(--muted); }
.render-formato {
  padding: 2px 8px; border-radius: 4px; background: var(--surface);
  border: 1px solid var(--line); font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.cena-escolha { display: grid; gap: 4px; }

/* ---------------------------------------------------------------- prompts salvos */
.preset-row-salvos { margin-top: 8px; }
.preset-salvo-par { display: inline-flex; align-items: stretch; }
.preset-salvo { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.preset-excluir {
  display: inline-flex; align-items: center; padding: 0 8px; cursor: pointer;
  border: 1px solid var(--line); border-left: 0; border-radius: 0 6px 6px 0;
  background: var(--surface-2); color: var(--muted-2);
  font-family: inherit; font-size: 15px; line-height: 1;
}
.preset-excluir:hover { color: var(--danger, #e5484d); }
.preset-acao { border-style: dashed; }

/* ---------------------------------------------------------------- consumo */
.barras { display: flex; align-items: flex-end; gap: 14px; height: 150px; padding: 0 2px; }
.barra-mes { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; }
.barra-par { flex: 1; display: flex; align-items: flex-end; gap: 3px; width: 100%; justify-content: center; }
.barra { width: 42%; max-width: 26px; min-height: 3px; border-radius: 3px 3px 0 0; }
.barra-entrada { background: var(--accent, #6c5ce7); }
.barra-saida { background: var(--muted-2); opacity: .75; }
.barra-mes small { color: var(--muted-2); font-size: 11.5px; }
.legenda { display: flex; gap: 16px; margin-top: 12px; color: var(--muted-2); font-size: 12px; }
.legenda span { display: inline-flex; align-items: center; gap: 6px; }
.ponto { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.ponto-entrada { background: var(--accent, #6c5ce7); }
.ponto-saida { background: var(--muted-2); opacity: .75; }

.uso-lista { display: grid; gap: 11px; margin: 0; padding: 0; list-style: none; }
.uso-lista li { display: grid; grid-template-columns: minmax(110px, 1.3fr) 2fr auto auto; align-items: center; gap: 11px; font-size: 13px; }
.uso-lista li > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uso-lista small { color: var(--muted-2); font-size: 11.5px; }
.uso-trilho { height: 7px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.uso-trilho-largo { height: 11px; margin-bottom: 12px; }
.uso-preenchido { height: 100%; border-radius: 4px; background: var(--accent, #6c5ce7); }
.uso-alerta { background: var(--danger, #e5484d); }
.badge-erro { background: color-mix(in srgb, var(--danger, #e5484d) 18%, transparent); color: var(--danger, #e5484d); }

@media (max-width: 620px) {
  .uso-lista li { grid-template-columns: 1fr auto; }
  .uso-lista li .uso-trilho { grid-column: 1 / -1; order: 3; }
  .acervo-lista li { grid-template-columns: auto 1fr auto; }
  .acervo-lista small { display: none; }
}

/* ---------------------------------------------------------------- preferências */
.pref-linha {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; padding: 13px 0;
}
.pref-linha + .pref-linha { border-top: 1px solid var(--line); }
.pref-linha > div { flex: 1; min-width: 200px; }
.pref-linha strong { display: block; font-size: 13.5px; margin-bottom: 3px; }
.pref-linha .field-hint { margin: 0; }
.input-compacto { max-width: 210px; }

.cost-box-saldo { margin-top: -6px; }
.cost-box-saldo strong { font-weight: 650; }
.saldo-zerado { color: var(--danger, #e5484d); }
.alert-compacto { margin-top: 10px; padding: 11px 12px; font-size: 12.5px; align-items: flex-start; }
.alert-compacto span { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; }

/* ---------------------------------------------------------------- menu de legenda */
.menu-legenda { position: relative; display: inline-flex; }
.menu-flutuante {
  position: absolute; top: calc(100% + 5px); left: 0; z-index: 30; min-width: 232px;
  display: grid; gap: 1px; padding: 4px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .45);
}
.menu-flutuante a {
  display: flex; align-items: baseline; gap: 8px; padding: 9px 11px; border-radius: 5px;
  color: var(--text); text-decoration: none; font-size: 13px; font-weight: 600;
}
.menu-flutuante a:hover { background: var(--surface-2); }
.menu-flutuante small { color: var(--muted-2); font-size: 11.5px; font-weight: 500; }

/* ---------------------------------------------------------------- transcrição */
.transcricao {
  display: grid; gap: 2px; margin: 14px 0 0; padding: 0; list-style: none;
  max-height: 46vh; overflow-y: auto;
}
.transcricao li {
  display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 12px;
  padding: 7px 9px; border-radius: 5px; font-size: 13.5px; line-height: 1.5;
}
.transcricao li:hover { background: var(--surface-2); }
.transcricao button {
  border: 0; background: transparent; padding: 0; cursor: pointer;
  color: var(--accent, #6c5ce7); font-family: inherit; font-size: 12px;
  font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.transcricao button:hover { text-decoration: underline; }
.transcricao mark { background: color-mix(in srgb, var(--accent, #6c5ce7) 34%, transparent); color: inherit; border-radius: 2px; }
.empty-compacto { padding: 22px 16px; }
.empty-compacto p { margin: 8px 0 12px; }

/* ------------------------------------------------------ Central inteligente */
.sidebar { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.sidebar-user { flex: 0 0 auto; }
.eyebrow { display: flex; margin-bottom: 10px; }
.zero-cost-badge {
  width: fit-content; min-height: 28px; padding: 0 9px; border: 1px solid rgba(33, 184, 157, .28);
  border-radius: 99px; display: inline-flex; align-items: center; gap: 6px;
  color: #79dec9; background: rgba(33, 184, 157, .08); font-size: 11px; font-weight: 790;
}
.smart-hub { padding: 18px; border: 1px solid var(--line); border-radius: 9px; background: linear-gradient(135deg, rgba(33,184,157,.055), rgba(255,107,53,.035) 60%, var(--surface)); }
.smart-hub .section-head { margin-bottom: 16px; }
.smart-hub-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.smart-tool-card {
  min-width: 0; min-height: 92px; padding: 15px; border: 1px solid var(--line); border-radius: 7px;
  background: rgba(12,15,18,.68); display: grid; grid-template-columns: 42px minmax(0,1fr) auto;
  align-items: center; gap: 12px; color: var(--ink); text-align: left; cursor: pointer;
  transition: border-color .18s ease, transform .18s ease, background .18s ease;
}
.smart-tool-card:hover { transform: translateY(-2px); border-color: var(--line-strong); background: var(--surface-2); }
.smart-tool-icon, .automation-icon {
  width: 42px; height: 42px; border: 1px solid rgba(33,184,157,.22); border-radius: 7px;
  display: grid; place-items: center; color: var(--teal); background: rgba(33,184,157,.08);
}
.smart-tool-card strong, .smart-tool-card small { display: block; min-width: 0; }
.smart-tool-card strong { margin-bottom: 5px; font-size: 14px; }
.smart-tool-card small { color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.smart-tool-card > .icon { color: var(--muted-2); }
.smart-recommendation, .recommendation-strip, .automation-safety {
  margin-top: 12px; padding: 11px 13px; border: 1px solid rgba(245,185,66,.18); border-radius: 6px;
  display: flex; align-items: center; gap: 10px; background: rgba(245,185,66,.055); color: #dcc486; font-size: 12.5px;
}
.compact-metrics .metric { min-height: 105px; }
.recommendation-strip { margin: -10px 0 18px; align-items: flex-start; }
.recommendation-strip > div { display: grid; gap: 3px; }
.recommendation-strip strong { color: var(--ink); font-size: 12px; }
.recommendation-strip span { color: var(--muted); }

/* ------------------------------------------------------------ Planejamento */
.planner-toolbar { margin-bottom: 15px; padding: 12px; display: grid; grid-template-columns: minmax(180px, 240px) minmax(180px, 240px) 1fr; align-items: end; gap: 12px; }
.planner-toolbar .field { gap: 5px; }
.planner-toolbar .select { height: 40px; }
.planner-count { align-self: center; justify-self: end; color: var(--muted); font-size: 12px; }
.kanban {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 10px;
  overflow-x: auto; padding: 1px 1px 12px; scroll-snap-type: x proximity; scrollbar-width: thin;
}
.kanban-column { min-height: 440px; border: 1px solid var(--line); border-radius: 8px; background: #101519; scroll-snap-align: start; }
.kanban-column > header { min-height: 49px; padding: 0 12px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; }
.kanban-column > header .icon { color: var(--muted); }
.kanban-column > header strong { font-size: 12.5px; }
.kanban-column > header span { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 99px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); font-size: 11px; }
.kanban-stack { padding: 9px; display: grid; align-content: start; gap: 9px; }
.kanban-empty { min-height: 86px; border: 1px dashed var(--line); border-radius: 6px; padding: 18px 12px; display: grid; place-content: center; text-align: center; color: var(--muted-2); font-size: 11.5px; line-height: 1.45; }
.editorial-card { position: relative; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); overflow: hidden; }
.editorial-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 2px; background: transparent; }
.editorial-card.priority-high::before { background: var(--danger); }
.editorial-card.priority-low::before { background: var(--teal); opacity: .55; }
.editorial-card-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.platform-pill, .format-pill { min-height: 22px; padding: 0 7px; border-radius: 4px; display: inline-flex; align-items: center; font-size: 9.5px; font-weight: 790; text-transform: uppercase; letter-spacing: .025em; }
.platform-pill { color: #f6ae90; background: rgba(255,107,53,.1); }
.format-pill { color: var(--muted); background: var(--surface-2); }
.editorial-card h3 { margin: 11px 0 7px; font-size: 13.5px; line-height: 1.35; }
.editorial-hook { margin: 0 0 10px; color: var(--muted); font-size: 11.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.editorial-date { margin: 8px 0; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10.5px; }
.editorial-date.overdue { color: #ff9da5; }
.editorial-progress { margin-top: 10px; display: grid; gap: 5px; }
.editorial-progress > span { color: var(--muted-2); font-size: 10px; }
.editorial-progress .progress-track { height: 4px; }
.editorial-progress .progress-bar { background: var(--teal); }
.editorial-card-actions { margin: 11px -3px -3px; padding-top: 9px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 5px; }
.editorial-card-actions .icon-btn { width: 29px; height: 29px; border: 0; background: transparent; color: var(--muted); }
.editorial-card-actions .icon { width: 15px; height: 15px; }
.checklist-editor { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 6px; }
.checklist-editor legend { padding: 0 5px; color: var(--muted); font-size: 12px; font-weight: 700; }

/* ------------------------------------------------------ Laboratório local */
.lab-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(250px, .65fr); gap: 16px; align-items: start; }
.lab-generator .panel-head { min-height: 68px; }
.privacy-panel .panel-body { display: flex; align-items: flex-start; gap: 12px; }
.privacy-panel .panel-body > .icon { color: var(--teal); }
.privacy-panel strong { display: block; margin-bottom: 6px; }
.privacy-panel p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.creative-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.creative-result-card { min-width: 0; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); overflow: hidden; }
.creative-result-card > header { min-height: 52px; padding: 0 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 9px; }
.creative-result-card > header .icon { color: var(--accent); }
.creative-result-card h3 { margin: 0; font-size: 14px; }
.creative-result-list { display: grid; }
.creative-result-list article { min-height: 62px; padding: 11px 8px 11px 14px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 9px; }
.creative-result-list article:last-child { border-bottom: 0; }
.creative-result-list article > span { color: #d8dcde; font-size: 12px; line-height: 1.48; }
.creative-result-list article > div { display: flex; gap: 3px; }
.creative-result-list .icon-btn { width: 31px; height: 31px; border: 0; background: transparent; color: var(--muted); }
.creative-result-list .icon { width: 15px; height: 15px; }
.lab-utilities { margin-top: 34px; }
.utility-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.analysis-result { margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 12px; background: #101519; }
.analysis-result > strong { width: 54px; height: 54px; border: 1px solid rgba(33,184,157,.28); border-radius: 50%; display: grid; place-items: center; color: var(--teal); font-size: 13px; }
.analysis-result span { font-size: 12px; font-weight: 720; }
.analysis-result p { margin: 4px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.utm-result { margin-top: 14px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; }

/* ------------------------------------------------------------ Automações */
.automation-safety { margin: 0 0 16px; border-color: rgba(33,184,157,.2); background: rgba(33,184,157,.055); color: var(--teal); }
.automation-safety > div { display: grid; gap: 3px; }
.automation-safety strong { color: var(--ink); font-size: 12.5px; }
.automation-safety span { color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.automation-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.automation-card { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: hidden; }
.automation-card.enabled { border-color: rgba(33,184,157,.24); }
.automation-card > header { padding: 16px; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: start; gap: 12px; }
.automation-card h3 { margin: 1px 0 6px; font-size: 14px; }
.automation-card p { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.5; }
.automation-card > footer { min-height: 45px; padding: 0 16px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted-2); font-size: 10.5px; }
.automation-card > footer span { display: inline-flex; align-items: center; gap: 5px; }
.switch { width: 42px; height: 24px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 99px; background: #0d1215; cursor: pointer; transition: background .2s ease, border-color .2s ease; }
.switch span { display: block; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform .2s ease, background .2s ease; }
.switch.on { border-color: rgba(33,184,157,.42); background: rgba(33,184,157,.16); }
.switch.on span { transform: translateX(17px); background: var(--teal); }
.automation-config { padding: 11px 16px 14px; border-top: 1px solid var(--line); display: grid; gap: 7px; }
.automation-config > label { color: var(--muted); font-size: 11px; font-weight: 700; }
.automation-config > div { display: grid; grid-template-columns: 90px auto auto; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.automation-config .input { height: 36px; }
.automation-log { display: grid; }
.automation-log > div { min-height: 62px; padding: 10px 15px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 32px minmax(0,1fr); align-items: center; gap: 10px; }
.automation-log > div:last-child { border-bottom: 0; }
.automation-log-icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--teal); background: rgba(33,184,157,.1); }
.automation-log-icon .icon { width: 15px; height: 15px; }
.automation-log strong, .automation-log small { display: block; }
.automation-log strong { font-size: 12.5px; }
.automation-log small { margin-top: 4px; color: var(--muted); font-size: 11px; }

/* ----------------------------------------------------------- Teleprompter */
.teleprompter-shell { display: grid; gap: 12px; }
.teleprompter-stage { height: min(58vh, 520px); overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #050708; position: relative; }
.teleprompter-stage::before, .teleprompter-stage::after { content: ""; position: absolute; z-index: 2; left: 0; right: 0; height: 28%; pointer-events: none; }
.teleprompter-stage::before { top: 0; background: linear-gradient(#050708, transparent); }
.teleprompter-stage::after { bottom: 0; background: linear-gradient(transparent, #050708); }
.teleprompter-track { padding: 45vh 8% 55vh; color: #fff; font-size: clamp(23px, 3.4vw, 40px); font-weight: 720; line-height: 1.55; text-align: center; white-space: pre-wrap; }
.teleprompter-track p { margin: 0; }
.teleprompter-track.playing { animation-name: teleprompter-scroll; animation-timing-function: linear; animation-fill-mode: forwards; }
.teleprompter-track.paused { animation-play-state: paused; }
.teleprompter-track.speed-slow { animation-duration: 150s; }
.teleprompter-track.speed-normal { animation-duration: 105s; }
.teleprompter-track.speed-fast { animation-duration: 72s; }
.teleprompter-controls { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
@keyframes teleprompter-scroll { from { transform: translateY(0); } to { transform: translateY(calc(-100% + 20vh)); } }

@media (max-width: 1080px) {
  .smart-hub-grid { grid-template-columns: 1fr; }
  .automation-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .compact-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .planner-toolbar { grid-template-columns: 1fr 1fr; }
  .planner-count { grid-column: 1 / -1; justify-self: start; }
  .creative-results, .utility-grid, .lab-layout { grid-template-columns: 1fr; }
  .privacy-panel { order: -1; }
  .analysis-result { grid-template-columns: auto 1fr; }
  .analysis-result .btn { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  .smart-hub { padding: 13px; }
  .smart-tool-card { grid-template-columns: 38px minmax(0,1fr); }
  .smart-tool-card > .icon { display: none; }
  .smart-tool-icon { width: 38px; height: 38px; }
  .planner-toolbar { grid-template-columns: 1fr; }
  .planner-count { grid-column: auto; }
  .kanban { margin-right: -14px; grid-auto-columns: minmax(82vw, 1fr); }
  .compact-metrics { gap: 8px; }
  .compact-metrics .metric { padding: 13px; }
  .automation-card > header { grid-template-columns: 38px minmax(0,1fr) auto; padding: 13px; }
  .automation-card > footer { align-items: flex-start; flex-direction: column; justify-content: center; padding-block: 9px; }
  .creative-result-list article { grid-template-columns: 1fr; }
  .creative-result-list article > div { justify-content: flex-end; }
  .teleprompter-track { font-size: 24px; padding-inline: 5%; }
}
