/* ============================================================
   Santiago Abogados — Elite Legal v3
   Accesibilidad primero: Inter 17.5px / lh 1.7, alto contraste.
   Premium por hairlines, numeración editorial, espaciado generoso.
   Color: bone, ink, champagne (acento quirúrgico).
   ============================================================ */

/* ---- Tokens ---- */
:root {
  /* Palette: bone, ink, champagne */
  --bone: #FAF8F4;
  --bone-2: #F2EEE5;
  --bone-3: #E8E2D3;
  --paper: #FFFFFF;
  --ink: #0A0A0A;
  --ink-2: #1F1F1F;
  --ink-3: #404040;
  --ink-4: #595959;
  --stone: #767676;
  --stone-2: #9B9B9B;
  --hairline: #DDD7C7;
  --hairline-strong: #B8B0A0;

  /* Champagne — acento limitado */
  --champagne: #9A7B4A;
  --champagne-soft: #C4A878;
  --champagne-deep: #6B5430;
  --champagne-glow: rgba(154, 123, 74, 0.12);

  /* Compatibilidad con código existente (aliases del sistema anterior) */
  --primary: var(--champagne);
  --primary-dark: var(--champagne-deep);
  --primary-soft: var(--bone-2);
  --primary-softer: var(--bone);
  --accent: var(--champagne);
  --accent-2: var(--champagne-soft);
  --accent-3: var(--champagne-soft);
  --slate: #5A6B7C;
  --olive: #6B7A4F;
  --navy: var(--ink);
  --navy-2: var(--ink-2);
  --border: var(--hairline);
  --border-strong: var(--hairline-strong);
  --surface: var(--paper);
  --surface-2: var(--bone-2);
  --bg: var(--bone);
  --muted: var(--ink-4);
  --faint: var(--stone);

  --ok: #2E7D4F;
  --ok-soft: #ECFDF5;
  --warn-bg: #FFFBEB;
  --warn-border: #E8C26E;
  --warn-text: #8B5A1A;

  --shadow-xs: 0 1px 2px rgba(10, 10, 10, 0.04);
  --shadow-sm: 0 2px 6px rgba(10, 10, 10, 0.05);
  --shadow-md: 0 4px 14px rgba(10, 10, 10, 0.06);
  --shadow-lg: 0 10px 28px rgba(10, 10, 10, 0.08);
  --shadow-xl: 0 20px 50px rgba(10, 10, 10, 0.10);
  --shadow-glow: 0 4px 14px rgba(154, 123, 74, 0.15);

  --r-sm: 3px;
  --r-md: 4px;
  --r-lg: 6px;
  --r-xl: 8px;
  --r-full: 999px;
  --radius-lg: 6px;

  --max-w: 1200px;
  --header-h: 72px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  font-size: 17.5px;
  line-height: 1.7;
  color: var(--ink-3);
  background: var(--bone);
  min-width: 320px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'kern', 'liga', 'calt', 'ss01';
  font-variant-numeric: oldstyle-nums;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 16px; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--ink); color: var(--bone); }

/* ---- Tipografía — sans moderna, accesible ---- */
h1, h2, h3, h4,
.hero h1, .section-title, .logo, .logo-text,
.ficha-info h2, .ficha-mapa h2 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--ink);
}
h1, .hero h1 {
  font-size: clamp(2.25rem, 5.5vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
}
h2, .section-title {
  font-size: clamp(1.75rem, 3.4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
h3 {
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--ink);
}
.logo, .logo-text {
  font-weight: 700;
  letter-spacing: -0.02em;
}
.ficha-info h2, .ficha-mapa h2 {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-size: 12.5px;
  margin: 0 0 20px;
}

/* ---- Eyebrow (chip superior con línea) ---- */
.eyebrow, .hero-eyebrow, .section-eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--champagne-deep);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: 0;
  padding: 0;
  border-radius: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  margin-bottom: 14px;
}
.eyebrow::before, .hero-eyebrow::before, .section-eyebrow::before {
  content: '';
  width: 28px;
  height: 1.5px;
  background: var(--champagne);
  display: inline-block;
  flex-shrink: 0;
}
.section-eyebrow { display: inline-block; margin-bottom: 10px; }
.section-eyebrow::before { display: none; }
.section-eyebrow { padding-left: 40px; position: relative; }
.section-eyebrow::after {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  width: 28px;
  height: 1.5px;
  background: var(--champagne);
}

/* ---- Detalles globales ---- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bone); }
::-webkit-scrollbar-thumb { background: var(--hairline-strong); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--stone-2); }

/* ---- Enlaces: estilo global, nada chillón ---- */
a {
  color: var(--champagne-deep);
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color .15s ease, text-decoration .15s ease;
}
a:visited { color: var(--champagne-deep); }
a:hover { color: var(--ink); text-decoration: underline; }
a:focus-visible {
  outline: 2px solid var(--champagne);
  outline-offset: 2px;
  border-radius: var(--r-md);
}
a.area-card, a.tool-card, a.spoke-card, a.juzgado-card, a.comuna-link,
a.court-card, a.logo, a.guide-card, a.step-link, a.ab-card, a.ab-mini, a.comuna-chip {
  color: inherit;
}
a.area-card:hover, a.tool-card:hover, a.spoke-card:hover, a.juzgado-card:hover,
a.comuna-link:hover, a.court-card:hover, a.btn:hover, a.logo:hover,
a.guide-card:hover, a.step-link:hover, a.ab-card:hover, a.ab-mini:hover, a.comuna-chip:hover {
  text-decoration: none;
}

/* ---- Container ---- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 960px) { .container { padding: 0 24px; } }
@media (max-width: 600px) { .container { padding: 0 18px; } }

/* ============================================================
   HEADER — minimal, hairlines, sticky con blur
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 248, 244, 0.86);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline);
  height: var(--header-h);
  box-shadow: none;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 24px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  flex-shrink: 0;
  box-shadow: none;
  transition: background .2s, color .2s;
}
.logo:hover .logo-icon { background: var(--ink); color: var(--bone); }
.logo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.1;
}
.logo-text::after { content: none; }
.logo-accent { color: var(--stone); font-weight: 500; }
.logo-sub {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-4);
  display: block;
}
.main-nav {
  display: flex;
  align-items: center;
  gap: 0;
}
.main-nav a {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-2);
  padding: 10px 14px;
  border-radius: 0;
  transition: color .15s ease, background .15s ease;
}
.main-nav a:hover {
  color: var(--ink);
  background: transparent;
  text-decoration: none;
}
.main-nav a.nav-cta,
.main-nav a[href*="publicar-estudio"] {
  background: var(--ink);
  color: var(--bone);
  padding: 11px 20px;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  border-radius: var(--r-md);
  margin-left: 12px;
  box-shadow: none;
  text-transform: none;
}
.main-nav a.nav-cta:hover,
.main-nav a[href*="publicar-estudio"]:hover { background: var(--ink-2); }
.menu-toggle {
  display: none;
  background: none;
  border: 1.5px solid var(--hairline-strong);
  border-radius: var(--r-md);
  width: 44px;
  height: 44px;
  padding: 0;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}
.menu-toggle:hover { background: var(--bone-2); }
@media (max-width: 960px) {
  .main-nav { display: none; }
  .menu-toggle { display: inline-flex; }
  .main-nav.open {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--bone);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 12px 20px 18px;
    border-bottom: 1px solid var(--hairline);
    box-shadow: var(--shadow-md);
  }
  .main-nav.open a { padding: 12px 16px; font-size: 16px; font-weight: 500; }
}

/* ============================================================
   HERO — body pegado al header, editorial
   ============================================================ */
