:root {
  --paper: #EEF3EE;
  --sheet: #FBFDFB;
  --tint: #DFECE2;
  --tint-deep: #CEE0D3;
  --ink: #0F261C;
  --ink-2: #2B473B;
  --muted: #4A685A;
  --rule: #B7CBBF;
  --rule-soft: #D3E0D7;
  --emerald: #0B7A5C;
  --emerald-strong: #086349;
  --pass-surface: #D9F2E8;
  --red: #C42525;
  --red-surface: #FCE4E4;
  --amber: #8F5205;
  --amber-surface: #FDEFD9;
  --night: #11261D;
  --night-ink: #ECF4EE;
  --night-muted: #A5C2B2;

  --font-display: 'Archivo', system-ui, sans-serif;
  --font-body: 'Public Sans', system-ui, sans-serif;
  --font-mono: 'Azeret Mono', ui-monospace, monospace;

  --r-card: 14px;
  --r-ctl: 10px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
  background: var(--paper);
}

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

h1, h2, h3, h4, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

::selection { background: var(--emerald); color: var(--sheet); }

:focus-visible {
  outline: 2px solid var(--emerald);
  outline-offset: 2px;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  font-size: 0.94em;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--sheet);
  border-radius: var(--r-ctl);
}
.skip-link:focus { top: 0.75rem; }

.wrap {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* ───────── Botones ───────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.7rem 1.25rem;
  border: 1px solid var(--ink);
  border-radius: var(--r-ctl);
  background: var(--ink);
  color: var(--sheet);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  text-decoration: none;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease), transform 0.18s var(--ease);
}
.btn:hover:not(:disabled) { background: var(--emerald-strong); border-color: var(--emerald-strong); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled {
  background: var(--tint);
  border-color: var(--rule);
  color: var(--muted);
  cursor: not-allowed;
}
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover:not(:disabled) { background: var(--ink); border-color: var(--ink); color: var(--sheet); }
.btn-ghost:disabled { background: transparent; }
.btn-small { min-height: 40px; padding: 0.45rem 0.95rem; font-size: 0.9rem; }
.btn-light { background: var(--sheet); color: var(--ink); border-color: var(--sheet); }
.btn-light:hover:not(:disabled) { background: var(--pass-surface); border-color: var(--pass-surface); color: var(--ink); }

.link-btn {
  background: none;
  border: 0;
  padding: 0.5rem 0.25rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.link-btn:hover { color: var(--ink); }

.tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}
.tag-demo { background: var(--amber-surface); color: var(--amber); }

/* ───────── Cabecera ───────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule-soft);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}
.brand-roundel {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--sheet);
}
.brand-roundel svg {
  width: 100%;
  height: 100%;
  display: block;
}
.brand-accent {
  color: var(--emerald);
}
.header-nav {
  display: flex;
  gap: 1.5rem;
  margin-left: auto;
  font-size: 0.92rem;
  font-weight: 600;
}
.header-nav a {
  text-decoration: none;
  color: var(--ink-2);
  padding: 0.5rem 0;
}
.header-nav a:hover { color: var(--emerald); }
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.btn-account {
  gap: 0.45rem;
}
.header-create-btn { gap: 0.45rem; }
.header-create-btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.radar-sweep {
  transform-box: view-box;
  transform-origin: 12px 12px;
  animation: radar-spin 2.8s linear infinite;
}
.radar-blip { animation: radar-blip 2.8s ease-out infinite; }
.brand-sweep {
  transform-box: view-box;
  transform-origin: 20px 20px;
  animation: radar-spin 4s linear infinite;
}
.brand:hover .brand-sweep { animation-duration: 1.6s; }
.header-create-btn:hover .radar-sweep { animation-duration: 1.2s; }
.header-create-btn:hover .radar-blip { animation-duration: 1.2s; }
@keyframes radar-spin { to { transform: rotate(360deg); } }
/* El punto se enciende cuando el borde del barrido pasa por encima (~20 % del giro) */
@keyframes radar-blip {
  0%, 17% { opacity: 0.15; }
  21% { opacity: 1; }
  100% { opacity: 0.15; }
}
@media (prefers-reduced-motion: reduce) {
  .radar-sweep, .radar-blip, .brand-sweep { animation: none; }
  .radar-blip { opacity: 1; }
}
.btn-account svg {
  width: 16px;
  height: 16px;
  flex: none;
}
.account-count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 0.38rem;
  border-radius: 999px;
  background: var(--pass-surface);
  color: var(--emerald-strong);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
}

/* ───────── Hero ───────── */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
  grid-template-areas:
    "copy chat"
    "plan chat";
  column-gap: 3rem;
  row-gap: 2rem;
  align-items: start;
  padding-top: 3rem;
  padding-bottom: 4rem;
}
.hero-copy { grid-area: copy; }
.chat { grid-area: chat; }
.plan { grid-area: plan; }

.hero h1 {
  font-size: clamp(2.1rem, 4.4vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
  max-width: 15ch;
}
.hero-lead {
  margin-top: 1.1rem;
  max-width: 52ch;
  font-size: 1.1rem;
  color: var(--ink-2);
}
.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  margin-top: 1.25rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-2);
}
.hero-facts li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.hero-facts li::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--emerald);
}

