/* ==========================================================================
   Contadordetexto.com — sistema visual
   Instrumento de precisión para medir y optimizar texto.
   ========================================================================== */

:root {
  /* Paleta — modo claro (papel cálido + señal esmeralda) */
  --bg:          #f6f5f0;
  --surface:     #ffffff;
  --surface-2:   #f0efe8;
  --ink:         #16201b;
  --muted:       #5c645e;
  --line:        #e3e1d8;
  --line-strong: #d3d0c4;
  --accent:      #0e7a58;
  --accent-ink:  #ffffff;
  --accent-soft: #e4f3ec;
  --accent-strong:#0a5e43;
  --warn:        #c2410c;
  --warn-soft:   #fbe8de;
  --ok:          #0e7a58;

  --shadow-sm: 0 1px 2px rgba(22, 32, 27, .06);
  --shadow-md: 0 6px 24px -12px rgba(22, 32, 27, .22);

  --radius:    14px;
  --radius-sm: 10px;
  --radius-lg: 22px;

  --maxw: 1080px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

:root[data-theme="dark"] {
  --bg:          #0f1310;
  --surface:     #161c18;
  --surface-2:   #1d241f;
  --ink:         #eceee8;
  --muted:       #99a29b;
  --line:        #283029;
  --line-strong: #37413a;
  --accent:      #34d399;
  --accent-ink:  #06231a;
  --accent-soft: #15271f;
  --accent-strong:#5ee0ad;
  --warn:        #fb923c;
  --warn-soft:   #2a1d14;
  --ok:          #34d399;
  --shadow-md: 0 10px 30px -14px rgba(0, 0, 0, .6);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #0f1310;
    --surface:     #161c18;
    --surface-2:   #1d241f;
    --ink:         #eceee8;
    --muted:       #99a29b;
    --line:        #283029;
    --line-strong: #37413a;
    --accent:      #34d399;
    --accent-ink:  #06231a;
    --accent-soft: #15271f;
    --accent-strong:#5ee0ad;
    --warn:        #fb923c;
    --warn-soft:   #2a1d14;
    --ok:          #34d399;
    --shadow-md: 0 10px 30px -14px rgba(0, 0, 0, .6);
  }
}

/* --------------------------------------------------------------------------
   Reset / base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 560; line-height: 1.12; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5.2vw, 3rem); font-optical-sizing: auto; }
h2 { font-size: clamp(1.4rem, 3.2vw, 1.9rem); }
h3 { font-size: 1.2rem; font-family: var(--font-sans); font-weight: 700; letter-spacing: 0; }
p { margin: 0 0 1em; }

a { color: var(--accent-strong); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }

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

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(16px, 4vw, 28px); }
.muted { color: var(--muted); }
.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; }

/* --------------------------------------------------------------------------
   Barra superior
   -------------------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner { display: flex; align-items: center; gap: 18px; min-height: 62px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink); text-decoration: none; letter-spacing: -.02em; font-size: 1.05rem; }
.brand:hover { color: var(--ink); }
.brand__mark { width: 30px; height: 30px; flex: none; }

.mainnav { margin-left: auto; }
.mainnav ul { list-style: none; display: flex; gap: 2px; margin: 0; padding: 0; }
.mainnav a {
  display: block; padding: 8px 12px; border-radius: 999px;
  color: var(--muted); text-decoration: none; font-size: .95rem; font-weight: 600;
  white-space: nowrap;
}
.mainnav a:hover { color: var(--ink); background: var(--surface-2); }
.mainnav a[aria-current="page"] { color: var(--accent-strong); background: var(--accent-soft); }

.theme-toggle {
  flex: none; display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  cursor: pointer;
}
.theme-toggle:hover { background: var(--surface-2); }
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}

.navtoggle { display: none; }

@media (max-width: 760px) {
  .navtoggle {
    display: inline-grid; place-items: center; width: 40px; height: 40px; margin-left: auto;
    border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
    border-radius: 999px; cursor: pointer;
  }
  .navtoggle svg { width: 20px; height: 20px; }
  .mainnav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--surface); border-bottom: 1px solid var(--line);
    margin: 0; padding: 8px clamp(16px,4vw,28px) 14px;
    display: none; box-shadow: var(--shadow-md);
  }
  .mainnav.open { display: block; }
  .mainnav ul { flex-direction: column; gap: 2px; }
  .mainnav a { padding: 11px 12px; font-size: 1rem; }
}

/* --------------------------------------------------------------------------
   Héroe / cabecera de herramienta
   -------------------------------------------------------------------------- */
