/* Slides-FV — mundo "Estudio en vivo": cáscara blanca sobre durazno, tarjetas suaves, coral */

@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/outfit-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/outfit-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Tinta y neutros (fríos, tintados de navy) */
  --ink: #1d2340;
  --ink-2: #2b3463;
  --n-700: #484e66;
  --n-600: #646a80;   /* texto secundario: 5.4:1 sobre blanco */
  --n-400: #a3a7b6;
  --n-300: #cfd1da;
  --n-200: #e8e3e1;
  --n-100: #f6f2f1;   /* rellenos de campos y superficies hundidas */
  --n-50: #fbf8f7;    /* la cáscara */
  --paper: #ffffff;

  /* Ambiente */
  --peach-1: #f9b0a5;
  --peach-2: #f9c5b7;
  --peach-3: #f6b3ac;

  /* Señales */
  --coral: #f2683c;        /* progreso, etapa activa, selección, foco */
  --coral-text: #b8461f;   /* coral para texto sobre claro (5.3:1) */
  --coral-wash: #fff1ec;
  --orange-1: #f9874a;
  --orange-2: #ffb15c;
  --mint: #22b58c;         /* hecho */
  --mint-text: #0e7a5c;
  --mint-wash: #e3f6ef;
  --pink: #e8336d;         /* fallo, destructivo */
  --pink-text: #c8224f;
  --pink-wash: #fdebf1;
  --sky: #39aef0;          /* resaltado */
  --sky-text: #0b6fa4;
  --sky-wash: #e6f5fe;

  /* Profundidad: sombras suaves tintadas de navy, siempre con desplazamiento */
  --shadow-sm: 0 1px 2px rgba(29, 35, 64, 0.05), 0 4px 12px rgba(29, 35, 64, 0.05);
  --shadow: 0 2px 4px rgba(29, 35, 64, 0.04), 0 12px 32px rgba(29, 35, 64, 0.07);
  --shadow-lg: 0 8px 24px rgba(168, 82, 52, 0.10), 0 40px 80px rgba(168, 82, 52, 0.14);

  --r-shell: 36px;
  --r-card: 22px;
  --r-inner: 16px;
  --r-field: 14px;

  /* Escala tipográfica (≈1.2) */
  --t-xs: 0.8125rem;
  --t-sm: 0.875rem;
  --t-md: 1rem;
  --t-lg: 1.1875rem;
  --t-xl: 1.375rem;
  --t-2xl: 1.625rem;
  --t-3xl: 1.875rem;

  /* Espaciado */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;

  --pad-shell: 32px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  padding: var(--s-4) var(--s-6) var(--s-7);
  font-family: "Outfit", system-ui, sans-serif;
  font-size: var(--t-md);
  line-height: 1.5;
  color: var(--ink);
  background:
    radial-gradient(120% 80% at 0% 0%, var(--peach-1) 0%, transparent 60%),
    radial-gradient(100% 80% at 100% 100%, var(--peach-3) 0%, transparent 55%),
    var(--peach-2);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  caret-color: var(--coral);
  scrollbar-color: var(--n-400) transparent;
}
::selection { background: #ffd5c6; color: var(--ink); }
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1.5px; text-decoration-color: rgba(29, 35, 64, 0.35); }
a:hover { text-decoration-color: currentColor; }
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }

.icon { width: 1.2em; height: 1.2em; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

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

.skip-link {
  position: absolute; left: var(--s-4); top: -100px; z-index: 10;
  background: var(--ink); color: var(--paper); padding: var(--s-2) var(--s-4); font-weight: 600; border-radius: 999px;
}
.skip-link:focus { top: var(--s-4); }

/* ---------- Marca y cáscara ---------- */

.site-mark {
  display: inline-flex; align-items: center; gap: var(--s-2);
  margin: 0 0 var(--s-3) var(--s-2);
  font-weight: 600; font-size: var(--t-sm); letter-spacing: 0.01em; text-decoration: none; color: var(--ink);
}
.site-dot { width: 14px; height: 14px; border-radius: 5px; background: linear-gradient(145deg, var(--orange-2), var(--coral)); }

.shell {
  max-width: 1560px; margin: 0 auto;
  background: var(--n-50);
  border-radius: var(--r-shell);
  box-shadow: var(--shadow-lg);
  padding: var(--pad-shell);
}

.topbar {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center; gap: var(--s-4) var(--s-5);
  margin-bottom: var(--s-6);
}
.identity { display: flex; align-items: center; gap: var(--s-4); min-width: 0; }
.identity-text { min-width: 0; }
.avatar {
  width: 64px; height: 64px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--orange-2), var(--coral));
  color: var(--paper); font-weight: 700; font-size: 1.6rem;
  box-shadow: 0 0 0 4px var(--paper), var(--shadow);
}
.avatar.has-logo { background: var(--paper) center / 70% no-repeat; }
.avatar.is-app { background: var(--ink); color: var(--paper); font-size: 1.4rem; }
.avatar.is-app .icon { width: 28px; height: 28px; }
.page-title {
  font-weight: 600; font-size: var(--t-3xl); line-height: 1.15; letter-spacing: -0.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.page-title.is-placeholder { color: var(--n-600); }
.page-meta {
  display: flex; flex-wrap: wrap; gap: 2px var(--s-3);
  color: var(--n-600); font-size: var(--t-md); margin-top: 2px;
}
.page-meta span + span::before { content: "·"; margin-right: var(--s-3); color: var(--n-400); }
.page-meta strong { color: var(--ink); font-weight: 600; }

/* Etapas: la lista de pasos de la clase, dentro de una píldora */
.topbar-stages { justify-self: center; }
.topbar-stages:empty { display: none; }
.stages-pill {
  display: grid; gap: 6px; padding: 6px 6px 10px;
  background: var(--paper); border-radius: 28px; box-shadow: var(--shadow-sm);
}
.bands { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.stages-bar { display: block; height: 6px; margin-inline: 14px; border-radius: 999px; background: var(--n-100); overflow: hidden; }
.stages-bar > span {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--orange-1), var(--coral));
  transition: width 0.6s var(--ease);
}
.stages-bar.is-failed > span { background: var(--pink); }
.band {
  display: flex; align-items: center; gap: var(--s-2);
  padding: 6px 16px 6px 6px; border-radius: 999px;
  font-weight: 500; font-size: var(--t-sm); color: var(--n-600); white-space: nowrap;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}
.band-mark {
  width: 28px; height: 28px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  border: 1.5px solid var(--n-300); color: var(--n-600);
  font-size: var(--t-xs); font-weight: 600;
}
.band-mark .icon { width: 15px; height: 15px; stroke-width: 2.6; }
.band.is-done { color: var(--ink); }
.band.is-done .band-mark { border-color: var(--mint); color: var(--mint-text); background: var(--mint-wash); }
.band.is-turn { background: var(--coral-wash); color: var(--ink); font-weight: 600; }
.band.is-turn .band-mark { border: 0; background: var(--coral); color: var(--paper); }
.band.is-failed { background: var(--pink-wash); color: var(--pink-text); font-weight: 600; }
.band.is-failed .band-mark { border: 0; background: var(--pink); color: var(--paper); }
.band.is-working { background: var(--coral-wash); color: var(--ink); font-weight: 600; }
.band.is-working .band-mark {
  position: relative; border: 0; color: var(--coral-text);
}
.band.is-working .band-mark::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 2.5px dashed var(--coral);
  animation: spin 3.5s linear infinite;
}

