/* ═══════════════════════════════════════════════════════════════════
   mercado.css — Mercado de vecinos (portal de residentes)

   Lo usa /js/residente/mercado.js, que ya no se genera desde el rediseño de
   Apps Script (R2Mercado.html): su fuente es este proyecto, y por eso sus
   estilos van aparte de residente.css (que sí se genera). Usa las variables y
   las piezas del portal «Mi casa» (.btn, .btn-ghost, .round-btn, .input,
   .field, .seg, .switch, .row, .empty, .card, .topbar, .hoja, .spinner);
   aquí va solo lo que le falta. Prefijo mk-.

   Lo que se toma de Marketplace es la ORGANIZACIÓN —las fotos y el precio
   primero, una rejilla de tarjetas, pastillas que se deslizan, un carrusel,
   vender con las fotos primero—, no su marca: el color y la letra son los del
   portal, en tema oscuro y claro.

   Reglas de la casa que se cuidan aquí: ningún texto mide menos de 12 px, todo
   lo que se toca mide 44 px o más, los campos van a 16 px, ningún <select>
   lleva la flecha del sistema, el texto secundario es --text-2 (nunca
   --text-3) y las tarjetas de una fila miden lo mismo. El color sale de las
   variables; las únicas excepciones son los cuatro tintes de categoría de
   abajo, el blanco sobre una foto y el velo negro que la protege.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Tintes de categoría y la flecha de los select, por tema ───────── */
[data-theme="dark"] {
  --mk-rosa: #f472b6; --mk-azul: #60a5fa; --mk-violeta: #a78bfa; --mk-cielo: #38bdf8;
  --mk-flecha: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239998b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}
[data-theme="light"] {
  --mk-rosa: #db2777; --mk-azul: #2563eb; --mk-violeta: #7c3aed; --mk-cielo: #0284c7;
  --mk-flecha: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235a5a7a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}
.mk-c-COMIDA { --mk-tinte: var(--amber); }
.mk-c-BELLEZA { --mk-tinte: var(--mk-rosa); }
.mk-c-HOGAR { --mk-tinte: var(--mk-azul); }
.mk-c-CLASES { --mk-tinte: var(--mk-violeta); }
.mk-c-MASCOTAS { --mk-tinte: var(--green); }
.mk-c-TRANSPORTE { --mk-tinte: var(--mk-cielo); }
.mk-c-VENTAS { --mk-tinte: var(--accent); }
.mk-c-OTRO { --mk-tinte: var(--text-2); }

/* ── Ancho ───────────────────────────────────────────────────────────────
   El portal es una columna de 480 px. Las pantallas del mercado, que son de
   fotos, se ensanchan mientras están a la vista en una pantalla grande:
   la portada y la publicación (`mk-ancha-desde-700`) a 3 columnas de tarjetas
   desde 700 px y a 4 desde 1000 px. Vender y «Tus publicaciones»
   (`mk-ancha-desde-1000`) son un formulario y una lista de texto: en una
   tableta se quedan en la columna de siempre, con su encabezado alineado, y
   solo se ensanchan (el formulario con su vista previa a un lado, la lista a
   dos columnas) desde 1000 px. */
@media (min-width: 700px) {
  .app:has(> .views > .mk-ancha-desde-700:not([hidden])) { max-width: 760px; }
}
@media (min-width: 1000px) {
  .app:has(> .views > .mk-ancha-desde-700:not([hidden])),
  .app:has(> .views > .mk-ancha-desde-1000:not([hidden])) { max-width: 1040px; }
}

/* ── La foto de una publicación ──────────────────────────────────────────
   Debajo va siempre el tinte y el icono de la categoría: es lo que se ve
   cuando no hay foto, mientras carga o si la imagen falla. */
