/* tucasaesmicasa.es
   Lenguaje visual: el cartel naranja de «Se vende», la fotocopia pegada en el portal,
   el rotulador, el sello de juzgado y la marca blanca del súper. */

:root {
  --ink: #000;
  --paper: #fff;
  --copy: #ecedea;      /* fotocopia / pared de portal */
  --sign: #ff5b14;      /* naranja de cartel «Se vende» */
  --sticker: #ffe81a;   /* pegatina de precio */
  --biro: #1d3fcf;      /* bolígrafo azul */
  --line: #c9cac5;

  --font: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --hand: "Permanent Marker", "Comic Sans MS", cursive;

  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --measure: 66ch;
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

h1, h2, h3 { margin: 0; text-wrap: balance; }

p { margin: 0 0 1rem; }

a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: .18em; }
a:hover { text-decoration-color: var(--sign); }

:focus-visible { outline: 3px solid var(--biro); outline-offset: 3px; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.skip {
  position: absolute; left: 1rem; top: -100px; z-index: 100;
  background: var(--sticker); padding: .5rem 1rem; font-weight: 700;
}
.skip:focus { top: 1rem; }

.hand { font-family: var(--hand); font-weight: 400; }

.footnote { font-size: .95rem; }

/* ---------- Aviso superior ---------- */

.bar {
  margin: 0;
  padding: .55rem var(--gutter);
  background: var(--ink);
  color: var(--paper);
  font-size: .9rem;
  text-align: center;
}

/* ---------- Cabecera ---------- */

.site-header {
  position: sticky; top: 0; z-index: 30;
  background: var(--paper);
  border-bottom: 3px solid var(--ink);
}

.header-row { display: flex; align-items: center; gap: 1.5rem; min-height: 68px; }

.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  font-weight: 800; font-stretch: 78%; font-size: 1.45rem; letter-spacing: -.01em;
  text-decoration: none; white-space: nowrap;
}
.brand .tld { color: var(--sign); }
.site-footer .brand .tld { color: var(--sign); }

.nav { display: flex; gap: 1.75rem; margin-left: auto; }
.nav a { font-weight: 650; text-decoration: none; padding-block: .25rem; }
.nav a:hover,
.nav a[aria-current] {
  text-decoration: underline;
  text-decoration-color: var(--sign);
  text-decoration-thickness: 4px;
  text-underline-offset: .35em;
}

.menu-btn,
.cart-btn {
  font: inherit; font-weight: 700; font-size: 1rem;
  background: var(--paper); color: var(--ink);
  border: 3px solid var(--ink); padding: .4rem .8rem;
  cursor: pointer;
}
.cart-btn { display: inline-flex; align-items: center; gap: .5rem; }
.cart-btn:hover, .menu-btn:hover { background: var(--sticker); }
.cart-count {
  display: inline-grid; place-items: center;
  min-width: 1.6rem; height: 1.6rem; padding-inline: .3rem;
  background: var(--sticker); border: 2px solid var(--ink); border-radius: 999px;
  font-size: .85rem; line-height: 1;
}
.menu-btn { display: none; margin-left: auto; }

@media (max-width: 760px) {
  .header-row { gap: .6rem; min-height: 60px; flex-wrap: wrap; }
  .brand { font-size: 1.2rem; }
  .brand .logo { width: 30px; height: 30px; }
  .menu-btn { display: inline-block; }
  .nav {
    display: none; order: 3; width: 100%;
    flex-direction: column; gap: 0; margin: 0 0 .75rem;
    border-top: 2px solid var(--ink);
  }
  .site-header.nav-open .nav { display: flex; }
  .nav a { padding: .8rem 0; border-bottom: 1px solid var(--line); font-size: 1.2rem; }
  .cart-btn { padding: .35rem .6rem; }
}

@media (max-width: 400px) {
  .brand > span { font-size: 1.05rem; }
  .cart-btn { font-size: 0; gap: 0; }
  .cart-btn .cart-count { font-size: .85rem; }
  .cart-btn::before { content: "🛒"; font-size: 1.1rem; margin-right: .3rem; }
}

