/* Lectura: una herramienta de trabajo diaria, con la estructura de Publora que pidió el dueño.
   Dial ENERGY 1 / RHYTHM 2 / MOTION 1. Neutros más un verde de acento, y tres colores que sólo dicen
   estado. Fuente del sistema: no se carga nada externo y es la que se lee mejor en cada pantalla. */
:root {
  color-scheme: light;
  --bg: #ffffff; --surface: #ffffff; --soft: #f5f6f7; --hover: #eef0f2;
  --ink: #17191c; --muted: #5d636b; --line: #dfe2e6; --line-strong: #7d848c;
  --primary: #17191c; --on-primary: #ffffff;
  --accent: #0b7a53; --on-accent: #ffffff; --accent-soft: #e9f7f1;
  --next: #1d5fd1; --ok: #0b7a53; --bad: #c0271c; --on-bad: #ffffff; --bad-soft: #fdeeec; --warn: #8a5a00; --warn-soft: #fdf5e2;
  --drop: #e3f0ff;
  --r-sm: 6px; --r: 8px; --r-lg: 12px;
  --side: 232px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121417; --surface: #181b1f; --soft: #1f2328; --hover: #2a2f35;
  --ink: #eef0f2; --muted: #a4abb3; --line: #33383f; --line-strong: #808791;
  --primary: #eef0f2; --on-primary: #17191c;
  --accent: #3ccb95; --on-accent: #0c1f18; --accent-soft: #15302a;
  --next: #7db0ff; --ok: #3ccb95; --bad: #ff8d82; --on-bad: #260b08; --bad-soft: #3a1f1c; --warn: #eebc5e; --warn-soft: #33290f;
  --drop: #1c3350;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121417; --surface: #181b1f; --soft: #1f2328; --hover: #2a2f35;
    --ink: #eef0f2; --muted: #a4abb3; --line: #33383f; --line-strong: #808791;
    --primary: #eef0f2; --on-primary: #17191c;
    --accent: #3ccb95; --on-accent: #0c1f18; --accent-soft: #15302a;
    --next: #7db0ff; --ok: #3ccb95; --bad: #ff8d82; --on-bad: #260b08; --bad-soft: #3a1f1c; --warn: #eebc5e; --warn-soft: #33290f;
    --drop: #1c3350;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0; letter-spacing: -.01em; }
h2, h3 { margin: 0; font-size: 1rem; }
p { margin: 0; }
a { color: inherit; }
img, video { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--next); outline-offset: 2px; }
.muted { color: var(--muted); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.stack { display: grid; gap: 14px; min-width: 0; }
.break { overflow-wrap: anywhere; }
.visually-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.boot { padding: 40vh 16px 0; text-align: center; color: var(--muted); }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); text-decoration: none; font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary); opacity: .88; }
.btn:disabled { opacity: .55; }
.btn-small { min-height: 36px; padding: 6px 10px; font-size: .9rem; }
.btn-danger { background: var(--bad); border-color: var(--bad); color: var(--on-bad); }
.btn-danger:hover { background: var(--bad); opacity: .88; }
.btn-danger-quiet { color: var(--bad); border-color: var(--bad); }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border: 0; border-radius: var(--r); background: none; color: var(--muted); }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn.bordered { border: 1px solid var(--line-strong); color: var(--ink); }
.icon-btn:disabled { opacity: .35; background: none; }