.shell-nav { display: flex; align-items: center; justify-content: flex-end; gap: var(--s-3); }
.round-btn {
  position: relative; width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; flex: none;
  background: var(--paper); box-shadow: var(--shadow-sm); color: var(--ink); text-decoration: none;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.round-btn .icon { width: 22px; height: 22px; }
.round-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.round-btn[aria-current="page"] { background: var(--ink); color: var(--paper); }
.count {
  position: absolute; top: -2px; right: -4px;
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
  background: var(--coral); color: var(--ink); font-size: var(--t-xs); font-weight: 700; border-radius: 11px;
  box-shadow: 0 0 0 3px var(--n-50);
}
.new-btn {
  display: inline-flex; align-items: center; gap: var(--s-2); min-height: 52px; padding: 0 22px 0 18px;
  border-radius: 999px; background: var(--coral); color: var(--ink);
  font-weight: 600; text-decoration: none; box-shadow: 0 6px 16px rgba(242, 104, 60, 0.28);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background-color 0.2s var(--ease);
}
.new-btn:hover { transform: translateY(-1px); background: #f47a52; box-shadow: 0 10px 22px rgba(242, 104, 60, 0.34); }
.identity { grid-column: 1; }
.shell-nav { grid-column: -2 / -1; grid-row: 1; }

/* Usuario */
.user-menu { position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; overflow: hidden; font-weight: 600; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-btn img { width: 100%; height: 100%; object-fit: cover; }
.user-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; min-width: 240px;
  display: grid; gap: 4px; padding: var(--s-4);
  background: var(--paper); border-radius: var(--r-inner); box-shadow: var(--shadow);
}
.user-pop b { font-weight: 600; }
.user-pop .btn { margin-top: var(--s-2); }

/* Login */
.login-page { display: grid; place-items: center; padding: var(--s-5) var(--s-4); }
.login-card {
  width: min(100%, 440px); display: grid; justify-items: center; gap: var(--s-3); text-align: center;
  background: var(--n-50); border-radius: var(--r-shell); box-shadow: var(--shadow-lg); padding: var(--s-7) var(--s-6);
}
.login-mark { width: 72px; height: 72px; font-size: 1.9rem; margin-bottom: var(--s-2); }
.login-title { font-weight: 600; font-size: var(--t-3xl); letter-spacing: -0.01em; }
.login-lead { color: var(--n-600); max-width: 32ch; }
.login-card .alert { width: 100%; text-align: left; }
.google-btn { width: 100%; margin-top: var(--s-3); }
.g-logo { width: 20px; height: 20px; background: var(--paper); border-radius: 50%; padding: 2px; box-sizing: content-box; }
.login-note { font-size: var(--t-sm); color: var(--n-600); }

/* ---------- Superficie de trabajo ---------- */

.work {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: var(--s-5);
  align-items: start;
}
.work.single { grid-template-columns: minmax(0, 1fr); }
.aside { display: grid; gap: var(--s-4); }
.task { display: grid; gap: var(--s-5); min-width: 0; }

/* Tarjetas */
.module, .module-body {
  min-width: 0;
  background: var(--paper); border-radius: var(--r-card); box-shadow: var(--shadow-sm);
  padding: var(--s-5);
}
.module > .module-body { background: none; box-shadow: none; padding: 0; border-radius: 0; }
.tab { display: block; font-weight: 600; font-size: var(--t-lg); line-height: 1.3; margin-bottom: var(--s-3); }
.module-body > * + * { margin-top: var(--s-3); }
.module-body > dl.facts { margin-top: var(--s-5); }
.prose { max-width: 66ch; font-size: var(--t-md); line-height: 1.6; color: var(--n-700); }
.muted { color: var(--n-600); }
.small { font-size: var(--t-sm); }

/* Tarjeta naranja (la "clase" destacada de la referencia) */
.module.promo {
  background: linear-gradient(150deg, var(--orange-1) 0%, var(--orange-2) 100%);
  box-shadow: 0 10px 28px rgba(242, 104, 60, 0.25);
}
.module.promo .tab { font-size: var(--t-xl); }
.module.promo .muted { color: #4a2a1c; }

.task-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--s-3) var(--s-5); }
.task-title { font-weight: 600; font-size: var(--t-2xl); line-height: 1.2; letter-spacing: -0.01em; text-wrap: balance; }
.task-lead { color: var(--n-600); max-width: 66ch; margin-top: var(--s-1); }
.task-lead a { color: var(--coral-text); font-weight: 600; }

dl.facts { margin: 0; display: grid; gap: var(--s-3); }
dl.facts dt { font-size: var(--t-sm); font-weight: 500; color: var(--n-600); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- Botones ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 48px; padding: 0 22px;
  font-weight: 600; font-size: var(--t-md);
  border: 0; border-radius: 999px;
  background: var(--paper); color: var(--ink); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--n-200);
  text-decoration: none; cursor: pointer;
  transition: background-color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease), color 0.2s var(--ease);
}
.btn:hover { background: var(--n-100); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--paper); box-shadow: 0 8px 20px rgba(29, 35, 64, 0.22); }
.btn-primary .icon { color: #ff9b76; }
.btn-primary:hover { background: var(--ink-2); }
.btn-small { min-height: 40px; padding: 0 16px; font-size: var(--t-sm); }
.btn[disabled], .btn[aria-disabled="true"] { cursor: not-allowed; background: var(--n-200); color: var(--n-600); box-shadow: none; transform: none; }
.btn[disabled] .icon { color: inherit; }
.btn.is-busy { cursor: progress; }
.btn.is-busy .icon { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.link-btn {
  display: inline-flex; align-items: center; gap: var(--s-2);
  background: none; border: 0; padding: 0; min-height: 40px;
  font-weight: 600; color: var(--coral-text); text-decoration: none; cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }

.actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3) var(--s-5); }
.actions-end { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); margin-left: auto; }

