/* =============================================================
   CONTADOR DE PALABRAS — styles.css
   Sistema de diseño VivaFacilito · hoja única, organizada por secciones.
   1. Tokens  2. Reset  3. Utilidades  4. Tipografía  5. Componentes
   6. Secciones  7. Estados/efectos  8. Responsive  9. Reduced motion
   ============================================================= */

/* =============================================================
   1. TOKENS
   ============================================================= */
:root {
  /* Paleta — modo claro */
  --bg: #f6f7fb;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-muted: #eef0f6;
  --border: #e2e5ee;
  --border-strong: #cbd0dd;
  --text: #1b1f2a;
  --text-muted: #5a6072;
  --text-faint: #868c9e;

  --accent: #4f46e5;
  --accent-strong: #3730a3;
  --accent-soft: #eef0ff;
  --accent-contrast: #ffffff;

  --success: #14804a;
  --success-soft: #e4f6ec;
  --warning: #a15c00;
  --warning-soft: #fff3d9;
  --danger: #b3261e;
  --danger-soft: #fdeceb;

  --focus-ring: #4f46e5;

  --font-display: "Manrope", "Inter", system-ui, sans-serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(20, 22, 40, 0.06);
  --shadow-md: 0 6px 20px rgba(20, 22, 40, 0.08);
  --shadow-lg: 0 20px 45px rgba(20, 22, 40, 0.14);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --container-w: 1240px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12131a;
    --bg-elevated: #1a1c26;
    --surface: #1a1c26;
    --surface-muted: #21232f;
    --border: #2c2f3d;
    --border-strong: #3a3e50;
    --text: #eef0f6;
    --text-muted: #a8adc0;
    --text-faint: #767c92;

    --accent: #8b85f6;
    --accent-strong: #b3aefb;
    --accent-soft: #232244;
    --accent-contrast: #14151f;

    --success: #4fd692;
    --success-soft: #123324;
    --warning: #f2b43f;
    --warning-soft: #3a2c0c;
    --danger: #ff8078;
    --danger-soft: #3a1917;

    --focus-ring: #8b85f6;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 20px 45px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #12131a;
  --bg-elevated: #1a1c26;
  --surface: #1a1c26;
  --surface-muted: #21232f;
  --border: #2c2f3d;
  --border-strong: #3a3e50;
  --text: #eef0f6;
  --text-muted: #a8adc0;
  --text-faint: #767c92;

  --accent: #8b85f6;
  --accent-strong: #b3aefb;
  --accent-soft: #232244;
  --accent-contrast: #14151f;

  --success: #4fd692;
  --success-soft: #123324;
  --warning: #f2b43f;
  --warning-soft: #3a2c0c;
  --danger: #ff8078;
  --danger-soft: #3a1917;

  --focus-ring: #8b85f6;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 45px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

/* =============================================================
   2. RESET & BASE
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
  transition: background-color .25s var(--ease-out), color .25s var(--ease-out);
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.15; letter-spacing: -0.01em; font-family: var(--font-display); }
ul, ol { padding-left: 1.25em; }
::selection { background: var(--accent); color: var(--accent-contrast); }

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 6px;
}

textarea, input, select { font-family: inherit; color: inherit; }

.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .7rem 1.1rem; background: var(--accent); color: var(--accent-contrast);
  z-index: 9999; border-radius: var(--radius-sm); font-weight: 600;
  transition: top .2s var(--ease-out);
}
.skip-link:focus { top: 1rem; }

/* =============================================================
   3. UTILIDADES
   ============================================================= */
.container { width: 100%; max-width: var(--container-w); margin-inline: auto; padding-inline: 1.15rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section--tight { padding-block: clamp(1.5rem, 4vw, 2.5rem); }
.eyebrow {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent);
}
.section-head { max-width: 62ch; margin-bottom: clamp(1.5rem, 3vw, 2.25rem); }
.section-head h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin-top: .35rem; }
.section-head p { color: var(--text-muted); margin-top: .6rem; font-size: 1rem; }
.text-muted { color: var(--text-muted); }
.visually-nowrap { white-space: nowrap; }