.hero {
  position: relative;
  padding: 20px 0 80px;
  text-align: left;
  background: var(--bone);
  overflow: hidden;
  border-bottom: 0;
}
.hero::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -160px;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, var(--champagne-glow) 0%, transparent 68%);
  z-index: 0;
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: var(--hairline);
}
/* Signature line sutil en el hero (esquina superior derecha) — evoca una firma de abogado */
.hero .signature {
  position: absolute;
  top: 32px;
  right: 24px;
  width: 180px;
  height: 56px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.85;
}
.hero-content::after {
  content: '';
  position: absolute;
  top: -8px;
  right: -8px;
  width: 200px;
  height: 64px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 64' fill='none'><path d='M 8 44 Q 30 22, 56 34 T 110 30 Q 138 22, 162 38 Q 178 46, 196 30' stroke='%239A7B4A' stroke-width='1.4' fill='none' stroke-linecap='round' opacity='0.6'/><path d='M 64 50 L 188 50' stroke='%239A7B4A' stroke-width='0.6' fill='none' stroke-linecap='round' opacity='0.35'/></svg>");
  background-size: contain;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 1;
}
@media (max-width: 760px) { .hero-content::after { display: none; } }
.hero .container { position: relative; z-index: 1; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 64px;
  /* `end` colgaba el aside al fondo y dejaba 315 px de hueco muerto arriba
     (medido: hero 610 px, aside 295 px). Con `stretch` el filete lateral
     recorre todo el alto y el bloque se ancla arriba y abajo. */
  align-items: stretch;
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
}
.hero-content { max-width: 720px; }
.hero h1 {
  font-size: clamp(2.5rem, 5.5vw, 4.25rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: var(--ink);
  max-width: none;
  margin: 0 0 24px;
  text-wrap: balance;
}
.hero h1 .grad {
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  -webkit-text-fill-color: currentColor;
  color: var(--champagne-deep);
  font-weight: 800;
  position: relative;
  display: inline-block;
}
.hero h1 .grad::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.08em;
  height: 2px;
  background: var(--champagne);
  opacity: 0.55;
}
.hero-sub {
  font-size: 1.1875rem;
  line-height: 1.55;
  color: var(--ink-3);
  max-width: 580px;
  margin: 0 0 28px;
  font-weight: 400;
}
.hero-ctas {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 0;
  justify-content: flex-start;
}

/* Sidebar de cifras en el hero */
.hero-aside {
  border-left: 1.5px solid var(--hairline);
  padding-left: 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
/* El título del aside se alinea con el eyebrow, que es la primera línea de la
   columna izquierda: 11 px es la distancia medida entre el tope de la grilla y
   el tope del eyebrow. Así ambas columnas arrancan en la misma línea óptica. */
@media (min-width: 901px) {
  .hero-aside { padding-top: 11px; }
}
/* Ancla el pie al fondo de la columna: sin esto el stretch deja el hueco abajo */
.hero-aside-foot {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--stone);
}
.hero-aside-foot a {
  color: var(--champagne);
  font-weight: 500;
  text-decoration: none;
}
.hero-aside-foot a:hover { text-decoration: underline; }
@media (max-width: 900px) {
  .hero-aside-foot { margin-top: 4px; }
}
.hero-aside-title {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 4px;
}
.hero-stat { display: flex; flex-direction: column; gap: 2px; }
.hero-stat-n {
  font-family: 'Inter', sans-serif;
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: lining-nums;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.hero-stat-n .unit {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--stone);
  letter-spacing: 0.04em;
  text-transform: lowercase;
}
.hero-stat-l {
  font-size: 14px;
  color: var(--ink-3);
  font-weight: 400;
  line-height: 1.45;
}
@media (max-width: 900px) {
  .hero-aside { border-left: 0; border-top: 1.5px solid var(--hairline); padding-left: 0; padding-top: 32px; }
}

/* Buscador del Hero */
.hero-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 580px;
  margin: 0 0 24px;
  padding: 4px 4px 4px 18px;
  background: var(--paper);
  border: 1.5px solid var(--hairline-strong);
  border-radius: var(--r-md);
  box-shadow: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.hero-search:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
  transform: none;
}
.hero-search-icon { flex-shrink: 0; color: var(--stone); }
.hero-search input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-size: 16px;
  color: var(--ink);
  padding: 14px 4px;
  font-family: 'Inter', sans-serif;
}
.hero-search input:focus { outline: none; }
.hero-search input::placeholder { color: var(--stone); font-weight: 400; }
.hero-search .btn {
  flex-shrink: 0;
  border-radius: var(--r-md);
  padding: 14px 22px;
  font-size: 14px;
  font-weight: 600;
}
@media (max-width: 480px) {
  .hero-search { flex-wrap: wrap; border-radius: var(--r-md); padding: 10px; }
  .hero-search input { flex-basis: 100%; padding: 10px 8px; }
  .hero-search .btn { width: 100%; }
}

@media (max-width: 760px) { .hero { padding: 12px 0 56px; } }

/* ---- Botones ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 600;
  border: 1.5px solid transparent;
  transition: background .2s, color .2s, border-color .2s;
  min-height: 48px;
  box-shadow: none;
  background-image: none;
}
.btn-primary {
  background: var(--ink);
  color: var(--bone);
  border-color: var(--ink);
}
.btn-primary:hover {
  background: var(--ink-2);
  color: var(--bone);
  border-color: var(--ink-2);
  transform: none;
  box-shadow: none;
}
.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--hairline-strong);
}
.btn-secondary:hover {
  border-color: var(--ink);
  background: var(--paper);
  color: var(--ink);
  transform: none;
  box-shadow: none;
}
.btn .arrow {
  display: inline-block;
  transition: transform .2s;
}
.btn:hover .arrow { transform: translateX(3px); }

/* ============================================================
   SECCIONES
   ============================================================ */
section { padding: 96px 0; }
@media (max-width: 760px) { section { padding: 64px 0; } }
.section-head { max-width: 720px; margin-bottom: 56px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head.between {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
  max-width: none;
  gap: 40px;
}
@media (max-width: 760px) {
  .section-head.between { flex-direction: column; align-items: flex-start; }
}
.section-head h2 {
  font-size: clamp(1.875rem, 3.4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 12px;
  text-wrap: balance;
}
.section-desc { color: var(--ink-3); font-size: 1.0625rem; line-height: 1.6; max-width: 600px; }
.head-link {
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  padding: 8px 0;
}
.head-link::after { content: '→'; transition: transform .2s; }
.head-link:hover::after { transform: translateX(3px); }

/* ============================================================
   ÁREAS — grid 4 cols con hairline, sin colores
   ============================================================ */
.areas { padding-top: 0; position: relative; }
.areas .container { margin-top: 0; }
.areas-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1.5px solid var(--hairline);
  background: var(--paper);
}
@media (max-width: 900px) { .areas-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .areas-grid { grid-template-columns: 1fr; } }

.area-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 36px 28px;
  background: var(--paper);
  border: 0;
  border-right: 1.5px solid var(--hairline);
  border-radius: var(--r-md);
  box-shadow: none;
  min-height: 280px;
  overflow: hidden;
  transition: background .3s;
}
.area-card:last-child { border-right: 0; }
@media (max-width: 900px) {
  .area-card:nth-child(2n) { border-right: 0; }
  .area-card:nth-child(-n+2) { border-bottom: 1.5px solid var(--hairline); }
}
@media (max-width: 480px) {
  .area-card { border-right: 0; border-bottom: 1.5px solid var(--hairline); }
  .area-card:last-child { border-bottom: 0; }
}
.area-card::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2.5px;
  background: var(--champagne);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .4s cubic-bezier(.2,.8,.2,1);
}
.area-card:hover { background: var(--bone); border-color: var(--hairline-strong); transform: none; box-shadow: none; }
.area-card:hover::before { transform: scaleX(1); }

