:root {
  --primary: 237 100% 40%;
  --primary-strong: 237 100% 34%;
  --primary-soft: 237 100% 96%;
  --secondary: 160 75% 70%;
  --background: 280 40% 97%;
  --foreground: 0 0% 10%;
  --card: 0 0% 100%;
  --muted: 280 30% 92%;
  --muted-foreground: 280 8% 42%;
  --border: 280 20% 90%;
  --success: 157 62% 36%;
  --success-soft: 157 55% 94%;
  --warning: 35 92% 46%;
  --warning-soft: 39 100% 94%;
  --danger: 355 72% 48%;
  --danger-soft: 355 80% 96%;
  --shadow: 280 30% 20%;
  --sidebar-width: 248px;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
}

.dark {
  /* Graphite night theme: near-neutral grays with a faint Dongee-blue cast. */
  --primary: 228 100% 67%;
  --primary-strong: 228 100% 75%;
  --primary-soft: 226 40% 19%;
  --secondary: 160 70% 62%;
  --background: 220 12% 9%;
  --foreground: 220 14% 92%;
  --card: 220 11% 12.5%;
  --muted: 220 9% 17%;
  --muted-foreground: 220 8% 65%;
  --border: 220 8% 22%;
  --success-soft: 157 30% 16%;
  --warning-soft: 35 35% 16%;
  --danger-soft: 355 35% 17%;
  --shadow: 220 40% 2%;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: hsl(var(--foreground));
  background: hsl(var(--background));
  font-family: "DM Sans", "Avenir Next", Avenir, Inter, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid hsl(var(--secondary)); outline-offset: 2px; }
/* Base for fields no module styles: zero specificity, so every existing rule still wins. */
:where(input:not([type="checkbox"], [type="radio"], [type="hidden"], [type="file"], [type="range"], [type="color"], [type="submit"], [type="button"]), select, textarea) { padding: 10px 12px; color: hsl(var(--foreground)); background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: 8px; transition: border-color .15s, box-shadow .15s; }
:where(input:not([type="checkbox"], [type="radio"], [type="hidden"], [type="file"], [type="range"], [type="color"], [type="submit"], [type="button"]), select, textarea):focus { border-color: hsl(var(--primary)); box-shadow: 0 0 0 3px hsl(var(--primary) / .12); outline: 0; }
:where(label) > :where(input:not([type="checkbox"], [type="radio"], [type="hidden"], [type="file"]), select, textarea) { width: 100%; }
/* File inputs: a drop zone (public/app.js wraps each visible input). */
.file-drop { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 10px 14px; color: hsl(var(--muted-foreground)); background: hsl(var(--background)); border: 1.5px dashed hsl(var(--border)); border-radius: var(--radius-sm); font-size: .74rem; font-weight: 600; line-height: 1.35; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.file-drop:hover, .file-drop.dragging { color: hsl(var(--foreground)); background: hsl(var(--primary-soft)); border-color: hsl(var(--primary) / .55); }
.file-drop:focus-within { border-color: hsl(var(--primary)); box-shadow: 0 0 0 3px hsl(var(--primary) / .15); }
.file-drop.has-files { color: hsl(var(--foreground)); border-style: solid; border-color: hsl(var(--primary) / .4); }
.file-drop-icon { flex: 0 0 auto; display: grid; place-items: center; width: 32px; height: 32px; color: hsl(var(--primary)); background: hsl(var(--primary-soft)); border-radius: 8px; }
.file-drop-text { min-width: 0; overflow-wrap: anywhere; }
.file-drop input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
/* Without JavaScript the native control at least matches the app. */
input[type="file"]::file-selector-button { margin-right: 10px; padding: 7px 12px; color: hsl(var(--primary)); background: hsl(var(--primary-soft)); border: 1px solid hsl(var(--primary) / .2); border-radius: 8px; font: inherit; font-weight: 700; cursor: pointer; }
svg { width: 20px; height: 20px; fill: currentColor; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: -.03em; }
h1 { font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1.02; font-weight: 600; }
h2 { font-size: 1.28rem; line-height: 1.2; font-weight: 600; }
h3 { font-size: 1rem; line-height: 1.35; font-weight: 600; }
.muted { color: hsl(var(--muted-foreground)); }
.eyebrow { display: block; color: hsl(var(--muted-foreground)); font-size: .7rem; line-height: 1.2; letter-spacing: .11em; text-transform: uppercase; font-weight: 800; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 1.08rem; font-weight: 700; letter-spacing: -.03em; }
.brand-logo { display: block; width: 106px; height: auto; object-fit: contain; }
.brand-logo-dark { display: none; }
.dark .brand-logo-light { display: none; }
.dark .brand-logo-dark { display: block; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border: 1px solid hsl(var(--border)); border-radius: var(--radius-sm); cursor: pointer; font-weight: 700; transition: transform .15s ease, background .15s ease, opacity .15s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .48; }
.is-loading { gap: 9px; cursor: wait !important; opacity: .82 !important; }
.is-loading::before { content: ""; flex: 0 0 auto; width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: button-spin .65s linear infinite; }
@keyframes button-spin { to { transform: rotate(360deg); } }
.button.primary { color: hsl(0 0% 100%); background: hsl(var(--primary)); border-color: hsl(var(--primary)); }
.button.primary:hover:not(:disabled) { background: hsl(var(--primary-strong)); }
.button.full { width: 100%; }
.button.small { min-height: 34px; padding: 0 11px; font-size: .68rem; }
.button.ghost { color: hsl(var(--foreground)); background: hsl(var(--card)); }
.button.danger { color: hsl(var(--danger)); background: hsl(var(--danger-soft)); border-color: hsl(var(--danger) / .18); }
.text-button { color: hsl(var(--muted-foreground)); background: none; border: 0; cursor: pointer; font-size: .78rem; font-weight: 700; }
.icon-button { display: grid; place-items: center; width: 40px; height: 40px; color: hsl(var(--foreground)); background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: 50%; cursor: pointer; }
.panel { background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius); box-shadow: 0 12px 35px hsl(var(--shadow) / .045); }
.alert { margin: 18px 0; padding: 12px 14px; border-radius: var(--radius-sm); font-size: .88rem; }
.alert-error { color: hsl(var(--danger)); background: hsl(var(--danger-soft)); border: 1px solid hsl(var(--danger) / .18); }
.alert-success { color: hsl(var(--success)); background: hsl(var(--success-soft)); border: 1px solid hsl(var(--success) / .2); }
.auth-secondary-link { display: block; margin-top: 14px; color: hsl(var(--muted-foreground)); font-size: .85rem; text-align: center; }
.auth-secondary-link:hover { color: hsl(var(--primary)); }
.toast { position: fixed; z-index: 100; top: 20px; right: 24px; padding: 12px 18px; color: hsl(0 0% 100%); background: hsl(var(--foreground)); border-radius: var(--radius-sm); box-shadow: 0 15px 40px hsl(var(--shadow) / .2); animation: toast-in .25s ease-out; transition: opacity .2s ease, transform .2s ease; }
.toast.hide { opacity: 0; transform: translateY(-8px); pointer-events: none; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
.oauth-redirect-wrap { min-height: 100vh; }
.oauth-redirect-card { display: grid; justify-items: center; text-align: center; }
.oauth-redirect-card p { margin: 4px 0 24px; color: hsl(var(--muted-foreground)); line-height: 1.6; }
.oauth-redirect-spinner { width: 42px; height: 42px; margin-bottom: 22px; border: 4px solid hsl(var(--primary) / .2); border-right-color: hsl(var(--primary)); border-radius: 50%; animation: button-spin .8s linear infinite; }
.oauth-cancel-link { margin-top: 18px; text-decoration: none; }

/* Acceso */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, .92fr) 1.08fr; background: hsl(var(--card)); }
.auth-panel { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; overflow: hidden; padding: 48px clamp(36px, 6vw, 90px); color: hsl(280 70% 92%); background: hsl(280 75% 15%); }
.auth-panel::before, .auth-panel::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.auth-panel::before { width: 38vw; height: 38vw; right: -18vw; top: 16%; background: hsl(var(--primary) / .45); filter: blur(3px); }
.auth-panel::after { width: 24vw; height: 24vw; left: -12vw; bottom: -10vw; background: hsl(var(--secondary) / .22); filter: blur(30px); }
.auth-panel > * { position: relative; z-index: 1; }
.auth-brand .brand-logo-light { display: none; }
.auth-brand .brand-logo-dark { display: block; }
.auth-copy { max-width: 580px; }
.auth-copy .eyebrow { color: hsl(var(--secondary)); }
.auth-copy h1 { max-width: 600px; margin: 18px 0 22px; font-size: clamp(2.9rem, 6vw, 5.5rem); font-weight: 500; }
.auth-copy p { max-width: 510px; color: hsl(280 32% 78%); font-family: "PT Serif", Georgia, serif; font-size: 1.3rem; line-height: 1.5; }
.auth-principle { max-width: 360px; padding-top: 20px; border-top: 1px solid hsl(280 40% 35%); }
.auth-principle span { color: hsl(var(--secondary)); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }
.auth-principle p { margin: 8px 0 0; color: hsl(280 35% 82%); }
.auth-form-wrap { display: grid; place-items: center; min-height: 100vh; padding: 42px; background: hsl(var(--background)); }
.auth-form { width: min(430px, 100%); padding: 42px; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius-lg); box-shadow: 0 30px 80px hsl(var(--shadow) / .08); }
.auth-form h2 { margin: 8px 0 6px; font-size: 2rem; }
.auth-form > label, .workflow-card label { display: grid; gap: 8px; margin: 18px 0; font-size: .78rem; font-weight: 800; }
.auth-form input, .workflow-card textarea { width: 100%; color: hsl(var(--foreground)); background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: var(--radius-sm); padding: 13px 14px; transition: border .15s, box-shadow .15s; }
.auth-form input:focus, .workflow-card textarea:focus { border-color: hsl(var(--primary)); box-shadow: 0 0 0 3px hsl(var(--primary) / .12); outline: 0; }
.setup-steps { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.setup-steps li { display: flex; align-items: center; gap: 12px; color: hsl(280 24% 64%); }
.setup-steps li span { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid hsl(280 35% 38%); border-radius: 50%; font-size: .75rem; font-weight: 800; }
.setup-steps .done, .setup-steps .current { color: hsl(280 70% 92%); }
.setup-steps .done span { color: hsl(280 75% 15%); background: hsl(var(--secondary)); border-color: hsl(var(--secondary)); }
.setup-steps .current span { border-color: hsl(var(--secondary)); }

/* Aplicación */
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; display: flex; flex-direction: column; width: var(--sidebar-width); padding: 28px 18px 22px; background: hsl(var(--card)); border-right: 1px solid hsl(var(--border)); }
.sidebar { overflow-y: auto; scrollbar-width: thin; }
.sidebar .brand { padding: 0 10px 26px; }
.main-nav { display: grid; align-content: start; gap: 4px; }
.nav-item { display: flex; align-items: center; min-height: 40px; gap: 12px; padding: 0 12px; color: hsl(var(--muted-foreground)); border-radius: var(--radius-sm); font-size: .88rem; font-weight: 650; }
.nav-item svg { flex: 0 0 auto; width: 19px; }
.nav-item:hover:not(.disabled), .nav-item.active { color: hsl(var(--primary)); background: hsl(var(--primary-soft)); }
.nav-item.disabled { cursor: default; opacity: .55; }
.nav-item small { margin-left: auto; font-size: .57rem; letter-spacing: .06em; text-transform: uppercase; }
/* «Recientes»: the last pieces this person opened */
.nav-recent { display: grid; gap: 3px; margin-top: 14px; padding-top: 12px; border-top: 1px solid hsl(var(--border)); }
.nav-section-label { padding: 0 12px 4px; color: hsl(var(--muted-foreground)); font-size: .6rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.nav-recent-item { min-height: 38px; }
.nav-recent-label { display: grid; min-width: 0; line-height: 1.25; }
.nav-recent-title { overflow: hidden; color: hsl(var(--foreground)); font-size: .8rem; font-weight: 650; white-space: nowrap; text-overflow: ellipsis; }
.nav-recent-meta { color: hsl(var(--muted-foreground)); font-size: .66rem; font-weight: 500; }
.nav-recent-item.active .nav-recent-title { color: hsl(var(--primary)); }
.sidebar-footer { margin-top: auto; padding-top: 20px; border-top: 1px solid hsl(var(--border)); }
.tenant-switcher { display: flex; align-items: center; gap: 10px; padding: 8px; }
.tenant-avatar, .user-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; color: hsl(0 0% 100%); background: hsl(var(--primary)); border-radius: 10px; font-weight: 800; }
.tenant-switcher span:last-child { display: grid; }
.tenant-switcher strong { font-size: .82rem; }
.tenant-switcher small { color: hsl(var(--muted-foreground)); font-size: .68rem; }
.workspace-switcher { display: grid; gap: 7px; padding: 8px; }
.workspace-switcher label { color: hsl(var(--muted-foreground)); font-size: .6rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.workspace-switcher > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px; }
.workspace-switcher select { min-width: 0; padding: 8px; color: hsl(var(--foreground)); background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: 7px; font-size: .68rem; }
.workspace-switcher button { padding: 0 8px; color: hsl(var(--primary)); background: hsl(var(--primary-soft)); border: 1px solid hsl(var(--primary) / .18); border-radius: 7px; cursor: pointer; font-size: .61rem; font-weight: 800; }
.sidebar-footer > p { margin: 12px 8px 0; color: hsl(var(--muted-foreground)); font-size: .66rem; }
.main-area { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar { position: sticky; z-index: 30; top: 0; display: flex; align-items: center; justify-content: space-between; height: 76px; padding: 0 clamp(24px, 4vw, 54px); background: hsl(var(--background) / .88); border-bottom: 1px solid hsl(var(--border)); backdrop-filter: blur(14px); }
.topbar-context { display: grid; gap: 2px; }
.topbar-context strong { font-size: .92rem; }
.topbar-actions, .user-menu { display: flex; align-items: center; gap: 12px; }
.user-menu { padding-left: 4px; }
.user-avatar { width: 38px; height: 38px; border-radius: 50%; }
.user-copy { display: grid; min-width: 110px; }
.user-copy strong { font-size: .78rem; }
.user-copy small { color: hsl(var(--muted-foreground)); font-size: .64rem; }
.mobile-menu { display: none; }
.page-content { width: min(1460px, 100%); margin: 0 auto; padding: 40px clamp(24px, 4vw, 54px) 72px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.page-heading h1 { margin: 8px 0 12px; font-size: clamp(2rem, 4vw, 3.2rem); }
.page-heading p { max-width: 680px; margin-bottom: 0; color: hsl(var(--muted-foreground)); }
.heading-actions { display: flex; align-items: center; gap: 12px; }
.date-range { white-space: nowrap; color: hsl(var(--muted-foreground)); font-size: .8rem; }
.metrics-grid { display: grid; grid-template-columns: 1.8fr repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.metric-card { min-height: 138px; padding: 22px; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius); }
.metric-card > span, .metric-top span { color: hsl(var(--muted-foreground)); font-size: .76rem; font-weight: 650; }
.metric-card > strong { display: block; margin: 13px 0 0; font-size: 2.35rem; line-height: 1; letter-spacing: -.04em; }
.metric-card > small { color: hsl(var(--muted-foreground)); font-size: .68rem; }
.metric-card.featured { color: hsl(0 0% 100%); background: hsl(var(--primary)); border-color: hsl(var(--primary)); }
.metric-top { display: flex; justify-content: space-between; align-items: center; }
.metric-card.featured .metric-top span, .metric-card.featured p { color: hsl(0 0% 100% / .76); }
.metric-top strong { font-size: 1.55rem; }
.metric-card.featured p { margin: 12px 0 0; font-size: .75rem; }
.progress { height: 7px; margin-top: 16px; overflow: hidden; background: hsl(0 0% 100% / .2); border-radius: 99px; }
.progress span { display: block; height: 100%; width: 0; background: hsl(var(--secondary)); border-radius: inherit; }
.progress .w-0 { width: 0; } .progress .w-5 { width: 5%; } .progress .w-10 { width: 10%; } .progress .w-15 { width: 15%; } .progress .w-20 { width: 20%; }
.progress .w-25 { width: 25%; } .progress .w-30 { width: 30%; } .progress .w-35 { width: 35%; } .progress .w-40 { width: 40%; } .progress .w-45 { width: 45%; }
.progress .w-50 { width: 50%; } .progress .w-55 { width: 55%; } .progress .w-60 { width: 60%; } .progress .w-65 { width: 65%; } .progress .w-70 { width: 70%; }
.progress .w-75 { width: 75%; } .progress .w-80 { width: 80%; } .progress .w-85 { width: 85%; } .progress .w-90 { width: 90%; } .progress .w-95 { width: 95%; } .progress .w-100 { width: 100%; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.calendar-panel { overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px; border-bottom: 1px solid hsl(var(--border)); }
.panel-heading h2 { margin: 5px 0 0; }
.legend { display: flex; gap: 12px; color: hsl(var(--muted-foreground)); font-size: .63rem; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 7px; height: 7px; border-radius: 50%; }
.dot.published { background: hsl(var(--success)); } .dot.review { background: hsl(var(--primary)); } .dot.draft { background: hsl(var(--muted-foreground)); }
.content-list { display: grid; }
.content-row { display: grid; grid-template-columns: 50px 68px minmax(0, 1fr) 144px; align-items: center; gap: 15px; min-height: 114px; padding: 15px 22px; border-bottom: 1px solid hsl(var(--border)); transition: background .15s ease; }
.content-row:last-child { border-bottom: 0; }
.content-row:hover { background: hsl(var(--primary-soft) / .55); }
.date-tile { display: grid; justify-items: center; }
.date-tile strong { font-size: 1.25rem; line-height: 1; }
.date-tile span { margin-top: 4px; color: hsl(var(--muted-foreground)); font-size: .58rem; letter-spacing: .1em; }
.content-thumb { width: 68px; height: 68px; object-fit: cover; background: hsl(var(--muted)); border-radius: 10px; }
.content-main { min-width: 0; }
.row-meta { display: flex; align-items: center; gap: 8px; color: hsl(var(--muted-foreground)); font-size: .64rem; }
.type-label { color: hsl(var(--primary)); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.content-main h3 { max-width: 650px; margin: 7px 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-list { display: flex; gap: 5px; overflow: hidden; }
.channel-list span { flex: 0 0 auto; padding: 3px 7px; color: hsl(var(--muted-foreground)); background: hsl(var(--muted) / .58); border-radius: 5px; font-size: .58rem; }
.row-status { position: relative; display: grid; justify-items: end; gap: 7px; padding-right: 16px; }
.status { display: inline-flex; align-items: center; width: fit-content; min-height: 25px; padding: 0 9px; border-radius: 99px; font-size: .6rem; font-weight: 800; }
.status-draft { color: hsl(var(--muted-foreground)); background: hsl(var(--muted)); }
.status-brand_validation { color: hsl(var(--warning)); background: hsl(var(--warning-soft)); }
.status-human_review, .status-approved, .status-scheduled { color: hsl(var(--primary)); background: hsl(var(--primary-soft)); }
.status-published, .status-measured { color: hsl(var(--success)); background: hsl(var(--success-soft)); }
.status.large { min-height: 34px; padding: 0 14px; font-size: .68rem; }
.blocker { color: hsl(var(--warning)); font-size: .57rem; }
.row-arrow { position: absolute; right: 0; top: 50%; transform: translateY(-50%); color: hsl(var(--muted-foreground)); font-size: 1.4rem; }
.side-stack { display: grid; gap: 20px; }
.compact-panel { overflow: hidden; }
.panel-count { color: hsl(var(--muted-foreground)); font-size: .7rem; }
.connection-list { display: grid; padding: 8px 20px; }
.connection-row { display: grid; grid-template-columns: 34px 1fr 8px; align-items: center; gap: 10px; min-height: 58px; border-bottom: 1px solid hsl(var(--border)); }
.connection-row:last-child { border-bottom: 0; }
.channel-icon { display: grid; place-items: center; width: 30px; height: 30px; color: hsl(var(--primary)); background: hsl(var(--primary-soft)); border-radius: 8px; font-size: .7rem; font-weight: 800; }
.connection-row div { display: grid; }
.connection-row strong { font-size: .76rem; }
.connection-row small { color: hsl(var(--muted-foreground)); font-size: .62rem; }
.connection-state { width: 7px; height: 7px; background: hsl(var(--muted-foreground)); border-radius: 50%; }
.connection-state.connected { background: hsl(var(--success)); }
.panel-note, .brand-panel > p { margin: 0; padding: 16px 20px 20px; color: hsl(var(--muted-foreground)); font-size: .71rem; line-height: 1.55; border-top: 1px solid hsl(var(--border)); }
.brand-panel { display: block; }
.brand-panel:hover { border-color: hsl(var(--primary) / .24); }
.shield { display: grid; place-items: center; width: 32px; height: 32px; color: hsl(var(--success)); background: hsl(var(--success-soft)); border-radius: 50%; font-weight: 900; }
.rule-summary { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid hsl(var(--border)); }
.rule-summary span { display: grid; justify-items: center; gap: 2px; padding: 14px 6px; color: hsl(var(--muted-foreground)); font-size: .52rem; text-align: center; border-right: 1px solid hsl(var(--border)); }
.rule-summary span:last-child { border-right: 0; }
.rule-summary strong { color: hsl(var(--foreground)); font-size: 1rem; }

/* Detalle */
.back-link { display: inline-block; margin-bottom: 26px; color: hsl(var(--muted-foreground)); font-size: .78rem; font-weight: 700; }
.detail-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.detail-heading h1 { max-width: 900px; margin: 10px 0 10px; font-size: clamp(2rem, 4vw, 3.4rem); }
.detail-heading p { color: hsl(var(--muted-foreground)); }
.detail-grid { display: grid; grid-template-columns: minmax(340px, .9fr) minmax(420px, 1.1fr); gap: 22px; align-items: start; }
.visual-card { position: sticky; top: 98px; overflow: hidden; }
.visual-card > img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: hsl(var(--muted)); }
.visual-meta { display: grid; gap: 5px; padding: 18px 20px; }
.visual-meta span { color: hsl(var(--muted-foreground)); font-size: .68rem; }
.visual-meta strong { font-size: .72rem; }
.detail-stack { display: grid; gap: 16px; }
.detail-card, .workflow-card, .blocker-card { padding: 24px; }
.detail-card dl { display: grid; margin: 18px 0 0; }
.detail-card dl > div { display: grid; grid-template-columns: 120px 1fr; gap: 20px; padding: 12px 0; border-top: 1px solid hsl(var(--border)); }
.detail-card dt { color: hsl(var(--muted-foreground)); font-size: .68rem; }
.detail-card dd { margin: 0; font-size: .78rem; font-weight: 650; }
.validation-title { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.validation-title h2 { margin: 6px 0 0; }
.validation-card > p { margin: 16px 0 0; color: hsl(var(--muted-foreground)); font-size: .78rem; }
.validation-card.failed .shield { color: hsl(var(--danger)); background: hsl(var(--danger-soft)); }
.check-list { display: grid; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.check-list li { padding: 10px 12px; background: hsl(var(--warning-soft)); border-radius: 8px; font-size: .75rem; }
.check-list li.error { color: hsl(var(--danger)); background: hsl(var(--danger-soft)); }
.blocker-card { border-left: 4px solid hsl(var(--warning)); }
.blocker-card p { margin: 10px 0 0; font-size: .8rem; }
.workflow-card h2 { margin: 6px 0 0; }
.workflow-card form { margin-top: 18px; }

/* ADN de marca */
.dna-heading { align-items: center; }
.dna-heading .heading-actions form { margin: 0; }
.dna-progress-card { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(240px, .7fr); align-items: center; gap: 28px; margin-bottom: 18px; padding: 20px 24px; }
.dna-progress-copy { display: flex; align-items: center; gap: 24px; }
.dna-progress-copy > div { display: grid; min-width: 86px; }
.dna-progress-copy strong { margin-top: 4px; font-size: 1.8rem; letter-spacing: -.04em; }
.dna-progress-copy p { margin: 0; color: hsl(var(--muted-foreground)); font-size: .72rem; }
.dna-progress { margin: 0; background: hsl(var(--muted)); }
.dna-stepper { display: grid; grid-template-columns: repeat(7, minmax(90px, 1fr)); gap: 7px; margin-bottom: 20px; overflow-x: auto; }
.dna-step { display: flex; align-items: center; gap: 8px; min-width: 112px; min-height: 52px; padding: 9px 10px; color: hsl(var(--muted-foreground)); background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius-sm); font-size: .67rem; }
.dna-step > span { display: grid; place-items: center; flex: 0 0 auto; width: 26px; height: 26px; background: hsl(var(--muted)); border-radius: 50%; font-size: .62rem; font-weight: 800; }
.dna-step.complete > span { color: hsl(var(--success)); background: hsl(var(--success-soft)); }
.dna-step.current { color: hsl(var(--primary)); border-color: hsl(var(--primary) / .3); box-shadow: 0 0 0 3px hsl(var(--primary) / .07); }
.dna-step.current > span { color: hsl(0 0% 100%); background: hsl(var(--primary)); }
.dna-editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 20px; align-items: start; }
.dna-form-card { overflow: hidden; }
.dna-section-heading { display: flex; align-items: flex-start; gap: 16px; padding: 25px 28px; border-bottom: 1px solid hsl(var(--border)); }
.dna-section-heading .step-number { display: grid; place-items: center; flex: 0 0 auto; width: 42px; height: 42px; color: hsl(0 0% 100%); background: hsl(var(--primary)); border-radius: 12px; font-weight: 900; }
.dna-section-heading h2 { margin: 5px 0 5px; }
.dna-section-heading p { margin: 0; color: hsl(var(--muted-foreground)); font-size: .72rem; }
.dna-form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 28px; }
.dna-form label { display: grid; align-content: start; gap: 7px; color: hsl(var(--muted-foreground)); font-size: .7rem; font-weight: 800; }
.dna-form label.wide { grid-column: 1 / -1; }
.dna-form label > span { display: flex; align-items: center; gap: 8px; }
.dna-form label i { padding: 2px 5px; color: hsl(var(--primary)); background: hsl(var(--primary-soft)); border-radius: 4px; font-size: .51rem; font-style: normal; letter-spacing: .04em; text-transform: uppercase; }
.dna-form input, .dna-form textarea, .dna-form select { width: 100%; padding: 12px 13px; color: hsl(var(--foreground)); background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: 8px; resize: vertical; }
.dna-form input:focus, .dna-form textarea:focus, .dna-form select:focus { border-color: hsl(var(--primary)); box-shadow: 0 0 0 3px hsl(var(--primary) / .1); outline: 0; }
.dna-form label small { font-weight: 500; line-height: 1.45; }
.dna-font-note { display: flex; align-items: center; justify-content: space-between; gap: 16px; grid-column: 1 / -1; padding: 14px 15px; background: hsl(var(--primary-soft)); border: 1px solid hsl(var(--primary) / .14); border-radius: 10px; }
.dna-font-note > div { display: grid; gap: 3px; }
.dna-font-note strong { color: hsl(var(--foreground)); font-size: .72rem; }
.dna-font-note span { color: hsl(var(--muted-foreground)); font-size: .65rem; line-height: 1.45; }
.dna-font-note .button { flex: 0 0 auto; }
.dna-form-actions { display: flex; justify-content: flex-end; gap: 10px; grid-column: 1 / -1; padding-top: 5px; }
.dna-guide-card { position: sticky; top: 98px; padding: 24px; }
.dna-guide-card h2 { margin: 7px 0 12px; }
.dna-guide-card > p, .dna-guide-card li { color: hsl(var(--muted-foreground)); font-size: .7rem; }
.dna-guide-card ul { display: grid; gap: 8px; margin: 18px 0; padding-left: 18px; }
.dna-safe-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 22px; padding: 13px; background: hsl(var(--success-soft)); border-radius: var(--radius-sm); }
.dna-safe-note .shield { flex: 0 0 auto; width: 28px; height: 28px; }
.dna-safe-note p { margin: 0; color: hsl(var(--muted-foreground)); font-size: .66rem; }
.dna-permission-note { margin: 0; padding: 28px; color: hsl(var(--muted-foreground)); }
.dna-review-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 20px; align-items: start; }
.dna-review-main, .dna-review-aside { display: grid; gap: 16px; }
.dna-review-aside { position: sticky; top: 98px; }
.dna-summary-card { overflow: hidden; }
.dna-summary-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px; border-bottom: 1px solid hsl(var(--border)); }
.dna-summary-heading h2 { margin: 5px 0 0; font-size: .92rem; }
.dna-summary-heading > a { color: hsl(var(--primary)); font-size: .68rem; font-weight: 800; }
.dna-summary-card dl { display: grid; grid-template-columns: 1fr 1fr; margin: 0; }
.dna-summary-card dl > div { padding: 15px 20px; border-right: 1px solid hsl(var(--border)); border-bottom: 1px solid hsl(var(--border)); }
.dna-summary-card dl > div:nth-child(even) { border-right: 0; }
.dna-summary-card dl > div:nth-last-child(-n+2) { border-bottom: 0; }
.dna-summary-card dt { margin-bottom: 6px; color: hsl(var(--muted-foreground)); font-size: .61rem; font-weight: 800; text-transform: uppercase; }
.dna-summary-card dd { margin: 0; font-size: .73rem; white-space: pre-line; }
.dna-summary-card dd ul { display: grid; gap: 4px; margin: 0; padding-left: 16px; }
.dna-decision-card, .dna-version-card { padding: 22px; }
.dna-decision-card h2 { margin: 7px 0 10px; }
.dna-decision-card > p { color: hsl(var(--muted-foreground)); font-size: .7rem; }
.dna-decision-card form { margin-top: 10px; }
.dna-active-state { display: flex; align-items: center; gap: 10px; margin-top: 18px; color: hsl(var(--success)); font-size: .74rem; }
.dna-version-card dl { display: grid; gap: 0; margin: 12px 0 0; }
.dna-version-card dl > div { display: flex; justify-content: space-between; gap: 15px; padding: 10px 0; border-top: 1px solid hsl(var(--border)); font-size: .7rem; }
.dna-version-card dt { color: hsl(var(--muted-foreground)); }
.dna-version-card dd { margin: 0; font-weight: 800; }