/* =============================================================
   4. TIPOGRAFÍA
   ============================================================= */
h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.3rem, 2.6vw, 1.75rem); }
h3 { font-size: clamp(1.05rem, 1.6vw, 1.2rem); }

/* =============================================================
   5. COMPONENTES
   ============================================================= */

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .65rem 1.15rem; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .92rem; line-height: 1.2;
  border: 1px solid transparent; transition: transform .15s var(--ease-out), background-color .15s var(--ease-out), border-color .15s var(--ease-out), box-shadow .15s var(--ease-out);
  min-height: 44px; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-contrast); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--accent); }
.btn-danger-ghost { background: transparent; color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.btn-sm { padding: .45rem .8rem; font-size: .82rem; min-height: 36px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-icon { width: 44px; height: 44px; padding: 0; border-radius: var(--radius-sm); }

/* Tarjetas */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.card-pad { padding: clamp(1.1rem, 2.5vw, 1.6rem); }

/* Chips / pills */
.chip {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .4rem .8rem; border-radius: var(--radius-pill);
  background: var(--surface-muted); border: 1px solid var(--border);
  font-size: .85rem; font-weight: 600; color: var(--text-muted);
  transition: all .15s var(--ease-out); cursor: pointer; min-height: 40px;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }

/* Barra de progreso */
.progress {
  position: relative; width: 100%; height: 10px; border-radius: var(--radius-pill);
  background: var(--surface-muted); overflow: hidden; border: 1px solid var(--border);
}
.progress > span {
  display: block; height: 100%; border-radius: var(--radius-pill);
  background: var(--accent); transition: width .25s var(--ease-out), background-color .2s var(--ease-out);
  width: 0%;
}
.progress.is-warn > span { background: var(--warning); }
.progress.is-over > span { background: var(--danger); }

/* Stat tile */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; }
.stat-tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: .85rem .9rem; display: flex; flex-direction: column; gap: .2rem;
}
.stat-tile strong {
  font-family: var(--font-display); font-size: clamp(1.25rem, 3vw, 1.55rem); font-weight: 800;
  color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.1;
}
.stat-tile span { font-size: .78rem; color: var(--text-muted); font-weight: 600; }
.stat-tile.is-accent { background: var(--accent-soft); border-color: transparent; }
.stat-tile.is-accent strong { color: var(--accent-strong); }

/* Toggle de tema */
.theme-toggle {
  display: inline-flex; align-items: center; border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill); padding: 3px; gap: 2px; background: var(--surface);
}
.theme-toggle button {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  color: var(--text-muted); transition: background-color .15s var(--ease-out), color .15s var(--ease-out);
}
.theme-toggle button.is-active { background: var(--accent); color: var(--accent-contrast); }
.theme-toggle svg { width: 17px; height: 17px; }