/* ───────── Marquesina de portales ───────── */
.portals-marquee {
  padding-block: 1.5rem 2rem;
  border-top: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft);
  background: color-mix(in srgb, var(--tint) 55%, var(--paper));
  overflow: hidden;
}
.portals-marquee-head {
  margin-bottom: 1rem;
  text-align: center;
}
.portals-marquee-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.marquee-viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
}
.marquee-track {
  display: flex;
  align-items: center;
  width: max-content;
  will-change: transform;
  animation: portals-marquee 32s linear infinite;
}
.marquee-viewport:hover .marquee-track {
  animation-play-state: paused;
}
.marquee-group {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  padding-right: 1.15rem;
  flex-shrink: 0;
}
.portal-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 58px;
  min-width: 152px;
  padding: 0.65rem 1.35rem;
  background: #FFFFFF;
  border: 1px solid var(--rule);
  border-radius: var(--r-ctl);
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.portal-badge:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}
.portal-logo {
  display: block;
  width: auto;
  height: 24px;
  max-width: 140px;
  object-fit: contain;
}
.portal-logo-wallapop { height: 27px; }
.portal-logo-milanuncios { height: 24px; }
.portal-logo-cochesnet { height: 20px; }
.portal-logo-autoscout { height: 27px; }
.portal-logo-flexicar { height: 26px; }
.portal-logo-ocasionplus { height: 21px; }
.portal-logo-clicars { height: 19px; }
.portal-logo-autohero {
  height: 24px;
  filter: drop-shadow(0 0 1px rgba(0, 62, 112, 0.32));
}
.portal-logo-modrive { height: 38px; }

@keyframes portals-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ───────── Chat ───────── */
.chat {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  height: min(640px, calc(100vh - 108px));
  min-height: 480px;
  background: var(--sheet);
  border: 1px solid var(--ink);
  border-radius: var(--r-card);
  overflow: hidden;
}
.chat-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
}
.chat-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--sheet);
}
.chat-avatar svg {
  width: 24px;
  height: 24px;
  display: block;
}
.chat-head-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
  margin-right: auto;
}
.chat-head-text strong { font-family: var(--font-display); font-size: 0.98rem; }
.chat-head-text span { font-size: 0.82rem; color: var(--muted); }

.chat-progress {
  height: 3px;
  background: var(--tint);
}
.chat-progress span {
  display: block;
  height: 100%;
  background: var(--emerald);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.35s var(--ease);
}

.chat-stream {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}
.chat-stream:focus-visible { outline-offset: -2px; }

.bubble {
  max-width: 88%;
  padding: 0.65rem 0.9rem;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  animation: bubble-in 0.22s var(--ease);
}
.bubble-bot {
  align-self: flex-start;
  background: var(--tint);
  border-bottom-left-radius: 5px;
}
.bubble-user {
  align-self: flex-end;
  background: var(--ink);
  color: var(--sheet);
  border-bottom-right-radius: 5px;
}
.bubble-error { background: var(--red-surface); color: #7d1616; }
.bubble em { font-style: normal; font-weight: 700; }
.bubble-summary {
  max-width: 100%;
  background: var(--pass-surface);
}
.bubble-summary blockquote {
  margin: 0.5rem 0 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--sheet);
  border-radius: 10px;
  font-size: 0.9rem;
  color: var(--ink-2);
}
.bubble-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.typing {
  align-self: flex-start;
  display: inline-flex;
  gap: 4px;
  padding: 0.8rem 0.9rem;
  background: var(--tint);
  border-radius: 16px;
  border-bottom-left-radius: 5px;
}
.typing i {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: typing 1s infinite ease-in-out;
}
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}
@keyframes bubble-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.chat-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0 1rem 0.75rem;
  max-height: 190px;
  overflow-y: auto;
}
.chat-replies:empty { display: none; }
.chat-replies.chat-replies-portals {
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0.55rem;
  max-height: 260px;
  padding-top: 0.55rem;
  border-top: 1px solid var(--rule-soft);
  overflow: visible;
}

.portal-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  width: 100%;
}
.chat-replies-portals .portal-picker-grid {
  min-height: 0;
  overflow-y: auto;
  padding: 1px;
}
.portal-picker-grid-compact {
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
}
.portal-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0.55rem 1.3rem 0.55rem 0.65rem;
  border-radius: var(--r-ctl);
  border: 1.5px dashed var(--rule);
  background: var(--paper);
  cursor: pointer;
  transition: border-color 0.16s var(--ease), background-color 0.16s var(--ease), transform 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.portal-toggle:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}