/* Marco */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 18px; padding: 18px 12px 12px; border-right: 1px solid var(--line); background: var(--surface); }
.brand { font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; text-decoration: none; padding: 2px 8px; }
.btn-new { min-height: 44px; }
.nav { display: grid; gap: 4px; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 10px; border-radius: var(--r); text-decoration: none; color: var(--muted); font-weight: 500; }
.nav-link:hover { background: var(--hover); color: var(--ink); }
.nav-link[aria-current="page"] { background: var(--soft); color: var(--ink); font-weight: 600; }
.nav-icon { position: relative; display: grid; place-items: center; }
.nav-badge { position: absolute; top: -7px; right: -9px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--bad); color: var(--on-bad); font-size: 11px; line-height: 16px; text-align: center; font-weight: 700; }
.side-foot { margin-top: auto; display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.who { font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; padding: 0 8px; }
.side-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.themes { display: flex; gap: 2px; padding: 2px; background: var(--soft); border-radius: var(--r); }
.theme-btn { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: var(--r-sm); background: none; color: var(--muted); }
.theme-btn[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line-strong); }
.main { min-width: 0; padding: 24px clamp(16px, 3vw, 36px) 40px; }
.view { display: grid; gap: 18px; min-width: 0; }
.top-bar, .bottom-nav { display: none; }
.banner { background: var(--bad-soft); color: var(--bad); padding: 10px 14px; border-radius: var(--r); margin-bottom: 14px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.page-head p { margin-top: 4px; }
.notice { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r); background: var(--bad-soft); color: var(--bad); font-weight: 600; text-decoration: none; }
.notice:hover { text-decoration: underline; }
.empty { display: grid; justify-items: center; gap: 14px; padding: 48px 16px; text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--r-lg); color: var(--muted); }
.empty-line { color: var(--muted); }

/* Marca de estado: anillo = viene, punto = salió, ! = problema, guiones = borrador */
.mark { display: inline-grid; place-items: center; width: 10px; height: 10px; flex: none; border-radius: 50%; font-size: 9px; line-height: 1; font-weight: 800; }
.mark-next { border: 2px solid var(--next); }
.mark-ok { background: var(--ok); }
.mark-bad { width: 13px; height: 13px; background: var(--bad); color: var(--on-bad); }
.mark-draft { border: 2px dashed var(--muted); }

/* Foto de cuenta */
.avatar { position: relative; display: inline-grid; place-items: center; flex: none; border-radius: 50%; background: var(--soft); color: var(--ink); font-weight: 600; }
.avatar > img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar-sm { width: 28px; height: 28px; font-size: .78rem; }
.avatar-md { width: 44px; height: 44px; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.2rem; }
.avatar-badge { position: absolute; right: -3px; bottom: -3px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); color: var(--bg); border: 2px solid var(--surface); }
.avatar-sm .avatar-badge { display: none; }

/* Miniaturas */
.thumb { display: inline-grid; place-items: center; flex: none; overflow: hidden; background: var(--soft); color: var(--muted); border-radius: var(--r-sm); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-xs { width: 18px; height: 24px; border-radius: 3px; }
.thumb-xs svg { width: 12px; height: 12px; }
.thumb-sm { width: 36px; height: 48px; }
.thumb-md { width: 42px; height: 56px; }
.thumb-lg { width: 100%; aspect-ratio: 9 / 16; border-radius: var(--r); }

/* Barra de herramientas */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.toolbar-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.toolbar-title { min-width: 0; padding: 0 6px; font-size: 1.05rem; }
.toolbar-title::first-letter { text-transform: uppercase; }
.segmented { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); }
.segment { min-height: 34px; padding: 4px 14px; border: 0; border-radius: var(--r-sm); background: none; color: var(--muted); font-weight: 500; }
.segment:hover { color: var(--ink); }
.segment[aria-checked="true"] { background: var(--primary); color: var(--on-primary); }

/* Desplegable */
.menu-wrap { position: relative; min-width: 0; }
.menu-trigger { max-width: 240px; }
.menu-trigger.is-set { border-color: var(--ink); font-weight: 600; }
.menu { position: absolute; z-index: 30; top: calc(100% + 4px); min-width: 200px; max-width: min(320px, 90vw); padding: 4px; display: grid; gap: 2px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r); box-shadow: 0 8px 24px rgb(0 0 0 / .16); }
.menu-left { left: 0; }
.menu-right { right: 0; }
.menu-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; padding: 6px 10px; border: 0; border-radius: var(--r-sm); background: none; text-align: left; }
.menu-item:hover, .menu-item:focus-visible { background: var(--hover); }

