/* ============================================================
   Contenidor Studio — design system
   Light, clean, premium SaaS. Inter. Orange signature accent.
   ============================================================ */

:root {
  --bg: #fafafa;
  --bg-soft: #ffffff;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --surface-3: #f2f2f1;
  --border: #eaeaea;
  --border-strong: #dedede;

  --text: #111111;
  --text-soft: #3f3f46;
  --muted: #6b7280;
  --faint: #a1a1aa;

  --accent: #ff6a00;
  --accent-soft: #ff8a42;
  --accent-wash: #fff1e8;
  --accent-grad: linear-gradient(135deg, #ff8a42 0%, #ff6a00 100%);

  --good: #16a34a;
  --good-bg: rgba(22, 163, 74, 0.1);
  --warn: #f59e0b;
  --warn-bg: rgba(245, 158, 11, 0.12);
  --bad: #ef4444;
  --bad-bg: rgba(239, 68, 68, 0.1);
  --info: #0284c7;
  --info-bg: rgba(2, 132, 199, 0.1);

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 999px;

  --shadow-1: 0 1px 2px rgba(20, 16, 10, 0.04), 0 8px 20px -12px rgba(20, 16, 10, 0.08);
  --shadow-2: 0 4px 10px rgba(20, 16, 10, 0.06), 0 24px 48px -16px rgba(20, 16, 10, 0.16);
  --glow: 0 0 0 1px rgba(255, 106, 26, 0.16), 0 8px 22px -6px rgba(255, 106, 26, 0.32);

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(255, 106, 26, 0.2); color: var(--text); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--r-pill);
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--faint); }

h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.85em;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
  color: #c04d0f;
}

/* ============================================================
   App shell — sidebar + main
   ============================================================ */

.app { display: flex; min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  width: 236px;
  flex: 0 0 236px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 14px;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.sidebar.hidden-auth { display: none; }

.side-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px 20px;
}

.logo-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 11px;
  background: var(--accent-grad);
  box-shadow: var(--glow);
  position: relative;
}
.logo-mark::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.95);
  clip-path: polygon(0 0, 100% 0, 100% 30%, 30% 30%, 30% 100%, 0 100%);
}

.logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.logo-text strong { font-size: 15.5px; font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
.logo-text span { font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; }

.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.tab {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
  position: relative;
  text-align: left;
}

.tab svg { width: 18px; height: 18px; flex: 0 0 auto; opacity: 0.75; }

/* "Mas" solo existe en la bottom bar mobile */
.tab-more { display: none; }

/* --- Tour guiado --- */
#tour-root { position: fixed; inset: 0; z-index: 200; }
.tour-backdrop { position: fixed; inset: 0; }
.tour-backdrop.dim { background: rgba(17, 17, 17, 0.55); animation: fadeIn 0.25s ease; }
.tour-spot {
  position: fixed;
  border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(17, 17, 17, 0.55), 0 0 0 2px var(--accent) inset;
  transition: top 0.3s var(--ease), left 0.3s var(--ease), width 0.3s var(--ease), height 0.3s var(--ease);
  pointer-events: none;
}
.tour-pop {
  position: fixed;
  z-index: 201;
  width: min(340px, calc(100vw - 28px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  padding: 18px 20px;
  animation: tourFade 0.2s ease;
}
.tour-pop.center { left: 50%; top: 50%; transform: translate(-50%, -50%); }
@keyframes tourFade { from { opacity: 0; } }
.tour-step { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 7px; }
.tour-pop h3 { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 6px; color: var(--text); }
.tour-pop p { font-size: 13.5px; line-height: 1.55; color: var(--text-soft); margin-bottom: 16px; }
.tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tour-nav { display: flex; gap: 8px; margin-left: auto; }

/* Hoja de "Mas" (bottom sheet en mobile) */
.more-sheet h3 { font-size: 17px; font-weight: 800; margin-bottom: 14px; }
.more-list { display: flex; flex-direction: column; gap: 4px; }
.more-item {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 14px 12px;
  border: 0; border-radius: var(--r-md);
  background: transparent; color: var(--text);
  font: inherit; font-weight: 650; font-size: 15px;
  cursor: pointer; text-align: left;
  transition: background 0.15s var(--ease);
}
.more-item:hover, .more-item.active { background: var(--surface-2); }
.more-item.active { color: var(--accent); }
.more-icon { display: flex; width: 24px; height: 24px; color: var(--muted); }
.more-item.active .more-icon { color: var(--accent); }
.more-icon svg { width: 24px; height: 24px; }
.more-label { flex: 1; }
.more-chevron { width: 18px; height: 18px; color: var(--faint); }

.tab:hover { background: var(--surface-3); color: var(--text-soft); }

.tab.active {
  background: var(--accent-wash);
  color: var(--text);
}
.tab.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  border-radius: var(--r-pill);
  background: var(--accent-grad);
}
.tab.active svg { color: var(--accent); opacity: 1; }

.side-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.side-foot select { width: 100%; font-weight: 600; }
.side-foot .foot-row { display: flex; gap: 8px; }
.side-foot .foot-row .btn { flex: 1; justify-content: center; }

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

#content {
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: 26px 40px 80px;
  animation: viewIn 0.35s var(--ease);
}

@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ============================================================
   Page head
   ============================================================ */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}

.page-head h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; color: var(--text); }
.page-head p { color: var(--muted); margin-top: 4px; font-size: 13.5px; }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-soft);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s var(--ease);
  box-shadow: 0 1px 2px rgba(20, 16, 10, 0.03);
}