.area-num {
  font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--stone);
  font-variant-numeric: tabular-nums;
}
.area-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1.5px solid var(--hairline-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  margin-bottom: 4px;
  transition: none;
  box-shadow: none;
}
.area-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--ink);
  margin: 0;
}
.area-card p {
  font-size: 15px;
  color: var(--ink-3);
  line-height: 1.6;
  flex: 1;
  font-weight: 400;
}
.area-cta {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.area-cta::after { content: '→'; transition: transform .2s; }
.area-card:hover .area-cta::after { transform: translateX(4px); }
/* Quita color tints por categoría (era #db2777, #d97706, #059669) */
.areas-grid .area-card:nth-child(1) .area-icon,
.areas-grid .area-card:nth-child(2) .area-icon,
.areas-grid .area-card:nth-child(3) .area-icon,
.areas-grid .area-card:nth-child(4) .area-icon {
  background: transparent;
  color: var(--ink);
  border-color: var(--hairline-strong);
}
.areas-grid .area-card:hover { box-shadow: none; }

/* ============================================================
   HERRAMIENTAS / CALCULADORAS — 3 cols, hairline grid
   ============================================================ */
.tools { padding: 96px 0; }
.tools.bg-2 { background: var(--bone-2); }
.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5px;
  background: var(--hairline);
  border: 1.5px solid var(--hairline);
}
@media (max-width: 900px) { .tools-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .tools-grid { grid-template-columns: 1fr; } }

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 32px 28px;
  background: var(--paper);
  border: 0;
  border-radius: var(--r-md);
  box-shadow: none;
  min-height: 220px;
  overflow: hidden;
  transition: background .3s;
}
.tool-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 28px;
  height: 2.5px;
  background: var(--champagne);
  transition: width .4s cubic-bezier(.2,.8,.2,1);
}
.tool-card:hover {
  background: var(--bone);
  border-color: var(--hairline-strong);
  transform: none;
  box-shadow: none;
}
.tool-card:hover::after { width: 100%; }
.tool-card::before { display: none; }

.tool-card h3 {
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--ink);
  margin: 0;
}
.tool-card p {
  font-size: 15px;
  color: var(--ink-3);
  line-height: 1.6;
  flex: 1;
  font-weight: 400;
  margin: 0;
}
.tool-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
  transition: none;
  font-family: 'Inter', sans-serif;
  margin-top: 4px;
}
.tool-cta::after { content: '→'; transition: transform .2s; font-weight: 400; }
.tool-card:hover .tool-cta { gap: 6px; }
.tool-card:hover .tool-cta::after { transform: translateX(4px); }

.tool-card .tool-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--stone);
  font-variant-numeric: tabular-nums;
}
.tool-card .tool-meta .tag {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-md);
  color: var(--ink-3);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 500;
}

/* ============================================================
   SPOKES — guías, tarjetas similares a tool-card
   ============================================================ */
.spokes { padding: 0 0 16px; }
.spokes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}
@media (max-width: 800px) { .spokes-grid { grid-template-columns: 1fr; } }
.spoke-card {
  position: relative;
  display: block;
  padding: 28px 24px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--hairline);
  background: var(--paper);
  transition: background .2s, border-color .2s;
  box-shadow: none;
  min-height: 200px;
  overflow: hidden;
}
.spoke-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 24px;
  height: 2.5px;
  background: var(--champagne);
  transition: width .4s cubic-bezier(.2,.8,.2,1);
}
.spoke-card:hover {
  background: var(--bone);
  border-color: var(--hairline-strong);
  transform: none;
  box-shadow: none;
}
.spoke-card:hover::after { width: 100%; }
.spoke-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.spoke-card p {
  font-size: 15px;
  color: var(--ink-3);
  line-height: 1.6;
  font-weight: 400;
}
.spoke-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: transparent;
  padding: 4px 10px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-md);
  margin-bottom: 14px;
  font-family: 'Inter', sans-serif;
}

/* ============================================================
   JUZGADOS — lista minimal
   ============================================================ */
.juzgados-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0;
  margin-top: 0;
  border-top: 1.5px solid var(--hairline);
}
@media (max-width: 400px) { .juzgados-grid { grid-template-columns: 1fr; } }
.juzgado-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 8px;
  background: transparent;
  border: 0;
  border-bottom: 1.5px solid var(--hairline);
  border-radius: 0;
  text-align: left;
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  letter-spacing: -0.01em;
  box-shadow: none;
  min-height: 64px;
  transition: padding .2s, color .2s;
}
.juzgado-card:hover {
  background: transparent;
  color: var(--champagne-deep);
  border-color: var(--hairline);
  transform: none;
  box-shadow: none;
}
.juzgado-card::after {
  content: '→';
  color: var(--stone);
  font-size: 18px;
  transition: transform .2s, color .2s;
}
.juzgado-card:hover::after { color: var(--champagne); transform: translateX(3px); }

/* ============================================================
   BREADCRUMBS — compactos
   ============================================================ */
.breadcrumbs {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  margin: 0 0 16px;
  font-size: 13.5px;
  background: transparent;
  border-radius: 0;
  color: var(--ink-4);
  font-weight: 500;
}
.breadcrumbs a { color: var(--ink-4); font-weight: 500; }
.breadcrumbs a:hover { color: var(--ink); text-decoration: underline; }
.breadcrumbs .sep { color: var(--stone-2); }
.breadcrumbs .current { color: var(--ink); font-weight: 600; }

/* ============================================================
   PÁGINAS DE ARTÍCULO (pilares, guías, glosario, calculadoras)
   ============================================================ */
.pilar { padding: 0 0 64px; }
.pilar > section { padding: 40px 0 0; }
.pilar > section:first-of-type { padding-top: 24px; }
.pilar > section:last-child { padding-bottom: 0; }
.pilar-header { margin: 0 0 24px; max-width: 760px; }
.pilar-header h1 {
  font-size: clamp(2.25rem, 4.5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin: 12px 0 16px;
  text-wrap: balance;
}
.pilar-desc {
  font-size: 1.1875rem;
  color: var(--ink-3);
  line-height: 1.55;
  font-weight: 400;
  max-width: 720px;
}

/* Disclaimer */
.disclaimer {
  display: block;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-left: 4px solid var(--warn-text);
  padding: 16px 20px;
  border-radius: var(--r-md);
  margin: 0 0 40px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--warn-text);
  box-shadow: none;
}
.disclaimer strong { font-weight: 700; }

/* Spokes wrappers de páginas pilar */
.guias-home, .herramientas-home { padding: 0 0 16px; }

/* ============================================================
   FAQ
   ============================================================ */
/* Sin margin-top: la sección anterior ya aporta su padding-bottom de 96 px y
   los 56 px se sumaban encima → 152 px de hueco entre el CTA y las FAQ. */
.faq { margin-top: 0; max-width: 800px; }
.faq h2 { margin-bottom: 24px; font-size: clamp(1.5rem, 2.6vw, 2rem); }
.faq-item {
  position: relative;
  background: var(--paper);
  border: 1.5px solid var(--hairline);
  border-radius: 4px;
  padding: 0;
  margin-bottom: 8px;
  transition: background .18s ease, border-color .18s ease;
}
.faq-item:last-of-type { margin-bottom: 0; }
.faq-item::before { display: none; }
.faq-item:hover { border-color: var(--ink); }
.faq-item[open] { background: var(--bone); border-color: var(--ink); }
.faq-item > summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 56px 18px 22px;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  position: relative;
  user-select: none;
}
.faq-item > summary::-webkit-details-marker { display: none; }
/* Indicador + / - con SVG inline: centrado pixel-perfect, sin depender
   del baseline del glifo en la fuente. viewBox 26x26, icono 14x14 dentro
   del circulo 26x26 -> 6px de margen perimetral. */