/* Mes */
.calendar-frame { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month-head { padding: 8px; text-align: center; font-size: .86rem; font-weight: 600; color: var(--muted); background: var(--soft); border-bottom: 1px solid var(--line); text-transform: capitalize; }
.month-cell { min-height: clamp(104px, 15vh, 148px); padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.month-cell:nth-child(7n) { border-right: 0; }
.month-cell.is-other { background: var(--soft); }
.month-cell.is-past .day-number { color: var(--muted); }
.month-cell.is-today { background: var(--accent-soft); }
.month-day { display: flex; align-items: center; justify-content: space-between; min-height: 26px; }
.day-number { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 13px; font-size: .9rem; }
.is-today .day-number { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.day-open { padding: 0; border: 0; background: none; font-weight: 600; }
.day-open:hover { background: var(--hover); }
.is-today .day-open:hover { background: var(--accent); opacity: .85; }
.day-add { display: grid; place-items: center; width: 26px; height: 26px; border-radius: var(--r-sm); color: var(--muted); opacity: 0; }
.day-add:hover { background: var(--hover); color: var(--ink); }
.day-add:focus-visible, .month-cell:hover .day-add, .week-day:hover .day-add { opacity: 1; }
@media (hover: none) { .day-add { opacity: 1; } }
.month-chips { display: grid; gap: 2px; min-width: 0; }
.chip { display: flex; align-items: center; gap: 5px; min-width: 0; width: 100%; min-height: 28px; padding: 2px 4px; border: 0; border-radius: var(--r-sm); background: none; text-align: left; font-size: .82rem; }
.chip:hover { background: var(--hover); }
.chip[draggable="true"] { cursor: grab; }
.chip-time { flex: none; font-variant-numeric: tabular-nums; }
.chip-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.chip-more { border: 0; background: none; color: var(--muted); font-size: .8rem; text-align: left; padding: 2px 6px; min-height: 26px; border-radius: var(--r-sm); }
.chip-more:hover { background: var(--hover); color: var(--ink); }
.drop { background: var(--drop) !important; box-shadow: inset 0 0 0 2px var(--next); }

/* Semana */
.week { display: grid; }
.week-head { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); background: var(--soft); border-bottom: 1px solid var(--line); overflow-y: hidden; scrollbar-gutter: stable; }
.week-day { display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 44px; padding: 4px; font-size: .86rem; font-weight: 600; color: var(--muted); text-transform: capitalize; min-width: 0; }
.week-day .day-number { color: var(--ink); }
.week-day.is-today .day-number { color: var(--on-accent); }
.week-scroll { height: calc(100dvh - 250px); min-height: 360px; overflow-y: auto; scrollbar-gutter: stable; }
.week-body { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); }
.week-hours span { display: block; height: 56px; padding: 2px 6px 0 0; text-align: right; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.week-col { position: relative; border-left: 1px solid var(--line); background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 56px); cursor: copy; }
.week-col.is-past { background-color: var(--soft); cursor: default; }
.week-card { position: absolute; height: 52px; padding: 4px 6px; flex-wrap: wrap; align-content: flex-start; overflow: hidden; background: var(--surface); border: 1px solid var(--line-strong); }
.week-card .chip-text { flex-basis: 100%; }
.week-card.is-split .thumb { display: none; }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--accent); pointer-events: none; z-index: 2; }

/* Celular */
.phone-calendar { display: grid; gap: 16px; }
.phone-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.phone-weekday { text-align: center; font-size: .78rem; color: var(--muted); padding-bottom: 4px; text-transform: capitalize; }
.phone-day { display: grid; justify-items: center; align-content: start; gap: 2px; min-height: 52px; padding: 3px 0; border: 0; border-radius: var(--r); background: none; }
.phone-day.is-other .day-number { color: var(--muted); }
.phone-day[aria-pressed="true"] { background: var(--soft); box-shadow: inset 0 0 0 1px var(--line-strong); }
.phone-dots { display: flex; gap: 2px; min-height: 13px; align-items: center; }
.phone-dots .mark { width: 7px; height: 7px; font-size: 0; border-width: 1.5px; }
.agenda { display: grid; gap: 10px; }
.agenda-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.agenda-head h2::first-letter { text-transform: uppercase; }
.day-list { display: grid; gap: 6px; }
.row-btn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); text-align: left; }
.row-btn:hover { background: var(--hover); }
.row-main { display: grid; gap: 2px; min-width: 0; flex: 1; }
.row-state { display: flex; align-items: center; gap: 6px; font-size: .86rem; }