.hero { padding: clamp(28px, 6vw, 56px) 0 10px; }
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--accent-strong); font-weight: 700; font-size: .9rem;
  background: var(--accent-soft); padding: 5px 12px; border-radius: 999px; margin-bottom: 16px;
}
.hero__eyebrow svg { width: 15px; height: 15px; }
.hero h1 { max-width: 16ch; }
.hero__lead { font-size: 1.12rem; color: var(--muted); max-width: 60ch; margin-bottom: 0; }

/* --------------------------------------------------------------------------
   Herramienta: editor + panel de métricas
   -------------------------------------------------------------------------- */
.tool { padding: 22px 0 8px; }
.tool__grid { display: grid; grid-template-columns: 1.55fr .95fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .tool__grid { grid-template-columns: 1fr; } }

.editor {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md); overflow: hidden;
}
.editor__bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.editor__bar .spacer { margin-left: auto; }
.editor textarea {
  width: 100%; border: 0; resize: vertical; display: block;
  min-height: 300px; padding: 20px 22px;
  font-family: var(--font-sans); font-size: 1.06rem; line-height: 1.7;
  color: var(--ink); background: transparent;
}
.editor textarea::placeholder { color: var(--muted); opacity: .8; }
.editor textarea:focus { outline: none; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  font: inherit; font-weight: 650; font-size: .92rem;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn--accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn--accent:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn--ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn--ghost:hover { color: var(--ink); background: var(--surface); }
.btn.is-done { color: var(--accent-strong); border-color: var(--accent); background: var(--accent-soft); }

/* Panel de métricas — el instrumento */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  padding: 20px; position: sticky; top: 78px;
}
@media (max-width: 900px) { .panel { position: static; } }

