:root {
  --vino: #8e1b5e; --vino-osc: #6d1448; --oliva: #55610e; --oliva-clara: #a3ac1c;
  --crema: #fbf7f1; --blanco: #fff; --texto: #2b2326; --suave: #6f6468; --linea: #e8dfd6;
  --rojo: #b3261e; --ok: #2e7d32;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--crema); color: var(--texto);
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { padding-bottom: env(safe-area-inset-bottom); }
a { color: var(--vino); }
.barra { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  background: var(--vino); color: #fff; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); }
.marca { color: #fff; text-decoration: none; font: 600 20px Georgia, serif; }
.marca span { color: var(--oliva-clara); font-family: inherit; }
.enlace { background: none; border: 0; color: #fff; font-size: 15px; text-decoration: underline; padding: 6px; }
main { max-width: 640px; margin: 0 auto; padding: 16px; }
h1 { font: 600 24px Georgia, serif; margin: 6px 0 4px; color: var(--vino-osc); }
h2 { font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: var(--oliva); margin: 26px 0 8px; font-weight: 800; }
.cargando { color: var(--suave); }
.tarjeta { background: var(--blanco); border: 1px solid var(--linea); border-radius: 14px; padding: 14px; margin-bottom: 10px; }
input, select, textarea { width: 100%; font: inherit; padding: 12px; border: 1px solid #cfc3b8; border-radius: 10px; background: #fff; color: var(--texto); }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(142, 27, 94, .25); border-color: var(--vino); }
label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: 15px; }
.ayuda { font-size: 13px; color: var(--suave); margin-top: 4px; }
.salud { font-size: 13px; color: var(--rojo); font-weight: 600; margin-top: 4px; }
.boton { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 18px;
  border-radius: 12px; border: 0; font: 600 16px/1 inherit; font-family: inherit; cursor: pointer; text-decoration: none;
  background: var(--vino); color: #fff; }
.boton:active { transform: scale(.98); }
.boton.sec { background: #fff; color: var(--vino); border: 2px solid var(--vino); }
.boton.oliva { background: var(--oliva); }
.boton.peligro { background: #fff; color: var(--rojo); border: 2px solid var(--rojo); }
.boton.ancho { width: 100%; }
.boton:disabled { opacity: .6; }
.fila { display: flex; gap: 10px; flex-wrap: wrap; }
.fila > * { flex: 1 1 0; min-width: 0; }
.buscador { position: relative; }
.buscador input { padding-left: 42px; font-size: 18px; }
.buscador::before { content: "🔍"; position: absolute; left: 13px; top: 12px; font-size: 18px; }
.lista { list-style: none; margin: 0; padding: 0; }
.lista a { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-decoration: none; color: inherit;
  background: #fff; border: 1px solid var(--linea); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
.lista .nom { font-weight: 600; }
.lista .det { font-size: 14px; color: var(--suave); }
.chip { display: inline-block; font-size: 13px; padding: 3px 10px; border-radius: 999px; background: #f2e6ee; color: var(--vino-osc); white-space: nowrap; }
.chip.oliva { background: #eef0d6; color: var(--oliva); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { margin: 0; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid #cfc3b8;
  border-radius: 999px; padding: 8px 12px; }
.chips input { width: auto; }
.contacto { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.contacto .boton { padding: 0 6px; font-size: 15px; white-space: nowrap; }
.dato { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--linea); font-size: 15px; }
.dato:last-child { border-bottom: 0; }
.dato span:first-child { color: var(--suave); }
.dato span:last-child { text-align: right; overflow-wrap: anywhere; }
.compra { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--linea); }
.compra:last-child { border-bottom: 0; }
.compra .imp { font-weight: 700; white-space: nowrap; }
.x { background: none; border: 0; color: var(--suave); font-size: 20px; padding: 4px 8px; cursor: pointer; }
.vacio { color: var(--suave); font-size: 15px; }
.aviso { position: fixed; left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 20; max-width: 600px; margin: 0 auto;
  background: var(--texto); color: #fff; padding: 14px 16px; border-radius: 12px; font-size: 15px; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.aviso.error { background: var(--rojo); }
.login { max-width: 380px; margin: 40px auto; text-align: center; }
.login p { color: var(--suave); }
.pie { margin-top: 30px; text-align: center; }
.volver { display: inline-block; margin-bottom: 6px; text-decoration: none; font-weight: 600; }
@media (min-width: 560px) { .contacto { grid-template-columns: repeat(4, 1fr); } }