.portal-toggle[aria-pressed="true"] {
  border-style: solid;
  border-color: var(--emerald);
  background: #FFFFFF;
  box-shadow: inset 0 0 0 1px rgba(11, 122, 92, 0.12);
}
.portal-toggle[aria-pressed="false"] {
  border-style: dashed;
  border-color: var(--rule);
  background: var(--tint);
}
.portal-toggle .portal-logo {
  max-width: 86%;
  height: auto;
  max-height: 23px;
  transition: opacity 0.16s var(--ease), filter 0.16s var(--ease);
}
.portal-toggle .portal-logo-modrive { max-height: 30px; }
.portal-toggle .portal-logo-wallapop { max-height: 22px; }
.portal-toggle .portal-logo-autoscout { max-height: 21px; }
.portal-toggle .portal-logo-ocasionplus { max-height: 17px; }
.portal-toggle .portal-logo-clicars { max-height: 15px; }
.portal-toggle[aria-pressed="false"] .portal-logo {
  opacity: 0.34;
  filter: grayscale(0.9);
}
.portal-toggle[aria-pressed="false"] .portal-logo-autohero {
  filter: grayscale(0.9) drop-shadow(0 0 1px rgba(0, 62, 112, 0.25));
}
.portal-toggle-mark {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 14px;
  height: 14px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  border: 1.5px solid var(--rule);
  background: var(--sheet);
  color: #FFFFFF;
  transition: background-color 0.16s var(--ease), border-color 0.16s var(--ease);
}
.portal-toggle-mark svg {
  width: 11px;
  height: 11px;
  opacity: 0;
  transition: opacity 0.14s var(--ease);
}
.portal-toggle[aria-pressed="true"] .portal-toggle-mark {
  background: var(--emerald);
  border-color: var(--emerald);
}
.portal-toggle[aria-pressed="true"] .portal-toggle-mark svg {
  opacity: 1;
}
.portal-picker-bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.portal-picker-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}
.portal-mini-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.portal-mini-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  padding: 0.2rem 0.5rem;
  background: #FFFFFF;
  border: 1px solid var(--rule);
  border-radius: 7px;
}
.portal-mini-logo {
  display: block;
  width: auto;
  height: 13px;
  max-width: 68px;
  object-fit: contain;
}
.portal-mini-logo.portal-logo-modrive { height: 19px; }
.portal-mini-logo.portal-logo-wallapop,
.portal-mini-logo.portal-logo-autoscout { height: 14px; }
.portal-mini-logo.portal-logo-clicars,
.portal-mini-logo.portal-logo-ocasionplus { height: 11px; }
.portal-mini-logo.portal-logo-autohero {
  height: 14px;
  filter: drop-shadow(0 0 1px rgba(0, 62, 112, 0.3));
}
.summary-portals {
  margin: 0 0 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.summary-portals-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-2);
}

.chip {
  min-height: 40px;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--sheet);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-2);
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.chip:hover { border-color: var(--ink); color: var(--ink); background: var(--tint); }
.chip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-style: dashed;
  color: var(--muted);
}
.chip-toggle::before {
  content: "";
  flex: none;
  width: 14px; height: 14px;
  border: 1.5px solid currentColor;
  border-radius: 4px;
}
.chip-toggle[aria-pressed="true"] {
  border-style: solid;
  border-color: var(--emerald);
  background: var(--pass-surface);
  color: var(--ink);
}
.chip-toggle[aria-pressed="true"]::before {
  border-color: var(--emerald);
  background: var(--emerald) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 7.5 2.5 2.5L11 4.5'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.chip-go {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--sheet);
}
.chip-go:hover:not(:disabled) { background: var(--emerald-strong); border-color: var(--emerald-strong); color: var(--sheet); }
.chip-go:disabled { opacity: 0.55; cursor: not-allowed; background: var(--muted); border-color: var(--muted); }

.chat-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--rule-soft);
}
.chat-input {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--rule);
  border-radius: var(--r-ctl);
  background: var(--paper);
  font-size: 1rem;
}
.chat-input::placeholder { color: var(--muted); }
.chat-input:focus-visible { background: #fff; border-color: var(--emerald); outline-offset: 0; }
.chat-send {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border: 0;
  border-radius: var(--r-ctl);
  background: var(--emerald);
  color: #fff;
  transition: background-color 0.15s var(--ease);
}
.chat-send:hover { background: var(--emerald-strong); }
.chat-send svg { width: 20px; height: 20px; }

/* ───────── Ficha de la automatización ───────── */
.plan {
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--r-card);
  padding: 1.25rem 1.25rem 1.1rem;
}
.plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.plan-head h2 { font-size: 1.2rem; }
.plan-status {
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--tint);
  color: var(--ink-2);
}
.plan-status[data-state="ready"] { background: var(--amber-surface); color: var(--amber); }
.plan-status[data-state="active"] { background: var(--emerald); color: #fff; }

.stage {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 0.9rem;
  padding-bottom: 1.1rem;
}
.stage:last-child { padding-bottom: 0; }
.stage::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 32px;
  bottom: 2px;
  width: 2px;
  background: var(--rule-soft);
  transition: background-color 0.3s var(--ease);
}
.stage:last-child::before { display: none; }
.stage.is-done::before { background: var(--emerald); }

.stage-mark {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border: 2px solid var(--rule);
  border-radius: 50%;
  background: var(--sheet);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--muted);
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.stage.is-done .stage-mark {
  border-color: var(--emerald);
  background: var(--emerald);
  color: #fff;
}
.stage-body h3 {
  font-size: 1rem;
  line-height: 30px;
}

.plan-row {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-top: 1px solid var(--rule-soft);
  font-size: 0.92rem;
}
.plan-row dt { color: var(--muted); }
.plan-row dd { font-weight: 600; overflow-wrap: anywhere; }
.plan-row dd.is-empty { font-weight: 400; color: var(--muted); }
.plan-row.is-fixed dd { font-weight: 500; color: var(--ink-2); grid-column: 2 / -1; }
.plan-row.is-new dd { animation: row-flash 0.9s var(--ease); }
@keyframes row-flash {
  0% { background: var(--pass-surface); box-shadow: 0 0 0 4px var(--pass-surface); }
  100% { background: transparent; box-shadow: 0 0 0 4px transparent; }
}

.row-edit {
  background: none;
  border: 0;
  padding: 0.3rem 0.1rem;
  margin: -0.3rem 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--emerald-strong);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.row-edit:hover { color: var(--ink); }

.filter-list { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.filter-list span {
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--pass-surface);
  font-size: 0.82rem;
  font-weight: 600;
}