/* ---------- Botones ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-weight: 750; font-size: 1.05rem; line-height: 1.2;
  padding: .8rem 1.3rem;
  background: var(--ink); color: var(--paper);
  border: 3px solid var(--ink); border-radius: 0;
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--sign); color: var(--ink); }
.btn-line { background: transparent; color: var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--paper); }
.btn-sm { font-size: .95rem; padding: .55rem .9rem; }

.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

/* ---------- Portada: cartel ---------- */

.hero {
  background: var(--copy);
  padding-block: clamp(3rem, 7vw, 5.5rem) clamp(3.5rem, 8vw, 6rem);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}
.hero h1 {
  font-weight: 900; font-stretch: 62%;
  font-size: clamp(3.4rem, 8vw, 6.4rem);
  line-height: .86; letter-spacing: -.01em;
}
.lede {
  margin: 1.25rem 0 1rem;
  font-size: clamp(1.3rem, 2.2vw, 1.6rem); font-weight: 650; line-height: 1.3;
  max-width: 26ch;
}
.lede a { text-decoration: none; color: var(--sign); font-weight: 900; }
.hero-copy > p { max-width: 46ch; }
.hero .footnote { margin-top: 1.5rem; }

.sign {
  position: relative;
  justify-self: end;
  width: 100%; max-width: 500px;
  margin: 0;
  padding: clamp(1.25rem, 3vw, 1.9rem);
  background: var(--sign);
  transform: rotate(-2.2deg);
  box-shadow: 0 2px 0 rgba(0,0,0,.06), 0 26px 40px -24px rgba(0,0,0,.55);
}
.sign-head {
  margin: 0;
  font-weight: 900; font-stretch: 62%;
  font-size: clamp(5.2rem, 15vw, 10.5rem);
  line-height: .8; letter-spacing: -.02em;
}
.sign-sub {
  margin: .9rem 0 0;
  font-weight: 750; font-stretch: 80%; font-size: clamp(1.05rem, 2vw, 1.3rem); line-height: 1.2;
}
.sign-panel {
  margin-top: 1.1rem;
  padding: .8rem 1rem .9rem;
  background: var(--paper);
  border: 2px solid var(--ink);
}
.sign-panel p { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .7rem; margin: 0; }
.sign-panel p + p { margin-top: .35rem; }
.sign-label { font-weight: 800; font-size: 1rem; min-width: 3.6rem; }
.sign-panel .hand { font-size: clamp(1.3rem, 2.4vw, 1.65rem); line-height: 1.15; }
.sign-panel s { text-decoration-thickness: 3px; }
.tape {
  position: absolute; top: -14px;
  width: 112px; height: 30px;
  background: rgba(238, 233, 214, .78);
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
}
.tape-l { left: -24px; transform: rotate(-30deg); }
.tape-r { right: -24px; transform: rotate(26deg); }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .sign { justify-self: center; max-width: 430px; }
}

/* ---------- Teletipo ---------- */

.ticker {
  display: flex; align-items: stretch;
  background: var(--ink); color: var(--paper);
  overflow: hidden;
}
.ticker-label {
  flex: none; margin: 0;
  display: flex; align-items: center;
  padding: .65rem 1rem;
  background: var(--sign); color: var(--ink);
  font-weight: 850; font-stretch: 75%; font-size: 1.05rem;
  position: relative; z-index: 1;
}
.ticker-viewport { overflow: hidden; flex: 1; }
.ticker-track { display: flex; width: max-content; animation: ticker 90s linear infinite; }
.ticker:hover .ticker-track,
.ticker:focus-within .ticker-track { animation-play-state: paused; }
.ticker ul { display: flex; margin: 0; padding: 0; list-style: none; }
.ticker li { padding: .65rem 0 .65rem 1.4rem; white-space: nowrap; font-size: 1rem; }
.ticker li::after {
  content: ""; display: inline-block;
  width: .5em; height: .5em; margin-left: 1.4rem;
  background: var(--sign); vertical-align: .1em;
}
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- Secciones ---------- */

.section { padding-block: clamp(3.5rem, 8vw, 6rem); }
.section-alt { background: var(--copy); }
.section-rule { border-top: 3px solid var(--ink); }

