:root {
  --ink: #334252;
  --muted: #66717b;
  --paper: #f6f4f1;
  --paper-light: #fffdfa;
  --forest: #8b9476;
  --forest-dark: #4d5b6b;
  --sage: #d9d2c4;
  --terracotta: #c56a4a;
  --honey: #c56a4a;
  --line: rgba(30, 41, 37, 0.16);
  --shadow: 0 24px 70px rgba(39, 54, 46, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

/* Identidad Moka Local: guía visual recibida el 31-07-2026. */
.brand img { display: block; width: clamp(190px, 22vw, 270px); height: auto; }
.brand-private { gap: 14px; }
.brand-private img { width: 178px; }
.brand-private > small {
  max-width: 115px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1,
.section-copy h2,
.status-band h2,
.citizen-uses h2,
.citizen-status h2,
.benefit-grid h3,
.principle-list h3,
.faq-list summary,
.promise-grid h3,
.citizen-use-grid h3,
.admin-grid strong,
.admin-actions h2,
.result-header h2,
.answer {
  font-family: Poppins, Montserrat, "Avenir Next", Arial, sans-serif;
}

h1,
.section-copy h2,
.citizen-uses h2,
.citizen-status h2 { font-weight: 600; }

.public-hero { min-height: min(650px, calc(100vh - 84px)); }
.public-hero-overlay {
  background:
    linear-gradient(90deg, rgba(246,244,241,.97) 0%, rgba(246,244,241,.90) 43%, rgba(246,244,241,.18) 100%),
    linear-gradient(0deg, rgba(77,91,107,.18), transparent 48%);
}
.public-hero-content { padding: 82px 0 98px; }
.public-hero-content .eyebrow { color: var(--terracotta); }
.public-hero-content h1 {
  max-width: 700px;
  color: var(--forest-dark);
  font-size: clamp(48px, 7vw, 88px);
  line-height: 1.02;
}
.public-hero-content h1 em { color: var(--terracotta); font-style: normal; }
.public-hero-content > p:not(.eyebrow) { color: #44515d; }
.button { border-radius: 6px; }
.button-primary { color: white; background: var(--forest-dark); }
.button-primary:hover { background: #354351; }
.button-secondary { color: var(--forest-dark); border-color: var(--forest-dark); background: rgba(246,244,241,.76); }
.button-secondary:hover { background: var(--paper-light); }
.image-credit { color: rgba(51,66,82,.78); background: rgba(246,244,241,.78); padding: 4px 7px; }
.citizen-uses, .public-footer, .admin-actions { background: var(--forest-dark); }
.citizen-uses .section-label, .status-band .eyebrow { color: #f2c4b3; }
.section-label, .eyebrow, .result-kicker { color: var(--terracotta); }
.framework-note { border-left-color: var(--terracotta); background: rgba(197,106,74,.08); }
.chat-avatar { padding: 5px; background: var(--paper-light); }
.chat-avatar img { width: 100%; height: 100%; object-fit: contain; }
#askButton, .result-shell { background: var(--forest-dark); }
#askButton:hover { background: #354351; }
.evidence-count { color: var(--forest-dark); }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 85% 10%, rgba(184, 197, 173, 0.34), transparent 29rem),
    linear-gradient(180deg, var(--paper-light) 0, var(--paper) 48rem);
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 20;
  padding: 10px 14px;
  color: white;
  background: var(--ink);
  border-radius: 8px;
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--honey);
  outline-offset: 3px;
}

body::after {
  /* Fuente de la fotografía: sección Patrimonio de www.montroy.es. */
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: url("/assets/torre-montroy.jpg") center / cover no-repeat;
  filter: grayscale(1) sepia(0.18) contrast(0.9);
  opacity: 0.16;
}

.presentation-page::after { display: none; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 140 140' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
}

.site-header,
main,
footer {
  position: relative;
  z-index: 1;
}

button, textarea { font: inherit; }
button { cursor: pointer; }

.site-header {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.language-selector {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin-left: auto;
  color: var(--slate, #425563);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  white-space: nowrap;
}

.language-selector button {
  appearance: none;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: inherit;
  padding: .35rem .15rem .25rem;
  cursor: pointer;
  font: inherit;
}

.language-selector button:hover,
.language-selector button:focus-visible,
.language-selector button.is-active {
  border-bottom-color: var(--terracotta, #a94f38);
  color: var(--terracotta, #8f402d);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--paper-light);
  background: var(--forest);
  border-radius: 50% 50% 46% 54% / 54% 45% 55% 46%;
  font-family: Georgia, serif;
  font-size: 23px;
}

.brand strong, .brand small { display: block; }
.brand strong { font-family: Georgia, serif; font-size: 19px; letter-spacing: 0.02em; }
.brand small { color: var(--muted); font-size: 11px; margin-top: 2px; text-transform: uppercase; letter-spacing: 0.09em; }

.system-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.state-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c99342;
  box-shadow: 0 0 0 4px rgba(201, 147, 66, 0.13);
}

.system-state.is-ready .state-dot { background: #3e8b65; box-shadow: 0 0 0 4px rgba(62, 139, 101, 0.13); }
.system-state.is-error .state-dot { background: var(--terracotta); box-shadow: 0 0 0 4px rgba(189, 94, 67, 0.13); }

.admin-pilot-link {
  color: var(--forest-dark);
  font-size: 12px;
  font-weight: 800;
  text-underline-offset: 4px;
}

.public-header {
  min-height: 84px;
}

.public-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.public-nav a,
.public-footer a {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.public-nav a:hover,
.public-footer a:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

main { overflow: hidden; }

.public-hero {
  position: relative;
  min-height: min(720px, calc(100vh - 84px));
  display: grid;
  align-items: center;
  color: white;
  isolation: isolate;
}

.public-hero-image,
.public-hero-overlay {
  position: absolute;
  inset: 0;
}

.public-hero-image {
  z-index: -2;
  background: url("/assets/torre-montroy.jpg") center 43% / cover no-repeat;
}

.public-hero-overlay {
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(21, 31, 33, 0.88) 0%, rgba(27, 39, 40, 0.7) 52%, rgba(27, 39, 40, 0.34) 100%),
    linear-gradient(0deg, rgba(25, 36, 37, 0.48), transparent 45%);
}

.public-hero-content {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 92px 0 110px;
}

.public-hero-content .eyebrow { color: #f2cb92; }

.public-hero-content h1 {
  max-width: 720px;
  margin: 18px 0 22px;
  font-size: clamp(54px, 8vw, 102px);
  line-height: 0.94;
}

.public-hero-content h1 em {
  display: block;
  color: #e8dfd1;
}

.public-hero-content > p:not(.eyebrow) {
  max-width: 650px;
  margin-bottom: 30px;
  color: rgba(255,255,255,0.86);
  font-size: clamp(18px, 2.2vw, 24px);
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  min-height: 48px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.button-primary {
  color: var(--ink);
  background: #f4f1ea;
}

.button-primary:hover { background: white; }

.button-secondary {
  color: white;
  border-color: rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.06);
}

.button-secondary:hover { background: rgba(255,255,255,0.13); }

.image-credit {
  position: absolute;
  right: 20px;
  bottom: 14px;
  max-width: 540px;
  margin: 0;
  color: rgba(255,255,255,0.7);
  font-size: 10px;
  text-align: right;
}

.public-section {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 110px 0;
  display: grid;
  grid-template-columns: minmax(150px, 0.36fr) minmax(0, 1fr);
  gap: 70px;
}

.section-label {
  padding-top: 10px;
  color: var(--terracotta);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.section-copy h2,
.status-band h2 {
  max-width: 850px;
  margin-bottom: 28px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(40px, 6vw, 68px);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.section-copy > p {
  max-width: 770px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.72;
}

.section-copy .lead {
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: clamp(22px, 3vw, 31px);
  line-height: 1.45;
}

.benefit-section {
  padding: 12px 0 110px;
  background: rgba(222, 215, 201, 0.45);
  border-block: 1px solid var(--line);
}

.compact-heading { padding-bottom: 42px; }

.benefit-grid {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}

.benefit-grid article {
  min-height: 280px;
  padding: 30px;
}

.benefit-grid article:first-child { padding-left: 0; }
.benefit-grid article + article { border-left: 1px solid var(--line); }
.benefit-grid span { color: var(--honey); font-size: 12px; font-weight: 800; }
.benefit-grid h3 { margin: 68px 0 15px; font-family: Georgia, serif; font-size: 31px; font-weight: 400; }
.benefit-grid p { max-width: 300px; color: var(--muted); line-height: 1.65; }

.principle-list {
  margin-top: 50px;
  border-top: 1px solid var(--line);
}

.principle-list article {
  padding: 24px 0;
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 30px;
  border-bottom: 1px solid var(--line);
}

.principle-list h3,
.principle-list p { margin: 0; }
.principle-list h3 { font-family: Georgia, serif; font-size: 22px; font-weight: 400; }
.principle-list p { color: var(--muted); line-height: 1.65; }

.status-band {
  padding: 90px max(20px, calc((100% - 1180px) / 2));
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 80px;
  color: white;
  background: var(--ink);
}

.status-band .eyebrow { color: #f2cb92; }
.status-band h2 { margin: 10px 0 0; }
.status-copy > p { max-width: 680px; color: rgba(255,255,255,0.75); font-size: 18px; line-height: 1.65; }
.status-copy dl { margin: 36px 0 0; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid rgba(255,255,255,0.18); }
.status-copy dl div { padding: 18px 0; border-bottom: 1px solid rgba(255,255,255,0.18); }
.status-copy dl div:nth-child(odd) { padding-right: 22px; }
.status-copy dl div:nth-child(even) { padding-left: 22px; border-left: 1px solid rgba(255,255,255,0.18); }
.status-copy dt { color: rgba(255,255,255,0.55); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; }
.status-copy dd { margin: 8px 0 0; font-size: 15px; }

.faq-list { border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary { padding: 24px 44px 24px 0; cursor: pointer; color: var(--ink); font-family: Georgia, serif; font-size: 21px; }
.faq-list p { max-width: 720px; padding: 0 0 24px; color: var(--muted); line-height: 1.65; }
.legal-section { border-top: 1px solid var(--line); }

.public-footer {
  width: auto;
  padding: 44px max(20px, calc((100% - 1180px) / 2));
  align-items: flex-start;
  color: rgba(255,255,255,0.7);
  background: var(--forest-dark);
}

.public-footer strong { color: white; font-family: Georgia, serif; font-size: 21px; }
.public-footer nav { display: flex; flex-wrap: wrap; gap: 20px; }
.public-footer a { color: white; }

.pilot-notice {
  width: min(880px, calc(100% - 40px));
  margin: 18px auto 0;
  padding: 12px 16px;
  display: flex;
  gap: 12px;
  border: 1px solid rgba(184, 135, 70, 0.45);
  border-radius: 10px;
  color: #6c4c27;
  background: rgba(244, 224, 189, 0.75);
  font-size: 12px;
}

.citizen-intro { padding-bottom: 88px; }

.citizen-uses {
  padding: 88px max(20px, calc((100% - 1180px) / 2));
  color: white;
  background: var(--forest-dark);
}

.citizen-uses-heading {
  max-width: 760px;
  margin-bottom: 48px;
}

.citizen-uses .section-label { color: #f2cb92; }

.citizen-uses h2,
.citizen-status h2 {
  margin: 12px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(40px, 6vw, 68px);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.citizen-use-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(255,255,255,0.2);
}

.citizen-use-grid article { padding: 30px 30px 10px; }
.citizen-use-grid article:first-child { padding-left: 0; }
.citizen-use-grid article + article { border-left: 1px solid rgba(255,255,255,0.2); }
.citizen-use-grid h3 { margin: 0 0 16px; font-family: Georgia, serif; font-size: 27px; font-weight: 400; }
.citizen-use-grid p { max-width: 320px; color: rgba(255,255,255,0.72); line-height: 1.65; }

.promise-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
}

.promise-grid article { padding: 26px 28px 26px 0; border-bottom: 1px solid var(--line); }
.promise-grid article:nth-child(even) { padding-left: 28px; border-left: 1px solid var(--line); }
.promise-grid h3 { margin: 0 0 10px; font-family: Georgia, serif; font-size: 22px; font-weight: 400; }
.promise-grid p { margin: 0; color: var(--muted); line-height: 1.6; }

.framework-note {
  margin-top: 30px;
  padding: 18px 20px;
  border-left: 3px solid var(--honey);
  background: rgba(184, 135, 70, 0.08);
  font-size: 14px !important;
}

.citizen-status {
  padding: 88px max(20px, calc((100% - 1180px) / 2));
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 80px;
  background: rgba(222, 215, 201, 0.45);
  border-block: 1px solid var(--line);
}

.citizen-status .eyebrow { color: var(--terracotta); }
.citizen-status > div:last-child > p { max-width: 680px; color: var(--muted); font-size: 18px; line-height: 1.65; }
.citizen-status ul { margin: 30px 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.citizen-status li { padding: 16px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.citizen-status li strong { color: var(--ink); }
.citizen-status .status-date { font-size: 12px !important; }

.compact-legal { padding-top: 70px; padding-bottom: 70px; }
.compact-legal .section-copy h2 { font-size: clamp(34px, 4.5vw, 52px); }

.admin-page::after { opacity: 0.08; }

.admin-main {
  width: min(1000px, calc(100% - 40px));
  margin: 0 auto;
  padding: 78px 0 100px;
}

.admin-main h1 {
  max-width: none;
  margin: 10px 0 18px;
  font-size: clamp(48px, 7vw, 76px);
}

.admin-intro {
  max-width: 660px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.admin-grid {
  margin-top: 50px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: rgba(255,255,255,0.55);
}

.admin-grid article {
  min-height: 150px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.admin-grid span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.admin-grid strong { font-family: Georgia, serif; font-size: 25px; font-weight: 400; }

.admin-actions { margin-top: 46px; padding: 30px; background: var(--forest-dark); color: white; border-radius: 16px; }
.admin-actions h2 { margin-bottom: 24px; font-family: Georgia, serif; font-size: 30px; font-weight: 400; }
.admin-actions .button { margin: 0 8px 12px 0; }
.button-admin { color: var(--ink); background: white; }
.button-admin-secondary { color: white; border-color: rgba(255,255,255,0.5); }
.admin-actions p { max-width: 720px; margin: 16px 0 0; color: rgba(255,255,255,0.7); font-size: 12px; line-height: 1.6; }

.hero {
  width: min(960px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0 36px;
  text-align: center;
}

.eyebrow, .result-kicker {
  color: var(--terracotta);
  font-weight: 750;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin: 10px auto 8px;
  max-width: 880px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 5.5vw, 60px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.04em;
}

h1 em {
  color: var(--forest);
  font-weight: 400;
}

.hero-copy {
  max-width: 660px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.question-box {
  margin: 46px auto 0;
  padding: 18px 20px 12px;
  max-width: 850px;
  text-align: left;
  background: rgba(255,255,255,0.76);
  border: 1px solid rgba(30, 41, 37, 0.2);
  border-radius: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  transition: border-color 160ms ease, transform 160ms ease;
}

.question-box:focus-within {
  border-color: rgba(23, 76, 59, 0.6);
  transform: translateY(-2px);
}

.question-box > label {
  display: block;
  padding: 0 6px 10px;
  color: var(--forest);
  font-size: 13px;
  font-weight: 750;
}

.question-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: stretch;
}

textarea {
  width: 100%;
  min-height: 82px;
  padding: 14px 10px;
  resize: vertical;
  border: 0;
  outline: none;
  color: var(--ink);
  background: transparent;
  font-size: 18px;
  line-height: 1.45;
}

textarea::placeholder { color: #929791; }

#askButton {
  min-width: 140px;
  padding: 0 20px;
  border: 0;
  border-radius: 14px;
  color: white;
  background: var(--forest);
  font-weight: 750;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  transition: background 160ms ease, transform 160ms ease;
}

#askButton:hover { background: var(--forest-dark); transform: translateY(-1px); }
#askButton:disabled { opacity: 0.62; cursor: wait; transform: none; }
.button-arrow { font-size: 22px; transition: transform 160ms ease; }
#askButton:hover .button-arrow { transform: translateX(3px); }

.question-meta {
  display: flex;
  justify-content: space-between;
  padding: 9px 6px 0;
  color: var(--muted);
  font-size: 11px;
}

.suggestions {
  margin: 18px auto 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.suggestions button, .feedback button {
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255,255,255,0.38);
  font-size: 12px;
  transition: border-color 150ms ease, background 150ms ease;
}

.suggestions button:hover, .feedback button:hover {
  border-color: var(--forest);
  background: rgba(255,255,255,0.8);
}

.result-shell {
  width: min(900px, calc(100% - 40px));
  margin: 0 auto 100px;
  padding: 38px;
  border-radius: 24px;
  color: #f8f4e9;
  background: var(--forest);
  box-shadow: 0 28px 80px rgba(16, 55, 44, 0.25);
  animation: rise 320ms ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.is-hidden { display: none !important; }

.result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.18);
}

.result-kicker { color: #d9a58e; }
.result-header h2 { margin: 6px 0 0; font-family: Georgia, serif; font-size: 33px; font-weight: 400; }
.result-time { color: rgba(255,255,255,0.62); font-size: 12px; white-space: nowrap; }

.answer {
  padding: 32px 0;
  font-family: Georgia, serif;
  font-size: clamp(20px, 3vw, 27px);
  line-height: 1.55;
}

.answer p:last-child { margin-bottom: 0; }
.answer .fact-ref { color: #e4b29d; font-family: Inter, sans-serif; font-size: 0.62em; font-weight: 800; vertical-align: super; }

.review-warning {
  margin-bottom: 20px;
  padding: 13px 15px;
  border: 1px solid rgba(255, 210, 132, 0.55);
  border-radius: 10px;
  color: #ffdda1;
  background: rgba(126, 87, 24, 0.25);
  font-size: 13px;
}

.evidence {
  border-top: 1px solid rgba(255,255,255,0.18);
  border-bottom: 1px solid rgba(255,255,255,0.18);
}

.evidence summary {
  padding: 18px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.evidence-count {
  min-width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--forest);
  background: var(--sage);
}

.evidence ol {
  margin: 0;
  padding: 0 0 24px;
  list-style: none;
}

.evidence li {
  padding: 16px 0;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  border-top: 1px solid rgba(255,255,255,0.11);
}

.source-id { color: #d9a58e; font-size: 12px; font-weight: 800; }
.source-statement { margin: 0 0 8px; color: rgba(255,255,255,0.9); font-size: 14px; line-height: 1.55; }
.source-links { display: flex; flex-wrap: wrap; gap: 10px; }
.source-links a { color: #c9dbc1; font-size: 12px; text-underline-offset: 3px; }

.result-footer {
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.result-footer p { margin: 0; color: rgba(255,255,255,0.72); font-size: 13px; }
.feedback { display: flex; gap: 8px; }
.feedback button { color: white; border-color: rgba(255,255,255,0.28); background: transparent; }
.feedback button:hover, .feedback button.is-selected { border-color: var(--sage); background: rgba(184,197,173,0.16); }

.principles {
  padding: 100px max(20px, calc((100% - 1180px) / 2)) 110px;
  background: rgba(229, 222, 207, 0.55);
  border-top: 1px solid var(--line);
}

.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 38px; }
.section-heading h2 { margin: 0; font-family: Georgia, serif; font-size: clamp(36px, 5vw, 58px); font-weight: 400; letter-spacing: -0.03em; }

.principle-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.principle-grid article { min-height: 230px; padding: 28px 28px 10px 0; }
.principle-grid article + article { padding-left: 28px; border-left: 1px solid var(--line); }
.principle-number { color: var(--terracotta); font-size: 11px; font-weight: 800; letter-spacing: 0.12em; }
.principle-grid h3 { margin: 42px 0 12px; font-family: Georgia, serif; font-size: 27px; font-weight: 400; }
.principle-grid p { max-width: 300px; color: var(--muted); line-height: 1.6; font-size: 14px; }

footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 16px 0 24px;
  display: flex;
  justify-content: space-between;
  gap: 30px;
  color: var(--muted);
  font-size: 11px;
}

footer p { margin: 0; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.chat-shell {
  max-width: 880px;
  margin: 20px auto 0;
  overflow: hidden;
  text-align: left;
  border: 1px solid rgba(30, 41, 37, 0.2);
  border-radius: 22px;
  background: rgba(255,255,255,0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.conversation {
  height: min(58vh, 570px);
  min-height: 390px;
  padding: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

.chat-welcome,
.chat-message {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.chat-welcome {
  max-width: 520px;
  color: var(--muted);
}

.chat-welcome strong {
  display: block;
  margin: 4px 0 4px;
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 19px;
}

.chat-welcome p { margin: 0; font-size: 14px; }

.chat-avatar {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--forest);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 17px;
}

.chat-message { margin-top: 22px; }
.chat-message-user { justify-content: flex-end; }

.chat-bubble {
  max-width: min(650px, 84%);
  padding: 13px 16px;
  border-radius: 6px 18px 18px 18px;
  color: var(--ink);
  background: #ece7dc;
  font-size: 15px;
  line-height: 1.55;
}

.chat-message-user .chat-bubble {
  border-radius: 18px 18px 6px 18px;
  color: white;
  background: var(--forest);
}

.chat-answer-wrap { flex: 1; min-width: 0; }
.chat-answer-wrap > .chat-bubble { max-width: 700px; background: #eef0e8; }
.chat-bubble p { margin: 0 0 9px; }
.chat-bubble p:last-child { margin-bottom: 0; }

.chat-loading {
  min-width: 64px;
  display: flex;
  gap: 5px;
}

.chat-loading i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: typing 900ms infinite ease-in-out;
}

.chat-loading i:nth-child(2) { animation-delay: 120ms; }
.chat-loading i:nth-child(3) { animation-delay: 240ms; }

@keyframes typing {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.chat-sources {
  max-width: 700px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.4);
}

.chat-sources summary {
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.chat-sources summary span {
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--forest);
  background: var(--sage);
}

.chat-sources ol { margin: 0; padding: 0 12px 10px; list-style: none; }
.chat-sources li { padding: 10px 0; display: grid; grid-template-columns: 34px 1fr; gap: 8px; border-top: 1px solid var(--line); }
.chat-sources .source-statement { color: var(--ink); font-size: 12px; }
.chat-sources .source-links a { color: var(--forest); }

.chat-meta {
  max-width: 700px;
  padding: 7px 2px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 10px;
}

.chat-meta .feedback { align-items: center; }
.chat-meta .feedback button {
  padding: 5px 9px;
  color: var(--muted);
  background: transparent;
}

.chat-meta .feedback button.is-selected {
  color: var(--forest);
  border-color: var(--forest);
  background: rgba(184,197,173,0.22);
}

.chat-note {
  max-width: 700px;
  margin: 8px 0 0;
  color: var(--terracotta);
  font-size: 11px;
}

.chat-shell > .suggestions {
  margin: 0;
  padding: 0 20px 14px;
}

.location-panel {
  margin: 0 14px 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper-light);
}

.location-panel[hidden] { display: none; }

.location-panel-header,
.location-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.location-panel h2 {
  margin: 2px 0 0;
  font-family: Georgia, serif;
  font-size: 21px;
}

.location-panel > p {
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.location-close {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  font-size: 22px;
}

.location-map {
  height: 330px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #e5e0d5;
}

.location-fields {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 2fr 0.7fr 0.7fr 1.3fr;
  gap: 8px;
}

.location-fields label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.location-fields input {
  width: 100%;
  margin-top: 4px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  font: inherit;
  font-size: 13px;
}

.location-panel .location-privacy {
  margin-bottom: 8px;
  color: var(--terracotta);
}

.location-actions {
  color: var(--muted);
  font-size: 11px;
}

.location-open {
  padding: 0;
  border: 0;
  color: var(--forest);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.location-prompt { margin-top: 8px; }
.location-prompt button { color: white; background: var(--forest); }

.chat-composer {
  position: relative;
  padding: 14px 14px 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,0.92);
}

.chat-composer textarea {
  min-height: 56px;
  max-height: 130px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper-light);
  font-size: 15px;
}

.chat-composer textarea:focus { border-color: var(--forest); }

.chat-composer #askButton {
  min-width: 116px;
  min-height: 56px;
}

.chat-composer .question-meta {
  grid-column: 1 / -1;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

@media (max-width: 720px) {
  body::after {
    inset: 64px 0 0;
    background-position: right -95px top -155px;
    background-size: 420px auto;
    -webkit-mask-image: radial-gradient(ellipse at 75% 16%, #000 0 28%, transparent 74%);
    mask-image: radial-gradient(ellipse at 75% 16%, #000 0 28%, transparent 74%);
    opacity: 0.11;
  }
  .site-header { width: min(100% - 28px, 1180px); min-height: 78px; }
  .brand small { display: none; }
  .system-state span:last-child { display: none; }
  .hero { width: min(100% - 20px, 960px); padding: 20px 0 22px; }
  h1 { font-size: clamp(34px, 10vw, 46px); }
  .hero-copy { font-size: 13px; }
  .question-box { padding: 15px; border-radius: 17px; }
  .question-row { grid-template-columns: 1fr; }
  #askButton { min-height: 52px; }
  .result-shell { width: min(100% - 20px, 900px); margin-bottom: 64px; padding: 26px 20px; border-radius: 18px; }
  .result-header, .result-footer { align-items: flex-start; flex-direction: column; }
  .principles { padding-top: 70px; padding-bottom: 70px; }
  .section-heading { display: block; }
  .section-heading .eyebrow { display: block; margin-bottom: 14px; }
  .principle-grid { grid-template-columns: 1fr; }
  .principle-grid article { min-height: 0; padding: 24px 0; }
  .principle-grid article + article { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .principle-grid h3 { margin-top: 20px; }
  footer { flex-direction: column; width: min(100% - 28px, 1180px); }
  .chat-shell { margin-top: 14px; border-radius: 17px; }
  .conversation { height: 61vh; min-height: 390px; padding: 16px 13px; }
  .chat-bubble { max-width: 88%; font-size: 14px; }
  .chat-composer { grid-template-columns: 1fr auto; padding: 10px; }
  .chat-composer #askButton { min-width: 52px; padding: 0 13px; }
  .chat-composer #askButton span:first-child { display: none; }
  .chat-meta { align-items: flex-start; flex-direction: column; }
  .chat-meta .feedback { flex-wrap: wrap; }
  .location-map { height: 280px; }
  .location-fields { grid-template-columns: 1fr 1fr; }
  .location-fields label:first-child,
  .location-fields label:last-child { grid-column: 1 / -1; }
  .location-actions { align-items: stretch; flex-direction: column; }
  .chat-composer .question-meta { align-items: flex-start; flex-wrap: wrap; }
  .public-header { min-height: 72px; }
  .public-nav { display: none; }
  .public-hero { min-height: 670px; }
  .public-hero-image { background-position: 62% center; }
  .public-hero-overlay {
    background:
      linear-gradient(90deg, rgba(246,244,241,.97), rgba(246,244,241,.72)),
      linear-gradient(0deg, rgba(77,91,107,.16), transparent 55%);
  }
  .public-hero-content { width: min(100% - 32px, 1180px); padding: 82px 0 120px; }
  .public-hero-content h1 { font-size: clamp(52px, 17vw, 74px); }
  .public-hero-content > p:not(.eyebrow) { font-size: 18px; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .button { width: 100%; }
  .image-credit { left: 16px; right: 16px; text-align: left; }
  .public-section {
    width: min(100% - 32px, 1180px);
    padding: 74px 0;
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .section-copy h2, .status-band h2 { font-size: clamp(38px, 12vw, 54px); }
  .benefit-section { padding-bottom: 54px; }
  .compact-heading { padding-bottom: 20px; }
  .benefit-grid {
    width: min(100% - 32px, 1180px);
    grid-template-columns: 1fr;
  }
  .benefit-grid article,
  .benefit-grid article:first-child { min-height: 0; padding: 26px 0; }
  .benefit-grid article + article { border-left: 0; border-top: 1px solid var(--line); }
  .benefit-grid h3 { margin-top: 28px; }
  .principle-list article { grid-template-columns: 1fr; gap: 8px; }
  .status-band { padding: 70px 16px; grid-template-columns: 1fr; gap: 28px; }
  .status-copy dl { grid-template-columns: 1fr; }
  .status-copy dl div:nth-child(odd),
  .status-copy dl div:nth-child(even) { padding: 16px 0; border-left: 0; }
  .public-footer { padding: 40px 16px; }
  .pilot-notice { width: min(100% - 28px, 880px); flex-direction: column; gap: 4px; }
  .citizen-intro { padding-bottom: 64px; }
  .citizen-uses { padding: 64px 16px; }
  .citizen-uses-heading { margin-bottom: 30px; }
  .citizen-use-grid { grid-template-columns: 1fr; }
  .citizen-use-grid article,
  .citizen-use-grid article:first-child { padding: 24px 0; }
  .citizen-use-grid article + article { border-left: 0; border-top: 1px solid rgba(255,255,255,0.2); }
  .promise-grid { grid-template-columns: 1fr; }
  .promise-grid article,
  .promise-grid article:nth-child(even) { padding: 22px 0; border-left: 0; }
  .citizen-status { padding: 64px 16px; grid-template-columns: 1fr; gap: 26px; }
  .citizen-status h2 { font-size: clamp(38px, 12vw, 54px); }
  .compact-legal { padding-top: 56px; padding-bottom: 56px; }
  .admin-main { width: min(100% - 28px, 1000px); padding-top: 48px; }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-grid article { min-height: 120px; }
  .admin-actions { padding: 22px; }
  .admin-actions .button { width: 100%; margin-right: 0; }
  .brand img { width: 190px; }
  .brand-private img { width: 150px; }
  .brand-private > small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}

/* La identidad prevalece sobre los estilos heredados de la versión alfa. */
.brand img { display: block; width: clamp(190px, 22vw, 270px); height: auto; }
h1, .section-copy h2, .status-band h2, .citizen-uses h2, .citizen-status h2,
.benefit-grid h3, .principle-list h3, .faq-list summary, .promise-grid h3,
.citizen-use-grid h3, .admin-grid strong, .admin-actions h2, .result-header h2, .answer {
  font-family: Poppins, Montserrat, "Avenir Next", Arial, sans-serif;
}
h1, .section-copy h2, .citizen-uses h2, .citizen-status h2 { font-weight: 600; }
.public-hero-overlay {
  background: linear-gradient(90deg, rgba(246,244,241,.97) 0%, rgba(246,244,241,.88) 46%, rgba(246,244,241,.12) 100%);
}
.public-hero-content .eyebrow { color: var(--terracotta); }
.public-hero-content h1 { color: var(--forest-dark); font-size: clamp(48px, 7vw, 88px); line-height: 1.02; }
.public-hero-content h1 em { color: var(--terracotta); font-style: normal; }
.public-hero-content > p:not(.eyebrow) { color: #44515d; }
.button-primary { color: white; background: var(--forest-dark); }
.button-secondary { color: var(--forest-dark); border-color: var(--forest-dark); background: rgba(246,244,241,.82); }

@media (max-width: 720px) {
  .brand img { width: 190px; }
  .brand-private img { width: 150px; }
  .public-hero { min-height: 650px; }
  .public-hero-overlay {
    background: linear-gradient(180deg, rgba(246,244,241,.97) 0%, rgba(246,244,241,.91) 64%, rgba(246,244,241,.58) 100%);
  }
  .public-hero-content { align-self: start; padding-top: 72px; }
  .public-hero-content h1 { color: var(--forest-dark); font-size: clamp(46px, 14vw, 62px); }
  .public-hero-content > p:not(.eyebrow) { color: #44515d; }
}