.btn:hover { background: var(--surface-3); color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: #111111;
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 10px -4px rgba(0, 0, 0, 0.35);
}
.btn-primary:hover {
  background: #2a2a2a;
  box-shadow: 0 4px 14px -4px rgba(0, 0, 0, 0.4);
  color: #fff;
}
.btn-primary:active { background: #000; }

.btn-good { border-color: rgba(22, 163, 74, 0.28); color: var(--good); background: var(--good-bg); }
.btn-good:hover { background: rgba(22, 163, 74, 0.16); color: #0f7d38; }

.btn-danger { border-color: rgba(220, 38, 38, 0.24); color: var(--bad); background: var(--bad-bg); }
.btn-danger:hover { background: rgba(220, 38, 38, 0.15); color: #b91c1c; }

.btn-plain { background: transparent; border-color: transparent; color: var(--muted); box-shadow: none; }
.btn-plain:hover { background: var(--surface-3); color: var(--text-soft); }

.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }

/* ============================================================
   Inputs
   ============================================================ */

input, textarea, select, .select {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

input::placeholder, textarea::placeholder { color: var(--faint); }

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: rgba(255, 106, 26, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 106, 26, 0.13);
}

input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
input[type="color"] { padding: 2px; height: 38px; width: 46px; cursor: pointer; }
input[type="file"] { padding: 8px; font-size: 12.5px; color: var(--muted); }
input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-soft);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

textarea { resize: vertical; min-height: 40px; line-height: 1.55; }
textarea.tall { min-height: 180px; }

select, .select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a7f6f' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
  cursor: pointer;
}

label {
  display: block;
  margin-bottom: 7px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ============================================================
   Layout primitives
   ============================================================ */

.grid { display: grid; gap: 14px; }
.grid.metrics { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.grid.two { grid-template-columns: 1fr 1fr; align-items: start; }
.grid.three { grid-template-columns: repeat(3, 1fr); }

.section, .card, .category-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-1);
}

.section + .section, .category-card + .category-card { margin-top: 14px; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.section-head h2 { font-size: 16px; font-weight: 750; color: var(--text); }
.section-head h3 { font-size: 13px; font-weight: 700; color: var(--text-soft); }
.section-head .meta { color: var(--faint); font-size: 12px; font-weight: 600; }

.title { font-weight: 700; font-size: 14.5px; letter-spacing: -0.01em; color: var(--text); }
.subtle { color: var(--muted); font-size: 12.5px; }

.empty {
  padding: 34px 20px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  background: var(--surface-2);
}

.loading-state {
  padding: 80px 20px;
  text-align: center;
  color: var(--faint);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }

/* ============================================================
   Metrics
   ============================================================ */

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px 18px 16px;
  transition: transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s;
}
.metric-card:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow-1); }

