/* VDC: hoja base. Los colores vienen de variables que redefine cada plantilla (css/themes/*.css). */
:root {
  --bg: #f3f7fc; --surface: #fff; --soft: #eaf2fb;
  --text: #14233a; --muted: #5a6b82;
  --brand: #1565c0; --brand-dark: #0d47a1; --on-brand: #fff;
  --border: #d6e2f0;
  --danger: #b3261e; --danger-bg: #fdecea;
  --ok: #146c43; --ok-bg: #e6f4ec;
  --info: #0d47a1; --info-bg: #e3f0fd;
  --hero-from: #0d47a1; --hero-to: #1e88e5; --on-hero: #fff;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16,40,80,.06), 0 4px 14px rgba(16,40,80,.07);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
main { flex: 1; }
img { max-width: 100%; height: auto; }
a { color: var(--brand); } a:hover { color: var(--brand-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); } h2 { font-size: 1.25rem; } h3 { font-size: 1rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.section { padding-top: 28px; padding-bottom: 40px; }
.section-tight { padding-top: 12px; padding-bottom: 20px; }
.narrow { max-width: 460px; } .narrow-wide { max-width: 760px; }
.center { text-align: center; } .muted { color: var(--muted); } .lead { color: var(--muted); font-size: 1.05rem; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--brand); color: var(--on-brand); padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
.inline { display: inline; margin: 0; } .plain { list-style: none; margin: 0; padding: 0; }
.hint { color: var(--muted); font-size: .9rem; margin: .3em 0 0; }
mark.todo { background: #fff3b0; color: #4a3b00; padding: 0 .3em; border-radius: 4px; }
.title-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.gap { gap: 12px; }

/* Cabecera y pie */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.brand { font-weight: 800; font-size: 1.4rem; letter-spacing: -.02em; text-decoration: none; color: #1b7a34; }
.nav { display: flex; align-items: center; gap: 6px 16px; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--text); } .nav a:hover { color: var(--brand); }
.nav a.btn-primary { color: var(--on-brand); }
.langs { display: inline-flex; gap: 4px; }
.lang { padding: 2px 8px; border-radius: 6px; font-size: .8rem; font-weight: 600; border: 1px solid var(--border); }
.lang.is-current { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.badge-count { display: inline-block; min-width: 1.4em; padding: 0 .4em; border-radius: 999px; background: var(--danger); color: #fff; font-size: .75rem; text-align: center; }
.site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 24px; font-size: .9rem; }
.foot { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; padding-top: 18px; padding-bottom: 18px; }
.foot-links { display: flex; gap: 16px; flex-wrap: wrap; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--text); cursor: pointer; }
.linkbtn:hover { color: var(--brand); }

/* Botones */
.btn { display: inline-block; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.3; text-align: center; }
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: var(--on-brand); }
.btn-light { background: var(--on-hero); border-color: var(--on-hero); color: var(--brand-dark); }
.btn-ghost { background: transparent; border-color: currentColor; }
.btn-danger { color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-small { padding: 5px 12px; font-size: .88rem; } .btn-block { display: block; width: 100%; }
.btn[disabled], button[disabled] { opacity: .5; cursor: not-allowed; }

/* Avisos */
.flashes { padding-top: 16px; }
.alert { padding: 12px 16px; border-radius: 10px; margin: 0 0 16px; border: 1px solid transparent; }
.alert-error { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.alert-success { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.alert-info { background: var(--info-bg); color: var(--info); border-color: var(--info); }

/* Tarjetas y formularios */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow); }
.form { display: grid; gap: 16px; }
.form label { display: block; font-weight: 600; margin-bottom: 4px; }
.form label.check { font-weight: 400; display: flex; gap: 8px; align-items: flex-start; }
.form-wide { max-width: 760px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=search], input[type=url], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; }
input[type=file] { max-width: 100%; }
textarea { min-height: 140px; resize: vertical; }
fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; margin: 0; }
legend { font-weight: 600; padding: 0 6px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.step-actions, .actions-row, .row-actions, .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Portada */
.hero { background: linear-gradient(135deg, var(--hero-from), var(--hero-to)); color: var(--on-hero); padding: 48px 0 40px; }
.hero h1 { margin-bottom: .3em; } .hero p { opacity: .92; }
.searchbar { display: flex; gap: 8px; margin-top: 18px; max-width: 640px; }
.searchbar input { flex: 1; border: 0; }
.cta { margin-top: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 8px; }
.chips a { display: inline-block; padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: var(--text); }
.chips a:hover { border-color: var(--brand); color: var(--brand); }
.chips small { color: var(--muted); }
.more { margin-top: 16px; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }

/* Listados */
.filters { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 20px; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); align-items: end; }
.filter-row { display: contents; }
.result-count { color: var(--muted); margin: 0 0 12px; }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 12px; }