/* ---------- Formularios ---------- */

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-5); }
.field { display: grid; gap: 6px; align-content: start; }
.field.span-2 { grid-column: 1 / -1; }
.label { font-weight: 600; font-size: var(--t-md); }
.label .opt { font-weight: 400; color: var(--n-600); }
.hint { font-size: var(--t-sm); color: var(--n-600); }
.input, .textarea {
  width: 100%; min-height: 52px; padding: var(--s-3) var(--s-4);
  background: var(--n-100); border: 1.5px solid transparent; border-radius: var(--r-field);
  font-size: var(--t-md);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background-color 0.2s var(--ease);
}
.textarea { min-height: 132px; resize: vertical; line-height: 1.55; }
.textarea.short { min-height: 84px; }
.input::placeholder, .textarea::placeholder { color: var(--n-600); }
.input:hover, .textarea:hover { border-color: var(--n-200); }
.input:focus-visible, .textarea:focus-visible { outline: 0; background: var(--paper); border-color: var(--coral); box-shadow: 0 0 0 4px rgba(242, 104, 60, 0.18); }
.input:user-invalid, .textarea:user-invalid { border-color: var(--pink); background: var(--pink-wash); }
.was-submitted .input:invalid, .was-submitted .textarea:invalid { border-color: var(--pink); background: var(--pink-wash); }
.was-submitted .input:invalid ~ .field-error, .was-submitted .textarea:invalid ~ .field-error,
.was-submitted .logo-row:has(.input:invalid) ~ .field-error { display: flex; gap: 6px; align-items: center; }
.logo-row:has(.input:user-invalid) ~ .field-error { display: flex; gap: 6px; align-items: center; }
.field-error { display: none; color: var(--pink-text); font-size: var(--t-sm); font-weight: 500; }
.input:user-invalid ~ .field-error, .textarea:user-invalid ~ .field-error { display: flex; gap: 6px; align-items: center; }
.counter { justify-self: end; font-size: var(--t-xs); color: var(--n-600); }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }

/* Formato del deck */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-3); margin-top: 6px; }
.tile { position: relative; }
.tile input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.tile span {
  display: grid; gap: 2px; padding: var(--s-3) var(--s-4); min-height: 68px; align-content: center;
  background: var(--n-100); border: 2px solid transparent; border-radius: var(--r-inner);
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.tile b { font-weight: 600; font-size: var(--t-lg); line-height: 1.1; }
.tile small { font-size: var(--t-sm); color: var(--n-600); }
.tile input:hover + span { background: var(--n-200); }
.tile input:checked + span { background: var(--paper); border-color: var(--coral); box-shadow: var(--shadow-sm); }
.tile input:checked + span small { color: var(--coral-text); }
.tile input:focus-visible + span { outline: 3px solid var(--coral); outline-offset: 2px; }

.check { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-3) 0; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--coral); flex: none; }
.check input:disabled + span { color: var(--n-600); }
.check b { display: block; font-weight: 600; }

.logo-row { display: flex; gap: var(--s-3); align-items: stretch; }
.logo-row .input { flex: 1; }
.logo-preview {
  width: 52px; flex: none; border-radius: var(--r-field); background: var(--paper) center / 75% no-repeat;
  box-shadow: inset 0 0 0 1px var(--n-200);
}
.logo-preview[hidden] { display: none; }

.alert {
  display: flex; gap: var(--s-3); align-items: flex-start;
  background: var(--pink-wash); color: var(--ink); border-radius: var(--r-inner);
  padding: var(--s-4);
}
.alert .icon { color: var(--pink-text); margin-top: 2px; }
.alert[hidden] { display: none; }
.notice { background: var(--sky-wash); }
.notice .icon { color: var(--sky-text); }

/* ---------- Direcciones ---------- */

.dirs { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); }
.dir { position: relative; display: flex; }
.dir input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dir label {
  flex: 1; display: flex; flex-direction: column; gap: var(--s-3);
  padding: var(--s-5); background: var(--paper); border: 2px solid transparent; border-radius: var(--r-card);
  box-shadow: var(--shadow-sm); cursor: pointer;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.dir label:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.dir input:checked + label { border-color: var(--coral); background: var(--coral-wash); box-shadow: var(--shadow); }
.dir input:focus-visible + label { outline: 3px solid var(--coral); outline-offset: 3px; }
.dir-mark {
  flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--n-300);
  display: grid; place-items: center; background: var(--paper);
}
.dir input:checked + label .dir-mark { background: var(--coral); border-color: var(--coral); }
.dir input:checked + label .dir-mark::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--paper); }
.dir-top { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-3); }
.dir .tone { align-self: flex-start; }
.dir-title { font-weight: 600; font-size: var(--t-xl); line-height: 1.2; text-wrap: balance; }
.tone {
  font-size: var(--t-xs); font-weight: 600;
  background: var(--sky-wash); color: var(--sky-text); padding: 4px 12px; border-radius: 999px;
}
.dir-tagline { font-weight: 600; font-size: var(--t-lg); line-height: 1.35; }
.dir-angle { color: var(--n-700); font-size: var(--t-sm); line-height: 1.55; }
.dir-hook {
  margin-top: auto; padding: var(--s-3) var(--s-4); border-radius: var(--r-inner);
  background: var(--n-100); font-size: var(--t-sm); line-height: 1.5;
}
.dir input:checked + label .dir-hook { background: var(--paper); }
.dir-hook b { display: block; font-size: var(--t-xs); font-weight: 600; color: var(--n-600); margin-bottom: 2px; }