/* Publicaciones */
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tab { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 10px; white-space: nowrap; text-decoration: none; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
.tab-count { min-width: 20px; padding: 0 5px; border-radius: 10px; background: var(--soft); font-size: .78rem; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.tab-alert .tab-count { background: var(--bad); color: var(--on-bad); font-weight: 700; }
.search { display: flex; align-items: center; gap: 8px; flex: 1 1 240px; max-width: 420px; min-height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); color: var(--muted); }
.search:focus-within { outline: 2px solid var(--next); outline-offset: 2px; }
.search input { flex: 1; min-width: 0; min-height: 38px; border: 0; background: none; color: var(--ink); outline: none; }
.post-groups { display: grid; gap: 20px; }
.post-group { display: grid; gap: 8px; }
.post-group h2 { font-size: .9rem; color: var(--muted); font-weight: 600; }
.post-group h2::first-letter { text-transform: uppercase; }
.post-list { display: grid; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.post-row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 72px; padding: 8px 14px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; }
.post-row:first-child { border-top: 0; }
.post-row:hover { background: var(--hover); }
.post-row:focus-visible { outline-offset: -2px; }
.post-main { display: grid; gap: 2px; flex: 1; min-width: 0; }
.post-sub { display: flex; align-items: center; gap: 6px; font-size: .86rem; }
.post-error { color: var(--bad); font-size: .86rem; overflow-wrap: anywhere; }
.post-side { display: flex; align-items: center; gap: 12px; flex: none; }
.post-time { font-variant-numeric: tabular-nums; font-size: .9rem; }

/* Cuentas */
.account-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 12px; }
.account-card { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.account-main { display: grid; gap: 2px; flex: 1 1 180px; min-width: 0; }
.account-status { font-size: .86rem; margin-top: 2px; }
.account-status > span { display: inline-flex; align-items: flex-start; gap: 5px; }
.account-status svg { flex: none; margin-top: 3px; }
.status-ok { color: var(--ok); }
.status-bad { color: var(--bad); }
.account-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--muted); }
.steps a { color: var(--ink); }
.field { display: grid; gap: 4px; font-weight: 500; font-size: .92rem; min-width: 0; }
.field input, .time-input, textarea { width: 100%; min-width: 0; min-height: 42px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); font-weight: 400; }
.field input[readonly] { background: var(--soft); color: var(--muted); }
.error { color: var(--bad); }

