:root {
  --paper: #f3ecde;
  --paper-2: #fffaf0;
  --ink: #092b39;
  --ink-soft: #36515a;
  --line: #afbaa8;
  --sea: #087f78;
  --sea-dark: #005c58;
  --coral: #b53630;
  --yellow: #e5a900;
  --mint: #87d7bf;
  --blue: #1669ac;
  --panel: rgba(255, 250, 240, .88);
  --shadow: 0 18px 55px rgba(9, 43, 57, .12);
  --radius: 1.1rem;
  --font-display: "Aptos Display", "Segoe UI Variable Display", "Trebuchet MS", sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI Variable Text", "Trebuchet MS", sans-serif;
  --font-mono: "Cascadia Mono", "Lucida Console", monospace;
  color-scheme: light;
}

[data-theme="night"] {
  --paper: #071a23;
  --paper-2: #0b2630;
  --ink: #f8f1e4;
  --ink-soft: #bdd0cd;
  --line: #496369;
  --sea: #63d8c7;
  --sea-dark: #95ebdd;
  --coral: #ff796d;
  --yellow: #f4c64e;
  --mint: #77d4bd;
  --blue: #76b9ef;
  --panel: rgba(11, 38, 48, .9);
  --shadow: 0 22px 70px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: auto; }
body {
  margin: 0;
  background:
    linear-gradient(90deg, transparent 49.88%, color-mix(in srgb, var(--line) 22%, transparent) 50%, transparent 50.12%),
    var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.62;
  transition: background-color .25s ease, color .25s ease;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  opacity: .2;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
a { color: var(--sea-dark); text-underline-offset: .22em; text-decoration-thickness: .08em; }
a:hover { text-decoration-thickness: .15em; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 4px; }
::selection { background: var(--yellow); color: #071a23; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 1rem; top: 1rem; z-index: 100;
  transform: translateY(-180%);
  padding: .8rem 1rem; background: var(--ink); color: var(--paper);
}
.skip-link:focus { transform: translateY(0); }

.utility-bar {
  min-height: 2.9rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .4rem clamp(1rem, 4vw, 4.5rem);
  border-bottom: 1px solid var(--line);
  background: var(--ink); color: var(--paper-2);
  font: 700 .72rem/1 var(--font-mono);
  letter-spacing: .04em;
}
.utility-actions { display: flex; align-items: center; gap: .4rem; }
.utility-bar button, .utility-bar select {
  border: 1px solid color-mix(in srgb, var(--paper-2) 50%, transparent);
  border-radius: 999px; padding: .48rem .72rem;
  color: inherit; background: transparent;
}
.utility-bar select { max-width: 10.5rem; }
.quick-exit { background: var(--coral) !important; border-color: var(--coral) !important; color: #fff !important; font-weight: 900; }
[data-theme="night"] .quick-exit { color: #071a23 !important; }
.icon-button { display: inline-flex; gap: .45rem; align-items: center; }

.site-header {
  position: sticky; top: 0; z-index: 18;
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2rem;
  min-height: 5.2rem; padding: .8rem clamp(1rem, 4vw, 4.5rem);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(16px);
}
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--ink); text-decoration: none; }
.brand svg { width: 3.7rem; }
.brand path { fill: none; stroke: var(--sea); stroke-width: 5; stroke-linecap: round; }
.brand path:last-child { stroke: var(--coral); }
.brand span, .brand-footer { line-height: .9; }
.brand strong { display: block; font: 900 1rem/1 var(--font-display); letter-spacing: -.03em; }
.brand small { font: 700 .82rem/1 var(--font-mono); color: var(--coral); }
.site-nav { justify-self: end; display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; }
.site-nav a { color: var(--ink); font-weight: 800; text-decoration: none; }
.site-nav a:hover { color: var(--coral); }
.menu-toggle { display: none; }

.section, .hero { padding: clamp(5rem, 9vw, 9rem) clamp(1rem, 6vw, 7.5rem); }
.hero {
  min-height: calc(100svh - 8rem);
  display: grid; grid-template-columns: minmax(0, .95fr) minmax(320px, 1.05fr); align-items: center; gap: clamp(2rem, 7vw, 8rem);
  overflow: hidden;
}
.eyebrow, .section-number {
  margin: 0 0 1rem;
  color: var(--coral); font: 800 .75rem/1.2 var(--font-mono); letter-spacing: .12em; text-transform: uppercase;
}
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; }
h1 { margin: 0; max-width: 9ch; font-size: clamp(3.4rem, 8.5vw, 8.8rem); line-height: .84; letter-spacing: -.075em; }
h2 { margin: 0; max-width: 15ch; font-size: clamp(2.5rem, 5vw, 5.5rem); line-height: .92; letter-spacing: -.055em; }
h3 { line-height: 1.05; letter-spacing: -.025em; }
.hero-intro { max-width: 58ch; margin: 1.8rem 0; font-size: clamp(1.06rem, 1.5vw, 1.35rem); color: var(--ink-soft); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; }
.button {
  display: inline-flex; justify-content: center; align-items: center; min-height: 3.15rem;
  padding: .75rem 1.15rem; border: 2px solid var(--ink); border-radius: .35rem;
  font-weight: 900; text-decoration: none; transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.button:hover { transform: translateY(-2px); box-shadow: 5px 5px 0 var(--ink); }
.button-primary { background: var(--coral); color: #fff; border-color: var(--ink); }
[data-theme="night"] .button-primary { color: #071a23; }
.button-ghost { background: transparent; color: var(--ink); }
.status-line { display: flex; align-items: center; gap: .55rem; margin-top: 2rem; color: var(--ink-soft); font: 700 .76rem/1.3 var(--font-mono); }
.status-dot { width: .65rem; height: .65rem; border-radius: 50%; background: var(--sea); box-shadow: 0 0 0 .3rem color-mix(in srgb, var(--sea) 20%, transparent); }

.signal-console {
  position: relative; min-height: 34rem; overflow: hidden;
  border: 2px solid var(--ink); border-radius: 1.4rem; background: #082b3a; color: #fffaf0; box-shadow: 14px 14px 0 var(--yellow);
}
.console-top, .console-readout { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; font: 700 .7rem/1 var(--font-mono); letter-spacing: .08em; }
.console-top { border-bottom: 1px solid #56717a; }
.console-readout { position: absolute; inset: auto 0 0; border-top: 1px solid #56717a; }
.console-readout span { color: var(--mint); }
.signal-map { width: 100%; height: 26.5rem; }
.map-water { fill: none; stroke: #315565; stroke-width: 2; }
.map-water-alt { stroke: #694941; }
.map-route { fill: none; stroke: var(--yellow); stroke-width: 5; stroke-dasharray: 8 9; stroke-linecap: round; }
.map-node circle { fill: #082b3a; stroke: var(--mint); stroke-width: 5; }
.map-node text { fill: #fffaf0; font: 700 13px var(--font-mono); }
.map-node-hot circle { fill: var(--coral); stroke: var(--yellow); }

.section-heading { display: grid; grid-template-columns: minmax(10rem, .35fr) minmax(0, 1fr); gap: 1rem 4rem; margin-bottom: clamp(2.5rem, 6vw, 5rem); align-items: start; }
.section-heading .section-number { grid-column: 1; }
.section-heading h2 { grid-column: 2; }
.section-heading > p:last-child { grid-column: 2; max-width: 61ch; margin: .4rem 0 0; color: var(--ink-soft); font-size: 1.1rem; }

.emergency { background: #082b3a; color: #fffaf0; }
.emergency .section-number { color: var(--yellow); }
.emergency .section-heading p:last-child { color: #c9dad8; }
.emergency-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid #557079; }
.emergency-card { display: flex; min-height: 17rem; flex-direction: column; padding: 1.3rem; border-right: 1px solid #557079; }
.emergency-card:last-child { border-right: 0; }
.emergency-card h3 { margin: 0 0 .7rem; font-size: 1.25rem; }
.emergency-card p { color: #c9dad8; }
.emergency-card .phone { margin: auto 0 1rem; color: var(--yellow); font: 900 clamp(1.45rem, 2.2vw, 2.3rem)/1 var(--font-mono); text-decoration: none; }
.source-link { font-weight: 800; }
.emergency .source-link { color: var(--mint); }
.privacy-note { max-width: 68rem; margin-top: 2rem; padding: 1rem 1.2rem; border: 1px solid #557079; }
.privacy-note summary { font-weight: 900; cursor: pointer; }
.privacy-note p { color: #c9dad8; }

.route-line { list-style: none; margin: 0; padding: 0; }
.route-step { position: relative; display: grid; grid-template-columns: .45fr 1fr 1.5fr; gap: 2rem; padding: 1.6rem 0; border-top: 1px solid var(--line); }
.route-step::before { content: ""; position: absolute; left: calc(45% - .4rem); top: 0; width: .8rem; height: .8rem; transform: translate(-50%, -50%) rotate(45deg); background: var(--coral); }
.route-step time { color: var(--coral); font: 900 1rem/1.2 var(--font-mono); }
.route-step h3 { margin: 0; font-size: 1.45rem; }
.route-step p { margin: 0; color: var(--ink-soft); }
.truth-strip { display: grid; grid-template-columns: .45fr 2.5fr; gap: 2rem; margin-top: 3rem; padding: 1.5rem; border: 2px solid var(--ink); background: var(--yellow); color: #082b3a; box-shadow: 8px 8px 0 var(--ink); }
.truth-strip p { margin: 0; }

.needs { background: var(--paper-2); }
.needs-grid { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--line); }
.needs-grid article { min-height: 13rem; padding: 1.2rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.needs-grid article:nth-child(5n) { border-right: 0; }
.needs-grid article:nth-child(n+6) { border-bottom: 0; }
.needs-grid b { color: var(--coral); font: 800 .75rem var(--font-mono); }
.needs-grid h3 { margin: 2rem 0 .5rem; }
.needs-grid p { margin: 0; color: var(--ink-soft); font-size: .92rem; }

.filter-panel { padding: 1.2rem; border: 2px solid var(--ink); background: var(--paper-2); box-shadow: 8px 8px 0 var(--sea); }
.search-field input { width: 100%; padding: 1rem; border: 0; border-bottom: 2px solid var(--ink); background: transparent; color: var(--ink); font-size: 1.1rem; }
.filter-row { display: flex; flex-wrap: wrap; gap: .5rem; padding: 1rem 0; }
.filter-chip { border: 1px solid var(--line); border-radius: 999px; padding: .45rem .8rem; color: var(--ink); background: transparent; font-weight: 800; }
.filter-chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.select-row { display: flex; flex-wrap: wrap; align-items: end; gap: .8rem 1.5rem; }
.select-row label { display: grid; gap: .3rem; font: 800 .72rem/1.2 var(--font-mono); text-transform: uppercase; }
.select-row select { min-width: 9rem; padding: .55rem; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
.adult-filter { display: flex !important; grid-auto-flow: column; align-items: center; text-transform: none !important; }
.adult-filter input { width: 1.25rem; height: 1.25rem; }
.result-count { margin: 2rem 0 1rem; font: 800 .76rem var(--font-mono); color: var(--ink-soft); }
.resource-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.resource-card { display: flex; min-height: 23rem; flex-direction: column; padding: 1.25rem; border: 1px solid var(--line); background: var(--panel); }
.resource-card:hover { border-color: var(--ink); }
.resource-card-head { display: flex; justify-content: space-between; gap: 1rem; }
.resource-card h3 { margin: 1rem 0 .65rem; font-size: 1.5rem; }
.resource-card p { color: var(--ink-soft); }
.resource-meta { display: flex; flex-wrap: wrap; gap: .4rem; }
.resource-meta span { padding: .25rem .5rem; border: 1px solid var(--line); border-radius: 999px; font: 700 .68rem var(--font-mono); }
.resource-address { font-size: .88rem; }
.resource-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: auto; padding-top: 1rem; }
.resource-actions a { font-weight: 900; }
.verified { color: var(--sea-dark); font: 700 .68rem var(--font-mono); }
.source-warning, .empty-state { margin-top: 1.4rem; color: var(--ink-soft); font-size: .9rem; }

.fun-zone { background: #9f302b; color: #fff; }
.fun-zone .section-number { color: #fff1a7; }
.fun-zone .section-heading p:last-child { color: #fff; }
.plan-machine { display: grid; grid-template-columns: 1.25fr .75fr; border: 2px solid #102f39; background: var(--paper-2); color: var(--ink); box-shadow: 12px 12px 0 #102f39; }
.plan-machine form { padding: clamp(1.2rem, 3vw, 2.5rem); }
.plan-machine fieldset { border: 0; padding: 0; margin: 0 0 1.5rem; }
.plan-machine legend { margin-bottom: .8rem; font-weight: 900; }
.chip-options { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip-options input { position: absolute; opacity: 0; }
.chip-options span { display: block; padding: .5rem .75rem; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.chip-options input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip-options input:focus-visible + span { outline: 3px solid var(--yellow); outline-offset: 3px; }
.plan-selects { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-bottom: 1.5rem; }
.plan-selects label { display: grid; gap: .4rem; font-weight: 800; }
.plan-selects select { width: 100%; padding: .7rem; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
.plan-output { padding: clamp(1.2rem, 3vw, 2.5rem); border-left: 2px solid var(--ink); background: var(--yellow); color: #082b3a; }
.plan-output h3 { margin: 2.5rem 0 1rem; font-size: 2rem; }
.plan-stamp { font: 800 .72rem var(--font-mono); }
.plan-output ol { padding-left: 1.2rem; }
.plan-output li { margin: .75rem 0; }
.night-note { max-width: 70rem; margin-top: 2rem; border-left: 5px solid #fff1a7; padding: 1rem 1.2rem; background: rgba(7, 26, 35, .2); }

.story-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.city-card { overflow: hidden; border: 2px solid var(--ink); background: var(--paper-2); }
.city-card img { width: 100%; aspect-ratio: 3/2; object-fit: cover; filter: saturate(.82) contrast(1.04); }
.city-card > div { padding: 1.5rem; }
.city-card h3 { font-size: 2.1rem; margin: .4rem 0 .7rem; }
.city-card p:not(.eyebrow) { color: var(--ink-soft); }

.culture { background: var(--paper-2); }
.culture-list { border-top: 2px solid var(--ink); }
.culture-card { display: grid; grid-template-columns: .35fr 1fr 1.5fr .65fr; gap: 1.5rem; padding: 1.3rem 0; border-bottom: 1px solid var(--line); align-items: start; }
.culture-card .type { color: var(--coral); font: 800 .72rem var(--font-mono); text-transform: uppercase; }
.culture-card h3, .culture-card p { margin: 0; }
.culture-card a { font-weight: 900; }
.legal-download-note { display: grid; grid-template-columns: .7fr 2fr; gap: 2rem; margin-top: 2rem; padding: 1rem 1.2rem; border: 1px solid var(--line); }
.legal-download-note p { margin: 0; }

.radio { background: #06161f; color: #f8f1e4; }
.radio-shell { position: relative; overflow: hidden; max-width: 75rem; margin: 0 auto; padding: clamp(1.5rem, 5vw, 4rem); border: 2px solid #8da4a9; border-radius: 1.5rem; background: #0b2630; box-shadow: 16px 16px 0 var(--coral); }
.radio-shell h2 { margin-bottom: 1rem; color: #f8f1e4; }
.radio-shell > p:not(.section-number) { color: #bdd0cd; }
.radio-header { display: flex; justify-content: space-between; }
.radio-led { width: .9rem; height: .9rem; border-radius: 50%; background: #5a6b70; }
.radio-led.on { background: #78e6b5; box-shadow: 0 0 22px #78e6b5; }
.radio-display { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; margin: 2rem 0; padding: 1rem; border: 1px solid #577078; background: #06161f; font-family: var(--font-mono); }
.radio-display span { color: var(--mint); }
.radio-display small { color: #9fb5b5; }
.radio-controls { display: flex; align-items: center; gap: 1rem; }
.radio-controls input { accent-color: var(--coral); }
.station-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin-top: 2rem; }
.station-grid a { display: flex; align-items: center; gap: .8rem; padding: .8rem; border: 1px solid #577078; color: #f8f1e4; text-decoration: none; }
.station-grid b { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border: 1px solid var(--mint); border-radius: 50%; color: var(--mint); font-family: var(--font-mono); }
.radio-circuit { position: absolute; inset: 0; pointer-events: none; opacity: .16; }
.radio-circuit i { position: absolute; height: 1px; background: var(--mint); transform-origin: left; }
.radio-circuit i:nth-child(1) { width: 38%; left: 0; top: 20%; transform: rotate(12deg); }
.radio-circuit i:nth-child(2) { width: 31%; right: -5%; top: 37%; transform: rotate(-30deg); }
.radio-circuit i:nth-child(3) { width: 28%; left: 9%; bottom: 18%; transform: rotate(-19deg); }
.radio-circuit i:nth-child(4) { width: 40%; right: -8%; bottom: 12%; transform: rotate(9deg); }
.radio-circuit i:nth-child(5) { width: 1px; height: 70%; left: 62%; top: 0; }

.agent-layout { display: grid; grid-template-columns: .38fr 1fr; gap: 1rem; }
.agent-tabs { display: grid; align-content: start; gap: .55rem; }
.agent-tab { display: grid; grid-template-columns: auto 1fr; gap: .8rem; width: 100%; padding: .9rem; border: 1px solid var(--line); text-align: left; background: var(--paper-2); color: var(--ink); }
.agent-tab[aria-selected="true"] { border: 2px solid var(--ink); box-shadow: 5px 5px 0 var(--coral); }
.agent-avatar { display: grid; place-items: center; width: 2.7rem; height: 2.7rem; border-radius: 50%; background: var(--mint); color: #082b3a; font: 900 .9rem var(--font-mono); }
.agent-tab small { display: block; color: var(--ink-soft); }
.agent-console { min-height: 34rem; padding: 1.2rem; border: 2px solid var(--ink); background: var(--paper-2); }
.agent-intro { display: flex; gap: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.agent-intro h3, .agent-intro p { margin: 0; }
.agent-intro p { color: var(--ink-soft); }
.chat-log { min-height: 13rem; max-height: 28rem; overflow-y: auto; padding: 1rem 0; }
.chat-message { max-width: 82%; margin: .7rem 0; padding: .8rem 1rem; border-radius: .85rem; white-space: pre-wrap; }
.chat-message.user { margin-left: auto; background: var(--ink); color: var(--paper); }
.chat-message.agent { border: 1px solid var(--line); background: var(--paper); }
.agent-form { display: grid; grid-template-columns: 1fr auto; gap: .7rem; }
.agent-form textarea { width: 100%; resize: vertical; padding: .8rem; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
.agent-privacy { color: var(--ink-soft); font-size: .82rem; }

.news { background: var(--paper-2); }
.news-meta { display: flex; justify-content: space-between; margin-bottom: 1rem; color: var(--ink-soft); font: 700 .75rem var(--font-mono); }
.text-button { border: 0; border-bottom: 1px solid currentColor; padding: 0; background: transparent; color: var(--sea-dark); font-weight: 900; }
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.news-card { display: flex; min-height: 18rem; flex-direction: column; padding: 1.1rem; border: 1px solid var(--line); background: var(--paper); }
.news-card h3 { margin: .8rem 0; font-size: 1.25rem; }
.news-card p { color: var(--ink-soft); font-size: .9rem; }
.news-card a { margin-top: auto; font-weight: 900; }
.news-source { display: flex; justify-content: space-between; gap: .5rem; color: var(--coral); font: 700 .68rem var(--font-mono); }

.check-grid { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--line); }
.check-grid article { padding: 1.2rem; border-right: 1px solid var(--line); }
.check-grid article:last-child { border-right: 0; }
.check-grid span { color: var(--coral); font: 900 .75rem var(--font-mono); }
.check-grid p { color: var(--ink-soft); }

.site-footer { padding: 3rem clamp(1rem, 6vw, 7.5rem); background: #082b3a; color: #fffaf0; }
.footer-main { display: grid; grid-template-columns: .5fr 1fr .8fr; gap: 3rem; padding-bottom: 2.5rem; border-bottom: 1px solid #557079; }
.brand-footer { display: block; color: #fffaf0; }
.brand-footer strong { font-size: 1.4rem; }
.brand-footer small { color: var(--mint); }
.footer-main p { margin: 0; color: #c9dad8; }
.footer-main nav { display: grid; align-content: start; gap: .5rem; }
.footer-main a { color: var(--mint); }
.signature { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; margin-top: 1.5rem; color: #a9bdbd; font: 700 .68rem var(--font-mono); }
.signature strong { color: #fffaf0; }
.offline-hint { color: #a9bdbd; font-size: .8rem; }
.offline-hint span:first-child { color: var(--mint); }
.toast { position: fixed; right: 1rem; bottom: 1rem; z-index: 50; max-width: 23rem; padding: .9rem 1rem; border: 2px solid var(--ink); background: var(--yellow); color: #082b3a; box-shadow: 6px 6px 0 var(--ink); font-weight: 800; }
.legal-page { max-width: 72rem; margin: auto; }
.legal-page h1 { max-width: 12ch; }
.legal-page h2 { margin-top: 3.5rem; font-size: clamp(2rem, 4vw, 3.5rem); }
.legal-page h3 { margin-top: 2rem; }
.legal-page li { margin: .6rem 0; }
.legal-callout { padding: 1.2rem; border: 2px solid var(--ink); background: var(--yellow); color: #082b3a; }
.legal-meta { color: var(--ink-soft); font-family: var(--font-mono); }

@media (max-width: 1080px) {
  .emergency-grid { grid-template-columns: repeat(2, 1fr); }
  .emergency-card { border-bottom: 1px solid #557079; }
  .emergency-card:nth-child(2n) { border-right: 0; }
  .emergency-card:last-child { grid-column: 1 / -1; min-height: auto; }
  .needs-grid, .check-grid { grid-template-columns: repeat(2, 1fr); }
  .needs-grid article, .needs-grid article:nth-child(5n), .check-grid article { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .needs-grid article:nth-child(2n), .check-grid article:nth-child(2n) { border-right: 0; }
  .resource-grid, .news-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .utility-bar { align-items: flex-start; }
  .utility-actions { flex-wrap: wrap; justify-content: flex-end; }
  .icon-button span:last-child { display: none; }
  .site-header { grid-template-columns: 1fr auto; }
  .menu-toggle { display: flex; gap: .7rem; padding: .55rem .75rem; border: 1px solid var(--line); background: var(--paper-2); color: var(--ink); font-weight: 800; }
  .site-nav { position: absolute; inset: 100% 0 auto; display: none; padding: 1rem; border-bottom: 1px solid var(--line); background: var(--paper); }
  .site-nav.open { display: grid; }
  .site-nav a { padding: .55rem; }
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .signal-console { min-height: 27rem; }
  .signal-map { height: 20rem; }
  .section-heading { grid-template-columns: 1fr; }
  .section-heading .section-number, .section-heading h2, .section-heading > p:last-child { grid-column: 1; }
  .route-step { grid-template-columns: .35fr 1fr; }
  .route-step p { grid-column: 2; }
  .route-step::before { display: none; }
  .truth-strip, .legal-download-note { grid-template-columns: 1fr; }
  .plan-machine, .agent-layout { grid-template-columns: 1fr; }
  .plan-output { border-left: 0; border-top: 2px solid var(--ink); }
  .agent-tabs { grid-template-columns: repeat(2, 1fr); }
  .story-grid { grid-template-columns: 1fr; }
  .culture-card { grid-template-columns: .4fr 1fr; }
  .culture-card p, .culture-card a { grid-column: 2; }
  .footer-main { grid-template-columns: 1fr; gap: 1.5rem; }
}

@media (max-width: 560px) {
  .section, .hero { padding-left: 1rem; padding-right: 1rem; }
  h1 { font-size: clamp(3.2rem, 17vw, 5.2rem); }
  .utility-bar { padding-inline: .6rem; }
  .language-control select { width: 7rem; }
  .emergency-grid, .needs-grid, .resource-grid, .news-grid, .check-grid { grid-template-columns: 1fr; }
  .emergency-card, .emergency-card:nth-child(2n), .needs-grid article, .needs-grid article:nth-child(2n), .check-grid article { border-right: 0; }
  .emergency-card:last-child { grid-column: auto; }
  .route-step { grid-template-columns: 1fr; gap: .5rem; }
  .route-step p { grid-column: 1; }
  .plan-selects, .station-grid { grid-template-columns: 1fr; }
  .radio-display { grid-template-columns: 1fr; }
  .radio-controls { align-items: stretch; flex-direction: column; }
  .agent-tabs { grid-template-columns: 1fr; }
  .agent-form { grid-template-columns: 1fr; }
  .chat-message { max-width: 94%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

@media print {
  .utility-bar, .site-header, .radio, .agents, .fun-zone, .hero-actions, .toast { display: none !important; }
  body { background: #fff; color: #000; }
  .section, .hero { padding: 1.5rem 0; }
  a { color: #000; text-decoration: underline; }
}

/* ==========================================================================
   Capa 2 · ampliación 2026-10-11
   Todo lo de abajo es aditivo: añade herramientas (salud, sonido, trámites,
   movilidad, glosario), el buscador rápido, el plan privado y un acabado más
   moderno sin cambiar la identidad ni los contratos de app.js/content.js.
   ========================================================================== */

:root {
  --glass: color-mix(in srgb, var(--paper-2) 72%, transparent);
  --mesh-a: color-mix(in srgb, var(--sea) 26%, transparent);
  --mesh-b: color-mix(in srgb, var(--coral) 18%, transparent);
  --mesh-c: color-mix(in srgb, var(--yellow) 22%, transparent);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

/* Reglas que antes vivían en un <style> inline del HTML (CSP sin unsafe-inline). */
html, body { overflow-x: hidden; max-width: 100vw; }
img, video { max-width: 100%; height: auto; }

body {
  background-image:
    radial-gradient(60rem 40rem at 12% -10%, var(--mesh-a), transparent 65%),
    radial-gradient(48rem 32rem at 96% 8%, var(--mesh-b), transparent 62%),
    radial-gradient(52rem 40rem at 60% 120%, var(--mesh-c), transparent 60%),
    linear-gradient(90deg, transparent 49.88%, color-mix(in srgb, var(--line) 22%, transparent) 50%, transparent 50.12%);
  background-attachment: fixed;
}

/* Marcas de contenido canónico en español cuando el idioma no tiene traducción. */
[data-fallback="es"]::after {
  content: "ES";
  display: inline-block;
  margin-left: .4em;
  padding: 0 .35em;
  border: 1px solid var(--line);
  border-radius: .25em;
  font: 700 .6rem/1.5 var(--font-mono);
  color: var(--ink-soft);
  vertical-align: middle;
}

.nojs-note, .nojs-note p {
  max-width: 68rem;
  margin: 0 0 1.2rem;
  padding: .8rem 1rem;
  border-left: 4px solid var(--yellow);
  background: color-mix(in srgb, var(--yellow) 18%, transparent);
  color: #fffaf0;
}

/* --- urgencias: cuadrícula flexible para 5-8 tarjetas -------------------- */
.emergency-grid {
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0;
  border: 1px solid #557079;
}
.emergency-card { min-height: 15rem; border-right: 1px solid #557079; border-bottom: 1px solid #557079; }
.emergency-card:nth-child(2n) { border-right: 1px solid #557079; }

/* --- salud -------------------------------------------------------------- */
.health { background: var(--paper-2); }
.health-tools { display: block; }
.health-grid { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); }
.health-routes, .health-prep, .health-tracker, .health-mood {
  padding: 1.3rem;
  border: 2px solid var(--ink);
  background: var(--panel);
  box-shadow: 8px 8px 0 color-mix(in srgb, var(--sea) 55%, transparent);
}
.health-grid > div:nth-child(2) { box-shadow: 8px 8px 0 color-mix(in srgb, var(--coral) 45%, transparent); }
.health-grid > div:nth-child(3) { box-shadow: 8px 8px 0 color-mix(in srgb, var(--blue) 40%, transparent); }
.health-grid > div:nth-child(4) { box-shadow: 8px 8px 0 color-mix(in srgb, var(--yellow) 55%, transparent); }
.health-route-buttons { display: flex; flex-wrap: wrap; gap: .5rem; margin: .8rem 0 1rem; }
.chip-route {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .5rem .8rem;
  background: var(--paper);
  color: var(--ink);
  font-weight: 800;
  text-align: left;
}
.chip-route[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip-route.tone-coral { border-color: var(--coral); }
.chip-route.tone-yellow { border-color: var(--yellow); }
.health-route-card { padding: 1rem; border-left: 5px solid var(--sea); background: var(--paper); }
.health-route-card.tone-coral { border-left-color: var(--coral); }
.health-route-card.tone-yellow { border-left-color: var(--yellow); }
.health-route-card h4 { margin: 0 0 .6rem; font-family: var(--font-display); font-size: 1.15rem; }
.health-steps { margin: 0 0 .9rem; padding-left: 1.2rem; }
.health-steps li { margin: .4rem 0; }
.health-route-actions, .health-controls { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: .8rem; }
.health-hint { color: var(--ink-soft); font-size: .9rem; }
.health-privacy { margin-top: .9rem; padding-top: .7rem; border-top: 1px dashed var(--line); color: var(--ink-soft); font-size: .82rem; }
.health-readout { margin-top: .9rem; }
.health-clock { display: grid; grid-template-columns: auto auto; gap: .2rem .8rem; align-items: baseline; }
.health-clock strong { font: 900 1.8rem/1 var(--font-mono); color: var(--coral); }
.health-clock-label { font: 700 .7rem/1.2 var(--font-mono); text-transform: uppercase; color: var(--ink-soft); }
.health-bar { height: .7rem; margin: .6rem 0; border: 1px solid var(--ink); background: var(--paper); }
.health-bar i { display: block; height: 100%; background: var(--coral); transition: width .3s var(--ease-out); }
.health-action { font-weight: 800; }
.health-form { display: grid; gap: .7rem; margin-top: .6rem; }
.health-form input[type="text"], .health-form input[type="number"] { width: 100%; padding: .6rem; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
.health-mood-fieldset { border: 1px solid var(--line); padding: .7rem; }
.health-mood-fieldset legend { font-weight: 800; }
.health-list { list-style: none; margin: .9rem 0 0; padding: 0; display: grid; gap: .5rem; }
.health-reminder { display: grid; grid-template-columns: 1fr auto; gap: .2rem .8rem; padding: .6rem; border: 1px dashed var(--line); }
.health-reminder span { grid-column: 1; color: var(--ink-soft); font-size: .85rem; }
.health-chart { margin-top: 1rem; }
.health-bars { display: flex; align-items: flex-end; gap: .35rem; height: 6rem; margin: .6rem 0 0; padding: .5rem; border: 1px solid var(--line); background: var(--paper); list-style: none; }
.health-bars li { flex: 1; display: flex; align-items: flex-end; height: 100%; }
.health-bars i { display: block; width: 100%; min-height: .6rem; background: linear-gradient(180deg, var(--sea), var(--blue)); border-radius: .2rem .2rem 0 0; }
.health-crisis { margin-top: .8rem; padding: .7rem .9rem; border: 2px solid var(--coral); background: color-mix(in srgb, var(--coral) 12%, var(--paper)); font-weight: 800; }
.health-topics { margin-top: 1.6rem; }
.health-topics-details { border: 1px solid var(--line); background: var(--panel); padding: 1rem 1.2rem; }
.health-topics-details summary { font-weight: 900; cursor: pointer; }
.health-topics-list { margin: 1rem 0 0; padding-left: 1.1rem; }
.health-topics-list li { margin: .7rem 0; }
.health-topics-list strong { display: block; }
.health-topics-list span { color: var(--ink-soft); }

/* --- estudio de sonido --------------------------------------------------- */
.music { background: #06161f; color: #f8f1e4; }
.music .section-heading > p:last-child { color: #bdd0cd; }
.music .section-number { color: var(--mint); }
.studio-host { margin-bottom: 1rem; }
.studio {
  padding: clamp(1rem, 3vw, 2rem);
  border: 2px solid #8da4a9;
  border-radius: 1.2rem;
  background: linear-gradient(160deg, #0b2630, #06161f 70%);
  box-shadow: 12px 12px 0 color-mix(in srgb, var(--coral) 70%, #06161f);
}
.studio-toolbar { display: flex; flex-wrap: wrap; gap: .8rem; align-items: end; }
.studio-sliders { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); margin: 1.2rem 0; }
/* Los campos se comparten entre el estudio (panel oscuro) y las herramientas
   de salud/trámites (paneles claros). El color por defecto es el del tema y el
   estudio oscurece lo suyo: así axe no encuentra texto claro sobre papel. */
.studio-field { display: grid; gap: .35rem; font-weight: 800; color: var(--ink); }
.studio-field > span { font: 700 .7rem/1.2 var(--font-mono); text-transform: uppercase; color: var(--sea-dark); }
.studio-field input[type="range"] { accent-color: var(--yellow); width: 100%; }
.studio-field select, .studio-field input[type="text"], .studio-field input[type="number"] {
  padding: .55rem; border: 1px solid var(--line); background: var(--paper-2); color: var(--ink);
}
.studio .studio-field { color: #f8f1e4; }
.studio .studio-field > span { color: var(--mint); }
.studio .studio-field select, .studio .studio-field input[type="text"], .studio .studio-field input[type="number"] {
  border: 1px solid #577078; background: #06161f; color: #f8f1e4;
}
.studio-output { font: 700 .75rem/1 var(--font-mono); color: var(--yellow); }
.studio-canvas { width: 100%; height: auto; border: 1px solid #577078; border-radius: .6rem; background: #06161f; }
.studio-status { margin: .8rem 0 0; color: #bdd0cd; font-size: .86rem; }
.station-extra { max-width: 75rem; margin: 2rem auto 0; }
.station-extra h3 { color: #f8f1e4; }
.station-extra p { color: #bdd0cd; }
.music-legal { max-width: 68rem; margin: 1rem 0 0; color: #8fa6a6; font-size: .82rem; }

/* --- trámites ------------------------------------------------------------ */
.tramites-section { background: var(--paper-2); }
.tramites { display: grid; gap: 1.4rem; grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); align-items: start; }
.tramites-form { display: grid; gap: .8rem; padding: 1.3rem; border: 2px solid var(--ink); background: var(--panel); box-shadow: 8px 8px 0 var(--ink); position: sticky; top: 6rem; }
.tramites-output { min-height: 12rem; }
.tramites-header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem; align-items: baseline; }
.tramites-progress { font: 700 .75rem/1 var(--font-mono); color: var(--sea-dark); }
.tramites-list { list-style: none; margin: 1rem 0; padding: 0; counter-reset: paso; }
.tramites-step { display: grid; grid-template-columns: auto 1fr; gap: .8rem; padding: .9rem 0; border-top: 1px solid var(--line); }
.tramites-step input { width: 1.3rem; height: 1.3rem; margin-top: .2rem; accent-color: var(--sea); }
.tramites-step label { display: grid; gap: .3rem; }
.tramites-step strong { font-size: 1.05rem; }
.tramites-step span { color: var(--ink-soft); }
.tramites-step input:checked + label strong { text-decoration: line-through; text-decoration-color: var(--sea); }
.tramites-source { font: 700 .75rem/1.3 var(--font-mono); }
.checklist-block { margin-top: 3rem; }
.checklist-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); margin-top: 1rem; }
.checklist-card { padding: 1.2rem; border: 1px solid var(--line); background: var(--paper); }
.checklist-header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem; align-items: baseline; }
.checklist-header h3 { margin: 0; font-size: 1.2rem; }
.checklist-audience { font: 700 .68rem/1 var(--font-mono); color: var(--coral); text-transform: uppercase; }
.checklist-items { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .7rem; }
.checklist-items li { display: grid; grid-template-columns: auto 1fr; gap: .6rem; }
.checklist-items input { width: 1.2rem; height: 1.2rem; margin-top: .2rem; accent-color: var(--sea); }
.checklist-items label { display: grid; gap: .15rem; }
.checklist-items span { color: var(--ink-soft); font-size: .88rem; }

/* --- movilidad ----------------------------------------------------------- */
.move { background: var(--paper); }
.move-notes { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); margin-bottom: 1.5rem; }
.move-notes article { padding: 1rem; border-left: 5px solid var(--sea); background: var(--paper-2); }
.move-notes h3 { margin: 0 0 .4rem; font-size: 1.1rem; }
.move-notes p { margin: 0; color: var(--ink-soft); }
.transport-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.transport-card { display: flex; flex-direction: column; gap: .5rem; padding: 1.1rem; border: 1px solid var(--line); background: var(--panel); }
.transport-card h3 { margin: 0; font-size: 1.15rem; }
.transport-card p { margin: 0; color: var(--ink-soft); font-size: .92rem; }
.transport-mode { font: 800 .68rem/1 var(--font-mono); color: var(--coral); text-transform: uppercase; }
.transport-tip { border-left: 3px solid var(--yellow); padding-left: .6rem; color: var(--ink) !important; font-size: .86rem !important; }
.transport-card a { margin-top: auto; font-weight: 900; }

/* --- glosario ------------------------------------------------------------ */
.glossary { background: var(--paper-2); }
.glossary-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.glossary-card { padding: 1.1rem; border: 1px solid var(--line); background: var(--paper); }
.glossary-card h3 { margin: 0 0 .3rem; font-size: 1.15rem; }
.glossary-short { margin: 0 0 .5rem; font-weight: 800; }
.glossary-card p { color: var(--ink-soft); font-size: .9rem; }
.glossary-card a { font-weight: 800; }

/* --- buscador rápido ----------------------------------------------------- */
.palette { position: fixed; inset: 0; z-index: 60; display: grid; align-items: start; justify-items: center; padding: 8vh 1rem 2rem; background: color-mix(in srgb, #06161f 72%, transparent); backdrop-filter: blur(4px); }
.palette[hidden] { display: none; }
.palette-panel { width: min(46rem, 100%); border: 2px solid var(--ink); border-radius: 1rem; background: var(--paper-2); box-shadow: 0 30px 80px rgba(6, 22, 31, .45); overflow: hidden; }
.palette-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); }
.palette-header h2 { margin: 0; font-size: 1.3rem; }
.palette-close { border: 1px solid var(--line); border-radius: 999px; padding: .3rem .7rem; background: transparent; color: var(--ink); font: 700 .72rem/1.4 var(--font-mono); }
.palette-input { width: 100%; padding: 1rem 1.1rem; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 1.05rem; }
.palette-results { list-style: none; max-height: 55vh; overflow-y: auto; margin: 0; padding: .5rem 0; }
.palette-group { padding: .5rem 1.1rem .2rem; font: 800 .66rem/1 var(--font-mono); text-transform: uppercase; color: var(--coral); }
.palette-item { display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem; padding: .6rem 1.1rem; cursor: pointer; }
.palette-item strong { display: block; }
.palette-item span { grid-column: 1; color: var(--ink-soft); font-size: .82rem; }
.palette-item b { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--sea-dark); font: 800 .75rem/1 var(--font-mono); }
.palette-item.is-active, .palette-item[aria-selected="true"] { background: color-mix(in srgb, var(--sea) 18%, transparent); }
.palette-empty { padding: 1rem 1.1rem; color: var(--ink-soft); }
.palette-hint { margin: 0; padding: .7rem 1.1rem; border-top: 1px solid var(--line); color: var(--ink-soft); font: 700 .7rem/1.3 var(--font-mono); }
body.palette-open { overflow: hidden; }

/* --- plan privado -------------------------------------------------------- */
.plan-drawer { position: fixed; inset: auto 0 0 0; z-index: 55; max-height: 80vh; overflow-y: auto; padding: 1.2rem clamp(1rem, 4vw, 3rem) 2rem; border-top: 2px solid var(--ink); background: var(--paper-2); box-shadow: 0 -20px 60px rgba(6, 22, 31, .3); }
.plan-drawer[hidden] { display: none; }
.plan-drawer-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.plan-drawer-header h2 { margin: 0; font-size: 1.4rem; }
.plan-drawer-list { list-style: none; margin: 1rem 0; padding: 0; display: grid; gap: .6rem; }
.plan-drawer-list li { display: grid; grid-template-columns: 1fr auto auto; gap: .8rem; align-items: center; padding: .6rem; border: 1px solid var(--line); background: var(--paper); }
.connection-state { display: inline-flex; align-items: center; gap: .4rem; font: 700 .68rem/1 var(--font-mono); }
.connection-state::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--mint); }
.connection-state[data-state="offline"]::before { background: var(--coral); }
.connection-state[data-state="update"]::before { background: var(--yellow); }

/* --- directorio ampliado ------------------------------------------------- */
.level-badge { padding: .2rem .45rem; border-radius: 999px; font: 800 .62rem/1.3 var(--font-mono); border: 1px solid var(--ink); }
/* Contraste WCAG AA comprobado con axe en día (#fffaf0 sobre #005c58 = 8.9:1)
   y noche (#041e1c sobre #63d8c7 = 10:1). El color de día se cambió tras
   detectar 43 nodos con contraste 3.5:1 (nivel A sobre --sea). */
.level-A { background: var(--sea-dark); color: var(--paper-2); }
.level-B { background: var(--mint); color: #06231d; }
.level-C { background: color-mix(in srgb, var(--line) 60%, var(--paper)); color: var(--ink); }
[data-theme="night"] .level-A { background: var(--sea); color: #041e1c; }
.resource-actions .text-button { font-size: .82rem; }
.chat-sources { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: -.3rem 0 .9rem; padding: .5rem .6rem; border-left: 3px solid var(--sea); background: color-mix(in srgb, var(--sea) 8%, transparent); }
.chat-sources-label { font: 700 .68rem/1 var(--font-mono); color: var(--ink-soft); }
.chat-source { padding: .15rem .45rem; border: 1px solid var(--line); border-radius: 999px; font-size: .78rem; text-decoration: none; }
.chat-source[data-level="A"] { border-color: var(--sea); }
.chat-safety { margin: .4rem 0; padding: .6rem .8rem; border: 2px solid var(--coral); font-weight: 800; }
.agent-mode { margin: .6rem 0 0; font: 700 .7rem/1.3 var(--font-mono); color: var(--ink-soft); }

/* --- navegación activa y acabado moderno --------------------------------- */
.site-nav a[aria-current="true"] { color: var(--coral); text-decoration: underline; text-decoration-thickness: .18em; }
.section-heading h2 { text-wrap: balance; }
.resource-card, .news-card, .city-card, .culture-card, .checklist-card, .transport-card, .glossary-card { transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out), border-color .25s var(--ease-out); }
.resource-card:hover, .checklist-card:hover, .transport-card:hover, .glossary-card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(6, 22, 31, .12); }
.button { transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out), background-color .2s var(--ease-out); }

/* --- modo discreto ------------------------------------------------------- */
body.is-discreet .brand strong, body.is-discreet .brand small { visibility: hidden; }
body.is-discreet .radio, body.is-discreet .fun-zone .night-note, body.is-discreet [data-discreet-hide] { display: none !important; }
body.is-discreet .city-card img, body.is-discreet .hero .signal-map { filter: grayscale(1) contrast(.8); }

/* --- impresión de plan y trámites ---------------------------------------- */
/* --- 17 · IA con límites: contrato visible, no marketing ----------------
   Tres tarjetas de estado y un bloque copiable. Colores tomados de las
   variables del tema para no introducir contrastes nuevos ni orígenes. */
.ai-contract { display: grid; gap: 1.5rem; }
.ai-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.ai-card {
  display: grid; gap: .55rem; align-content: start;
  padding: 1.1rem 1.2rem; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--paper-2);
}
.ai-card h3 { margin: 0; font-size: 1.02rem; color: var(--ink); }
.ai-card p { margin: 0; color: var(--ink-soft); font-size: .92rem; line-height: 1.55; }
.ai-badge {
  justify-self: start; padding: .2rem .55rem; border-radius: 999px; border: 1px solid var(--line);
  font: 700 .68rem/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .08em;
  background: var(--sea-dark); color: var(--paper-2); /* 8.9:1 medido, igual que .level-A */
}
.ai-badge-remote { background: var(--sun-dark, var(--sea-dark)); color: var(--paper-2); }
.ai-badge-limits { background: var(--ink); color: var(--paper-2); }
[data-theme="night"] .ai-badge { background: var(--sea); color: #041e1c; }
[data-theme="night"] .ai-badge-limits { background: var(--paper-2); color: var(--ink); }
[data-theme="night"] .ai-card { background: #0d2a30; border-color: rgba(248, 241, 228, .18); }

.ai-prompt {
  display: grid; gap: .8rem; padding: 1.2rem 1.3rem;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--paper-2), var(--paper));
}
.ai-prompt-head { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: baseline; justify-content: space-between; }
.ai-prompt-head h3 { margin: 0; }
.ai-prompt-file { font: 700 .7rem/1.6 var(--font-mono); color: var(--ink-soft); }
.ai-prompt-body {
  margin: 0; max-height: 16rem; overflow: auto; padding: .9rem 1rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
  color: var(--ink); font: .82rem/1.6 var(--font-mono); white-space: pre-wrap;
}
.ai-prompt-body:focus-visible { outline: 2px solid var(--sea-dark); outline-offset: 2px; }
.ai-prompt-actions { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }
.ai-feedback { margin: 0; min-height: 1.2rem; color: var(--ink-soft); font-size: .85rem; }
.ai-metrics { margin: 0; color: var(--ink-soft); font-size: .86rem; }
[data-theme="night"] .ai-badge.ai-badge-limits { background: var(--paper-2); color: var(--ink); }
@media (max-width: 560px) {
  .ai-prompt-body { max-height: 20rem; font-size: .78rem; }
}
@media print {
  .ai-prompt-actions { display: none !important; }
  .ai-prompt-body { max-height: none; overflow: visible; }
}

@media print {
  body.printing-tramites .tramites-form, body.printing-tramites .checklist-block { display: none !important; }
  body.printing-plan .plan-drawer { position: static; box-shadow: none; border: 0; max-height: none; }
  body.printing-plan .plan-drawer-list li button, body.printing-plan .plan-drawer .health-controls button { display: none !important; }
  .palette, .plan-drawer .palette-close { display: none !important; }
}

@media (max-width: 900px) {
  .tramites { grid-template-columns: 1fr; }
  .tramites-form { position: static; }
}
@media (max-width: 560px) {
  .palette { padding-top: 4vh; }
  .plan-drawer-list li { grid-template-columns: 1fr; }
  .health-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .health-bar i, .resource-card, .checklist-card, .transport-card, .glossary-card, .button { transition: none; }
  .resource-card:hover, .checklist-card:hover, .transport-card:hover, .glossary-card:hover, .ai-card:hover { transform: none; }
}
