:root {
  --bg0: #071018;
  --bg1: #0c1a24;
  --bg2: #122636;
  --ink: #f2f7fb;
  --ink-dim: #c5d4e0;
  --muted: #8aa0b2;
  --line: rgba(120, 190, 220, 0.16);
  --signal: #39e6a8;
  --signal-ink: #042018;
  --amber: #ffb020;
  --amber-ink: #2a1800;
  --cyan: #3ec8ff;
  --cyan-ink: #041820;
  --rose: #ff6b7a;
  --violet-soft: #7aa2ff;
  --surface: rgba(12, 28, 40, 0.78);
  --surface-2: rgba(18, 40, 56, 0.9);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Manrope", system-ui, sans-serif;
  --display: "Syne", "Arial Black", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1000px 520px at 8% -8%, rgba(62, 200, 255, 0.22), transparent 55%),
    radial-gradient(800px 420px at 92% 0%, rgba(57, 230, 168, 0.16), transparent 50%),
    radial-gradient(600px 380px at 70% 100%, rgba(255, 176, 32, 0.1), transparent 45%),
    linear-gradient(165deg, var(--bg0), var(--bg1) 45%, var(--bg2));
  letter-spacing: 0.01em;
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.11;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 75%);
}

.bg-glow {
  position: fixed;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(57, 230, 168, 0.18), transparent 70%);
  top: 18%;
  right: 8%;
  pointer-events: none;
  filter: blur(8px);
  animation: pulseGlow 5s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.08); }
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 2rem;
  position: relative;
  z-index: 2;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.brand-mark {
  font-family: var(--display);
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  background: linear-gradient(105deg, var(--ink) 20%, var(--signal) 55%, var(--cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-sub {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 0 rgba(57, 230, 168, 0.6);
  animation: livePulse 1.6s ease-out infinite;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.live-dot.live-dot-tick {
  animation: livePulse 1.6s ease-out infinite, liveTick 0.9s ease-out 1;
}

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(57, 230, 168, 0.55); }
  70% { box-shadow: 0 0 0 10px rgba(57, 230, 168, 0); }
  100% { box-shadow: 0 0 0 0 rgba(57, 230, 168, 0); }
}

@keyframes liveTick {
  0% { transform: scale(1); background: var(--signal); }
  40% { transform: scale(1.45); background: #7dffc4; }
  100% { transform: scale(1); background: var(--signal); }
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.user-badge {
  color: var(--cyan);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(62, 200, 255, 0.12);
  border: 1px solid rgba(62, 200, 255, 0.28);
}

main {
  position: relative;
  z-index: 1;
  padding: 0 2rem 3rem;
  max-width: 1180px;
  margin: 0 auto;
}

h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.1rem, 4.2vw, 3.4rem);
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin: 0 0 0.65rem;
}

.lede {
  color: var(--ink-dim);
  max-width: 40rem;
  line-height: 1.55;
  font-size: 1.02rem;
}

.hidden { display: none !important; }

/* ——— Forms / surfaces ——— */
.auth-panel { animation: fadeUp 0.45s ease both; }

.auth-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1.6rem;
}

.card-form,
.block,
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.card-form {
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.card-form:focus-within {
  border-color: rgba(57, 230, 168, 0.45);
  transform: translateY(-1px);
}

.card-form h2,
.block h3 {
  margin: 0 0 0.85rem;
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.block-head h3 { margin: 0; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.chip.ok {
  color: var(--signal-ink);
  background: var(--signal);
}

.chip.warn {
  color: var(--amber-ink);
  background: var(--amber);
}

.chip.off {
  color: var(--ink);
  background: rgba(138, 160, 178, 0.25);
  border-color: var(--line);
}

.card-form input,
.stack input,
.stack select,
.filters select,
.filters input {
  width: 100%;
  margin: 0 0 0.6rem;
  padding: 0.78rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(4, 12, 18, 0.55);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.card-form input:focus,
.stack input:focus,
.stack select:focus,
.filters select:focus,
.filters input:focus {
  outline: none;
  border-color: rgba(62, 200, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(62, 200, 255, 0.15);
}

.field-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #d7e6f0;
  margin: 0.15rem 0 0.35rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.field-row select {
  margin-bottom: 0.6rem;
}

.stack select option:disabled {
  color: #6a7a88;
}

.search-hint {
  margin: 0 0 0.85rem;
  font-size: 0.86rem;
  line-height: 1.45;
}

.type-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.type-chip {
  appearance: none;
  border: 1px solid rgba(125, 160, 180, 0.35);
  background: rgba(10, 24, 34, 0.55);
  color: #d7e6f0;
  border-radius: 12px;
  padding: 0.7rem 0.55rem;
  font: inherit;
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.type-chip:hover:not(:disabled) {
  border-color: rgba(62, 200, 255, 0.55);
}

.type-chip.active {
  border-color: rgba(62, 200, 255, 0.75);
  background: rgba(62, 200, 255, 0.14);
  color: #effbff;
}

.type-chip:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.type-chip .soon {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9bb0bf;
}

.portal-filter {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.portal-check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  border: 1px solid rgba(125, 160, 180, 0.28);
  background: rgba(10, 24, 34, 0.45);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.portal-check input {
  width: auto;
  margin: 0;
  accent-color: #39e6a8;
}

.portal-check:has(input:checked) {
  border-color: rgba(57, 230, 168, 0.5);
  background: rgba(57, 230, 168, 0.1);
}

.portal-check:has(input:disabled) {
  opacity: 0.5;
  cursor: not-allowed;
}

.live-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.live-bar strong {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 1.15rem;
  color: #7fe7ff;
}

.live-summary {
  font-size: 0.85rem;
  text-align: right;
}

.results-head {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(126, 231, 255, 0.16);
  background:
    linear-gradient(135deg, rgba(20, 36, 48, 0.92), rgba(12, 22, 30, 0.88));
  backdrop-filter: blur(8px);
}

.results-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.65rem 0.75rem;
  align-items: end;
}

.rt-field {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
}

.rt-field > span {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8aa3b5;
}

.rt-field select,
.rt-field input {
  width: 100%;
  min-height: 2.35rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid rgba(126, 231, 255, 0.22);
  background: rgba(6, 14, 20, 0.85);
  color: #e8f4fb;
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 0.88rem;
}

.rt-field select:focus,
.rt-field input:focus {
  outline: 1px solid rgba(126, 231, 255, 0.55);
  border-color: rgba(126, 231, 255, 0.45);
}

.rt-grow {
  grid-column: span 2;
}

.rt-portals {
  grid-column: 1 / -1;
}

.portal-filter-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

@media (max-width: 720px) {
  .rt-grow {
    grid-column: span 1;
  }
}

.listing-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.tag-hot {
  color: #1a0d08;
  background: #ff7a45;
  border-color: #ff9a70;
}

.tag-new {
  color: #062018;
  background: #3dffb5;
  border-color: #7affcf;
}

.tag-drop,
.tag-sale {
  color: #1a1400;
  background: #ffd24a;
  border-color: #ffe08a;
}

.tag-time {
  text-transform: none;
  letter-spacing: 0.01em;
  font-weight: 600;
  color: #c9dbe8;
  background: rgba(62, 200, 255, 0.12);
  border-color: rgba(62, 200, 255, 0.28);
}

.tag-time.tag-new {
  color: #0f1a12;
  background: #9ef0b8;
  border-color: #b8f5cc;
}

.tag-time.tag-seen {
  color: #c9dbe8;
  background: rgba(62, 200, 255, 0.12);
  border-color: rgba(62, 200, 255, 0.28);
}

.tag-time.tag-published {
  color: #e8dcc8;
  background: rgba(255, 200, 120, 0.14);
  border-color: rgba(255, 200, 120, 0.32);
}

.tag-multi {
  color: #1a1020;
  background: #e8b4ff;
  border-color: #f0d0ff;
}

.tag-quality {
  color: #0f1a12;
  background: #9ef0b8;
  border-color: #b8f5cc;
  font-variant-numeric: tabular-nums;
}

.field-hint {
  margin: -0.25rem 0 0.35rem;
  font-size: 0.78rem;
  line-height: 1.35;
}

.old-price {
  margin-left: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #9bb0bf;
  text-decoration: line-through;
}

/* ——— Buttons ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0.78rem 1.1rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
  transition: transform 0.12s ease, filter 0.12s ease, background 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
}

.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn.primary {
  background: linear-gradient(135deg, var(--signal) 0%, #2fd49a 100%);
  color: var(--signal-ink);
  box-shadow: 0 6px 20px rgba(57, 230, 168, 0.28);
}

.btn.primary:hover { filter: brightness(1.06); }

.btn.accent {
  background: linear-gradient(135deg, var(--cyan) 0%, #2aa8e0 100%);
  color: var(--cyan-ink);
  box-shadow: 0 6px 20px rgba(62, 200, 255, 0.25);
}

.btn.accent:hover { filter: brightness(1.06); }

.btn.warn {
  background: linear-gradient(135deg, var(--amber) 0%, #f09a10 100%);
  color: var(--amber-ink);
}

.btn.ghost {
  width: auto;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  border-color: var(--line);
}

.btn.ghost:hover {
  background: rgba(62, 200, 255, 0.12);
  border-color: rgba(62, 200, 255, 0.35);
}

.btn.danger-ghost {
  width: auto;
  background: transparent;
  color: var(--rose);
  border: 1px solid rgba(255, 107, 122, 0.35);
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
}

.btn.danger-ghost:hover {
  background: rgba(255, 107, 122, 0.12);
}

.btn.compact {
  width: auto;
  padding: 0.55rem 0.9rem;
  font-size: 0.88rem;
}

.error {
  color: var(--rose);
  font-weight: 600;
  margin-top: 0.75rem;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

/* ——— KPIs ——— */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin: 0.4rem 0 1.25rem;
}

.kpi {
  position: relative;
  overflow: hidden;
  animation: fadeUp 0.4s ease both;
  background: rgba(6, 16, 24, 0.92);
  border: 1px solid rgba(180, 220, 240, 0.28);
  padding: 1rem 1.1rem 1rem 1.2rem;
}

.kpi:nth-child(1) { animation-delay: 0.02s; --kpi: var(--signal); }
.kpi:nth-child(2) { animation-delay: 0.06s; --kpi: var(--cyan); }
.kpi:nth-child(3) { animation-delay: 0.1s; --kpi: var(--amber); }
.kpi:nth-child(4) { animation-delay: 0.14s; --kpi: #b8c8ff; }

.kpi::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--kpi, var(--signal));
}

.kpi span {
  color: #d7e6f0;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 0.4rem;
  opacity: 0.92;
}

.kpi strong {
  font-family: var(--mono);
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #ffffff;
  line-height: 1.15;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

/* ——— Layout ——— */
.layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1rem;
}

.side {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.row-btns {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.55rem;
  flex-wrap: wrap;
}

.row-btns .btn { flex: 1; min-width: 0; }

.code-box {
  margin-top: 0.65rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 8, 14, 0.55);
  border: 1px dashed rgba(57, 230, 168, 0.3);
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--signal);
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 2.5rem;
}

.code-box.small {
  max-height: 150px;
  overflow: auto;
  font-size: 0.72rem;
  color: var(--ink-dim);
  border-style: solid;
  border-color: var(--line);
}

.alert-list {
  list-style: none;
  padding: 0;
  margin: 0.85rem 0 0;
}

.alert-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  font-weight: 500;
}

.alert-list li span {
  color: var(--ink-dim);
}

.filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
  align-items: center;
}

.filters select,
.filters input {
  margin: 0;
  max-width: 170px;
  width: auto;
  flex: 1;
}

.listings-wrap {
  animation: fadeUp 0.4s ease 0.08s both;
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.85rem;
}

.listing-grid.is-loading {
  opacity: 0.55;
  pointer-events: none;
}

.listing {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
  background:
    linear-gradient(165deg, rgba(62, 200, 255, 0.06), transparent 42%),
    var(--surface-2);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 0;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.listing.listing-enter {
  animation: rise 0.35s ease both;
}

.listing.listing-static {
  animation: none;
}

.listing.listing-just-in {
  border-color: rgba(57, 230, 168, 0.55);
  box-shadow: 0 0 0 1px rgba(57, 230, 168, 0.25), var(--shadow);
}

.listing.listing-blink {
  animation: newBlink 1.1s ease-out 2;
}

@keyframes newBlink {
  0% { box-shadow: 0 0 0 0 rgba(57, 230, 168, 0.55), var(--shadow); }
  45% { box-shadow: 0 0 0 6px rgba(57, 230, 168, 0.18), var(--shadow); border-color: rgba(57, 230, 168, 0.85); }
  100% { box-shadow: 0 0 0 1px rgba(57, 230, 168, 0.25), var(--shadow); }
}

.listing:hover {
  border-color: rgba(57, 230, 168, 0.4);
  transform: translateY(-2px);
}

.listing-media {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.45rem 0.28rem;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.14), transparent 55%),
    linear-gradient(160deg, #163246, #0a1822 70%);
  border-right: 1px solid var(--line);
}

.listing-media[data-portal="fotocasa"] {
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 140, 100, 0.28), transparent 55%),
    linear-gradient(160deg, #3a221c, #1a100e 70%);
}
.listing-media[data-portal="pisos"] {
  background:
    radial-gradient(circle at 30% 20%, rgba(100, 200, 255, 0.28), transparent 55%),
    linear-gradient(160deg, #163246, #0a1822 70%);
}
.listing-media[data-portal="idealista"] {
  background:
    radial-gradient(circle at 30% 20%, rgba(140, 220, 100, 0.28), transparent 55%),
    linear-gradient(160deg, #1c2e18, #0e160c 70%);
}
.listing-media[data-portal="habitaclia"] {
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 210, 80, 0.28), transparent 55%),
    linear-gradient(160deg, #2e2614, #161208 70%);
}

.listing-media-mark {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 800;
  color: #041018;
  background: linear-gradient(135deg, #7fe7ff, #39e6a8);
}

.listing-media-city {
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(242, 247, 251, 0.72);
  text-align: center;
  line-height: 1.15;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 0.1rem;
}

.listing-body {
  padding: 0.9rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

@media (max-width: 560px) {
  .listing {
    grid-template-columns: 1fr;
  }
  .listing-media {
    min-height: 44px;
    flex-direction: row;
    gap: 0.45rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0.35rem 0.65rem;
    justify-content: flex-start;
  }
}

/* License gate (nuevo dispositivo) */
.license-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(4, 12, 18, 0.72);
  backdrop-filter: blur(6px);
}
.license-overlay.hidden { display: none; }
.license-card {
  width: min(420px, 100%);
  padding: 1.35rem 1.4rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-2);
  box-shadow: var(--shadow);
}
.license-card h2 {
  margin: 0 0 0.4rem;
  font-family: var(--display);
  font-size: 1.35rem;
}
.license-card .lede-sm {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}
.license-card input {
  width: 100%;
  margin-bottom: 0.75rem;
  font-family: var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.license-card .error { min-height: 1.2em; }

.listing-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.listing .price {
  color: #04150f;
  background: linear-gradient(135deg, #5dffc0 0%, #39e6a8 100%);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.22rem;
  letter-spacing: -0.01em;
  line-height: 1.2;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  display: inline-block;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

.listing .price-unit {
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.8;
  margin-left: 0.1rem;
}

.source-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  justify-content: flex-end;
  max-width: 55%;
}

.source-badge {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.28rem 0.5rem;
  border-radius: 6px;
  white-space: nowrap;
  border: 1px solid transparent;
  text-decoration: none;
}

a.source-badge:hover,
a.portal-pill:hover {
  filter: brightness(1.12);
}

.portal-fotocasa {
  background: rgba(255, 90, 50, 0.16);
  color: #ffb29a;
  border-color: rgba(255, 120, 80, 0.35);
}

.portal-pisos {
  background: rgba(62, 200, 255, 0.16);
  color: #9de7ff;
  border-color: rgba(62, 200, 255, 0.35);
}

.portal-idealista {
  background: rgba(120, 220, 90, 0.14);
  color: #b7f08a;
  border-color: rgba(120, 220, 90, 0.35);
}

.portal-habitaclia {
  background: rgba(255, 210, 74, 0.14);
  color: #ffe08a;
  border-color: rgba(255, 210, 74, 0.35);
}

.portal-other {
  background: rgba(62, 200, 255, 0.15);
  color: var(--cyan);
  border-color: rgba(62, 200, 255, 0.3);
}

.listing h4 {
  margin: 0.1rem 0 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.listing-place {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.listing-place span {
  color: #d7e6f0;
  font-weight: 650;
}

.listing-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  margin: 0.35rem 0 0.15rem;
}

.listing-stats > div {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(125, 160, 180, 0.18);
  border-radius: 10px;
  padding: 0.4rem 0.45rem;
}

.listing-stats dt {
  margin: 0;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8fa6b6;
}

.listing-stats dd {
  margin: 0.15rem 0 0;
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 600;
  color: #eef6fb;
}

.listing-portal-row {
  margin-top: 0.15rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.portal-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.listing .meta {
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 0.35rem;
  line-height: 1.4;
}

.listing a.btn-link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  background: rgba(57, 230, 168, 0.12);
  border: 1px solid rgba(57, 230, 168, 0.35);
  color: var(--signal);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  transition: background 0.15s ease;
}

.listing a.btn-link:hover {
  background: rgba(57, 230, 168, 0.22);
}

.empty-state {
  padding: 1.5rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.15);
}

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

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.tag-particular {
  background: rgba(46, 160, 110, 0.18);
  color: #9be7c4;
}
.tag-profesional {
  background: rgba(80, 140, 220, 0.2);
  color: #a8c7f0;
}
.tag-agency {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.listing-contact {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.92rem;
  color: var(--muted);
}
.listing-phone {
  color: var(--accent, #6ee7b7);
  font-weight: 600;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: 0.02em;
  text-decoration: none;
}
.listing-phone:hover { text-decoration: underline; }
.listing-agency { color: var(--text); font-weight: 600; }
.listing-adv { color: var(--muted); }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: 1fr 1fr; }
  main { padding: 0 1rem 2rem; }
  .top { padding: 1rem; }
  .btn.ghost.compact { width: auto; }
}

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