.own-dir { display: grid; gap: var(--s-3); }
.own-toggle { display: flex; align-items: center; gap: var(--s-3); }
.own-toggle input { width: 20px; height: 20px; accent-color: var(--coral); margin: 0; }

/* ---------- Progreso ---------- */

.progress-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; }
.now { font-weight: 600; font-size: var(--t-xl); line-height: 1.3; max-width: 50ch; }
.now-meta { display: flex; align-items: center; gap: var(--s-2); margin-top: var(--s-2); font-size: var(--t-sm); color: var(--n-600); }
.now-meta.is-slow { color: var(--coral-text); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--coral); flex: none; animation: pulse 1.4s ease-in-out infinite; }
.meter { height: 10px; background: var(--n-100); border-radius: 999px; margin-top: var(--s-4); overflow: hidden; }
.meter > span {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--orange-1), var(--coral));
  transition: width 0.6s var(--ease);
}
.log { list-style: none; margin: var(--s-3) 0 0; padding: 0; display: grid; }
.log li {
  display: grid; grid-template-columns: 72px 1fr; gap: var(--s-3);
  padding: var(--s-2) 0; border-top: 1px solid var(--n-100); font-size: var(--t-sm); color: var(--n-700);
}
.log time { color: var(--n-600); }
.log li:last-child { font-weight: 600; color: var(--ink); }
.log-scroll { max-height: 320px; overflow: auto; }
details.disclose summary {
  cursor: pointer; font-weight: 600; min-height: 40px; display: flex; align-items: center; gap: var(--s-2);
  list-style: none; color: var(--n-700);
}
details.disclose summary:hover { color: var(--ink); }
details.disclose summary::-webkit-details-marker { display: none; }
details.disclose summary .icon { transition: transform 0.2s var(--ease); }
details.disclose[open] summary .icon { transform: rotate(90deg); }

/* ---------- Imágenes ---------- */

.frames { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--s-4); }
.frame { margin: 0; display: grid; gap: var(--s-3); align-content: start; min-width: 0; }
.frame.wide { grid-column: span 3; }
.frame.tall { grid-column: span 2; }
.frame-media { position: relative; border-radius: var(--r-card); background: var(--n-100); overflow: hidden; box-shadow: var(--shadow-sm); }
.frame.wide .frame-media { aspect-ratio: 16 / 9; }
.frame.tall .frame-media { aspect-ratio: 3 / 4; }
.frame-media img { width: 100%; height: 100%; object-fit: cover; }
.frame-media.is-empty::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.7) 50%, transparent 70%) var(--n-100);
  background-size: 300% 100%;
  animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }
.frame-media.is-busy img { filter: saturate(0.2) brightness(1.08); }
.frame-media .busy-tag {
  position: absolute; left: var(--s-3); bottom: var(--s-3);
  background: var(--paper); color: var(--ink); font-size: var(--t-xs); font-weight: 600;
  padding: 6px 12px; border-radius: 999px; box-shadow: var(--shadow-sm);
}
.frame figcaption { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); padding-inline: var(--s-1); }
.frame-name { white-space: nowrap; font-weight: 600; font-size: var(--t-lg); }
.frame-text { font-size: var(--t-sm); color: var(--n-700); line-height: 1.5; }

.regen-panel {
  display: grid; gap: var(--s-2); padding: var(--s-4);
  background: var(--paper); border-radius: var(--r-card); box-shadow: var(--shadow-sm);
}
.regen-panel[hidden] { display: none; }
.regen-panel .textarea { min-height: 150px; font-size: var(--t-sm); line-height: 1.55; }
.regen-panel .textarea[aria-busy="true"] { color: var(--n-600); }
.regen-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-4); margin-top: var(--s-1); }
.regen-actions .actions-end { gap: var(--s-4); }
.frame.is-editing .frame-media { box-shadow: 0 0 0 3px var(--coral), var(--shadow); }
/* Al editar, la imagen ocupa la fila: foto a la izquierda, prompt a la derecha */
.frames .frame.is-editing {
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: var(--s-5);
}
.frames .frame.tall.is-editing { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); }
.frame.is-editing .frame-media, .frame.is-editing figcaption { grid-column: 1; }
.frame.is-editing .regen-panel { grid-column: 2; grid-row: 1 / span 2; align-self: start; }
.frame.is-editing .regen-panel .textarea { min-height: 220px; }
@media (max-width: 640px) {
  .frames .frame.is-editing, .frames .frame.tall.is-editing { grid-template-columns: minmax(0, 1fr); }
  .frame.is-editing .regen-panel { grid-column: 1; grid-row: auto; }
  .frame.tall.is-editing .frame-media { max-width: 60%; }
}