.faq-item > summary::after {
  content: '';
  position: absolute;
  right: 18px;
  top: 50%;
  width: 26px;
  height: 26px;
  background-color: var(--bone-2);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 26'%3E%3Cg stroke='%23404040' stroke-width='1.8' stroke-linecap='round' fill='none'%3E%3Cline x1='13' y1='8' x2='13' y2='18'/%3E%3Cline x1='8' y1='13' x2='18' y2='13'/%3E%3C/g%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 14px 14px;
  border-radius: 50%;
  transform: translateY(-50%);
  transition: background-color .2s ease;
}
.faq-item[open] > summary::after {
  background-color: var(--ink);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 26'%3E%3Cg stroke='%23FAF8F4' stroke-width='1.8' stroke-linecap='round' fill='none'%3E%3Cline x1='8' y1='13' x2='18' y2='13'/%3E%3C/g%3E%3C/svg%3E");
}
.faq-item > summary:hover { color: var(--ink); }
.faq-item > summary:hover::after { background-color: var(--bone-3); }
.faq-answer {
  padding: 0 22px 20px 22px;
  font-size: 15.5px;
  color: var(--ink-3);
  line-height: 1.7;
  border-top: 1px solid var(--hairline);
  margin-top: -1px;
}
.faq-answer p { margin: 16px 0 0; }
.faq-answer p:first-child { margin-top: 14px; }
.faq-answer a { font-weight: 500; }

/* ============================================================
   CALCULADORAS — formulario + panel
   ============================================================ */
.calc-hero { padding: 32px 0 40px; }
.calc-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 32px;
  align-items: start;
}
@media (max-width: 860px) { .calc-layout { grid-template-columns: 1fr; } }

.calc-card {
  background: var(--paper);
  border: 1.5px solid var(--hairline);
  border-radius: 4px;
  padding: 32px;
  box-shadow: none;
}
@media (max-width: 480px) { .calc-card { padding: 24px 18px; } }

.calc-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hairline);
}
.calc-card-title::before {
  content: '';
  width: 28px;
  height: 1.5px;
  background: var(--champagne);
  border-radius: var(--r-md);
  box-shadow: none;
}

.field { margin-bottom: 22px; }
.field-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}
.field-hint { font-size: 12.5px; font-weight: 400; color: var(--stone); }
.field-note {
  margin: 8px 2px 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--stone);
}
.field-input-wrap { position: relative; display: flex; align-items: center; }
.field-prefix {
  position: absolute;
  left: 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--stone);
  pointer-events: none;
}
.field-input {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border: 1.5px solid var(--hairline-strong);
  border-radius: var(--r-md);
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: border-color .15s ease, box-shadow .15s ease;
  appearance: none;
  -moz-appearance: textfield;
}
.field-input::-webkit-outer-spin-button,
.field-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.field-input.has-prefix { padding-left: 34px; }
.field-input::placeholder { color: var(--stone); font-weight: 400; }
.field-input:hover { border-color: var(--ink-4); }
.field-input:focus {
  outline: none;
  border-color: var(--ink);
  background: var(--paper);
  box-shadow: 0 0 0 3px var(--champagne-glow);
}

/* Segmentado (sí/no) */
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 1fr;
  gap: 6px;
  padding: 5px;
  background: var(--bone-2);
  border: 1.5px solid var(--hairline-strong);
  border-radius: var(--r-md);
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.3;
  min-height: 52px;
  padding: 11px 12px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-3);
  cursor: pointer;
  transition: all .16s ease;
  user-select: none;
}
.segmented label:hover { color: var(--ink); }
.segmented input:checked + label {
  background: var(--ink);
  color: var(--bone);
  box-shadow: none;
}
.segmented input:focus-visible + label {
  outline: 2px solid var(--champagne);
  outline-offset: 1px;
}

.calc-live-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 13px;
  color: var(--stone);
}
.calc-live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ok);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* Panel de resultado (calculadora) — más claro y editorial */
.calc-result-panel {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  border-radius: 4px;
  background: var(--bone-2);
  color: var(--ink);
  padding: 32px;
  box-shadow: none;
  border: 1.5px solid var(--hairline);
  overflow: hidden;
}
.calc-result-panel::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2.5px;
  background: var(--champagne);
}
@media (max-width: 860px) { .calc-result-panel { position: static; } }
@media (max-width: 480px) { .calc-result-panel { padding: 24px 20px; } }

.result-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--champagne-deep);
  margin-bottom: 8px;
}
.result-total {
  font-size: clamp(2.25rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--ink);
  text-shadow: none;
}
.result-total-sub {
  font-size: 13.5px;
  color: var(--ink-4);
  margin-bottom: 24px;
  font-weight: 400;
}

.result-rows { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--hairline);
}
.result-row:last-child { border-bottom: 0; }
.result-row-label { font-size: 14px; color: var(--ink-3); font-weight: 400; }
.result-row-value {
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--ink);
}
.result-row.muted .result-row-value { color: var(--ink-3); }

.result-bar {
  height: 8px;
  border-radius: var(--r-md);
  background: var(--hairline);
  overflow: hidden;
  display: flex;
  margin-bottom: 20px;
}
.result-bar span {
  display: block;
  height: 100%;
  transition: width .4s ease;
}
.result-bar .seg-anios { background: var(--champagne); }
.result-bar .seg-aviso { background: var(--ink-4); }
.result-bar .seg-vacaciones { background: #2E7D4F; }
.result-bar .seg-dias { background: #B87333; }

.result-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12.5px;
  color: var(--ink-3);
  margin-bottom: 20px;
}
.result-legend i {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: var(--r-md);
  margin-right: 6px;
}
.result-legend .l-anios i { background: var(--champagne); }
.result-legend .l-aviso i { background: var(--ink-4); }
.result-legend .l-vacaciones i { background: #2E7D4F; }
.result-legend .l-dias i { background: #B87333; }

.result-note {
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-4);
  font-weight: 400;
}
.result-panel-note {
  margin: 14px 0 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-3);
}
.result-empty {
  padding: 12px 0 20px;
  color: var(--ink-3);
  font-size: 15px;
  line-height: 1.6;
}

/* Tool info (bajo la calculadora) */
.tool-info {
  margin-top: 64px;
  padding-top: 40px;
  border-top: 1px solid var(--hairline);
  max-width: 760px;
}
.tool-info h2 {
  position: relative;
  padding-left: 16px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 16px;
}
.tool-info h2::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--champagne);
  border-radius: 0;
}
.tool-info h3 {
  font-size: 1.1875rem;
  font-weight: 700;
  margin: 28px 0 10px;
  color: var(--ink);
}
.tool-info p, .tool-info li {
  font-size: 16.5px;
  color: var(--ink-2);
  line-height: 1.7;
  margin-bottom: 14px;
  font-weight: 400;
}
.tool-info ul, .tool-info ol { padding-left: 24px; }

/* ============================================================
   GUÍAS: pasos numerados
   ============================================================ */
.steps { counter-reset: step; margin: 32px 0; max-width: 800px; position: relative; }
.step {
  position: relative;
  padding: 24px 26px 24px 78px;
  background: var(--paper);
  border: 1.5px solid var(--hairline);
  border-radius: var(--r-md);
  margin-bottom: 14px;
  counter-increment: step;
  transition: background .18s ease, border-color .18s ease;
}
.step:hover { box-shadow: none; border-color: var(--hairline-strong); background: var(--bone); }
.step::before {
  content: counter(step);
  position: absolute;
  left: 22px; top: 24px;
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bone-2);
  color: var(--ink);
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  border: 1.5px solid var(--hairline-strong);
}
@media (min-width: 640px) {
  .step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 39px; top: 66px; bottom: -16px;
    width: 1.5px;
    background: var(--hairline);
  }
}
.step h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.step p {
  font-size: 15.5px;
  color: var(--ink-3);
  line-height: 1.65;
}

/* ============================================================
   ARTÍCULO LARGO (guías, glosario, publicar-estudio)
   ============================================================ */
.article-body { max-width: 760px; }
.article-body h2 {
  position: relative;
  padding-left: 16px;
  font-size: clamp(1.625rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 48px 0 16px;
}
.article-body h2::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--champagne);
  border-radius: 0;
}
.article-body h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 32px 0 10px;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.article-body p, .article-body li {
  font-size: 16.5px;
  color: var(--ink-2);
  line-height: 1.75;
  margin-bottom: 14px;
  font-weight: 400;
}
.article-body ul, .article-body ol { padding-left: 24px; margin-bottom: 14px; }
.article-body li { margin-bottom: 8px; }
.article-body a { font-weight: 500; }