/* Detalles / FAQ */
details.faq-item {
  border-bottom: 1px solid var(--border); padding-block: .95rem;
}
details.faq-item:first-child { border-top: 1px solid var(--border); }
details.faq-item summary {
  cursor: pointer; font-weight: 700; font-size: 1rem; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item summary::after {
  content: "+"; font-size: 1.3rem; color: var(--accent); flex: none;
  transition: transform .2s var(--ease-out); font-weight: 400;
}
details.faq-item[open] summary::after { transform: rotate(45deg); }
details.faq-item p { color: var(--text-muted); margin-top: .65rem; max-width: 68ch; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 1.25rem; transform: translate(-50%, 12px);
  background: var(--text); color: var(--bg); padding: .7rem 1.1rem; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .88rem; opacity: 0; pointer-events: none; z-index: 400;
  transition: opacity .2s var(--ease-out), transform .2s var(--ease-out); box-shadow: var(--shadow-lg);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* Ad slots */
.ad-slot {
  border: 1px dashed var(--border-strong); border-radius: var(--radius-md);
  background: var(--surface-muted); color: var(--text-faint);
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  width: 100%; overflow: hidden;
}
.ad-slot span { opacity: .8; }
.ad-slot--top { min-height: 90px; }
.ad-slot--incontent { min-height: 250px; margin-block: clamp(2rem, 5vw, 3rem); }
.ad-slot--sidebar { min-height: 250px; margin-bottom: 1rem; }
.ad-slot--sidebar:last-child { margin-bottom: 0; }

/* =============================================================
   6. SECCIONES
   ============================================================= */

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: .6rem; min-height: 62px; }
.brand { display: flex; align-items: center; gap: .5rem; font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; white-space: nowrap; min-width: 0; }
.brand span:last-child { overflow: hidden; text-overflow: ellipsis; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--accent-contrast);
  display: grid; place-items: center; font-size: .95rem; flex: none;
}
.header-nav { display: flex; gap: 1.3rem; flex: none; }
.header-nav a { font-size: .88rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.header-nav a:hover { color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: .6rem; flex: none; }
.back-link {
  font-size: .85rem; font-weight: 600; color: var(--text-muted);
  display: inline-flex; align-items: center; gap: .3rem; transition: color .15s var(--ease-out);
  white-space: nowrap;
}
.back-link:hover { color: var(--accent); }

/* Hero */
.hero { padding-block: clamp(1.75rem, 4vw, 2.75rem) .5rem; }
.hero p.lead { color: var(--text-muted); font-size: clamp(1rem, 1.6vw, 1.15rem); max-width: 68ch; margin-top: .6rem; }
.trust-row { display: flex; flex-wrap: wrap; gap: .5rem .9rem; margin-top: 1.1rem; }
.trust-row .chip { cursor: default; }
.trust-row .chip:hover { border-color: var(--border); color: var(--text-muted); }

/* Layout principal: editor + panel de stats */
.workspace {
  display: grid; grid-template-columns: 1fr; gap: 1.1rem;
  padding-block: 1rem clamp(2rem, 4vw, 2.75rem);
}

.editor-card { display: flex; flex-direction: column; gap: .85rem; }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; }
.editor-toolbar .toolbar-group { display: flex; flex-wrap: wrap; gap: .5rem; }

.editor-shell { position: relative; }
#editor {
  width: 100%; min-height: 46vh; max-height: 70vh; resize: vertical;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--bg-elevated); color: var(--text);
  padding: 1.1rem 1.2rem; font-size: 1.05rem; line-height: 1.7;
  transition: border-color .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
#editor:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#editor::placeholder { color: var(--text-faint); }

.editor-footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem; align-items: center; }
.editor-footer-row .toolbar-group { display: flex; flex-wrap: wrap; gap: .5rem; }

/* Panel de estadísticas */
.stats-panel { display: flex; flex-direction: column; gap: 1rem; }
.stats-panel h2 { font-size: 1.05rem; }
.stats-panel .card-pad > h2 { margin-bottom: .85rem; }

.limit-block { display: flex; flex-direction: column; gap: .55rem; }
.limit-block-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.limit-block-head strong { font-family: var(--font-display); font-variant-numeric: tabular-nums; font-size: 1.05rem; }
.limit-msg { font-size: .82rem; font-weight: 600; }
.limit-msg.is-ok { color: var(--success); }
.limit-msg.is-warn { color: var(--warning); }
.limit-msg.is-over { color: var(--danger); }
.preset-row { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.preset-row input[type="number"] {
  width: 6.5rem; padding: .45rem .6rem; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--surface); font-weight: 600; font-size: .85rem;
}

