/* ---------- Tejido design tokens (tokens.json of the Tejido design system) ---------- */
/* Fonts load from Google Fonts in the page head (shell.mjs); the stacks fall back to system fonts. */
:root {
  --font-display: 'Schibsted Grotesk', 'Atkinson Hyperlegible Next', system-ui, sans-serif;
  --font-sans: 'Atkinson Hyperlegible Next', system-ui, -apple-system, 'Segoe UI', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  --font-mono: 'Atkinson Hyperlegible Mono', ui-monospace, 'Cascadia Mono', monospace;

  /* Light theme: Niebla */
  --bg: #F3F4F7;
  --surface: #FFFFFF;
  --surface-2: #E9EBF1;
  --line: #D5D8E2;
  --line-strong: #7C8299;
  --ink: #171A2C;
  --ink-muted: #545A72;
  --anil: #27306F;
  --anil-soft: #E4E6F3;
  --brand: #E8A92A;
  --brand-strong: #D4951A;
  --brand-soft: #FBEFD3;
  --brand-text: #8A5A00;
  --on-brand: #171A2C;
  --focus: #27306F;
  --st-programada: #2F54C4;
  --st-programada-soft: #E6ECFB;
  --st-publicada: #1A6E4C;
  --st-publicada-soft: #E1F3EA;
  --st-borrador: #545A72;
  --st-borrador-soft: #E9EBF1;
  --st-error: #B42A1C;
  --st-error-soft: #FBE6E3;
  --hilo-1: #E8A92A;
  --hilo-2: #27306F;
  --hilo-3: #A83A5E;
  --hilo-4: #5E7F2E;
  --hilo-5: #7A5A3C;
  --hilo-6: #2D7F8F;
  --shadow-1: 0 1px 2px rgba(23, 26, 44, 0.08);
  --shadow-2: 0 8px 24px rgba(23, 26, 44, 0.14);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;

  --radius-xs: 3px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;
}
/* Dark theme: Noche. The «Cambiar modo oscuro» toggle sets html.dark; the sign-in showcase panel is always Noche. */
html.dark, .auth-panel {
  --bg: #12142A;
  --surface: #1A1D36;
  --surface-2: #232742;
  --line: #2F3452;
  --line-strong: #6E7596;
  --ink: #ECEDF5;
  --ink-muted: #A6ABC4;
  --anil: #9AA6F0;
  --anil-soft: #262B55;
  --brand: #E8A92A;
  --brand-strong: #F2BC4E;
  --brand-soft: #3A3018;
  --brand-text: #E8A92A;
  --on-brand: #171A2C;
  --focus: #E8A92A;
  --st-programada: #8FA8FF;
  --st-programada-soft: #1E2A57;
  --st-publicada: #5FD1A0;
  --st-publicada-soft: #143A2D;
  --st-borrador: #A6ABC4;
  --st-borrador-soft: #2A2E48;
  --st-error: #FF8A7A;
  --st-error-soft: #4A1E1C;
  --hilo-1: #E8A92A;
  --hilo-2: #9AA6F0;
  --hilo-3: #E58BA8;
  --hilo-4: #A9CC6E;
  --hilo-5: #C9A27C;
  --hilo-6: #7CC9D6;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, 0.5);
}
html.dark { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-sans); font-size: 15px; line-height: 22px; color: var(--ink); background: var(--bg); overflow-x: clip; -webkit-font-smoothing: antialiased; }
svg { display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
input, select, textarea { font: inherit; color: var(--ink); }
h1, h2, h3, h4, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
[hidden] { display: none !important; }
.muted { color: var(--ink-muted); }
.small { font-size: 13px; line-height: 18px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Buttons (Button) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); height: 36px; padding: 0 var(--space-4); font-size: 15px; line-height: 22px; font-weight: 700; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); white-space: nowrap; transition: background .14s, border-color .14s, color .14s; }
.btn:hover { background: var(--surface-2); }
.btn svg { flex: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.btn-outline { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-outline:hover { background: var(--surface-2); }
.btn-danger { background: var(--surface); border-color: var(--st-error); color: var(--st-error); }
.btn-danger:hover { background: var(--st-error-soft); }
.btn:disabled { opacity: 1; background: var(--surface-2); border-color: var(--line); color: var(--ink-muted); }
.btn-sm { height: 32px; padding: 0 var(--space-3); font-size: 13px; line-height: 18px; }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: var(--radius-sm); color: var(--ink-muted); transition: background .14s, color .14s; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.danger:hover { background: var(--st-error-soft); color: var(--st-error); }
.link-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--anil); font-weight: 700; font-size: 13px; }
.link { display: inline-flex; align-items: center; gap: var(--space-1); font-size: 13px; font-weight: 700; color: var(--anil); }

/* ---------- Logo (inline SVG bound to tokens) ---------- */
.logo { display: inline-flex; align-items: center; }
.logo svg { height: 28px; width: auto; }
.tj-weft { fill: var(--brand); }
.tj-warp { fill: var(--anil); }
.tj-word { fill: none; stroke: var(--ink); stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; }
.tj-knot { fill: var(--brand); }