.article-body table, .tool-info table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0 26px;
  font-size: 14.5px;
  background: var(--paper);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: none;
  border: 1.5px solid var(--hairline);
}
.article-body th, .tool-info th {
  background: var(--bone-2);
  color: var(--ink);
  font-weight: 700;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1.5px solid var(--hairline);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.article-body td, .tool-info td {
  padding: 12px 16px;
  border-top: 1px solid var(--hairline);
  color: var(--ink-2);
}
.article-body tr:hover td, .tool-info tr:hover td { background: var(--bone); }

.callout {
  display: block;
  background: var(--bone-2);
  border: 1.5px solid var(--hairline);
  border-left: 4px solid var(--champagne);
  border-radius: var(--r-md);
  padding: 20px 28px !important;
  margin: 24px 0;
  font-size: 15.5px;
  color: var(--ink-2);
  line-height: 1.65;
  box-shadow: none;
  box-sizing: border-box;
}
.callout strong { color: var(--ink); }

/* ============================================================
   PÁGINAS DE JUZGADOS
   ============================================================ */
.courts-list { display: flex; flex-direction: column; gap: 0; margin: 28px 0; border-top: 1.5px solid var(--hairline); }
.court-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 20px;
  padding: 22px 8px;
  background: transparent;
  border: 0;
  border-bottom: 1.5px solid var(--hairline);
  border-radius: 0;
  transition: padding .18s ease, background .18s ease;
}
.court-card:hover {
  border-color: var(--hairline-strong);
  box-shadow: none;
  transform: none;
  background: var(--bone);
  padding-left: 16px;
}
@media (max-width: 560px) { .court-card { grid-template-columns: 1fr; } }
.court-name {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.court-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 14px;
  color: var(--ink-3);
}
.court-meta span { display: inline-flex; align-items: center; gap: 6px; }
.court-badge {
  align-self: start;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: transparent;
  padding: 4px 10px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-md);
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
}

.official-link-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--bone-2);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-md);
  padding: 20px 24px;
  margin-top: 32px;
  font-size: 14.5px;
  color: var(--ink-3);
}

/* 404 / coming soon */
.coming-soon {
  text-align: center;
  padding: 48px;
  color: var(--stone);
  font-size: 16px;
}

/* ============================================================
   DIRECTORIO — buscador, filtros y tarjetas
   ============================================================ */
.directorio { margin-top: 40px; }
.dir-toolbar {
  background: var(--paper);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1.5px solid var(--hairline);
  border-radius: 4px;
  padding: 20px 22px;
  box-shadow: none;
  margin: 0 0 32px;
}
.dir-search-wrap { position: relative; margin-bottom: 16px; }
.dir-search-icon {
  position: absolute;
  left: 16px; top: 50%;
  transform: translateY(-50%);
  color: var(--stone);
  pointer-events: none;
}
.dir-search {
  width: 100%;
  padding: 14px 16px 14px 46px;
  font-size: 15.5px;
  border: 1.5px solid var(--hairline-strong);
  border-radius: var(--r-md);
  background: var(--paper);
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
  font-family: 'Inter', sans-serif;
}
.dir-search:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--champagne-glow);
}
.dir-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.dir-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.dir-pill {
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 500;
  border: 1.5px solid var(--hairline-strong);
  border-radius: var(--r-md);
  background: var(--paper);
  color: var(--ink-2);
  cursor: pointer;
  transition: all .15s ease;
  font-family: 'Inter', sans-serif;
}
.dir-pill:hover { border-color: var(--ink); color: var(--ink); }
.dir-pill.active {
  background: var(--ink);
  color: var(--bone);
  border-color: var(--ink);
}

.dir-note { color: var(--ink-3); font-size: 15px; margin-bottom: 20px; }
.comunas-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.comuna-link {
  padding: 10px 18px;
  border-radius: var(--r-md);
  background: var(--paper);
  border: 1.5px solid var(--hairline-strong);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  transition: all .15s ease;
}
.comuna-link:hover {
  background: var(--ink);
  color: var(--bone);
  border-color: var(--ink);
  transform: none;
  text-decoration: none;
}

/* ============================================================
   TARJETAS DE ABOGADOS (directorio)
   ============================================================ */
.ab-card {
  display: block;
  padding: 22px;
  background: var(--paper);
  border: 1.5px solid var(--hairline);
  border-radius: 4px;
  transition: background .2s, border-color .2s;
  position: relative;
  overflow: hidden;
}
.ab-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 24px; height: 2.5px;
  background: var(--champagne);
  transition: width .4s cubic-bezier(.2,.8,.2,1);
}
.ab-card:hover { background: var(--bone); border-color: var(--hairline-strong); transform: none; box-shadow: none; }
.ab-card:hover::after { width: 100%; }
.ab-card h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.ab-card .ab-meta { font-size: 14px; color: var(--ink-3); line-height: 1.5; margin: 0 0 12px; }
.ab-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: transparent;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-md);
  font-family: 'Inter', sans-serif;
}
.ab-laboral, .ab-familia, .ab-penal, .ab-herencias {
  background: transparent;
  color: var(--ink-3);
  border: 1px solid var(--hairline-strong);
}
.ab-mini {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  min-height: 96px;
  background: var(--paper);
  border: 1.5px solid var(--hairline);
  border-radius: var(--r-md);
  transition: background .18s ease, border-color .18s ease;
}
.ab-mini:hover { background: var(--bone); border-color: var(--hairline-strong); }
.ab-mini h4 { font-size: 0.9375rem; font-weight: 600; color: var(--ink); margin: 0; line-height: 1.35; }
.ab-mini p,
.ab-mini .ab-mini-meta { font-size: 13px; color: var(--ink-3); margin: 0; margin-top: auto; }
.ab-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 16px 0;
}
@media (max-width: 720px) { .ab-mini-grid { grid-template-columns: 1fr; } }
.ab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 500;
  border: 1.5px solid var(--hairline-strong);
  border-radius: var(--r-md);
  background: var(--paper);
  color: var(--ink);
  transition: all .15s ease;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
}
.ab-btn:hover { border-color: var(--ink); background: var(--ink); color: var(--bone); text-decoration: none; }
.ab-btn-tel, .ab-btn-ficha, .ab-btn-maps, .ab-btn-web {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--hairline-strong);
}

/* Fichas (página individual de estudio) */
.ficha-row {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 15px;
}
.ficha-row:last-child { border-bottom: 0; }
.ficha-label { width: 140px; flex-shrink: 0; color: var(--ink-3); font-weight: 500; }
.ficha-info { color: var(--ink); flex: 1; min-width: 0; word-break: break-word; overflow-wrap: anywhere; }
.ficha-mapa { margin-top: 24px; min-width: 0; }
.ficha-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 32px; align-items: start; }
@media (max-width: 900px) { .ficha-grid { grid-template-columns: 1fr; gap: 24px; } }

/* ---- FICHA: Datos de contacto (cards con iconos) ---- */
.ficha-contact-list { display: flex; flex-direction: column; gap: 8px; margin: 0 0 32px; }
.ficha-contact-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--paper);
  border: 1.5px solid var(--hairline);
  border-radius: var(--r-md);
  text-decoration: none;
  color: inherit;
  transition: background .18s ease, border-color .18s ease;
}
a.ficha-contact-card:hover { background: var(--bone-2); border-color: var(--hairline-strong); text-decoration: none; }
.ficha-contact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--bone-2);
  border: 1.5px solid var(--hairline);
  border-radius: 50%;
  color: var(--ink);
  flex-shrink: 0;
}
a.ficha-contact-card:hover .ficha-contact-icon { background: var(--paper); border-color: var(--ink); }
.ficha-contact-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.ficha-contact-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--stone);
}
.ficha-contact-value {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
  word-break: break-word;
}

