/* Astra Beta — tokens da Astra (public/app.css), só o modo claro (R5 da Manu: claro por padrão). */
@font-face { font-family: 'DM Sans'; font-weight: 400 700; font-display: swap; src: url(/fuentes/dm-sans-latin-b9df62.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: 'DM Sans'; font-weight: 400 700; font-display: swap; src: url(/fuentes/dm-sans-latin-ext-33d679.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Fraunces'; font-weight: 400 700; font-display: swap; src: url(/fuentes/fraunces-latin-63f165.woff2) format('woff2'); }

:root {
  color-scheme: light;
  --bg: #F8F7FD; --bg-2: #F1F0F9; --surface: #FFFFFF; --surface-2: #F4F3FA;
  --ink: #220B27; --ink-2: #4D3B51; --muted: #685E74; --line: #E3E1EC; --line-2: #D1CFDD;
  --brand: #6D49B5; --brand-hover: #5C389F; --brand-ink: #5E3CA0; --brand-soft: #F0ECFE; --brand-lilas: #C7B7FC; --brand-on: #FFFFFF;
  --ok: #136239; --ok-soft: #E1F7E7; --warn: #694413; --warn-soft: #FDF2DD; --err: #9E2C2C; --err-soft: #FFEEEC;
  --shadow-1: 0 1px 2px oklch(0.20 0.06 320 / .06);
  --shadow-2: 0 1px 2px oklch(0.20 0.06 320 / .05), 0 4px 10px oklch(0.20 0.06 320 / .06);
  --r-sm: 8px; --r: 12px; --r-lg: 16px;
  --f-ui: 'DM Sans', -apple-system, 'Segoe UI', sans-serif; --f-display: 'Fraunces', Georgia, serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.5 var(--f-ui); }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 600; letter-spacing: -.01em; margin: 0 0 .4em; line-height: 1.2; }
h1 { font-size: 30px; } h2 { font-size: 26px; } h3 { font-size: 20px; }
h3.sec { margin-top: 32px; }
a { color: var(--brand-ink); }
.saltar { position: absolute; left: -999px; } .saltar:focus { left: 16px; top: 8px; z-index: 50; background: var(--surface); padding: 8px 12px; border-radius: var(--r-sm); }
.oculto-accesible { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
:focus-visible { outline: 3px solid var(--brand-lilas); outline-offset: 2px; }

.sub { color: var(--ink-2); margin: 0 0 16px; }
.ayuda { color: var(--muted); font-size: 15px; margin: 6px 0 0; }
.opcional { color: var(--muted); font-weight: 400; }
.contador { color: var(--muted); font-size: 14px; margin: 4px 0 0; text-align: right; }
.contador.mal { color: var(--err); }
.error-campo { color: var(--err); font-size: 15px; margin: 6px 0 0; min-height: 0; }
.error-campo:empty { display: none; }
.pill { display: inline-block; background: var(--brand-soft); color: var(--brand-ink); font-size: 13px; font-weight: 600; padding: 2px 10px; border-radius: 999px; margin: 0; }

/* botões: alvo ≥ 44 px */
.btn { font: 600 16px/1 var(--f-ui); min-height: 48px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  transition: background .15s var(--ease), transform .1s var(--ease); display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; white-space: nowrap; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primario { background: var(--ink); color: #fff; }
.btn.primario:hover:not(:disabled) { background: #3D2143; }
.btn.secundario { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn.secundario:hover:not(:disabled) { background: var(--surface-2); }
.btn.marca { background: var(--brand); color: var(--brand-on); }
.btn.marca:hover:not(:disabled) { background: var(--brand-hover); }
.btn.texto { background: none; color: var(--brand-ink); padding: 0 12px; min-height: 44px; }
.btn.peligro { background: none; color: var(--err); border-color: var(--line-2); }
.btn.chico { min-height: 44px; font-size: 15px; padding: 0 16px; }

/* campos */
label { display: block; font-weight: 600; font-size: 15px; margin: 18px 0 6px; }
input:not([type=radio]):not([type=checkbox]):not([type=file]), textarea {
  width: 100%; font: 400 17px/1.4 var(--f-ui); color: var(--ink); background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r); padding: 12px 14px; min-height: 48px; }
textarea { resize: vertical; }
input:focus, textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 500; min-height: 44px; margin: 12px 0 0; }
label.check input { width: 22px; height: 22px; accent-color: var(--brand); }

/* login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login-caja { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 32px 24px; box-shadow: var(--shadow-2); }
.login-caja img { display: block; margin-bottom: 8px; }
.login-caja h1 { margin-top: 18px; }
.login-caja .btn.primario { width: 100%; margin-top: 18px; }
.login-caja .btn.texto { width: 100%; margin-top: 6px; }
#codigo { letter-spacing: .4em; font-size: 24px; text-align: center; }

/* barra e abas */
.barra { position: sticky; top: 0; z-index: 10; background: color-mix(in oklch, var(--bg) 92%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.barra-in { max-width: 880px; margin: 0 auto; padding: 10px 16px 0; display: flex; align-items: center; gap: 10px; }
.espacio { flex: 1; }
.quien { color: var(--muted); font-size: 14px; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs { max-width: 880px; margin: 0 auto; padding: 0 8px; display: flex; gap: 4px; }
.tabs a { flex: 1; text-align: center; padding: 12px 8px 10px; min-height: 44px; color: var(--ink-2); text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; }
.tabs a[aria-current=page] { color: var(--ink); border-bottom-color: var(--brand); }
.aviso-modo { max-width: 880px; margin: 12px auto 0; padding: 10px 16px; background: var(--warn-soft); color: var(--warn); border-radius: var(--r); font-size: 15px; width: calc(100% - 32px); }

main#principal { max-width: 880px; margin: 0 auto; padding: 24px 16px 96px; outline: none; }
.cabeza { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.cabeza h2 { margin: 0; }
.tarjeta { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-1); margin: 16px 0; }
.form h3 { margin-bottom: 4px; }
.acciones { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; align-items: center; }
.lista { display: grid; gap: 12px; margin-top: 16px; }

/* segmento */
.segmento { border: 0; padding: 0; margin: 16px 0 0; }
.segmento legend { font-weight: 600; font-size: 15px; margin-bottom: 6px; padding: 0; }
.segmento { display: flex; flex-wrap: wrap; gap: 6px; }
.segmento legend { width: 100%; }
.segmento label { margin: 0; flex: 1; min-width: 96px; }
.segmento input { position: absolute; opacity: 0; }
.segmento span { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r); font-weight: 600; cursor: pointer; background: var(--surface); }
.segmento input:checked + span { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); }
.segmento input:focus-visible + span { outline: 3px solid var(--brand-lilas); }

/* subida */
.soltar { margin-top: 16px; border: 2px dashed var(--line-2); border-radius: var(--r-lg); background: var(--surface-2); transition: border-color .15s; }
.soltar.encima { border-color: var(--brand); background: var(--brand-soft); }
.soltar-label { margin: 0; padding: 24px 16px; display: grid; gap: 4px; text-align: center; cursor: pointer; font-weight: 400; }
.soltar-label strong { font-size: 17px; color: var(--brand-ink); }
.soltar-label span { color: var(--muted); font-size: 15px; }
.archivos { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.archivos li { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: var(--r); }
.archivos .mini { width: 56px; height: 70px; border-radius: var(--r-sm); background: var(--bg-2); object-fit: cover; }
.archivos .nombre { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.archivos .meta { font-size: 13px; color: var(--muted); }
.barra-prog { height: 6px; background: var(--bg-2); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.barra-prog i { display: block; height: 100%; background: var(--brand); width: 0; transition: width .2s; }

/* post e regra */
.item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; display: grid; grid-template-columns: 72px 1fr; gap: 14px; }
.item .mini { width: 72px; height: 90px; border-radius: var(--r-sm); background: var(--bg-2); object-fit: cover; }
.item .cuerpo { min-width: 0; }
.item .linea { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.item .texto { margin: 6px 0 0; color: var(--ink-2); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item .acciones { margin-top: 10px; }
.item.regla { grid-template-columns: 1fr auto; }
.estado { font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--bg-2); color: var(--ink-2); }
.estado.borrador { background: var(--warn-soft); color: var(--warn); }
.estado.aprobado, .estado.procesando { background: var(--brand-soft); color: var(--brand-ink); }
.estado.publicado, .estado.enviado, .estado.activa { background: var(--ok-soft); color: var(--ok); }
.estado.error { background: var(--err-soft); color: var(--err); }
.error-post { color: var(--err); font-size: 15px; margin: 6px 0 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chip { font-size: 13px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink-2); }

/* interruptor */
.switch { position: relative; width: 52px; height: 32px; flex: none; margin: 6px 0; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line-2); transition: background .15s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid var(--brand-lilas); outline-offset: 2px; }

/* registro */
.registro .fila { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); font-size: 15px; }
.registro .fila .det { grid-column: 1 / -1; color: var(--muted); font-size: 14px; }
.vacio { text-align: center; color: var(--ink-2); padding: 28px 16px; border: 1px dashed var(--line-2); border-radius: var(--r-lg); }
.vacio .btn { margin-top: 12px; }

/* instagram */
.perfil { display: flex; gap: 14px; align-items: center; }
.perfil img, .perfil .avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--brand-soft); object-fit: cover; flex: none; }
.perfil strong { font-size: 19px; display: block; }
.checklist { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.checklist li::before { content: '✓'; color: var(--ok); font-weight: 700; width: 18px; flex: none; }
.checklist li.falta::before { content: '○'; color: var(--muted); }
code { font-size: 14px; background: var(--bg-2); padding: 1px 6px; border-radius: 6px; word-break: break-all; }
.resultado { margin: 12px 0 0; font-size: 15px; color: var(--ink-2); }
.resultado:empty { display: none; }
details.avanzado { margin-top: 16px; }
details.avanzado summary { cursor: pointer; color: var(--brand-ink); font-weight: 600; min-height: 44px; display: flex; align-items: center; }

/* esqueleto */
.esqueleto { height: 88px; border-radius: var(--r); background: linear-gradient(90deg, var(--bg-2), var(--surface-2), var(--bg-2)); background-size: 200% 100%; animation: brillo 1.2s infinite linear; }
@keyframes brillo { to { background-position: -200% 0; } }

/* toast */
.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; border-radius: var(--r); padding: 6px 6px 6px 16px; display: flex; align-items: center; gap: 8px; box-shadow: var(--shadow-2); z-index: 40; width: max-content; max-width: min(440px, calc(100% - 32px)); }
.toast .btn.texto { color: var(--brand-lilas); }

@media (max-width: 560px) {
  h2 { font-size: 23px; }
  .cabeza .btn.primario { width: 100%; }
  .item { grid-template-columns: 56px 1fr; }
  .item .mini { width: 56px; height: 70px; }
  .acciones .btn.primario { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
