:root {
  --fondo: #f5f5f7;
  --superficie: #fff;
  --texto: #111827;
  --tenue: #6b7280;
  --borde: #e5e7eb;
  --primario: #111827;
  --ok: #16a34a;
  --aviso: #d97706;
  --error: #dc2626;
  --radio: 14px;
  color-scheme: light;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--fondo);
  color: var(--texto);
  -webkit-text-size-adjust: 100%;
}
h1 { font-size: 1.5rem; margin: .5rem 0; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
a { color: inherit; }
img { max-width: 100%; display: block; }
.tenue { color: var(--tenue); font-size: .9rem; }

.barra {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: .75rem 1rem; padding-top: max(.75rem, env(safe-area-inset-top));
  background: rgba(255,255,255,.9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--borde);
}
.barra form { margin: 0; }
.marca { font-weight: 700; text-decoration: none; }
.contenedor { max-width: 860px; margin: 0 auto; padding: 1rem; padding-bottom: max(2rem, env(safe-area-inset-bottom)); }

.tarjeta { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); padding: 1.25rem; margin: 0 0 1rem; }
.tarjeta-login { max-width: 420px; margin: 12vh auto 0; }

.boton {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: .6rem 1.1rem; border-radius: 999px;
  border: 1px solid var(--borde); background: var(--superficie); color: var(--texto);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.boton-primario { background: var(--primario); border-color: var(--primario); color: #fff; }
.boton-peligro { background: var(--error); border-color: var(--error); color: #fff; }
.boton-texto { border-color: transparent; background: transparent; color: var(--tenue); }
.boton:active { transform: scale(.98); }

.formulario { display: grid; gap: 1rem; }
.formulario label { display: grid; gap: .35rem; font-weight: 600; font-size: .95rem; }
input, select {
  width: 100%; min-height: 44px; padding: .6rem .8rem;
  border: 1px solid var(--borde); border-radius: 10px; font: inherit; background: #fff;
}
input:focus, select:focus { outline: 2px solid var(--primario); outline-offset: 1px; }
fieldset { border: 1px solid var(--borde); border-radius: 10px; display: grid; gap: 1rem; padding: 1rem; }

.alerta { padding: .8rem 1rem; border-radius: 10px; margin: 0 0 1rem; border: 1px solid; }
.alerta ul { margin: 0; padding-left: 1.1rem; }
.alerta-ok { background: #f0fdf4; border-color: #bbf7d0; }
.alerta-aviso { background: #fffbeb; border-color: #fde68a; }
.alerta-error { background: #fef2f2; border-color: #fecaca; }

.lista-pasos { padding-left: 1.1rem; color: var(--tenue); }
.estado { display: flex; align-items: center; gap: .5rem; margin: 0 0 .5rem; }
.punto { width: 10px; height: 10px; border-radius: 50%; background: var(--tenue); flex: none; }
.punto-ok { background: var(--ok); }
.punto-error { background: var(--error); }
.datos { display: grid; gap: .5rem; margin: 0 0 1rem; }
.datos div { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--borde); padding-bottom: .4rem; }
.datos dt { color: var(--tenue); }
.datos dd { margin: 0; text-align: right; }
.acciones { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-start; }
.acciones form { margin: 0; }
.confirmar summary { list-style: none; }
.confirmar summary::-webkit-details-marker { display: none; }
.confirmar[open] form { margin-top: .5rem; }

.perfil { display: flex; gap: 1rem; align-items: flex-start; }
.avatar { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; flex: none; }
.cifras { display: flex; gap: 1rem; margin: 0 0 .5rem; font-size: .95rem; }
.bio { white-space: pre-line; margin: 0 0 .5rem; }

.cuadricula { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.publicacion { position: relative; aspect-ratio: 1; background: var(--borde); overflow: hidden; }
.publicacion img { width: 100%; height: 100%; object-fit: cover; }
.publicacion.oculta img { opacity: .3; filter: grayscale(1); }
.sin-imagen { display: grid; place-items: center; height: 100%; color: var(--tenue); font-size: .8rem; }
.etiqueta { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: .7rem; padding: 2px 6px; border-radius: 6px; }
.publicacion form { position: absolute; left: 6px; bottom: 6px; margin: 0; }
.boton-visible { border: 0; border-radius: 999px; padding: 4px 10px; font: inherit; font-size: .75rem; font-weight: 600; background: rgba(255,255,255,.92); cursor: pointer; }

.encabezado { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.lista { list-style: none; padding: 0; margin: 0; }
.fila-cliente { display: grid; gap: .5rem; }
.fila-cliente a { display: grid; text-decoration: none; }
.tabla-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .5rem; border-bottom: 1px solid var(--borde); white-space: nowrap; }

@media (min-width: 640px) {
  .cuadricula { gap: 8px; }
  .publicacion { border-radius: 10px; }
  .fila-cliente { grid-template-columns: 1fr auto; align-items: center; }
}

textarea { width: 100%; padding: .6rem .8rem; border: 1px solid var(--borde); border-radius: 10px; font: inherit; resize: vertical; }
details > summary.boton { list-style: none; }
details > summary.boton::-webkit-details-marker { display: none; }
.formulario-sitio { margin-top: 1rem; }
.fila-color { display: grid; gap: .75rem; }
.fila-color input[type="color"] { width: 64px; padding: 2px; height: 44px; }
.casilla { display: flex !important; align-items: center; gap: .5rem; font-weight: 400 !important; }
.casilla input { width: auto; min-height: 0; }
.formulario-linea { margin: 0 0 .75rem; }