/* Clientes y onboarding */
.clients-heading { align-items: center; }
.client-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.client-grid { display: grid; grid-template-columns: repeat(3, minmax(250px, 1fr)); gap: 16px; }
.client-card { display: grid; align-content: start; gap: 18px; padding: 22px; }
.client-card.current { border-color: hsl(var(--primary) / .3); box-shadow: 0 0 0 3px hsl(var(--primary) / .06); }
.client-card-top { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: start; gap: 11px; }
.client-card-top .tenant-avatar { width: 42px; height: 42px; }
.client-card-top h2 { margin: 3px 0 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-card-top p { margin: 0; color: hsl(var(--muted-foreground)); font-size: .64rem; }
.client-card dl { display: grid; margin: 0; border-top: 1px solid hsl(var(--border)); }
.client-card dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid hsl(var(--border)); font-size: .67rem; }
.client-card dt { color: hsl(var(--muted-foreground)); }
.client-card dd { margin: 0; font-weight: 800; text-align: right; }
.client-card form { margin: 0; }
.credit-adjustment { border: 1px solid hsl(var(--border)); border-radius: 8px; }
.credit-adjustment summary { padding: 11px 12px; cursor: pointer; color: hsl(var(--primary)); font-size: .67rem; font-weight: 800; }
.credit-adjust-form { display: grid; gap: 9px; padding: 0 12px 12px; }
.credit-adjust-form label { display: grid; gap: 5px; color: hsl(var(--muted-foreground)); font-size: .61rem; font-weight: 800; }
.credit-adjust-form input { width: 100%; padding: 9px 10px; color: hsl(var(--foreground)); background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: 7px; }
.onboarding-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.onboarding-form-card { overflow: hidden; }
.onboarding-card-heading { display: flex; align-items: flex-start; gap: 15px; padding: 25px 28px; border-bottom: 1px solid hsl(var(--border)); }
.onboarding-card-heading .step-number { display: grid; place-items: center; flex: 0 0 auto; width: 42px; height: 42px; color: hsl(0 0% 100%); background: hsl(var(--primary)); border-radius: 12px; font-weight: 900; }
.onboarding-card-heading h2 { margin: 5px 0; }
.onboarding-card-heading p { margin: 0; color: hsl(var(--muted-foreground)); font-size: .7rem; }
.onboarding-errors { margin: 20px 28px 0; }
.onboarding-errors ul { margin: 8px 0 0; padding-left: 18px; }
.onboarding-form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 28px; }
.onboarding-form label { display: grid; align-content: start; gap: 7px; color: hsl(var(--muted-foreground)); font-size: .7rem; font-weight: 800; }
.onboarding-form label.wide { grid-column: 1 / -1; }
.onboarding-form label > span { display: flex; align-items: center; gap: 8px; }
.onboarding-form label i { padding: 2px 5px; color: hsl(var(--primary)); background: hsl(var(--primary-soft)); border-radius: 4px; font-size: .51rem; font-style: normal; letter-spacing: .04em; text-transform: uppercase; }
.onboarding-form input { width: 100%; padding: 12px 13px; color: hsl(var(--foreground)); background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: 8px; }
.onboarding-form input:focus { border-color: hsl(var(--primary)); box-shadow: 0 0 0 3px hsl(var(--primary) / .1); outline: 0; }
.onboarding-form label small { font-weight: 500; }
.onboarding-actions { display: flex; justify-content: flex-end; gap: 10px; grid-column: 1 / -1; padding-top: 5px; }
.onboarding-flow-card { position: sticky; top: 98px; padding: 24px; }
.onboarding-flow-card ol { display: grid; gap: 0; margin: 18px 0 0; padding: 0; list-style: none; }
.onboarding-flow-card li { position: relative; display: grid; grid-template-columns: 32px 1fr; gap: 10px; min-height: 66px; color: hsl(var(--muted-foreground)); }
.onboarding-flow-card li::after { content: ""; position: absolute; top: 32px; bottom: 0; left: 15px; border-left: 1px solid hsl(var(--border)); }
.onboarding-flow-card li:last-child::after { display: none; }
.onboarding-flow-card li > span { position: relative; z-index: 1; display: grid; place-items: center; align-self: start; width: 32px; height: 32px; background: hsl(var(--muted)); border-radius: 50%; font-size: .67rem; font-weight: 800; }
.onboarding-flow-card li.current > span { color: hsl(0 0% 100%); background: hsl(var(--primary)); }
.onboarding-flow-card li div { display: grid; align-content: start; }
.onboarding-flow-card li strong { color: hsl(var(--foreground)); font-size: .75rem; }
.onboarding-flow-card li small { font-size: .63rem; }

/* Integraciones */
.integration-heading { align-items: center; }
.domain-chip { padding: 9px 13px; color: hsl(var(--success)); background: hsl(var(--success-soft)); border: 1px solid hsl(var(--success) / .18); border-radius: 99px; font-size: .72rem; font-weight: 800; }
.integration-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.integration-main { display: grid; gap: 20px; min-width: 0; }
.provider-card { overflow: hidden; }
.provider-heading { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 15px; padding: 24px; border-bottom: 1px solid hsl(var(--border)); }
.provider-heading h2 { margin: 3px 0; }
.provider-heading p { margin: 0; color: hsl(var(--muted-foreground)); font-size: .73rem; }
.provider-symbol { display: grid; place-items: center; width: 48px; height: 48px; color: hsl(0 0% 100%); border-radius: 14px; font-size: 1.2rem; font-weight: 900; }
.x-symbol { background: hsl(0 0% 4%); border: 1px solid hsl(0 0% 25%); }
.youtube-symbol { background: hsl(0 100% 45%); color: white; }
.meta-symbol { background: hsl(220 92% 54%); }
.openai-symbol { color: hsl(var(--foreground)); background: hsl(var(--primary-soft)); border: 1px solid hsl(var(--primary) / .2); font-size: .8rem; }
.integration-steps { display: grid; grid-template-columns: repeat(3, 1fr); padding: 22px 24px; border-bottom: 1px solid hsl(var(--border)); }
.integration-step { position: relative; display: flex; align-items: flex-start; gap: 10px; padding-right: 20px; color: hsl(var(--muted-foreground)); }
.integration-step::after { content: ""; position: absolute; top: 15px; right: 8px; width: calc(100% - 52px); border-top: 1px solid hsl(var(--border)); transform: translateX(50%); }
.integration-step:last-child::after { display: none; }
.integration-step > span { position: relative; z-index: 1; display: grid; place-items: center; flex: 0 0 auto; width: 30px; height: 30px; background: hsl(var(--muted)); border: 1px solid hsl(var(--border)); border-radius: 50%; font-size: .7rem; font-weight: 800; }
.integration-step div { display: grid; gap: 2px; }
.integration-step strong { color: hsl(var(--foreground)); font-size: .72rem; }
.integration-step small { font-size: .6rem; }
.integration-step.current > span { color: hsl(0 0% 100%); background: hsl(var(--primary)); border-color: hsl(var(--primary)); }
.integration-step.complete > span { color: hsl(var(--success)); background: hsl(var(--success-soft)); border-color: hsl(var(--success) / .25); }
.credential-box { margin: 20px 24px; background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: var(--radius-sm); }
.credential-box summary { padding: 15px 17px; cursor: pointer; font-size: .76rem; font-weight: 800; }
.settings-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 0 17px 17px; }
.settings-form label { display: grid; gap: 7px; color: hsl(var(--muted-foreground)); font-size: .68rem; font-weight: 800; }
.settings-form label:nth-of-type(3), .settings-form .readonly-field, .settings-form .button, .settings-form .wide { grid-column: 1 / -1; }
.settings-form input, .settings-form select { width: 100%; padding: 11px 12px; color: hsl(var(--foreground)); background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: 8px; }
.settings-form label small { font-weight: 500; line-height: 1.4; }
.button.secondary { color: hsl(var(--primary)); background: hsl(var(--primary-soft)); border-color: hsl(var(--primary) / .18); }
.readonly-field { display: grid; gap: 6px; }
.readonly-field > span { color: hsl(var(--muted-foreground)); font-size: .68rem; font-weight: 800; }
.readonly-field code { overflow: auto; padding: 10px 12px; color: hsl(var(--foreground)); background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: 8px; font-size: .68rem; white-space: nowrap; }
.scope-box { margin: 0 24px 20px; padding: 18px; border: 1px solid hsl(var(--border)); border-radius: var(--radius-sm); }
.scope-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.scope-list code { padding: 5px 7px; color: hsl(var(--primary)); background: hsl(var(--primary-soft)); border-radius: 5px; font-size: .61rem; }
.scope-box p { margin: 0; color: hsl(var(--muted-foreground)); font-size: .68rem; }
.ai-provider-summary { margin-top: 20px; }
.ai-model-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0 14px; }
.ai-model-grid > span { display: grid; gap: 5px; min-width: 0; padding: 10px; background: hsl(var(--muted)); border-radius: 7px; }
.ai-model-grid small { color: hsl(var(--muted-foreground)); font-size: .58rem; font-weight: 800; }
.ai-model-grid code { overflow: hidden; color: hsl(var(--foreground)); font-size: .63rem; text-overflow: ellipsis; white-space: nowrap; }
.openai-settings-form label:nth-of-type(3) { grid-column: auto; }
.connect-action { display: flex; align-items: center; gap: 12px; padding: 20px 24px; border-top: 1px solid hsl(var(--border)); }
.connect-action small { color: hsl(var(--muted-foreground)); font-size: .64rem; }
.detected-accounts { padding: 20px 24px; border-top: 1px solid hsl(var(--border)); }
.account-row { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 10px; min-height: 55px; border-bottom: 1px solid hsl(var(--border)); }
.account-row:last-child { border-bottom: 0; }
.account-type { display: grid; place-items: center; width: 28px; height: 28px; color: hsl(var(--primary)); background: hsl(var(--primary-soft)); border-radius: 8px; font-size: .65rem; font-weight: 900; }
.account-row div { display: grid; }
.account-row strong { font-size: .74rem; }
.account-row small { color: hsl(var(--muted-foreground)); font-size: .62rem; }
.integration-aside { display: grid; gap: 20px; }
.readiness-card, .roadmap-card { padding: 22px; }
.readiness-card h2 { margin: 6px 0 18px; }
.readiness-state { display: flex; align-items: center; gap: 10px; padding: 12px; background: hsl(var(--warning-soft)); border-radius: var(--radius-sm); }
.readiness-state i { width: 9px; height: 9px; background: hsl(var(--warning)); border-radius: 50%; }
.readiness-state.ready { background: hsl(var(--success-soft)); }
.readiness-state.ready i { background: hsl(var(--success)); }
.readiness-state span { display: grid; }
.readiness-state strong { font-size: .75rem; }
.readiness-state small { color: hsl(var(--muted-foreground)); font-size: .61rem; }
.readiness-card > p { margin: 16px 0 0; color: hsl(var(--muted-foreground)); font-size: .7rem; }
.storage-credential-box { margin-top: 16px; border-top: 1px solid hsl(var(--border)); }
.storage-credential-box summary { padding: 14px 0 2px; cursor: pointer; color: hsl(var(--primary)); font-size: .68rem; font-weight: 800; }
.storage-settings-form { display: grid; gap: 11px; padding-top: 12px; }
.storage-settings-form label { display: grid; gap: 5px; color: hsl(var(--muted-foreground)); font-size: .62rem; font-weight: 800; }
.storage-settings-form input { width: 100%; min-width: 0; padding: 9px 10px; color: hsl(var(--foreground)); background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: 7px; font-size: .66rem; }
.roadmap-card > .eyebrow { margin-bottom: 9px; }
.roadmap-row { display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid hsl(var(--border)); }
.roadmap-row:last-child { border-bottom: 0; }
.roadmap-row > span { display: grid; place-items: center; width: 26px; height: 26px; color: hsl(var(--muted-foreground)); background: hsl(var(--muted)); border-radius: 50%; font-size: .65rem; font-weight: 800; }
.roadmap-row div { display: grid; }
.roadmap-row strong { font-size: .75rem; }
.roadmap-row small { color: hsl(var(--muted-foreground)); font-size: .61rem; }
.security-note { display: flex; align-items: flex-start; gap: 12px; padding: 20px; }
.security-note strong { font-size: .76rem; }
.security-note p { margin: 4px 0 0; color: hsl(var(--muted-foreground)); font-size: .66rem; }

/* Estudio creativo */
.studio-heading { align-items: center; }
.studio-metrics { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 20px; }
.credit-metric strong { color: hsl(var(--primary)); }
.metric-card .metric-word { margin-top: 17px; font-size: 1.55rem; }
.studio-layout { display: grid; grid-template-columns: minmax(0, 1fr) 355px; gap: 20px; align-items: start; }
.studio-list-card { overflow: hidden; }
.studio-list { display: grid; }
.studio-row { position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr) 180px; align-items: center; gap: 15px; min-height: 112px; padding: 18px 42px 18px 22px; border-bottom: 1px solid hsl(var(--border)); transition: background .15s ease; }
.studio-row:last-child { border-bottom: 0; }
.studio-row:hover { background: hsl(var(--primary-soft) / .55); }
.creative-icon { display: grid; place-items: center; width: 44px; height: 44px; color: hsl(var(--primary)); background: hsl(var(--primary-soft)); border-radius: 12px; font-size: .69rem; font-weight: 900; }
.studio-row-copy { min-width: 0; }
.studio-row-copy h3 { margin: 6px 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-row-meta { display: grid; justify-items: end; gap: 8px; }
.studio-row-meta small { color: hsl(var(--muted-foreground)); font-size: .61rem; text-align: right; }
.studio-side, .brief-side, .creative-aside { display: grid; gap: 20px; }
.cost-card { padding: 23px; }
.cost-card h2 { margin: 7px 0 15px; }
.cost-card > p { color: hsl(var(--muted-foreground)); font-size: .71rem; }
.cost-card ul { display: grid; gap: 7px; margin: 18px 0 0; padding-left: 18px; color: hsl(var(--muted-foreground)); font-size: .68rem; }
.cost-rule { display: flex; align-items: center; gap: 13px; padding: 14px; color: hsl(var(--primary)); background: hsl(var(--primary-soft)); border-radius: var(--radius-sm); }
.cost-rule strong { font-size: 2rem; line-height: 1; }
.cost-rule span { max-width: 190px; font-size: .68rem; font-weight: 750; }
.ai-settings { overflow: hidden; }
.ai-settings > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 21px 22px; cursor: pointer; list-style: none; }
.ai-settings > summary::-webkit-details-marker { display: none; }
.ai-settings > summary > span:first-child { display: grid; gap: 5px; }
.ai-settings-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 0 22px 22px; border-top: 1px solid hsl(var(--border)); }
.ai-settings-form label { display: grid; align-content: start; gap: 7px; padding-top: 18px; color: hsl(var(--muted-foreground)); font-size: .66rem; font-weight: 800; }
.ai-settings-form label.wide, .ai-settings-form .wide { grid-column: 1 / -1; }
.ai-settings-form input:not([type="checkbox"]), .ai-settings-form select { width: 100%; padding: 10px 11px; color: hsl(var(--foreground)); background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: 8px; }
.ai-settings-form small { font-weight: 500; line-height: 1.4; }
.toggle-field { grid-template-columns: 18px 1fr; align-items: start; }
.toggle-field input { margin: 3px 0 0; }
.toggle-field span { display: grid; gap: 3px; }
.toggle-field strong { color: hsl(var(--foreground)); }
.studio-empty { display: flex; align-items: center; justify-content: space-between; gap: 25px; min-height: 190px; padding: 30px; }
.studio-empty.compact { min-height: 250px; }
.studio-empty h2 { margin: 7px 0; }
.studio-empty p { max-width: 580px; margin: 0; color: hsl(var(--muted-foreground)); font-size: .76rem; }
.studio-blocked { min-height: auto; margin-bottom: 20px; border-left: 4px solid hsl(var(--warning)); }
.studio-blocked .shield { flex: 0 0 auto; color: hsl(var(--warning)); background: hsl(var(--warning-soft)); }