/* ---- FICHA: Sidebar (mapa + CTAs) ---- */
.ficha-sidebar { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ficha-map-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 24px 24px;
  background: var(--bone-2);
  border: 1.5px solid var(--hairline);
  border-radius: var(--r-md);
  overflow: hidden;
}
/* Grid pattern sutil para evocar un mapa, sin ser literal */
.ficha-map-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--hairline) 1px, transparent 1px),
    linear-gradient(to bottom, var(--hairline) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}
.ficha-map-icon-wrap {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  margin-bottom: 18px;
  box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.4);
}
.ficha-map-title {
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--stone);
  margin: 0 0 6px;
}
.ficha-map-dir {
  position: relative;
  z-index: 1;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 2px;
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.ficha-map-comuna {
  position: relative;
  z-index: 1;
  font-size: 13.5px;
  color: var(--ink-3);
  margin: 0 0 20px;
  font-weight: 400;
}
.ficha-map-btn { position: relative; z-index: 1; width: 100%; }

/* ---- FICHA: Stack de CTAs (botones apilados) ---- */
.ficha-cta-stack { display: flex; flex-direction: column; gap: 8px; }
.ficha-cta-stack .btn {
  width: 100%;
  justify-content: center;
  min-height: 48px;
}
.ficha-cta-stack .btn svg { flex-shrink: 0; }
.comuna-chip, .comunas-chip, .comuna-chip-online {
  display: inline-block;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  background: var(--paper);
  border: 1.5px solid var(--hairline-strong);
  border-radius: var(--r-md);
  margin: 3px 4px 3px 0;
  text-decoration: none;
}
.comuna-chip:hover { background: var(--ink); color: var(--bone); border-color: var(--ink); text-decoration: none; }

/* Glosario */
.glosario-list, .glosario-grid { display: grid; gap: 0; }
.glosario-item, .glosario-card {
  padding: 22px 4px;
  border-bottom: 1.5px solid var(--hairline);
}
.glosario-item h3, .glosario-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.glosario-item p, .glosario-card p {
  font-size: 15.5px;
  color: var(--ink-3);
  line-height: 1.65;
  margin: 0;
}

/* Guide-card alias */
.guide-card {
  position: relative;
  display: block;
  padding: 28px 24px;
  background: var(--paper);
  border: 1.5px solid var(--hairline);
  border-radius: var(--r-md);
  transition: background .2s, border-color .2s;
  min-height: 200px;
  overflow: hidden;
}
.guide-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 24px; height: 2.5px;
  background: var(--champagne);
  transition: width .4s cubic-bezier(.2,.8,.2,1);
}
.guide-card:hover { background: var(--bone); border-color: var(--hairline-strong); transform: none; box-shadow: none; }
.guide-card:hover::after { width: 100%; }
.guide-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.guide-card p {
  font-size: 15px;
  color: var(--ink-3);
  line-height: 1.6;
  margin: 0;
}

/* ============================================================
   PUBLICAR ESTUDIO — formulario
   ============================================================ */
.pub-form, .form-card {
  background: var(--paper);
  border: 1.5px solid var(--hairline);
  border-radius: 4px;
  padding: 32px;
  margin: 24px 0;
}
.pub-form h2, .form-card h2 { font-size: 1.5rem; margin: 0 0 20px; }
.form-group, .pub-field { margin-bottom: 18px; }
.form-group label, .pub-field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink);
}
.form-group input, .form-group select, .form-group textarea,
.pub-field input, .pub-field select, .pub-field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1.5px solid var(--hairline-strong);
  border-radius: var(--r-md);
  background: var(--paper);
  color: var(--ink);
  font-size: 15.5px;
  font-family: 'Inter', sans-serif;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus,
.pub-field input:focus, .pub-field select:focus, .pub-field textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--champagne-glow);
}
.form-group textarea, .pub-field textarea { min-height: 100px; resize: vertical; }
.form-row, .pub-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row, .pub-row { grid-template-columns: 1fr; } }

/* ============================================================
   FOOTER — dark editorial
   ============================================================ */
.site-footer {
  background: var(--ink);
  color: var(--stone-2);
  padding: 80px 0 32px;
  /* Sin margin-top: su propio padding-top de 80 px ya separa. El margen extra
     se sumaba al padding-bottom de la última sección → 256 px antes del pie. */
  margin-top: 0;
  position: relative;
}
.site-footer::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 24px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 24' preserveAspectRatio='none'><path d='M0,24 C200,4 400,4 600,14 C800,24 1000,4 1200,14 L1200,24 L0,24 Z' fill='%230A0A0A'/></svg>");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  pointer-events: none;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 56px;
  margin-bottom: 64px;
}
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; gap: 32px; } }
.footer-brand .logo { color: var(--bone); }
.footer-brand .logo-text { color: var(--bone); }
.footer-brand .logo-text .sub { color: var(--stone-2); }
.footer-brand .logo-icon { border-color: var(--bone); color: var(--bone); }
.footer-brand .logo:hover .logo-icon { background: var(--bone); color: var(--ink); }
.footer-desc {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--stone-2);
  max-width: 340px;
  margin-top: 20px;
  font-weight: 400;
}
.footer-links h3 {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone);
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}
.footer-links a {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: var(--stone-2);
  padding: 7px 0;
  transition: color .15s ease, padding .15s ease;
  font-weight: 400;
  min-height: 36px;
}
.footer-links a:hover { color: var(--bone); padding-left: 4px; text-decoration: none; }
.footer-contact .email-card {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  margin-top: 4px;
}
.footer-contact .email-label {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--stone);
  display: block;
  margin-bottom: 6px;
}
.footer-contact .email-value {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: var(--bone);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.footer-contact .copy-btn {
  background: transparent;
  color: var(--bone);
  border: 1px solid rgba(255, 255, 255, 0.20);
  padding: 9px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: var(--r-md);
  transition: background .2s ease, border-color .2s ease;
  white-space: nowrap;
  min-height: 36px;
}
.footer-contact .copy-btn:hover { background: rgba(255, 255, 255, 0.06); border-color: var(--bone); }

.footer-bottom {
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--stone);
  font-weight: 400;
}
.footer-bottom a { color: var(--stone-2); }
.footer-bottom a:hover { color: var(--bone); text-decoration: none; }
@media (max-width: 600px) {
  .footer-bottom { flex-direction: column; gap: 10px; text-align: center; }
}

/* ============================================================
   MOBILE DRAWER (mantenido)
   ============================================================ */
.mobile-drawer { display: none; }
@media (max-width: 960px) {
  .mobile-drawer { display: block; }
}
.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  visibility: hidden;
  overflow: hidden;
}
.mobile-drawer.open { pointer-events: auto; visibility: visible; }
.mobile-drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.32);
  opacity: 0;
  transition: opacity .25s ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.mobile-drawer.open .mobile-drawer-overlay { opacity: 1; }
.mobile-drawer-content {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(380px, 88vw);
  background: var(--bone);
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--hairline);
  box-shadow: -8px 0 32px rgba(10, 10, 10, 0.08);
}
.mobile-drawer.open .mobile-drawer-content { transform: translateX(0); }
.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid var(--hairline);
}
.mobile-drawer-close {
  background: none;
  border: 1.5px solid var(--hairline-strong);
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  font-size: 18px;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
}
.mobile-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 32px;
}
.nav-group { padding: 16px 22px; border-bottom: 1px solid var(--hairline); }
.nav-group:last-child { border-bottom: 0; }
.nav-group-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--stone);
  display: block;
  margin-bottom: 12px;
}
.nav-group-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.nav-group-link { font-size: 13px; color: var(--ink-2); }
.nav-item-highlight {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bone-2);
  border: 1.5px solid var(--hairline);
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--ink);
  transition: background .15s;
}
.nav-item-highlight:hover { background: var(--bone-3); text-decoration: none; }
.nav-item-label { font-size: 15.5px; font-weight: 600; display: block; }
.nav-item-desc { font-size: 13px; color: var(--ink-3); display: block; margin-top: 2px; }
.nav-icon { display: inline-flex; align-items: center; justify-content: center; color: var(--ink-3); flex-shrink: 0; }
.nav-item-starred {
  display: flex;
  align-items: center;
  padding: 10px 0;
  font-size: 15px;
  color: var(--ink);
  border-bottom: 1px solid var(--hairline);
  font-weight: 600;
}
.nav-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.nav-badge-item {
  padding: 12px 14px;
  text-align: center;
  background: var(--bone-2);
  border: 1.5px solid var(--hairline);
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}
.nav-badge-item:hover { background: var(--ink); color: var(--bone); text-decoration: none; border-color: var(--ink); }
.nav-sub-list a {
  display: flex;
  align-items: center;
  padding: 11px 0;
  font-size: 15px;
  color: var(--ink-2);
  border-bottom: 1px solid var(--hairline);
}
.nav-sub-list a:last-child { border-bottom: 0; }
.nav-sub-list a:hover { color: var(--ink); }