.readout { padding: 6px 4px 18px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.readout__label { color: var(--muted); font-weight: 650; font-size: .9rem; margin: 0 0 2px; }
.readout__value {
  font-family: var(--font-sans); font-weight: 800;
  font-size: clamp(3.2rem, 9vw, 4.4rem); line-height: 1; letter-spacing: -.03em;
  color: var(--accent-strong); font-variant-numeric: tabular-nums;
}
.readout__value.tick { animation: tick .18s ease; }
@keyframes tick { 0%{ transform: translateY(-2px); opacity:.65 } 100%{ transform:none; opacity:1 } }
.readout__sub { color: var(--muted); font-size: .92rem; margin: 6px 0 0; }

.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.metric { background: var(--surface); padding: 13px 14px; }
.metric__n { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.metric__k { color: var(--muted); font-size: .82rem; font-weight: 600; margin-top: 1px; }

/* --------------------------------------------------------------------------
   Límites SEO / redes (medidores)
   -------------------------------------------------------------------------- */
.fields { display: grid; gap: 18px; }
.field label { display: block; font-weight: 700; margin-bottom: 7px; }
.field textarea, .field input[type="text"] {
  width: 100%; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  border-radius: var(--radius-sm); padding: 12px 14px; font: inherit; resize: vertical;
  min-height: 0; line-height: 1.5;
}
.field textarea { min-height: 3.2em; }
.field textarea:focus, .field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field .hint { color: var(--muted); font-size: .88rem; margin: 7px 0 0; }

.meter { margin-top: 9px; }
.meter__track { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.meter__fill { height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .18s ease, background .18s ease; }
.meter__row { display: flex; justify-content: space-between; gap: 10px; font-size: .86rem; margin-top: 6px; }
.meter__status { font-weight: 700; }
.is-under .meter__fill { background: var(--muted); }
.is-ok .meter__fill { background: var(--accent); }
.is-ok .meter__status { color: var(--accent-strong); }
.is-over .meter__fill { background: var(--warn); }
.is-over .meter__status { color: var(--warn); }

/* Vista previa buscador / redes */
.serp {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  background: var(--surface); margin-top: 4px;
}
.serp__crumb { color: var(--muted); font-size: .8rem; display:flex; align-items:center; gap:6px; }
.serp__crumb b { color: var(--ink); font-weight: 600; }
.serp__title { color: #1a0dab; font-size: 1.25rem; line-height: 1.3; margin: 3px 0 2px; font-family: var(--font-sans); font-weight: 500; }
.serp__desc { color: #4d5156; font-size: .92rem; line-height: 1.5; }
:root[data-theme="dark"] .serp__title { color: #8ab4f8; }
:root[data-theme="dark"] .serp__desc { color: #bdc1c6; }
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]) .serp__title{color:#8ab4f8;} :root:not([data-theme="light"]) .serp__desc{color:#bdc1c6;} }

/* Conversor de caso — resultados */
.casegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.caseopt {
  text-align: left; padding: 13px 15px; border: 1px solid var(--line-strong); background: var(--surface);
  border-radius: var(--radius-sm); cursor: pointer; font: inherit;
}
.caseopt:hover { border-color: var(--accent); background: var(--accent-soft); }
.caseopt b { display: block; font-size: .78rem; color: var(--muted); font-weight: 650; margin-bottom: 2px; }
.caseopt span { font-weight: 700; }

/* --------------------------------------------------------------------------
   Secciones de contenido
   -------------------------------------------------------------------------- */
.section { padding: clamp(34px, 6vw, 60px) 0; }
.section--tint { background: var(--surface); border-block: 1px solid var(--line); }
.prose { max-width: 68ch; }
.prose h2 { margin-top: 0; }
.prose h3 { margin-top: 1.6em; }
.prose ul { padding-left: 1.1em; }
.prose li { margin-bottom: .4em; }
.prose strong { font-weight: 700; }

.lede { font-size: 1.12rem; color: var(--ink); }

/* Tarjetas de otras herramientas */
.tools-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.card {
  display: block; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; transition: border-color .15s ease, transform .12s ease, box-shadow .15s ease;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-md); color: inherit; }
.card__ico { width: 34px; height: 34px; color: var(--accent-strong); margin-bottom: 12px; }
.card__ico svg { width: 100%; height: 100%; }
.card h3 { margin: 0 0 4px; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); font-size: .92rem; }

/* FAQ */
.faq { max-width: 74ch; display: grid; gap: 0; }
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary {
  cursor: pointer; list-style: none; padding: 16px 44px 16px 2px; position: relative;
  font-family: var(--font-display); font-size: 1.12rem; font-weight: 540;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 8px; top: 50%; width: 11px; height: 11px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: translateY(-65%) rotate(45deg); transition: transform .2s ease;
}
.faq details[open] summary::after { transform: translateY(-35%) rotate(-135deg); }
.faq details > div { padding: 0 44px 16px 2px; color: var(--muted); }
.faq details > div p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   Pie
   -------------------------------------------------------------------------- */
.footer { background: var(--surface); border-top: 1px solid var(--line); padding: 44px 0 36px; margin-top: 10px; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
@media (max-width: 720px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .footer__grid { grid-template-columns: 1fr; } }
.footer h4 { font-size: .82rem; letter-spacing: .02em; color: var(--muted); margin: 0 0 12px; font-weight: 700; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer a { color: var(--ink); text-decoration: none; font-size: .95rem; }
.footer a:hover { color: var(--accent-strong); text-decoration: underline; }
.footer__brand p { color: var(--muted); font-size: .95rem; max-width: 36ch; }
.footer__legal { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; display:flex; justify-content:space-between; gap:14px; flex-wrap:wrap; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(16px);
  background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 999px;
  font-weight: 650; font-size: .92rem; box-shadow: var(--shadow-md); opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease; z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ==========================================================================
   Menú por categorías, selects y herramientas nuevas
   ========================================================================== */

/* Menú desplegable de herramientas */
.nav-top { display: flex; gap: 2px; align-items: center; list-style: none; margin: 0; padding: 0; }
.menu { position: relative; }
.menu__btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 8px 12px; border-radius: 999px; border: 0; background: transparent;
  color: var(--muted); font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer;
}
.menu__btn:hover { color: var(--ink); background: var(--surface-2); }
.menu__btn.is-active { color: var(--accent-strong); background: var(--accent-soft); }
.menu__btn svg { width: 16px; height: 16px; transition: transform .2s ease; }
.menu.open .menu__btn svg { transform: rotate(180deg); }
.menu__panel {
  position: absolute; right: 0; top: calc(100% + 10px); display: none;
  grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 2px 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-md); padding: 16px 18px; min-width: 500px; z-index: 60;
}
.menu.open .menu__panel { display: grid; }
.menu__col h4 { font-size: .74rem; color: var(--muted); margin: 10px 0 4px; font-weight: 700; padding-left: 10px; }
.menu__col a {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 11px;
  color: var(--ink); text-decoration: none; font-size: .94rem; font-weight: 600; white-space: nowrap;
}
.menu__col a:hover { background: var(--surface-2); color: var(--ink); }
.menu__col a[aria-current="page"] { color: var(--accent-strong); background: var(--accent-soft); }
.menu__ico { width: 18px; height: 18px; color: var(--muted); flex: none; }
.menu__ico svg { width: 100%; height: 100%; }
.menu__col a[aria-current="page"] .menu__ico { color: var(--accent-strong); }

@media (max-width: 760px) {
  .menu { position: static; }
  .menu__btn { display: none; }
  .menu__panel {
    position: static; display: grid; grid-template-columns: 1fr; min-width: 0;
    border: 0; box-shadow: none; padding: 0; background: transparent;
  }
  .nav-top { flex-direction: column; align-items: stretch; gap: 0; }
  .menu__col h4 { margin-top: 16px; padding-left: 12px; }
  .menu__col a { padding: 11px 12px; font-size: 1rem; }
}

/* Select y checkbox */
.select {
  width: 100%; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  border-radius: var(--radius-sm); padding: 11px 38px 11px 14px; font: inherit; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
.select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.check { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: .95rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* Conversor a slug */
.slug-out {
  font-family: var(--font-sans); font-weight: 700; font-size: 1.3rem; word-break: break-all;
  line-height: 1.4; color: var(--accent-strong); background: var(--accent-soft);
  border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; min-height: 62px;
}
.slug-out.is-empty { color: var(--muted); background: var(--surface-2); font-weight: 600; }

/* Verificador de código de país */
.phone-tool { max-width: 640px; margin: 0 auto; }
.phone-label { display: block; font-weight: 700; margin-bottom: 10px; text-align: center; }
.phone-input {
  display: flex; align-items: center; background: var(--surface);
  border: 2px solid var(--line-strong); border-radius: 18px; box-shadow: var(--shadow-md);
  overflow: hidden; transition: border-color .15s ease;
}
.phone-input:focus-within { border-color: var(--accent); }
.phone-plus { font-size: 1.7rem; font-weight: 700; color: var(--muted); padding: 0 2px 0 20px; }
.phone-input input {
  flex: 1; border: 0; background: transparent; color: var(--ink); font: inherit;
  font-size: 1.5rem; font-weight: 700; padding: 18px 20px 18px 6px; min-width: 0;
}
.phone-input input:focus { outline: none; }
.phone-result { margin-top: 20px; border-radius: 16px; }
.phone-result.is-ok, .phone-result.is-warn, .phone-result.is-over { padding: 20px 22px; border: 1px solid var(--line); }
.phone-result.is-ok { background: var(--accent-soft); }
.phone-result.is-warn, .phone-result.is-over { background: var(--warn-soft); }
.phone-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.phone-code {
  font-family: var(--font-sans); font-weight: 800; font-size: 1.9rem; color: var(--accent-strong);
  background: var(--surface); border-radius: 12px; padding: 2px 14px; border: 1px solid var(--line);
}
.phone-result.is-warn .phone-code, .phone-result.is-over .phone-code { color: var(--warn); }
.phone-verdict { font-size: 1.12rem; font-weight: 600; }
.phone-countries { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.phone-country {
  display: inline-flex; align-items: center; gap: 7px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 13px; font-weight: 600; font-size: .95rem;
}
.phone-country .fl { font-size: 1.15rem; }
.phone-len { color: var(--muted); font-size: .92rem; margin: 2px 0 0; }
.phone-result.is-warn .phone-len { color: var(--warn); font-weight: 600; }
.phone-hint { color: var(--muted); text-align: center; font-size: .95rem; margin: 0; }
.phone-result.is-ok .phone-hint, .phone-result.is-warn .phone-hint { text-align: left; margin-top: 10px; }

/* Explorador de datos por país */
.country-bar { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; margin-bottom: 14px; }
@media (max-width: 680px) { .country-bar { grid-template-columns: 1fr; } }
.country-search { position: relative; display: flex; align-items: center; }
.country-search svg { position: absolute; left: 14px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.country-search input {
  width: 100%; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  border-radius: var(--radius-sm); padding: 12px 14px 12px 44px; font: inherit;
}
.country-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.country-count { color: var(--muted); font-weight: 600; font-size: .92rem; margin: 0 0 14px; }
.country-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.country { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.country__h { display: flex; align-items: center; gap: 12px; margin-bottom: 13px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.country__flag { font-size: 2rem; line-height: 1; }
.country__h h3 { margin: 0; font-size: 1.1rem; }
.country__iso { color: var(--muted); font-size: .82rem; font-weight: 600; }
.country__facts { display: grid; grid-template-columns: 1fr 1fr; gap: 11px 14px; margin: 0; }
.country__facts > div { min-width: 0; }
.country__facts dt { color: var(--muted); font-size: .75rem; font-weight: 600; margin-bottom: 1px; }
.country__facts dd { margin: 0; font-weight: 600; font-size: .92rem; word-break: break-word; }

/* Pie: rejilla de 4 columnas por categoría */
.footer__intro { max-width: none; margin-bottom: 26px; }
.footer__intro .brand { margin-bottom: 10px; }
.footer__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; }
@media (max-width: 760px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .footer__grid { grid-template-columns: 1fr; } }