.mk-foto { position: relative; display: block; overflow: hidden; background: var(--surface-2); color: var(--mk-tinte, var(--accent)); }
.mk-foto::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, currentColor, transparent 130%); opacity: 0.3; }
.mk-foto > .ic { position: absolute; inset: 0; margin: auto; font-size: 40px; }
.mk-foto > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ── La tarjeta: foto cuadrada, precio, título y dónde ───────────────────── */
.mk-card { display: flex; flex-direction: column; min-width: 0; padding: 0; border: 0; background: none; color: var(--text); font: inherit; text-align: left; }
.mk-card-foto { width: 100%; aspect-ratio: 1 / 1; border-radius: 14px; }
.mk-card:active .mk-card-foto { opacity: 0.85; }
.mk-precio { display: block; margin-top: 8px; font-size: 16px; font-weight: 700; line-height: 1.25; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-titulo { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin-top: 2px; min-height: 2.6em; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.mk-donde { display: block; margin-top: 3px; font-size: 12px; line-height: 1.3; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* En la vista previa de vender, lo que todavía no se escribió va como un ejemplo, no como un dato. */
.mk-ejemplo { color: var(--text-2); font-weight: 400; }
.mk-tuya { position: absolute; left: 8px; top: 8px; padding: 3px 9px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border-2); color: var(--text); font-size: 12px; font-weight: 600; line-height: 1.3; }
.mk-card-vista { pointer-events: none; }

.mk-rejilla { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
@media (min-width: 700px) { .mk-rejilla { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 16px; } }
@media (min-width: 1000px) { .mk-rejilla { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ── Cargando: bloques del tamaño final ──────────────────────────────────── */
.mk-sk { pointer-events: none; }
.mk-sk-foto { display: block; width: 100%; aspect-ratio: 1 / 1; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); animation: r2-pulso 1.2s ease-in-out infinite; }
.mk-sk-linea { display: block; height: 12px; margin-top: 10px; border-radius: 6px; background: var(--surface-3); animation: r2-pulso 1.2s ease-in-out infinite; }
.mk-sk-corta { width: 42%; }
.mk-sk-media { width: 72%; }
.mk-sk-columna { flex: 1; min-width: 0; }
.mk-sk-propia { display: flex; gap: 12px; align-items: center; }
.mk-sk-propia .mk-sk-foto { flex: 0 0 88px; width: 88px; height: 88px; aspect-ratio: auto; }
.mk-sk-detalle { padding: 0 20px 20px; }
.mk-sk-hero { margin: 0 -20px; width: calc(100% + 40px); aspect-ratio: 4 / 3; border-radius: 0; border-left: 0; border-right: 0; }
.mk-sk-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mk-sk-form .mk-sk-linea { grid-column: 1 / -1; height: 52px; margin-top: 8px; border-radius: 12px; }
@media (prefers-reduced-motion: reduce) { .mk-sk-foto, .mk-sk-linea { animation: none; } }

/* ── Estados vacío y fallo ───────────────────────────────────────────────── */
.mk-zona .link, #mkd-cuerpo .link, #ini-mercado .sect button { min-height: 44px; }
.mk-vacio-btn { width: auto; margin-top: 16px; padding: 0 20px; }

/* ═══════════════════════════════════════════════════════════════════
   LA PORTADA
   ═══════════════════════════════════════════════════════════════════ */
.mk-cab { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.mk-cab h1 { min-width: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.4px; line-height: 1.25; }

.mk-buscar { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 4px 0 14px; margin-bottom: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border-2); color: var(--text-2); transition: border-color var(--transition); }
.mk-buscar:focus-within { border-color: var(--accent); }
.mk-buscar > .ic { font-size: 18px; }
.mk-buscar input { flex: 1; min-width: 0; height: 44px; padding: 0; border: none; background: none; color: var(--text); font-size: 16px; outline: none; -webkit-appearance: none; appearance: none; }
.mk-buscar input::placeholder { color: var(--text-2); }
.mk-buscar input, .mk-buscar input::placeholder { text-overflow: ellipsis; }   /* en 320 px el ejemplo no cabe: termina en «…», no cortado a la mitad */
.mk-q-borrar { width: 44px; height: 44px; border: none; background: none; color: var(--text-2); font-size: 16px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* Vender, a la derecha del título: compacto, como un botón más del encabezado. */
.mk-cab .mk-vender { width: auto; min-height: 44px; margin-left: auto; padding: 0 14px; border-radius: 12px; box-shadow: none; font-size: 14px; flex-shrink: 0; }
.mk-cab .mk-vender .ic { font-size: 16px; }

/* El buscador y, a su lado, las tres rayas: las categorías y «Tus publicaciones» en un menú. */
.mk-barra { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.mk-barra .mk-buscar { flex: 1; min-width: 0; margin-bottom: 0; }
.mk-filtros { position: relative; flex-shrink: 0; }
.mk-filtros[hidden] { display: none; }
.mk-filtro-boton {
  position: relative; width: 52px; height: 52px; border-radius: 14px; border: 1px solid var(--border-2);
  background: var(--surface); color: var(--text-2); display: flex; align-items: center; justify-content: center;
}
.mk-filtro-boton .ic { font-size: 20px; }
.mk-filtro-boton[aria-expanded="true"] { border-color: var(--accent); color: var(--text); }
/* Con una categoría elegida, un punto del acento en la esquina. */
.mk-filtro-boton.activo::after {
  content: ''; position: absolute; top: 10px; right: 10px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 2px var(--surface);
}
.mk-pastillas {
  position: absolute; z-index: 30; top: calc(100% + 6px); right: 0; width: 240px; max-height: min(60vh, 440px); overflow-y: auto;
  padding: 6px; display: flex; flex-direction: column; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 14px; box-shadow: var(--shadow);
}
.mk-pastillas[hidden] { display: none; }
.mk-pastilla {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border: none; border-radius: 10px;
  background: none; color: var(--text); font-size: 15px; font-weight: 500; text-align: left; white-space: nowrap;
}
.mk-pastilla span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.mk-pastilla .ic { font-size: 17px; color: var(--text-2); flex-shrink: 0; }
.mk-pastilla .ic:last-child:not(:first-child) { visibility: hidden; color: var(--accent); }   /* la marca de la elegida */
.mk-pastilla[aria-pressed="true"] { background: var(--accent-dim); font-weight: 600; }
.mk-pastilla[aria-pressed="true"] .ic:last-child { visibility: visible; }
.mk-pastilla:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.mk-pastillas-raya { height: 1px; margin: 4px 6px; background: var(--border-2); }

.mk-conteo { margin: 6px 0 14px; font-size: 13px; color: var(--text-2); }

/* ═══════════════════════════════════════════════════════════════════
   LA PUBLICACIÓN
   La foto va de borde a borde en el teléfono y, en una pantalla grande, a la
   izquierda con el texto a su lado.
   ═══════════════════════════════════════════════════════════════════ */
.mk-detalle { padding: 0 0 24px; }
.mk-barra-vacia { padding: calc(env(safe-area-inset-top, 0px) + 20px) 20px 16px; }
.mk-d-aviso { margin: 20px; }

.mk-galeria { position: relative; aspect-ratio: 4 / 3; background: var(--bg-2); overflow: hidden; }
.mk-pista { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.mk-pista::-webkit-scrollbar { display: none; }
.mk-lamina { flex: 0 0 100%; height: 100%; padding: 0; border: 0; background: none; display: block; scroll-snap-align: start; }
.mk-lamina-foto, .mk-galeria-vacia { width: 100%; height: 100%; }
.mk-galeria-vacia > .ic { font-size: 64px; }
.mk-d-volver { position: absolute; left: 16px; top: calc(env(safe-area-inset-top, 0px) + 16px); background: var(--surface); box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3); }
/* Sobre la foto: blanco con velo negro, en los dos temas, para que se lea con cualquier foto. */
.mk-contador { position: absolute; right: 14px; bottom: 14px; padding: 4px 11px; border-radius: 999px; background: rgba(0, 0, 0, 0.62); color: #fff; font-family: var(--mono); font-size: 12px; font-weight: 500; line-height: 1.4; pointer-events: none; }
.mk-puntos { position: absolute; left: 0; right: 0; bottom: 20px; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.mk-puntos span { width: 6px; height: 6px; border-radius: 6px; background: #fff; opacity: 0.55; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25); transition: width var(--transition), opacity var(--transition); }
.mk-puntos span.on { width: 18px; opacity: 1; }
/* Con ratón no hay dedo con que deslizar: flechas. Con el dedo no hacen falta. */
.mk-flecha { position: absolute; top: 50%; width: 44px; height: 44px; margin-top: -22px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.58); color: #fff; display: none; align-items: center; justify-content: center; font-size: 20px; }
.mk-flecha-ant { left: 12px; }
.mk-flecha-ant .ic { transform: rotate(180deg); }
.mk-flecha-sig { right: 12px; }
@media (hover: hover) and (pointer: fine) { .mk-flecha { display: flex; } }

.mk-info { padding: 16px 20px 0; }
.mk-d-precio { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; line-height: 1.2; }
.mk-d-titulo { margin-top: 4px; font-size: 20px; font-weight: 600; letter-spacing: -0.3px; line-height: 1.3; overflow-wrap: anywhere; }
.mk-d-meta { margin-top: 6px; font-size: 13px; line-height: 1.4; color: var(--text-2); }

/* El botón principal y, al lado, las acciones redondas con su rótulo. Si no caben en un renglón,
   las redondas pasan JUNTAS debajo del principal (un grupo, no una por una). */
.mk-acciones { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 10px; margin-top: 16px; }
.mk-principal { flex: 1 1 150px; width: auto; min-width: 0; min-height: 52px; padding: 0 14px; white-space: nowrap; text-align: center; }
.mk-principal .ic { font-size: 18px; }
.mk-redondos { display: flex; flex: 1 0 auto; justify-content: space-between; gap: 4px; }
.mk-redondo { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 58px; padding: 0; border: 0; background: none; color: var(--text); font-size: 12px; font-weight: 500; line-height: 1.2; text-decoration: none; }
.mk-redondo-ic { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border-2); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.mk-sin-contacto, .mk-propia-nota { flex: 1 1 100%; }
.mk-propia-nota { margin-top: 10px; }

.mk-bloque { margin-top: 24px; }
.mk-bloque h2, .mk-seccion h2 { margin-bottom: 8px; font-size: 16px; font-weight: 600; letter-spacing: -0.2px; line-height: 1.3; overflow-wrap: anywhere; }
.mk-d-desc { font-size: 15px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }

.mk-datos { border-radius: 14px; border: 1px solid var(--border); background: var(--surface); }
.mk-dato { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.mk-dato:last-child { border-bottom: 0; }
.mk-dato .ic { margin-top: 1px; font-size: 18px; color: var(--text-2); }
.mk-dato-rotulo { flex: 0 0 72px; padding-top: 1px; font-size: 13px; color: var(--text-2); }
.mk-dato-valor { flex: 1; min-width: 0; font-size: 14.5px; line-height: 1.4; overflow-wrap: anywhere; }

.mk-vendedor { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); }
.mk-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--accent-dim); color: var(--text); display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 600; flex-shrink: 0; }
.mk-vendedor-datos { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mk-vendedor-n { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.mk-vendedor-c { font-size: 13px; color: var(--text-2); }
.mk-vendedor-nota { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.mk-vendedor-nota .ic { font-size: 14px; color: var(--green); }

.mk-seccion { margin: 32px 20px 0; }

@media (min-width: 700px) {
  .mk-detalle { padding: 20px 20px 32px; }
  .mk-barra-vacia { padding: 0 0 16px; }
  .mk-d-aviso { margin: 20px 0 0; }
  .mk-pub { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
  .mk-galeria { aspect-ratio: 1 / 1; border-radius: 18px; }
  .mk-info { padding: 0; }
  .mk-seccion { margin: 40px 0 0; }
}

/* ═══════════════════════════════════════════════════════════════════
   LAS FOTOS EN GRANDE
   ═══════════════════════════════════════════════════════════════════ */
.mk-visor { position: fixed; inset: 0; z-index: 55; display: flex; flex-direction: column; background: rgba(0, 0, 0, 1); /* negro pleno: la publicación de atrás no se transparenta */ }
.mk-visor-barra { display: flex; align-items: center; justify-content: space-between; padding: calc(env(safe-area-inset-top, 0px) + 8px) 12px 8px 20px; }
.mk-visor-cuenta { font-family: var(--mono); font-size: 13px; color: #fff; }
.mk-visor-cerrar { width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.16); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.mk-visor-pista { flex: 1; min-height: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.mk-visor-pista::-webkit-scrollbar { display: none; }
.mk-visor-lamina { flex: 0 0 100%; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 8px 8px calc(env(safe-area-inset-bottom, 0px) + 16px); scroll-snap-align: center; }
.mk-visor-lamina img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }

/* ═══════════════════════════════════════════════════════════════════
   VENDER
   ═══════════════════════════════════════════════════════════════════ */
.mk-form { max-width: 560px; margin: 0 auto; width: 100%; }
.mk-campo { margin-bottom: 16px; }
.mk-campo .input::placeholder, .mk-monto input::placeholder { color: var(--text-2); }
.input[aria-invalid="true"], .mk-monto:has(input[aria-invalid="true"]) { border-color: var(--red); }
.mk-error { margin: 6px 0 0; font-size: 13px; line-height: 1.4; color: var(--red); }
.mk-error:empty { display: none; }
.mk-select { padding-right: 44px; background-image: var(--mk-flecha); background-repeat: no-repeat; background-position: right 14px center; background-size: 16px; }
textarea.mk-texto { min-height: 96px; max-height: 50vh; overflow-y: auto; font-size: 16px; line-height: 1.4; }
.mk-campo .ayuda-fila { margin: 6px 0 0; }
.mk-cuenta { white-space: nowrap; flex-shrink: 0; }
.mk-lleno { color: var(--red); }

/* Las fotos primero: un mosaico grande «Agregar fotos» y, con fotos, sus miniaturas. */
.mk-fotos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mk-agregar { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; aspect-ratio: 1 / 1; padding: 8px; border-radius: 14px; border: 1.5px dashed var(--border-2); background: var(--surface); color: var(--text); text-align: center; }
.mk-agregar .ic { font-size: 26px; color: var(--accent); }
.mk-agregar b { font-size: 14px; font-weight: 600; line-height: 1.2; }
.mk-agregar small { font-size: 12px; line-height: 1.3; color: var(--text-2); }
.mk-agregar-grande { grid-column: 1 / -1; aspect-ratio: auto; min-height: 168px; padding: 20px; }
.mk-agregar-grande .ic { font-size: 40px; }
.mk-agregar-grande b { font-size: 16px; }
.mk-miniatura { position: relative; aspect-ratio: 1 / 1; border-radius: 14px; overflow: hidden; background: var(--surface-2); color: var(--mk-tinte, var(--accent)); }
.mk-miniatura > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mk-miniatura > .ic { position: absolute; inset: 0; margin: auto; font-size: 26px; }
.mk-leyendo { display: flex; align-items: center; justify-content: center; border: 1px dashed var(--border-2); }
.mk-portada { position: absolute; left: 6px; bottom: 6px; padding: 2px 9px; border-radius: 999px; background: rgba(0, 0, 0, 0.62); color: #fff; font-size: 12px; font-weight: 600; line-height: 1.5; }
.mk-quitar { position: absolute; top: 0; right: 0; width: 44px; height: 44px; padding: 7px; border: 0; background: none; display: flex; align-items: flex-start; justify-content: flex-end; }
.mk-quitar i { width: 28px; height: 28px; border-radius: 50%; background: rgba(0, 0, 0, 0.66); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; font-style: normal; }

/* El precio: su tipo y, debajo, el monto. */
.mk-tipos { margin-bottom: 10px; }
.mk-monto { display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text-2); font-family: var(--mono); font-size: 16px; transition: border-color var(--transition); }
.mk-monto:focus-within { border-color: var(--accent); }
.mk-monto input { flex: 1; min-width: 0; height: 48px; padding: 0; border: none; background: none; outline: none; color: var(--text); font-family: var(--mono); font-size: 16px; -webkit-appearance: none; appearance: none; }

.row.mk-fila { min-height: 60px; }
.mk-fila .row-title { display: block; font-size: 14.5px; white-space: normal; }
.mk-fila .row-sub { display: block; overflow-wrap: anywhere; }
.mk-contacto { margin: 20px 0 4px; }
.mk-contacto-ayuda { margin: -4px 0 12px; }

/* La vista previa: la tarjeta como se verá, con el botón de publicar debajo. */
.mk-previa { margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--border); }
.mk-previa h2 { margin-bottom: 12px; font-size: 16px; font-weight: 600; letter-spacing: -0.2px; }
/* La tarjeta de la vista previa mide lo mismo que una de la rejilla: 168 px con dos columnas, 232 con tres y 238 con cuatro. */
.mk-previa-fila { display: grid; grid-template-columns: minmax(0, 168px) minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 16px; }
@media (min-width: 700px) { .mk-previa-fila { grid-template-columns: minmax(0, 232px) minmax(0, 1fr); } }
.mk-previa-fila .nota { padding-top: 2px; }
.mk-envio-error { margin-top: 0; }
.mk-nota-revision { margin-top: 10px; text-align: center; }
.mk-bloqueo { margin-bottom: 14px; }
.mk-bloqueo-texto { min-width: 0; }

@media (min-width: 1000px) {
  .mk-form { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; max-width: none; align-items: start; }
  .mk-campos { max-width: 600px; }
  .mk-previa { position: sticky; top: 8px; margin-top: 0; padding-top: 0; border-top: 0; }
  .mk-previa-fila { grid-template-columns: minmax(0, 238px); }
}

/* ═══════════════════════════════════════════════════════════════════
   TUS PUBLICACIONES
   ═══════════════════════════════════════════════════════════════════ */
#mkm-cuerpo { flex: 1 0 auto; display: flex; flex-direction: column; max-width: 640px; width: 100%; margin: 0 auto; }
.mk-propias { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
/* Con dos columnas, los botones de cada tarjeta van al pie y alineados con los de su vecina. */
.mk-propia { display: flex; flex-direction: column; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.mk-propia.mk-ocupada { opacity: 0.6; pointer-events: none; }
.mk-propia-top { display: flex; gap: 12px; width: 100%; padding: 0; border: 0; background: none; color: var(--text); font: inherit; text-align: left; }
.mk-propia-foto { flex: 0 0 88px; width: 88px; height: 88px; border-radius: 12px; }
.mk-propia-foto > .ic { font-size: 28px; }
.mk-propia-datos { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.mk-propia-t { font-size: 15px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-propia-p { font-size: 15px; font-weight: 700; line-height: 1.3; }
.mk-propia-d { font-size: 12.5px; line-height: 1.35; color: var(--text-2); }
/* El estado: un punto con el color de su tono y el nombre en tinta. */
.mk-estado { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; line-height: 1.3; color: var(--text); }
.mk-estado::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--text-2); flex-shrink: 0; }
.mk-estado.mk-ok::before { background: var(--green); }
.mk-estado.mk-aviso::before { background: var(--amber); }
.mk-estado.mk-mal::before { background: var(--red); }
.mk-motivo { margin-top: 10px; font-size: 13px; line-height: 1.4; color: var(--text-2); overflow-wrap: anywhere; }
.mk-motivo b { color: var(--text); font-weight: 600; }
/* Las acciones se reparten parejo: dos, tres, y cuatro en dos renglones de dos (desde 1000 px, con la lista a dos columnas, en uno de cuatro). */
.mk-propia-acciones { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: auto; padding-top: 12px; }
.mk-propia-acciones.mk-n1 { grid-template-columns: minmax(0, 1fr); }
.mk-propia-acciones.mk-n2, .mk-propia-acciones.mk-n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1000px) { .mk-propia-acciones.mk-n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.mk-acc { min-height: 44px; padding: 0 8px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text); font-size: 13.5px; font-weight: 600; line-height: 1; display: flex; align-items: center; justify-content: center; gap: 7px; }
.mk-acc .ic { font-size: 15px; }
.mk-acc-borrar .ic { color: var(--red); }
/* Tres botones en un teléfono muy angosto (320 px): el ícono y «Reanudar» no caben juntos y la palabra se cortaba. Queda la palabra. */
@media (max-width: 350px) { .mk-n3 .mk-acc .ic { display: none; } }
.mk-pie { padding-top: 14px; }
.mk-pie .btn .ic { font-size: 18px; }
.mk-pie-nota { text-align: center; }

/* En una pantalla grande el pie no se pega al fondo de la ventana: va justo después de la lista. */
@media (min-width: 700px) {
  .mk-pie.empuja { margin-top: 20px; }
}
/* Y desde 1000 px, con la lista a dos columnas, el botón no se estira de lado a lado. */
@media (min-width: 1000px) {
  #mkm-cuerpo { max-width: none; }
  .mk-propias { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mk-pie { max-width: 420px; width: 100%; margin-left: auto; margin-right: auto; }
}

/* ═══════════════════════════════════════════════════════════════════
   EN EL INICIO: una tira con lo más reciente
   ═══════════════════════════════════════════════════════════════════ */
/* `scroll-padding` cuenta el relleno de los lados: sin él, el ajuste al deslizar pega la primera tarjeta al borde. */
.mk-tira { display: flex; gap: 12px; margin: 0 -20px; padding: 0 20px 4px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding: 0 20px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.mk-tira::-webkit-scrollbar { display: none; }
.mk-tira::after { content: ''; flex: 0 0 8px; }
.mk-mini { flex: 0 0 148px; width: 148px; scroll-snap-align: start; }
.mk-mini .mk-precio { font-size: 15px; }
.mk-mini .mk-titulo { font-size: 13.5px; }
.mk-invita .row-title, .mk-invita .row-sub { display: block; white-space: normal; }
.mk-chev { display: flex; font-size: 16px; color: var(--text-2); flex-shrink: 0; }