.metric-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.metric-value {
  margin-top: 6px;
  font-size: 29px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.metric-note { margin-top: 3px; font-size: 12px; color: var(--faint); }

/* ============================================================
   Status pills
   ============================================================ */

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px 4px 9px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid transparent;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.status-pending { color: var(--warn); background: var(--warn-bg); border-color: rgba(217, 119, 6, 0.18); }
.status-generated { color: var(--info); background: var(--info-bg); border-color: rgba(2, 132, 199, 0.18); }
.status-needs_review { color: #c2410c; background: var(--accent-wash); border-color: rgba(255, 106, 26, 0.22); }
.status-approved { color: var(--good); background: var(--good-bg); border-color: rgba(22, 163, 74, 0.18); }
.status-posted { color: #7c3aed; background: rgba(124, 58, 237, 0.1); border-color: rgba(124, 58, 237, 0.2); }
.status-rejected { color: var(--bad); background: var(--bad-bg); border-color: rgba(220, 38, 38, 0.18); }
.status-skipped, .status-unknown { color: var(--muted); background: var(--surface-3); border-color: var(--border-strong); }

/* --- Analytics --- */
.an-bar-row { display: grid; grid-template-columns: 110px 1fr 34px; align-items: center; gap: 12px; padding: 7px 0; }
.an-bar-label { font-size: 12.5px; font-weight: 600; color: var(--text-soft); }
.an-bar-track { height: 10px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.an-bar-fill { height: 100%; border-radius: var(--r-pill); background: var(--accent); transition: width 0.4s ease; }
.an-bar-fill.st-generated { background: var(--info); }
.an-bar-fill.st-needs_review { background: var(--warn); }
.an-bar-fill.st-approved { background: var(--good); }
.an-bar-fill.st-posted { background: #7c3aed; }
.an-bar-fill.st-rejected { background: var(--bad); }
.an-bar-count { font-size: 12.5px; font-weight: 700; color: var(--text); text-align: right; }

.insight-list { margin: 0; padding: 0 0 0 2px; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.insight-list li { position: relative; padding-left: 22px; font-size: 13.5px; line-height: 1.55; color: var(--text-soft); }
.insight-list li::before { content: ''; position: absolute; left: 0; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* --- Ajustes / integraciones --- */
.integration-row { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.integration-row:last-child { border-bottom: 0; }
.integration-row .btn { flex: 0 0 auto; }

/* --- Brand hero --- */
.brand-hero {
  display: flex; align-items: center; gap: 18px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-1);
  padding: 22px 24px; margin-bottom: 16px;
}
.bh-avatar {
  width: 58px; height: 58px; flex: 0 0 58px; border-radius: 16px;
  background: var(--accent-grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800;
}
.bh-avatar.bh-logo { background: var(--surface-2); border: 1px solid var(--border); padding: 6px; }
.bh-avatar.bh-logo img { width: 100%; height: 100%; object-fit: contain; }
.bh-main { flex: 1; min-width: 0; }

.logo-upload { display: flex; align-items: flex-start; gap: 14px; }
.logo-upload img {
  width: 76px; height: 76px; flex: 0 0 76px; object-fit: contain;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 8px;
}
.bh-name { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.bh-desc { font-size: 13px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bh-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chan-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-pill); padding: 4px 11px;
}
.chan-chip.on { color: var(--accent); background: var(--accent-wash); border-color: rgba(255, 106, 0, 0.2); }
.chan-chip svg { width: 13px; height: 13px; }
.bh-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex: 0 0 auto; }
.bh-palette { display: flex; gap: 4px; }
.bh-palette span { width: 18px; height: 18px; border-radius: 6px; border: 1px solid var(--border); }

/* --- Banner "contenido de hoy" en el Inicio --- */
.today-hero {
  display: flex; align-items: center; gap: 16px;
  margin: 8px 0 18px;
  padding: 16px 20px;
  border-radius: var(--r-lg);
  background: var(--accent-wash);
  border: 1px solid rgba(255, 106, 0, 0.22);
}
.today-hero.done { background: var(--good-bg); border-color: rgba(22, 163, 74, 0.22); }
.today-hero .th-thumb { width: 52px; height: 52px; flex: 0 0 52px; border-radius: 12px; object-fit: cover; }
.today-hero .th-main { flex: 1; min-width: 0; }
.th-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase; color: var(--accent); }
.today-hero.done .th-eyebrow { color: var(--good); }
.th-eyebrow svg { width: 14px; height: 14px; }
.th-title { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; color: var(--text); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-sub { font-size: 13px; color: var(--text-soft); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-hero .btn { flex: 0 0 auto; }
@media (max-width: 560px) {
  .today-hero { flex-wrap: wrap; }
  .today-hero .btn { width: 100%; justify-content: center; }
}

/* --- Agenda: lista de ideas --- */
.agenda-list { display: flex; flex-direction: column; gap: 10px; }
.agenda-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-1);
  padding: 12px 14px;
  transition: box-shadow 0.15s var(--ease), border-color 0.15s;
}
.agenda-item:hover { box-shadow: var(--shadow-2); }
.agenda-item.is-today { border-color: rgba(255, 106, 0, 0.35); background: var(--accent-wash); }
.ag-thumb {
  width: 52px; height: 52px; flex: 0 0 52px; border-radius: 10px;
  object-fit: cover; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; color: var(--faint);
}
.ag-thumb-empty svg { width: 22px; height: 22px; }
.ag-main { flex: 1; min-width: 0; cursor: pointer; }
.ag-date { font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em; color: var(--muted); text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.ag-topic { font-size: 15px; font-weight: 700; color: var(--text); margin-top: 3px; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-angle { font-size: 12.5px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
@media (max-width: 560px) {
  .agenda-item { flex-wrap: wrap; }
  .ag-actions { width: 100%; justify-content: flex-end; }
}

.ctype-chip {
  display: inline-flex; align-items: center; white-space: nowrap;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.01em;
  color: #7c3aed; background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.2); border-radius: var(--r-pill);
  padding: 2px 8px;
}

/* --- Videos (Higgsfield) --- */
.video-section { margin: 16px 0 4px; padding: 16px; border: 1px solid var(--line, var(--border)); border-radius: var(--r-md); background: var(--surface-2); }
.video-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.video-head strong { font-size: 14px; }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.video-card { border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.video-card video { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; background: #000; }
.video-ph { aspect-ratio: 4 / 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: var(--surface-2); color: var(--muted); text-align: center; padding: 10px; }
.video-err .video-ph { color: var(--bad); }
.video-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; }

/* --- Product catalog --- */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.prod-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-1);
  overflow: hidden; display: flex; flex-direction: column;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.prod-card:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.prod-card.inactive { opacity: 0.6; }
.prod-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; border-bottom: 1px solid var(--border); }
.prod-img-empty { display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--faint); }
.prod-img-empty svg { width: 26px; height: 26px; }
.prod-body { padding: 13px 15px 6px; flex: 1; }
.prod-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.prod-price { font-size: 14px; font-weight: 800; color: var(--accent); white-space: nowrap; }
.prod-desc { font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prod-meta { display: flex; gap: 8px; margin-top: 9px; align-items: center; }
.prod-actions { display: flex; gap: 8px; padding: 10px 15px 14px; }

/* --- Template cards --- */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.tpl-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-1); overflow: hidden; }
.tpl-preview { aspect-ratio: 4 / 3; background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--faint); border-bottom: 1px solid var(--border); }
.tpl-preview svg { width: 28px; height: 28px; }
.tpl-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

.metric-icon.tone-bad { color: var(--bad); background: var(--bad-bg); }

.ig-connected { display: flex; align-items: center; gap: 12px; }
.ig-connected .platform-chip {
  width: 40px; height: 40px; flex: 0 0 40px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-wash); color: var(--accent);
}
.ig-connected .platform-chip svg { width: 20px; height: 20px; }

/* ============================================================
   Overview pieces
   ============================================================ */

.queue-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
}
.queue-item:last-child { border-bottom: 0; }

.date-chip {
  min-width: 52px;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  background: var(--surface-3);
  border: 1px solid var(--border);
  text-align: center;
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: 0.03em;
  color: var(--text-soft);
  text-transform: uppercase;
}

.recent-post { padding: 14px 4px; border-bottom: 1px solid var(--border); }
.recent-post:last-child { border-bottom: 0; }

.health-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.health-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 13px 15px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.health-item strong { font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.health-item span { font-size: 13.5px; font-weight: 650; color: var(--text); }

.ok { color: var(--good); }
.bad { color: var(--bad); }

/* ============================================================
   Posts
   ============================================================ */

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.post-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s; }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--border-strong); }

.post-image {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.post-empty-image {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--faint);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: default;
  animation: pulse 1.6s ease-in-out infinite;
}

.post-body { padding: 16px 18px 6px; display: flex; flex-direction: column; gap: 7px; flex: 1; }

.post-copy {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Post card estilo publicacion de Instagram --- */
.igp-head { display: flex; align-items: center; gap: 10px; padding: 11px 14px; }
.igp-avatar {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%;
  overflow: hidden; display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--border);
}
.igp-avatar img { width: 100%; height: 100%; object-fit: cover; }
.igp-avatar-initial { background: var(--accent-grad); color: #fff; font-size: 15px; font-weight: 800; border: 0; }
.igp-user { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.igp-username { font-size: 13px; font-weight: 700; color: var(--text); }
.igp-sub { font-size: 11px; color: var(--muted); }

.igp-media {
  width: 100%; aspect-ratio: 4 / 5; cursor: zoom-in;
  background: var(--surface-2);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.igp-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.igp-media video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; cursor: default; }
.igp-media .igp-play-badge {
  position: absolute; top: 12px; left: 12px; pointer-events: none;
  font-size: 11px; font-weight: 700; color: #fff;
  background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(6px);
  border-radius: var(--r-pill); padding: 3px 9px;
}
.igp-media .igp-video-processing {
  position: absolute; bottom: 12px; left: 12px;
  font-size: 11px; font-weight: 700; color: #fff;
  background: rgba(124, 58, 237, 0.85); backdrop-filter: blur(6px);
  border-radius: var(--r-pill); padding: 4px 10px;
  animation: pulse 1.6s ease-in-out infinite;
}
.igp-media-empty { display: flex; align-items: center; justify-content: center; cursor: default; }
.pc-generating {
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--faint); animation: pulse 1.6s ease-in-out infinite;
}
.pc-render-error { font-size: 12.5px; font-weight: 600; color: var(--bad); padding: 0 20px; text-align: center; }

.igp-iconbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px 2px; color: var(--text);
}
.igp-iconbar span { display: flex; align-items: center; gap: 14px; }
.igp-iconbar svg { width: 22px; height: 22px; }

.igp-caption {
  padding: 7px 14px 0; font-size: 13px; line-height: 1.5; color: var(--text);
  cursor: pointer;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.igp-caption .igp-username { margin-right: 2px; }
.igp-date {
  padding: 5px 14px 10px; font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--faint);
}

.pc-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px 12px;
  border-top: 1px solid var(--border);
  margin-top: auto;
  background: var(--surface-2);
}
.pc-primary { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pc-published {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 700; color: var(--good);
}
.pc-published svg { width: 15px; height: 15px; }

/* ============================================================
   Tables (calendario)
   ============================================================ */

.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: auto;
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

table { width: 100%; border-collapse: collapse; font-size: 13px; }

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-strong);
}

tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-soft);
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: var(--surface-2); }

td input, td select { padding: 7px 10px; font-size: 12.5px; background: transparent; border-color: transparent; }
td input:hover, td select:hover { border-color: var(--border-strong); background: var(--surface); }
td input:focus, td select:focus { background: var(--surface); }
td select { background-image: none; padding-right: 10px; }
td.actions { white-space: nowrap; text-align: right; }

/* ============================================================
   Forms
   ============================================================ */

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group { display: flex; flex-direction: column; }
.form-group.full { grid-column: 1 / -1; }
.form-group .subtle { margin-top: 6px; }

.color-grid { display: flex; gap: 14px; flex-wrap: wrap; }
.color-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  min-width: 190px;
}

/* ============================================================
   Misc content blocks
   ============================================================ */

.rules, .rules-list {
  white-space: pre-line;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.7;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
}
.rules-list { white-space: normal; padding: 6px 16px; }
.rules-list .queue-item { padding: 12px 0; }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
}

.inspiration {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  padding: 12px;
  cursor: pointer;
  transition: transform 0.18s var(--ease), border-color 0.18s, box-shadow 0.18s;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.inspiration:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow-1); }
.inspiration img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--r-sm);
  background: var(--surface-3);
  border: 1px solid var(--border);
}

/* ============================================================
   Modal
   ============================================================ */

#modal-root { position: fixed; inset: 0; z-index: 90; pointer-events: none; }
#modal-root.open { pointer-events: auto; }

.modal-bg {
  position: absolute;
  inset: 0;
  background: rgba(32, 26, 18, 0.42);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

.modal {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(680px, calc(100vw - 32px));
  max-height: min(86vh, 900px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 26px;
  box-shadow: var(--shadow-2);
  animation: modalIn 0.28s var(--ease);
}

@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 14px)) scale(0.985); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.modal h3 { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 16px; color: var(--text); }
.modal .subtle { margin-bottom: 14px; display: block; }