.density-toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; }
.density-toolbar label { font-size: .82rem; font-weight: 600; color: var(--text-muted); display: flex; align-items: center; gap: .4rem; }
.density-toolbar select {
  padding: .4rem .6rem; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); font-size: .82rem; font-weight: 600;
}
.density-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .45rem; margin-top: .8rem; }
.density-row { display: grid; grid-template-columns: 1fr auto 3.2rem; align-items: center; gap: .6rem; font-size: .88rem; }
.density-row .bar-track { height: 8px; border-radius: var(--radius-pill); background: var(--surface-muted); overflow: hidden; }
.density-row .bar-fill { height: 100%; background: var(--accent); border-radius: inherit; }
.density-row .count { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-muted); font-weight: 600; }
.density-row .word { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.density-empty { color: var(--text-faint); font-size: .88rem; padding: .5rem 0; }

.advanced-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
.advanced-grid .stat-tile strong { font-size: 1.15rem; }

.readability-box { display: flex; align-items: center; gap: 1rem; }
.readability-score {
  flex: none; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; border: 3px solid var(--border);
}
.readability-score.easy { border-color: var(--success); color: var(--success); }
.readability-score.medium { border-color: var(--warning); color: var(--warning); }
.readability-score.hard { border-color: var(--danger); color: var(--danger); }
.readability-copy strong { display: block; font-size: 1.02rem; margin-bottom: .2rem; }
.readability-copy p { font-size: .82rem; color: var(--text-muted); }

.reading-time-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }

/* Clean & transform panel */
.tools-grid { display: grid; grid-template-columns: 1fr; gap: 1.1rem; }
.checkbox-row { display: flex; align-items: flex-start; gap: .55rem; padding: .35rem 0; font-size: .92rem; }
.checkbox-row input { margin-top: .2rem; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.checkbox-row label { color: var(--text); cursor: pointer; }
.checkbox-row .hint { display: block; color: var(--text-muted); font-size: .8rem; margin-top: .1rem; }
.transform-grid { display: flex; flex-wrap: wrap; gap: .55rem; }

/* Historial */
.history-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.history-item {
  display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  border: 1px solid var(--border); border-radius: var(--radius-md); padding: .7rem .9rem; background: var(--bg-elevated);
}
.history-item-main { min-width: 0; flex: 1; cursor: pointer; }
.history-item-main:hover .history-preview { color: var(--accent); }
.history-preview { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-meta { font-size: .78rem; color: var(--text-muted); margin-top: .15rem; }
.history-empty { color: var(--text-faint); font-size: .9rem; padding: .5rem 0; }

/* Comparador */
.compare-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.compare-col { display: flex; flex-direction: column; gap: .6rem; }
.compare-col textarea {
  width: 100%; min-height: 220px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--bg-elevated); padding: .9rem 1rem; font-size: .95rem; line-height: 1.6;
}
.compare-col textarea:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.compare-mini-stats { display: flex; gap: 1rem; font-size: .82rem; color: var(--text-muted); font-weight: 600; }
.compare-mini-stats b { color: var(--text); font-variant-numeric: tabular-nums; }
.compare-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; margin-top: 1rem; }
.compare-shared { margin-top: 1.1rem; display: grid; grid-template-columns: 1fr; gap: .9rem; }
.exclusive-list { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.exclusive-list .chip { cursor: default; padding: .3rem .65rem; min-height: auto; font-size: .78rem; }
.exclusive-list .chip:hover { border-color: var(--border); color: var(--text-muted); }

/* Uso rápido / accesos */
.quick-limits-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
@media (min-width: 540px) { .quick-limits-grid { grid-template-columns: repeat(4, 1fr); } }
.quick-limit-btn {
  border: 1px solid var(--border); border-radius: var(--radius-md); padding: .8rem .6rem;
  background: var(--surface); text-align: center; font-weight: 700; transition: all .15s var(--ease-out);
}
.quick-limit-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.quick-limit-btn span { display: block; font-size: .72rem; font-weight: 600; color: var(--text-muted); margin-top: .2rem; }

/* Casos de uso */
.usecase-grid { display: grid; grid-template-columns: 1fr; gap: .9rem; }
@media (min-width: 720px) { .usecase-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .usecase-grid { grid-template-columns: repeat(3, 1fr); } }
.usecase-card { display: flex; flex-direction: column; gap: .5rem; }
.usecase-card .icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-strong);
  display: grid; place-items: center; flex: none;
}
.usecase-card h3 { font-size: 1rem; }
.usecase-card p { font-size: .88rem; color: var(--text-muted); }