.plan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
}
.plan-note {
  margin-top: 0.6rem;
  font-size: 0.86rem;
  color: var(--muted);
}

.saved {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}
.saved h3 { font-size: 0.95rem; margin-bottom: 0.5rem; }
.saved li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-top: 1px solid var(--rule-soft);
  font-size: 0.88rem;
}
.saved li span { overflow-wrap: anywhere; }

/* ───────── Secciones ───────── */
.section-head { max-width: 62ch; margin-bottom: 2rem; }
.section-head h2 {
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.section-head p { margin-top: 0.7rem; color: var(--ink-2); font-size: 1.02rem; }

.live { padding-block: 0 4rem; }
.live[hidden] { display: none; }
.live-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.live-skeleton {
  height: 150px;
  border-radius: var(--r-card);
  background: var(--tint);
  animation: pulse 1.2s infinite ease-in-out;
}
@keyframes pulse { 50% { opacity: 0.5; } }

.how {
  padding-block: 4.5rem;
  background: var(--sheet);
  border-block: 1px solid var(--rule-soft);
}
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
}
.steps li { max-width: 34ch; }
.step-num {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  margin-bottom: 0.9rem;
  border-radius: 50%;
  background: var(--emerald);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
}
.steps h3 { font-size: 1.15rem; margin-bottom: 0.4rem; }
.steps p { color: var(--ink-2); font-size: 0.97rem; }

.demo { margin-top: 3.5rem; }
.demo-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.demo-head h3 { font-size: 1.25rem; }
.demo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.ad, .msg {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.1rem;
  border-radius: var(--r-card);
  border: 1px solid var(--rule);
  background: var(--paper);
}
.ad-reject { background: #FAF4F3; border-color: #E6C5C5; }
.ad-pass { background: #F1FAF5; border-color: #A9D8C5; }
.ad-top { display: flex; gap: 0.8rem; align-items: flex-start; }
.ad h4 { font-size: 0.98rem; line-height: 1.25; letter-spacing: -0.01em; }
.ad-prices { display: flex; flex-wrap: wrap; gap: 0.2rem 0.7rem; margin-top: 0.3rem; font-size: 0.92rem; }
.ad-prices s { color: var(--red); }
.ad-reject .ad-prices strong { color: var(--red); }
.ad-pass .ad-prices strong { color: var(--emerald-strong); }
.ad-quote { font-size: 0.92rem; color: var(--ink-2); }
.ad-verdict { margin-top: auto; font-size: 0.9rem; font-weight: 700; }
.ad-reject .ad-verdict { color: #9c1c1c; }
.ad-pass .ad-verdict { color: var(--emerald-strong); }
.ad-link { font-size: 0.88rem; font-weight: 700; color: var(--ink); }
.ad-sub { font-size: 0.84rem; color: var(--muted); margin-top: 0.15rem; }

mark { color: inherit; padding: 0.05em 0.15em; border-radius: 3px; }
.mark-trap { background: var(--red-surface); text-decoration: underline wavy var(--red) 1px; text-underline-offset: 0.2em; }
.mark-pass { background: var(--pass-surface); }

.roundel {
  flex: none;
  display: grid;
  place-content: center;
  justify-items: center;
  width: 74px; height: 74px;
  padding: 6px;
  border: 2px solid;
  border-radius: 50%;
  background: var(--sheet);
  line-height: 1.05;
}
.roundel b { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; }
.roundel i { font-style: normal; font-size: 0.7rem; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roundel-pass { border-color: var(--emerald); color: var(--emerald-strong); }
.roundel-reject { border-color: var(--red); color: var(--red); }

.msg { background: var(--night); border-color: var(--night); color: var(--night-ink); }
.msg-top { display: flex; align-items: center; gap: 0.5rem; font-size: 0.84rem; font-weight: 600; color: var(--night-muted); }
.msg-top svg { width: 16px; height: 16px; }
.msg-title { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; line-height: 1.25; }
.msg-line { font-size: 0.9rem; color: var(--night-muted); }
.msg-draft { padding: 0.75rem; border-radius: 10px; background: #183328; font-size: 0.9rem; }
.msg-draft span { display: block; margin-bottom: 0.3rem; font-size: 0.8rem; font-weight: 700; color: #86EFAC; }
.msg .btn { margin-top: auto; align-self: flex-start; border-color: var(--night-muted); color: var(--night-ink); }
.msg .btn:hover:not(:disabled) { background: var(--night-ink); border-color: var(--night-ink); color: var(--night); }

.templates { padding-block: 4.5rem; }
.tpl-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
.tpl {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 1.1rem;
  text-align: left;
  border: 1px solid var(--rule);
  border-radius: var(--r-card);
  background: var(--sheet);
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease), background-color 0.18s var(--ease);
}
.tpl:hover { border-color: var(--ink); transform: translateY(-2px); }
.tpl strong { font-family: var(--font-display); font-size: 1.05rem; line-height: 1.2; letter-spacing: -0.01em; }
.tpl-model { font-size: 0.92rem; color: var(--ink-2); }
.tpl-specs { font-size: 0.84rem; color: var(--muted); }
.tpl-cta {
  margin-top: auto;
  padding-top: 0.6rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--emerald-strong);
}

.faq { padding-block: 0 4.5rem; }
.faq-list { max-width: 760px; border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 56px;
  padding: 0.75rem 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: none;
  width: 10px; height: 10px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 0.2s var(--ease);
}
.faq details[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.faq details p { padding: 0 0 1.1rem; max-width: 65ch; color: var(--ink-2); }

.closing { background: var(--night); color: var(--night-ink); }
.closing-inner { padding-block: 4rem; }
.closing h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.08; letter-spacing: -0.03em; max-width: 22ch; }
.closing p { margin: 0.8rem 0 1.5rem; color: var(--night-muted); font-size: 1.05rem; }

.site-footer { background: var(--night); color: var(--night-muted); border-top: 1px solid #2C5241; font-size: 0.86rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; padding-block: 1.25rem; }

/* ───────── Mi Cuenta (Página Completa) ───────── */
body.account-open #inicio { display: none; }

.account-page {
  padding-block: 2rem 4.5rem;
  min-height: calc(100dvh - 140px);
}
.account-page[hidden] { display: none; }

.account-page-hero {
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--r-card);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.25rem;
}
.account-top-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--rule-soft);
}
.account-back-btn {
  font-size: 0.9rem;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--rule);
  border-radius: var(--r-ctl);
  background: var(--paper);
}
.account-back-btn:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--sheet);
}
.account-bot-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
  font-size: 0.82rem;
  color: var(--ink-2);
}
.account-bot-status a {
  font-weight: 600;
  color: var(--emerald-strong);
  text-decoration: none;
}
.account-bot-status a:hover { text-decoration: underline; }
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  display: inline-block;
  flex: none;
}