.section-head { max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head h2 + p { margin-top: .9rem; }
.section-head p { font-size: 1.2rem; }
.section-head p:last-child { margin-bottom: 0; }
.section-head .footnote { font-size: .95rem; max-width: 46ch; }

h2 {
  font-weight: 850; font-stretch: 66%;
  font-size: clamp(2.3rem, 5vw, 3.6rem);
  line-height: .95; letter-spacing: -.005em;
}
h3 { font-size: 1.35rem; font-weight: 750; line-height: 1.2; }

.more-link { margin-top: 2rem; font-weight: 700; }

/* ---------- Pasos ---------- */

.steps {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 3.5rem);
  margin: 0; padding: 0; list-style: none;
}
.steps li { border-top: 6px solid var(--ink); padding-top: 1rem; }
.step-num {
  display: block;
  font-weight: 900; font-stretch: 62%; font-size: 5.5rem; line-height: .85;
  margin-bottom: .75rem;
}
.steps h3 { margin-bottom: .6rem; }
.steps p { margin: 0; }

.redacted {
  background: var(--ink); color: var(--ink);
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
  padding-inline: .1em;
}
.redacted::selection { background: var(--sticker); color: var(--ink); }

@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; }
}

/* ---------- Lista de guías ---------- */

.guide-list { list-style: none; margin: 0; padding: 0; border-bottom: 3px solid var(--ink); }
.guide-list li { border-top: 3px solid var(--ink); }
.guide-list a {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) auto;
  gap: .5rem 2.5rem; align-items: baseline;
  padding: 1.4rem 0 1.5rem;
  text-decoration: none;
}
.guide-title {
  font-weight: 850; font-stretch: 70%;
  font-size: clamp(1.55rem, 2.8vw, 2.15rem); line-height: 1.02;
}
.guide-dek { font-size: 1.05rem; }
.guide-time { font-size: .95rem; white-space: nowrap; }
.guide-list a:hover .guide-title {
  text-decoration: underline; text-decoration-color: var(--sign);
  text-decoration-thickness: 5px; text-underline-offset: .12em;
}

@media (max-width: 860px) {
  .guide-list a { grid-template-columns: 1fr; }
}

/* ---------- Banda okupómetro ---------- */

.band { background: var(--sign); border-block: 3px solid var(--ink); }
.band-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1.5rem 3rem; padding-block: clamp(2.25rem, 5vw, 3.25rem);
}
.band h2 { font-size: clamp(2.2rem, 4.5vw, 3.2rem); }
.band p { max-width: 44ch; margin: .75rem 0 0; font-size: 1.15rem; }
.band .btn:hover { background: var(--paper); }

/* ---------- Productos: marca blanca ---------- */

.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
  gap: clamp(2rem, 4vw, 3rem) clamp(1.5rem, 3vw, 2.5rem);
}
.product { display: flex; flex-direction: column; align-items: flex-start; }
.product > p { margin: 1.1rem 0 1rem; flex: 1; }

.pack {
  position: relative; width: 100%;
  min-height: 250px;
  display: flex; flex-direction: column;
  padding: 1rem 1.1rem .9rem;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-top: 22px solid var(--band, var(--sign));
}
.pack-brand { margin: 0 0 .6rem; font-size: .85rem; font-weight: 700; }
.pack-name {
  font-weight: 900; font-stretch: 62%;
  font-size: clamp(2rem, 3.2vw, 2.45rem); line-height: .92;
  margin-right: 3.5rem;
}
.pack-meta {
  display: flex; justify-content: space-between; gap: 1rem;
  margin: auto 0 0; padding-top: .5rem;
  border-top: 2px solid var(--ink);
  font-size: .85rem; font-weight: 600;
}
.price {
  position: absolute; right: -16px; top: -34px;
  display: grid; place-items: center;
  width: 92px; height: 92px; margin: 0;
  background: var(--sticker); border-radius: 50%;
  font-family: var(--hand); font-size: 1.3rem; line-height: 1; text-align: center;
  transform: rotate(9deg);
  box-shadow: 0 6px 12px -8px rgba(0,0,0,.6);
}
.price small { display: block; font-size: .8rem; }

.notice {
  max-width: 46rem;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding: 1.1rem 1.25rem;
  background: var(--paper);
  border: 2px dashed var(--ink);
  font-size: 1.05rem;
}
.notice p:last-child { margin-bottom: 0; }

/* ---------- Inmuebles ---------- */