.modal-image {
  width: 100%;
  max-width: 380px;
  display: block;
  margin: 0 auto 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-2);
}

/* ============================================================
   Toasts
   ============================================================ */

#toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
}

.toast {
  padding: 13px 18px 13px 16px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--good);
  color: var(--text);
  font-size: 13px;
  font-weight: 550;
  box-shadow: var(--shadow-2);
  animation: toastIn 0.3s var(--ease);
}
.toast.error { border-left-color: var(--bad); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: none; }
}

/* ============================================================
   Auth (login / registro)
   ============================================================ */

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  width: 100vw;
  margin: -26px 0 -80px calc(50% - 50vw);
  background: var(--surface);
}

.auth-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 56px;
  background:
    radial-gradient(900px 500px at 20% 0%, rgba(255, 106, 26, 0.12), transparent 55%),
    radial-gradient(700px 500px at 90% 100%, rgba(255, 106, 26, 0.06), transparent 55%),
    var(--bg);
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.auth-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(20, 16, 10, 0.05) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(600px 400px at 30% 30%, black, transparent);
  pointer-events: none;
}

.auth-hero .side-logo { padding: 0; }

.auth-hero h1 {
  font-size: clamp(30px, 3.6vw, 46px);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.06;
  max-width: 480px;
  color: var(--text);
}
.auth-hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, #ff8b45, #ff5a05);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-hero .hero-points { display: flex; flex-direction: column; gap: 12px; margin-top: 26px; }
.hero-point { display: flex; gap: 11px; align-items: flex-start; color: var(--text-soft); font-size: 14px; max-width: 440px; }
.hero-point::before {
  content: "";
  flex: 0 0 auto;
  width: 18px; height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--accent-wash) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff5a05' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 13 4 4L19 7'/%3E%3C/svg%3E") center / 10px no-repeat;
}

.auth-hero .hero-foot { color: var(--faint); font-size: 12px; }

.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 28px; background: var(--surface); }

.auth-card { width: min(400px, 100%); }
.auth-card h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; color: var(--text); }
.auth-card .subtle { display: block; margin: 6px 0 24px; }
.auth-card form { display: flex; flex-direction: column; gap: 16px; }
.auth-card input { padding: 12px 14px; font-size: 14px; border-radius: var(--r-md); }
.auth-card .btn { padding: 12px 16px; font-size: 14px; border-radius: var(--r-md); width: 100%; }

.auth-switch {
  margin-top: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.15s;
}
.auth-switch:hover { color: var(--accent); }
.auth-switch b { color: var(--accent); font-weight: 700; }

/* Empty state — primera marca */
.hero-empty {
  max-width: 520px;
  margin: 9vh auto 0;
  text-align: center;
  padding: 46px 40px;
}
.hero-empty .logo-mark { display: block; margin: 0 auto 22px; width: 52px; height: 52px; border-radius: 16px; }
.hero-empty .logo-mark::after { inset: 14px; border-radius: 8px; }
.hero-empty h2 { font-size: 26px; font-weight: 850; letter-spacing: -0.03em; color: var(--text); }
.hero-empty p { color: var(--muted); margin: 10px auto 24px; max-width: 380px; }

/* Brand switcher (side-foot) */
.brand-switch { display: flex; flex-direction: column; gap: 8px; }

/* ============================================================
   Apple-style shared components (segmented, settings, toggle)
   ============================================================ */

.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 11px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }

.seg-opt {
  padding: 7px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s var(--ease);
}
.seg-opt:hover { color: var(--text-soft); }
.seg-opt.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(20, 16, 10, 0.1), 0 0 0 0.5px rgba(20, 16, 10, 0.04);
}
.seg-opt .seg-count { color: var(--faint); font-weight: 600; margin-left: 5px; font-size: 11.5px; }
.seg-opt.active .seg-count { color: var(--accent); }

.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.settings-card + .settings-card { margin-top: 16px; }