.account-hero-main {
  margin: 1rem 0 1.25rem;
}
.account-hero-main h1 {
  font-size: clamp(1.65rem, 2.8vw, 2.3rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.account-page-sub {
  margin-top: 0.5rem;
  max-width: 68ch;
  font-size: 0.98rem;
  color: var(--ink-2);
}

/* KPIs */
.account-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}
.account-kpi-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.15rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--r-card);
}
.account-kpi-card.is-pass {
  background: #F1FAF5;
  border-color: #A9D8C5;
}
.account-kpi-card.is-reject {
  background: #FAF4F3;
  border-color: #E6C5C5;
}
.kpi-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}
.kpi-value {
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
}
.account-kpi-card.is-pass .kpi-value { color: var(--emerald-strong); }
.account-kpi-card.is-reject .kpi-value { color: var(--red); }
.kpi-sub {
  font-size: 0.8rem;
  color: var(--ink-2);
}

/* Pestañas de la página Mi Cuenta */
.account-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.75rem;
}
.account-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 42px;
  padding: 0.45rem 0.95rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--r-ctl);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink-2);
  transition: background-color 0.16s var(--ease), border-color 0.16s var(--ease), color 0.16s var(--ease);
}
.account-tab:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.account-tab.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--sheet);
}
.account-tab-count {
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: var(--tint);
  color: var(--ink);
  font-size: 0.76rem;
}
.account-tab.is-active .account-tab-count {
  background: var(--emerald);
  color: var(--sheet);
}

/* Pestaña fija en el borde derecho */
.account-dock-tab {
  position: fixed;
  right: 0;
  top: 50%;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 0.55rem;
  background: var(--night);
  color: var(--night-ink);
  border: 0;
  border-radius: var(--r-ctl) 0 0 var(--r-ctl);
  box-shadow: -6px 6px 18px rgba(15, 38, 28, 0.18);
  transform: translateY(-50%);
  font-size: 0.82rem;
  font-weight: 600;
}
.account-dock-tab:hover { background: var(--emerald-strong); }
.account-dock-tab svg { width: 16px; height: 16px; }
.account-dock-tab > span:not(.account-count-badge) { writing-mode: vertical-rl; transform: rotate(180deg); }
body.account-open .account-dock-tab { visibility: hidden; }

.account-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}
.account-bar .chat-input {
  flex: 1 1 240px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-ctl);
  padding: 0.55rem 0.85rem;
}
.account-create-card {
  background: var(--sheet);
  border: 1px solid var(--emerald);
  border-radius: var(--r-card);
  padding: 1.35rem;
  margin-bottom: 1.25rem;
}
.account-create-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}
.account-new-filters {
  border: 1px solid var(--rule-soft);
  border-radius: var(--r-ctl);
  padding: 0.75rem 0.95rem 0.9rem;
  margin: 0.85rem 0 1rem;
  background: var(--paper);
}
.account-new-filters legend {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-2);
  padding: 0 0.35rem;
}
.account-layers-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.account-layer-check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--sheet);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
}
.account-layer-check input { accent-color: var(--emerald); }

.account-status { font-size: 0.92rem; color: var(--ink-2); margin-bottom: 1.1rem; }
.account-list { display: grid; gap: 1.35rem; }
.account-card {
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--r-card);
  padding: 1.35rem;
}
.account-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1rem;
}
.account-card-title { font-size: 1.1rem; }
.account-card-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}
.account-badge {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--tint);
  color: var(--ink);
}
.account-badge.is-active { background: var(--pass-surface); color: var(--emerald-strong); font-weight: 700; }
.account-badge.is-expired { background: var(--amber-surface); color: var(--amber); font-weight: 700; }

