:root {
  --fondo: #f6f7fb;
  --superficie: #ffffff;
  --texto: #13193e;
  --suave: #5b6185;
  --borde: #e2e5f0;
  --marca: #4c63f6;
  --marca-fuerte: #3248d6;
  --ok: #0f7a4a;
  --error: #b42318;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #0d1029;
    --superficie: #161a3a;
    --texto: #eef0fb;
    --suave: #a6abcf;
    --borde: #2a2f5a;
    --marca: #7b8cff;
    --marca-fuerte: #9aa7ff;
    --ok: #4cc58c;
    --error: #ff8a80;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--marca); text-underline-offset: 0.15em; }
::selection { background: color-mix(in srgb, var(--marca) 28%, transparent); }
:focus-visible { outline: 2px solid var(--marca); outline-offset: 2px; }
.barra :focus-visible { outline-color: #fff; }
code { font: 0.9em ui-monospace, SFMono-Regular, Menlo, monospace; }
.barra {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  background: #13193e;
  color: #fff;
}
.marca { color: #fff; font-weight: 700; text-decoration: none; letter-spacing: 0.01em; }
.cuenta { display: flex; align-items: center; gap: 12px; font-size: 14px; color: #c9cdea; min-width: 0; }
.cuenta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cuenta form { margin: 0; }
.cuenta nav { display: flex; gap: 16px; }
.cuenta nav a { color: #fff; text-decoration: none; font-weight: 600; }
.cuenta nav a:hover { text-decoration: underline; }
.enlace { background: none; border: 0; color: #fff; font: inherit; text-decoration: underline; cursor: pointer; padding: 0; }
main { max-width: 1040px; margin: 0 auto; padding: 32px 24px 64px; }
h1 { font-size: 28px; line-height: 1.2; margin: 0; }
.titulo { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.bajada { color: var(--suave); margin: 8px 0 24px; max-width: 70ch; }
.boton {
  display: inline-block;
  background: var(--marca);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}
.boton:hover { background: var(--marca-fuerte); }
.chico {
  background: var(--superficie);
  color: var(--marca);
  border: 1px solid var(--borde);
  border-radius: 6px;
  padding: 4px 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
}
a.chico { text-decoration: none; display: inline-block; }
.chico:hover { border-color: var(--marca); }
h2 { font-size: 18px; margin: 40px 0 12px; }
.buscar {
  width: 100%;
  max-width: 420px;
  margin-bottom: 20px;
  padding: 10px 14px;
  border: 1px solid var(--borde);
  border-radius: 8px;
  background: var(--superficie);
  color: inherit;
  font: inherit;
}
.buscar:focus { outline: 2px solid var(--marca); outline-offset: -1px; }
.tarjetas { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.tarjeta {
  position: relative;
  display: grid;
  gap: 16px;
  align-content: space-between;
  min-height: 150px;
  padding: 20px;
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tarjeta:hover, .tarjeta:focus-within { border-color: var(--marca); box-shadow: 0 6px 20px rgb(19 25 62 / 0.08); }
.tarjeta[hidden] { display: none; }
.abrir { display: grid; gap: 6px; color: inherit; text-decoration: none; }
.abrir::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }
.abrir:focus-visible { outline: none; }
.tarjeta:has(.abrir:focus-visible) { outline: 2px solid var(--marca); outline-offset: 2px; }
.tarjeta-titulo { font-size: 18px; font-weight: 650; line-height: 1.3; }
.tarjeta-acciones { position: relative; z-index: 1; display: flex; gap: 8px; flex-wrap: wrap; }
.admins { list-style: none; margin: 0 0 20px; padding: 0; max-width: 560px; background: var(--superficie); border: 1px solid var(--borde); border-radius: 10px; }
.admins li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--borde); }
.admins li:last-child { border-bottom: 0; }
.admins span:first-child { overflow-wrap: anywhere; }
.admins form { margin: 0; }
.agregar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; max-width: 560px; }
.agregar label { font-weight: 600; width: 100%; }
.agregar input { flex: 1; min-width: 220px; padding: 10px 12px; border: 1px solid var(--borde); border-radius: 8px; background: var(--superficie); color: inherit; font: inherit; }
.visor { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.barra-visor { padding: 8px 16px; gap: 12px; flex-shrink: 0; }
.volver { color: #fff; text-decoration: none; font-weight: 600; white-space: nowrap; }
.volver:hover { text-decoration: underline; }
.barra-visor select {
  flex: 1;
  min-width: 0;
  max-width: 480px;
  padding: 6px 10px;
  border: 1px solid #3a4170;
  border-radius: 6px;
  background: #1e2452;
  color: #fff;
  font: inherit;
  font-size: 14px;
}
.acciones-visor { display: flex; gap: 8px; flex-shrink: 0; }
.aviso-version { margin: 0; padding: 8px 16px; background: #fff4d6; color: #5c4400; font-size: 14px; flex-shrink: 0; }
.marco { position: relative; flex: 1; min-height: 0; }
.marco iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.marca-agua { position: absolute; inset: 0; pointer-events: none; background-image: url(/marca-agua.svg); }
.lista { width: 100%; border-collapse: collapse; background: var(--superficie); border: 1px solid var(--borde); border-radius: 10px; overflow: hidden; }
.lista th { text-align: left; font-size: 13px; font-weight: 600; color: var(--suave); padding: 10px 16px; border-bottom: 1px solid var(--borde); }
.lista td { padding: 12px 16px; border-bottom: 1px solid var(--borde); vertical-align: middle; }
.lista tr:last-child td { border-bottom: 0; }
.lista td form { margin: 0; }
.marca-actual { margin-left: 6px; font-size: 12px; color: var(--ok); font-weight: 600; }
.nota { color: var(--suave); font-size: 13px; font-weight: 400; }
.vacio { padding: 32px; text-align: center; color: var(--suave); background: var(--superficie); border: 1px dashed var(--borde); border-radius: 10px; }
.ok { color: var(--ok); font-weight: 600; }
.error { color: var(--error); font-weight: 600; }
.subir { display: grid; gap: 20px; max-width: 560px; background: var(--superficie); border: 1px solid var(--borde); border-radius: 10px; padding: 24px; }
.subir label { display: grid; gap: 6px; font-weight: 600; }
.subir input { font: inherit; color: inherit; }
.subir input[type="file"] { font-weight: 400; font-size: 15px; color: var(--suave); }
.subir input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 8px 14px;
  border: 1px solid var(--marca);
  border-radius: 8px;
  background: var(--superficie);
  color: var(--marca);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.subir input[type="file"]::file-selector-button:hover { background: color-mix(in srgb, var(--marca) 8%, var(--superficie)); }
.subir input[name="nombre"] { border: 0; background: none; padding: 8px 10px 8px 0; flex: 1; min-width: 0; outline: none; }
.link { display: flex; align-items: center; border: 1px solid var(--borde); border-radius: 8px; padding-left: 10px; background: var(--fondo); }
.link:focus-within { border-color: var(--marca); }
.link > span { color: var(--suave); font: 15px ui-monospace, Menlo, monospace; }
.subir .boton { justify-self: start; }
.entrar { max-width: 420px; margin: 64px auto; text-align: center; display: grid; justify-items: center; gap: 4px; }
@media (max-width: 680px) {
  .barra, main { padding-left: 16px; padding-right: 16px; }
  .cuenta > span { display: none; }
  .barra-visor .chico[href] { display: none; }
  .lista thead { display: none; }
  .lista, .lista tbody, .lista tr, .lista td { display: block; width: 100%; }
  .lista tr { border-bottom: 1px solid var(--borde); padding: 8px 0; }
  .lista td { border: 0; padding: 4px 16px; }
  .lista td[data-c]::before { content: attr(data-c); display: block; font-size: 12px; color: var(--suave); }
}