.settings-card-head {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.settings-card-head h2 { font-size: 15px; font-weight: 750; letter-spacing: -0.01em; }
.settings-card-head p { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.settings-card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.settings-card-head > div { flex: 1; min-width: 0; }

.settings-card-body { padding: 22px 24px; }

input[type="checkbox"].toggle {
  position: relative;
  width: 46px;
  height: 27px;
  flex: 0 0 auto;
  appearance: none;
  -webkit-appearance: none;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s;
}
.toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(20, 16, 10, 0.25);
  transition: transform 0.2s var(--ease);
}
.toggle:checked { background: var(--accent); border-color: var(--accent); }
.toggle:checked::after { transform: translateX(19px); }

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.toggle-row .t-label { font-size: 13.5px; font-weight: 650; color: var(--text); }
.toggle-row .t-desc { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.save-bar {
  position: sticky;
  bottom: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  padding: 12px 18px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-2);
}
.save-bar .subtle { flex: 1; }

.cal-today td { background: var(--accent-wash) !important; }

/* ============================================================
   Calendario mensual (grid estilo Content Calendar)
   ============================================================ */

.cal-shell { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }

.cal-main {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-nav .icon-btn { width: 32px; height: 32px; border-radius: 9px; }
.cal-month-label { font-size: 16px; font-weight: 750; letter-spacing: -0.01em; min-width: 140px; text-align: center; text-transform: capitalize; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }

.cal-dow {
  padding: 10px 10px 8px;
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.cal-cell {
  min-height: 112px;
  padding: 8px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--surface);
}
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.other { background: var(--surface-2); }
.cal-cell.other .cal-daynum { color: var(--faint); }

.cal-daynum {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-soft);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.cal-daynum.today { background: var(--accent-grad); color: #fff; box-shadow: 0 2px 8px -2px rgba(255,106,26,0.5); }

.cal-mini {
  display: flex;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  transition: transform 0.12s var(--ease), box-shadow 0.12s;
  text-align: left;
  width: 100%;
  font: inherit;
}
.cal-mini:hover { transform: translateY(-1px); box-shadow: var(--shadow-1); }

.cal-mini .cm-thumb {
  width: 34px; height: 34px; flex: 0 0 auto;
  border-radius: 8px; object-fit: cover;
  border: 1px solid var(--border);
  background: var(--surface-3);
  display: flex; align-items: center; justify-content: center;
  color: var(--faint);
}
.cal-mini .cm-thumb svg { width: 14px; height: 14px; }

.cal-mini .cm-body { min-width: 0; flex: 1; }
.cal-mini .cm-status { display: flex; align-items: center; gap: 5px; font-size: 9.5px; font-weight: 750; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 2px; }
.cal-mini .cm-status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.cal-mini .cm-title {
  font-size: 11px; font-weight: 600; color: var(--text); line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.cal-mini.st-pending { background: var(--warn-bg); border-color: rgba(217,119,6,0.18); }
.cal-mini.st-pending .cm-status { color: var(--warn); }
.cal-mini.st-generated { background: var(--info-bg); border-color: rgba(2,132,199,0.16); }
.cal-mini.st-generated .cm-status { color: var(--info); }
.cal-mini.st-needs_review { background: var(--accent-wash); border-color: rgba(255,106,26,0.2); }
.cal-mini.st-needs_review .cm-status { color: #c2410c; }
.cal-mini.st-approved { background: var(--good-bg); border-color: rgba(22,163,74,0.16); }
.cal-mini.st-approved .cm-status { color: var(--good); }
.cal-mini.st-posted { background: rgba(124,58,237,0.08); border-color: rgba(124,58,237,0.16); }
.cal-mini.st-posted .cm-status { color: #7c3aed; }
.cal-mini.st-rejected { background: var(--bad-bg); border-color: rgba(220,38,38,0.16); }
.cal-mini.st-rejected .cm-status { color: var(--bad); }
.cal-mini.st-skipped .cm-status { color: var(--muted); }

.cal-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.cal-legend .lg { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); font-weight: 600; }
.cal-legend .lg::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dot, var(--faint)); }

.cal-side {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  padding: 18px;
  position: sticky;
  top: 86px;
}
.cal-side h2 { font-size: 15px; font-weight: 750; margin-bottom: 4px; }
.cal-side .side-sub { font-size: 12px; color: var(--muted); margin-bottom: 14px; }

.side-post {
  display: flex; gap: 11px; align-items: center;
  padding: 11px 2px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.side-post:last-of-type { border-bottom: 0; }
.side-post:hover .sp-title { color: var(--accent); }
.side-post .sp-date { font-size: 10.5px; font-weight: 750; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.side-post .sp-title { font-size: 12.5px; font-weight: 650; line-height: 1.3; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

@media (max-width: 1100px) {
  .cal-shell { grid-template-columns: 1fr; }
  .cal-side { position: static; }
}

/* ============================================================
   Onboarding wizard (multi-step, testimonials, content plan)
   ============================================================ */

.wizard { display: flex; flex-direction: column; gap: 4px; }

.wizard-progress {
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  overflow: hidden;
  margin-bottom: 22px;
}
.wizard-bar {
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--accent-grad);
  transition: width 0.4s var(--ease);
}

.wizard-emoji { font-size: 34px; line-height: 1; margin-bottom: 12px; }
.wizard h3 { font-size: 22px; letter-spacing: -0.03em; margin-bottom: 6px; }
.wizard .lead { color: var(--muted); font-size: 14px; margin-bottom: 22px; display: block; }

.opt-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }

.opt-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s, transform 0.12s;
  text-align: left;
  width: 100%;
  font: inherit;
}
.opt-card:hover { border-color: var(--accent-soft); transform: translateY(-1px); }
.opt-card.selected { border-color: var(--accent); background: var(--accent-wash); }

.opt-emoji {
  width: 40px; height: 40px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: 11px; font-size: 19px;
  background: var(--surface-3);
}
.opt-card.selected .opt-emoji { background: #fff; }

.opt-body { flex: 1; min-width: 0; }
.opt-body strong { display: block; font-size: 14.5px; font-weight: 700; color: var(--text); }
.opt-body span { font-size: 12.5px; color: var(--muted); }

.opt-radio {
  width: 20px; height: 20px; flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}
.opt-card.selected .opt-radio { border-color: var(--accent); }
.opt-card.selected .opt-radio::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent);
}

.chip-list { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 8px; }
.chip-opt {
  padding: 9px 15px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-soft);
  font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.chip-opt:hover { border-color: var(--accent-soft); }
.chip-opt.selected { border-color: var(--accent); background: var(--accent-wash); color: #c2410c; }

.testimonial-card {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  padding: 22px;
  margin-bottom: 4px;
}
.stars { color: #f5a623; font-size: 16px; letter-spacing: 2px; margin-bottom: 12px; }
.testimonial-card blockquote {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text);
}
.testi-author { display: flex; align-items: center; gap: 11px; }
.testi-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent-grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px;
}
.testi-author .name { font-size: 13.5px; font-weight: 700; color: var(--text); }
.testi-author .role { font-size: 12px; color: var(--muted); }

.rating-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 16px; padding-top: 16px;
  border-top: 1px solid var(--border);
}
.rating-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px; font-weight: 600; color: var(--text-soft);
}
.rating-badge b { color: var(--text); }
.rating-badge .rstar { color: #f5a623; }

.wizard-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 22px; }
.wizard-actions .btn-primary { flex: 1; justify-content: center; padding: 12px; }