.account-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
  margin: 0.85rem 0;
}
.account-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.account-field input,
.account-field textarea {
  width: 100%;
  padding: 0.48rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--paper);
  font-size: 0.9rem;
  font-family: inherit;
}
.account-field input:focus-visible,
.account-field textarea:focus-visible {
  background: #fff;
  border-color: var(--emerald);
  outline: none;
}
.account-criterio-wrap {
  margin: 0.75rem 0;
}
.account-criterio-wrap textarea {
  min-height: 68px;
  resize: vertical;
  line-height: 1.45;
}
.account-card-layers {
  margin: 0.75rem 0 0.95rem;
}
.account-card-layers-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.account-layer-chip {
  min-height: 34px;
  padding: 0.28rem 0.72rem;
  font-size: 0.8rem;
}
.account-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}
.btn-danger {
  background: transparent;
  color: var(--red);
  border-color: var(--red);
}
.btn-danger:hover:not(:disabled) {
  background: var(--red);
  border-color: var(--red);
  color: var(--sheet);
}
.account-results {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--rule);
}
.account-results-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}
.account-results h4 { font-size: 0.94rem; margin: 0; color: var(--ink); }
.account-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.account-filter-pill {
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
}
.account-filter-pill.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--sheet);
}
.account-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 0.9rem;
}
.account-seller-draft {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--rule-soft);
  border-radius: 8px;
  background: var(--sheet);
  font-size: 0.84rem;
  color: var(--ink-2);
}
.account-seller-draft-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--emerald-strong);
}
.account-copy-draft {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink);
}
.account-copy-draft:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--sheet);
}
.account-result-footer {
  margin-top: auto;
  padding-top: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.account-result-del {
  background: none;
  border: 0;
  padding: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.account-result-del:hover { color: var(--red); }

/* Galería global de coches */
.account-cars-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 1rem;
  padding: 0.9rem 1.1rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--r-card);
}
.account-cars-search-wrap {
  flex: 1 1 260px;
  max-width: 380px;
}
.account-cars-search-wrap .chat-input {
  width: 100%;
  min-height: 40px;
  padding: 0.45rem 0.8rem;
  background: var(--paper);
  font-size: 0.9rem;
}
.account-all-cars-grid {
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}
.account-radar-origin {
  display: inline-block;
  align-self: flex-start;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  background: var(--tint);
  color: var(--ink-2);
  font-size: 0.75rem;
  font-weight: 600;
}

/* Canales, Login, Verificación SMS y Guía de Telegram */
.account-top-nav-page {
  margin-bottom: 1.1rem;
  padding: 0.75rem 1.15rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--r-card);
}

/* Vista de Login / Registro */
.auth-view {
  display: flex;
  justify-content: center;
  padding-block: 1rem 3rem;
}
.auth-view[hidden] { display: none; }
.auth-card {
  width: 100%;
  max-width: 490px;
  padding: 1.75rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--r-card);
}
.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  padding: 0.3rem;
  background: var(--paper);
  border: 1px solid var(--rule-soft);
  border-radius: var(--r-ctl);
  margin-bottom: 1.25rem;
}
.auth-tab {
  min-height: 40px;
  padding: 0.45rem 0.75rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink-2);
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.auth-tab.is-active {
  background: var(--ink);
  color: var(--sheet);
}
.auth-header h1 {
  font-size: 1.55rem;
  line-height: 1.12;
  letter-spacing: -0.025em;
}
.auth-sub {
  margin-top: 0.45rem;
  font-size: 0.92rem;
  color: var(--ink-2);
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  margin-top: 1.25rem;
}
.auth-pwd-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.auth-pwd-wrap input { padding-right: 4.75rem; }
.auth-pwd-toggle {
  position: absolute;
  right: 0.45rem;
  border: 1px solid var(--rule);
  background: var(--sheet);
  border-radius: 6px;
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-2);
}
.auth-pwd-toggle:hover { border-color: var(--ink); color: var(--ink); }
.auth-phone-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.auth-phone-row input {
  flex: 1 1 190px;
}
.auth-field-help {
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.auth-otp-box {
  padding: 0.95rem 1rem;
  border: 1px solid var(--emerald);
  border-radius: var(--r-ctl);
  background: var(--pass-surface);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.auth-otp-box[hidden] { display: none; }
.auth-otp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--emerald-strong);
}
.auth-use-code-btn {
  border: 1px solid var(--emerald);
  background: var(--sheet);
  color: var(--emerald-strong);
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
}
.auth-use-code-btn:hover { background: var(--emerald); color: var(--sheet); }
.auth-otp-hint {
  font-size: 0.84rem;
  color: var(--ink);
}
.auth-otp-input {
  background: var(--sheet) !important;
  font-size: 1.1rem !important;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-align: center;
}
.auth-remember {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.86rem;
  color: var(--ink-2);
  cursor: pointer;
}
.auth-remember input { accent-color: var(--emerald); }
.auth-feedback {
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 600;
}
.auth-feedback.is-error {
  background: var(--red-surface);
  border: 1px solid #E6C5C5;
  color: var(--red);
}
.auth-feedback.is-ok {
  background: var(--pass-surface);
  border: 1px solid #A9D8C5;
  color: var(--emerald-strong);
}
.auth-submit-btn { width: 100%; }
.auth-footer {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  text-align: center;
}

