/* The editorial theme uses the existing panel DOM and module controls. */
:root {
  color-scheme: light;
  --editorial-page: #f2eee8;
  --editorial-paper: #fbf8f2;
  --editorial-input: #fffdf8;
  --editorial-ink: #2f2329;
  --editorial-muted: #685861;
  --editorial-line: #ded3ca;
  --editorial-border: #ae969d;
  --editorial-plum: #30212d;
  --editorial-plum-hover: #493543;
  --editorial-coral: #f8ad91;
  --editorial-coral-ink: #943f2e;
  --editorial-peach: #f3ded0;
  --editorial-pink: #eedde5;
  --editorial-serifs: Georgia, Cambria, serif;
  --navy: var(--editorial-ink);
  --copper: var(--editorial-coral-ink);
  --sand: var(--editorial-coral);
  --ivory: var(--editorial-page);
  --line: var(--editorial-line);
  --muted: var(--editorial-muted);
  --ok: #38522a;
  --bad: #932d2d;
}

body { background: var(--editorial-page); color: var(--editorial-ink); }
::selection { color: var(--editorial-plum); background: var(--editorial-coral); }

.card.auth {
  border: 1px solid var(--editorial-line);
  border-radius: 14px;
  background: var(--editorial-paper);
  box-shadow: 0 12px 38px rgb(48 33 45 / 12%);
}
.auth h1, .auth-head h1 { font-family: var(--editorial-serifs); font-weight: 400; }
.auth-head .mono {
  background: var(--editorial-coral);
  color: var(--editorial-plum);
  border-radius: 50%;
  font-family: var(--editorial-serifs);
}
.auth .btn.primary { background: var(--editorial-plum); }
.auth .btn.primary:hover:enabled { background: var(--editorial-plum-hover); }
.auth .btn.ghost { border-color: var(--editorial-border); }

#app:has(.dashboard-ready:not([hidden])) {
  background: var(--editorial-page);
  color: var(--editorial-ink);
}
.dashboard-ready {
  --dashboard-ink: var(--editorial-ink);
  --dashboard-muted: var(--editorial-muted);
  --dashboard-paper: var(--editorial-paper);
  --dashboard-line: var(--editorial-line);
  --dashboard-accent: var(--editorial-plum);
  --dashboard-width: 1360px;
  --dashboard-gutter: clamp(16px, 3.3vw, 46px);
}
.dashboard-ready > .top {
  min-height: 64px;
  color: var(--editorial-ink);
  background: var(--editorial-paper);
  border-block-end: 1px solid var(--editorial-line);
}
.dashboard-ready > .top .who { color: var(--editorial-muted); max-inline-size: 30ch; }
.dashboard-ready > .top :focus-visible { outline-color: var(--editorial-coral-ink); }
.dashboard-ready .dashboard-menu-trigger { border-color: var(--editorial-line); }
.dashboard-ready .dashboard-menu-trigger:hover { background: var(--editorial-peach); }
.dashboard-ready > .dashboard-heading { padding-block-end: 22px; }
.dashboard-heading h1 {
  font: 400 clamp(2.75rem, 5vw, 5rem)/1 var(--editorial-serifs);
  letter-spacing: -.04em;
  overflow-wrap: anywhere;
}
.dashboard-heading p {
  max-width: 65ch;
  margin: 12px 0 0;
  color: var(--editorial-muted);
}
.dashboard-ready > [data-pane] { color: var(--editorial-ink); }
.dashboard-ready :is(.tr-hd h2, .ms-inbox-head h2, .ms-reader h2, .sb-form h3, .nl-phead h2, .nl-aud h2, .nl-hist h2, .nw-head h2, .soon h2) {
  font: 400 1.35rem/1.2 var(--editorial-serifs);
  letter-spacing: -.02em;
}