/* Brief creativo */
.brief-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 20px; align-items: start; }
.brief-card { overflow: hidden; }
.brief-form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 28px; }
.brief-form > label { display: grid; align-content: start; gap: 7px; color: hsl(var(--muted-foreground)); font-size: .7rem; font-weight: 800; }
.brief-form .wide { grid-column: 1 / -1; }
.brief-form label i, .choice-field legend i { padding: 2px 5px; color: hsl(var(--primary)); background: hsl(var(--primary-soft)); border-radius: 4px; font-size: .51rem; font-style: normal; letter-spacing: .04em; text-transform: uppercase; }
.brief-form input:not([type="checkbox"]):not([type="radio"]), .brief-form textarea, .brief-form select { width: 100%; padding: 12px 13px; color: hsl(var(--foreground)); background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: 8px; resize: vertical; }
.brief-form input:focus, .brief-form textarea:focus, .brief-form select:focus { border-color: hsl(var(--primary)); box-shadow: 0 0 0 3px hsl(var(--primary) / .1); outline: 0; }
.brief-form label small { font-weight: 500; line-height: 1.45; }
.recipe-source { display: grid; gap: 16px; padding: 20px; background: hsl(var(--muted) / .35); border: 1px solid hsl(var(--border)); border-radius: 12px; }
.recipe-source h2 { margin: 5px 0 7px; font-size: 1rem; }
.recipe-source p { max-width: 760px; margin: 0; color: hsl(var(--muted-foreground)); font-size: .72rem; line-height: 1.55; }
.recipe-file-current { display: flex; gap: 18px; align-items: center; justify-content: space-between; padding: 14px 16px; background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: 9px; }
.recipe-file-current > div { display: grid; gap: 4px; min-width: 0; }
.recipe-file-current strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .74rem; }
.recipe-file-current small { color: hsl(var(--muted-foreground)); font-size: .62rem; }
.brief-section { display: flex; align-items: center; gap: 13px; margin: 8px -28px 0; padding: 22px 28px 4px; border-top: 1px solid hsl(var(--border)); }
.brief-section:first-of-type { margin-top: -28px; border-top: 0; }
.brief-section > span { display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; color: hsl(0 0% 100%); background: hsl(var(--primary)); border-radius: 10px; font-size: .75rem; font-weight: 900; }
.brief-section h2 { margin: 4px 0 0; }
.choice-field { margin: 0; padding: 0; border: 0; }
.choice-field legend { margin-bottom: 8px; color: hsl(var(--muted-foreground)); font-size: .7rem; font-weight: 800; }
.choice-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.choice-grid.two { grid-template-columns: 1fr 1fr; }
.choice-grid label { display: grid; grid-template-columns: 18px 1fr; align-items: start; gap: 8px; min-height: 70px; padding: 13px; background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: 9px; cursor: pointer; }
.choice-grid input { margin: 3px 0 0; }
.choice-grid label > span { display: grid; gap: 3px; }
.choice-grid strong { font-size: .71rem; }
.choice-grid small { color: hsl(var(--muted-foreground)); font-size: .59rem; line-height: 1.35; }
.choice-grid .disabled-choice { opacity: .55; cursor: not-allowed; }
.tone-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; }
.tone-grid label { display: grid; gap: 6px; color: hsl(var(--muted-foreground)); font-size: .65rem; font-weight: 800; }
.brief-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 6px; }
.dna-lock-card { display: flex; align-items: flex-start; gap: 14px; padding: 22px; }
.dna-lock-card .shield { flex: 0 0 auto; }
.dna-lock-card h2 { margin: 5px 0 8px; }
.dna-lock-card p { margin: 0; color: hsl(var(--muted-foreground)); font-size: .68rem; }