/* Content plan (final step) */
.plan-summary {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px;
  padding: 18px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--border);
  margin-bottom: 16px;
}
.plan-summary .kv strong { display: block; font-size: 11px; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.plan-summary .kv span { font-size: 13.5px; color: var(--text); font-weight: 600; }

.plan-week { border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; margin-bottom: 8px; }
.plan-week-head { padding: 12px 16px; background: var(--surface-2); font-weight: 700; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.plan-day { display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center; padding: 11px 16px; border-top: 1px solid var(--border); }
.plan-day .pd-day { font-size: 11.5px; font-weight: 750; text-transform: uppercase; color: var(--accent); }
.plan-day .pd-idea { font-size: 13px; color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.user-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent-grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0;
}
.user-meta { min-width: 0; line-height: 1.25; }
.user-meta strong { display: block; font-size: 12.5px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta span { font-size: 11px; color: var(--muted); }

/* ============================================================
   Persistent top bar (search, notifications, primary action)
   ============================================================ */

.topbar-new {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 40px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-new.hidden-auth { display: none; }

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(420px, 44vw);
  padding: 9px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--muted);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.search-box:focus-within {
  border-color: rgba(255, 106, 26, 0.5);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(255, 106, 26, 0.12);
}
.search-box svg { width: 16px; height: 16px; flex: 0 0 auto; }
.search-box input {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 13.5px;
  color: var(--text);
}
.search-box input:focus { outline: none; box-shadow: none; }
.search-box kbd {
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  color: var(--faint);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 2px 6px;
}

.topbar-actions { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }

.icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.icon-btn:hover { background: var(--surface-3); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }

.notif-wrap { position: relative; }

.badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface);
}
.badge[hidden] { display: none; }

.notif-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 320px;
  max-height: 380px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
  padding: 8px;
  z-index: 30;
  animation: modalIn 0.18s var(--ease);
}
.notif-panel[hidden] { display: none; }

.notif-head {
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.notif-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: var(--text);
  transition: background 0.12s;
}
.notif-item:hover { background: var(--surface-2); }
.notif-item .title { display: block; margin-bottom: 2px; }
.notif-item .subtle { display: block; }

/* ============================================================
   Dashboard (Overview) — metric cards, creative preview, schedule
   ============================================================ */

.dash-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; gap: 10px; }
.dash-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; }
.dash-head p { color: var(--muted); font-size: 13.5px; margin-top: 3px; }

.metric-card { display: flex; flex-direction: column; gap: 14px; }
.metric-top { display: flex; align-items: center; gap: 12px; }

.metric-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: var(--accent-wash);
}
.metric-icon svg { width: 19px; height: 19px; }
.metric-icon.tone-good { color: var(--good); background: var(--good-bg); }
.metric-icon.tone-info { color: var(--info); background: var(--info-bg); }
.metric-icon.tone-warn { color: var(--warn); background: var(--warn-bg); }

.metric-delta { font-weight: 700; }
.metric-delta.up { color: var(--good); }
.metric-delta.down { color: var(--bad); }

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.card-head h2 { font-size: 15.5px; font-weight: 750; }

.creative-preview { display: grid; grid-template-columns: 1.1fr 1fr; gap: 22px; align-items: stretch; }

.creative-media {
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
  aspect-ratio: 4 / 5;
}
.creative-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.creative-media .platform-chip {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-1);
  color: var(--accent);
}
.creative-media .platform-chip svg { width: 16px; height: 16px; }
.creative-media.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  color: var(--faint);
  font-size: 12.5px;
  text-align: center;
  padding: 20px;
}

.creative-info { display: flex; flex-direction: column; gap: 10px; }
.creative-info h3 { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.3; }
.creative-info .body-text { color: var(--text-soft); font-size: 13.5px; line-height: 1.6; }
.creative-info .cta-line { color: var(--accent); font-weight: 700; font-size: 13px; }
.creative-info .toolbar { margin-top: auto; padding-top: 4px; }

.upcoming-row {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--border);
}
.upcoming-row:last-child { border-bottom: 0; }