/* Diálogos y avisos */
.dialog { width: min(480px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); box-shadow: 0 16px 48px rgb(0 0 0 / .28); }
.dialog-wide { width: min(720px, calc(100vw - 24px)); }
.dialog::backdrop { background: rgb(0 0 0 / .5); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 18px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dialog-body { padding: 16px 18px 18px; overflow-y: auto; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.detail-media { display: grid; gap: 6px; min-width: 0; }
.detail-file { width: 100%; max-height: 60dvh; object-fit: contain; border-radius: var(--r); background: #000; }
.detail-pager { display: flex; align-items: center; justify-content: space-between; font-size: .86rem; }
.detail { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; align-items: start; }
.detail-state { display: flex; align-items: center; gap: 8px; }
.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: .92rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; min-width: 0; }
.facts-account { display: flex; align-items: center; gap: 6px; }
.detail-caption { white-space: pre-wrap; overflow-wrap: anywhere; padding: 10px 12px; background: var(--soft); border-radius: var(--r); font-size: .92rem; max-height: 220px; overflow-y: auto; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.problem { display: flex; align-items: flex-start; gap: 8px; color: var(--bad); overflow-wrap: anywhere; font-size: .92rem; }
.problem svg { flex: none; margin-top: 2px; }
.toasts { position: fixed; z-index: 60; right: 16px; bottom: 16px; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: var(--r); background: var(--primary); color: var(--on-primary); box-shadow: 0 8px 24px rgb(0 0 0 / .24); overflow-wrap: anywhere; }
.toast-bad { background: var(--bad); color: var(--on-bad); }
.toast-action { flex: none; min-height: 32px; padding: 2px 8px; border: 1px solid currentColor; border-radius: var(--r-sm); background: none; color: inherit; font-weight: 600; }

/* Editor */
.composer { display: grid; gap: 16px; min-width: 0; }
.composer-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.composer-head .problem { margin-top: 6px; }
.composer-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.composer-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: clamp(20px, 3vw, 40px); align-items: start; }
.composer-form { display: grid; gap: 24px; min-width: 0; }
.compose-block { display: grid; gap: 10px; min-width: 0; }
.block-title { display: block; font-size: .95rem; font-weight: 600; }
.progress { display: grid; gap: 4px; }
.progress-track { height: 6px; border-radius: 3px; background: var(--soft); overflow: hidden; }
.progress-bar { display: block; height: 100%; width: 0; background: var(--accent); }
.issues { display: grid; gap: 6px; }
.issue { display: flex; align-items: flex-start; gap: 8px; padding: 8px 12px; border-radius: var(--r); background: var(--warn-soft); color: var(--warn); font-size: .92rem; overflow-wrap: anywhere; }
.issue svg { flex: none; margin-top: 2px; }
.issue-bad { background: var(--bad-soft); color: var(--bad); }
.account-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.account-pick { position: relative; display: flex; align-items: center; gap: 8px; max-width: 240px; min-height: 56px; padding: 5px 12px 5px 6px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.account-pick:hover { background: var(--hover); }
.account-pick[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.account-pick-check { position: absolute; top: -6px; left: -4px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: var(--on-accent); }
.account-pick-name { font-weight: 500; }
.media-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.media-grid.has-items { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.dropzone { display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 148px; padding: 18px; border: 2px dashed var(--line-strong); border-radius: var(--r-lg); text-align: center; cursor: pointer; }
.dropzone:hover { background: var(--hover); }
#media-input:focus-visible + .media-grid .dropzone { outline: 2px solid var(--next); outline-offset: 2px; }
.media-tile { position: relative; margin: 0; min-height: 148px; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: #000; color: #fff; }
.media-tile > img, .media-tile > video { width: 100%; height: 190px; object-fit: contain; }
.media-tile figcaption { padding: 4px 8px; font-size: .78rem; background: var(--surface); color: var(--muted); }
.media-order { position: absolute; top: 6px; left: 6px; min-width: 22px; height: 22px; border-radius: 11px; background: #000c; color: #fff; font-size: .78rem; font-weight: 700; line-height: 22px; text-align: center; }
.media-tools { position: absolute; top: 4px; right: 4px; display: flex; gap: 4px; }
.tile-btn { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: var(--r-sm); background: #000c; color: #fff; }
.tile-btn:hover { background: #000; }
textarea { resize: vertical; min-height: 130px; line-height: 1.45; }
.counters { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: .84rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.fold-note, .story-note { font-size: .88rem; }
.when-grid { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 20px; align-items: start; }
.when-side { display: grid; gap: 12px; min-width: 0; }
.time-input { max-width: 150px; }
.quick-times { display: flex; flex-wrap: wrap; gap: 6px; }
.mini { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.mini-head { display: flex; align-items: center; justify-content: space-between; }
.mini-head strong::first-letter { text-transform: uppercase; }
.mini-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.mini-weekday { text-align: center; font-size: .76rem; color: var(--muted); text-transform: capitalize; }
.mini-day { position: relative; aspect-ratio: 1; min-height: 36px; border: 0; border-radius: var(--r-sm); background: none; font-variant-numeric: tabular-nums; }
.mini-day:hover:not(:disabled) { background: var(--hover); }
.mini-day:disabled { color: var(--muted); opacity: .5; }
.mini-day.is-other:not([aria-pressed="true"]) { color: var(--muted); }
.mini-day.is-today { box-shadow: inset 0 0 0 1px var(--accent); }
.mini-day.has-posts::after { content: ""; position: absolute; left: 50%; bottom: 4px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; }
.mini-day[aria-pressed="true"], .mini-day[aria-pressed="true"]:hover:not(:disabled) { background: var(--primary); color: var(--on-primary); font-weight: 700; }
.day-posts-box { display: grid; gap: 6px; font-size: .9rem; }
.day-posts-box h3 { font-size: .86rem; font-weight: 500; color: var(--muted); }
.day-posts { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.day-posts li { display: flex; align-items: center; gap: 6px; min-width: 0; }

/* Vista previa de Instagram */
.preview { position: sticky; top: 16px; display: grid; gap: 10px; min-width: 0; }
.preview-body { display: grid; gap: 10px; justify-items: center; min-width: 0; }
.preview-note { font-size: .82rem; text-align: center; }
.ig-user { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: .86rem; }
.ig-vertical { position: relative; width: 100%; max-width: 300px; aspect-ratio: 9 / 16; overflow: hidden; border-radius: 14px; background: #101214; color: #fff; }
.ig-media { width: 100%; height: 100%; object-fit: cover; }
.ig-empty { display: grid; justify-items: center; align-content: center; gap: 8px; height: 100%; padding: 16px; text-align: center; font-size: .88rem; color: #b8bec5; }
.ig-post .ig-empty { color: var(--muted); }
.ig-overlay { position: absolute; inset: 0; pointer-events: none; }
.ig-progress { position: absolute; left: 8px; right: 8px; top: 8px; height: 2px; border-radius: 1px; background: rgb(255 255 255 / .85); }
.ig-user-over { position: absolute; left: 10px; right: 10px; top: 16px; text-shadow: 0 1px 3px #000; }
.ig-user-over span:not(.avatar) { opacity: .85; flex: none; }
.ig-reel-side { position: absolute; right: 10px; bottom: 64px; display: grid; gap: 14px; filter: drop-shadow(0 1px 2px #000); }
.ig-reel-info { position: absolute; left: 10px; right: 44px; bottom: 54px; display: grid; gap: 4px; text-shadow: 0 1px 3px #000; }
.ig-reel-caption { font-size: .84rem; overflow-wrap: anywhere; }
.ig-placeholder { opacity: .7; }
.ig-more { color: inherit; opacity: .7; }
.safe-zone { position: absolute; left: 0; right: 0; display: grid; place-items: center; padding: 4px; background: rgb(192 39 28 / .45); border: 1px dashed #fff; color: #fff; font-size: .76rem; font-weight: 600; text-align: center; text-shadow: 0 1px 2px #000; }
.safe-top { top: 0; height: 14%; place-items: end center; }
.safe-bottom { bottom: 0; height: 20%; }
.ig-post { width: 100%; max-width: 340px; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.ig-post > .ig-user { padding: 8px 10px; }
.ig-stage { position: relative; background: var(--soft); }
.ig-arrow { position: absolute; top: 50%; display: grid; place-items: center; width: 36px; height: 36px; margin-top: -18px; border: 0; border-radius: 50%; background: #000a; color: #fff; }
.ig-arrow:disabled { display: none; }
.ig-arrow-left { left: 6px; }
.ig-arrow-right { right: 6px; }
.ig-actions { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 10px; }
.ig-dots { position: absolute; left: 50%; transform: translateX(-50%); display: flex; gap: 3px; }
.ig-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.ig-dots i.on { background: var(--next); }
.ig-caption { padding: 0 10px 10px; font-size: .86rem; overflow-wrap: anywhere; white-space: pre-line; }

/* Login */
.login { max-width: 380px; margin: 0 auto; padding: 22vh 16px 0; display: grid; gap: 14px; }
.login p { color: var(--muted); }
.login .error { color: var(--bad); }
.login .btn { min-height: 48px; }

/* En el mes, la miniatura sólo si le deja lugar al texto. */
@media (max-width: 1600px) {
  .month .thumb-xs { display: none; }
}

/* Compu chica y tableta: la barra queda en íconos para no comerle ancho al calendario. */
@media (max-width: 1100px) {
  :root { --side: 72px; }
  .sidebar { padding-inline: 8px; align-items: stretch; }
  .sidebar .brand, .who, .sidebar .nav-label { display: none; }
  .btn-new { padding: 8px; }
  .nav-link { justify-content: center; padding: 8px; }
  .side-tools { flex-direction: column; }
  .sidebar .themes { flex-direction: column; }
  .composer-grid { grid-template-columns: minmax(0, 1fr) minmax(240px, 280px); }
  .when-grid { grid-template-columns: minmax(0, 1fr); }
  .mini { max-width: 340px; }
}
@media (max-width: 860px) {
  .composer-grid { grid-template-columns: minmax(0, 1fr); }
  .preview { position: static; }
  .detail { grid-template-columns: 180px minmax(0, 1fr); }
  .chip .thumb-xs { display: none; }
}

/* Celular: arriba la marca, abajo la navegación al alcance del pulgar. */
@media (max-width: 720px) {
  body { font-size: 15px; }
  h1 { font-size: 1.35rem; }
  .shell { display: block; }
  .sidebar { display: none; }
  .top-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 4px 8px 4px 8px; padding-top: calc(4px + env(safe-area-inset-top)); background: var(--surface); border-bottom: 1px solid var(--line); }
  .top-bar .side-tools { flex-direction: row; }
  .top-bar .themes { flex-direction: row; }
  .main { padding: 16px 16px calc(88px + env(safe-area-inset-bottom)); }
  .bottom-nav { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: center; gap: 2px; min-height: 64px; padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
  .nav-link-compact { display: grid; justify-items: center; gap: 2px; min-height: 52px; padding: 4px; font-size: .74rem; }
  .bottom-new { order: 4; display: grid; place-items: center; justify-self: center; width: 48px; height: 48px; border-radius: 50%; background: var(--primary); color: var(--on-primary); }
  body[data-view="nueva"] .bottom-nav, body[data-view="editar"] .bottom-nav { display: none; }
  body[data-view="nueva"] .main, body[data-view="editar"] .main { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .composer-actions { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 6px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
  .composer-actions .btn { min-height: 48px; padding: 6px; white-space: normal; line-height: 1.15; font-size: .86rem; }
  .composer-actions svg { display: none; }
  .page-head { flex-wrap: wrap; }
  .page-head p { display: none; }
  .toolbar { align-items: stretch; }
  .toolbar-title { flex: 1; text-align: center; }
  .post-row { gap: 10px; padding: 8px 10px; }
  .search { max-width: none; flex-basis: 100%; }
  .account-actions { margin-left: 0; width: 100%; }
  .account-actions .btn { flex: 1; }
  .btn-small { min-height: 44px; }
  .segment { min-height: 42px; }
  .theme-btn { width: 38px; height: 42px; }
  .search { min-height: 44px; }
  .search input { min-height: 42px; }
  .icon-btn { width: 44px; height: 44px; }
  .detail { grid-template-columns: minmax(0, 1fr); }
  .detail-media { width: 100%; max-width: 260px; margin: 0 auto; }
  .detail-actions .btn { flex: 1 1 45%; }
  .toasts { bottom: calc(76px + env(safe-area-inset-bottom)); right: 12px; width: calc(100vw - 24px); }
  .dropzone { min-height: 120px; }
  .mini { max-width: none; }
  .time-input { max-width: none; }
  .quick-times .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