/* ---------- App frame (AppSidebar) ---------- */
.app { background: var(--bg); }
.app-layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4) var(--space-3); background: var(--surface-2); border-right: 1px solid var(--line); z-index: 30; }
.side-top { padding: 0 var(--space-2) var(--space-2); }
.side-logo { display: inline-flex; height: 28px; }
.workspace { margin-top: 10px; font-size: 13px; font-weight: 700; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-wrap { margin-top: var(--space-4); }
/* BrandSwitcher */
.brand-switch { display: flex; align-items: center; gap: var(--space-3); width: 100%; height: 44px; padding: 0 var(--space-3); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); transition: background .14s; }
.brand-switch:hover, .brand-switch[aria-expanded='true'] { background: var(--surface); border-color: var(--anil); }
.brand-switch .workspace { margin-top: 0; min-width: 0; flex: 1; text-align: left; color: inherit; font: 600 15px/20px var(--font-display); }
.brand-switch .chev { flex: none; width: 16px; height: 16px; color: var(--ink-muted); transition: transform .14s; }
.brand-switch[aria-expanded='true'] .chev { transform: rotate(180deg); }
.brand-menu { top: 50px; left: 0; width: 100%; }
.brand-row { padding: var(--space-3) 0; border-top: 1px solid var(--line); }
.brand-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.brand-head .acc-info { flex: 1; min-width: 0; }
.brand-acc { display: flex; align-items: center; gap: var(--space-2); padding: 6px 0 0 4px; font-size: 15px; }
.brand-acc span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-acc select, .pick-row select { height: 32px; max-width: 45%; padding: 0 var(--space-2); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); font-size: 13px; }
.pick-row { justify-content: space-between; }
.pick-row label { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.modal .pick-row select { width: auto; height: 32px; }
.side-new { margin: var(--space-2) 0 var(--space-2); height: 44px; }
.side-nav { display: grid; gap: 2px; }
.side-link { display: flex; align-items: center; gap: var(--space-3); height: 36px; padding: 0 var(--space-3); border-radius: var(--radius-sm); font-size: 15px; font-weight: 400; color: var(--ink); transition: background .14s; }
.side-link > svg { color: var(--ink-muted); flex: none; }
.side-link:hover { background: var(--surface); }
.side-link.active, .side-link.current { background: var(--anil-soft); color: var(--anil); font-weight: 700; }
.side-link.active > svg, .side-link.current > svg { color: var(--anil); }
.side-link .both { display: flex; }
.side-link .both svg + svg { margin-left: -4px; }
.side-label { margin: var(--space-4) var(--space-3) var(--space-1); font: 700 11px/16px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.side-bottom { margin-top: auto; padding-top: var(--space-3); border-top: 1px solid var(--line); }
.scrim { display: none; }
.app-main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--space-3); height: 64px; padding: 0 var(--space-8); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar h1 { font: 700 28px/34px var(--font-display); letter-spacing: -0.01em; color: var(--ink); }
.burger { display: none; }
.net-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius-pill); font-size: 12px; font-weight: 700; background: var(--surface); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); }
.user-wrap { position: relative; }
.user-btn { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 var(--space-2); border-radius: var(--radius-sm); }
.user-btn:hover { background: var(--surface-2); }
.user-btn .chev { width: 14px; height: 14px; color: var(--ink-muted); }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--anil-soft); font-size: 15px; }
.user-text { display: grid; text-align: left; line-height: 1.2; }
.user-text b { font-size: 13px; }
.user-text small { font-size: 12px; color: var(--ink-muted); }
.user-menu { position: absolute; right: 0; top: 50px; width: 210px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-2); }
.user-menu a, .user-menu button { display: block; width: 100%; text-align: left; padding: 6px var(--space-2); border-radius: var(--radius-sm); font-size: 15px; }
.user-menu a:hover, .user-menu button:hover { background: var(--surface-2); }
.view { padding: var(--space-8); max-width: 1240px; width: 100%; outline: 0; }

/* ---------- Shared pieces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-6); }
.card + .card, section.card + p.hint, .card + .an-cols, .an-cols + .hint { margin-top: var(--space-4); }
.card h3 { display: flex; align-items: center; gap: var(--space-2); font: 600 17px/24px var(--font-display); color: var(--ink); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--surface-2); border: 1px solid var(--line); font: 400 12px/16px var(--font-mono); color: var(--ink-muted); }
.section-title { margin: var(--space-6) 0 10px; font: 700 11px/16px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.hint { margin: var(--space-3) 0; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.fine { margin-top: var(--space-3); font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.empty { display: grid; justify-items: center; gap: 14px; padding: 56px var(--space-5); text-align: center; font-size: 18px; line-height: 28px; color: var(--ink-muted); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); }
.empty.small { padding: 28px var(--space-3); border: 0; font-size: 15px; line-height: 22px; }
/* Tag: publication state, always icon + word */
.status { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px; border-radius: var(--radius-pill); font: 700 12px/16px var(--font-sans); white-space: nowrap; background: var(--st-borrador-soft); color: var(--st-borrador); }
.status svg { width: 12px; height: 12px; flex: none; }
.status-scheduled { background: var(--st-programada-soft); color: var(--st-programada); }
.status-published { background: var(--st-publicada-soft); color: var(--st-publicada); }
.status-draft { background: var(--st-borrador-soft); color: var(--st-borrador); }
.status-failed { background: var(--st-error-soft); color: var(--st-error); }
.st-ico { flex: none; }
.st-ico-scheduled { color: var(--st-programada); }
.st-ico-published { color: var(--st-publicada); }
.st-ico-draft { color: var(--st-borrador); }
.st-ico-failed { color: var(--st-error); }
.acc-badge { display: inline-grid; place-items: center; }
.seg-tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: var(--radius-md); background: var(--surface-2); border: 1px solid var(--line); }
.seg-tabs button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; color: var(--ink-muted); }
.seg-tabs button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.seg-tabs.small button { height: 28px; padding: 0 10px; font-size: 12px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-2); }
.toolbar-right { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.toolbar select, .toolbar input[type='search'] { height: 40px; padding: 0 var(--space-3); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); font-size: 15px; }
.legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.legend .st-ico { width: 12px; height: 12px; margin-left: var(--space-2); }
.lg { width: 10px; height: 10px; border-radius: var(--radius-xs); margin-left: var(--space-2); }
.lg.fb { background: var(--hilo-2); } .lg.ig { background: var(--hilo-3); }