/* ============================================================
   320px SAFETY
   ============================================================ */
@media (max-width: 380px) {
  body { font-size: 16.5px; }
  .hero h1 { letter-spacing: -0.03em; }
  .hero-ctas .btn { width: 100%; }
  .area-card, .tool-card { padding: 28px 20px; }
  .footer-contact .email-card { flex-direction: column; align-items: flex-start; }
  .footer-contact .copy-btn { width: 100%; text-align: center; }
  .section-head.between { gap: 16px; }
  .footer-grid { gap: 24px; }
  .pilar-header h1 { font-size: 2rem; }
  .h-display, .hero h1 { font-size: 2.25rem; }
}

/* ============================================================
   PATCH v3.1: Clases faltantes detectadas por audit
   ============================================================ */

/* Home: sección Juzgados (apoya el <section class="juzgados"> del build) */
.juzgados { padding: 96px 0; }
@media (max-width: 760px) { .juzgados { padding: 64px 0; } }
.juzgados .juzgados-grid { margin-top: 32px; }

/* ---- DIRECTORIO: header + toolbar + grid + cards ---- */
.dir-header { margin: 0 0 32px; max-width: 760px; }
.dir-header h1 { margin: 12px 0 16px; }

.dir-select {
  padding: 8px 32px 8px 14px;
  font-size: 13.5px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  border: 1.5px solid var(--hairline-strong);
  border-radius: var(--r-md);
  background: var(--paper);
  color: var(--ink-2);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23767676' stroke-width='1.5'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
}
.dir-select:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--champagne-glow);
}

.dir-count {
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--stone);
  text-transform: uppercase;
  margin: 0 0 16px;
}
.dir-count strong {
  color: var(--ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 16px;
  margin: 16px 0 32px;
}
@media (max-width: 720px) { .ab-grid { grid-template-columns: 1fr; } }

.ab-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 22px;
  background: var(--paper);
  border: 1.5px solid var(--hairline);
  border-radius: 4px;
  transition: background .2s, border-color .2s;
  position: relative;
  overflow: hidden;
}
.ab-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 24px; height: 2.5px;
  background: var(--champagne);
  transition: width .4s cubic-bezier(.2,.8,.2,1);
}
.ab-card:hover { background: var(--bone); border-color: var(--hairline-strong); }
.ab-card:hover::after { width: 100%; }

.ab-card-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.ab-card-main h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  margin: 6px 0 4px;
  letter-spacing: -0.015em;
  color: var(--ink);
  line-height: 1.3;
}
.ab-card-main h3 a { color: inherit; }
.ab-card-main h3 a:hover { color: var(--ink); text-decoration: underline; }
.ab-card-main .ab-meta { font-size: 14px; color: var(--ink-3); line-height: 1.45; margin: 0 0 8px; font-weight: 400; }
.ab-card-main .ab-nota {
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.55;
  margin: 0;
  font-weight: 400;
  font-style: italic;
}

.ab-verified-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--champagne-deep);
  background: var(--bone-2);
  border: 1px solid var(--hairline-strong);
  border-radius: 2px;
  padding: 3px 8px;
  text-transform: uppercase;
  font-family: 'Inter', sans-serif;
}
.ab-verified-tag svg { stroke: var(--champagne-deep); }

.ab-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
}
.ab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 500;
  border: 1.5px solid var(--hairline-strong);
  border-radius: var(--r-md);
  background: var(--paper);
  color: var(--ink);
  transition: all .15s ease;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  min-height: 36px;
}
.ab-btn:hover { border-color: var(--ink); background: var(--ink); color: var(--bone); text-decoration: none; }
.ab-btn-tel, .ab-btn-ficha, .ab-btn-maps, .ab-btn-wa, .ab-btn-web {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--hairline-strong);
}
.ab-btn-wa svg { vertical-align: middle; }

.ab-empty {
  text-align: center;
  padding: 48px 24px;
  background: var(--bone-2);
  border: 1.5px dashed var(--hairline-strong);
  border-radius: 4px;
  margin: 16px 0;
}
.ab-empty h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 8px;
}
.ab-empty p {
  font-size: 15px;
  color: var(--ink-3);
  margin: 0 0 18px;
  font-weight: 400;
}

/* ---- LEGAL TIPS BOX (debajo del directorio) ---- */
.legal-tips-box {
  margin: 40px 0 0;
  padding: 32px 36px !important;
  background: var(--bone-2);
  border: 1.5px solid var(--hairline);
  border-left: 4px solid var(--champagne);
  border-radius: 4px;
  max-width: 880px;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box;
}
.legal-tips-box > * { max-width: 100%; }
.legal-tips-box h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.legal-tips-box > p { margin: 0 0 24px; font-size: 15px; color: var(--ink-3); font-weight: 400; }
.legal-tips-box > p a { color: var(--champagne-deep); font-weight: 500; }
.legal-tips-list { display: flex; flex-direction: column; gap: 18px; }
.legal-tip-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.6;
  font-weight: 400;
}
.legal-tip-item strong { color: var(--ink); font-weight: 700; }
.legal-tip-item a { color: var(--champagne-deep); font-weight: 500; }
.legal-tip-num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bone);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 560px) {
  .legal-tips-box { padding: 24px 18px; }
  .legal-tip-item { flex-direction: column; gap: 8px; }
}

/* ---- FICHAS: clases que faltan ---- */
.ficha-header { margin: 0 0 28px; max-width: 760px; }
.ficha-header h1 { margin: 12px 0 16px; }
.ficha-nota {
  display: block;
  background: var(--bone-2);
  border: 1.5px solid var(--hairline);
  border-left: 4px solid var(--champagne);
  border-radius: 4px;
  padding: 16px 20px;
  margin: 0 0 32px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
  font-weight: 400;
  max-width: 800px;
}
.ficha-nota strong { color: var(--ink); font-weight: 700; }
.ficha-nota a { color: var(--champagne-deep); font-weight: 500; }
.ficha-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 24px;
}
/* ---- FICHA: Banner CTA al final (oscuro, full-width) ---- */
.ficha-cta {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  align-items: center;
  gap: 32px;
  padding: 36px 40px;
  margin: 40px 0 32px;
  background: var(--ink);
  border-radius: var(--r-md);
  color: var(--bone);
  position: relative;
  overflow: hidden;
}
.ficha-cta::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2.5px;
  background: var(--champagne);
}
.ficha-cta h2 {
  font-size: clamp(1.375rem, 2.4vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--bone);
  margin: 0;
  line-height: 1.2;
  text-wrap: balance;
}
.ficha-cta p {
  font-size: 14.5px;
  color: var(--stone-2);
  margin: 0;
  line-height: 1.55;
}
.ficha-cta .btn { flex-shrink: 0; }
@media (max-width: 760px) {
  .ficha-cta {
    grid-template-columns: 1fr;
    text-align: left;
    padding: 28px 24px;
    gap: 16px;
  }
  .ficha-cta .btn { width: 100%; justify-content: center; }
}
.ficha-mapa-nota { font-size: 13px; color: var(--ink-3); margin-top: 8px; line-height: 1.5; }
.ficha-comunas { margin: 32px 0; }
.ficha-comunas h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  margin: 0 0 14px;
}
.comuna-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ficha-relacionados { margin: 40px 0; }
.ficha-relacionados h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  margin: 0 0 16px;
}
.ficha-volver { margin: 32px 0 0; }
.ficha-volver a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  padding: 8px 0;
}
.ficha-volver a:hover { color: var(--ink); text-decoration: none; }
.ficha-volver a::before { content: '\2190'; display: inline-block; margin-right: 6px; transition: transform .2s; }
.ficha-volver a:hover::before { transform: translateX(-3px); }