/* ---------- Entrega ---------- */

.delivery {
  background: var(--paper); border-radius: var(--r-card); box-shadow: var(--shadow-sm);
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4) var(--s-5); padding: var(--s-5);
}
.delivery-file { display: grid; gap: 2px; min-width: 0; }
.delivery-file b { font-size: var(--t-lg); font-weight: 600; overflow-wrap: anywhere; }
.delivery .actions-end { margin-left: auto; }

.strategy-read { display: grid; gap: var(--s-4); }
.strategy-read h3 { font-size: var(--t-sm); font-weight: 500; color: var(--n-600); }
.strategy-read p { margin-top: 2px; }
.creators { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-4); }
.creator + .creator { border-top: 1px solid var(--n-100); padding-top: var(--s-4); }
.creator b { display: block; font-weight: 600; }

/* ---------- Revisión y edición de textos ---------- */

.review-group { display: grid; gap: var(--s-4); }
.review-group + .review-group { margin-top: var(--s-6); }
.review-group legend { margin-bottom: var(--s-1); }
.review-group h3 { font-weight: 600; font-size: var(--t-xl); }
.review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4) var(--s-5); }
.card-group { background: var(--paper); border-radius: var(--r-card); box-shadow: var(--shadow-sm); padding: var(--s-5); }
.review-grid .field.wide { grid-column: 1 / -1; }
.words { justify-self: end; font-size: var(--t-xs); color: var(--n-600); }
.words.is-over { color: var(--pink-text); font-weight: 600; }
.sticky-actions {
  position: sticky; bottom: var(--s-3); z-index: 2; margin-top: var(--s-5);
  padding: var(--s-3) var(--s-3) var(--s-3) var(--s-5);
  background: var(--paper); border-radius: 999px; box-shadow: var(--shadow);
}
.field-edited .textarea, .field-edited .input { background: var(--coral-wash); }

.ideas-edit { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--s-4); }
.idea-edit {
  display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-5);
  background: var(--paper); border: 2px solid transparent; border-radius: var(--r-card); box-shadow: var(--shadow-sm);
  transition: border-color 0.2s var(--ease);
}
.idea-edit.is-new { border-color: var(--coral); }
.idea-edit[aria-busy="true"] .input, .idea-edit[aria-busy="true"] .textarea { color: var(--n-600); }
.idea-edit-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.idea-num { font-weight: 600; font-size: var(--t-lg); }
.idea-flag { font-size: var(--t-xs); font-weight: 600; color: var(--coral-text); background: var(--coral-wash); padding: 3px 10px; border-radius: 999px; }
.idea-edit .textarea { min-height: 150px; }
.idea-alt { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; margin-top: auto; }
.idea-alt .input { flex: 1 1 160px; min-width: 0; }
.input-small { min-height: 40px; padding-block: 0; font-size: var(--t-sm); border-radius: 999px; }
.idea-edit .hint:empty { display: none; }
.idea-edit [hidden] { display: none; }
#texts-form .sticky-actions { flex-wrap: wrap; }
#texts-form .sticky-actions .check { padding: 0; }
#texts-form .sticky-actions .actions-end { gap: var(--s-4); }
.more-texts { margin-top: var(--s-5); }
.more-texts .disclose-body { border: 0; padding: var(--s-4) 0 0; margin: 0; min-width: 0; }
fieldset[disabled] { opacity: 0.6; }

/* ---------- Creadores ---------- */