/* KPIs */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); margin-bottom: var(--space-4); }
.kpi { padding: var(--space-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); }
.kpi small { display: block; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.kpi b { display: block; margin: var(--space-1) 0 6px; font: 700 26px/32px var(--font-mono); color: var(--ink); }
.delta { display: inline-block; font-style: normal; font: 700 12px/16px var(--font-mono); padding: 2px var(--space-2); border-radius: var(--radius-pill); }
.delta.up { background: var(--st-publicada-soft); color: var(--st-publicada); }
.delta.down { background: var(--st-error-soft); color: var(--st-error); }
.delta.flat { background: var(--surface-2); color: var(--ink-muted); }

/* Dashboard */
.dash-hello { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.dash-hello h2 { display: flex; align-items: center; gap: 10px; font: 700 28px/34px var(--font-display); letter-spacing: -0.01em; color: var(--ink); }
.dash-hello p { font-size: 18px; line-height: 28px; color: var(--ink-muted); }
.dash-cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--space-4); align-items: start; }
.dash-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); min-width: 0; }
.dash-side .card + .card { margin-top: 0; }
.best h3 svg { flex: none; }
.best-when { margin: 10px 0 var(--space-1); font: 700 20px/28px var(--font-mono); color: var(--anil); }
.best .btn { margin-top: var(--space-3); }
.draft-link { min-width: 0; display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) 0; border-top: 1px solid var(--line); font-size: 13px; }
.draft-link span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.acc-line { display: flex; align-items: center; gap: 10px; padding: var(--space-2) 0; border-top: 1px solid var(--line); }
.acc-line span, .acc-info { display: grid; line-height: 1.25; }
.acc-line b, .acc-info b { font-size: 15px; }
.acc-line small, .acc-info small { font-size: 13px; color: var(--ink-muted); }