.thumb {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.thumb-empty {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
}
.thumb-empty svg { width: 17px; height: 17px; }

.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.week-col { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.week-col-head { text-align: center; }
.week-col-head .dow { font-size: 10.5px; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.week-col-head .dom { font-size: 13.5px; font-weight: 800; color: var(--text); }
.week-col.is-today .dom { color: var(--accent); }

.week-thumb {
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--faint);
  transition: transform 0.15s var(--ease), border-color 0.15s;
}
.week-thumb:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.week-thumb img { width: 100%; height: 100%; object-fit: cover; }
.week-thumb svg { width: 16px; height: 16px; }

.week-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.week-dot.status-pending { background: var(--warn); }
.week-dot.status-generated { background: var(--info); }
.week-dot.status-needs_review { background: var(--accent); }
.week-dot.status-approved { background: var(--good); }
.week-dot.status-rejected { background: var(--bad); }

.brand-summary-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.brand-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-grad);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-summary-head strong { display: block; font-size: 14px; font-weight: 750; }
.brand-summary-head span { font-size: 12px; color: var(--muted); }

.swatch-row { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
}

.font-row { display: flex; gap: 20px; margin-top: 14px; }
.font-chip .sample { font-size: 20px; font-weight: 800; color: var(--text); }
.font-chip .label { font-size: 11px; color: var(--muted); margin-top: 2px; }

.recent-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.recent-row:last-child { border-bottom: 0; }
.recent-row:hover .title { color: var(--accent); }
.recent-meta { font-size: 11.5px; color: var(--faint); margin-top: 2px; }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1020px) {
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
}

/* ============================================================
   Mobile: layout tipo app nativa — top bar compacta, navegacion
   inferior fija, modals como bottom sheets, touch targets amplios.
   ============================================================ */
@media (max-width: 860px) {
  .app { flex-direction: column; }

  /* Top app bar: logo + marca/usuario. La navegacion vive abajo. */
  /* Sin backdrop-filter: un filter en un ancestro convierte a este contenedor
     en containing block y rompe el position:fixed de la bottom bar (hija). */
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: auto;
    width: 100%;
    flex: none;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    background: #ffffff;
  }

  .side-logo { padding: 0; flex: 0 0 auto; }
  .side-logo .logo-text span { display: none; }

  .side-foot { flex-direction: row; align-items: center; border-top: 0; padding: 0; margin-left: auto; gap: 8px; }
  .side-foot .brand-switch { display: flex; flex-direction: row; align-items: center; gap: 8px; }
  .side-foot select { width: auto; max-width: 160px; }
  .user-row { display: none; }
  /* "+ Marca" y "Salir" viven en Ajustes > Cuenta en mobile */
  .side-foot .foot-row { display: none; }

  /* Bottom tab bar fija, como una app */
  .side-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    flex-direction: row;
    gap: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    background: #ffffff;
    border-top: 1px solid var(--border);
    justify-content: space-around;
  }

  /* Solo 4 destinos en la barra: Inicio, Posts, Calendario y "Mas". */
  .tab[data-nav="secondary"] { display: none; }
  .tab-more { display: flex; }

  .tab {
    width: auto;
    flex: 1 1 0;
    flex-direction: column;
    gap: 3px;
    padding: 7px 4px;
    font-size: 10.5px;
    font-weight: 650;
    justify-content: center;
    align-items: center;
    text-align: center;
    border-radius: 12px;
    min-height: 50px;
  }
  .tab svg { width: 22px; height: 22px; opacity: 1; }
  .tab.active::before { display: none; }
  .tab.active { background: transparent; color: var(--accent); }
  .tab.active svg { color: var(--accent); }
  .tab span { white-space: nowrap; }

  /* Contenido despeja la bottom bar */
  #content { padding: 18px 14px calc(96px + env(safe-area-inset-bottom, 0px)); }
  .form-grid { grid-template-columns: 1fr; }
  .health-grid { grid-template-columns: 1fr; }
  .auth-shell { margin: -18px 0 -96px calc(50% - 50vw); }
  .page-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .page-head h1 { font-size: 22px; }
  .page-head .toolbar { flex-wrap: wrap; }

  .topbar-new { padding: 10px 14px; gap: 10px; }
  .search-box { width: 100%; min-width: 0; }
  .search-box kbd { display: none; }
  .topbar-actions .btn-primary svg { display: none; }
  .topbar-actions .btn-primary { padding: 9px 12px; font-size: 12.5px; }
  .notif-panel { width: calc(100vw - 28px); right: -8px; }

  /* Touch targets */
  .btn { min-height: 40px; }
  .btn-sm { min-height: 36px; }
  input, select, textarea { font-size: 16px; } /* evita zoom automatico de iOS */

  /* Modals como bottom sheet */
  .modal {
    left: 0;
    top: auto;
    bottom: 0;
    transform: none;
    width: 100vw;
    max-height: 90dvh;
    border-radius: 22px 22px 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    padding: 22px 18px calc(22px + env(safe-area-inset-bottom, 0px));
    animation: sheetIn 0.3s var(--ease);
  }

  /* Save bar flota sobre la bottom bar */
  .save-bar { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }

  /* Calendario: la grilla mensual scrollea horizontal */
  .cal-main { overflow-x: auto; }
  .cal-grid { min-width: 600px; }
  .cal-toolbar { flex-wrap: wrap; gap: 10px; }

  /* Segmented scrolleable */
  .segmented { overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .segmented::-webkit-scrollbar { display: none; }
  .seg-opt { white-space: nowrap; }

  .creative-preview { grid-template-columns: 1fr; }
  .creative-media { aspect-ratio: 16 / 10; }

  .week-strip { grid-template-columns: repeat(7, minmax(64px, 1fr)); overflow-x: auto; }

  .brand-hero { flex-wrap: wrap; }
  .bh-side { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; }
  .an-bar-row { grid-template-columns: 90px 1fr 30px; }
  .integration-row { flex-wrap: wrap; }
  .pc-actions { flex-wrap: wrap; }
  .prod-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .tpl-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

@keyframes sheetIn {
  from { opacity: 0.6; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}