.creators-edit { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--s-4); }
.creator-card {
  display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-5);
  background: var(--paper); border-radius: var(--r-card); box-shadow: var(--shadow-sm);
  transition: opacity 0.2s var(--ease), background-color 0.2s var(--ease);
}
.creator-card .textarea { min-height: 120px; font-size: var(--t-sm); }
.creator-head { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-2); }
.creator-id { display: grid; min-width: 0; flex: 1; }
.creator-id b { font-weight: 600; overflow-wrap: anywhere; }
.creator-dot {
  width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center;
  font-weight: 600; font-size: var(--t-lg);
}
.creator-dot.is-instagram { background: var(--coral-wash); color: var(--coral-text); }
.creator-dot.is-tiktok { background: var(--sky-wash); color: var(--sky-text); }
.creator-dot.is-add { background: var(--n-100); color: var(--ink); }
.remove-toggle { position: relative; flex: none; }
.remove-toggle input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.remove-toggle > span {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px 0 10px;
  border-radius: 999px; font-size: var(--t-sm); font-weight: 600; color: var(--n-700);
  box-shadow: inset 0 0 0 1px var(--n-200); transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.remove-toggle .icon { width: 16px; height: 16px; }
.remove-toggle input:hover + span { background: var(--n-100); }
.remove-toggle input:focus-visible + span { outline: 3px solid var(--coral); outline-offset: 2px; }
.remove-toggle .when-on { display: none; }
.remove-toggle input:checked + span { background: var(--pink-wash); color: var(--pink-text); box-shadow: none; }
.remove-toggle input:checked + span .when-off { display: none; }
.remove-toggle input:checked + span .when-on { display: inline; }
.creator-card.is-removed { background: var(--n-50); }
.creator-card.is-removed .creator-id, .creator-card.is-removed .creator-dot,
.creator-card.is-removed .label, .creator-card.is-removed .textarea, .creator-card.is-removed .hint { opacity: 0.45; }
.creator-card.is-removed .creator-id b { text-decoration: line-through; }
.creator-add { background: var(--n-50); box-shadow: inset 0 0 0 1.5px var(--n-200); }
.creator-add .input { background: var(--paper); }
.add-grid { display: grid; gap: var(--s-3); }
.creator-card.field-edited .textarea { background: var(--coral-wash); }

/* ---------- Fallo ---------- */

.module.failure { background: var(--paper); box-shadow: var(--shadow-sm), inset 0 0 0 2px var(--pink-wash); }
.failure-stage { color: var(--pink-text); font-weight: 600; font-size: var(--t-sm); }
.failure-body { display: grid; gap: var(--s-4); }
.failure-title { font-weight: 600; font-size: var(--t-2xl); line-height: 1.2; }
.failure pre {
  margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--t-sm);
  background: var(--n-100); padding: var(--s-3) var(--s-4); border-radius: var(--r-field);
}

/* ---------- Historial ---------- */