/* Barra de usuario autenticado */
.account-session-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 1rem;
}
.account-user-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.account-user-pill {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--rule);
  font-size: 0.84rem;
}
.account-verified-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  background: var(--pass-surface);
  border: 1px solid #A9D8C5;
  color: var(--emerald-strong);
  font-size: 0.78rem;
  font-weight: 700;
}
.account-verified-badge.is-unverified {
  background: var(--amber-surface);
  border-color: #E2B874;
  color: var(--amber);
}
.email-verify-banner {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.15rem;
  background: var(--tint);
  border: 1px solid var(--emerald);
  border-radius: var(--r-card);
}
.email-verify-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
}
.email-verify-main p {
  margin-top: 0.2rem;
  font-size: 0.88rem;
  color: var(--ink-2);
}
.email-verify-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.email-verify-otp-row {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--rule);
}
.email-verify-otp-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.email-verify-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}
.email-verify-controls .auth-otp-input {
  width: 165px;
  padding: 0.52rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: var(--r-ctl);
  background: var(--sheet);
  color: var(--ink);
}
.account-tg-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  background: var(--tint);
  border: 1px solid var(--rule);
  color: var(--ink-2);
  font-size: 0.78rem;
  font-weight: 600;
}
.account-tg-badge.is-linked {
  background: var(--pass-surface);
  border-color: #A9D8C5;
  color: var(--emerald-strong);
}
.account-tg-badge.is-unlinked {
  background: var(--amber-surface);
  border-color: #E7C998;
  color: var(--amber);
}
.account-session-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Banner y guía paso a paso de Telegram */
.tg-setup-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 1.25rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  background: var(--amber-surface);
  border: 1px solid #E2B874;
  border-radius: var(--r-card);
}
.tg-setup-banner[hidden] { display: none; }
.tg-setup-banner p {
  margin-top: 0.2rem;
  font-size: 0.88rem;
  color: var(--ink-2);
}
.tg-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.tg-radar-alert {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.85rem;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.75rem;
  border-radius: 8px;
  background: var(--amber-surface);
  border: 1px solid #E2B874;
  font-size: 0.84rem;
  color: var(--ink);
}
.tg-radar-alert-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tg-guide-head {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
}
.tg-steps-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 0.35rem 0;
}
.tg-step-card {
  padding: 1rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-ctl);
}
.tg-step-card .step-num { margin-bottom: 0.6rem; }
.tg-step-card h4 { font-size: 0.98rem; margin-bottom: 0.35rem; }
.tg-step-card p { font-size: 0.86rem; color: var(--ink-2); }
.tg-verifier-bar {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.6rem;
  padding-top: 0.5rem;
}
.tg-verifier-input { flex: 1 1 230px; max-width: 340px; }
.tg-status-box {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
}
.tg-status-box[hidden] { display: none; }
.tg-status-box.is-linked {
  background: var(--pass-surface);
  border: 1px solid #A9D8C5;
  color: var(--emerald-strong);
}
.tg-status-box.is-unlinked {
  background: var(--amber-surface);
  border: 1px solid #E2B874;
  color: var(--amber);
}
.passes-grid-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.account-channels-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.account-channel-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1.35rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--r-card);
}
.account-channel-wide { grid-column: 1 / -1; }
.account-channel-card h3 { font-size: 1.1rem; }
.account-channel-card p { font-size: 0.94rem; color: var(--ink-2); max-width: 65ch; }
.channel-meta-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--paper);
  border: 1px solid var(--rule-soft);
  border-radius: 8px;
  font-size: 0.88rem;
}
.channel-note { font-size: 0.86rem; color: var(--muted); }
.passes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  width: 100%;
}
.pass-tier {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-ctl);
}
.pass-tier.is-featured {
  background: #F1FAF5;
  border-color: var(--emerald);
}
.pass-price { font-size: 1.2rem; font-weight: 700; color: var(--emerald-strong); }
.pass-tier p { font-size: 0.86rem; }
.channel-radars-summary {
  width: 100%;
  display: grid;
  gap: 0.5rem;
  margin-top: 0.35rem;
}
.channel-summary-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--rule-soft);
  border-radius: 8px;
  background: var(--paper);
  font-size: 0.88rem;
}