.dashboard-ready .dashboard-drawer, .editorial-sidebar {
  background: var(--editorial-plum);
  color: #f8eee9;
}
.dashboard-ready .dashboard-drawer::backdrop { background: rgb(30 17 27 / 52%); }
.dashboard-ready .dashboard-drawer-top { border-color: #695361; }
.dashboard-ready :is(.dashboard-drawer, .editorial-sidebar) .tabs a {
  color: #f8eee9;
  background: transparent;
  border: 0;
  min-height: 46px;
  text-decoration: none;
}
.dashboard-ready :is(.dashboard-drawer, .editorial-sidebar) .tabs a:hover,
.dashboard-ready .dashboard-menu-close:hover { background: var(--editorial-plum-hover); }
.dashboard-ready :is(.dashboard-drawer, .editorial-sidebar) .tabs a[aria-current="page"] {
  color: var(--editorial-plum);
  background: var(--editorial-coral);
  font-weight: 700;
}
.dashboard-ready :is(.dashboard-drawer, .editorial-sidebar) :focus-visible { outline-color: var(--editorial-coral); }
.dashboard-ready .dashboard-menu-close { border-color: #8d7180; }
.editorial-sidebar { display: none; }
.editorial-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  font: 400 1.12rem/1.2 var(--editorial-serifs);
  text-decoration: none;
}
.editorial-brand small { display: block; margin-top: 4px; color: #ebd0dd; font: 400 .74rem/1.2 Manrope, system-ui, sans-serif; }
.editorial-monogram {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--editorial-coral);
  color: var(--editorial-plum);
  font-style: italic;
}
.editorial-nav-icon { flex: none; width: 18px; height: 18px; stroke: currentColor; fill: none; }
.editorial-admin .tabs a { gap: 10px; }
.editorial-admin .tab-badge { flex: none; margin-inline-start: auto; background: #7d4665; color: white; }
.editorial-admin .tabs a[aria-current="page"] .tab-badge { background: var(--editorial-plum); }

@media (min-width: 721px) {
  .editorial-admin {
    display: grid;
    grid-template-columns: 212px minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    align-items: start;
    min-height: 100svh;
  }
  .editorial-admin.nav-compact { grid-template-columns: 70px minmax(0, 1fr); }
  .editorial-admin .editorial-sidebar {
    display: flex;
    flex-direction: column;
    grid-column: 1;
    grid-row: 1 / 4;
    position: sticky;
    top: 0;
    height: 100svh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 26px 17px 22px;
    scrollbar-width: thin;
  }
  .editorial-sidebar .editorial-brand { margin-inline: 8px; }
  .editorial-sidebar .tabs {
    margin: 42px 0 0;
    padding: 0;
    display: grid;
    gap: 4px;
    border: none;
    overflow: visible;
  }
  .editorial-sidebar .tabs a { padding: 8px 11px; border-radius: 8px; font-size: 14px; }
  .editorial-admin .editorial-sidebar-caption { margin-block-start: auto; color: #ebd0dd; }
  .editorial-admin > .top,
  .editorial-admin > .dashboard-heading,
  .editorial-admin > [data-pane] { grid-column: 2; }
  .editorial-admin > .top { grid-row: 1; }
  .editorial-admin > .dashboard-heading { grid-row: 2; }
  .editorial-admin > [data-pane] { grid-row: 3; }
  .editorial-admin.nav-compact .editorial-sidebar { padding-inline: 10px; }
  .editorial-admin.nav-compact .editorial-brand { justify-content: center; margin-inline: 0; }
  .editorial-admin.nav-compact .editorial-brand > :not(.editorial-monogram),
  .editorial-admin.nav-compact .editorial-nav-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .editorial-admin.nav-compact .tabs a { justify-content: center; position: relative; padding-inline: 4px; }
  .editorial-admin.nav-compact .tab-badge {
    position: absolute;
    inset: 1px 2px auto auto;
    min-width: 16px;
    height: 16px;
    padding-inline: 3px;
    font-size: 10px;
  }
}

/* Keep every live control and panel intact. */
.dashboard-ready :is(.card, .tr-panel, .nw-row, .sb-row, .nl-block) { background: var(--editorial-paper); border-color: var(--editorial-line); }
.dashboard-ready :is(.btn, .chip, .tr-periods button) { border-radius: 7px; }
.dashboard-ready :is(.btn.ghost, .chip, .nl-btns button, .nl-x) {
  background: var(--editorial-input);
  color: var(--editorial-ink);
  border-color: var(--editorial-border);
}
.dashboard-ready :is(.btn.ghost, .chip, .nl-btns button, .nl-x):hover:not(:disabled) { background: var(--editorial-peach); }
.dashboard-ready :is(.btn.primary, .chip[aria-pressed="true"], .tr-periods button[aria-pressed="true"]),
.dashboard-ready .ms-reader-content .ms-actions .primary {
  background: var(--editorial-plum);
  color: white;
  border-color: var(--editorial-plum);
}
.dashboard-ready :is(.btn.primary, .chip[aria-pressed="true"]):hover:not(:disabled) {
  background: var(--editorial-plum-hover);
  color: white;
}
.dashboard-ready :is(.chip.danger, .nw-del) { color: var(--bad); }
.dashboard-ready .tr-periods { border-radius: 9px; background: var(--editorial-paper); }
.dashboard-ready :is(.tr-periods, .nl-chips) button { min-height: 42px; }
.dashboard-ready :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea) {
  max-width: 100%;
  background: var(--editorial-input);
  border-color: var(--editorial-border);
  color: var(--editorial-ink);
  border-radius: 7px;
}
.dashboard-ready :is(input, textarea)::placeholder { color: var(--editorial-muted); opacity: 1; }
.dashboard-ready input[type="file"] { max-width: 100%; }

/* Visitas */
.dashboard-ready .tr-top { gap: 10px 15px; margin-bottom: 18px; }
.dashboard-ready .tr-kpis { border-radius: 14px; margin-bottom: 16px; }
.dashboard-ready .tr-kpi { padding: 15px 13px; }
.dashboard-ready .tr-kpi .label { font-size: 13px; }
.dashboard-ready .tr-kpi .value {
  color: var(--editorial-ink);
  font: 400 clamp(1.35rem, 2vw, 1.85rem)/1.12 var(--editorial-serifs);
  font-variant-numeric: lining-nums tabular-nums;
  overflow-wrap: anywhere;
}
.dashboard-ready .tr-g2 { gap: 16px; margin-bottom: 16px; }
.dashboard-ready .tr-panel { padding: clamp(13px, 1.6vw, 22px); border-radius: 14px; }
.dashboard-ready .tr-panel .tr-days .b { fill: #976b87; }
.dashboard-ready .tr-bar .t i { background: #976b87; }
.dashboard-ready .tr-days g:hover .b { fill: var(--editorial-coral-ink); }
.dashboard-ready :is(.tr-bar, .tr-meter) .t { background: var(--editorial-peach); }
.dashboard-ready .tr-country summary { min-height: 44px; display: grid; align-content: center; }
.dashboard-ready .tr-org .side { white-space: normal; text-align: end; }

/* Mensajes */
.dashboard-ready .ms-inbox-layout { gap: 16px; }
.dashboard-ready .ms-inbox-list { scrollbar-color: #b78b9c transparent; }
.dashboard-ready .ms-inbox-row:hover:not([aria-pressed="true"]) { background: #f5e9df; }
.dashboard-ready .ms-inbox-row[aria-pressed="true"] { background: var(--editorial-peach); }
.dashboard-ready .ms-inbox-row.unread .ms-inbox-row-top strong::before { background: var(--editorial-coral-ink); }
.dashboard-ready .ms-reader-head { background: #f2e4db; border-radius: 13px 13px 0 0; }
.dashboard-ready .ms-reader-head a { color: var(--editorial-coral-ink); }
.dashboard-ready .ms-inbox-head .tr-periods button { min-height: 44px; }
.dashboard-ready .tag { color: var(--editorial-ink); background: var(--editorial-paper); }
.dashboard-ready .tag.nl { color: var(--editorial-coral-ink); }
.dashboard-ready .tag.warn { color: var(--bad); }

/* Suscriptores */
.dashboard-ready .sb-top { gap: 8px 12px; margin-bottom: 14px; }
.dashboard-ready .sb-list { gap: 0; border: 1px solid var(--editorial-line); border-radius: 13px; background: var(--editorial-paper); }
.dashboard-ready .sb-list:has(> .tr-empty) { padding: 14px; }
.dashboard-ready .sb-row { border: 0; border-radius: 0; }
.dashboard-ready .sb-row + .sb-row { border-top: 1px solid var(--editorial-line); }
.dashboard-ready .sb-row:first-child { border-radius: 12px 12px 0 0; }
.dashboard-ready .sb-row:last-child { border-radius: 0 0 12px 12px; }
.dashboard-ready .sb-row:only-child { border-radius: 12px; }
.dashboard-ready .sb-row.open { background: #f2e4db; }
.dashboard-ready .sb-row:hover:not(.open) { background: #f5e9df; }
.dashboard-ready .sb-check { align-content: start; padding-top: 12px; }
.dashboard-ready .sb-st {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding-inline: 7px;
  border-radius: 5px;
  background: #eedde5;
}
.dashboard-ready .sb-st.confirmed { background: #e6ebd9; }
.dashboard-ready .sb-st.pending { background: #eee2bf; color: #67490c; }
.dashboard-ready .sb-st.bounced { background: #f6dfde; }
.dashboard-ready .sb-detail { background: var(--editorial-paper); padding: 8px 16px 16px; }
.dashboard-ready .sb-consent,
.dashboard-ready .sb-bulk { background: #f2e4db; }
.dashboard-ready .sb-bulk { border-color: var(--editorial-border); }
.dashboard-ready .sb-status { flex-wrap: wrap; overflow: visible; }

/* Boletín and Noticias share the same block editor and device-preview markup. */
.dashboard-ready .nl-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
.dashboard-ready .nl-col { grid-template-columns: minmax(0, 1fr); gap: 16px; }
.dashboard-ready .nl-side { position: static; }
.dashboard-ready .nl-frame { background: #efe3dc; }
.dashboard-ready .nl-block { border-left-width: 1px; }
.dashboard-ready .nl-block header { gap: 6px; flex-wrap: wrap; }
.dashboard-ready .nl-block header > span:first-child { font-size: 13px; letter-spacing: 0; text-transform: none; }
.dashboard-ready .nl-sure { background: #f5e9df; }
.dashboard-ready .nl-lbl { font-size: 15px; }
.dashboard-ready .nl-actions { display: flex; flex-wrap: wrap; }
.dashboard-ready .nl-actions .btn { width: auto; min-height: 44px; }
.dashboard-ready .nw-rows { gap: 0; border: 1px solid var(--editorial-line); border-radius: 12px; background: var(--editorial-paper); }
.dashboard-ready .nw-rows > li + li { border-top: 1px solid var(--editorial-line); }
.dashboard-ready .nw-row { border: 0; border-radius: 7px; }
.dashboard-ready .nw-row:hover { background: #f5e9df; }
.dashboard-ready .nw-row:focus-visible { outline-offset: -3px; }
.dashboard-ready .nw-state { color: var(--editorial-muted); }
.dashboard-ready .soon { background: var(--editorial-paper); }

@media (min-width: 1050px) {
  .dashboard-ready .nl-grid { grid-template-columns: minmax(0, 1.07fr) minmax(0, 1fr); }
  .dashboard-ready .nl-side { position: sticky; top: 12px; }
}
@media (min-width: 721px) and (max-width: 1279px) {
  .dashboard-ready .tr-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .dashboard-ready .ms-inbox-layout { grid-template-columns: minmax(0, 1fr); }
  .dashboard-ready .tr-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 470px) {
  .dashboard-ready .nl-actions .btn { flex: 1 1 auto; }
  .dashboard-ready .sb-tools { display: flex; flex-wrap: wrap; }
  .dashboard-ready .sb-tools .btn { white-space: normal; }
  .dashboard-ready .tr-periods button { padding-inline: 9px; font-size: 13px; }
  .dashboard-ready .tr-feed .fi { grid-template-columns: 4.6em minmax(0, 1fr); }
  .dashboard-ready .tr-feed .fi > :last-child { grid-column: 2; justify-self: start; }
}