/* Post rows (PostCard in the queue) */
.post-row { display: grid; grid-template-columns: 86px 72px minmax(0, 1fr) auto; gap: var(--space-4); align-items: center; padding: var(--space-4) 0; border-top: 1px solid var(--line); }
.card-head + .post-row, .card.list .post-row:first-child { border-top: 0; }
.card.list { padding: var(--space-1) var(--space-6); border-radius: var(--radius-md); }
.card.list .post-row { transition: box-shadow .14s; }
.pr-when { display: grid; line-height: 1.25; font-family: var(--font-mono); }
.pr-when b { font-size: 15px; color: var(--ink); }
.pr-when small { font-size: 12px; color: var(--ink-muted); }
.pr-thumb { width: 72px; height: 72px; display: grid; place-items: center; overflow: hidden; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink-muted); }
.pr-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pr-thumb .fmt-ico { font: 700 10px/1 var(--font-mono); color: var(--ink-muted); text-transform: uppercase; }
.app-foot { display: flex; flex-wrap: wrap; gap: var(--space-4); justify-content: space-between; margin-top: auto; padding: 18px var(--space-8); border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-muted); }
.app-foot nav { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.app-foot a:hover { color: var(--anil); }
.pr-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.fmt { font: 400 12px/16px var(--font-mono); color: var(--ink-muted); }
.pr-caption { margin-top: var(--space-2); font-size: 15px; line-height: 22px; color: var(--ink); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pr-stats { margin-top: var(--space-1); font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.pr-actions { display: flex; align-items: center; gap: 6px; }
.day-group .section-title { margin-top: 18px; }

/* ---------- Composer (Field, AccountChip) ---------- */
.compose { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--space-6); align-items: start; }
.compose-form { display: grid; gap: var(--space-6); padding: var(--space-6); }
.field { display: grid; gap: 6px; }
.field-label { font-size: 13px; line-height: 18px; font-weight: 700; color: var(--ink); }
.field-label small { font-weight: 400; color: var(--ink-muted); margin-left: 6px; }
.field-row { display: flex; align-items: center; justify-content: space-between; }
.compose input[type='text'], .compose input[type='datetime-local'], .compose textarea, .modal input[type='text'] { width: 100%; min-height: 40px; padding: var(--space-2) var(--space-3); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font-size: 15px; line-height: 22px; background: var(--surface); }
.compose input[type='datetime-local'] { font-family: var(--font-mono); }
.compose textarea { resize: vertical; min-height: 140px; }
.compose input::placeholder, .compose textarea::placeholder, .modal input::placeholder { color: var(--ink-muted); }
.acc-picks { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.acc-pick { position: relative; display: flex; align-items: center; gap: var(--space-2); padding: 6px var(--space-3) 6px var(--space-2); border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; background: var(--surface); }
.acc-pick input { position: absolute; opacity: 0; }
.acc-pick span { display: grid; line-height: 1.2; }
.acc-pick b { font-size: 13px; }
.acc-pick small { font-size: 12px; color: var(--ink-muted); }
.acc-pick.on { border-color: var(--anil); box-shadow: inset 0 0 0 1px var(--anil); }
.acc-pick:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.media-row { display: flex; flex-wrap: wrap; gap: 10px; }
.media-item { position: relative; }
.thumb { width: 88px; height: 88px; display: grid; place-items: center; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-muted); }
.thumb-video { gap: 2px; padding: var(--space-1); text-align: center; }
.thumb-video small { font-size: 9px; overflow: hidden; max-width: 80px; white-space: nowrap; text-overflow: ellipsis; }
.media-x { position: absolute; right: -6px; top: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--surface); font-size: 11px; }
.media-add { width: 88px; height: 88px; display: grid; place-items: center; align-content: center; gap: var(--space-1); padding: 6px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius-sm); color: var(--ink-muted); font-size: 12px; line-height: 16px; text-align: center; cursor: pointer; }
.media-add:hover { border-color: var(--anil); color: var(--anil); }
.counter { display: flex; justify-content: flex-end; gap: 14px; font: 400 13px/18px var(--font-mono); color: var(--ink-muted); }
.counter .over, .counter.over > span:first-child { color: var(--st-error); font-weight: 700; }
.swatches { display: flex; gap: 10px; }
.swatch { width: 32px; height: 32px; border-radius: var(--radius-sm); }
.swatch.none { display: grid; place-items: center; border: 1px solid var(--line-strong); color: var(--ink-muted); }
.swatch.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--focus); }
.thread { display: grid; gap: var(--space-2); }
.thread-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) 36px; align-items: center; gap: var(--space-2); }
.thread-row b { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--anil); color: var(--surface); font: 700 11px/1 var(--font-mono); }
.thread + .btn { justify-self: start; }
.when-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.when-row input { flex: 1; min-width: 200px; }
.errors { display: grid; gap: var(--space-1); padding: var(--space-3) 14px; border-radius: var(--radius-sm); background: var(--st-error-soft); border: 1px solid var(--st-error); color: var(--st-error); font-size: 13px; line-height: 18px; }
.errors li::before { content: '• '; }
.compose-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding-top: var(--space-4); border-top: 1px solid var(--line); }
.preview { position: sticky; top: 84px; padding: 18px; }
.preview-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: 14px; }
/* The preview imitates Facebook and Instagram, so it keeps their neutral colors in both themes. */
.pv { border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; background: #fff; color: #050505; }
.pv-head { display: flex; align-items: center; gap: 10px; padding: var(--space-3); }
.pv-head span:last-child { display: grid; line-height: 1.2; }
.pv-head b { font-size: 14px; }
.pv-head small { font-size: 11px; color: #65676b; }
.pv-av { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: #f0f2f5; }
.pv-av.ig { background: linear-gradient(135deg, #feda75, #d62976, #4f5bd5); padding: 2px; }
.pv-av.ig svg { background: #fff; border-radius: 50%; width: 30px; height: 30px; padding: 5px; }
.pv-text { padding: 0 var(--space-3) 10px; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.pv-first { color: #65676b; font-size: 13px; }
.pv-bg { display: grid; place-items: center; min-height: 220px; padding: var(--space-6); color: #fff; font-size: 24px; font-weight: 700; text-align: center; white-space: pre-wrap; word-break: break-word; }
.pv-media { display: grid; gap: 2px; }
.pv-media.multi { grid-template-columns: 1fr 1fr; }
.pv-img { width: 100%; height: 100%; max-height: 360px; object-fit: cover; display: block; }
.pv-media .thumb-video, .pv-square .thumb-video { min-height: 220px; display: grid; place-items: center; background: #18191a; color: #fff; }
.pv-square { position: relative; aspect-ratio: 1; display: grid; place-items: center; background: #f0f2f5; overflow: hidden; font-size: 13px; }
.pv-ig.vertical .pv-square { aspect-ratio: 9 / 14; }
.pv-square .pv-img { max-height: none; height: 100%; }
.pv-count { position: absolute; right: 10px; top: 10px; padding: 2px var(--space-2); border-radius: var(--radius-pill); background: rgba(0,0,0,.6); color: #fff; font-size: 11px; }
.pv-actions { display: flex; justify-content: space-around; padding: var(--space-2) var(--space-3); border-top: 1px solid #e4e6eb; font-size: 13px; font-weight: 600; color: #65676b; }
.pv-actions.ig { justify-content: flex-start; gap: var(--space-4); border-top: 0; font-size: 18px; }
.pv-actions.ig .save { margin-left: auto; }
.pv-comments { padding: var(--space-2) var(--space-3) var(--space-3); display: grid; gap: 6px; background: #f7f8fa; }
.pv-comments p { padding: 6px 10px; border-radius: 14px; background: #f0f2f5; font-size: 13px; }
.ideas { display: grid; gap: 10px; margin-top: 14px; }
.idea { display: grid; gap: var(--space-2); justify-items: start; padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-md); }
.idea pre { margin: 0; white-space: pre-wrap; font: 15px/22px var(--font-sans); }

/* ---------- Calendar (CalendarDay: the loom) ---------- */
.cal-nav { display: flex; align-items: center; gap: var(--space-2); }
.cal-nav h2 { min-width: 180px; text-align: center; font: 600 21px/28px var(--font-display); }
.cal { padding: 0; overflow: hidden; border-radius: var(--radius-md); }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head span { padding: 10px; font: 700 11px/16px var(--font-mono); color: var(--ink-muted); text-transform: uppercase; letter-spacing: .08em; border-bottom: 1px solid var(--line); }
.cal-cell { min-height: 132px; padding: var(--space-2) var(--space-2) var(--space-3); background: var(--surface); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: var(--space-1); transition: background .14s; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.other { background: var(--surface-2); }
.cal-cell.other .cal-day span { color: var(--ink-muted); }
.cal-cell.today { background: var(--anil-soft); }
.cal-cell.drop { background: var(--brand-soft); box-shadow: inset 0 0 0 2px var(--brand); }
.cal-day { display: flex; justify-content: space-between; align-items: center; padding: 2px var(--space-1) var(--space-1); font: 700 13px/18px var(--font-mono); color: var(--ink); }
.cal-cell.today .cal-day span { display: grid; place-items: center; min-width: 24px; height: 24px; border-radius: var(--radius-pill); background: var(--anil); color: var(--surface); }
.cal-add { width: 22px; height: 22px; display: grid; place-items: center; border-radius: var(--radius-sm); color: var(--ink-muted); opacity: 0; font-size: 16px; }
.cal-cell:hover .cal-add, .cal-add:focus { opacity: 1; background: var(--surface-2); }
.cal-chip { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 3px 6px; border-radius: var(--radius-xs); font-size: 12px; line-height: 16px; background: var(--bg); color: var(--ink); cursor: pointer; }
.cal-chip.published { cursor: default; }
.cal-chip span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal-chip b { flex: none; font: 400 12px/16px var(--font-mono); color: var(--ink-muted); }
.cal-chip .st-ico { width: 12px; height: 12px; }
.cal-more { font-size: 12px; line-height: 16px; font-weight: 700; color: var(--anil); padding-left: var(--space-1); }

/* ---------- Analytics ---------- */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 220px; padding-top: 10px; border-bottom: 1px solid var(--line); background: linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 55px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.bar i { display: block; width: 100%; min-height: 0; }
.bar .fb { background: var(--hilo-2); border-radius: 0; }
.bar .ig { background: var(--hilo-3); border-radius: var(--radius-xs) var(--radius-xs) 0 0; }
.bars-axis { display: flex; justify-content: space-between; margin-top: 6px; font: 400 12px/16px var(--font-mono); color: var(--ink-muted); }
.an-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-4); }
.an-cols .card + .card { margin-top: 0; }
.heat-grid { display: grid; grid-template-columns: 70px repeat(7, minmax(0, 1fr)); gap: var(--space-1); align-items: center; }
.heat-grid b { text-align: center; font: 700 11px/16px var(--font-mono); color: var(--ink-muted); }
.heat-grid small { font: 400 12px/16px var(--font-mono); color: var(--ink-muted); }
.heat-grid i { height: 26px; border-radius: var(--radius-xs); background: color-mix(in srgb, var(--anil) calc(var(--v) * 100%), var(--surface-2)); }
.top-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.top-table th { text-align: left; font: 700 11px/16px var(--font-mono); color: var(--ink-muted); text-transform: uppercase; letter-spacing: .08em; padding: 6px var(--space-1); }
.top-table td { padding: var(--space-2) var(--space-1); border-top: 1px solid var(--line); }
.top-table td + td { font-family: var(--font-mono); }
.top-table td:first-child { display: flex; align-items: center; gap: 6px; }
.top-table td:first-child span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 260px; }
.an-cols + .card { margin-top: var(--space-4); }
.an-table-wrap { overflow-x: auto; margin: 0 calc(-1 * var(--space-1)); }
.an-table { width: 100%; min-width: 860px; border-collapse: collapse; font-size: 13px; }
.an-table th { text-align: right; padding: 0 var(--space-1) 6px; white-space: nowrap; }
.an-table th:first-child { text-align: left; }
.an-table th button { padding: 2px 0; background: none; border: 0; cursor: pointer; font: 700 11px/16px var(--font-mono); color: var(--ink-muted); text-transform: uppercase; letter-spacing: .08em; }
.an-table th button:hover, .an-table th button.on { color: var(--ink); }
.an-table th button.on::after { content: ' ↓'; }
.an-table td { padding: var(--space-2) var(--space-1); border-top: 1px solid var(--line); text-align: right; font-family: var(--font-mono); white-space: nowrap; }
.an-table td:first-child { text-align: left; font-family: inherit; white-space: normal; width: 40%; }
.an-post { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.an-post > div { display: grid; gap: 2px; min-width: 0; }
.an-post a, .an-post > div > span { color: var(--ink); text-decoration: none; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.an-post a:hover { text-decoration: underline; }
.an-post small { display: flex; align-items: center; gap: 4px; color: var(--ink-muted); font-size: 12px; }
.an-thumb { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); color: var(--ink-muted); }
.an-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Accounts and settings ---------- */
.acc-row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-top: 1px solid var(--line); }
.acc-av { width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.acc-info { flex: 1; min-width: 0; }
.btn-line { display: flex; flex-wrap: wrap; gap: 10px; margin-top: var(--space-3); }
.view[data-view='settings'] .card h3 { margin-bottom: var(--space-3); }
.view[data-view='settings'] .card p { margin-bottom: var(--space-3); }
#ws-name { flex: 1; min-width: 200px; height: 40px; padding: 0 var(--space-3); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); }

/* ---------- Modal and toast ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: var(--space-5); background: rgba(18, 20, 42, .5); }
.modal { width: 460px; max-width: 100%; max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); }
.modal-wide { width: 620px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px var(--space-6); border-bottom: 1px solid var(--line); }
.modal-head h2 { font: 600 21px/28px var(--font-display); }
.modal-body { display: grid; gap: 10px; padding: var(--space-6); }
.modal-body .seg-tabs { justify-self: start; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 14px var(--space-6); border-top: 1px solid var(--line); }
.err-text { color: var(--st-error); font-size: 13px; line-height: 18px; }
.toast-root { position: fixed; left: 50%; bottom: var(--space-6); transform: translateX(-50%); z-index: 90; display: grid; gap: var(--space-2); justify-items: center; }
.toast { padding: 10px var(--space-4); border-radius: var(--radius-md); background: var(--ink); color: var(--bg); font-size: 15px; box-shadow: var(--shadow-2); transition: opacity .3s, transform .3s; }
.toast-err { background: var(--st-error-soft); color: var(--st-error); border: 1px solid var(--st-error); }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- Auth extras ---------- */
.af-error { margin-top: var(--space-4); padding: 10px var(--space-3); border-radius: var(--radius-sm); background: var(--st-error-soft); border: 1px solid var(--st-error); color: var(--st-error); font-size: 13px; }
.af-note { margin-top: 28px; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.ap-slides { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); }


/* Top bar menus (and the BrandSwitcher menu) */
.menu-wrap { position: relative; }
.tb-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border-radius: var(--radius-sm); font-size: 15px; font-weight: 400; color: var(--ink); transition: background .14s; }
.tb-btn:hover, .tb-btn[aria-expanded='true'] { background: var(--surface-2); }
.tb-btn .chev { width: 14px; height: 14px; color: var(--ink-muted); transition: transform .14s; }
.tb-btn[aria-expanded='true'] .chev { transform: rotate(180deg); }
.tb-btn .both, .tb-menu .both { display: flex; }
.tb-btn .both svg + svg, .tb-menu .both svg + svg { margin-left: -4px; }
.tb-menu { position: absolute; left: 0; top: 44px; z-index: 40; width: 240px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-2); }
.tb-menu.right { left: auto; right: 0; width: 290px; }
.tb-menu.narrow { width: 170px; }
.tb-label { padding: 6px var(--space-2) var(--space-1); font: 700 11px/16px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.tb-menu a, .tb-menu button { display: flex; align-items: center; gap: var(--space-3); width: 100%; padding: 6px var(--space-2); border-radius: var(--radius-sm); font-size: 15px; font-weight: 400; color: var(--ink); text-align: left; }
.tb-menu a:hover, .tb-menu button:hover { background: var(--surface-2); }
.tb-menu a.on { color: var(--anil); background: var(--anil-soft); }
.tb-menu a b { display: block; font-size: 15px; font-weight: 700; }
.tb-menu a small { display: block; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.tb-menu a:has(small) { display: block; }
.tb-sep { margin-top: 6px; border-top: 1px solid var(--line); color: var(--anil); font-weight: 700; }
.tb-menu .tb-sep { color: var(--anil); font-weight: 700; border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.btn-line.tight { margin-top: 0; }
.tb-menu.up { top: auto; bottom: 44px; }
.app-foot { align-items: center; }
.app-foot .tb-btn { font-size: 13px; height: 32px; color: var(--ink-muted); }
.check-row { display: flex; align-items: center; gap: 10px; padding: var(--space-2) 0; border-top: 1px solid var(--line); font-size: 15px; }
.dash-cols.no-main { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1100px) { .tb-wide { display: none; } }
@media (max-width: 640px) { .tb-btn > span:not(.both) { display: none; } .topbar { gap: 6px; } .topbar .tb-menu { left: -60px; } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .compose { grid-template-columns: minmax(0, 1fr); }
  .preview { position: static; }
  .dash-cols { grid-template-columns: minmax(0, 1fr); }
  .dash-side { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}
@media (max-width: 900px) {
  .app-layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-2); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(18, 20, 42, .4); }
  .burger { display: inline-grid; }
  .topbar { padding: 0 var(--space-4); }
  .topbar h1 { font-size: 21px; line-height: 28px; }
  .view { padding: var(--space-5) var(--space-4); }
  .app-foot { padding: var(--space-4); }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .an-cols { grid-template-columns: minmax(0, 1fr); }
  .an-cols .card + .card { margin-top: 0; }
  .user-text { display: none; }
}
@media (max-width: 640px) {
  .topbar h1 { font-size: 17px; line-height: 24px; }
  .net-chip { display: none; }
  .dash-hello { flex-direction: column; align-items: flex-start; }
  .post-row { grid-template-columns: 64px minmax(0, 1fr); }
  .pr-thumb { display: none; }
  .pr-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .toolbar-right { width: 100%; }
  .toolbar-right input[type='search'] { flex: 1; min-width: 0; }
  .cal-head span { padding: var(--space-2) 2px; text-align: center; font-size: 10px; }
  .cal-cell { min-height: 74px; padding: 3px; }
  .cal-chip span, .cal-chip .acc-badge { display: none; }
  .cal-chip { padding: 2px 3px; font-size: 9px; gap: 3px; }
  .cal-chip b { font-size: 9px; }
  .cal-nav h2 { min-width: 0; font-size: 17px; }
  .legend { display: none; }
  .compose-form { padding: var(--space-4); }
  .compose-actions .btn { flex: 1; }
  .heat-grid { grid-template-columns: 54px repeat(7, minmax(0, 1fr)); }
  .top-table td:first-child span { max-width: 140px; }
}

/* ---------- Auth pages: bg with the loom pattern, the form on a surface card ---------- */
.auth { background: var(--bg); color: var(--ink); }
.auth::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: url('/assets/brand/trama-telar.svg') 0 0 / 144px 72px repeat; }
html.dark .auth::before { opacity: .12; }
.auth .cookie-banner { right: 40px; }
.auth-wrap { display: grid; grid-template-columns: 720px minmax(0, 1fr); min-height: 100vh; }
.auth-form-col { display: flex; justify-content: center; align-items: center; padding: 40px var(--space-6); }
.auth-up .auth-form-col { align-items: flex-start; padding-top: 45px; }
.auth-form { width: 448px; max-width: 100%; padding: var(--space-8); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.auth-logo { display: inline-flex; }
.auth-logo .logo svg { height: 32px; }
.auth h1 { margin-top: var(--space-8); font: 700 28px/34px var(--font-display); letter-spacing: -0.01em; color: var(--ink); }
.auth-up h1 { margin-top: var(--space-8); }
.af-sub { margin-top: var(--space-1); font-size: 15px; color: var(--ink-muted); }
.af-sub a { color: var(--anil); font-weight: 700; }
.af-label { display: block; margin-top: var(--space-6); font-size: 13px; line-height: 18px; font-weight: 700; color: var(--ink); }
.auth-up .af-label { margin-top: var(--space-5); }
.auth-up .af-or + form .af-label:first-child { margin-top: var(--space-6); }
.af-input { position: relative; margin-top: 6px; }
.af-input input { width: 100%; height: 44px; padding: 0 var(--space-3); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); font-size: 16px; color: var(--ink); }
.af-input input::placeholder { color: var(--ink-muted); }
.has-eye input { padding-right: 44px; }
.af-eye { position: absolute; right: var(--space-3); top: 12px; color: var(--ink-muted); }
.af-row { display: flex; justify-content: space-between; align-items: center; margin-top: var(--space-6); font-size: 15px; }
.af-row a { color: var(--anil); font-weight: 700; }
.af-check { display: inline-flex; align-items: center; gap: var(--space-2); font-size: 15px; color: var(--ink); }
.af-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--anil); }
.af-check a { color: var(--anil); font-weight: 700; }
.af-terms { margin-top: var(--space-5); }
.af-submit { width: 100%; height: 44px; margin-top: var(--space-6); padding: 0 var(--space-5); border: 1px solid var(--brand); border-radius: var(--radius-sm); background: var(--brand); color: var(--on-brand); font: 700 16px/22px var(--font-sans); cursor: pointer; transition: background .14s; }
.af-submit:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.af-or { position: relative; height: 1px; margin: var(--space-8) 0; background: var(--line); }
.af-or span { position: absolute; left: 50%; top: -9px; transform: translateX(-50%); padding: 0 var(--space-4); background: var(--surface); font-size: 12px; color: var(--ink-muted); }
.auth-up .af-or { margin: var(--space-8) 0 0; }
.af-google { display: flex; align-items: center; justify-content: center; gap: var(--space-2); height: 44px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); font-size: 15px; font-weight: 700; color: var(--ink); }
.auth-up .af-google { margin-top: var(--space-8); }
.af-rules { display: grid; grid-template-columns: 198px 1fr; gap: var(--space-1) 0; margin-top: 14px; }
.af-rules li { display: flex; align-items: center; gap: 6px; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.af-rules li::before { content: '×'; width: 13px; height: 13px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; font-size: 10px; line-height: 1; }
.af-rules li.ok { color: var(--st-publicada); }
.af-rules li.ok::before { content: '✓'; border-color: var(--st-publicada); }
.af-trust { margin-top: var(--space-8); padding: 18px var(--space-4) var(--space-2); border: 1px solid var(--line); border-radius: var(--radius-md); display: grid; gap: 14px; }
.af-trust > div { position: relative; display: flex; gap: 14px; }
.af-trust > div > span { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: var(--radius-sm); background: var(--anil-soft); }
.af-trust p { font-size: 13px; line-height: 20px; color: var(--ink-muted); }
.af-trust b { display: block; font-size: 15px; font-weight: 700; color: var(--ink); }
.gdpr { position: absolute; right: 0; top: 0; display: flex; flex-direction: column; align-items: center; padding: 2px 6px; border: 1px solid var(--line-strong); border-radius: var(--radius-xs); font-style: normal; font-size: 10px; font-weight: 700; line-height: 1.1; }
.gdpr small { font-size: 6px; font-weight: 400; }
/* Showcase panel: a flat Noche surface (dark tokens are scoped to .auth-panel above). */
.auth-panel { position: relative; margin: 18px 18px 18px 0; border-radius: var(--radius-lg); overflow: hidden; background: var(--bg); color: var(--ink); min-height: 864px; }
.ap-grid { display: none; }
/* Icons are placed around the centered slide: offsets from the panel's center (design panel 720×864), so they
   never land on the text when the panel is wider or taller than the design. */
.auth-panel { container-type: inline-size; }
.ap-icon { position: absolute; left: calc(50% + clamp(8px - 50cqw, var(--x), 50cqw - 64px)); top: calc(50% + var(--y)); width: 56px; height: 56px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); }
.fi-1 { --x: -23px; --y: -397px; } .fi-2 { --x: 117px; --y: -353px; } .fi-3 { --x: -163px; --y: -354px; } .fi-4 { --x: 216px; --y: -233px; }
.fi-5 { --x: -276px; --y: -242px; } .fi-6 { --x: 279px; --y: -78px; } .fi-7 { --x: -318px; --y: -78px; } .fi-8 { --x: 250px; --y: 95px; }
/* Narrow panels have no room beside the text for the side icons. */
@media (max-width: 1279px) { .fi-6, .fi-7, .fi-8 { display: none; } }
.auth-in .ap-slides, .auth-up .ap-slides { top: 50%; transform: translateY(-50%); }
.ap-slide { display: none; flex-direction: column; align-items: center; text-align: center; padding: 0 var(--space-12); }
.ap-slide.active { display: flex; }
.ap-logo .logo svg { height: 40px; }
.ap-slide h2 { max-width: 400px; margin-top: var(--space-8); font: 700 40px/46px var(--font-display); letter-spacing: -0.015em; color: var(--ink); }
.ap-slide p { max-width: 400px; margin-top: var(--space-5); font-size: 18px; line-height: 28px; color: var(--ink-muted); }
.ap-dots { position: absolute; left: 0; right: 0; bottom: 22px; display: flex; justify-content: center; gap: var(--space-2); }
.ap-dots button { width: 8px; height: 8px; border-radius: var(--radius-pill); background: var(--line-strong); }
.ap-dots button.on { width: 22px; background: var(--brand); }
@media (max-width: 1023px) {
  .auth-wrap { grid-template-columns: minmax(0, 1fr); }
  .auth-panel { display: none; }
  .auth-in .auth-form-col { align-items: flex-start; padding-top: 120px; }
}
@media (max-width: 767px) {
  .auth-form-col { padding: 45px var(--space-4); }
  .auth-in .auth-form-col { padding-top: 80px; }
  .auth-form { padding: var(--space-6) var(--space-4); }
  .af-rules { grid-template-columns: 1fr 1fr; }
}

/* Notices, real-account markers, guides and the AI section */
.notice { margin: 14px 0 var(--space-1); padding: var(--space-3) 14px; border-radius: var(--radius-md); background: var(--anil-soft); border: 1px solid var(--line); color: var(--ink); font-size: 15px; }
.notice a { color: var(--anil); font-weight: 700; margin-left: var(--space-1); }
.notice.warn { background: var(--brand-soft); border-color: var(--brand); color: var(--ink); }
.real-dot { font-style: normal; font: 700 11px/16px var(--font-mono); text-transform: uppercase; letter-spacing: .08em; padding: 2px 6px; border-radius: var(--radius-pill); background: var(--st-publicada-soft); color: var(--st-publicada); margin-left: auto; }
.acc-pick .real-dot { margin-left: 6px; }
.media-item .media-url { position: absolute; left: var(--space-1); bottom: var(--space-1); padding: 1px 5px; border-radius: var(--radius-xs); background: var(--ink); color: var(--surface); font: 700 9px/14px var(--font-mono); }
button.media-add { font: inherit; font-size: 12px; line-height: 16px; background: none; }
.pr-delivery { margin-top: var(--space-1); font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.guide { list-style: decimal; display: grid; gap: 10px; margin: var(--space-3) 0 var(--space-4) var(--space-5); font-size: 15px; color: var(--ink); }
.guide code, .code { font-family: var(--font-mono); font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1px 5px; }
.code { display: block; white-space: pre; overflow-x: auto; padding: var(--space-3); margin: var(--space-2) 0; }
.form-grid { display: grid; gap: var(--space-2); max-width: 420px; }
.form-grid input, .modal select, .modal input[type='text'] { width: 100%; height: 40px; padding: 0 var(--space-3); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); font-size: 15px; }
.connect-card h3 svg + svg { margin-left: -6px; }
.ai-hero { background: var(--anil-soft); }
.ai-hero p { margin-top: var(--space-2); }
.tool-list { display: grid; gap: var(--space-2); margin-top: 10px; font-size: 15px; }
.check-row small { margin-left: var(--space-1); }

/* ---------- Public pages (about, privacy, terms, data deletion) ---------- */
.pub { display: flex; flex-direction: column; min-height: 100vh; }
.pub::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: url('/assets/brand/trama-telar.svg') 0 0 / 144px 72px repeat; }
html.dark .pub::before { opacity: .12; }
.pub-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-4) var(--space-8); border-bottom: 1px solid var(--line); background: var(--surface); }
.pub-logo { display: inline-flex; }
.pub-actions { display: flex; align-items: center; gap: var(--space-2); }
.pub-main { flex: 1; padding: var(--space-12) var(--space-6); }
.pub-doc { max-width: 65ch; margin: 0 auto; padding: var(--space-8); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.pub-doc h1 { font: 700 32px/38px var(--font-display); letter-spacing: -0.01em; }
.pub-lead { margin-top: var(--space-3); font-size: 17px; line-height: 26px; color: var(--ink-muted); }
.pub-updated { margin-top: var(--space-4); font-size: 13px; color: var(--ink-muted); }
.pub-doc h2 { margin-top: var(--space-8); font: 700 20px/26px var(--font-display); }
.pub-doc h3 { margin-top: var(--space-6); font: 700 17px/24px var(--font-display); }
.pub-doc p { margin-top: var(--space-3); line-height: 24px; }
.pub-doc ul { margin-top: var(--space-3); padding-left: var(--space-6); list-style: disc; }
.pub-doc li { margin-top: var(--space-2); line-height: 24px; }
.pub-doc li::marker { color: var(--brand-strong); }
.pub-doc a { color: var(--anil); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.pub-doc code { font-family: var(--font-mono); font-size: 14px; padding: 1px var(--space-1); background: var(--anil-soft); border-radius: var(--radius-xs); }
.pub-facts { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-4); margin: var(--space-3) 0 0; padding: var(--space-4); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-md); }
.pub-facts dt { font-weight: 700; color: var(--ink-muted); }
.pub-facts dd { margin: 0; user-select: text; }
.pub-foot { display: flex; flex-wrap: wrap; gap: var(--space-4); justify-content: space-between; padding: 18px var(--space-8); border-top: 1px solid var(--line); background: var(--surface); font-size: 13px; color: var(--ink-muted); }
.pub-foot nav { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.pub-foot a:hover { color: var(--anil); }
@media (max-width: 640px) {
  .pub-top, .pub-foot { padding: var(--space-4); }
  .pub-main { padding: var(--space-6) var(--space-3); }
  .pub-doc { padding: var(--space-5); }
  .pub-doc h1 { font-size: 26px; line-height: 32px; }
  .pub-facts { grid-template-columns: 1fr; gap: 0; }
  .pub-facts dd + dt { margin-top: var(--space-2); }
}