.ad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.ad-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .15s; }
.ad-card:hover { transform: translateY(-2px); }
.ad-card.is-featured { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.ad-card-link { display: block; text-decoration: none; color: inherit; }
.ad-card-media { position: relative; aspect-ratio: 4 / 3; background: var(--soft); display: grid; place-items: center; }
.ad-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.noimg { font-size: 2.2rem; opacity: .4; }
.badges { position: absolute; top: 8px; left: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--soft); color: var(--brand-dark); }
.badge-featured { background: #ffc107; color: #3b2b00; } .badge-buy { background: var(--brand); color: var(--on-brand); } .badge-danger { background: var(--danger); color: #fff; }
.ad-card-body { padding: 12px 14px 14px; }
.ad-card-body h3 { margin: 0 0 6px; font-size: 1rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price { font-weight: 800; font-size: 1.15rem; color: var(--brand-dark); margin: 0 0 4px; }
.meta { color: var(--muted); font-size: .85rem; margin: 0; }
.pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 28px; }
.pagination a, .pagination span { padding: 7px 13px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); text-decoration: none; }
.pagination .current, .pagination [aria-current] { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }

/* Ficha */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.gallery-main { margin: 0 0 12px; background: var(--soft); border-radius: var(--radius); overflow: hidden; }
.gallery-main img { display: block; width: 100%; height: auto; max-height: 620px; object-fit: contain; margin: 0 auto; }
.gallery-thumbs { display: flex; gap: 8px; flex-wrap: wrap; list-style: none; padding: 0; margin: 0 0 20px; }
.gallery-thumbs img { width: 84px; height: 63px; object-fit: cover; border-radius: 8px; border: 2px solid transparent; display: block; }
.gallery-thumbs a:hover img, .gallery-thumbs a.is-active img { border-color: var(--brand); }
.prose { overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 0; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; }
.price-big { font-size: 2rem; font-weight: 800; color: var(--brand-dark); margin: 0 0 4px; }
.detail-side { position: sticky; top: 76px; }
.report summary { cursor: pointer; color: var(--muted); margin-top: 12px; }