/* ───────── Responsive ───────── */
@media (max-width: 980px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "copy" "chat" "plan";
    padding-top: 2rem;
    padding-bottom: 3rem;
    row-gap: 1.5rem;
  }
  .chat { position: static; height: min(600px, 78svh); min-height: 440px; }
  .hero h1 { max-width: 18ch; }
  .steps, .demo-grid { grid-template-columns: minmax(0, 1fr); }
  .steps li { max-width: 60ch; }
  .tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-channels-grid, .passes-grid, .passes-grid-compact, .tg-steps-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  html, body { overflow-x: hidden; }
  .wrap { padding-inline: 0.85rem; }
  .site-header .wrap { padding-inline: 0.65rem; }
  .header-nav { display: none; }
  .header-inner { justify-content: space-between; gap: 0.35rem; min-height: 54px; }
  .brand { gap: 0.35rem; font-size: 0.92rem; }
  .brand-roundel { width: 28px; height: 28px; }
  .header-actions { gap: 0.3rem; flex-shrink: 0; }
  .header-actions .btn-small { min-height: 34px; padding: 0.3rem 0.52rem; font-size: 0.76rem; gap: 0.25rem; white-space: nowrap; }
  .header-create-btn svg, .btn-account svg { display: none; }
  .header-actions .account-count-badge { min-width: 18px; height: 18px; padding: 0 0.3rem; font-size: 0.68rem; }

  .hero { padding-top: 1.35rem; padding-bottom: 2.25rem; row-gap: 1.2rem; }
  .portals-marquee { padding-block: 1.15rem 1.4rem; }
  .portals-marquee-head { margin-bottom: 0.75rem; }
  .portals-marquee-title { font-size: 0.82rem; }
  .marquee-group { gap: 0.75rem; padding-right: 0.75rem; }
  .portal-badge { height: 50px; min-width: 132px; padding: 0.5rem 1rem; }
  .portal-logo { height: 20px; max-width: 118px; }
  .portal-logo-wallapop { height: 23px; }
  .portal-logo-autoscout, .portal-logo-flexicar { height: 23px; }
  .portal-logo-cochesnet { height: 18px; }
  .portal-logo-ocasionplus { height: 18px; }
  .portal-logo-clicars { height: 17px; }
  .portal-logo-modrive { height: 32px; }
  .hero h1 { font-size: clamp(1.7rem, 7vw, 2.15rem); max-width: 100%; }
  .hero-lead { font-size: 0.96rem; margin-top: 0.75rem; }
  .hero-facts { gap: 0.35rem 0.85rem; font-size: 0.84rem; margin-top: 0.9rem; }
  .chat { height: min(510px, 74svh); min-height: 390px; }
  .chat-head { padding: 0.65rem 0.85rem; gap: 0.55rem; }
  .chat-stream { padding: 0.75rem; }
  .chat-replies { padding: 0 0.75rem 0.6rem; max-height: 150px; }
  .chat-replies.chat-replies-portals { max-height: 255px; padding-top: 0.45rem; gap: 0.45rem; }
  .chat-replies-portals .portal-picker-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.35rem; }
  .portal-toggle { min-height: 40px; padding: 0.38rem 1.2rem 0.38rem 0.5rem; }
  .portal-toggle .portal-logo { max-height: 18px; }
  .portal-toggle .portal-logo-modrive { max-height: 24px; }
  .chip { min-height: 36px; padding: 0.35rem 0.7rem; font-size: 0.82rem; }
  .chat-form { padding: 0.6rem 0.75rem 0.75rem; }

  .plan { padding: 1rem; }
  .plan-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 0.1rem; }
  .plan-row dt { grid-column: 1; grid-row: 1; font-size: 0.82rem; }
  .plan-row dd { grid-column: 1; grid-row: 2; }
  .plan-row .row-edit { grid-column: 2; grid-row: 1 / span 2; align-self: center; padding: 0.6rem 0.25rem; margin: 0; }
  .plan-row.is-fixed dd { grid-column: 1 / -1; }
  .plan-actions .btn { flex: 1 1 100%; }

  .ad, .msg { padding: 0.9rem; }
  .ad-top { gap: 0.6rem; }
  .roundel { width: 60px; height: 60px; }
  .roundel b { font-size: 0.92rem; }
  .roundel i { font-size: 0.62rem; }

  .tpl-grid { grid-template-columns: minmax(0, 1fr); }
  .how, .templates { padding-block: 3rem; }
  .live-list { grid-template-columns: minmax(0, 1fr); }

  .account-dock-tab { display: none; }
  .account-page { padding-block: 1rem 2.5rem; }
  .account-page-hero, .auth-card, .account-card, .account-create-card, .account-channel-card { padding: 1rem; }
  .auth-view { padding-block: 0.25rem 2rem; }
  .auth-header h1 { font-size: 1.32rem; }
  .auth-tab { font-size: 0.85rem; padding: 0.4rem 0.5rem; }
  .account-field input, .account-field textarea { font-size: 1rem; }
  .account-session-bar { flex-direction: column; align-items: stretch; gap: 0.65rem; }
  .account-user-pill { width: 100%; justify-content: space-between; overflow-wrap: anywhere; }
  .account-session-actions { width: 100%; }
  .account-session-actions .btn { flex: 1 1 auto; text-align: center; }
  .account-hero-main { margin: 0.85rem 0 0.5rem; }
  .account-hero-main h1 { font-size: 1.38rem; }
  .account-page-sub { font-size: 0.9rem; }
  .account-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
  .account-kpi-card { padding: 0.75rem 0.85rem; }
  .kpi-value { font-size: 1.35rem; }
  .account-tabs { gap: 0.4rem; }
  .account-tab { flex: 1 1 auto; justify-content: center; min-height: 38px; padding: 0.4rem 0.65rem; font-size: 0.82rem; }
  .email-verify-banner, .tg-setup-banner { padding: 0.9rem 1rem; }
  .email-verify-actions, .email-verify-controls, .tg-banner-actions { width: 100%; }
  .email-verify-actions .btn, .email-verify-controls .btn, .tg-banner-actions .btn { flex: 1 1 auto; }
  .email-verify-controls .auth-otp-input { flex: 1 1 130px; width: auto; }
  .account-edit-grid { grid-template-columns: minmax(0, 1fr); gap: 0.6rem; }
  .account-card-actions .btn { flex: 1 1 calc(50% - 0.3rem); font-size: 0.82rem; padding: 0.45rem 0.6rem; }
  .account-results-grid, .account-all-cars-grid { grid-template-columns: minmax(0, 1fr); }
  .account-cars-toolbar { padding: 0.8rem; }
  .account-cars-search-wrap { max-width: 100%; width: 100%; }
  .tg-verifier-bar { flex-direction: column; align-items: stretch; }
  .tg-verifier-input { flex: 1 1 auto; max-width: 100%; width: 100%; }
  .tg-verifier-bar .btn { width: 100%; }
  .channel-summary-row { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee-viewport { -webkit-mask-image: none; mask-image: none; }
  .marquee-track { width: 100%; animation: none !important; justify-content: center; }
  .marquee-group { flex-wrap: wrap; justify-content: center; padding-right: 0; }
  .marquee-group-dup { display: none; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
