:root {
  color-scheme: dark;
  font: 16px/1.55 system-ui, sans-serif;
  background: #101719;
  color: #eef5f2;
  --acento: #a3edcf;
  --suave: #afc3bd;
  --borde: #334744;
  --superficie: #182426;
}

* { box-sizing: border-box; }
body { margin: 0; overflow-wrap: anywhere; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--acento); outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.6rem, 5vw, 2.2rem); letter-spacing: -.035em; line-height: 1.16; }
h2 { font-size: 1rem; font-weight: 650; }
button, input, textarea { font: inherit; color: inherit; }

.barra { border-bottom: 1px solid var(--borde); background: #131e20; }
.barra-interior {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  max-width: 70rem;
  margin: auto;
  padding: .5rem max(1rem, env(safe-area-inset-right)) .5rem max(1rem, env(safe-area-inset-left));
}
.marca { display: inline-flex; align-items: center; gap: .65rem; font-size: 1.2rem; font-weight: 700; }
.marca-punto { width: .65rem; height: .65rem; border-radius: 50%; background: var(--acento); }
main { max-width: 70rem; margin: auto; padding: 1.25rem max(1rem, env(safe-area-inset-right)) 2rem max(1rem, env(safe-area-inset-left)); }

button {
  min-height: 44px;
  border-radius: .6rem;
  border: 1px solid var(--borde);
  padding: .45rem .85rem;
  font-weight: 650;
  cursor: pointer;
}
.primario { background: var(--acento); color: #102722; border-color: transparent; }
.secundario { background: #202f31; }
button:disabled { opacity: .55; cursor: default; }

.tarjeta {
  min-width: 0;
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: .8rem;
  padding: 1rem;
}
.login { width: min(100%, 26rem); margin: clamp(1.5rem, 9vh, 6rem) auto 0; padding: 1.25rem; }
.login h1 { margin-bottom: .6rem; }
form { display: grid; gap: .75rem; }
.login form { margin-top: 1.25rem; }
label { font-weight: 650; }
input, textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border-radius: .5rem;
  border: 1px solid var(--borde);
  padding: .6rem .75rem;
  background: #101719;
}
textarea { resize: vertical; }
.aviso { color: #f4bdac; }
.login .aviso:not(:empty) { margin-top: .75rem; }
.detalle { color: var(--suave); font-size: .92rem; }
.detalle:empty, .aviso:empty { display: none; }
.destacado { font-weight: 650; }
.cabecera-mando, .cabecera-tarjeta, .acciones {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .6rem;
}
.cabecera-tarjeta { margin-bottom: .7rem; }
.origen {
  color: var(--suave);
  border: 1px solid var(--borde);
  border-radius: .4rem;
  padding: .05rem .45rem;
  font-size: .8rem;
}
.mando, .chat, .historial { display: grid; gap: .85rem; grid-template-columns: minmax(0, 1fr); }
.mando .cabecera-mando { grid-column: 1 / -1; }
.filas { list-style: none; margin: 0; padding: 0; }
.filas li + li { border-top: 1px solid var(--borde); margin-top: .5rem; padding-top: .5rem; }
.acciones { justify-content: flex-start; }
.tarjeta .acciones { margin-top: .7rem; }
.acciones + .detalle:not(:empty) { margin-top: .4rem; }
.estado-jarvis { display: flex; align-items: center; gap: .8rem; }
.orbe {
  width: 2.7rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #d5fff0, #6bc8b2 34%, #194341 75%);
  border: 1px solid #529b88;
}
progress { width: 100%; accent-color: var(--acento); }
.turno { display: grid; gap: .7rem; }
.pregunta { font-weight: 650; white-space: pre-wrap; }
.markdown { min-width: 0; }
.markdown > * { margin: .65rem 0; }
.markdown > :first-child { margin-top: 0; }
.markdown > :last-child { margin-bottom: 0; }
.markdown a { color: var(--acento); }
.markdown pre { overflow: auto; background: #101719; padding: .75rem; border-radius: .45rem; }
.markdown pre code { overflow-wrap: normal; }

@media (min-width: 44rem) {
  .mando { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 62rem) {
  .mando { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