/* Fotos (subida) */
.uploader { display: grid; gap: 12px; margin-top: 12px; }
.upload-progress { width: 100%; }
.photo-grid { list-style: none; margin: 0 0 20px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.photo { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photo .badge { position: absolute; top: 8px; left: 8px; }
.photo-actions { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px; }
.photo-actions form { margin: 0; }

/* Mis anuncios, cuenta, mensajes */
.my-ads { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.my-ad { display: grid; grid-template-columns: 140px 1fr; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.my-ad-media { aspect-ratio: 4 / 3; background: var(--soft); border-radius: 8px; overflow: hidden; display: grid; place-items: center; }
.my-ad-media img { width: 100%; height: 100%; object-fit: cover; }
.my-ad-body h2 { font-size: 1.05rem; margin-bottom: .3em; }
.status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--soft); color: var(--brand-dark); }
.status-active { background: var(--ok-bg); color: var(--ok); }
.status-pending { background: #fff3cd; color: #664d03; }
.status-rejected, .status-banned, .status-suspended { background: var(--danger-bg); color: var(--danger); }
.status-expired, .status-paused, .status-draft, .status-sold { background: var(--soft); color: var(--muted); }
.stats, .tile-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.tile { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-decoration: none; color: var(--text); box-shadow: var(--shadow); }
.tile:hover { border-color: var(--brand); }
.tile .big, .big { display: block; font-size: 2rem; font-weight: 800; color: var(--brand-dark); line-height: 1.1; }
.conv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.conv-list a { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; text-decoration: none; color: var(--text); }
.conv-list a:hover { border-color: var(--brand); }
.conv-list .is-unread { border-left: 4px solid var(--brand); font-weight: 600; }
.conv-top { display: flex; justify-content: space-between; gap: 8px; } .conv-ad, .conv-last { color: var(--muted); font-weight: 400; }
.thread { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 10px; }
.bubble { max-width: 85%; background: var(--surface); border: 1px solid var(--border); border-radius: 14px 14px 14px 4px; padding: 10px 14px; }
.bubble.mine { margin-left: auto; background: var(--soft); border-radius: 14px 14px 4px 14px; }
.bubble-body { margin: 0 0 4px; overflow-wrap: anywhere; } .bubble-meta { margin: 0; font-size: .78rem; }

/* Admin */
.admin-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; padding: 0; list-style: none; }
.admin-nav a { display: block; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); text-decoration: none; color: var(--text); }
.admin-nav a[aria-current], .admin-nav a.is-current { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { background: var(--soft); font-weight: 700; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.admin-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.admin-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: grid; gap: 8px; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.reject-form { display: flex; gap: 8px; flex-wrap: wrap; } .reject-form input { flex: 1; min-width: 180px; }
.theme-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.theme-option { display: flex; gap: 12px; align-items: center; padding: 12px; border: 2px solid var(--border); border-radius: var(--radius); cursor: pointer; background: var(--surface); }
.theme-option:has(input:checked) { border-color: var(--brand); }
.theme-option .swatch { width: 44px; height: 44px; border-radius: 10px; flex: none; border: 1px solid var(--border); }
.theme-oceano .swatch { background: linear-gradient(135deg, #0d47a1, #1e88e5); }
.theme-cielo .swatch { background: linear-gradient(135deg, #4aa3e8, #cfe8fb); }
.theme-noche .swatch { background: linear-gradient(135deg, #0a1730, #3d7fe0); }
.theme-indigo .swatch { background: linear-gradient(135deg, #283593, #7986cb); }
.legal .prose h2 { margin-top: 1.6em; }
.code, code { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--soft); padding: 1px 6px; border-radius: 4px; }

@media (max-width: 860px) { .detail-grid { grid-template-columns: 1fr; } .detail-side { position: static; } }
@media (max-width: 560px) { .my-ad { grid-template-columns: 96px 1fr; } .searchbar { flex-direction: column; } .nav { gap: 4px 12px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Valoraciones, captcha, avisos pequeños */
.stars { color: #f5a623; letter-spacing: 1px; white-space: nowrap; }
.reviews { display: grid; gap: 10px; }
.review p { margin: 0 0 6px; }
.captcha label { display: block; font-weight: 600; margin-bottom: 4px; }
.captcha input { max-width: 8rem; }

/* --- Crecimiento (beta.6) --- */
[hidden] { display: none !important; }
.cf { margin-bottom: 12px; }
.filter-near, .filter-fields { align-items: center; }
.save-search { margin: 8px 0 16px; }
.save-search summary { cursor: pointer; font-weight: 600; }
.form-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.form-inline input[type=text] { flex: 1 1 220px; }
.seo-text { margin-top: 32px; max-width: 70ch; color: var(--muted, #556); }
.related { margin-top: 24px; }
.related h2 { font-size: 1.05rem; margin: 0 0 8px; }
.related ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.alert-link { margin: 8px 0; }

/* --- Estadísticas --- */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-bottom: 20px; }
.chart-card { margin: 0; padding: 14px; }
.chart-card figcaption { margin-bottom: 8px; }
.chart { display: block; width: 100%; height: 110px; }
.chart .bar { fill: var(--brand); }
.chart .bar:hover { fill: var(--brand-dark); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; margin-bottom: 20px; }
.range-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }

/* --- Pagos / destacados --- */
.plan-option { display: block; padding: 8px 0; }
.plan-list { display: grid; gap: 12px; margin-bottom: 24px; }
.plan-row { padding: 12px; display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; }
.plan-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.plan-form label { display: grid; gap: 4px; font-size: .9rem; }
.pre-line { white-space: pre-line; }
.status-paid { color: #166534; font-weight: 600; }
.status-failed, .status-refunded { color: #92400e; font-weight: 600; }

/* =====================================================================
   Ajustes de diseño público (beta.8+)
   ===================================================================== */
body { line-height: 1.55; }
h1 { letter-spacing: -.02em; line-height: 1.15; }
h2 { letter-spacing: -.01em; }
.section { padding-top: 28px; padding-bottom: 20px; }

/* Portada: texto legible sobre cualquier plantilla y buscador en un solo panel */
.hero { padding: 56px 0 64px; }
.hero h1 { font-size: clamp(1.9rem, 4.6vw, 3rem); max-width: 24ch; text-wrap: balance; }
.hero .lead, .hero p { color: inherit; opacity: .9; font-size: 1.1rem; max-width: 52ch; margin: 0 0 6px; }
.searchbar { display: flex; flex-wrap: wrap; gap: 10px; max-width: 860px; margin-top: 26px; padding: 12px;
  background: var(--surface); border-radius: 16px; box-shadow: 0 10px 30px rgba(8,25,60,.25); }
.searchbar input[type=search] { flex: 1 1 100%; border: 1px solid var(--border); font-size: 1.05rem; padding: 13px 14px; min-width: 0; }
.searchbar select { flex: 1 1 200px; min-width: 0; }
.searchbar .btn { flex: 0 0 auto; padding-left: 28px; padding-right: 28px; }
.cta { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; }
.hero .btn-ghost { color: inherit; border-color: currentColor; background: transparent; }
.hero .btn-ghost:hover { background: rgba(255,255,255,.14); color: inherit; border-color: currentColor; }
.tpl-cielo .hero .btn-ghost:hover { background: rgba(11,42,69,.08); }
.tpl-cielo .hero .lead, .tpl-cielo .hero p { margin-left: auto; margin-right: auto; }
.tpl-cielo .hero h1 { margin-left: auto; margin-right: auto; }
.tpl-cielo .cta { justify-content: center; }

/* Categorías */
.chips a { padding: 9px 16px; font-weight: 500; transition: border-color .15s, background .15s; }
.chips a:hover { background: var(--soft); }

/* Tarjetas de anuncio */
.ad-grid { gap: 20px; }
.ad-card { display: flex; flex-direction: column; border-radius: 14px; }
.ad-card-link { display: flex; flex-direction: column; flex: 1; }
.ad-card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; flex: 1; }
.ad-card-body h3, .ad-card-title { font-size: 1rem; line-height: 1.3; margin: 0 0 6px; font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ad-card .price { font-size: 1.3rem; margin: auto 0 4px; padding-top: 4px; }
.ad-card .meta { margin-top: 0; }
.ad-card.is-featured { border-color: var(--brand); box-shadow: var(--shadow); border-top: 4px solid var(--brand); }
.badge-featured { box-shadow: 0 1px 3px rgba(0,0,0,.25); }

/* Listado: panel de filtros en filas ordenadas */
.filters { display: grid; grid-template-columns: 1fr; gap: 10px; padding: 16px; }
.filter-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: center; }
.filter-row:first-child { grid-template-columns: minmax(220px, 2fr) repeat(auto-fit, minmax(150px, 1fr)); }
.filters .btn-primary { justify-self: stretch; }
.filters input, .filters select { min-width: 0; }
.result-count { font-weight: 600; margin-top: 4px; }

/* Ficha */
.crumbs { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.crumbs a { color: var(--muted); }
.price-big { font-size: 2.2rem; letter-spacing: -.02em; }
.gallery-main { border: 1px solid var(--border); }
.detail-grid aside .card:first-child { border-top: 4px solid var(--brand); }

/* Móvil */
@media (max-width: 640px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .hero { padding: 36px 0 40px; }
  .searchbar { padding: 10px; border-radius: 14px; }
  .searchbar select, .searchbar .btn { flex: 1 1 100%; }
  .ad-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .ad-card .price { font-size: 1.1rem; }
  .ad-card-body { padding: 10px; }
  .detail-grid { grid-template-columns: 1fr; }
  .filter-row, .filter-row:first-child { grid-template-columns: 1fr 1fr; }
  .filter-row input[type=search] { grid-column: 1 / -1; }
  .price-big { font-size: 1.8rem; }
}
@media (prefers-reduced-motion: reduce) { .ad-card, .chips a { transition: none; } .ad-card:hover { transform: none; } }

/* Formularios de acceso: tarjeta centrada con etiquetas pegadas a su campo */
.narrow { margin-top: 24px; }
.narrow > .form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); gap: 6px; }
.narrow > .form > label:not(:first-child) { margin-top: 10px; }
.narrow > .form > .btn, .narrow > .form > button { margin-top: 16px; }
.narrow > p { margin: 14px 0 0; }
.narrow > h1 { font-size: 1.8rem; }

/* Campo trampa antispam: fuera de pantalla */
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* VDC: cantidad junto al precio por tonelada */
.ad-card .price .qty { font-size: .85rem; font-weight: 600; color: var(--muted, #5b6573); white-space: nowrap; }

/* VDC: distintivos de tipo de vendedor y verificación */
.badge-seller { background: #eef2f7; color: #334155; }
.badge-empresa { background: #e0ecff; color: #1e3a8a; }
.badge-verified { background: #dcfce7; color: #166534; }
.business-fields { border: 1px solid var(--border, #d8dee6); border-radius: 8px; padding: 12px 14px; margin: 14px 0; }
.business-fields legend { font-weight: 700; padding: 0 6px; }

.badge-analysis { background: #fef3c7; color: #92400e; }
.doc-list { list-style: none; padding: 0; margin: 0; }
.doc-list li { padding: 6px 0; border-bottom: 1px solid var(--border, #e3e8ee); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.prices-table td, .prices-table th { vertical-align: middle; }
.chg.up { color: #166534; } .chg.down { color: #b91c1c; }
.spark { color: var(--brand, #2563eb); }
.rfq-card { margin: 14px 0; } .rfq summary { cursor: pointer; text-align: center; }
dl.result { margin-top: 12px; }

/* VDC: directorio, noticias y calendario */
.dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 16px; }
.dir-card h2 { font-size: 1.1rem; margin: 4px 0; }
.dir-contact { display: flex; flex-direction: column; gap: 4px; word-break: break-word; }
.news-item h2 { font-size: 1.2rem; margin: 0 0 4px; }
.calendar-list { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 12px; }
.calendar-list .is-past { opacity: .6; }
.cal-date { margin: 0 0 2px; }
.tools .card { align-self: start; }

/* VDC: cifras destacadas, gráficos y avisos de seguridad */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin: 16px 0; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat p { margin: 0; }
.stat-label { color: var(--muted); font-size: .85rem; font-weight: 600; }
.stat-value { font-size: 1.7rem; font-weight: 800; color: var(--brand-dark); margin: 2px 0 4px !important; letter-spacing: -.01em; }
.chart { display: block; max-width: 100%; height: auto; margin: 8px 0 4px; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .line { stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.chart .c1 { stroke: var(--brand); fill: var(--brand); } .chart .c2 { stroke: #d97706; fill: #d97706; } .chart .c3 { stroke: #15803d; fill: #15803d; }
.chart .dot { stroke: none; } .chart polyline.line { fill: none; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin: 4px 0 0; color: var(--muted); font-size: .9rem; }
.legend .key::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: currentColor; }
.legend .key.c1::before { background: var(--brand); } .legend .key.c2::before { background: #d97706; } .legend .key.c3::before { background: #15803d; }
.series-pick { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.safety { border: 1px solid var(--border); border-left: 4px solid #d97706; background: #fffbeb; color: #5b3a05; border-radius: 8px; padding: 10px 14px; margin: 10px 0; font-size: .92rem; }
.safety.is-ok { border-left-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.safety p { margin: 0 0 4px; } .safety ul { margin: 4px 0 6px 18px; padding: 0; }
.risk { margin: 6px 0 0; padding: 6px 10px; border-radius: 6px; background: var(--danger-bg); color: var(--danger); font-size: .85rem; font-weight: 600; }
.risk-offsite { background: #fffbeb; color: #92400e; }
.quotes-table td, .quotes-table th { vertical-align: middle; }
.badge-seller { background: var(--soft); color: var(--brand-dark); }

.rfq-card dl.facts { margin-bottom: 12px; } .rfq-card .inline { margin-right: 6px; } .card h3 { margin: 18px 0 4px; }

/* Portada (alpha.6) */
.hero-landing { padding: 56px 0 44px; }
.hero-landing h1 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); max-width: 22ch; line-height: 1.12; }
.hero-landing .lead { max-width: 60ch; font-size: 1.1rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; font-weight: 700; opacity: .85; margin: 0 0 8px; }
.cta-big { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 6px; }
.cta-big .btn { padding: 12px 22px; font-size: 1.02rem; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 8px 28px; list-style: none; padding: 0; margin: 22px 0 0; }
.hero-stats strong { font-size: 1.35rem; margin-right: 4px; }
.hero-stats span { opacity: .85; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.section-head h2 { margin: 0; }
.ad-grid + .ad-grid { margin-top: 16px; }
.band { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-top: 8px; }
.steps-grid { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 22px; }
.steps-grid h3 { margin: 8px 0 4px; font-size: 1.05rem; }
.steps-grid p { margin: 0; color: var(--muted); }
.step-n { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: var(--on-brand); font-weight: 700; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.news-card { margin-bottom: 0; }
.news-card h3 { margin: 4px 0 8px; font-size: 1.1rem; }
.join-block { display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center; background: linear-gradient(135deg, var(--hero-from), var(--hero-to)); color: var(--on-hero); border-radius: var(--radius); padding: 32px; }
.join-block h2 { margin-top: 0; }
.join-block a:not(.btn) { color: inherit; }
.join-block .muted { color: inherit; opacity: .85; }
.join-actions { text-align: center; }
.btn-lg { padding: 14px 28px; font-size: 1.08rem; }
.ticks { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.ticks li::before { content: "✓"; font-weight: 700; margin-right: 8px; }
@media (max-width: 720px) { .join-block { grid-template-columns: 1fr; padding: 22px; } .join-actions { text-align: left; } }

/* Contacto (alpha.7) */
.contact-options { display: grid; gap: 8px; margin: 10px 0 14px; }
.contact-options .btn { text-align: center; }
.btn-wa { background: #16a34a; border-color: #15803d; color: #fff; }
.btn-wa:hover { background: #15803d; color: #fff; }
.contact-options .btn .muted { color: inherit; opacity: .8; font-weight: 400; }

/* Tendencias: verde sube, rojo baja (alpha.7) */
.trend { display: inline-block; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; font-size: .92em; }
.trend.up { color: #14532d; background: #dcfce7; }
.trend.down { color: #7f1d1d; background: #fee2e2; }
.trend.flat { color: #475569; background: #e2e8f0; }
.quote-board { width: 100%; }
.quote-board .price-cell { font-size: 1.15rem; font-weight: 700; white-space: nowrap; }
.quote-board tr.row-up > :first-child { box-shadow: inset 4px 0 0 #16a34a; }
.quote-board tr.row-down > :first-child { box-shadow: inset 4px 0 0 #dc2626; }
.quote-board tr.row-flat > :first-child { box-shadow: inset 4px 0 0 #94a3b8; }
.quote-board + .hint, .table-wrap + .hint { margin-bottom: 20px; }
h2 + .muted { margin-top: 0; }
.spark.up { color: #16a34a; } .spark.down { color: #dc2626; } .spark.flat { color: #64748b; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; margin: 8px 0 16px; align-items: center; }
.quote-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.stat-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.bar-list { list-style: none; padding: 0; margin: 0; }
.bar-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; margin: 6px 0; }
.bar-list .meter { grid-column: 1 / -1; height: 6px; background: var(--brand); border-radius: 3px; opacity: .75; }

/* Anchos de barras (la política de seguridad no permite estilos en línea) */
.w-0 { width: 0%; }
.w-5 { width: 5%; }
.w-10 { width: 10%; }
.w-15 { width: 15%; }
.w-20 { width: 20%; }
.w-25 { width: 25%; }
.w-30 { width: 30%; }
.w-35 { width: 35%; }
.w-40 { width: 40%; }
.w-45 { width: 45%; }
.w-50 { width: 50%; }
.w-55 { width: 55%; }
.w-60 { width: 60%; }
.w-65 { width: 65%; }
.w-70 { width: 70%; }
.w-75 { width: 75%; }
.w-80 { width: 80%; }
.w-85 { width: 85%; }
.w-90 { width: 90%; }
.w-95 { width: 95%; }
.w-100 { width: 100%; }

/* alpha.8: ficha de datos de solo lectura */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
.kv dt { color: var(--muted, #666); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* Logotipo en verde (BDC Bróker) */
.brand:hover { color: #14602a; }
.logbox { background: var(--soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; overflow-x: auto; font-size: .8rem; white-space: pre-wrap; word-break: break-word; }
.btn-whatsapp { background: #1f9d55; border-color: #1f9d55; color: #fff; } .btn-whatsapp:hover { background: #187a43; color: #fff; }

.advantages { padding: 22px 26px; }
.advantages p { margin: 0 0 10px; }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.check-list li { position: relative; padding-left: 28px; }
.check-list li::before { content: "\2713"; position: absolute; left: 0; top: 0; color: #1b7a34; font-weight: 700; }

/* Logotipo de la cabecera */
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-logo { height: 48px; width: auto; display: block; }
.brand-name { line-height: 1.1; }
@media (max-width: 600px) { .brand { gap: 7px; font-size: 1.15rem; } .brand-logo { height: 38px; } }
/* alpha.15: móvil — el texto oculto de las tablas con scroll no debe ensanchar la página; la ficha no desborda a 320 px */
.table-wrap { position: relative; }
.detail-main, .detail-main > * { min-width: 0; max-width: 100%; }
.gallery-thumbs { flex-wrap: wrap; }
.gallery-main img { max-width: 100%; height: auto; }
.facts { grid-template-columns: max-content minmax(0, 1fr); }
.facts dd { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 400px) { .facts { gap: 6px 12px; } }
/* alpha.16/0.2.0 — móvil: formularios de administración que no deben ensanchar la página */
fieldset { min-width: 0; max-width: 100%; }
.hint, .muted, code { overflow-wrap: anywhere; }
.theme-picker { grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); }