.filters { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.filters a {
  display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: 0 18px;
  background: var(--paper); border-radius: 999px; box-shadow: var(--shadow-sm);
  font-weight: 600; text-decoration: none; font-size: var(--t-sm);
  transition: background-color 0.2s var(--ease);
}
.filters a:hover { background: var(--n-100); }
.filters a[aria-current="true"] { background: var(--ink); color: var(--paper); }
.filters .n { color: var(--n-600); font-weight: 500; }
.filters a[aria-current="true"] .n { color: #c8cbe0; }

.table-wrap { background: var(--paper); border-radius: var(--r-card); box-shadow: var(--shadow-sm); overflow-x: auto; padding: var(--s-2) 0; }
table.jobs { width: 100%; border-collapse: collapse; font-size: var(--t-md); }
.jobs tr.group th { padding: var(--s-5) var(--s-5) var(--s-2); font-weight: 600; font-size: var(--t-lg); color: var(--ink); }
.jobs col.c-fmt { width: 15%; } .jobs col.c-state { width: 15%; } .jobs col.c-when { width: 12%; } .jobs col.c-actions { width: 25%; }
.row-note { white-space: nowrap; }
.jobs th {
  text-align: left; font-size: var(--t-sm); font-weight: 500;
  color: var(--n-600); padding: var(--s-3) var(--s-5);
}
.jobs td { padding: var(--s-4) var(--s-5); border-top: 1px solid var(--n-100); vertical-align: middle; }
.jobs tbody tr:not(.group):hover { background: var(--n-50); }
.jobs .brand a { font-weight: 600; text-decoration: none; }
.jobs .brand a:hover { text-decoration: underline; }
.jobs .sub { display: block; color: var(--n-600); font-size: var(--t-sm); max-width: 48ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jobs .row-actions { display: flex; justify-content: flex-end; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.jobs td.when { white-space: nowrap; color: var(--n-600); }
.jobs .row-actions form { margin: 0; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-size: var(--t-sm); font-weight: 600; padding: 4px 12px 4px 10px; border-radius: 999px;
}
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.chip.turn { background: var(--coral-wash); color: var(--coral-text); }
.chip.done { background: var(--mint-wash); color: var(--mint-text); }
.chip.failed { background: var(--pink-wash); color: var(--pink-text); }
.chip.working { background: var(--sky-wash); color: var(--sky-text); }
.chip.working::before { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }

.empty {
  background: var(--paper); border-radius: var(--r-card); box-shadow: var(--shadow-sm);
  padding: var(--s-7) var(--s-5); text-align: center; display: grid; gap: var(--s-3); justify-items: center;
}
.empty h2 { font-weight: 600; font-size: var(--t-2xl); }

.steps-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-4); }
.steps-list li { display: grid; grid-template-columns: 32px 1fr; gap: var(--s-3); align-items: start; }
.steps-list .num {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--paper); color: var(--ink); font-weight: 600; font-size: var(--t-sm);
  box-shadow: 0 2px 6px rgba(168, 82, 52, 0.18);
}
.steps-list b { display: block; font-weight: 600; }

.waiting-list { list-style: none; margin: 0; padding: 0; display: grid; }
.waiting-list a {
  display: flex; justify-content: space-between; align-items: center; gap: var(--s-3);
  font-weight: 600; text-decoration: none; padding: var(--s-3) 0; border-top: 1px solid var(--n-100);
}
.waiting-list li:first-child a { border-top: 0; }
.waiting-list a:hover { color: var(--coral-text); }

/* ---------- Responsive ---------- */

@media (max-width: 1280px) {
  .topbar { grid-template-columns: minmax(0, 1fr) auto; }
  .topbar-stages { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; }
  .bands { justify-content: space-between; }
  .band { flex: 1; }
}
@media (max-width: 1180px) {
  .dirs { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 960px) {
  :root { --pad-shell: 20px; }
  body { padding: var(--s-3) var(--s-3) var(--s-6); }
  .shell { border-radius: 28px; }
  .work { grid-template-columns: minmax(0, 1fr); }
  .aside { order: 2; }
  .task { order: 1; }
  .frame.wide { grid-column: 1 / -1; }
  .frame.tall { grid-column: span 2; }
}
@media (max-width: 640px) {
  :root { --pad-shell: 16px; --r-card: 18px; }
  body { padding: var(--s-2) var(--s-2) var(--s-5); }
  .site-mark { margin-bottom: var(--s-2); }
  .shell { border-radius: 24px; }
  .topbar { gap: var(--s-3); margin-bottom: var(--s-5); }
  .avatar { width: 48px; height: 48px; font-size: 1.25rem; box-shadow: 0 0 0 3px var(--paper), var(--shadow-sm); }
  .page-title { font-size: var(--t-xl); }
  .page-meta { font-size: var(--t-sm); column-gap: var(--s-3); }
  .page-meta span + span::before { content: none; }
  .round-btn, .new-btn { width: 44px; height: 44px; min-height: 44px; padding: 0; justify-content: center; }
  .new-btn > span { display: none; }
  .hide-sm { display: none; }
  .band { padding: 4px; justify-content: center; gap: 6px; }
  .band .band-label { display: none; }
  .band.is-turn, .band.is-working, .band.is-failed { flex: 2.5; padding-right: 12px; }
  .band.is-turn .band-label, .band.is-working .band-label, .band.is-failed .band-label { display: inline; }
  .module, .module-body, .delivery { padding: var(--s-4); }
  .form-grid, .review-grid { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .frames { grid-template-columns: repeat(3, 1fr); gap: var(--s-3); }
  .frame.wide { grid-column: 1 / -1; }
  .frame.tall { grid-column: span 1; }
  .frame-name { font-size: var(--t-md); }
  .frame figcaption { padding-inline: 2px; gap: var(--s-1); }
  .frame figcaption .btn { width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 50%; flex: none; }
  .frame figcaption .btn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .task-title { font-size: var(--t-xl); }
  .btn { width: 100%; }
  .actions-end { width: 100%; }
  .actions-end form { width: 100%; }
  .sticky-actions { border-radius: var(--r-card); padding: var(--s-3) var(--s-4); }
  .sticky-actions .btn { width: 100%; flex: 1 1 100%; }
  #texts-form .sticky-actions .actions-end { width: 100%; gap: var(--s-2); }
  #texts-form .sticky-actions .check { width: 100%; }
  .jobs thead { display: none; }
  .jobs tr { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); padding: var(--s-4); border-top: 1px solid var(--n-100); }
  .jobs td { padding: 0; border: 0; }
  .jobs td.brand { flex: 1 1 100%; }
  .jobs .sub { white-space: normal; }
  .jobs td.fmt, .jobs td.when { font-size: var(--t-sm); color: var(--n-600); }
  .jobs td:last-child { flex: 1 1 100%; }
  .jobs .row-actions { justify-content: flex-start; }
  .jobs .row-actions .btn { width: auto; }
  .jobs tr.group { padding: var(--s-4) var(--s-4) 0; border-top: 0; }
  .jobs tr.group th { flex: 1 1 100%; padding: 0; }
  .jobs colgroup { display: none; }
}

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