/* TODO: OFUSCAR CÓDIGO ANTES DE PUBLICAR (CSS: minificar y renombrar clases) */
:root {
  --bg: #0b0d10; --bg2: #12151a; --card: #171b21; --line: #262c35;
  --text: #e8ebf0; --muted: #8b94a1; --acc: #ff8a1f; --acc2: #ffb25e;
  --radius: 16px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; overflow: hidden; }
button, input { font: inherit; color: inherit; }
#app { height: 100%; position: relative; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); animation: in .35s ease; }
@keyframes in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Login ---------- */
.login { justify-content: center; align-items: center; padding: 24px;
  background: radial-gradient(900px 500px at 50% -10%, #2a1a0a 0%, transparent 60%), var(--bg); }
.login-box { width: 100%; max-width: 380px; background: linear-gradient(180deg, var(--card), var(--bg2));
  border: 1px solid var(--line); border-radius: 24px; padding: 32px 26px;
  box-shadow: 0 30px 80px #000a, inset 0 1px 0 #ffffff0d; }
.logo { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.logo svg { width: 44px; height: 44px; }
.logo b { font-size: 26px; letter-spacing: .5px; }
.logo b span { color: var(--acc); }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 24px; }
label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin: 14px 0 6px; }
input[type=text], input[type=password], input[type=search] {
  width: 100%; background: #0d1014; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; outline: none; transition: border-color .2s, box-shadow .2s; }
input:focus { border-color: var(--acc); box-shadow: 0 0 0 3px #ff8a1f22; }
.btn { width: 100%; margin-top: 22px; padding: 15px; border: 0; border-radius: 12px; cursor: pointer;
  background: linear-gradient(180deg, var(--acc2), var(--acc)); color: #1a0e00; font-weight: 700; letter-spacing: .5px;
  box-shadow: 0 8px 24px #ff8a1f40; transition: transform .1s; }
.btn:active { transform: scale(.98); }
.err { color: #ff6b6b; font-size: 13px; min-height: 18px; margin-top: 10px; }
.hint { color: var(--muted); font-size: 12px; text-align: center; margin-top: 16px; }

/* ---------- Barra superior ---------- */
.top { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; flex: none; }
.top h1 { font-size: 18px; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top h1 span { color: var(--acc); }
.icon-btn { width: 42px; height: 42px; flex: none; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); cursor: pointer; display: grid; place-items: center; }
.icon-btn svg { width: 20px; height: 20px; stroke: var(--text); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:active { background: var(--bg2); }

/* ---------- Buscador ---------- */
.search { margin: 0 16px 8px; position: relative; flex: none; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px;
  stroke: var(--acc); fill: none; stroke-width: 2.2; stroke-linecap: round; }
.search input { padding-left: 46px; border-radius: 14px; background: var(--card); }

/* ---------- Listas ---------- */
.scroll { flex: 1; overflow-y: auto; padding: 8px 16px 28px; -webkit-overflow-scrolling: touch; }
.section-t { font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); margin: 14px 4px 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.card { position: relative; text-align: left; background: linear-gradient(160deg, var(--card), var(--bg2));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; cursor: pointer; overflow: hidden;
  transition: transform .15s, border-color .2s; min-height: 110px; display: flex; flex-direction: column; justify-content: flex-end; }
.card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c, var(--acc)); }
.card:not(.off):hover { border-color: var(--acc); transform: translateY(-2px); }
.card:not(.off):active { transform: scale(.98); }
.card .init { position: absolute; right: 12px; top: 6px; font-size: 54px; font-weight: 800; color: #ffffff08; line-height: 1; }
/* Logo de la marca detrás del nombre: sobre una placa clara translúcida para que se vea también si el logo es oscuro */
.card .logo-plate { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 68px; height: 68px; border-radius: 50%;
  background: #ffffffe0; box-shadow: 0 2px 10px #0006; display: grid; place-items: center; pointer-events: none; }
.card .logo { width: 52px; height: 52px; object-fit: contain; transition: transform .2s; }
.card:not(.off):hover .logo { transform: scale(1.1); }
/* Logos de solo texto (muy anchos): placa tipo píldora arriba a la derecha, el nombre queda abajo */
.card .logo-plate.wide { top: 12px; transform: none; width: 98px; height: 32px; border-radius: 10px; }
.card .logo-plate.wide .logo { width: 88px; height: 22px; }
.card:has(.logo-plate.wide) h3 { max-width: none; }
.card:has(.logo-plate) h3, .card:has(.logo-plate) small { position: relative; z-index: 1; }
.card:has(.logo-plate) h3 { max-width: calc(100% - 66px); font-size: 17px; line-height: 1.15; overflow-wrap: anywhere; }
.card h3 { margin: 0; font-size: 20px; }
.card small { color: var(--muted); font-size: 12px; }
.card.off { opacity: .78; cursor: not-allowed; }
.card.off h3 { color: #9aa3b0; }
.card.off .logo-plate { background: #ffffffb0; }
.tag { position: absolute; right: 10px; bottom: 10px; font-size: 10px; letter-spacing: .5px; text-transform: uppercase;
  background: #ffffff10; color: var(--muted); border-radius: 20px; padding: 3px 8px; }
.tag.on { background: #ff8a1f22; color: var(--acc2); }
.empty { color: var(--muted); text-align: center; padding: 40px 10px; }

/* ---------- Visor 3D ---------- */
.screen.viewer { position: absolute; } /* fix: antes quedaba en "relative" y el canvas medía 0 de alto */
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.v-top { position: relative; z-index: 2; background: linear-gradient(#0b0d10ee, #0b0d1000); }
.v-bar { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(#0b0d1000, #0b0d10ee 40%); display: flex; flex-direction: column; gap: 10px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: #171b21e6;
  backdrop-filter: blur(8px); cursor: pointer; font-size: 14px; white-space: nowrap; transition: .2s; }
.chip.on { background: var(--acc); border-color: var(--acc); color: #1a0e00; font-weight: 700; }
.chip.layer.on { background: #ff8a1f22; color: var(--acc2); border-color: var(--acc); font-weight: 600; }
.v-hint { position: absolute; z-index: 1; top: 72px; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--muted); pointer-events: none; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); z-index: 3; background: var(--bg); transition: opacity .5s; }
.loading.hide { opacity: 0; pointer-events: none; }

/* ---------- Tarjetas de marca: logo arriba a la derecha, nombre abajo, estrella de favorita ---------- */
[hidden] { display: none !important; }
.card.marca { min-height: 118px; justify-content: flex-end; }
.card.marca .logo-plate { top: 10px; right: 10px; transform: none; width: 58px; height: 58px; }
.card.marca .logo-plate .logo { width: 44px; height: 44px; }
.card.marca .logo-plate.wide { top: 14px; width: 98px; height: 32px; border-radius: 10px; }
.card.marca .logo-plate.wide .logo { width: 88px; height: 22px; }
.card.marca .tag { top: auto; left: auto; right: 12px; bottom: 12px; }
.card.marca .init { top: 8px; right: 14px; }
.card.marca h3, .card.marca:has(.logo-plate.wide) h3 { max-width: none; font-size: 18px; }
.card.marca small { max-width: none; }

/* Corazón de favorita: arriba a la izquierda */
.fav { position: absolute; left: 10px; top: 10px; right: auto; bottom: auto; z-index: 2; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid #ffffff1a; background: #0b0d10a6; backdrop-filter: blur(4px); color: #8b94a1; cursor: pointer; display: grid; place-items: center; padding: 0; transition: color .15s, background .15s, border-color .15s, transform .12s; }
.fav svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: fill .15s; }
.fav:hover { color: #ff4d6d; border-color: #ff4d6d80; transform: scale(1.08); }
.fav:active { transform: scale(.92); }
.fav.on { color: #ff4d6d; border-color: #ff4d6d99; background: #ff4d6d24; box-shadow: 0 0 14px #ff4d6d40; }
.fav.on svg { fill: currentColor; }
.fav.pop svg { animation: latido .5s ease; }
@keyframes latido { 0% { transform: scale(.5); } 45% { transform: scale(1.45); } 70% { transform: scale(.9); } 100% { transform: scale(1); } }

/* Tarjetas de marca más vistosas */
@keyframes subir { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.card.marca { background: linear-gradient(155deg, #1d222b 0%, #14171c 65%); border-radius: 18px; border: 1px solid #2a313b;
  animation: subir .5s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 22ms); }
.card.marca::after { content: ''; position: absolute; right: -34px; top: -34px; width: 132px; height: 132px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, var(--c) 0%, transparent 68%); opacity: .16; transition: opacity .25s; }
.card.marca:not(.off):hover { transform: translateY(-3px); box-shadow: 0 12px 30px #0009, 0 0 0 1px var(--c); border-color: var(--c); }
.card.marca:not(.off):hover::after { opacity: .34; }
.card.marca.live { border-color: #ff8a1f66; box-shadow: 0 10px 30px #ff8a1f26; }
.card.marca.live::after { opacity: .3; }
.card.marca.es-fav { border-color: #ff4d6d55; }
.card.marca.es-fav::before { background: #ff4d6d; }
.card.marca.off { opacity: .86; }
.card.marca .logo-plate { box-shadow: 0 4px 14px #0007, inset 0 0 0 1px #ffffff40; }

/* Encabezado del menú */
.screen.menu { background: radial-gradient(1000px 380px at 50% -140px, #ff8a1f26, transparent 70%), var(--bg); }
.hero { flex: none; padding: 4px 20px 12px; }
.hero h2 { margin: 0; font-size: 24px; line-height: 1.15; letter-spacing: .2px; }
.hero h2 span { color: var(--acc); }
.hero p { margin: 5px 0 0; color: var(--muted); font-size: 13.5px; }
.search input { box-shadow: 0 6px 20px #0006; }
.filtros .chip:not(.on) { background: #171b21; border-color: #2a313b; }
.filtros .chip.on { box-shadow: 0 6px 18px #ff8a1f4d; }
.empty-ico { width: 54px; height: 54px; margin: 0 auto 12px; color: #ff4d6d; opacity: .8; }
.empty-ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-reduced-motion: reduce) { .card.marca, .fav.pop svg { animation: none; } }
.filtros { margin: 2px 16px 4px; flex: none; }
.chip .n { opacity: .6; font-size: 11px; margin-left: 4px; }
.toast { position: fixed; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; max-width: 90vw;
  background: #171b21; border: 1px solid var(--acc); color: var(--text); padding: 11px 16px; border-radius: 12px; font-size: 14px; box-shadow: 0 10px 30px #000a; transition: opacity .4s; }
.toast.out { opacity: 0; }

/* ---------- Responsive ---------- */
html, body, #app { height: 100dvh; }
.card .foto { width: calc(100% + 32px); margin: -18px -16px 12px; aspect-ratio: 16 / 9; object-fit: cover; display: block;
  background: #0d1014; border-bottom: 1px solid var(--line); }
.card.off .foto { filter: grayscale(.6); }
.card:has(.foto) { justify-content: flex-start; padding-top: 18px; }
.card:has(.foto) .tag { top: 10px; bottom: auto; background: #0b0d10cc; }
.card:has(.foto) .init { display: none; }

@media (max-width: 480px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .scroll { padding: 6px 12px 24px; }
  .card { min-height: 96px; padding: 14px 12px; }
  .card h3 { font-size: 16px; }
  .top { padding: 10px 12px 8px; gap: 8px; }
  .top h1 { font-size: 15px; }
  .top h1 span { display: none; }
  .search { margin: 0 12px 6px; }
  .filtros { margin: 2px 12px 4px; }
  .hero { padding: 2px 14px 10px; }
  .hero h2 { font-size: 21px; }
  .login-box { padding: 26px 20px; }
  .chip { padding: 9px 13px; font-size: 13px; }
  .v-hint { top: 62px; font-size: 11px; }
}
@media (min-width: 481px) and (max-width: 799px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-height: 520px) and (orientation: landscape) { /* celu acostado */
  .v-hint { display: none; }
  .v-bar { flex-direction: row; align-items: center; padding: 8px 10px; gap: 8px; }
  .v-bar .chips { flex: 1; min-width: 0; }
  .top { padding: 6px 12px; }
  .icon-btn { width: 36px; height: 36px; }
  .login { align-items: flex-start; overflow-y: auto; }
}

@media (min-width: 800px) {
  .scroll, .top, .search, .filtros, .hero { max-width: 1000px; width: 100%; margin-left: auto; margin-right: auto; }
  .hero { padding: 4px 16px 12px; }
  .filtros { padding: 0 16px; }
  .top { padding-left: 16px; padding-right: 16px; }
  .search { padding: 0 16px; }
  .search svg { left: 30px; }
  .v-bar { align-items: center; }
}

/* ---------- Historial ---------- */
.fuente { display: flex; gap: 14px; background: linear-gradient(155deg, #1b2028, #14171c); border: 1px solid var(--line); border-left: 4px solid var(--e, #8b94a1);
  border-radius: 16px; padding: 14px 14px 12px; margin-bottom: 10px; animation: subir .4s both; }
.fuente.est-oficial { --e: #32d74b; } .fuente.est-referencia { --e: #4aa8ff; } .fuente.est-descartado { --e: #ff6b6b; } .fuente.est-sin-acceso { --e: #8b94a1; }
.f-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; background: #ffffff0d; display: grid; place-items: center; color: var(--e); }
.f-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.f-body { min-width: 0; flex: 1; }
.f-body h3 { margin: 0; font-size: 15.5px; line-height: 1.25; }
.f-meta { color: var(--muted); font-size: 12px; margin: 3px 0 6px; }
.f-body p { margin: 0 0 9px; font-size: 13.5px; line-height: 1.45; color: #c5cbd4; }
.f-pie { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.badge { font-size: 11px; font-weight: 700; letter-spacing: .3px; padding: 3px 9px; border-radius: 20px; color: var(--e); background: #ffffff0f; border: 1px solid currentColor; }
.badge.est-oficial { --e: #32d74b; } .badge.est-referencia { --e: #4aa8ff; } .badge.est-descartado { --e: #ff6b6b; } .badge.est-sin-acceso { --e: #8b94a1; }
.mini { font-size: 11px; color: var(--muted); background: #ffffff0d; padding: 3px 8px; border-radius: 20px; }
.f-link { margin-left: auto; font-size: 12.5px; color: var(--acc2); text-decoration: none; padding: 4px 2px; }
.f-link:hover { text-decoration: underline; }
.avance { display: flex; gap: 14px; padding: 4px 4px 14px; position: relative; }
.avance::before { content: ''; position: absolute; left: 9px; top: 18px; bottom: -2px; width: 2px; background: var(--line); }
.avance .punto { flex: none; width: 14px; height: 14px; margin-top: 4px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 0 4px #ff8a1f26; position: relative; z-index: 1; }
.avance h3 { margin: 0 0 3px; font-size: 15.5px; } .avance p { margin: 0; font-size: 13.5px; line-height: 1.45; color: #c5cbd4; }
@media (max-width: 480px) { .fuente { padding: 12px 11px 10px; gap: 11px; } .f-ico { width: 34px; height: 34px; } .f-link { margin-left: 0; } }

/* ---------- Banner del menú ---------- */
.banner { flex: none; position: relative; margin: 2px 16px 12px; height: 172px; border-radius: 20px; overflow: hidden; background: #14171c;
  box-shadow: 0 14px 36px #0009, 0 0 0 1px #ffffff14; touch-action: pan-y; user-select: none; }
.slides, .slide { position: absolute; inset: 0; }
.slide { opacity: 0; visibility: hidden; transition: opacity .7s ease, visibility .7s; }
.slide.on { opacity: 1; visibility: visible; }
.s-bg { position: absolute; inset: 0; background-size: cover; background-position: center; transform: scale(1.1); }
.slide.on .s-bg { animation: kenburns 9s ease-out both; }
@keyframes kenburns { from { transform: scale(1.12) translateX(10px); } to { transform: scale(1.0) translateX(0); } }
.slide::before { content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg, #0b0d10f2 0%, #0b0d10c4 42%, #0b0d1040 100%), linear-gradient(0deg, #0b0d10aa 0%, transparent 45%); }
.slide-in { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 18px 22px; max-width: 62%; }
.b-tag { align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase;
  padding: 5px 11px; border-radius: 20px; color: #e8ebf0; background: #ffffff1f; border: 1px solid #ffffff2e; backdrop-filter: blur(6px); }
.b-tag.nuevo { color: #1a0e00; background: linear-gradient(180deg, var(--acc2), var(--acc)); border-color: transparent; box-shadow: 0 6px 18px #ff8a1f66; }
.b-tag i { width: 8px; height: 8px; border-radius: 50%; background: #1a0e00; animation: latir 1.1s ease-in-out infinite; }
@keyframes latir { 50% { transform: scale(.45); opacity: .5; } }
.slide h2 { margin: 9px 0 4px; font-size: 24px; line-height: 1.12; letter-spacing: .2px; text-shadow: 0 2px 12px #000a; }
.slide p { margin: 0; font-size: 13.5px; line-height: 1.4; color: #d3d9e2; text-shadow: 0 1px 8px #000a; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.b-cta { align-self: flex-start; margin-top: 11px; font-size: 13px; font-weight: 700; color: #fff; text-decoration: none; padding: 7px 14px; border-radius: 12px;
  background: #ffffff1c; border: 1px solid #ffffff38; backdrop-filter: blur(6px); transition: background .2s, transform .1s; }
.b-cta span { color: var(--acc2); display: inline-block; transition: transform .2s; }
.b-cta:hover { background: #ff8a1f; color: #1a0e00; border-color: transparent; } .b-cta:hover span { color: #1a0e00; transform: translateX(3px); }
.dots { position: absolute; z-index: 3; right: 16px; bottom: 12px; display: flex; gap: 7px; }
.dot { width: 8px; height: 8px; border-radius: 8px; border: 0; padding: 0; cursor: pointer; background: #ffffff55; transition: width .3s, background .3s; }
.dot.on { width: 24px; background: var(--acc); }
@media (max-width: 480px) { .banner { margin: 2px 12px 10px; height: 158px; border-radius: 18px; } .slide-in { max-width: 88%; padding: 14px 16px; }
  .slide h2 { font-size: 19px; margin: 7px 0 3px; } .slide p { font-size: 12.5px; } .b-cta { margin-top: 9px; padding: 6px 12px; } .dots { right: 12px; bottom: 10px; } }
@media (min-width: 800px) { .banner { max-width: 968px; width: calc(100% - 32px); margin: 2px auto 14px; height: 200px; } .slide h2 { font-size: 28px; } .slide p { font-size: 14.5px; } }
@media (prefers-reduced-motion: reduce) { .slide.on .s-bg, .b-tag i { animation: none; } }

/* ---------- Búsquedas recientes e historial de búsquedas ---------- */
.recientes { flex: none; margin: -2px 16px 8px; padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  background: #14171c; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 26px #0008; animation: in .2s ease; }
.rec-t { font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin-right: 2px; }
.rec { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 7px 12px; border-radius: 999px; background: #1b2028; border: 1px solid #2a313b; cursor: pointer; }
.rec svg { width: 14px; height: 14px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.rec:hover { border-color: var(--acc); } .rec.ver { color: var(--acc2); background: transparent; border-style: dashed; }
.ctrl { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 16px 0; padding: 10px 14px; background: #14171c; border: 1px solid var(--line); border-radius: 14px; }
.sw { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.sw input { position: absolute; opacity: 0; pointer-events: none; }
.sw-t { width: 42px; height: 24px; border-radius: 24px; background: #2a313b; position: relative; transition: background .2s; flex: none; }
.sw-t::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.sw input:checked + .sw-t { background: var(--acc); } .sw input:checked + .sw-t::after { transform: translateX(18px); }
.sw input:focus-visible + .sw-t { outline: 2px solid var(--acc2); outline-offset: 2px; }
.borrar, .conf button { font-size: 13px; padding: 7px 13px; border-radius: 10px; border: 1px solid #ff6b6b66; color: #ff8a8a; background: #ff6b6b14; cursor: pointer; }
.conf { font-size: 13px; color: #ff8a8a; display: inline-flex; align-items: center; gap: 6px; } .conf button:first-child { background: #ff6b6b; color: #1a0505; }
.busq { display: flex; align-items: stretch; gap: 8px; margin-bottom: 8px; animation: subir .3s both; }
.b-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-align: left; padding: 11px 13px; cursor: pointer;
  background: linear-gradient(155deg, #1b2028, #14171c); border: 1px solid var(--line); border-radius: 14px; transition: border-color .2s, transform .1s; }
.b-main:hover { border-color: var(--acc); } .b-main:active { transform: scale(.99); }
.b-main .f-ico { width: 36px; height: 36px; color: var(--acc); }
.b-txt { min-width: 0; display: flex; flex-direction: column; gap: 3px; } .b-txt b { font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-txt small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.b-del { flex: none; width: 42px; border-radius: 14px; border: 1px solid var(--line); background: #14171c; color: var(--muted); cursor: pointer; font-size: 14px; }
.b-del:hover { color: #ff8a8a; border-color: #ff6b6b66; }
.nota-priv { color: var(--muted); font-size: 12px; text-align: center; margin: 14px 8px 4px; }
@media (max-width: 480px) { .recientes { margin: -2px 12px 8px; } .ctrl { margin: 4px 12px 0; padding: 9px 11px; } }
@media (min-width: 800px) { .recientes, .ctrl { max-width: 968px; width: calc(100% - 32px); margin-left: auto; margin-right: auto; } }
.ctrl .sw { text-transform: none; letter-spacing: 0; color: var(--text); margin: 0; font-size: 14px; }

/* ---------- Engranaje del historial y panel de ajustes ---------- */
.icon-btn[aria-expanded="true"] { border-color: var(--acc); background: #ff8a1f1f; }
.icon-btn[aria-expanded="true"] svg { stroke: var(--acc2); }
.icon-btn[aria-expanded="true"] svg { transform: rotate(60deg); } .icon-btn svg { transition: transform .35s ease; }
.ctrl { flex-direction: column; align-items: stretch; gap: 10px; animation: in .22s ease; }
.ctrl-fila { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ctrl-nota { color: var(--muted); font-size: 13px; }
.borrar { display: inline-flex; align-items: center; gap: 8px; }
.borrar svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Marcas cargadas a la vista; el resto, al final y más tenue ---------- */
.sec-disp { color: var(--acc2); font-weight: 700; }
.grid-disp { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.grid-disp .card.marca { min-height: 142px; border-color: #ff8a1f88; box-shadow: 0 14px 38px #ff8a1f33; }
.grid-disp .card.marca h3 { font-size: 21px; }
.grid-disp .card.marca small { color: #c5cbd4; font-size: 12.5px; }
.grid-disp .card.marca .logo-plate { width: 72px; height: 72px; } .grid-disp .card.marca .logo-plate .logo { width: 54px; height: 54px; }
.grid-disp .card.marca .logo-plate.wide { width: 110px; height: 36px; } .grid-disp .card.marca .logo-plate.wide .logo { width: 98px; height: 26px; }
.grid-disp .card.marca::after { opacity: .42; }
.sec-prox { margin-top: 26px; }
.grid-prox .card.marca.off { opacity: .4; filter: saturate(.55); box-shadow: none; }
.grid-prox .card.marca.off h3 { color: #8f98a5; }
.grid-prox .card.marca.off .logo-plate { background: #ffffff70; }
.grid-prox .card.marca.off .logo { filter: grayscale(.85); }
.grid-prox .card.marca.off:hover { opacity: .62; }
@media (max-width: 480px) { .grid-disp { grid-template-columns: repeat(2, 1fr); gap: 10px; } .grid-disp .card.marca { min-height: 130px; } .grid-disp .card.marca h3 { font-size: 18px; }
  .grid-disp .card.marca .logo-plate { width: 60px; height: 60px; } .grid-disp .card.marca .logo-plate .logo { width: 44px; height: 44px; } }
.grid-disp .card.marca .tag { display: none; }   /* la sección ya dice "Disponibles" */