/* Resultado creativo */
.creative-heading { align-items: flex-start; }
.generate-action { display: grid; justify-items: stretch; flex: 0 0 230px; gap: 7px; }
.generate-action small { color: hsl(var(--muted-foreground)); font-size: .61rem; text-align: center; }
.creative-detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.variant-stack { display: grid; gap: 18px; }
.brief-summary-card { overflow: hidden; }
.brief-summary-card dl { display: grid; grid-template-columns: 1fr 1fr; margin: 0; }
.brief-summary-card dl > div { padding: 16px 21px; border-right: 1px solid hsl(var(--border)); border-bottom: 1px solid hsl(var(--border)); }
.brief-summary-card dl > div:nth-child(even) { border-right: 0; }
.brief-summary-card dt { margin-bottom: 5px; color: hsl(var(--muted-foreground)); font-size: .6rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.brief-summary-card dd { margin: 0; font-size: .73rem; white-space: pre-line; }
.variant-card { overflow: hidden; }
.variant-card.selected { border-color: hsl(var(--primary) / .4); box-shadow: 0 0 0 3px hsl(var(--primary) / .07); }
.variant-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 24px; border-bottom: 1px solid hsl(var(--border)); }
.variant-heading h2 { margin: 6px 0 0; }
.voice-score { display: grid; justify-items: center; flex: 0 0 auto; min-width: 72px; padding: 10px; color: hsl(var(--primary)); background: hsl(var(--primary-soft)); border-radius: 12px; }
.voice-score strong { font-size: 1.35rem; line-height: 1; }
.voice-score small { margin-top: 4px; font-size: .55rem; }
.variant-rationale, .copy-preview, .slides-section { padding: 20px 24px; border-bottom: 1px solid hsl(var(--border)); }
.variant-rationale { background: hsl(var(--background)); }
.variant-rationale strong { font-size: .69rem; }
.variant-rationale p { margin: 6px 0 0; color: hsl(var(--muted-foreground)); font-size: .7rem; }
.copy-preview > .eyebrow:not(:first-child) { margin-top: 20px; }
.copy-preview h3 { margin: 7px 0 0; font-size: 1.4rem; }
.copy-preview p { margin: 7px 0 0; font-size: .78rem; line-height: 1.65; white-space: pre-line; }
.hashtags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 14px; }
.hashtags span, .rendition-list span { padding: 5px 7px; color: hsl(var(--primary)); background: hsl(var(--primary-soft)); border-radius: 5px; font-size: .58rem; }
.section-inline-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.section-inline-heading h3 { margin: 4px 0 0; }
.section-inline-heading > small { color: hsl(var(--muted-foreground)); font-size: .6rem; }
.slide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.slide-card { position: relative; min-height: 240px; padding: 17px; overflow: hidden; color: hsl(280 70% 92%); background: linear-gradient(145deg, hsl(280 75% 15%), hsl(var(--primary) / .82)); border-radius: 12px; }
.slide-card::after { content: ""; position: absolute; right: -45px; bottom: -45px; width: 120px; height: 120px; background: hsl(var(--secondary) / .2); border-radius: 50%; }
.slide-card > * { position: relative; z-index: 1; }
.slide-number { display: grid; place-items: center; width: 28px; height: 28px; color: hsl(280 75% 15%); background: hsl(var(--secondary)); border-radius: 50%; font-size: .65rem; font-weight: 900; }
.slide-card > small { display: block; margin-top: 15px; color: hsl(var(--secondary)); font-size: .53rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.slide-card h4 { margin: 8px 0; font-size: .95rem; line-height: 1.25; }
.slide-card p { margin: 0; color: hsl(280 40% 82%); font-size: .65rem; }
.slide-card em { display: block; margin-top: 14px; color: hsl(280 22% 68%); font-size: .56rem; font-style: normal; }
.validation-strip { display: flex; align-items: flex-start; gap: 11px; margin: 20px 24px 0; padding: 13px; background: hsl(var(--success-soft)); border-radius: var(--radius-sm); }
.validation-strip.failed { background: hsl(var(--danger-soft)); }
.validation-strip.failed .shield { color: hsl(var(--danger)); background: hsl(var(--danger-soft)); }
.validation-strip > div { display: grid; gap: 3px; }
.validation-strip strong { font-size: .7rem; }
.validation-strip small { color: hsl(var(--muted-foreground)); font-size: .61rem; }
.voice-notes { display: grid; gap: 5px; margin: 14px 24px 0; padding-left: 20px; color: hsl(var(--muted-foreground)); font-size: .65rem; }
.rendition-box { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, .7fr); align-items: center; gap: 20px; margin: 20px 24px; padding: 16px; background: hsl(var(--background)); border-radius: var(--radius-sm); }
.rendition-box > div:first-child { display: grid; gap: 4px; }
.rendition-box strong { font-size: .72rem; }
.rendition-box p { margin: 0; color: hsl(var(--muted-foreground)); font-size: .62rem; }
.rendition-list { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 5px; }
.rendition-list span.ready { color: hsl(var(--success)); background: hsl(var(--success-soft)); }
.visual-production { padding: 4px 24px 24px; }
.art-direction { display: grid; gap: 10px; margin-bottom: 18px; padding: 16px; background: hsl(var(--primary-soft)); border: 1px solid hsl(var(--primary) / .25); border-radius: var(--radius-sm); }
.art-direction.busy { border-style: dashed; }
.art-direction-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.art-direction-heading > div { display: grid; gap: 4px; }
.art-direction-heading h3 { margin: 0; font-size: .82rem; }
.art-direction-heading p { margin: 0; color: hsl(var(--muted-foreground)); font-size: .62rem; max-width: 62ch; }
.art-direction-heading form { flex: 0 0 auto; }
.art-direction-actions { display: grid; flex: 0 0 auto; gap: 8px; justify-items: stretch; }
.art-direction-actions .art-brand-colors .button { width: 100%; }
.art-direction-note, .art-direction-review { margin: 0; color: hsl(var(--muted-foreground)); font-size: .6rem; }
.art-direction-error { margin: 0; padding: 8px 10px; color: hsl(var(--danger)); background: hsl(var(--card)); border-radius: 6px; font-size: .6rem; }
.art-slide-idea { margin: 10px 0 0; color: hsl(var(--muted-foreground)); font-size: .6rem; font-style: normal; }
.art-feedback { margin-top: 8px; }
.rendition-tile { display: grid; gap: 6px; margin: 0; }
.art-photo { margin-top: 8px; }
.art-photo summary { cursor: pointer; color: hsl(var(--primary)); font-size: .62rem; font-weight: 700; }
.art-photo-note { margin: 8px 0; color: hsl(var(--muted-foreground)); font-size: .6rem; }
.art-photo-compare { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; }
.art-photo-compare figure { display: grid; gap: 6px; margin: 0; width: 180px; }
.art-photo-compare img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 10px; background: hsl(var(--muted)); border: 1px solid hsl(var(--border)); }
.art-photo-candidate img { border-color: hsl(var(--primary)); box-shadow: 0 0 0 3px hsl(var(--primary) / .15); }
.art-photo-compare figcaption { font-size: .6rem; font-weight: 700; }
.art-photo-decide { display: flex; gap: 6px; flex-wrap: wrap; }
.art-photo-option { display: grid; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid hsl(var(--border)); }
.art-photo-option label { display: grid; gap: 4px; font-size: .62rem; font-weight: 700; }
.art-photo-option small { color: hsl(var(--muted-foreground)); font-weight: 500; }
.art-photo-option .button { justify-self: start; }
.rendition-tile figcaption { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: .6rem; }
.rendition-tile figcaption strong { font-weight: 700; }
.link-button { padding: 0; color: hsl(var(--primary)); background: none; border: 0; font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.art-feedback-sizes { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.art-feedback-sizes legend { margin-bottom: 6px; padding: 0; font-size: .62rem; font-weight: 700; }
.art-size-choice { display: flex !important; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border: 1px solid hsl(var(--border)); border-radius: 10px; cursor: pointer; }
.art-size-choice:has(input:checked) { border-color: hsl(var(--primary)); background: hsl(var(--primary-soft)); }
.art-size-choice img { width: 34px; height: 34px; object-fit: cover; border-radius: 5px; background: hsl(var(--muted)); }
.art-size-choice img.format-portrait { height: 42px; }
.art-size-choice img.format-story { height: 54px; width: 30px; }
.art-size-choice img.format-landscape { width: 54px; height: 28px; }
.art-size-choice span { display: grid; gap: 1px; font-size: .62rem; }
.art-size-choice small { color: hsl(var(--muted-foreground)); font-weight: 500; }
.art-feedback summary { cursor: pointer; color: hsl(var(--primary)); font-size: .62rem; font-weight: 700; }
.art-feedback form { display: grid; gap: 8px; margin-top: 8px; }
.art-feedback label { display: grid; gap: 4px; font-size: .6rem; }
.art-feedback textarea { width: 100%; }
@media (max-width: 720px) { .art-direction-heading { flex-direction: column; } }
.visual-slide-list { display: grid; gap: 14px; }
.visual-slide-card { padding: 14px; background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: var(--radius-sm); }
.visual-slide-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.visual-slide-heading > div { display: flex; align-items: center; gap: 10px; }
.visual-slide-heading > div > span:last-child { display: grid; gap: 2px; }
.visual-slide-heading strong { font-size: .7rem; }
.visual-slide-heading small { color: hsl(var(--muted-foreground)); font-size: .58rem; }
.visual-slide-heading .background-source { flex: 0 1 auto; padding: 5px 7px; color: hsl(var(--primary)); background: hsl(var(--primary-soft)); border-radius: 6px; font-size: .52rem; font-weight: 800; text-align: right; }
.rendition-preview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 10px; margin-top: 12px; }
.rendition-preview-grid a { position: relative; display: block; aspect-ratio: 1; overflow: hidden; background: hsl(var(--muted)); border: 1px solid hsl(var(--border)); border-radius: 9px; cursor: zoom-in; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.rendition-preview-grid a:hover { border-color: hsl(var(--primary) / .65); box-shadow: 0 10px 26px hsl(var(--shadow) / .12); transform: translateY(-2px); }
.rendition-preview-grid a:focus-visible { border-color: hsl(var(--primary)); box-shadow: 0 0 0 3px hsl(var(--primary) / .18); outline: 0; }
.rendition-preview-grid a.format-portrait { aspect-ratio: 4 / 5; }
.rendition-preview-grid a.format-story { aspect-ratio: 9 / 16; }
.rendition-preview-grid a.format-landscape { aspect-ratio: 1200 / 627; }
.rendition-preview-grid a.format-youtube_thumbnail { aspect-ratio: 16 / 9; }
.rendition-preview-grid img { display: block; width: 100%; height: 100%; object-fit: cover; }
.rendition-preview-grid span { position: absolute; right: 6px; bottom: 6px; padding: 4px 6px; color: #fff; background: rgb(0 0 0 / .65); border-radius: 5px; font-size: .5rem; }
.modal-open { overflow: hidden; }
.rendition-lightbox { width: min(1120px, calc(100vw - 40px)); max-width: none; max-height: calc(100dvh - 40px); padding: 0; overflow: visible; color: hsl(var(--foreground)); background: transparent; border: 0; }
.rendition-lightbox::backdrop { background: rgb(7 2 14 / .82); backdrop-filter: blur(7px); }
.rendition-lightbox-shell { position: relative; padding: 18px; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: 18px; box-shadow: 0 28px 90px rgb(0 0 0 / .42); }
.rendition-lightbox figure { display: grid; gap: 13px; margin: 0; }
.rendition-lightbox-frame { display: grid; place-items: center; min-height: 220px; max-height: calc(100dvh - 140px); overflow: hidden; background-color: hsl(var(--background)); background-image: linear-gradient(45deg, hsl(var(--muted)) 25%, transparent 25%), linear-gradient(-45deg, hsl(var(--muted)) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, hsl(var(--muted)) 75%), linear-gradient(-45deg, transparent 75%, hsl(var(--muted)) 75%); background-position: 0 0, 0 12px, 12px -12px, -12px 0; background-size: 24px 24px; border-radius: 12px; }
.rendition-lightbox img { display: block; max-width: 100%; max-height: calc(100dvh - 140px); object-fit: contain; }
.rendition-lightbox figcaption { display: grid; gap: 3px; padding: 0 44px 0 3px; }
.rendition-lightbox figcaption strong { font-size: .78rem; }
.rendition-lightbox figcaption small { color: hsl(var(--muted-foreground)); font-size: .58rem; }
.rendition-lightbox-close { position: absolute; z-index: 2; top: 10px; right: 10px; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; color: #fff; background: rgb(0 0 0 / .72); border: 1px solid rgb(255 255 255 / .18); border-radius: 50%; cursor: pointer; font: inherit; font-size: 1.25rem; line-height: 1; }
.rendition-lightbox-close:hover { background: hsl(var(--primary)); }
.rendition-lightbox-close:focus-visible { box-shadow: 0 0 0 3px hsl(var(--secondary) / .45); outline: 0; }
.visual-empty { display: flex; align-items: center; gap: 9px; margin-top: 12px; padding: 13px; color: hsl(var(--muted-foreground)); background: hsl(var(--muted)); border-radius: 8px; }
.visual-empty span { font-size: 1rem; }
.visual-empty p, .visual-warning { margin: 0; font-size: .62rem; }
.visual-warning { margin-top: 11px; color: hsl(var(--warning)); }
.render-form { display: grid; grid-template-columns: minmax(160px, 1fr) auto; align-items: end; gap: 10px; margin-top: 12px; }
.render-form label { font-size: .58rem; }
.render-form select { margin-top: 5px; }
.regenerate-form > small { grid-column: 1 / -1; color: hsl(var(--muted-foreground)); font-size: .56rem; }
.background-picker { margin-top: 12px; border-top: 1px solid hsl(var(--border)); }
.background-picker > summary { padding: 12px 2px 0; color: hsl(var(--primary)); cursor: pointer; font-size: .62rem; font-weight: 900; list-style-position: inside; }
.background-picker[open] > summary { margin-bottom: 12px; }
.background-picker-form { display: grid; gap: 12px; padding: 14px; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: 10px; }
.background-picker-form label, .background-picker-form legend { color: hsl(var(--muted-foreground)); font-size: .58rem; font-weight: 800; }
.background-picker-form select { width: 100%; margin-top: 5px; padding: 9px 10px; color: hsl(var(--foreground)); background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: 8px; }
.background-asset-choice { display: grid; grid-template-columns: minmax(0, 1fr) 100px; align-items: end; gap: 12px; }
.background-asset-preview { display: grid; place-items: center; width: 100px; aspect-ratio: 1; overflow: hidden; background: hsl(var(--muted)); border: 1px solid hsl(var(--border)); border-radius: 9px; }
.background-asset-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.background-picker-form fieldset { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding: 0; border: 0; }
.background-picker-form legend { grid-column: 1 / -1; margin-bottom: 2px; }
.background-mode-option { display: grid; grid-template-columns: 16px minmax(0, 1fr); align-items: start; gap: 8px; padding: 10px; background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: 8px; cursor: pointer; }
.background-mode-option:has(input:checked) { border-color: hsl(var(--primary)); box-shadow: 0 0 0 2px hsl(var(--primary) / .1); }
.background-mode-option input { margin: 2px 0 0; accent-color: hsl(var(--primary)); }
.background-mode-option span { display: grid; gap: 3px; }
.background-mode-option strong { color: hsl(var(--foreground)); font-size: .62rem; }
.background-mode-option small { color: hsl(var(--muted-foreground)); font-size: .53rem; font-weight: 500; line-height: 1.35; }
.background-picker-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.background-picker-options [hidden] { display: none !important; }
.background-picker-form > small { color: hsl(var(--muted-foreground)); font-size: .55rem; line-height: 1.4; }
.background-picker-empty { display: grid; justify-items: start; gap: 9px; padding: 13px; background: hsl(var(--muted)); border-radius: 8px; }
.background-picker-empty p { margin: 0; color: hsl(var(--muted-foreground)); font-size: .6rem; }
.background-picker-divider { display: flex; align-items: center; gap: 9px; margin: 12px 0; color: hsl(var(--muted-foreground)); font-size: .54rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.background-picker-divider::before, .background-picker-divider::after { flex: 1; height: 1px; background: hsl(var(--border)); content: ''; }
.color-background-preview { min-height: 76px; border: 1px solid hsl(var(--border)); border-radius: 9px; box-shadow: inset 0 0 0 1px hsl(0 0% 100% / .1); }
.background-color-control { display: grid; gap: 5px; }
.background-color-input-row { display: grid; grid-template-columns: minmax(0, 1fr) 46px 57px; align-items: center; gap: 7px; }
.background-color-input-row select { margin-top: 0; }
.background-color-input-row input[type="color"] { width: 46px; height: 39px; padding: 3px; background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: 8px; cursor: pointer; }
.background-color-input-row input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.background-color-input-row input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 5px; }
.background-color-input-row output { color: hsl(var(--muted-foreground)); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .51rem; font-weight: 700; }
.background-restore-form { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.background-restore-form .text-button { padding: 0; color: hsl(var(--primary)); font-size: .58rem; }
.background-restore-form small { color: hsl(var(--muted-foreground)); font-size: .52rem; }
.approval-help { display: block; margin-top: 8px; color: hsl(var(--muted-foreground)); font-size: .58rem; text-align: center; }
.variant-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 18px 24px; border-top: 1px solid hsl(var(--border)); }
.variant-actions > small { margin-right: auto; color: hsl(var(--muted-foreground)); font-size: .6rem; }
.creative-aside { position: sticky; top: 98px; }
.creative-review-card p { color: hsl(var(--muted-foreground)); font-size: .7rem; }
.publication-card { padding: 22px; }
.publication-card h2 { margin: 6px 0 10px; }
.publication-card > p { margin: 0; color: hsl(var(--muted-foreground)); font-size: .68rem; line-height: 1.5; }
.publication-form { display: grid; gap: 12px; margin-top: 17px; }
.publication-form label { display: grid; gap: 6px; color: hsl(var(--muted-foreground)); font-size: .64rem; font-weight: 800; }
.publication-form select, .publication-form input, .publication-form textarea { width: 100%; min-width: 0; padding: 10px 11px; color: hsl(var(--foreground)); background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: 8px; }
.publication-form textarea { resize: vertical; line-height: 1.45; }
.publication-form select:focus, .publication-form input:focus, .publication-form textarea:focus { border-color: hsl(var(--primary)); box-shadow: 0 0 0 3px hsl(var(--primary) / .1); outline: 0; }
.publication-form > small, .publication-note { color: hsl(var(--muted-foreground)); font-size: .57rem; line-height: 1.45; }
.publication-form .character-count { justify-self: end; margin-top: -8px; color: hsl(var(--muted-foreground)); font-size: .55rem; }
.publication-form .character-count.over-limit { color: hsl(var(--danger)); }
.publication-form .confirmation-row { grid-template-columns: 18px 1fr; align-items: start; gap: 8px; padding: 11px; color: hsl(var(--foreground)); background: hsl(var(--muted)); border-radius: 8px; font-weight: 600; line-height: 1.4; }
.publication-form .confirmation-row input { width: auto; margin: 2px 0 0; padding: 0; }
.publication-history .external-post-link { grid-column: 1 / -1; color: hsl(var(--primary)); font-size: .58rem; font-weight: 800; text-decoration: none; }
.publication-empty { display: grid; gap: 4px; margin: 16px 0 12px; padding: 12px; color: hsl(var(--warning)); background: hsl(var(--warning-soft)); border-radius: 8px; }
.publication-empty strong { font-size: .68rem; }
.publication-empty small { font-size: .59rem; line-height: 1.4; }
.publication-history { display: grid; gap: 0; margin-top: 18px; border-top: 1px solid hsl(var(--border)); }
.publication-history > article { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 12px 0; border-bottom: 1px solid hsl(var(--border)); }
.publication-history > article > div { display: grid; grid-template-columns: 8px minmax(0, 1fr); align-items: center; gap: 8px; }
.publication-history > article > div > span:last-child { display: grid; min-width: 0; }
.publication-history strong, .publication-history small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.publication-history strong { font-size: .62rem; }
.publication-history small { color: hsl(var(--muted-foreground)); font-size: .55rem; }
.publication-history form { grid-column: 1 / -1; }
.publication-history .text-button { padding: 0; font-size: .58rem; }
.publication-history .danger { color: hsl(var(--danger)); }
.publication-note { margin-top: 13px !important; padding-top: 12px; border-top: 1px solid hsl(var(--border)); }
.run-card { padding: 22px; }
.run-card h2 { margin: 6px 0 13px; }
.run-card > p { color: hsl(var(--muted-foreground)); font-size: .68rem; }
.run-list { display: grid; }
.run-list > div { display: grid; grid-template-columns: 8px 1fr; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid hsl(var(--border)); }
.run-list > div > span:last-child { display: grid; }
.run-list strong { font-size: .67rem; }
.run-list small, .daily-limit { color: hsl(var(--muted-foreground)); font-size: .58rem; }
.daily-limit { display: block; margin-top: 13px; }

/* Biblioteca de marca */
.assets-heading { align-items: center; }
.pending-chip { color: hsl(var(--warning)); background: hsl(var(--warning-soft)); border-color: hsl(var(--warning) / .18); }
.brand-color-library { margin-bottom: 20px; padding: 22px; }
.brand-color-library .panel-heading { align-items: start; margin-bottom: 18px; }
.brand-color-library .panel-heading h2 { margin-bottom: 4px; }
.brand-color-library .panel-heading p { max-width: 720px; margin: 0; color: hsl(var(--muted-foreground)); font-size: .66rem; line-height: 1.45; }
.brand-color-swatches { display: flex; flex-wrap: wrap; gap: 12px; }
.brand-color-swatch, .brand-color-add { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 10px; min-width: 155px; padding: 8px; color: hsl(var(--foreground)); background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: 12px; text-align: left; }
button.brand-color-swatch, .brand-color-add { cursor: pointer; }
button.brand-color-swatch:hover, button.brand-color-swatch:focus-visible, .brand-color-add:hover, .brand-color-add:focus-visible { border-color: hsl(var(--primary)); box-shadow: 0 0 0 3px hsl(var(--primary) / .1); outline: 0; }
.brand-color-swatch > i, .brand-color-add > i { display: grid; place-items: center; width: 48px; height: 48px; background: var(--brand-swatch); border: 4px solid hsl(var(--card)); border-radius: 50%; box-shadow: 0 0 0 1px hsl(var(--border)); font-style: normal; }
.brand-color-swatch > span { display: grid; gap: 2px; }
.brand-color-swatch strong { overflow: hidden; font-size: .64rem; text-overflow: ellipsis; white-space: nowrap; }
.brand-color-swatch small { color: hsl(var(--muted-foreground)); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .55rem; }
.brand-color-add { grid-template-columns: 48px auto; color: hsl(var(--muted-foreground)); border-style: dashed; font-size: .62rem; font-weight: 800; }
.brand-color-add > i { color: hsl(var(--muted-foreground)); background: hsl(var(--muted)); border-style: dashed; font-size: 1.3rem; }
.brand-color-help { display: block; margin-top: 14px; color: hsl(var(--muted-foreground)); font-size: .55rem; line-height: 1.45; }
.brand-color-dialog { width: min(510px, calc(100vw - 28px)); padding: 0; color: hsl(var(--foreground)); background: transparent; border: 0; border-radius: 18px; }
.brand-color-dialog::backdrop { background: hsl(270 50% 5% / .72); backdrop-filter: blur(7px); }
.brand-color-dialog-shell { overflow: hidden; padding: 24px; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: 18px; box-shadow: 0 28px 80px hsl(270 50% 5% / .4); }
.brand-color-dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.brand-color-dialog-heading h2 { margin: 5px 0 0; }
.brand-color-dialog-heading > button { display: grid; place-items: center; width: 32px; height: 32px; color: hsl(var(--foreground)); background: hsl(var(--muted)); border: 0; border-radius: 50%; cursor: pointer; font-size: 1.1rem; }
.brand-color-form { display: grid; gap: 14px; }
.brand-color-form > label, .brand-color-value-panel label { display: grid; gap: 6px; color: hsl(var(--muted-foreground)); font-size: .62rem; font-weight: 800; }
.brand-color-form input { width: 100%; padding: 10px 11px; color: hsl(var(--foreground)); background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: 8px; }
.brand-color-large-preview { height: 68px; background: #000ACC; border: 1px solid hsl(var(--border)); border-radius: 999px; }
.brand-color-native { height: 44px; padding: 3px !important; cursor: pointer; }
.brand-color-tabs { display: grid; grid-template-columns: repeat(3, 1fr); padding: 4px; background: hsl(var(--muted)); border-radius: 999px; }
.brand-color-tabs button { padding: 9px 12px; color: hsl(var(--muted-foreground)); background: transparent; border: 0; border-radius: 999px; cursor: pointer; font-weight: 800; }
.brand-color-tabs button.active { color: hsl(var(--foreground)); background: hsl(var(--card)); box-shadow: 0 2px 8px hsl(270 30% 10% / .08); }
.brand-color-value-panel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.brand-color-value-panel[data-color-panel="hex"] { grid-template-columns: 1fr; }
.brand-color-value-panel[hidden] { display: none; }
.brand-color-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 2px; }
.brand-color-delete { margin-top: 12px; padding-top: 12px; border-top: 1px solid hsl(var(--border)); text-align: center; }
.brand-color-delete[hidden] { display: none; }
.asset-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.assets-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.asset-library { overflow: hidden; }
.asset-grid { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 1px; background: hsl(var(--border)); }
.asset-card { min-width: 0; background: hsl(var(--card)); }
.asset-preview { display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background-color: hsl(var(--background)); background-image: linear-gradient(45deg, hsl(var(--muted)) 25%, transparent 25%), linear-gradient(-45deg, hsl(var(--muted)) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, hsl(var(--muted)) 75%), linear-gradient(-45deg, transparent 75%, hsl(var(--muted)) 75%); background-position: 0 0, 0 8px, 8px -8px, -8px 0; background-size: 16px 16px; }
.asset-preview img { display: block; width: 100%; height: 100%; object-fit: contain; padding: 14px; }
.asset-preview.file-preview { align-content: center; gap: 5px; color: hsl(0 0% 100%); background: linear-gradient(145deg, hsl(280 75% 15%), hsl(var(--primary) / .84)); }
.asset-preview.file-preview span { font-size: 1.5rem; font-weight: 900; }
.asset-preview.file-preview small { color: hsl(var(--secondary)); font-size: .55rem; letter-spacing: .12em; }
.asset-copy { padding: 17px; }
.asset-copy h3 { margin: 6px 0 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-copy p { margin: 0; overflow: hidden; color: hsl(var(--muted-foreground)); font-size: .62rem; text-overflow: ellipsis; white-space: nowrap; }
.asset-copy > small { display: block; margin-top: 9px; color: hsl(var(--muted-foreground)); font-size: .57rem; }
.asset-side { display: grid; gap: 20px; }
.upload-card, .asset-guidance { padding: 22px; }
.upload-card h2 { margin: 6px 0 17px; }
.asset-upload-form { display: grid; gap: 14px; }
.asset-manage { margin: -6px 17px 17px; }
.asset-manage summary { cursor: pointer; color: hsl(var(--primary)); font-size: .62rem; font-weight: 700; }
.asset-manage form { display: grid; gap: 8px; margin-top: 10px; }
.asset-manage label { display: grid; gap: 4px; font-size: .62rem; font-weight: 700; }
.asset-manage small { color: hsl(var(--muted-foreground)); font-weight: 500; }
.asset-manage .button { justify-self: start; }
.danger-text { color: hsl(var(--danger)); }
.asset-upload-form label { display: grid; gap: 6px; color: hsl(var(--muted-foreground)); font-size: .67rem; font-weight: 800; }
.asset-upload-form input:not([type="file"]), .asset-upload-form select { width: 100%; padding: 11px 12px; color: hsl(var(--foreground)); background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: 8px; }
.asset-upload-form label small { font-size: .58rem; font-weight: 500; line-height: 1.4; }
.asset-storage-warning { display: flex; align-items: center; gap: 10px; padding: 13px; background: hsl(var(--warning-soft)); border-radius: var(--radius-sm); }
.asset-storage-warning .shield { color: hsl(var(--warning)); background: hsl(var(--warning-soft)); }
.asset-storage-warning p { margin: 0; color: hsl(var(--muted-foreground)); font-size: .66rem; }
.asset-guidance > .eyebrow { margin-bottom: 10px; }
.asset-guidance ol { display: grid; margin: 0; padding: 0; list-style: none; }
.asset-guidance li { display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 9px; padding: 10px 0; border-bottom: 1px solid hsl(var(--border)); }
.asset-guidance li:last-child { border-bottom: 0; }
.asset-guidance li > span { display: grid; place-items: center; width: 27px; height: 27px; color: hsl(var(--primary)); background: hsl(var(--primary-soft)); border-radius: 50%; font-size: .61rem; font-weight: 900; }
.asset-guidance li div { display: grid; }
.asset-guidance strong { font-size: .69rem; }
.asset-guidance small { color: hsl(var(--muted-foreground)); font-size: .58rem; }

/* Control de agentes MCP */
.agent-heading { align-items: center; }
.agent-callout { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(360px, 1.2fr); gap: 24px; align-items: center; margin-bottom: 20px; padding: 22px 24px; }
.agent-callout > div:first-child { display: grid; gap: 8px; min-width: 0; }
.agent-callout code { overflow: hidden; padding: 11px 13px; color: hsl(var(--primary)); background: hsl(var(--primary-soft)); border-radius: 8px; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.agent-boundary { display: grid; gap: 4px; padding-left: 24px; border-left: 1px solid hsl(var(--border)); }
.agent-boundary strong { font-size: .88rem; }
.agent-boundary span { color: hsl(var(--muted-foreground)); font-size: .72rem; line-height: 1.55; }
.agent-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 20px; align-items: start; }
.agent-column { display: grid; gap: 20px; min-width: 0; }
.agent-card { padding: 22px; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.section-title-row h2 { margin: 5px 0 0; }
.count-pill { padding: 5px 9px; color: hsl(var(--muted-foreground)); background: hsl(var(--muted)); border-radius: 999px; font-size: .62rem; font-weight: 800; white-space: nowrap; }
.service-account-list, .proposal-list, .tool-call-list { display: grid; gap: 12px; }
.service-account { padding: 15px; background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: var(--radius-sm); }
.service-account-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.service-account-head > div { display: grid; gap: 3px; min-width: 0; }
.service-account-head strong { font-size: .8rem; }
.service-account-head small, .last-used { color: hsl(var(--muted-foreground)); font-size: .58rem; }
.scope-list.compact { margin: 11px 0 8px; }
.scope-list.compact code { font-size: .55rem; }
.account-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.agent-create { margin-top: 16px; }
.agent-scopes { margin: 10px 0 0; }
.agent-scopes .agent-account-form { padding: 0 12px 12px; }
.scope-checks > label.direct-scope { border-color: hsl(var(--warning)); background: hsl(var(--warning-soft)); }
.scope-checks > label:has(input:disabled) { cursor: not-allowed; opacity: .7; }
.scope-list code.direct-scope { color: hsl(var(--warning)); background: hsl(var(--warning-soft)); }
.agent-account-form { display: grid; gap: 16px; padding-top: 16px; }
.agent-account-form > label, .proposal-review-form label { display: grid; gap: 6px; color: hsl(var(--muted-foreground)); font-size: .66rem; font-weight: 800; }
.agent-account-form input[type="text"], .agent-account-form > label input, .proposal-review-form input { width: 100%; padding: 11px 12px; color: hsl(var(--foreground)); background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: 8px; }
.agent-account-form fieldset { margin: 0; padding: 0; border: 0; }
.agent-account-form legend { margin-bottom: 10px; color: hsl(var(--muted-foreground)); font-size: .66rem; font-weight: 800; }
.scope-checks { display: grid; gap: 7px; }
.scope-checks > label { display: grid; grid-template-columns: 18px 1fr; gap: 9px; align-items: start; padding: 10px; background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: 8px; cursor: pointer; }
.scope-checks input { margin: 2px 0 0; accent-color: hsl(var(--primary)); }
.scope-checks span { display: grid; gap: 2px; }
.scope-checks code { color: hsl(var(--primary)); font-size: .6rem; }
.scope-checks small, .agent-account-form > small { color: hsl(var(--muted-foreground)); font-size: .57rem; line-height: 1.45; }
.empty-state { padding: 30px 22px; text-align: center; background: hsl(var(--background)); border: 1px dashed hsl(var(--border)); border-radius: var(--radius-sm); }
.empty-state.compact { padding: 22px; }
.empty-state strong { font-size: .82rem; }
.empty-state p, .muted-copy { margin: 5px 0 0; color: hsl(var(--muted-foreground)); font-size: .67rem; line-height: 1.55; }
.tool-call-list > div { display: grid; grid-template-columns: 9px minmax(0, 1fr); gap: 2px 8px; align-items: center; padding: 9px 0; border-bottom: 1px solid hsl(var(--border)); }
.tool-call-list > div:last-child { border-bottom: 0; }
.tool-call-list strong { overflow: hidden; font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.tool-call-list small { grid-column: 2; color: hsl(var(--muted-foreground)); font-size: .56rem; }
.audit-dot { width: 7px; height: 7px; background: hsl(var(--warning)); border-radius: 50%; }
.audit-dot.success { background: hsl(var(--success)); }
.audit-dot.error, .audit-dot.denied { background: hsl(var(--danger)); }
.proposal-item { padding: 17px; background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: var(--radius-sm); }
.proposal-item > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.proposal-item h3 { margin: 4px 0 0; }
.proposal-item > p { margin: 13px 0; font-size: .74rem; line-height: 1.6; }
.proposal-item details { font-size: .66rem; }
.proposal-item details summary { color: hsl(var(--primary)); cursor: pointer; font-weight: 800; }
.proposal-item pre { max-height: 230px; overflow: auto; padding: 12px; color: hsl(var(--foreground)); background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: 8px; font: .58rem/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }
.proposal-item ul { margin: 9px 0 0; padding-left: 18px; color: hsl(var(--muted-foreground)); }
.proposal-item > footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 13px; color: hsl(var(--muted-foreground)); font-size: .56rem; }
.proposal-review-form { display: grid; gap: 10px; margin: 14px -17px -17px; padding: 14px 17px; background: hsl(var(--card)); border-top: 1px solid hsl(var(--border)); border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.proposal-review-form > div { display: flex; flex-wrap: wrap; gap: 8px; }
.proposal-review-form > small { color: hsl(var(--muted-foreground)); font-size: .56rem; }
.token-page { width: min(980px, 100%); }
.token-card { display: grid; gap: 18px; padding: 28px; }
.security-banner { display: flex; align-items: flex-start; gap: 12px; padding: 15px; background: hsl(var(--success-soft)); border-radius: var(--radius-sm); }
.security-banner .shield { flex: 0 0 auto; }
.security-banner p { margin: 3px 0 0; color: hsl(var(--muted-foreground)); font-size: .67rem; }
.token-field { display: grid; gap: 7px; }
.token-field > span { color: hsl(var(--muted-foreground)); font-size: .65rem; font-weight: 800; }
.token-field code { overflow-wrap: anywhere; padding: 14px; color: hsl(var(--primary)); background: hsl(var(--primary-soft)); border: 1px solid hsl(var(--primary) / .12); border-radius: var(--radius-sm); font-size: .72rem; }
.token-field.secret code { color: hsl(var(--foreground)); background: hsl(var(--background)); border-color: hsl(var(--border)); }
.token-instructions { padding: 18px; background: hsl(var(--background)); border-radius: var(--radius-sm); }
.token-instructions ol { margin: 9px 0 0; padding-left: 20px; color: hsl(var(--muted-foreground)); font-size: .7rem; }
.token-card > .button { justify-self: start; }

/* Experimentos A/B */
.experiments-heading { align-items: center; }
.experiment-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.experiments-layout { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 20px; align-items: start; }
.experiment-list, .experiment-aside { display: grid; gap: 20px; }
.experiment-aside { position: sticky; top: 98px; }
.experiment-card { overflow: hidden; }
.experiment-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 24px; border-bottom: 1px solid hsl(var(--border)); }
.experiment-card > header h2 { margin: 6px 0 7px; }
.experiment-card > header p { max-width: 700px; margin: 0; color: hsl(var(--muted-foreground)); font-size: .7rem; }
.experiment-rule { display: grid; grid-template-columns: repeat(3, 1fr); background: hsl(var(--background)); border-bottom: 1px solid hsl(var(--border)); }
.experiment-rule > span { display: grid; gap: 4px; padding: 13px 18px; border-right: 1px solid hsl(var(--border)); }
.experiment-rule > span:last-child { border-right: 0; }
.experiment-rule small { color: hsl(var(--muted-foreground)); font-size: .55rem; }
.experiment-rule strong { font-size: .68rem; }
.experiment-arms { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 18px 24px; }
.experiment-arms > article { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 11px; padding: 14px; background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: var(--radius-sm); }
.arm-label { display: grid; place-items: center; width: 32px; height: 32px; color: hsl(0 0% 100%); background: hsl(var(--primary)); border-radius: 9px; font-size: .75rem; font-weight: 900; }
.experiment-arms article > div { display: grid; min-width: 0; gap: 3px; }
.experiment-arms small { color: hsl(var(--muted-foreground)); font-size: .54rem; }
.experiment-arms strong { overflow: hidden; font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.experiment-arms p { margin: 2px 0 0; color: hsl(var(--muted-foreground)); font-size: .62rem; }
.experiment-card > footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 24px; border-top: 1px solid hsl(var(--border)); }
.experiment-card > footer > small { color: hsl(var(--muted-foreground)); font-size: .57rem; }
.experiment-create-card, .experiment-guide { padding: 22px; }
.experiment-create-card h2, .experiment-guide h2 { margin: 6px 0 12px; }
.experiment-create-card > p, .experiment-guide p { color: hsl(var(--muted-foreground)); font-size: .68rem; line-height: 1.55; }
.experiment-form { display: grid; gap: 13px; }
.experiment-form > label, .experiment-form legend { display: grid; gap: 6px; color: hsl(var(--muted-foreground)); font-size: .64rem; font-weight: 800; }
.experiment-form input[type="text"], .experiment-form select, .experiment-form textarea { width: 100%; min-width: 0; padding: 10px 11px; color: hsl(var(--foreground)); background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: 8px; resize: vertical; }
.experiment-form input:focus, .experiment-form select:focus, .experiment-form textarea:focus { border-color: hsl(var(--primary)); box-shadow: 0 0 0 3px hsl(var(--primary) / .1); outline: 0; }
.experiment-form fieldset { margin: 0; padding: 0; border: 0; }
.experiment-form legend { display: flex; justify-content: space-between; width: 100%; margin-bottom: 7px; }
.experiment-form legend small { font-size: .54rem; font-weight: 500; }
.experiment-variant-options { display: grid; gap: 7px; max-height: 330px; overflow-y: auto; }
.experiment-variant-options > label { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; padding: 10px; background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: 8px; cursor: pointer; }
.experiment-variant-options input { margin: 3px 0 0; accent-color: hsl(var(--primary)); }
.experiment-variant-options span { display: grid; min-width: 0; gap: 2px; }
.experiment-variant-options strong { overflow: hidden; font-size: .65rem; text-overflow: ellipsis; white-space: nowrap; }
.experiment-variant-options small { color: hsl(var(--muted-foreground)); font-size: .54rem; }
.experiment-variant-options em { margin-top: 3px; color: hsl(var(--foreground)); font-size: .57rem; font-style: normal; line-height: 1.35; }

/* Prueba privada del renderer creativo */
.renderer-proof-page { max-width: 1680px; }
.renderer-proof-heading { align-items: center; }
.renderer-proof-source { display: grid; grid-template-columns: minmax(240px, .8fr) 2.2fr; gap: 28px; align-items: center; margin-bottom: 20px; padding: 22px 24px; }
.renderer-proof-source h2 { margin: 6px 0 0; }
.renderer-proof-source dl { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; }
.renderer-proof-source dl > div { min-width: 0; padding: 6px 16px; border-left: 1px solid hsl(var(--border)); }
.renderer-proof-source dt { color: hsl(var(--muted-foreground)); font-size: .58rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.renderer-proof-source dd { margin: 5px 0 0; overflow-wrap: anywhere; font-size: .68rem; font-weight: 700; }
.renderer-proof-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.renderer-proof-card { overflow: hidden; }
.renderer-proof-preview { position: relative; display: block; width: 100%; padding: 0; background: hsl(var(--muted)); border: 0; cursor: zoom-in; }
.renderer-proof-preview img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.renderer-proof-preview span { position: absolute; right: 12px; bottom: 12px; padding: 6px 10px; color: #fff; background: hsl(0 0% 5% / .72); border-radius: 99px; font-size: .58rem; font-weight: 800; opacity: 0; transition: opacity .15s; }
.renderer-proof-preview:hover span, .renderer-proof-preview:focus-visible span { opacity: 1; }
.renderer-proof-card > div { padding: 19px 20px 21px; }
.renderer-proof-card h2 { margin: 6px 0; }
.renderer-proof-card p { margin: 0; color: hsl(var(--muted-foreground)); font-size: .66rem; }
.renderer-proof-note { margin-top: 20px; padding: 24px; }
.renderer-proof-note h2 { margin: 7px 0 8px; }
.renderer-proof-note p { max-width: 860px; margin: 0; color: hsl(var(--muted-foreground)); font-size: .75rem; }
.creative-heading-actions { display: flex; align-items: flex-start; gap: 12px; }
.explore-page { max-width: 1680px; }
.explore-heading { align-items: center; }
.explore-heading p { max-width: 850px; }
.explore-heading-action { display: grid; justify-items: end; gap: 12px; }
.explore-heading-action form, .explore-heading-action .button { width: 100%; }
.explore-context { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(430px, 1fr); gap: 28px; align-items: center; padding: 25px 28px; }
.explore-context h2 { margin: 7px 0; font-size: clamp(1.4rem, 2.3vw, 2.2rem); }
.explore-context > div > p { margin: 0; color: hsl(var(--muted-foreground)); }
.explore-context dl { display: grid; grid-template-columns: repeat(2, 1fr); margin: 0; border: 1px solid hsl(var(--border)); border-radius: 14px; overflow: hidden; }
.explore-context dl > div { padding: 13px 15px; border-right: 1px solid hsl(var(--border)); border-bottom: 1px solid hsl(var(--border)); }
.explore-context dl > div:nth-child(even) { border-right: 0; }
.explore-context dl > div:nth-last-child(-n+2) { border-bottom: 0; }
.explore-context dt { color: hsl(var(--muted-foreground)); font-size: .58rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.explore-context dd { margin: 4px 0 0; font-size: .68rem; font-weight: 750; }
.explore-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 34px 0 15px; }
.explore-section-heading h2 { margin: 5px 0 0; }
.explore-section-heading > p { max-width: 410px; margin: 0; color: hsl(var(--muted-foreground)); text-align: right; }
.explore-directions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.explore-direction { overflow: hidden; }
.direction-preview { position: relative; display: flex; min-height: 280px; padding: 25px; overflow: hidden; color: #fff; background: #121119; }
.direction-preview strong { position: relative; z-index: 2; max-width: 90%; font-size: clamp(1.4rem, 2.35vw, 2.7rem); line-height: .98; letter-spacing: -.045em; }
.direction-generated { display: block; padding: 0; cursor: zoom-in; }
.direction-generated img { display: block; width: 100%; min-height: 280px; aspect-ratio: 1; object-fit: cover; }
.direction-index { position: absolute; z-index: 3; right: 18px; top: 16px; font-size: .6rem; font-weight: 900; letter-spacing: .12em; }
.direction-preview i, .direction-preview b { position: absolute; display: block; }
.direction-editorial .direction-preview { align-items: flex-end; background: linear-gradient(145deg, #000acc 0 64%, #161225 64%); }
.direction-editorial .direction-preview i { width: 110px; height: 110px; right: 22px; top: 36px; background: #73e2c0; border-radius: 50%; }
.direction-editorial .direction-preview b { width: 55%; height: 6px; left: 25px; bottom: 18px; background: #73e2c0; }
.direction-modular .direction-preview { align-items: flex-start; padding-top: 65px; background: #f1eff7; color: #111018; }
.direction-modular .direction-preview i { width: 43%; height: 90px; right: 22px; bottom: 23px; background: #000acc; border-radius: 12px; }
.direction-modular .direction-preview b { width: 42%; height: 90px; left: 22px; bottom: 23px; background: #73e2c0; border-radius: 12px; }
.direction-split .direction-preview { width: 100%; align-items: center; padding-right: 50%; background: #000acc; }
.direction-split .direction-preview i { inset: 0 0 0 52%; background: radial-gradient(circle at 44% 42%, #73e2c0 0 17%, transparent 18%), linear-gradient(145deg, #281e61, #17131f); }
.direction-split .direction-preview b { width: 1px; inset: 0 auto 0 52%; background: hsl(0 0% 100% / .35); }
.direction-copy { padding: 20px 21px 23px; }
.direction-copy h3 { margin: 6px 0 12px; }
.direction-copy p { margin: 0 0 10px; color: hsl(var(--foreground)); font-size: .7rem; }
.direction-copy small { display: block; color: hsl(var(--muted-foreground)); line-height: 1.55; }
.direction-copy .status { display: inline-flex; margin-top: 14px; }
.explore-checkout { display: grid; grid-template-columns: 1.4fr .8fr; gap: 30px; align-items: center; margin-top: 24px; padding: 27px 29px; border-color: hsl(var(--primary) / .35); }
.explore-checkout h2 { margin: 6px 0 8px; }
.explore-checkout p { margin: 0 0 5px; color: hsl(var(--muted-foreground)); }
.explore-checkout-action { display: grid; justify-items: stretch; gap: 9px; }
.explore-checkout-action .button, .explore-checkout-action form { width: 100%; }
.explore-checkout-action small { color: hsl(var(--muted-foreground)); text-align: center; }

/* Error */
.error-page { min-height: 100vh; display: grid; align-content: center; justify-items: start; gap: 70px; width: min(720px, calc(100% - 48px)); margin: 0 auto; }
.error-page section { max-width: 640px; }
.error-page h1 { margin: 12px 0; }
.error-page p { margin-bottom: 28px; color: hsl(var(--muted-foreground)); }

@media (max-width: 1120px) {
  .metrics-grid { grid-template-columns: repeat(3, 1fr); }
  .metric-card.featured { grid-column: 1 / -1; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: 1fr 1fr; }
  .integration-layout { grid-template-columns: 1fr; }
  .integration-aside { grid-template-columns: repeat(3, 1fr); }
  .dna-editor-layout, .dna-review-layout { grid-template-columns: 1fr; }
  .dna-guide-card, .dna-review-aside { position: static; }
  .dna-review-aside { grid-template-columns: 1fr 1fr; }
  .client-grid { grid-template-columns: 1fr 1fr; }
  .onboarding-layout { grid-template-columns: 1fr; }
  .onboarding-flow-card { position: static; }
  .studio-metrics { grid-template-columns: 1fr 1fr; }
  .studio-layout, .brief-layout, .creative-detail-layout { grid-template-columns: 1fr; }
  .creative-aside { position: static; grid-template-columns: repeat(3, 1fr); }
  .brief-side { grid-template-columns: 1fr 1fr; }
  .slide-grid { grid-template-columns: repeat(2, 1fr); }
  .asset-metrics { grid-template-columns: 1fr 1fr; }
  .assets-layout { grid-template-columns: 1fr; }
  .asset-side { grid-template-columns: repeat(3, 1fr); }
  .agent-layout { grid-template-columns: 1fr; }
  .experiments-layout { grid-template-columns: 1fr; }
  .experiment-aside { position: static; }
  .renderer-proof-grid { grid-template-columns: 1fr 1fr; }
  .renderer-proof-source { grid-template-columns: 1fr; }
  .explore-directions { grid-template-columns: 1fr 1fr; }
  .explore-context { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  :root { --sidebar-width: 268px; }
  .sidebar { transform: translateX(-100%); box-shadow: 20px 0 50px hsl(var(--shadow) / .16); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .main-area { margin-left: 0; }
  .mobile-menu { display: grid; }
  .topbar-context { margin-right: auto; margin-left: 12px; }
  .user-copy { display: none; }
  .page-heading, .detail-heading { align-items: flex-start; flex-direction: column; }
  .detail-grid { grid-template-columns: 1fr; }
  .visual-card { position: static; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-panel { min-height: 420px; }
  .auth-form-wrap { min-height: auto; }
  .integration-aside { grid-template-columns: 1fr; }
  .dna-progress-card { grid-template-columns: 1fr; }
  .client-metrics { grid-template-columns: 1fr 1fr; }
  .choice-grid { grid-template-columns: 1fr 1fr; }
  .tone-grid { grid-template-columns: repeat(3, 1fr); }
  .creative-aside { grid-template-columns: 1fr; }
  .asset-grid { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
  .asset-side { grid-template-columns: 1fr; }
  .agent-callout { grid-template-columns: 1fr; }
  .experiment-metrics { grid-template-columns: 1fr 1fr; }
  .agent-boundary { padding: 18px 0 0; border-top: 1px solid hsl(var(--border)); border-left: 0; }
}

@media (max-width: 620px) {
  .page-content { padding: 28px 16px 60px; }
  .topbar { padding: 0 14px; }
  .topbar-actions { gap: 7px; }
  .user-menu form { display: none; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .metric-card.featured { grid-column: 1 / -1; }
  .content-row { grid-template-columns: 42px 56px minmax(0, 1fr); min-height: 98px; padding: 12px; gap: 10px; }
  .content-thumb { width: 56px; height: 56px; }
  .content-main h3 { font-size: .86rem; }
  .row-status { grid-column: 3; justify-items: start; padding: 0; }
  .row-arrow { display: none; }
  .legend { display: none; }
  .side-stack { grid-template-columns: 1fr; }
  .heading-actions { align-items: stretch; flex-direction: column; width: 100%; }
  .auth-panel { min-height: 360px; padding: 34px 26px; }
  .auth-copy h1 { font-size: 2.75rem; }
  .auth-principle, .setup-steps { display: none; }
  .auth-form-wrap { padding: 22px 14px; }
  .auth-form { padding: 28px 22px; }
  .detail-card dl > div { grid-template-columns: 90px 1fr; }
  .integration-steps { grid-template-columns: 1fr; gap: 12px; }
  .integration-step::after { display: none; }
  .settings-form { grid-template-columns: 1fr; }
  .settings-form label { grid-column: 1 / -1; }
  .connect-action { align-items: stretch; flex-direction: column; }
  .provider-heading { grid-template-columns: 42px 1fr; }
  .provider-heading > .status { grid-column: 2; }
  .dna-progress-copy { align-items: flex-start; flex-direction: column; gap: 8px; }
  .dna-form { grid-template-columns: 1fr; padding: 22px 18px; }
  .dna-form label { grid-column: 1 / -1; }
  .dna-font-note { align-items: stretch; flex-direction: column; }
  .dna-form-actions { align-items: stretch; flex-direction: column-reverse; }
  .dna-summary-card dl { grid-template-columns: 1fr; }
  .dna-summary-card dl > div { border-right: 0; border-bottom: 1px solid hsl(var(--border)); }
  .dna-summary-card dl > div:nth-last-child(-n+2) { border-bottom: 1px solid hsl(var(--border)); }
  .dna-summary-card dl > div:last-child { border-bottom: 0; }
  .dna-review-aside { grid-template-columns: 1fr; }
  .client-metrics, .client-grid { grid-template-columns: 1fr; }
  .client-card-top { grid-template-columns: 42px minmax(0, 1fr); }
  .client-card-top > .status { grid-column: 2; }
  .onboarding-form { grid-template-columns: 1fr; padding: 22px 18px; }
  .onboarding-form label { grid-column: 1 / -1; }
  .onboarding-actions { align-items: stretch; flex-direction: column-reverse; }
  .studio-metrics { grid-template-columns: 1fr 1fr; }
  .studio-row { grid-template-columns: 42px minmax(0, 1fr); padding: 15px 35px 15px 15px; }
  .studio-row-meta { grid-column: 2; justify-items: start; }
  .studio-empty { align-items: flex-start; flex-direction: column; }
  .ai-settings-form, .brief-form { grid-template-columns: 1fr; padding: 22px 18px; }
  .ai-settings-form > *, .brief-form > * { grid-column: 1 / -1; }
  .brief-section { margin-right: -18px; margin-left: -18px; padding-right: 18px; padding-left: 18px; }
  .choice-grid, .choice-grid.two, .tone-grid { grid-template-columns: 1fr; }
  .brief-actions { align-items: stretch; flex-direction: column-reverse; }
  .brief-side { grid-template-columns: 1fr; }
  .brief-summary-card dl { grid-template-columns: 1fr; }
  .brief-summary-card dl > div { border-right: 0; }
  .slide-grid { grid-template-columns: 1fr; }
  .rendition-box { grid-template-columns: 1fr; }
  .rendition-list { justify-content: flex-start; }
  .visual-slide-heading { align-items: flex-start; }
  .background-asset-choice, .background-picker-form fieldset, .background-picker-options { grid-template-columns: 1fr; }
  .background-asset-preview { width: 100%; max-height: 220px; }
  .background-restore-form { align-items: flex-start; flex-direction: column; }
  .rendition-lightbox { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); }
  .rendition-lightbox-shell { padding: 10px; border-radius: 14px; }
  .rendition-lightbox-frame, .rendition-lightbox img { max-height: calc(100dvh - 115px); }
  .variant-actions { align-items: stretch; flex-direction: column; }
  .variant-actions > small { margin-right: 0; }
  .asset-metrics { grid-template-columns: 1fr 1fr; }
  .asset-grid { grid-template-columns: 1fr; }
  .service-account-head, .proposal-item > header { align-items: flex-start; flex-direction: column; }
  .experiment-card > header, .experiment-card > footer { align-items: flex-start; flex-direction: column; }
  .experiment-rule, .experiment-arms { grid-template-columns: 1fr; }
  .experiment-rule > span { border-right: 0; border-bottom: 1px solid hsl(var(--border)); }
  .experiment-rule > span:last-child { border-bottom: 0; }
  .account-actions, .proposal-review-form > div { align-items: stretch; flex-direction: column; }
  .account-actions form, .account-actions .button, .proposal-review-form .button { width: 100%; }
  .renderer-proof-grid, .renderer-proof-source dl { grid-template-columns: 1fr; }
  .renderer-proof-source dl > div { padding: 10px 0; border-top: 1px solid hsl(var(--border)); border-left: 0; }
  .creative-heading-actions { width: 100%; align-items: stretch; flex-direction: column; }
  .creative-heading-actions .button { width: 100%; }
  .explore-section-heading { align-items: flex-start; flex-direction: column; }
  .explore-heading-action { width: 100%; justify-items: stretch; }
  .explore-section-heading > p { text-align: left; }
  .explore-directions, .explore-checkout { grid-template-columns: 1fr; }
  .explore-context dl { grid-template-columns: 1fr; }
  .explore-context dl > div { border-right: 0; border-bottom: 1px solid hsl(var(--border)); }
  .explore-context dl > div:nth-last-child(-n+2) { border-bottom: 1px solid hsl(var(--border)); }
  .explore-context dl > div:last-child { border-bottom: 0; }
}

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

.video-pipeline { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 24px; padding: 14px; }
.video-pipeline span, .video-pipeline a { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 10px 12px; border-radius: 12px; background: hsl(var(--muted) / .65); color: hsl(var(--muted-foreground)); font-size: .77rem; font-weight: 700; }
.video-pipeline span.active, .video-pipeline a.active { background: hsl(var(--primary) / .12); color: hsl(var(--primary)); }
.video-pipeline b { display: grid; place-items: center; flex: 0 0 25px; width: 25px; height: 25px; border-radius: 50%; background: hsl(var(--background)); }
.video-detail-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, .8fr); gap: 20px; margin-bottom: 20px; }
.video-brief-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 16px -24px -24px; }
.video-brief-card dl > div { padding: 16px 24px; border-top: 1px solid hsl(var(--border)); }
.video-brief-card dt, .concept-card dt { color: hsl(var(--muted-foreground)); font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.video-brief-card dd, .concept-card dd { margin: 5px 0 0; line-height: 1.5; }
.provider-readiness { display: flex; align-items: flex-start; flex-direction: column; gap: 12px; }
.provider-readiness .button { margin-top: auto; }
.video-product-assets { margin-bottom: 20px; }
.video-product-assets .panel-heading p { margin: 6px 0 0; color: hsl(var(--muted-foreground)); font-size: .68rem; }
.product-logo-layout { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr); gap: 20px; padding: 0 22px 22px; }
.product-logo-preview { display: grid; place-items: center; align-content: center; gap: 10px; min-height: 180px; padding: 20px; text-align: center; background: hsl(var(--background)); border: 1px dashed hsl(var(--border)); border-radius: 12px; }
.product-logo-preview img { max-width: 100%; max-height: 110px; object-fit: contain; }
.product-logo-preview > span { color: hsl(var(--primary)); font-size: 1.2rem; font-weight: 900; letter-spacing: .12em; }
.product-logo-preview p { max-width: 280px; margin: 0; color: hsl(var(--muted-foreground)); font-size: .65rem; line-height: 1.5; }
.product-logo-actions { display: grid; gap: 14px; }
.product-logo-actions form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; padding: 14px; background: hsl(var(--muted) / .25); border-radius: 10px; }
.product-logo-actions form:first-child { grid-template-columns: 1fr auto; }
.product-logo-actions label { display: grid; gap: 6px; color: hsl(var(--muted-foreground)); font-size: .65rem; font-weight: 800; }
.product-logo-actions input, .product-logo-actions select { width: 100%; padding: 10px 11px; color: hsl(var(--foreground)); background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: 8px; }
.product-logo-actions small { font-weight: 500; }
.video-stage { margin-bottom: 20px; }
.stage-empty { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px; border: 1px dashed hsl(var(--border)); border-radius: 16px; background: hsl(var(--muted) / .28); }
.stage-empty h3, .stage-empty p { margin: 0; }
.stage-empty p { margin-top: 7px; color: hsl(var(--muted-foreground)); }
.concept-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.concept-card { display: flex; flex-direction: column; gap: 12px; padding: 20px; border: 1px solid hsl(var(--border)); border-radius: 16px; background: hsl(var(--background)); }
.concept-card.selected { border-color: hsl(var(--primary)); box-shadow: inset 0 0 0 1px hsl(var(--primary)); }
.concept-card header { display: flex; align-items: center; justify-content: space-between; color: hsl(var(--muted-foreground)); font-size: .75rem; font-weight: 800; text-transform: uppercase; }
.concept-card h3, .concept-card p { margin: 0; }
.concept-card blockquote { margin: 0; padding: 12px 14px; border-left: 3px solid hsl(var(--primary)); background: hsl(var(--primary) / .06); font-weight: 700; }
.concept-card dl { display: grid; gap: 8px; margin: 0; }
.concept-card dl > div { padding-top: 8px; border-top: 1px solid hsl(var(--border)); }
.concept-card form { margin-top: auto; }
.voice-gate { display: flex; flex-direction: column; border-top: 4px solid hsl(var(--secondary)); }
.voice-grid { order: 2; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 24px; }
.voice-card { padding: 18px; border: 1px solid hsl(var(--border)); border-radius: 16px; background: hsl(var(--background)); }
.voice-card h3 { margin: 6px 0 10px; }
.voice-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.voice-card > p { min-height: 58px; color: hsl(var(--muted-foreground)); }
.voice-generation-progress { display: grid; gap: 8px; padding: 12px; border: 1px solid hsl(var(--primary) / .24); border-radius: 12px; background: hsl(var(--primary) / .06); }
.voice-generation-progress span { color: hsl(var(--muted-foreground)); font-size: .86rem; line-height: 1.45; }
.voice-preview-player { display: grid; gap: 6px; margin: 12px 0; padding: 12px; border-radius: 12px; background: hsl(var(--muted) / .35); }
.voice-preview-player > strong { color: hsl(var(--primary)); font-size: .88rem; }
.voice-role { color: hsl(var(--primary)); font-size: .72rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.voice-placeholder { display: flex; align-items: center; gap: 12px; margin: 14px 0; padding: 12px; border-radius: 12px; background: hsl(var(--muted) / .5); }
.voice-placeholder > span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: hsl(var(--primary)); color: white; }
.voice-placeholder div { display: flex; min-width: 0; flex-direction: column; }
.voice-placeholder small { color: hsl(var(--muted-foreground)); }
.voice-select-form { display: grid; gap: 9px; margin: 14px 0; }
.voice-select-form label { display: grid; gap: 6px; color: hsl(var(--muted-foreground)); font-size: .63rem; font-weight: 800; }
.voice-select-form select { width: 100%; padding: 10px 11px; color: hsl(var(--foreground)); background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: 8px; }
.voice-audio { width: 100%; height: 42px; margin: 2px 0 12px; }
.voice-catalog { order: 1; margin-top: 8px; padding-top: 12px; border-top: 1px solid hsl(var(--border)); }
.voice-catalog-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.voice-catalog-heading h3, .voice-catalog-heading p { margin: 5px 0 0; }
.voice-catalog-heading p { color: hsl(var(--muted-foreground)); font-size: .88rem; }
.voice-search { display: grid; gap: 6px; min-width: min(100%, 260px); color: hsl(var(--muted-foreground)); font-size: .76rem; font-weight: 750; }
.voice-search input, .voice-pick-controls select { min-height: 42px; padding: 8px 11px; color: hsl(var(--foreground)); background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: 9px; }
.voice-pick-controls { display: grid; grid-template-columns: minmax(180px, 1.5fr) minmax(170px, 1fr) minmax(170px, 1fr) auto; align-items: end; gap: 10px; margin: 16px 0; padding: 14px; border: 1px solid hsl(var(--primary) / .25); border-radius: 14px; background: hsl(var(--primary) / .045); }
.voice-pick-controls > label { display: grid; gap: 5px; color: hsl(var(--muted-foreground)); font-size: .72rem; font-weight: 750; }
.voice-pick-controls select { width: 100%; }
.voice-picked-name { align-self: center; font-weight: 750; }
.voice-pick-controls [disabled] { opacity: .55; cursor: not-allowed; }
.voice-catalog-list { display: grid; gap: 10px; }
.voice-option { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(220px, .8fr) auto; align-items: center; gap: 16px; padding: 14px 16px; border: 1px solid hsl(var(--border)); border-radius: 14px; background: hsl(var(--background)); }
.voice-option.is-selected { border-color: #fb5972; box-shadow: inset 3px 0 #fb5972; }
.voice-option[hidden] { display: none; }
.voice-option-copy { min-width: 0; }
.voice-option-copy > strong { display: block; overflow-wrap: anywhere; }
.voice-option-copy > strong > span { color: hsl(var(--muted-foreground)); font-variant-numeric: tabular-nums; }
.voice-option-tags { display: flex; flex-wrap: wrap; gap: 4px 9px; margin-top: 6px; color: hsl(var(--muted-foreground)); font-size: .73rem; }
.voice-catalog-audio { margin: 0; }
.voice-preview-load { width: 100%; min-height: 42px; }
.voice-pick-button { min-height: 42px; padding-inline: 13px; white-space: nowrap; }
.voice-load-more { justify-self: center; min-width: 220px; }
.voice-no-preview { color: hsl(var(--muted-foreground)); font-size: .8rem; }
.voice-filter-empty { margin: 0; padding: 20px; text-align: center; color: hsl(var(--muted-foreground)); }
.voice-language-note { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; margin: 14px 0 18px; padding: 12px 14px; border-radius: 12px; background: hsl(var(--secondary) / .12); }
.voice-language-note span { color: hsl(var(--muted-foreground)); font-size: .84rem; }
.voice-unverified { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: hsl(var(--warning-soft)); color: hsl(var(--foreground)); font-size: .79rem; }
.voice-empty-state { max-width: 820px; padding: 20px; border: 1px solid hsl(var(--border)); border-radius: 14px; background: hsl(var(--secondary) / .08); }
.voice-empty-state h4 { margin: 0 0 8px; }
.voice-empty-state p { margin: 0 0 15px; color: hsl(var(--muted-foreground)); line-height: 1.55; }
.voice-catalog-warning { display: flex; align-items: center; gap: 10px; margin: 16px 0; padding: 12px 14px; color: hsl(var(--warning)); background: hsl(var(--warning-soft)); border-radius: 10px; font-size: .66rem; }
.voice-catalog-warning span { flex: 1; color: hsl(var(--foreground)); }
.voice-catalog-warning a { color: inherit; font-weight: 800; }
.video-script { border-top: 4px solid hsl(var(--primary)); }
.script-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin: 10px 0 18px; color: hsl(var(--muted-foreground)); font-size: .88rem; }
.script-summary strong { color: hsl(var(--foreground)); }
.script-actions { display: flex; gap: 10px; margin-left: auto; }
.scene-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.scene-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid hsl(var(--border)); border-radius: 16px; background: hsl(var(--background)); scroll-margin-top: 90px; }
.scene-card > header { display: flex; justify-content: space-between; align-items: center; }
.scene-number { color: hsl(var(--primary)); font-size: .72rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.scene-duration { padding: 2px 9px; border-radius: 999px; background: hsl(var(--muted) / .6); font-size: .78rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.scene-action { margin: 0; font-weight: 650; line-height: 1.45; }
.scene-dialogue { margin: 0; padding: 10px 12px; border-left: 3px solid hsl(var(--secondary)); border-radius: 8px; background: hsl(var(--secondary) / .1); font-style: italic; }
.scene-dialogue span { display: block; margin-bottom: 3px; color: hsl(var(--muted-foreground)); font-size: .72rem; font-style: normal; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.scene-meta { display: grid; gap: 6px; margin: 0; font-size: .82rem; }
.scene-meta div { display: grid; grid-template-columns: 90px 1fr; gap: 8px; }
.scene-meta dt { color: hsl(var(--muted-foreground)); font-weight: 750; }
.scene-meta dd { margin: 0; }
.scene-edit summary { cursor: pointer; color: hsl(var(--primary)); font-weight: 750; font-size: .85rem; }
.scene-edit form { display: grid; gap: 10px; margin-top: 10px; }
.scene-edit label { display: grid; gap: 5px; color: hsl(var(--muted-foreground)); font-size: .74rem; font-weight: 750; }
.scene-edit input, .scene-edit select, .scene-edit textarea { width: 100%; padding: 8px 10px; color: hsl(var(--foreground)); background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: 8px; font: inherit; font-size: .9rem; }
.scene-edit-row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; }
.video-storyboard { border-top: 4px solid hsl(var(--secondary)); }
.storyboard-intro { color: hsl(var(--muted-foreground)); max-width: 880px; }
.storyboard-refresh { margin: 10px 0; }
.storyboard-block { margin-top: 20px; padding-top: 16px; border-top: 1px solid hsl(var(--border)); }
.storyboard-block-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.storyboard-block-heading h3 { margin: 0; }
.storyboard-block-heading [disabled] { opacity: .55; cursor: not-allowed; }
.storyboard-empty { color: hsl(var(--muted-foreground)); }
.character-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.character-option { margin: 0; overflow: hidden; border: 1px solid hsl(var(--border)); border-radius: 14px; background: hsl(var(--background)); }
.character-option.is-selected { border-color: #fb5972; box-shadow: 0 0 0 2px #fb5972; }
.character-option img, .frame-card img, .frame-placeholder { display: block; width: 100%; aspect-ratio: var(--frame-ratio, 9 / 16); object-fit: cover; background: hsl(var(--muted) / .5); }
.frame-placeholder { display: grid; place-items: center; padding: 14px; color: hsl(var(--muted-foreground)); font-size: .82rem; text-align: center; }
.character-option figcaption { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; font-size: .82rem; font-weight: 750; }
.character-option figcaption .button { min-height: 32px; padding: 4px 12px; }
.frame-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.frame-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid hsl(var(--border)); border-radius: 14px; background: hsl(var(--background)); }
.frame-card.is-approved { border-color: hsl(var(--success)); box-shadow: inset 0 -3px hsl(var(--success)); }
.frame-copy { display: grid; gap: 4px; padding: 10px 12px 0; }
.frame-copy small { color: hsl(var(--muted-foreground)); line-height: 1.4; }
.frame-state { color: hsl(var(--primary)); font-size: .76rem; font-weight: 750; }
.frame-actions { display: flex; gap: 8px; padding: 10px 12px 12px; }
.frame-actions .button { min-height: 34px; padding: 4px 12px; }
.frame-actions [disabled] { opacity: .55; cursor: not-allowed; }
.voice-native { order: 1; margin-top: 8px; padding-top: 12px; border-top: 1px solid hsl(var(--border)); scroll-margin-top: 80px; }
.native-controls { grid-template-columns: minmax(190px, 1.2fr) minmax(140px, .8fr) minmax(120px, .6fr) minmax(170px, 1fr); }
.voice-native-description { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.voice-alt { margin: 14px 0; }
.voice-alt > summary { cursor: pointer; color: hsl(var(--muted-foreground)); font-size: .88rem; font-weight: 750; }
.voice-audition { order: 3; margin-top: 24px; padding-top: 16px; border-top: 1px solid hsl(var(--border)); scroll-margin-top: 80px; }
.voice-audition-form { display: grid; gap: 12px; margin: 16px 0; padding: 14px; border: 1px solid hsl(var(--primary) / .25); border-radius: 14px; background: hsl(var(--primary) / .045); }
.voice-audition-controls { display: grid; grid-template-columns: minmax(200px, 1fr) auto minmax(200px, 1fr); align-items: end; gap: 12px; }
.voice-audition-controls > label { display: grid; gap: 5px; color: hsl(var(--muted-foreground)); font-size: .72rem; font-weight: 750; }
.voice-audition-controls select { width: 100%; min-height: 42px; padding: 8px 11px; color: hsl(var(--foreground)); background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: 9px; }
.voice-audition-controls fieldset { display: flex; gap: 14px; margin: 0; padding: 0 0 10px; border: 0; }
.voice-audition-controls legend { padding: 0; margin-bottom: 6px; color: hsl(var(--muted-foreground)); font-size: .72rem; font-weight: 750; }
.voice-check { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.voice-audition-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; max-height: 360px; overflow-y: auto; padding: 2px; }
.voice-audition-option { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid hsl(var(--border)); border-radius: 10px; background: hsl(var(--background)); }
.voice-audition-option[hidden] { display: none; }
.voice-audition-option:has(input:checked) { border-color: hsl(var(--primary)); box-shadow: inset 3px 0 hsl(var(--primary)); }
.voice-audition-option > label { display: flex; align-items: center; gap: 9px; min-width: 0; cursor: pointer; }
.voice-audition-name { display: grid; min-width: 0; }
.voice-audition-name small { color: hsl(var(--muted-foreground)); font-size: .72rem; }
.voice-audition-name small.voice-brand-tag { color: hsl(var(--primary)); font-weight: 800; }
.voice-audition-option .voice-preview-load { width: auto; min-height: 34px; padding-inline: 10px; }
.voice-audition-option .voice-catalog-audio { width: 150px; height: 34px; }
.voice-audition-submit { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.voice-audition-submit span { color: hsl(var(--muted-foreground)); font-size: .84rem; }
.voice-audition-submit span.over-limit { color: hsl(var(--danger)); font-weight: 750; }
.voice-audition-submit [disabled] { opacity: .55; cursor: not-allowed; }
.voice-audition-results { margin-top: 16px; padding: 16px; border: 1px solid hsl(var(--border)); border-radius: 14px; background: hsl(var(--background)); }
.voice-audition-results > header { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.voice-audition-results h4 { margin: 4px 0; }
.voice-audition-results header p { margin: 0; color: hsl(var(--muted-foreground)); }
.voice-audition-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.voice-audition-row { display: grid; grid-template-columns: minmax(170px, .8fr) minmax(220px, 1fr) auto; align-items: center; gap: 14px; padding: 10px 14px; border: 1px solid hsl(var(--border)); border-radius: 12px; }
.voice-audition-row.is-current { border-color: #fb5972; box-shadow: inset 3px 0 #fb5972; }
.voice-audition-state { color: hsl(var(--muted-foreground)); font-size: .84rem; }
.voice-audition-state.is-failed { color: hsl(var(--danger)); }
.tool-discovery { margin-bottom: 30px; }

@media (max-width: 980px) {
  .video-pipeline { grid-template-columns: repeat(3, 1fr); }
  .video-detail-grid, .concept-grid, .product-logo-layout { grid-template-columns: 1fr; }
  .product-logo-actions form, .product-logo-actions form:first-child { grid-template-columns: 1fr; }
  .voice-grid { grid-template-columns: 1fr; }
  .voice-option { grid-template-columns: 1fr 1fr; }
  .voice-option-copy { grid-column: 1 / -1; }
  .voice-pick-controls { grid-template-columns: 1fr 1fr; }
  .voice-picked-name { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .voice-catalog-heading { align-items: stretch; flex-direction: column; }
  .voice-option { grid-template-columns: 1fr; }
  .voice-option-copy { grid-column: auto; }
  .voice-pick-controls { grid-template-columns: 1fr; }
  .voice-picked-name { grid-column: auto; }
  .voice-audition-controls, .voice-audition-row { grid-template-columns: 1fr; }
  .voice-audition-results > header, .voice-audition-submit { align-items: stretch; flex-direction: column; }
}

@media (max-width: 620px) {
  .video-pipeline { grid-template-columns: 1fr 1fr; }
  .video-brief-card dl { grid-template-columns: 1fr; }
  .stage-empty { align-items: stretch; flex-direction: column; }
}
.video-production { border-top: 4px solid hsl(var(--primary)); }
.clip-video { display: block; width: 100%; aspect-ratio: var(--frame-ratio, 9 / 16); background: #000; object-fit: cover; }
.work-progress { display: flex; align-items: center; gap: 14px; margin: 14px 0; padding: 14px 16px; border: 1px solid hsl(var(--primary) / .25); border-radius: 14px; background: hsl(var(--primary) / .06); }
.work-progress div { display: grid; gap: 3px; }
.work-progress span:not(.work-spinner) { color: hsl(var(--muted-foreground)); font-size: .86rem; }
.work-spinner { width: 22px; height: 22px; flex: 0 0 auto; border: 3px solid hsl(var(--primary) / .2); border-top-color: hsl(var(--primary)); border-radius: 50%; animation: work-spin .8s linear infinite; }
@keyframes work-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .work-spinner { animation: none; } }

/* Video studio panels have no padding of their own: the heading carries it.
   Everything below the heading shares the same 24px gutter (16px on phones). */
.video-stage, .video-product-assets { padding-bottom: 24px; }
.video-stage > :not(.panel-heading), .video-product-assets > :not(.panel-heading) { margin-left: 24px; margin-right: 24px; }
.video-stage > .panel-heading + *, .video-product-assets > .panel-heading + * { margin-top: 20px; }
.video-brief-card dl { margin: 0; }
.provider-readiness { padding: 22px 24px; }
.provider-readiness h2 { margin: 0; }
.tool-discovery { padding: 18px 24px; }
.tool-discovery > p, .tool-discovery > .scope-list { margin: 14px 0 0; }
@media (max-width: 620px) {
  .video-stage > :not(.panel-heading), .video-product-assets > :not(.panel-heading) { margin-left: 16px; margin-right: 16px; }
  .provider-readiness, .tool-discovery { padding: 18px 16px; }
}
.detail-heading, .heading-actions { flex-wrap: wrap; }
.heading-actions .button { white-space: nowrap; }
@media (max-width: 1200px) { .video-pipeline { grid-template-columns: repeat(3, 1fr); } }

/* ── Video page: one stage open at a time ─────────────────────────────── */
.video-stage.stage { padding-bottom: 0; margin-bottom: 12px; }
.video-stage.stage > * { margin: 0; }
.stage-summary { display: flex; align-items: center; gap: 14px; padding: 16px 22px; cursor: pointer; list-style: none; border-radius: var(--radius); }
.stage-summary::-webkit-details-marker { display: none; }
.stage-summary:hover { background: hsl(var(--muted) / .35); }
.stage[open] > .stage-summary { border-bottom: 1px solid hsl(var(--border)); border-radius: var(--radius) var(--radius) 0 0; }
.stage-index { display: grid; place-items: center; flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; background: hsl(var(--muted)); color: hsl(var(--foreground)); font-size: .8rem; font-weight: 850; }
.stage-index.is-done { background: hsl(var(--success-soft)); color: hsl(var(--success)); }
.stage[open] .stage-index:not(.is-done) { background: hsl(var(--primary)); color: white; }
.stage-title { display: grid; flex: 1; min-width: 0; gap: 2px; }
.stage-title strong { font-size: 1rem; }
.stage-title small { overflow: hidden; color: hsl(var(--muted-foreground)); font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.stage-chevron { width: 9px; height: 9px; flex: 0 0 auto; border-right: 2px solid hsl(var(--muted-foreground)); border-bottom: 2px solid hsl(var(--muted-foreground)); transform: rotate(45deg); transition: transform .15s ease; }
.stage[open] .stage-chevron { transform: rotate(-135deg); }
.stage-body { display: grid; gap: 16px; padding: 20px 24px 24px; }
.stage-body > * { margin: 0; }
.stage-locked, .stage-hint { margin: 0; color: hsl(var(--muted-foreground)); font-size: .9rem; }
.stage-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.toolbar-note { color: hsl(var(--muted-foreground)); font-size: .9rem; }
.toolbar-note strong { color: hsl(var(--foreground)); }
.toolbar-actions, .row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.work-progress form { margin-left: auto; }
.video-pipeline a { text-decoration: none; cursor: pointer; }
.video-pipeline a:hover { background: hsl(var(--muted)); }
.video-pipeline a.active:hover { background: hsl(var(--primary) / .18); }
.video-pipeline a.is-done b { background: hsl(var(--success-soft)); color: hsl(var(--success)); }
.video-pipeline a.is-locked { opacity: .55; }

/* Brief */
.brief-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(220px, 1fr); gap: 20px; }
.brief-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; margin: 0; }
.brief-facts dt { color: hsl(var(--muted-foreground)); font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.brief-facts dd { margin: 4px 0 0; line-height: 1.45; }
.brief-logo { display: grid; align-content: start; gap: 10px; }
.inline-edit > summary { cursor: pointer; color: hsl(var(--primary)); font-size: .85rem; font-weight: 750; }
.inline-edit .product-logo-actions { margin-top: 10px; }

/* Compact tables */
.table-title, .table-title-row h3 { margin: 4px 0 0; font-size: .95rem; }
.table-title small { margin-left: 8px; color: hsl(var(--muted-foreground)); font-size: .8rem; font-weight: 600; }
.table-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid hsl(var(--border)); border-radius: 12px; overflow: hidden; background: hsl(var(--background)); font-size: .88rem; }
.data-table th { position: sticky; top: 0; z-index: 1; padding: 9px 12px; background: hsl(var(--muted) / .55); color: hsl(var(--muted-foreground)); font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
.data-table td { padding: 9px 12px; border-top: 1px solid hsl(var(--border)); vertical-align: middle; }
.data-table tbody tr:hover { background: hsl(var(--muted) / .25); }
.data-table tr[hidden] { display: none; }
.data-table tr.is-current, .data-table tr.is-approved { background: hsl(var(--success-soft) / .45); }
.data-table .col-num { width: 40px; color: hsl(var(--muted-foreground)); font-variant-numeric: tabular-nums; }
.data-table .col-check, .data-table .col-icon { width: 40px; text-align: center; }
.data-table .col-narrow { width: 16%; }
.data-table .col-actions { width: 1%; white-space: nowrap; text-align: right; }
.data-table td.col-actions .row-actions { justify-content: flex-end; }
.cell-meta { display: block; margin-top: 2px; color: hsl(var(--muted-foreground)); font-size: .76rem; }
.cell-meta.clamp { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.cell-speaker { display: block; color: hsl(var(--primary)); font-size: .7rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.cell-quote { font-style: italic; color: hsl(var(--muted-foreground)); }
.cell-empty { color: hsl(var(--muted-foreground)); }
.cell-error { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: hsl(var(--danger-soft)); color: hsl(var(--danger)); font-weight: 900; }
.cell-error-text { color: hsl(var(--danger)); }
.table-scroll { max-height: 440px; overflow: auto; border-radius: 12px; }
.table-scroll .data-table { border-radius: 12px; }
.table-empty td { color: hsl(var(--muted-foreground)); text-align: center; }
.table-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 12px; margin: 10px 0 12px; }
.table-filters label, .table-filters legend { display: grid; gap: 4px; color: hsl(var(--muted-foreground)); font-size: .72rem; font-weight: 750; }
.table-filters select, .table-filters input[type="search"] { min-height: 38px; padding: 6px 10px; color: hsl(var(--foreground)); background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: 9px; }
.table-filters fieldset { display: flex; gap: 12px; margin: 0; padding: 0; border: 0; }
.table-filters .filter-grow { flex: 1; min-width: 160px; }
.filter-submit { display: flex; align-items: center; gap: 10px; margin-left: auto; color: hsl(var(--muted-foreground)); font-size: .82rem; }
.filter-submit [disabled], .toolbar-actions [disabled] { opacity: .55; cursor: not-allowed; }
.voice-picker > summary { cursor: pointer; list-style-position: inside; }
.voice-alt > summary { color: hsl(var(--muted-foreground)); }
.button.small { min-height: 32px; padding: 4px 12px; font-size: .8rem; }

/* Icon buttons: ▶ / ■ */
.icon-button { display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid hsl(var(--border)); border-radius: 50%; background: hsl(var(--background)); color: hsl(var(--primary)); cursor: pointer; list-style: none; }
.icon-button::-webkit-details-marker { display: none; }
.icon-button:hover { border-color: hsl(var(--primary)); background: hsl(var(--primary) / .08); }
.icon-button svg { width: 14px; height: 14px; fill: currentColor; }
.play-button .icon-stop, .play-button.is-playing .icon-play { display: none; }
.play-button.is-playing .icon-stop { display: block; }
.play-button.is-playing { border-color: hsl(var(--primary)); background: hsl(var(--primary)); color: white; }
.play-button.is-error { border-color: hsl(var(--danger)); color: hsl(var(--danger)); }
.work-spinner.small { display: inline-block; width: 16px; height: 16px; border-width: 2px; vertical-align: middle; }

/* Inline scene editing */
.row-edit { position: relative; }
.row-edit[open] > .row-edit-form { position: absolute; right: 0; z-index: 5; display: grid; gap: 10px; width: min(420px, 80vw); margin-top: 6px; padding: 14px; border: 1px solid hsl(var(--border)); border-radius: 12px; background: hsl(var(--card)); box-shadow: 0 18px 40px hsl(var(--shadow) / .18); text-align: left; white-space: normal; }
.row-edit-form label { display: grid; gap: 4px; color: hsl(var(--muted-foreground)); font-size: .74rem; font-weight: 750; }
.row-edit-form input, .row-edit-form select, .row-edit-form textarea { width: 100%; padding: 7px 9px; color: hsl(var(--foreground)); background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: 8px; font: inherit; font-size: .88rem; }

@media (max-width: 820px) {
  .brief-grid, .brief-facts { grid-template-columns: 1fr; }
  .stage-body { padding: 16px; }
  .stage-summary { padding: 14px 16px; }
  .data-table .col-narrow { display: none; }
  .filter-submit { width: 100%; justify-content: space-between; margin-left: 0; }
}
@media (max-width: 620px) {
  .scenes-table th:nth-child(3), .scenes-table td:nth-child(3) { display: none; }
  .roles-table th:nth-child(2), .roles-table td:nth-child(2) { display: none; }
  .voices-table th:nth-child(5), .voices-table td:nth-child(5), .voices-table th:nth-child(6), .voices-table td:nth-child(6) { display: none; }
}
.video-stage.stage, .stage-body [id], .voice-picker { scroll-margin-top: 84px; }
.data-table .row-actions { flex-wrap: nowrap; }
.data-table .status { white-space: nowrap; }
.options-fold { border: 1px solid hsl(var(--border)); border-radius: 12px; background: hsl(var(--background)); }
.options-fold > summary { display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; list-style: none; }
.options-fold > summary::-webkit-details-marker { display: none; }
.options-fold > summary::after { content: ''; width: 8px; height: 8px; margin-left: auto; border-right: 2px solid hsl(var(--muted-foreground)); border-bottom: 2px solid hsl(var(--muted-foreground)); transform: rotate(45deg); }
.options-fold[open] > summary::after { transform: rotate(-135deg); }
.options-fold > summary span { display: grid; gap: 2px; }
.options-fold > summary small { color: hsl(var(--muted-foreground)); font-size: .8rem; }
.options-fold-thumb { width: 40px; height: 52px; border-radius: 8px; object-fit: cover; }
.options-fold > .character-grid { padding: 0 14px 14px; }

/* Collapsible sidebar (desktop): an icon rail that gives the page more room. */
.sidebar, .main-area { transition: width .2s ease, margin-left .2s ease, padding .2s ease; }
@media (min-width: 821px) {
  .mobile-menu { display: grid; }
  .sidebar-collapsed { --sidebar-width: 72px; }
  .sidebar-collapsed .sidebar { padding: 22px 10px; overflow: hidden; }
  .sidebar-collapsed .sidebar .brand { justify-content: center; padding: 0 0 22px; }
  .sidebar-collapsed .sidebar .brand > span, .sidebar-collapsed .nav-label, .sidebar-collapsed .sidebar-footer > p,
  .sidebar-collapsed .tenant-switcher > span:last-child, .sidebar-collapsed .workspace-switcher, .sidebar-collapsed .nav-section-label { display: none; }
  .sidebar-collapsed .brand-logo { width: 46px; }
  .sidebar-collapsed .nav-item { justify-content: center; padding: 0; }
  .sidebar-collapsed .nav-item svg { width: 21px; }
  .sidebar-collapsed .tenant-switcher { justify-content: center; padding: 8px 0; }
}
@media (prefers-reduced-motion: reduce) { .sidebar, .main-area { transition: none; } }
.shortlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.shortlist li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid hsl(var(--border)); border-radius: 12px; background: hsl(var(--background)); }
.shortlist-name { display: grid; flex: 1; min-width: 0; }
.shortlist-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shortlist-name small { overflow: hidden; color: hsl(var(--muted-foreground)); font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.shortlist form { margin: 0; }
.col-voice select { width: 100%; min-width: 170px; min-height: 36px; padding: 5px 8px; color: hsl(var(--foreground)); background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: 9px; }
.in-list { color: hsl(var(--success)); font-weight: 900; }
.voice-dialog { width: min(920px, 94vw); max-height: 88vh; padding: 0; border: 1px solid hsl(var(--border)); border-radius: 16px; background: hsl(var(--card)); color: hsl(var(--foreground)); box-shadow: 0 30px 80px hsl(var(--shadow) / .3); }
.voice-dialog::backdrop { background: hsl(220 30% 8% / .55); }
.voice-dialog > form { display: grid; gap: 4px; padding: 18px 22px 22px; }
.voice-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.voice-dialog-header h2 { margin: 4px 0 0; font-size: 1.2rem; }
.voice-dialog .table-scroll { max-height: 58vh; }
.cast-form { display: grid; gap: 10px; padding: 16px; border: 1px solid hsl(var(--primary) / .25); border-radius: 14px; background: hsl(var(--primary) / .04); }
.cast-form label { display: grid; gap: 5px; color: hsl(var(--muted-foreground)); font-size: .74rem; font-weight: 750; }
.cast-form textarea { width: 100%; padding: 9px 11px; color: hsl(var(--foreground)); background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: 9px; font: inherit; font-size: .92rem; }
.render-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 300px)); gap: 16px; }
.render-card .frame-actions { flex-wrap: wrap; }
.app-dialog { width: min(680px, 94vw); max-height: 90vh; padding: 0; border: 1px solid hsl(var(--border)); border-radius: 16px; background: hsl(var(--card)); color: hsl(var(--foreground)); box-shadow: 0 30px 80px hsl(var(--shadow) / .3); text-align: left; white-space: normal; }
/* Centred wherever it sits in the page (some containers reset child margins). */
dialog.app-dialog { margin: auto; }
.confirm-dialog { width: min(440px, 92vw); }
.confirm-dialog-body { display: grid; gap: 18px; padding: 22px; }
.confirm-dialog-body p { margin: 0; font-size: .95rem; line-height: 1.5; }
.app-dialog::backdrop { background: hsl(220 30% 8% / .55); }
.scene-dialog-form { display: grid; gap: 12px; padding: 18px 22px 22px; }
.scene-dialog-form label { display: grid; gap: 5px; color: hsl(var(--muted-foreground)); font-size: .74rem; font-weight: 750; }
.scene-dialog-form input, .scene-dialog-form select, .scene-dialog-form textarea { width: 100%; padding: 9px 11px; color: hsl(var(--foreground)); background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: 9px; font: inherit; font-size: .95rem; font-weight: 400; line-height: 1.45; }
.scene-dialog-form textarea { resize: vertical; }
.scene-dialog .scene-edit-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }
@media (max-width: 620px) { .scene-dialog .scene-edit-row { grid-template-columns: 1fr; } }
.scene-delete-form { padding: 0 22px 18px; margin-top: -8px; }
.cast-still { display: flex; gap: 16px; align-items: center; margin: 4px 0 16px; padding: 12px; border: 1px solid hsl(var(--border)); border-radius: 14px; background: hsl(var(--muted) / .35); }
.cast-still-frame { flex: 0 0 auto; display: grid; place-items: center; width: 96px; aspect-ratio: 9 / 16; overflow: hidden; border-radius: 10px; background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); font-size: .7rem; font-weight: 800; letter-spacing: .08em; }
.cast-still-frame.is-wide { width: 160px; aspect-ratio: 16 / 9; }
.cast-still-frame.is-square { aspect-ratio: 1; }
.cast-still-frame img { width: 100%; height: 100%; object-fit: cover; }
.cast-still-copy { display: grid; gap: 6px; min-width: 0; }
.cast-still-copy p { margin: 0; color: hsl(var(--muted-foreground)); font-size: .85rem; line-height: 1.45; }
.cast-still-copy form { justify-self: start; }
.rushed-line { display: block; margin-top: 4px; font-size: .74rem; line-height: 1.35; }
.field-hint { font-weight: 500; font-size: .7rem; color: hsl(var(--muted-foreground)); }
.role-library { display: grid; gap: 4px; margin-top: 4px; }
.role-library form { display: flex; gap: 6px; align-items: center; }
.role-library select { max-width: 170px; padding: 4px 6px; border: 1px solid hsl(var(--border)); border-radius: 7px; background: hsl(var(--background)); color: hsl(var(--foreground)); font: inherit; font-size: .78rem; }
.role-library .compact-button { min-height: 26px; padding: 2px 9px; font-size: .75rem; }
.role-library-save.button.danger-link { color: hsl(var(--primary)); font-size: .75rem; }
.brand-characters { margin-bottom: 18px; }
.role-edit form { display: grid; gap: 8px; margin-top: 8px; min-width: 220px; }
.role-edit label { display: grid; gap: 4px; color: hsl(var(--muted-foreground)); font-size: .74rem; font-weight: 750; }
.role-edit input, .role-edit textarea { width: 100%; padding: 7px 9px; border: 1px solid hsl(var(--border)); border-radius: 8px; background: hsl(var(--background)); color: hsl(var(--foreground)); font: inherit; font-size: .88rem; }
.role-edit .button { justify-self: start; }
.cast-reuse-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.cast-reuse-form label { display: grid; gap: 4px; color: hsl(var(--muted-foreground)); font-size: .74rem; font-weight: 750; }
.cast-reuse-form select { padding: 6px 10px; border: 1px solid hsl(var(--border)); border-radius: 9px; background: hsl(var(--background)); color: hsl(var(--foreground)); font: inherit; font-size: .9rem; }
/* Probar above the pencil keeps the action column narrow. */
.month-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -4px 0 16px; }
.month-nav .button { min-height: 32px; padding: 0 12px; font-size: .8rem; }
.month-menu .action-menu-panel { left: 0; right: auto; max-height: 360px; overflow-y: auto; }
.month-menu .month-year { padding: 8px 10px 2px; }
.month-menu .menu-item.is-active { background: hsl(var(--primary-soft)); }
.carousel-references .reference-list { display: grid; gap: 10px; margin-bottom: 16px; }
.reference-card { display: grid; grid-template-columns: minmax(0, 260px) 1fr; gap: 14px; align-items: center; padding: 10px; border: 1px solid hsl(var(--border)); border-radius: 12px; color: hsl(var(--foreground)); text-decoration: none; }
.reference-card:hover { background: hsl(var(--muted) / .4); }
.reference-strip { display: flex; gap: 4px; overflow: hidden; }
.reference-strip img { width: 40px; height: 50px; object-fit: cover; border-radius: 4px; background: hsl(var(--muted)); flex: none; }
.reference-copy { display: grid; gap: 3px; min-width: 0; }
.reference-copy small { color: hsl(var(--muted-foreground)); }
.reference-copy p { margin: 2px 0 0; font-size: .84rem; color: hsl(var(--muted-foreground)); }
.reference-upload-form { display: grid; grid-template-columns: 1fr 1.4fr; gap: 14px; align-items: start; padding-top: 14px; border-top: 1px solid hsl(var(--border)); }
.reference-upload-form > .button { grid-column: 1 / -1; justify-self: end; }
.reference-upload-form label, .art-reference-select { display: grid; gap: 4px; font-size: .8rem; font-weight: 700; }
.reference-upload-form small, .art-reference-select small { color: hsl(var(--muted-foreground)); font-weight: 500; }
.art-reference-select { margin: 8px 0 4px; text-align: left; }
.art-reference-select select { padding: 6px 8px; border: 1px solid hsl(var(--border)); border-radius: 8px; background: hsl(var(--background)); color: hsl(var(--foreground)); font: inherit; font-size: .82rem; }
.reference-detail-grid { display: grid; gap: 12px; }
.reference-slide-row { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 14px; border: 1px solid hsl(var(--border)); border-radius: 12px; }
.reference-slide-row img { width: 100%; border-radius: 8px; background: hsl(var(--muted)); }
.reference-slide-media { display: grid; gap: 8px; align-content: start; }
.reference-slide-tools { display: flex; gap: 4px; }
.reference-slide-tools .button { min-height: 30px; padding: 0 9px; font-size: .78rem; }
.reference-slide-tools .button:first-child, .reference-slide-tools .button:nth-child(2) { min-width: 34px; }
.reference-add-form { margin-top: 14px; }
.reference-upload-form .reference-replace { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.reference-files { display: grid; gap: 6px; }
.reference-add-form p { margin: 2px 0 0; font-size: .8rem; color: hsl(var(--muted-foreground)); }
.reference-slide-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.reference-slide-fields label, .reference-general label { display: grid; gap: 4px; font-size: .8rem; font-weight: 700; }
.reference-slide-fields .wide { grid-column: 1 / -1; }
.reference-slide-fields .check { display: flex; align-items: center; gap: 8px; }
.reference-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
.reference-general { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.reference-detail textarea, .reference-detail input[type="text"], .reference-detail select { width: 100%; padding: 7px 9px; border: 1px solid hsl(var(--border)); border-radius: 8px; background: hsl(var(--background)); color: hsl(var(--foreground)); font: inherit; font-size: .84rem; font-weight: 500; }
@media (max-width: 760px) {
  .reference-card, .reference-slide-row, .reference-upload-form, .reference-general, .reference-slide-fields { grid-template-columns: 1fr; }
  .reference-slide-row img { max-width: 220px; }
}
.scenes-table .col-actions { width: 1%; text-align: center; }
.scene-test-form { display: block; margin: 0 0 6px; }
.scene-test-button { min-height: 30px; padding: 3px 10px; font-size: .8rem; }
.scene-test-details > summary { cursor: pointer; color: hsl(var(--primary)); font-size: .8rem; font-weight: 750; padding: 4px 0; }
.scene-test-details .scene-test { margin-top: 6px; }
.scene-test-delete { margin-top: 4px; }
.scene-test-delete .button.danger-link { font-size: .74rem; }
.scene-board { display: grid; grid-template-columns: repeat(3, minmax(0, 120px)); gap: 8px; margin-top: 6px; }
.scene-board figure { margin: 0; display: grid; gap: 4px; justify-items: center; }
.scene-board img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 8px; background: hsl(var(--muted)); }
.scene-board figcaption { font-size: .7rem; color: hsl(var(--muted-foreground)); }
.script-proposal { display: grid; gap: 10px; margin: 4px 0 16px; padding: 14px; border: 1px solid hsl(var(--primary) / .35); border-radius: 14px; background: hsl(var(--primary) / .05); }
.script-proposal ul { margin: 0; padding-left: 18px; font-size: .85rem; }
.scene-test-row td { border-top: 0; padding-top: 0; }
.scene-test { display: flex; gap: 14px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: hsl(var(--muted) / .35); }
.scene-test-video { width: 150px; max-height: 270px; border-radius: 10px; background: #000; }
.scene-test-copy { display: grid; gap: 6px; font-size: .85rem; }
.scene-test-copy span { color: hsl(var(--muted-foreground)); line-height: 1.45; }
.scene-test-copy .button { justify-self: start; }
@media (max-width: 620px) { .cast-still, .scene-test { flex-direction: column; } .scene-test-video { width: 100%; } }
.button.danger-link { min-height: 0; padding: 0; color: hsl(var(--danger)); background: none; border: 0; font-size: .85rem; font-weight: 750; cursor: pointer; }
.button.danger-link:hover { text-decoration: underline; }

/* Script writing progress */
.script-progress { display: grid; gap: 12px; margin: 14px 0; padding: 18px 20px; border: 1px solid hsl(var(--border)); border-radius: 14px; background: hsl(var(--card)); box-shadow: 0 1px 2px hsl(var(--foreground) / .04); }
.script-progress-head { display: flex; align-items: center; gap: 14px; }
.script-progress-head div { display: grid; gap: 3px; flex: 1 1 auto; min-width: 0; }
.script-progress-head span[data-progress-step] { color: hsl(var(--muted-foreground)); font-size: .88rem; }
.script-progress-time { font-variant-numeric: tabular-nums; color: hsl(var(--muted-foreground)); font-size: .88rem; }
.script-progress-bar { height: 6px; border-radius: 999px; background: hsl(var(--muted)); overflow: hidden; }
.script-progress-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: hsl(var(--primary)); transition: width .9s ease; }
.script-progress-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.script-progress-steps li { counter-increment: step; display: flex; align-items: center; gap: 8px; color: hsl(var(--muted-foreground)); font-size: .82rem; }
.script-progress-steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 20px; height: 20px; flex: 0 0 auto; border-radius: 50%; border: 1px solid hsl(var(--border)); font-size: .72rem; }
.script-progress-steps li.is-current { color: hsl(var(--foreground)); font-weight: 600; }
.script-progress-steps li.is-current::before { border-color: hsl(var(--primary)); color: hsl(var(--primary)); }
.script-progress-steps li.is-done::before { content: '✓'; background: hsl(var(--primary)); border-color: hsl(var(--primary)); color: #fff; }
.script-progress-note { margin: 0; color: hsl(var(--muted-foreground)); font-size: .8rem; }
@media (max-width: 560px) { .script-progress-steps { grid-template-columns: repeat(2, 1fr); } }
@media (prefers-reduced-motion: reduce) { .script-progress-bar span { transition: none; } }

/* Script direction */
.script-write-form { display: grid; gap: 12px; flex: 1 1 100%; }
.script-direction-field { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; }
.script-direction-field small { font-weight: 400; color: hsl(var(--muted-foreground)); }
.script-direction-field textarea, .script-direction textarea { width: 100%; resize: vertical; font: inherit; font-weight: 400; }
.script-direction { margin: 0 0 14px; padding: 10px 14px; border: 1px solid hsl(var(--border)); border-radius: 12px; background: hsl(var(--card)); }
.script-direction summary { display: flex; gap: 10px; align-items: baseline; cursor: pointer; list-style: none; }
.script-direction summary::-webkit-details-marker { display: none; }
.script-direction summary::before { content: '▸'; color: hsl(var(--muted-foreground)); transition: transform .15s ease; }
.script-direction[open] summary::before { transform: rotate(90deg); }
.script-direction summary span { color: hsl(var(--muted-foreground)); font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1 1 auto; }
.script-direction[open] summary span { display: none; }
.script-direction textarea { margin-top: 10px; }
.voice-mismatch { display: block; margin-top: 3px; color: hsl(28 90% 45%); font-size: .78rem; font-weight: 600; }
.voice-mismatch::before { content: '⚠ '; }
.stage-empty:has(.script-write-form) { flex-direction: column; align-items: stretch; }
/* The long preview must never widen the stage: clip it to one line. */
.script-direction { min-width: 0; max-width: 100%; overflow: hidden; }
.script-direction summary { min-width: 0; }
.script-direction summary strong { flex: 0 0 auto; white-space: nowrap; }
.script-direction summary span { display: block; }
.stage-body > * { min-width: 0; }
.render-failed { display: grid; place-content: center; gap: 8px; padding: 24px; text-align: center; }
.render-failed strong { color: hsl(0 72% 60%); }
.render-failed span { color: hsl(var(--foreground)); font-size: .9rem; }
.render-failed small { color: hsl(var(--muted-foreground)); font-size: .8rem; }
.render-detail { text-align: left; font-size: .75rem; }
.draft-resolution { padding: 6px 9px; border: 1px solid hsl(var(--border)); border-radius: 9px; background: hsl(var(--background)); color: hsl(var(--foreground)); font: inherit; font-size: .85rem; margin-right: 6px; }
.render-draft { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); font-size: .7rem; font-weight: 800; vertical-align: middle; }
.scene-redo-form label { display: grid; gap: 4px; color: hsl(var(--muted-foreground)); font-size: .74rem; font-weight: 750; }
.scene-redo-form select { padding: 6px 9px; border: 1px solid hsl(var(--border)); border-radius: 8px; background: hsl(var(--background)); color: hsl(var(--foreground)); font: inherit; font-size: .85rem; }
.format-methods { display: flex; gap: 6px; flex-wrap: wrap; }
.render-formats form label { display: grid; gap: 4px; color: hsl(var(--muted-foreground)); font-size: .74rem; font-weight: 750; }
.render-formats select { padding: 6px 9px; border: 1px solid hsl(var(--border)); border-radius: 8px; background: hsl(var(--background)); color: hsl(var(--foreground)); font: inherit; font-size: .85rem; }
.format-item { display: grid; gap: 6px; padding-top: 8px; border-top: 1px solid hsl(var(--border)); }
.format-video { width: 100%; max-height: 200px; }
.scene-redos { display: grid; gap: 10px; }
.render-origin { display: block; color: hsl(var(--muted-foreground)); font-size: .75rem; }
.render-redo { flex-basis: 100%; }
.render-redo > summary { cursor: pointer; color: hsl(var(--primary)); font-size: .85rem; font-weight: 750; }
.render-redo-options { display: grid; gap: 10px; margin-top: 8px; }
.render-redo-options p { margin: 0; color: hsl(var(--muted-foreground)); font-size: .78rem; }
.render-redo-options form { display: grid; gap: 4px; }
.render-redo-options small { color: hsl(var(--muted-foreground)); font-size: .75rem; line-height: 1.35; }
.render-detail summary { cursor: pointer; color: hsl(var(--muted-foreground)); }
.render-detail pre { max-height: 180px; overflow: auto; white-space: pre-wrap; word-break: break-all; margin: 6px 0 0; }

/* ── Video studio, compact (v0.50) ──────────────────────────────────────── */
.video-page .button { min-height: 32px; padding: 0 12px; font-size: .8rem; }
.video-page .button.primary { box-shadow: 0 1px 2px hsl(var(--primary) / .25); }
.video-page .icon-button { width: 32px; height: 32px; }
.video-page .stage-toolbar.compact { align-items: center; }
.video-page .stage-toolbar .toolbar-note { font-size: .82rem; color: hsl(var(--muted-foreground)); }
.video-stage.is-done:not([open]) .stage-summary { opacity: .72; }
.video-stage.is-done .stage-title strong { color: hsl(var(--muted-foreground)); font-weight: 700; }
.video-stage.is-locked .stage-summary { opacity: .55; }

/* Action menus: a small ··· / Más ▾ that opens a panel of plain items. */
.action-menu { position: relative; display: inline-block; }
.action-menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; min-height: 32px; min-width: 32px; padding: 0 10px; border: 1px solid hsl(var(--border)); border-radius: var(--radius-sm); background: hsl(var(--card)); color: hsl(var(--foreground)); font-size: .8rem; font-weight: 700; letter-spacing: .04em; }
.action-menu > summary::-webkit-details-marker { display: none; }
.action-menu > summary:hover, .action-menu[open] > summary { background: hsl(var(--muted) / .5); }
.action-menu-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; display: grid; gap: 2px; min-width: 240px; padding: 6px; border: 1px solid hsl(var(--border)); border-radius: 12px; background: hsl(var(--card)); box-shadow: 0 14px 40px hsl(var(--shadow) / .22); text-align: left; white-space: normal; }
.action-menu-panel form { display: contents; }
.action-menu-panel .menu-form { display: grid; gap: 4px; padding: 6px 8px; }
.action-menu-panel .menu-form select { width: 100%; padding: 5px 7px; border: 1px solid hsl(var(--border)); border-radius: 8px; background: hsl(var(--background)); color: hsl(var(--foreground)); font: inherit; font-size: .8rem; }
.menu-item { display: grid; gap: 1px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: hsl(var(--foreground)); font: inherit; font-size: .84rem; font-weight: 650; text-align: left; text-decoration: none; cursor: pointer; }
.menu-item:hover:not(:disabled) { background: hsl(var(--muted) / .6); }
.menu-item:disabled { opacity: .45; cursor: not-allowed; }
.menu-item small { color: hsl(var(--muted-foreground)); font-size: .72rem; font-weight: 500; }
.menu-item.is-danger { color: hsl(var(--danger)); }
.scenes-table .col-actions { width: 1%; text-align: right; }
.scenes-table .action-menu-panel { min-width: 220px; }

/* Cast still actions */
.cast-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cast-upload label.button { cursor: pointer; }

/* Stage 4: one row per version, last three visible. */
.final-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid hsl(var(--success) / .35); border-radius: 12px; background: hsl(var(--success-soft) / .5); }
.final-banner strong { display: block; font-size: .95rem; }
.final-banner small { color: hsl(var(--muted-foreground)); }
.work-progress.compact { padding: 10px 12px; }
.render-list { display: grid; gap: 10px; }
.render-row { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 10px; border: 1px solid hsl(var(--border)); border-radius: 12px; background: hsl(var(--background)); }
.render-row.is-approved { border-color: hsl(var(--success)); }
.render-thumb.clip-video { width: 96px; border-radius: 8px; }
.render-row-body { display: grid; gap: 6px; align-content: start; min-width: 0; }
.render-row-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.render-row-head strong { font-size: .95rem; }
.render-draft.is-final { background: hsl(var(--primary-soft)); color: hsl(var(--primary)); }
.render-draft.is-chosen { background: hsl(var(--success-soft)); color: hsl(var(--success)); }
.render-row-meta { color: hsl(var(--muted-foreground)); font-size: .78rem; line-height: 1.4; }
.render-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.render-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: hsl(var(--muted) / .35); color: hsl(var(--muted-foreground)); font-size: .82rem; }
.render-line.is-failed { background: hsl(var(--danger-soft) / .6); }
.render-line-title { font-weight: 750; color: hsl(var(--foreground)); }
.render-line .render-detail { font-size: .72rem; }
.older-versions > summary { cursor: pointer; color: hsl(var(--primary)); font-size: .82rem; font-weight: 750; padding: 6px 0; list-style: none; }
.older-versions > summary::-webkit-details-marker { display: none; }
.older-versions > summary::before { content: '▸ '; }
.older-versions[open] > summary::before { content: '▾ '; }
.older-versions > .render-list, .older-versions > .scene-redos { margin-top: 8px; }
@media (max-width: 620px) { .render-row { grid-template-columns: 72px 1fr; } .render-thumb.clip-video { width: 72px; } .final-banner { flex-direction: column; align-items: flex-start; } }

/* Final video page: formats on top as the workspace, everything else in folded rows */
.final-page { max-width: 1120px; }
.final-heading { display: grid; gap: 6px; margin-bottom: 20px; }
.final-heading .back-link { width: fit-content; color: hsl(var(--primary)); font-size: .82rem; font-weight: 700; text-decoration: none; }
.final-heading h1 { margin: 0; font-size: clamp(1.3rem, 2.4vw, 1.75rem); line-height: 1.2; }
.final-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.final-meta span { padding: 3px 10px; border-radius: 99px; background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); font-size: .74rem; font-weight: 650; }

.final-workspace { display: grid; gap: 12px; margin-bottom: 32px; scroll-margin-top: 16px; }
.final-tabs-nav { display: flex; gap: 4px; overflow-x: auto; padding: 4px; border: 1px solid hsl(var(--border)); border-radius: 12px; background: hsl(var(--card)); scrollbar-width: none; }
.final-tab { flex: 0 0 auto; display: grid; gap: 1px; padding: 7px 14px; border: 0; border-radius: 9px; background: none; color: hsl(var(--foreground)); font: inherit; font-size: .86rem; font-weight: 750; text-align: left; cursor: pointer; }
.final-tab small { color: hsl(var(--muted-foreground)); font-size: .7rem; font-weight: 500; }
.final-tab:hover { background: hsl(var(--muted) / .6); }
.final-tab.is-active { background: hsl(var(--primary)); color: hsl(0 0% 100%); }
.final-tab.is-active small { color: hsl(0 0% 100% / .8); }
.final-panel { display: none; grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; align-items: start; padding: 20px; border: 1px solid hsl(var(--border)); border-radius: var(--radius); background: hsl(var(--card)); scroll-margin-top: 16px; }
.final-panel.is-active { display: grid; }
.final-stage { display: grid; place-items: center; min-height: 240px; padding: 12px; border-radius: 12px; background: hsl(var(--muted) / .45); }
.final-player { width: 100%; }
.final-player video { display: block; width: 100%; max-height: 62vh; aspect-ratio: 9 / 16; margin: 0 auto; border-radius: 10px; background: #000; object-fit: contain; }
.final-panel[data-aspect="16:9"] video { aspect-ratio: 16 / 9; }
.final-panel[data-aspect="21:9"] video { aspect-ratio: 21 / 9; }
.final-panel[data-aspect="1:1"] video { aspect-ratio: 1 / 1; max-width: 62vh; }
.final-panel[data-aspect="4:3"] video { aspect-ratio: 4 / 3; }
.final-panel[data-aspect="9:16"] video { max-width: calc(62vh * 9 / 16); }
.final-empty { display: grid; justify-items: center; gap: 6px; max-width: 320px; padding: 24px; color: hsl(var(--muted-foreground)); font-size: .84rem; text-align: center; }
.final-empty strong { color: hsl(var(--foreground)); font-size: .95rem; }
.final-side { display: grid; gap: 12px; align-content: start; }
.final-side-head { display: grid; gap: 2px; }
.final-side-head strong { font-size: .95rem; }
.final-side-head small, .final-side small { color: hsl(var(--muted-foreground)); font-size: .76rem; line-height: 1.4; }
.final-side-block { display: grid; gap: 6px; padding-top: 12px; border-top: 1px solid hsl(var(--border)); }
.final-side-block form { display: grid; gap: 8px; margin: 0; }
.final-made summary { cursor: pointer; font-size: .8rem; font-weight: 700; color: hsl(var(--muted-foreground)); }
.final-made-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.final-made-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .78rem; color: hsl(var(--muted-foreground)); }
.final-made-list form { display: block; }
.final-side .format-resolution select { flex: 1; }
.button.full { width: 100%; justify-content: center; }
.final-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.final-actions small { color: hsl(var(--muted-foreground)); }
.final-actions form { margin: 0; }
.final-create > summary { cursor: pointer; color: hsl(var(--primary)); font-size: .84rem; font-weight: 750; list-style: none; }
.final-create > summary::-webkit-details-marker { display: none; }
.final-create form { display: grid; gap: 8px; margin-top: 10px; }
.final-create small { color: hsl(var(--muted-foreground)); }

.final-group-title { margin: 0 0 10px; color: hsl(var(--muted-foreground)); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.final-list { display: grid; gap: 8px; margin-bottom: 28px; }
.final-group-title + .final-item { margin-bottom: 28px; }
.final-item { border: 1px solid hsl(var(--border)); border-radius: 12px; background: hsl(var(--card)); scroll-margin-top: 16px; transition: border-color .15s, box-shadow .15s; }
.final-item[open] { border-color: hsl(var(--primary) / .35); box-shadow: 0 8px 24px hsl(var(--shadow) / .06); }
.final-item > summary { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 14px; cursor: pointer; list-style: none; }
.final-item > summary::-webkit-details-marker { display: none; }
.final-item > summary:hover { background: hsl(var(--muted) / .35); border-radius: 12px; }
.final-item-mark { flex: 0 0 auto; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: hsl(var(--muted)); color: hsl(var(--foreground)); font-size: .74rem; font-weight: 850; }
.final-item-mark.is-ads { font-size: .64rem; }
.final-item-thumb { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 8px; object-fit: cover; background: hsl(var(--muted)); }
.final-item-title { flex: 1; display: grid; gap: 1px; min-width: 0; }
.final-item-title strong { font-size: .92rem; }
.final-item-meta { overflow: hidden; color: hsl(var(--muted-foreground)); font-size: .78rem; white-space: nowrap; text-overflow: ellipsis; }
.final-item-chevron { flex: 0 0 auto; width: 8px; height: 8px; margin: 0 4px 4px; border-right: 2px solid hsl(var(--muted-foreground)); border-bottom: 2px solid hsl(var(--muted-foreground)); transform: rotate(45deg); transition: transform .15s; }
.final-item[open] .final-item-chevron { margin-bottom: -2px; transform: rotate(-135deg); }
.final-item-body { display: grid; gap: 12px; padding: 4px 16px 18px 60px; }
.final-item-body > * { margin: 0 !important; }
.final-item-body .how-to { margin: 0; }
.final-item-body .final-publish-form { max-width: 640px; }
.final-item-body fieldset { display: grid; gap: 8px; min-width: 0; margin: 0; padding: 12px 0 0; border: 0; border-top: 1px solid hsl(var(--border)); }
.final-item-body fieldset.format-methods { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.final-item-body legend { float: left; width: 100%; margin-bottom: 4px; padding: 0; color: hsl(var(--muted-foreground)); font-size: .84rem; }
.final-form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.final-ad { display: grid; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid hsl(var(--border)); }
.final-item .cover-grid { margin-top: 0 !important; max-width: 640px; }
@media (max-width: 760px) {
  .final-panel { grid-template-columns: 1fr; padding: 14px; }
  .final-item-body { padding: 4px 14px 16px; }
  .final-item > summary .status { display: none; }
}

/* Voice library */
.voices-link { display: grid; gap: 4px; margin-bottom: 18px; padding: 16px 18px; text-decoration: none; color: inherit; }
.voices-link strong { font-size: 1.05rem; color: hsl(var(--primary)); }
.voices-link small { color: hsl(var(--muted-foreground)); }
.voices-page .page-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: flex-end; }
.voices-page .back-link { display: inline-block; margin-bottom: 6px; color: hsl(var(--primary)); font-size: .82rem; font-weight: 700; text-decoration: none; }
.lang-switch { display: flex; gap: 4px; padding: 4px; border: 1px solid hsl(var(--border)); border-radius: 10px; background: hsl(var(--card)); }
.lang-switch a { padding: 6px 12px; border-radius: 8px; color: hsl(var(--foreground)); font-size: .82rem; font-weight: 700; text-decoration: none; }
.lang-switch a.is-active { background: hsl(var(--primary)); color: #fff; }
.voices-section { margin-bottom: 16px; padding: 18px; }
.voice-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.voice-filters input, .voice-filters select { padding: 7px 10px; border: 1px solid hsl(var(--border)); border-radius: 9px; background: hsl(var(--background)); color: hsl(var(--foreground)); font: inherit; font-size: .85rem; }
.voice-filters input { flex: 1; min-width: 180px; }
.voice-list { display: grid; gap: 6px; }
.voice-item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(160px, 260px) auto; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid hsl(var(--border)); border-radius: 10px; background: hsl(var(--background)); }
.voice-item[hidden] { display: none; }
.voice-item-name { display: grid; gap: 2px; min-width: 0; }
.voice-item-name small { color: hsl(var(--muted-foreground)); font-size: .76rem; }
.voice-item-name .voice-desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-item audio { width: 100%; height: 32px; }
.voice-star .star { width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: hsl(var(--muted-foreground)); font-size: 1.2rem; cursor: pointer; }
.voice-star .star:hover { background: hsl(var(--muted) / .6); }
.voice-star .star.is-on { color: hsl(45 95% 48%); }
.clone-list { margin: 8px 0; padding-left: 18px; font-size: .85rem; }
.voice-favorites { display: grid; gap: 8px; margin: 0 0 14px; padding: 12px; border: 1px solid hsl(45 95% 48% / .4); border-radius: 12px; background: hsl(45 95% 48% / .06); }
.voice-favorites .voice-item { grid-template-columns: minmax(0, 1fr) minmax(140px, 220px) auto; }
.voice-favorites-link, .voice-favorites-empty a { color: hsl(var(--primary)); font-size: .8rem; font-weight: 700; }
.voice-favorites-empty { margin: 0 0 12px; color: hsl(var(--muted-foreground)); font-size: .82rem; }
.tenant-voice-box { margin-top: 12px; }
@media (max-width: 620px) { .voice-item, .voice-favorites .voice-item { grid-template-columns: 1fr auto; } .voice-item audio { grid-column: 1 / -1; } }

/* Character portraits (etapa 3) */
.character-sheets { margin: 4px 0 12px; padding: 12px; border: 1px solid hsl(var(--border)); border-radius: 14px; background: hsl(var(--muted) / .35); }
.character-sheets-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin-bottom: 10px; }
.character-sheets-head small { color: hsl(var(--muted-foreground)); }
.character-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.character-card { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.character-card > small { color: hsl(var(--muted-foreground)); font-size: .75rem; }
.character-photo { display: grid; place-items: center; width: 100%; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 10px; background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); font-size: 1.6rem; font-weight: 800; }
.character-photo img { width: 100%; height: 100%; object-fit: cover; }
.character-actions { display: flex; gap: 6px; align-items: center; margin-top: 2px; }


/* Language versions: panel on the final page, note on the studio page */
.language-list { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 24px 4px; }
.language-list form { margin: 0; }
.language-note { margin: -4px 0 16px; padding: 14px 16px 4px; border: 1px solid hsl(var(--primary) / .25); border-radius: var(--radius-sm); background: hsl(var(--card)); }
.language-note > p { margin: 0 0 4px; font-size: .86rem; }
.language-note .how-to { margin: 10px 0; }
.language-note form { margin: 0 0 10px; }

/* Other formats: 720p/1080p picker */
.format-resolution { display: flex; align-items: center; gap: 8px; font-size: .84rem; color: hsl(var(--muted-foreground)); }
.format-resolution select { font: inherit; padding: 4px 8px; border-radius: 8px; border: 1px solid hsl(var(--border)); background: hsl(var(--card)); color: hsl(var(--foreground)); }

/* Final page: publish to X/YouTube */
.status-pending, .status-publishing { color: hsl(var(--primary)); background: hsl(var(--primary-soft)); }
.status-failed { color: hsl(var(--danger)); background: hsl(var(--danger-soft)); }
.final-publish-form { display: grid; gap: 10px; }
.final-publish-form label { display: grid; gap: 4px; font-size: .84rem; color: hsl(var(--muted-foreground)); }
.final-publish-form textarea, .final-publish-form input, .final-publish-form select { font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid hsl(var(--border)); background: hsl(var(--card)); color: hsl(var(--foreground)); }
.final-publish-form .confirm-row, .final-side .confirm-row, .final-item-body .confirm-row { display: flex; flex-direction: row; align-items: center; gap: 8px; font-size: .82rem; color: hsl(var(--foreground)); }
.final-publish-form .confirm-row input { width: auto; }
.final-publish-actions { display: flex; }

/* Angles of the same video (other concept routes, same characters) */
.angle-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -4px 0 16px; }
.angle-chip { display: inline-flex; flex-direction: column; padding: 6px 12px; border: 1px solid hsl(var(--border)); border-radius: 10px; background: hsl(var(--card)); color: hsl(var(--foreground)); font-size: .82rem; font-weight: 750; text-decoration: none; }
.angle-chip small { color: hsl(var(--muted-foreground)); font-weight: 500; font-size: .7rem; }
.angle-chip.is-active { border-color: hsl(var(--primary)); background: hsl(var(--primary-soft)); }

/* "Pasar a calidad final" chooses 720p (free rescale) or 1080p (AI upscale) */
.finalize-menu > summary, .finalize-menu[open] > summary, .finalize-menu > summary:hover { background: hsl(var(--primary)); border-color: hsl(var(--primary)); color: white; letter-spacing: 0; padding: 0 14px; }

/* Team: collaborators and granular permissions per module */
.team-edit, .invite-link-box, #invite { margin-bottom: 20px; }
.page-content > .panel + .panel { margin-top: 20px; }
.invite-link-box input { width: 100%; font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid hsl(var(--border)); background: hsl(var(--muted) / .4); color: hsl(var(--foreground)); }
.permission-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 10px; }
.permission-head label { display: grid; gap: 4px; font-size: .84rem; color: hsl(var(--muted-foreground)); }
.permission-head input, .permission-head select { font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid hsl(var(--border)); background: hsl(var(--card)); color: hsl(var(--foreground)); }
.permission-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 12px 0 16px; }
.permission-grid.is-admin { opacity: .6; }
.permission-module { margin: 0; padding: 10px 12px 12px; border: 1px solid hsl(var(--border)); border-radius: 10px; background: hsl(var(--background)); }
.permission-module legend { padding: 0 4px; font-size: .74rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: hsl(var(--muted-foreground)); }
.permission-option { display: flex; align-items: flex-start; gap: 8px; padding: 4px 0; font-size: .84rem; }
.permission-option input { margin-top: 3px; }
.permission-option.is-locked { color: hsl(var(--muted-foreground)); }
@media (max-width: 820px) { .team-table th:nth-child(3), .team-table td:nth-child(3) { display: none; } }

/* Clients: Higgsfield price and per-client account policy */
.higgsfield-rate { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 320px); gap: 20px; align-items: end; margin-bottom: 20px; }
.higgsfield-rate h2 { margin: 5px 0 6px; }
.higgsfield-rate p { margin: 0; color: hsl(var(--muted-foreground)); }
.higgsfield-policy select { width: 100%; padding: 9px 10px; color: hsl(var(--foreground)); background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: 7px; font: inherit; font-size: .8rem; font-weight: 500; }
.higgsfield-policy small { color: hsl(var(--muted-foreground)); font-weight: 500; }
@media (max-width: 820px) { .higgsfield-rate { grid-template-columns: 1fr; } }

/* Suggested video cover (final page) */
.cover-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.3fr); gap: 14px; align-items: start; margin-top: 16px !important; }
.cover-grid.is-single { grid-template-columns: minmax(0, 360px); }
.cover-image img { display: block; width: 100%; border: 1px solid hsl(var(--border)); border-radius: 10px; background: hsl(var(--muted)); }
.cover-actions form { margin: 0; }
.cover-frames { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; margin: 0; padding: 0; border: 0; }
.cover-frames legend { margin-bottom: 6px; color: hsl(var(--muted-foreground)); font-size: .84rem; }
.cover-frame { position: relative; display: grid !important; gap: 3px; cursor: pointer; text-align: center; }
.cover-frame input { position: absolute; opacity: 0; pointer-events: none; }
.cover-frame img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border: 2px solid transparent; border-radius: 8px; background: hsl(var(--muted)); }
.cover-frame small { font-size: .72rem; }
.cover-frame input:checked + img, .cover-frame input:checked + span { border-color: hsl(var(--primary)); box-shadow: 0 0 0 2px hsl(var(--primary) / .25); }
.cover-frame input:focus-visible + img, .cover-frame input:focus-visible + span { outline: 2px solid hsl(var(--primary)); outline-offset: 2px; }
.cover-frame-auto span { display: flex; align-items: center; justify-content: center; height: 100%; min-height: 80px; padding: 6px; border: 2px solid hsl(var(--border)); border-radius: 8px; font-size: .78rem; font-weight: 700; color: hsl(var(--foreground)); }
.cover-older-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; margin-top: 10px; }
.cover-older-item { display: grid; gap: 4px; }
.cover-older-item img { display: block; width: 100%; border-radius: 8px; border: 1px solid hsl(var(--border)); }
.cover-older-item .final-actions { gap: 10px; }
.button.danger-link.cover-approve-link { color: hsl(var(--primary)); }
@media (max-width: 620px) { .cover-grid { grid-template-columns: 1fr; } }

/* Hidden step-by-step guide (partials/how-to) */
.how-to { margin: 16px 24px; border: 1px solid hsl(var(--primary) / .25); border-radius: var(--radius-sm); background: hsl(var(--primary-soft) / .45); }
.how-to > summary { display: flex; align-items: center; gap: 8px; padding: 12px 15px; cursor: pointer; color: hsl(var(--primary)); font-size: .82rem; font-weight: 800; list-style: none; }
.how-to > summary::-webkit-details-marker { display: none; }
.how-to > summary span { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: hsl(var(--primary)); color: hsl(0 0% 100%); font-size: .72rem; }
.how-to ol { display: grid; gap: 10px; margin: 0; padding: 4px 18px 14px 38px; font-size: .86rem; line-height: 1.5; }
.how-to code { padding: 1px 5px; border-radius: 5px; background: hsl(var(--card)); font-size: .78rem; word-break: break-all; }
.how-to a { color: hsl(var(--primary)); font-weight: 700; }
.how-to .how-to-copy { min-height: 0; margin-left: 4px; padding: 2px 8px; font-size: .72rem; }
.how-to-note { margin: 0; padding: 0 18px 14px; color: hsl(var(--muted-foreground)); font-size: .8rem; }

/* Public pages: home, privacy, terms */
.public-page { min-height: 100vh; display: flex; flex-direction: column; background: hsl(var(--background)); color: hsl(var(--foreground)); }
.public-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px clamp(16px, 5vw, 64px); border-bottom: 1px solid hsl(var(--border)); background: hsl(var(--card)); }
.public-brand { text-decoration: none; }
.public-nav { display: flex; align-items: center; gap: 18px; font-size: .9rem; font-weight: 700; }
.public-nav a:not(.button) { color: hsl(var(--foreground)); text-decoration: none; }
.public-main { flex: 1; width: 100%; max-width: 980px; margin: 0 auto; padding: clamp(28px, 6vw, 72px) 16px; }
.public-hero h1 { margin: 10px 0 16px; font-size: clamp(1.9rem, 4.5vw, 3rem); line-height: 1.1; }
.public-hero p { max-width: 70ch; font-size: 1.05rem; line-height: 1.6; }
.public-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 10px; }
.public-small { color: hsl(var(--muted-foreground)); font-size: .86rem; }
.public-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 44px 0; }
.public-grid article { padding: 20px; border: 1px solid hsl(var(--border)); border-radius: 14px; background: hsl(var(--card)); }
.public-grid h2 { margin: 0 0 8px; font-size: 1.02rem; }
.public-grid p { margin: 0; color: hsl(var(--muted-foreground)); font-size: .92rem; line-height: 1.55; }
.public-section { padding: 24px; border: 1px solid hsl(var(--border)); border-radius: 14px; background: hsl(var(--card)); line-height: 1.6; }
.public-section h2 { margin-top: 0; }
.public-main a { color: hsl(var(--primary)); }
.legal { line-height: 1.65; }
.legal h1 { margin: 8px 0 6px; font-size: clamp(1.7rem, 4vw, 2.4rem); }
.legal h2 { margin: 30px 0 8px; font-size: 1.2rem; }
.legal h3 { margin: 20px 0 6px; font-size: 1rem; }
.legal ul { padding-left: 22px; }
.legal li { margin-bottom: 6px; }
.legal code { padding: 1px 5px; border-radius: 5px; background: hsl(var(--muted)); font-size: .85rem; }
.legal hr { margin: 40px 0; border: 0; border-top: 1px solid hsl(var(--border)); }
.public-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 22px clamp(16px, 5vw, 64px); border-top: 1px solid hsl(var(--border)); background: hsl(var(--card)); color: hsl(var(--muted-foreground)); font-size: .84rem; }
.public-footer p { margin: 0; }
.public-footer nav { display: flex; flex-wrap: wrap; gap: 14px; }
.public-footer a { color: hsl(var(--primary)); }
.auth-legal { margin: 14px 0 0; text-align: center; font-size: .8rem; }
.auth-legal a { color: hsl(var(--muted-foreground)); }
@media (max-width: 620px) { .public-nav a:not(.button) { display: none; } }

.publish-summary { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; padding: 10px 12px; border: 1px solid hsl(var(--border)); border-radius: 10px; background: hsl(var(--background)); font-size: .84rem; }
.publish-summary span { color: hsl(var(--muted-foreground)); }

/* X Ads results on the definitive video page */
.ad-stats { margin: 8px 0 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--muted); }
.ad-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 0 0 8px; }
.ad-stats-grid div { min-width: 0; }
.ad-stats-grid dt { font-size: 12px; color: var(--muted-foreground); }
.ad-stats-grid dd { margin: 2px 0 0; font-size: 18px; font-weight: 700; color: var(--foreground); }
.ad-stats-days { margin: 4px 0 8px; }
.ad-stats-days table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ad-stats-days th, .ad-stats-days td { padding: 4px 6px; border-bottom: 1px solid var(--border); text-align: right; }
.ad-stats-days th:first-child, .ad-stats-days td:first-child { text-align: left; }
.ad-stats-refresh { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ad-stats-refresh small { color: var(--muted-foreground); }
.ad-group-stats { color: var(--foreground); }

/* Credit usage (client) and costs (platform) */
.usage-page .page-heading { align-items: flex-end; }
.month-nav { display: flex; flex: 0 0 auto; flex-wrap: nowrap; align-items: center; gap: 10px; }
.usage-page .how-to { margin: 0; }
.month-nav strong { min-width: 130px; text-align: center; white-space: nowrap; }
.month-nav strong::first-letter { text-transform: uppercase; }
.month-nav .button { min-width: 40px; justify-content: center; }
.button.is-disabled { opacity: .35; pointer-events: none; }
.usage-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.usage-metrics .metric-card { min-height: 0; }
.usage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; margin-bottom: 20px; }
.usage-grid > .panel { margin: 0 !important; }
.usage-panel { display: grid; align-content: start; gap: 12px; padding: 20px; margin-bottom: 20px; }
.usage-panel h2 { margin: 0; font-size: 1rem; }
.usage-panel .stage-hint { margin: 0; }
.usage-bars, .usage-pieces { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.usage-bars li { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(60px, 1fr) auto; align-items: center; gap: 12px; font-size: .86rem; }
.usage-bar-label { display: grid; min-width: 0; }
.usage-bar-label small, .usage-pieces small { color: hsl(var(--muted-foreground)); font-size: .74rem; }
.usage-bar { height: 8px; border-radius: 99px; background: hsl(var(--muted)); overflow: hidden; }
.usage-bar > span { display: block; height: 100%; border-radius: inherit; background: hsl(var(--primary)); }
.usage-pieces li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding-bottom: 10px; border-bottom: 1px solid hsl(var(--border)); font-size: .86rem; }
.usage-pieces li:last-child { border-bottom: 0; padding-bottom: 0; }
.usage-pieces a { overflow: hidden; color: hsl(var(--foreground)); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.usage-pieces a, .usage-pieces small { grid-column: 1; }
.usage-pieces strong { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.usage-table th.num, .usage-table td.num { text-align: right; white-space: nowrap; }
.usage-table td { vertical-align: top; }
.usage-table small.cell-meta { display: block; }
.usage-grant td { background: hsl(var(--success-soft) / .35); }
.usage-plus { color: hsl(var(--success)); font-weight: 700; }
.usage-facts { display: grid; gap: 8px; margin: 0; }
.usage-facts div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid hsl(var(--border)); font-size: .86rem; }
.usage-facts dt { color: hsl(var(--muted-foreground)); }
.usage-facts dd { margin: 0; font-weight: 700; text-align: right; }
.costs-form { display: grid; gap: 14px; }
.costs-form fieldset { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 0; padding: 12px 0 0; border: 0; border-top: 1px solid hsl(var(--border)); }
.costs-form legend { padding: 0 10px 0 0; font-size: .84rem; font-weight: 750; }
.costs-form .plan-fields { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.plan-field { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 8px; }
.costs-form label { display: grid; gap: 4px; color: hsl(var(--muted-foreground)); font-size: .8rem; }
@media (max-width: 760px) { .usage-page .page-heading { align-items: flex-start; } .usage-bars li { grid-template-columns: minmax(0, 1fr) auto; } .usage-bar { grid-column: 1 / -1; grid-row: 2; } }

/* Visual editor of a carousel slide (views/art-editor.ejs). */
.art-editor { display: grid; gap: 16px; }
.art-editor-bar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.art-editor-bar h1 { margin: 2px 0 0; font-size: 1.3rem; }
.art-editor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.art-editor-body { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 18px; align-items: start; }
.art-editor-canvas { position: relative; max-width: 100%; overflow: hidden; border-radius: 10px; box-shadow: 0 0 0 1px hsl(var(--border)), 0 18px 40px hsl(var(--shadow) / .12); background: hsl(var(--muted)); touch-action: none; user-select: none; }
.art-editor-stage { position: absolute; top: 0; left: 0; transform-origin: 0 0; overflow: hidden; cursor: default; }
.art-layer { position: absolute; display: block; max-width: none; pointer-events: none; }
.art-layer-photo { overflow: hidden; }
.art-layer-photo img { position: absolute; max-width: none; pointer-events: none; }
.art-layer.overflow { outline: 4px solid hsl(var(--danger)); outline-offset: 2px; }
.art-frame { position: absolute; z-index: 900; border: var(--line, 2px) solid hsl(var(--primary)); pointer-events: none; box-sizing: border-box; }
.art-frame.framing { border-style: dashed; border-color: hsl(var(--secondary)); }
.art-handle { position: absolute; width: var(--handle, 14px); height: var(--handle, 14px); margin: calc(var(--handle, 14px) / -2); background: hsl(0 0% 100%); border: var(--line, 2px) solid hsl(var(--primary)); border-radius: 3px; pointer-events: auto; box-sizing: border-box; }
.art-handle-nw { left: 0; top: 0; cursor: nwse-resize; } .art-handle-se { left: 100%; top: 100%; cursor: nwse-resize; }
.art-handle-ne { left: 100%; top: 0; cursor: nesw-resize; } .art-handle-sw { left: 0; top: 100%; cursor: nesw-resize; }
.art-handle-n { left: 50%; top: 0; cursor: ns-resize; } .art-handle-s { left: 50%; top: 100%; cursor: ns-resize; }
.art-handle-e { left: 100%; top: 50%; cursor: ew-resize; } .art-handle-w { left: 0; top: 50%; cursor: ew-resize; }
.art-frame:not(.text) .art-handle-n, .art-frame:not(.text) .art-handle-s, .art-frame:not(.text) .art-handle-e, .art-frame:not(.text) .art-handle-w { display: none; }
.art-frame.framing .art-handle { display: none; }
.art-guide { position: absolute; z-index: 950; pointer-events: none; background: hsl(330 90% 55%); }
.art-guide-x { top: 0; bottom: 0; width: 2px; } .art-guide-y { left: 0; right: 0; height: 2px; }
.art-safe { position: absolute; left: 0; right: 0; z-index: 800; pointer-events: none; box-shadow: 0 0 0 4000px hsl(0 0% 0% / .22); outline: 3px dashed hsl(0 0% 100% / .8); }
.art-editor-side { display: grid; gap: 12px; padding: 14px; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius-sm); }
.art-editor-layers { display: grid; gap: 4px; }
.art-editor-layers button { padding: 7px 9px; color: hsl(var(--foreground)); background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: 7px; font: inherit; font-size: .66rem; text-align: left; cursor: pointer; }
.art-editor-layers button.active { border-color: hsl(var(--primary)); background: hsl(var(--primary-soft)); color: hsl(var(--primary)); font-weight: 700; }
.art-editor-selected { margin: 0; font-size: .64rem; color: hsl(var(--muted-foreground)); }
.art-editor-warning { margin: 0; padding: 8px 10px; font-size: .64rem; color: hsl(var(--danger)); background: hsl(var(--danger-soft)); border-radius: 7px; }
.art-editor-help summary { cursor: pointer; font-size: .64rem; font-weight: 700; color: hsl(var(--primary)); }
.art-editor-help ul { margin: 8px 0 0; padding-left: 16px; display: grid; gap: 6px; font-size: .62rem; color: hsl(var(--muted-foreground)); }
.rendition-tile-actions { display: inline-flex; gap: 10px; }
@media (max-width: 900px) { .art-editor-body { grid-template-columns: 1fr; } }
.art-text-controls { display: grid; gap: 10px; padding: 10px; border: 1px solid hsl(var(--border)); border-radius: 8px; background: hsl(var(--background)); }
.art-control { display: grid; gap: 6px; font-size: .62rem; font-weight: 700; }
.art-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.art-swatch { width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 2px solid hsl(var(--card)); background: var(--swatch); box-shadow: 0 0 0 1px hsl(var(--border)); cursor: pointer; }
.art-swatch.active { box-shadow: 0 0 0 2px hsl(var(--primary)); }
.art-size-row { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.art-size-row input[type="range"] { flex: 1; min-width: 0; padding: 0; }
.art-size-row input[type="number"] { width: 64px; padding: 5px 6px; }
.art-align { display: flex; gap: 4px; }
.art-align button { flex: 1; padding: 6px 4px; color: hsl(var(--foreground)); background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: 6px; font: inherit; font-size: .6rem; cursor: pointer; }
.art-align button.active { border-color: hsl(var(--primary)); color: hsl(var(--primary)); background: hsl(var(--primary-soft)); font-weight: 700; }
.link-button.is-loading { display: inline-flex; align-items: center; text-decoration: none; }
.link-button.is-loading::before { width: 11px; height: 11px; }
.page-loader { position: fixed; top: 14px; left: 50%; z-index: 5000; display: flex; align-items: center; gap: 10px; padding: 10px 16px; transform: translateX(-50%); color: hsl(0 0% 100%); background: hsl(var(--primary)); border-radius: 999px; box-shadow: 0 12px 30px hsl(var(--shadow) / .25); font-size: .72rem; font-weight: 700; }
.page-loader::before { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: button-spin .65s linear infinite; }
.page-loader[hidden] { display: none; }