.listings {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 255px), 1fr));
  gap: 2rem;
}
.listing {
  position: relative;
  background: var(--paper);
  padding: 0 1.2rem 1.2rem;
  border: 1px solid var(--line);
  box-shadow: 0 16px 24px -20px rgba(0,0,0,.6);
}
.listing:nth-child(odd) { transform: rotate(-.6deg); }
.listing:nth-child(even) { transform: rotate(.5deg); }
.listing-ref {
  display: flex; justify-content: space-between; gap: 1rem;
  margin: 0 -1.2rem 1rem; padding: .45rem 1.2rem;
  background: var(--sign);
  font-weight: 850; font-stretch: 72%; font-size: 1.1rem;
}
.listing h3 { font-weight: 850; font-stretch: 72%; font-size: 1.6rem; line-height: 1; }
.listing .place { font-size: .95rem; margin: .4rem 0 0; }
.listing dl { display: grid; grid-template-columns: auto 1fr; gap: .3rem .8rem; margin: 1rem 0 0; font-size: 1rem; }
.listing dt { font-weight: 750; }
.listing dd { margin: 0; }
.listing .footnote { margin: .9rem 0 0; padding-top: .7rem; border-top: 1px solid var(--line); }

/* ---------- Chat de la comunidad ---------- */

.split {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 4rem); align-items: start;
}
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.chat {
  max-width: 470px; width: 100%;
  background: #dfe3dc;
  border: 3px solid var(--ink);
  border-radius: 22px;
  overflow: hidden;
  justify-self: center;
}
.chat-top { display: flex; flex-direction: column; padding: .8rem 1.1rem; background: var(--paper); border-bottom: 2px solid var(--ink); }
.chat-top strong { font-size: 1.1rem; }
.chat-top span { font-size: .85rem; }
.chat-log { list-style: none; margin: 0; padding: 1rem .9rem 1.2rem; display: flex; flex-direction: column; gap: .5rem; }
.msg {
  position: relative; align-self: flex-start;
  max-width: 85%;
  padding: .45rem .7rem 1.1rem;
  background: var(--paper);
  border-radius: 4px 14px 14px 14px;
  box-shadow: 0 1px 0 rgba(0,0,0,.15);
  font-size: 1rem; line-height: 1.35;
}
.msg b { display: block; font-size: .85rem; color: var(--who, var(--biro)); }
.msg p { margin: 0; }
.msg time { position: absolute; right: .6rem; bottom: .25rem; font-size: .72rem; color: #555; }
.msg-mine { align-self: flex-end; background: #fff7b8; border-radius: 14px 4px 14px 14px; }
.who-encarna { --who: #a3245f; }
.who-paco { --who: #1d3fcf; }
.who-kevin { --who: #0d6b38; }
.audio { display: flex; align-items: center; gap: .55rem; min-width: 200px; }
.audio::before {
  content: ""; flex: none;
  border-left: 12px solid var(--ink); border-block: 8px solid transparent;
}
.wave {
  flex: 1; height: 18px;
  background:
    repeating-linear-gradient(90deg, #6f6f6f 0 2px, transparent 2px 5px) center / 100% 40% no-repeat,
    repeating-linear-gradient(90deg, transparent 0 5px, #6f6f6f 5px 7px, transparent 7px 15px) center / 100% 100% no-repeat;
}
.chat-event {
  align-self: center;
  padding: .25rem .7rem; margin-top: .3rem;
  background: rgba(255,255,255,.75); border-radius: 8px;
  font-size: .82rem;
}

/* ---------- Preguntas ---------- */

.faq { max-width: 50rem; border-bottom: 3px solid var(--ink); }
.faq details { border-top: 3px solid var(--ink); }
.faq summary {
  display: flex; justify-content: space-between; gap: 1rem; align-items: baseline;
  padding: 1.15rem 0; cursor: pointer; list-style: none;
  font-weight: 800; font-stretch: 85%; font-size: 1.35rem; line-height: 1.2;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 900; font-size: 1.8rem; line-height: .8; }
.faq details[open] summary::after { content: "−"; }
.faq details > p { max-width: var(--measure); margin: -.25rem 0 1.4rem; }

/* ---------- Cabecera de página interior ---------- */

.page-head { padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(2rem, 4vw, 3rem); border-bottom: 3px solid var(--ink); }
.page-head h1,
.article-title {
  font-weight: 900; font-stretch: 62%;
  font-size: clamp(3rem, 8vw, 6rem); line-height: .88; letter-spacing: -.01em;
  max-width: 17ch;
}
.page-head .intro,
.article-dek { margin: 1.25rem 0 0; max-width: 44rem; font-size: clamp(1.2rem, 2vw, 1.4rem); line-height: 1.4; }
.crumbs { margin-bottom: 1.5rem; font-size: .95rem; }
.crumbs a { font-weight: 600; }
.article-meta { margin: 1.25rem 0 0; font-size: .95rem; }

/* ---------- Artículo ---------- */

.prose { max-width: var(--measure); padding-block: clamp(2rem, 5vw, 3rem) clamp(3rem, 6vw, 4.5rem); }
.prose > p:first-child { font-size: 1.25rem; line-height: 1.5; }
.prose h2 { font-size: clamp(1.8rem, 3.6vw, 2.5rem); margin: 2.6rem 0 .9rem; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1.2rem; }
.prose li { margin-bottom: .45rem; }
.prose li::marker { font-weight: 800; }
.prose blockquote {
  margin: 1.6rem 0; padding: .2rem 0 .2rem 1.2rem;
  border-left: 6px solid var(--sign);
  font-size: 1.25rem; font-weight: 600; line-height: 1.4;
}
.prose dl { margin: 0 0 1.2rem; }
.prose dt { font-weight: 800; margin-top: .9rem; }
.prose dd { margin: .1rem 0 0; }

.note {
  display: block;
  margin: 1.25rem 0 1.5rem; padding-left: 1rem;
  border-left: 3px solid var(--biro);
  font-family: var(--hand); color: var(--biro);
  font-size: 1.2rem; line-height: 1.3;
  transform: rotate(-1.2deg);
}
@media (min-width: 1120px) {
  .note {
    float: right; clear: right;
    width: 230px; margin: .2rem calc(-230px - 3.5rem) 1rem 0;
  }
}

.table-wrap { overflow-x: auto; margin: 1.5rem 0 1.8rem; }
.prose table { width: 100%; border-collapse: collapse; font-size: 1rem; min-width: 520px; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: .6rem .8rem .6rem 0; border-bottom: 1px solid var(--line); }
.prose thead th { border-bottom: 3px solid var(--ink); font-weight: 800; }
.prose tbody th { font-weight: 700; }
.prose tr.is-you th, .prose tr.is-you td { background: var(--sticker); }

@media (max-width: 600px) {
  .prose table { min-width: 0; }
  .prose thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .prose tbody tr {
    display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem;
    padding: .75rem 0; border-bottom: 1px solid var(--line);
  }
  .prose tbody th, .prose tbody td { padding: 0; border: 0; background: none; }
  .prose tbody td:nth-of-type(1) { text-align: right; font-size: .95rem; }
  .prose tbody td:last-child { grid-column: 1 / -1; }
  .prose tr.is-you { background: var(--sticker); padding-inline: .6rem; }
  .prose tr.is-you th, .prose tr.is-you td { background: none; }
}

.serious {
  margin-top: 3rem; padding: 1.2rem 1.4rem;
  background: var(--copy); border-left: 6px solid var(--ink);
  font-size: 1rem;
}
.serious h2 { font-size: 1.25rem; font-weight: 800; font-stretch: 100%; margin: 0 0 .4rem; }
.serious p:last-child { margin-bottom: 0; }

/* ---------- Okupómetro ---------- */

.calc {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem); align-items: start;
}
@media (max-width: 900px) { .calc { grid-template-columns: 1fr; } }

.calc fieldset { border: 0; margin: 0 0 2.25rem; padding: 0; min-width: 0; }
.calc legend { padding: 0; margin-bottom: .8rem; font-weight: 850; font-stretch: 75%; font-size: 1.6rem; line-height: 1.1; }
.calc .hint { margin: -.4rem 0 .9rem; font-size: .95rem; }

.choice {
  display: flex; gap: .75rem; align-items: flex-start;
  margin-bottom: .5rem; padding: .65rem .8rem;
  background: var(--paper); border: 2px solid var(--ink);
  cursor: pointer; font-size: 1.02rem; line-height: 1.35;
}
.choice:hover { background: #fffbd6; }
.choice:has(input:checked) { background: var(--sticker); }
.choice input { flex: none; width: 1.2rem; height: 1.2rem; margin: .1rem 0 0; accent-color: var(--ink); }

.range-row { display: flex; align-items: center; gap: 1rem; }
.range-row input { flex: 1; accent-color: var(--sign); height: 2rem; }
.range-row output {
  display: grid; place-items: center; flex: none;
  width: 3rem; height: 3rem;
  background: var(--sticker); border: 2px solid var(--ink); border-radius: 50%;
  font-family: var(--hand); font-size: 1.3rem;
}
.range-ends { display: flex; justify-content: space-between; font-size: .9rem; margin-top: .2rem; }

.calc select {
  width: 100%; padding: .7rem .8rem;
  font: inherit; color: var(--ink);
  background: var(--paper); border: 2px solid var(--ink); border-radius: 0;
}

.verdict {
  position: sticky; top: 96px;
  overflow: hidden;
  padding: 1.5rem clamp(1.1rem, 3vw, 1.75rem) 1.75rem;
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 10px 10px 0 var(--ink);
}
@media (max-width: 900px) { .verdict { position: relative; top: 0; } }
.verdict-court {
  margin: 0 0 1.2rem; padding-bottom: .9rem;
  border-bottom: 2px solid var(--ink);
  text-align: center; font-weight: 800; font-stretch: 80%; font-size: 1rem; line-height: 1.3;
}
.verdict-label { margin: 0; font-weight: 700; }
.verdict-days {
  margin: .2rem 0 .3rem;
  font-weight: 900; font-stretch: 62%;
  font-size: clamp(4.2rem, 10vw, 7rem); line-height: .85;
}
.verdict-sub { font-size: 1rem; }
.verdict-text { font-size: 1.15rem; font-weight: 600; line-height: 1.4; }
.verdict-list { margin: 0 0 1.2rem; padding-left: 1.2rem; font-size: 1rem; }
.verdict-list li { margin-bottom: .35rem; }
.verdict-final { margin: 0; padding-top: 1rem; border-top: 2px solid var(--ink); font-size: 1rem; }

.stamp {
  position: absolute; right: 1rem; top: 7.2rem;
  padding: .35rem .7rem;
  border: 4px double var(--sign); border-radius: 6px;
  color: var(--sign);
  font-weight: 900; font-stretch: 70%; font-size: 1.35rem; line-height: 1; text-align: center;
  transform: rotate(-13deg);
  opacity: .9;
  pointer-events: none;
}
.stamp.is-new { animation: stamp .35s cubic-bezier(.2, 1.6, .5, 1); }
@keyframes stamp {
  from { transform: rotate(-13deg) scale(1.6); opacity: 0; }
  to { transform: rotate(-13deg) scale(1); opacity: .9; }
}

/* ---------- Mapa ---------- */

:root {
  /* Secuencial naranja: % de viviendas vacías */
  --v1: #ffe7d6; --v2: #ffc199; --v3: #ff8a4c; --v4: #e04e0b; --v5: #8f2e00;
  /* Secuencial azul: alquiler */
  --r1: #dce3fa; --r2: #a9b9f2; --r3: #6f88e6; --r4: #2f50d2; --r5: #172c86;
  --na: #d4d4cf;
}

.map-layout {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 3.5rem); align-items: start;
}
@media (max-width: 900px) { .map-layout { grid-template-columns: 1fr; } }

.map-wrap { position: relative; margin: 0; }
.map-canvas { position: relative; }
.spain { display: block; width: 100%; height: auto; overflow: visible; }
.canarias-frame { fill: none; stroke: var(--ink); stroke-width: 1; stroke-dasharray: 4 4; }

.map-satire { padding: clamp(.75rem, 2vw, 1.5rem); background: var(--copy); border: 3px solid var(--ink); }
.spain-base .prov path { fill: var(--paper); stroke: var(--ink); stroke-width: .6; stroke-linejoin: round; }

.pin {
  position: absolute;
  width: 22px; height: 22px; margin: -11px 0 0 -11px; padding: 0;
  background: var(--sign); border: 3px solid var(--ink); border-radius: 50%;
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
}
.pin::after { content: ""; position: absolute; inset: -9px; border-radius: 50%; }
.pin:hover { background: var(--sticker); }
.pin[aria-pressed="true"] { background: var(--ink); box-shadow: 0 0 0 4px var(--sticker), 0 3px 0 4px var(--ink); }
@media (max-width: 600px) {
  .pin { width: 18px; height: 18px; margin: -9px 0 0 -9px; border-width: 2px; }
}

.map-panel .pin-card { max-width: 440px; }
.map-panel .pin-card + .pin-card { margin-top: 1.75rem; }
.map-hint {
  margin: 0; padding-top: 1rem;
  font-family: var(--hand); color: var(--biro); font-size: 1.5rem; line-height: 1.25;
  transform: rotate(-1.5deg);
}

.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 1.5rem 2.5rem; max-width: 900px; margin-bottom: clamp(2.5rem, 5vw, 3.5rem);
}
.stat { border-top: 6px solid var(--ink); padding-top: .8rem; }
.stat-num { margin: 0; font-weight: 900; font-stretch: 62%; font-size: clamp(3rem, 7vw, 4.6rem); line-height: .9; }
.stat p:last-child { margin: .5rem 0 0; font-size: 1rem; }

.map-lede { max-width: 60ch; margin: 0 0 2rem; font-size: 1.15rem; }
.map-controls { display: inline-flex; flex-wrap: wrap; margin-bottom: 1.5rem; border: 3px solid var(--ink); background: var(--paper); }
.seg { font: inherit; font-size: 1rem; font-weight: 700; padding: .6rem 1.1rem; background: var(--paper); color: var(--ink); border: 0; cursor: pointer; }
.seg + .seg { border-left: 3px solid var(--ink); }
.seg:hover { background: var(--sticker); }
.seg[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* Especificidad baja a propósito: las clases de color de abajo deben ganar. */
.spain-data path { fill: var(--na); stroke: var(--copy); stroke-width: 1.2; stroke-linejoin: round; cursor: crosshair; }
.spain-data path.is-active { stroke: var(--ink); stroke-width: 2.5; }
.spain-data .canarias-frame { fill: none; stroke: var(--ink); cursor: default; }
[data-measure="vacias"] .v1 { fill: var(--v1); }
[data-measure="vacias"] .v2 { fill: var(--v2); }
[data-measure="vacias"] .v3 { fill: var(--v3); }
[data-measure="vacias"] .v4 { fill: var(--v4); }
[data-measure="vacias"] .v5 { fill: var(--v5); }
[data-measure="alquiler"] .r1 { fill: var(--r1); }
[data-measure="alquiler"] .r2 { fill: var(--r2); }
[data-measure="alquiler"] .r3 { fill: var(--r3); }
[data-measure="alquiler"] .r4 { fill: var(--r4); }
[data-measure="alquiler"] .r5 { fill: var(--r5); }
[data-measure="alquiler"] .rna { fill: var(--na); }
[data-measure="vacias"] [data-legend="alquiler"],
[data-measure="alquiler"] [data-legend="vacias"] { display: none; }

.map-tip {
  position: absolute; z-index: 5;
  max-width: 250px; margin: 0; padding: .55rem .75rem;
  background: var(--paper); border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink);
  font-size: .9rem; line-height: 1.35;
  transform: translate(-50%, calc(-100% - 14px));
  pointer-events: none;
}
.map-tip strong { display: block; font-size: 1rem; }

.legend-title { margin: 0 0 .6rem; font-weight: 800; }
.legend-scale { display: grid; gap: .4rem; margin: 0; padding: 0; list-style: none; font-size: .95rem; }
.legend-scale li { display: flex; align-items: center; gap: .65rem; }
.sw { flex: none; width: 30px; height: 16px; border: 1px solid rgba(0, 0, 0, .25); }
.sw.v1 { background: var(--v1); } .sw.v2 { background: var(--v2); } .sw.v3 { background: var(--v3); }
.sw.v4 { background: var(--v4); } .sw.v5 { background: var(--v5); }
.sw.a1 { background: var(--r1); } .sw.a2 { background: var(--r2); } .sw.a3 { background: var(--r3); }
.sw.a4 { background: var(--r4); } .sw.a5 { background: var(--r5); }
.sw.na { background: var(--na); }

.map-readout { margin: 1.5rem 0 0; padding: .9rem 1rem; background: var(--paper); border: 2px solid var(--ink); font-size: 1rem; }
.map-readout strong { display: block; font-size: 1.1rem; }

.data-table { margin-top: clamp(2rem, 4vw, 3rem); border-block: 3px solid var(--ink); }
.data-table summary { padding: 1rem 0; cursor: pointer; font-weight: 800; font-size: 1.15rem; }
.table-scroll { max-height: 540px; overflow: auto; margin-bottom: 1.25rem; background: var(--paper); }
.data-table table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: .95rem; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { padding: .45rem .75rem; text-align: right; border-bottom: 1px solid var(--line); }
.data-table th:first-child { text-align: left; }
.data-table thead th { position: sticky; top: 0; background: var(--paper); border-bottom: 2px solid var(--ink); }

.sources { max-width: 62rem; margin-top: 2rem; font-size: .92rem; }
.sources h3 { font-size: 1.05rem; margin-bottom: .5rem; }
.sources ul { padding-left: 1.2rem; margin: 0 0 1rem; }
.sources li { margin-bottom: .4rem; }

/* ---------- Texto legal ---------- */

.legal h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.legal dl { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.2rem; }
.legal dt { margin: 0; }
.legal dd { margin: 0; }
.fill-me { background: var(--sticker); padding-inline: .2em; font-weight: 700; }

/* ---------- 404 ---------- */

.lost { padding-block: clamp(3rem, 8vw, 6rem); }
.lost .sign { justify-self: start; margin-top: 2.5rem; }

/* ---------- Pie ---------- */

.site-footer { background: var(--ink); color: var(--paper); padding-top: clamp(3rem, 6vw, 4rem); }
.footer-grid {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, .8fr) minmax(0, 1fr);
  gap: 2.5rem;
}
.footer-about p { margin-top: 1rem; max-width: 46ch; font-size: 1rem; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: .55rem; }
.footer-links a { font-weight: 650; }
.footer-help p { font-size: 1rem; padding: 1rem 1.1rem; border: 2px solid var(--sign); }
.footer-help strong { display: block; color: var(--sign); margin-bottom: .2rem; }
.footer-base { margin-top: 2.5rem; padding-block: 1.25rem 1.5rem; border-top: 1px solid #444; font-size: .9rem; }
.footer-base p { margin: 0; }
.site-footer a:hover { text-decoration-color: var(--sign); }

@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Carrito y avisos ---------- */

.cart {
  width: min(560px, calc(100% - 32px));
  padding: 0; border: 3px solid var(--ink); border-radius: 0;
  box-shadow: 12px 12px 0 var(--ink);
  color: var(--ink);
}
.cart::backdrop { background: rgba(0, 0, 0, .55); }
.cart-inner { padding: 1.4rem 1.5rem 1.5rem; }
.cart-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.cart-head h2 { font-size: 2.4rem; }
.cart-close {
  width: 2.5rem; height: 2.5rem;
  font: inherit; font-size: 1.6rem; line-height: 1;
  background: var(--paper); border: 2px solid var(--ink); cursor: pointer;
}
.cart-close:hover { background: var(--sticker); }
.cart-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.cart-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line); font-size: 1rem; }
.cart-total { display: flex; justify-content: space-between; margin: .8rem 0 0; font-weight: 800; font-size: 1.15rem; }
.cart-empty { margin: 0; }
.cart-msg:empty { display: none; }
.cart-msg {
  margin: 1rem 0 0; padding: .8rem 1rem;
  background: var(--sticker); border: 2px solid var(--ink);
  font-weight: 600; font-size: 1rem;
}
.cart-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .6rem; margin-top: 1.3rem; }

.toast {
  position: fixed; left: 50%; bottom: 1.25rem; z-index: 60;
  width: max-content; max-width: calc(100% - 32px);
  margin: 0; padding: .85rem 1.1rem;
  background: var(--ink); color: var(--paper);
  border-left: 10px solid var(--sticker);
  font-size: 1rem; font-weight: 600;
  transform: translate(-50%, calc(100% + 2rem));
  visibility: hidden;
  transition: transform .25s ease, visibility 0s .25s;
}
.toast.is-visible { transform: translate(-50%, 0); visibility: visible; transition: transform .25s ease; }

/* ---------- Movimiento reducido ---------- */

@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
  .ticker-viewport { overflow-x: auto; }
  .toast { transition: none; }
  .stamp.is-new { animation: none; }
}