.ab-mini-meta {
  font-size: 12.5px;
  color: var(--stone);
  margin: 4px 0 0;
  font-weight: 400;
}

/* ---- GLOSARIO ---- */
.dir-filters-card {
  background: var(--paper);
  border: 1.5px solid var(--hairline);
  border-radius: 4px;
  padding: 20px 22px;
  margin: 0 0 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.glo-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 24px;
  background: var(--paper);
  border: 1.5px solid var(--hairline);
  border-radius: 4px;
  transition: background .2s, border-color .2s;
  position: relative;
  overflow: hidden;
}
.glo-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 24px; height: 2.5px;
  background: var(--champagne);
  transition: width .4s cubic-bezier(.2,.8,.2,1);
}
.glo-card:hover { background: var(--bone); border-color: var(--hairline-strong); }
.glo-card:hover::after { width: 100%; }
.glo-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin: 0;
}
.glo-card p {
  font-size: 15.5px;
  color: var(--ink-3);
  line-height: 1.6;
  margin: 0;
}

/* Directorio - paginator */
.dir-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 24px 0 32px;
}
.dir-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--hairline-strong);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all .15s ease;
}
.dir-page-btn:hover:not(:disabled):not(.active) {
  border-color: var(--ink);
  background: var(--bone);
}
.dir-page-btn.active {
  background: var(--ink);
  color: var(--bone);
  border-color: var(--ink);
  font-weight: 700;
}
.dir-page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.dir-page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 38px;
  color: var(--ink-3);
  font-size: 14px;
}

/* ============================================================
   MODAL DE PUBLICAR ESTUDIO — revisión de la IA y resultado
   Venia del tema oscuro anterior (#1A1A2E, emerald, emojis) sobre
   un sitio claro. Rehecho con la paleta bone/ink/champagne.
   ============================================================ */
.pub-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(10, 10, 10, 0.55);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
.pub-modal.is-open { display: flex; }

.pub-modal-card {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  max-width: 620px;
  width: 100%;
  padding: 28px;
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(10, 10, 10, 0.22);
  max-height: 92vh;
  overflow-y: auto;
}

.pub-modal-head { text-align: center; margin-bottom: 20px; }
.pub-modal-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  background: var(--champagne-glow);
  color: var(--champagne);
  border: 1px solid var(--hairline);
}
.pub-modal-icon svg { width: 24px; height: 24px; }
.pub-modal-icon.is-ok     { background: rgba(107, 122, 79, 0.12); color: var(--olive); }
.pub-modal-icon.is-wait   { background: var(--champagne-glow);    color: var(--champagne); }
.pub-modal-icon.is-reject { background: rgba(154, 62, 62, 0.10);  color: #9A3E3E; }

.pub-modal-h {
  font-size: 21px;
  line-height: 1.25;
  margin: 0 0 8px;
  color: var(--ink);
}
.pub-modal-sub {
  font-size: 14.5px;
  color: var(--ink-4);
  line-height: 1.6;
  margin: 0;
}

/* ---- Diff ortográfico ---- */
.pub-diff { margin: 18px 0 0; }
.pub-diff-group { margin-bottom: 16px; }
.pub-diff-label {
  margin: 0 0 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.pub-diff-box {
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--bone);
}
.pub-diff-box + .pub-diff-box { margin-top: 8px; }
.pub-diff-box.is-before { background: var(--bone-2); }
.pub-diff-box.is-after {
  background: var(--paper);
  border-color: var(--champagne-soft);
}
.pub-diff-cap {
  margin: 0 0 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--stone);
}
.pub-diff-box.is-after .pub-diff-cap { color: var(--champagne-deep); }
.pub-diff-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
  /* Una direccion o palabra larga sin espacios no debe ensanchar el modal */
  overflow-wrap: anywhere;
}
.pub-diff-notes {
  margin: 8px 0 0;
  font-size: 11.5px;
  color: var(--stone);
  font-style: italic;
}

/* ---- Avisos dentro del modal ---- */
.pub-note {
  border: 1px solid var(--hairline);
  border-left-width: 3px;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.55;
  margin: 0 0 12px;
  background: var(--bone);
  color: var(--ink-3);
}
.pub-note strong { color: var(--ink); }
.pub-note.is-ok     { border-left-color: var(--olive); }
.pub-note.is-warn   { border-left-color: var(--champagne); }
.pub-note.is-reject { border-left-color: #9A3E3E; }
.pub-note ul { margin: 8px 0 0; padding-left: 18px; }
.pub-note li { margin-bottom: 3px; }

/* ---- Error del propio modal (antes se pintaba detras del overlay) ---- */
.pub-modal-error {
  display: none;
  border: 1px solid #D8B4B4;
  border-left: 3px solid #9A3E3E;
  background: rgba(154, 62, 62, 0.06);
  color: #7A3131;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.5;
  margin: 16px 0 0;
}

/* ---- Acciones ---- */
.pub-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}
.pub-modal-actions .pub-btn { flex: 1; }
.pub-btn {
  padding: 12px 18px;
  border-radius: var(--r-full, 999px);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.3;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.pub-btn-ghost {
  background: transparent;
  color: var(--ink-2);
  border: 1.5px solid var(--hairline-strong);
}
.pub-btn-ghost:hover:not(:disabled) {
  background: var(--bone-2);
  border-color: var(--ink-3);
}
.pub-btn-primary {
  background: var(--champagne);
  color: var(--paper);
  border: 1.5px solid var(--champagne);
}
.pub-btn-primary:hover:not(:disabled) {
  background: var(--champagne-deep);
  border-color: var(--champagne-deep);
}
.pub-btn:disabled { opacity: 0.55; cursor: wait; }

.pub-modal-cancel {
  display: block;
  margin: 12px auto 0;
  background: transparent;
  color: var(--stone);
  border: none;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px 8px;
}
.pub-modal-cancel:hover { color: var(--ink-2); }

.pub-modal-id {
  display: none;
  background: var(--bone-2);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 0 0 18px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12.5px;
  color: var(--ink-3);
  overflow-wrap: anywhere;
}

/* A 320 px los dos botones lado a lado quedan en dos palabras por linea */
@media (max-width: 460px) {
  .pub-modal-card { padding: 22px 18px; border-radius: 14px; }
  .pub-modal-h { font-size: 19px; }
  .pub-modal-actions { flex-direction: column; }
  .pub-modal-actions .pub-btn { width: 100%; }
}




/* ============================================================
   Boton Imprimir / Guardar PDF
   El PDF se genera en una ventana nueva con CSS propio
   (ver initBotonesImprimir en app.js). Esta seccion solo
   define el aspecto del boton en pantalla.
   ============================================================ */
.result-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline, #e6dfd2);
}
.btn-imprimir-pdf {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--ink, #1A1A2E);
  color: #fff;
  border: 1px solid var(--ink, #1A1A2E);
  border-radius: 6px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s, opacity 0.15s;
}
.btn-imprimir-pdf:hover:not(:disabled) { background: #2a2a4e; }
.btn-imprimir-pdf:active:not(:disabled) { transform: translateY(1px); }
.btn-imprimir-pdf:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-imprimir-pdf svg { flex-shrink: 0; }
.result-hint {
  margin: 0;
  font-size: 12px;
  color: var(--ink-3, #6a6a7a);
  text-align: center;
}
.result-hint--warn { color: #8B6914; }