/* Cómo funciona */
.steps-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; counter-reset: step; }
@media (min-width: 720px) { .steps-grid { grid-template-columns: repeat(3, 1fr); } }
.step-card { position: relative; padding-top: .5rem; }
.step-num {
  width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: var(--accent-contrast);
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; margin-bottom: .8rem;
}
.step-card h3 { font-size: 1.02rem; margin-bottom: .35rem; }
.step-card p { color: var(--text-muted); font-size: .9rem; }

/* Redes sociales */
.social-grid { display: grid; grid-template-columns: 1fr; gap: .7rem; }
@media (min-width: 640px) { .social-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .social-grid { grid-template-columns: repeat(3, 1fr); } }
.social-card { display: flex; flex-direction: column; gap: .55rem; }
.social-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.social-card-head h3 { font-size: .95rem; }
.social-card-head b { font-variant-numeric: tabular-nums; color: var(--text-muted); font-size: .82rem; }

/* Layout de dos columnas para contenido largo (SEO) */
.content-cols { display: grid; grid-template-columns: 1fr; gap: 2.5rem; }
.content-cols .content-main { min-width: 0; }
.content-cols .content-side { display: none; }

.prose { max-width: 72ch; color: var(--text); }
.prose p { margin-bottom: .95rem; color: var(--text-muted); }
.prose h3 { margin-top: 1.4rem; margin-bottom: .5rem; }
.prose strong { color: var(--text); }

.anchor-nav { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.75rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding-block: 2.25rem; margin-top: 2rem; }
.footer-grid { display: flex; flex-direction: column; gap: 1.25rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .85rem; color: var(--text-muted); }
.footer-links a:hover { color: var(--accent); }
.footer-note { font-size: .8rem; color: var(--text-faint); }

/* =============================================================
   7. ESTADOS / EFECTOS
   ============================================================= */
.is-hidden { display: none !important; }
.fade-in { animation: fadeIn .35s var(--ease-out); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.limit-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex: none; }
.limit-status-dot.is-warn { background: var(--warning); }
.limit-status-dot.is-over { background: var(--danger); }

/* =============================================================
   8. RESPONSIVE
   ============================================================= */
@media (min-width: 960px) {
  .workspace { grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); align-items: start; }
  #editor { min-height: 52vh; }
  .stats-panel { position: sticky; top: 78px; max-height: calc(100vh - 96px); overflow-y: auto; padding-right: .25rem; }
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .compare-grid { grid-template-columns: 1fr 1fr; }
  .reading-time-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1280px) {
  .content-cols { grid-template-columns: minmax(0, 1fr) 300px; }
  .content-cols .content-side { display: block; }
}

@media (max-width: 899.98px) {
  .header-nav { display: none; }
}

@media (max-width: 539.98px) {
  .btn { min-height: 46px; }
  .quick-limits-grid { grid-template-columns: repeat(2, 1fr); }
  .container { padding-inline: 1rem; }
  .brand { font-size: .88rem; }
  .brand-mark { width: 28px; height: 28px; font-size: .82rem; }
  .back-link .back-label { display: none; }
  .back-link { font-size: 1.05rem; }
  .theme-toggle button { width: 30px; height: 30px; }
}

@media (max-width: 380px) {
  .brand span:last-child { max-width: 108px; }
}

/* =============================================================
   9. REDUCED MOTION
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fade-in { animation: none; }
  * { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}
