body {
  min-height: 100svh;
  background:
    linear-gradient(141deg, #061322ed 18%, #0613229e 62%, #061322e8 100%),
    radial-gradient(ellipse at 65% 2%, #16406c, var(--ink) 67%);
  line-height: 1.5;
}
body.compact-screen {
  background:
    linear-gradient(90deg, #061322fa 4%, #061322b5 58%, #0613226b),
    url("portada/equipo.webp") center 30% / cover no-repeat,
    var(--ink);
}
main {
  width: min(100% - 2rem, 72rem);
  margin-inline: auto;
  padding-block: max(1rem, env(safe-area-inset-top)) max(1.5rem, env(safe-area-inset-bottom));
}
.barra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.5rem;
  margin-bottom: clamp(1rem, 4svh, 2.5rem);
  padding-bottom: .9rem;
  border-bottom: 1px solid #6888ad3d;
}
.barra img { display: block; width: clamp(4.3rem, 8vw, 6rem); height: auto; }
.barra a {
  color: var(--link);
  font-size: .9375rem;
  font-weight: 650;
  text-decoration: none;
  padding: .6rem .85rem;
  border: 1px solid #6486ab69;
  border-radius: .35rem;
  background: #0b2137b8;
}
.barra a:hover { background: var(--surface); }

.station {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
  grid-template-areas: "intro lens" "panel lens";
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid #466684;
  border-radius: .95rem;
  background: linear-gradient(153deg, #112f50, var(--navy) 67%);
  box-shadow: 0 1.6rem 4rem #02091380;
}
.station.compact {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "intro" "panel";
  width: min(100%, 31rem);
  margin: clamp(1rem, 7svh, 4rem) auto 0 0;
  background:
    linear-gradient(90deg, #9fc7ff, #487de7 32%, transparent 78%) top / 100% 2px no-repeat,
    linear-gradient(148deg, #133558, var(--navy) 63%);
}
.intro {
  grid-area: intro;
  min-width: 0;
  padding: clamp(1.1rem, 3.6vw, 2.5rem);
  padding-bottom: 0;
}
h1 {
  margin: 0 0 .6rem;
  font-size: clamp(2rem, 4.6vw, 3.45rem);
  font-weight: 740;
  line-height: .99;
  letter-spacing: -.052em;
  text-wrap: balance;
}
#instruction { margin: 0; max-width: 37ch; color: var(--muted); }
#progress {
  width: fit-content;
  margin: .75rem 0 .4rem;
  padding: .05rem 0 .16rem;
  border-bottom: 2px solid #77a9ff;
  color: #b8d4ff;
  font-size: .875rem;
  font-weight: 670;
}
[data-stage="camera"] #instruction, [data-stage="preview"] #instruction {
  min-height: 2.35em;
  color: var(--paper);
  font-size: clamp(1.12rem, 2.65vw, 1.6rem);
  font-weight: 650;
  line-height: 1.23;
}
.identity {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .45rem .65rem;
  margin-top: 1.05rem;
  padding: .62rem 0 .7rem;
  border-block: 1px solid #759abd56;
  color: #e5effa;
  font-weight: 650;
}
.identity strong {
  display: block;
  padding: .15rem .48rem;
  border: 1px solid #6c9bc277;
  border-radius: .25rem;
  background: #071c31;
  color: #d2e6ff;
  font: 650 .8125rem/1.5 ui-monospace, Consolas, monospace;
}
.lens {
  grid-area: lens;
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(23rem, 58svh, 36rem);
  overflow: hidden;
  border-left: 1px solid #66829e55;
  background: radial-gradient(ellipse at center, #102840, #030c17 78%);
}
.lens video, .lens img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.lens video { transform: scaleX(-1); }
.guide {
  position: relative;
  width: min(54%, 15rem);
  height: 59%;
  max-height: 20rem;
  pointer-events: none;
}
.guide i {
  position: absolute;
  width: clamp(1.35rem, 3vw, 2.4rem);
  height: clamp(1.35rem, 3vw, 2.4rem);
  border: solid #8ec2ff;
  border-width: 0;
  filter: drop-shadow(0 0 5px #00162d);
}
.guide i:nth-child(1) { top: 0; left: 0; border-width: 3px 0 0 3px; border-top-left-radius: .45rem; }
.guide i:nth-child(2) { top: 0; right: 0; border-width: 3px 3px 0 0; border-top-right-radius: .45rem; }
.guide i:nth-child(3) { bottom: 0; left: 0; border-width: 0 0 3px 3px; border-bottom-left-radius: .45rem; }
.guide i:nth-child(4) { bottom: 0; right: 0; border-width: 0 3px 3px 0; border-bottom-right-radius: .45rem; }
.turn-guide {
  position: absolute;
  top: 50%;
  right: .85rem;
  display: grid;
  place-items: center;
  width: clamp(2.4rem, 7vw, 3rem);
  aspect-ratio: 1;
  transform: translateY(-50%);
  border: 1px solid #94b9f7;
  border-radius: .65rem;
  background: #122f61;
  color: var(--paper);
}
.turn-guide[data-side="left"] { right: auto; left: .85rem; }
.turn-guide svg {
  width: 74%;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.turn-guide[data-side="left"] svg { transform: scaleX(-1); }
#lens-label {
  position: absolute;
  bottom: .85rem;
  padding: .28rem .7rem;
  border: 1px solid #77a9dc75;
  border-radius: .35rem;
  background: #061429eb;
  color: #ecf4ff;
  font-size: .875rem;
}
.panel { grid-area: panel; padding: clamp(1.15rem, 3.6vw, 2.5rem); }
label { display: block; font-weight: 650; margin-bottom: .4rem; }
button, input, select { font: inherit; }
input, select {
  width: 100%;
  min-height: 3.15rem;
  padding: .64rem .85rem;
  border: 1px solid #7396bd;
  border-radius: .48rem;
  background: #06192c;
  color: inherit;
}
#employee-number {
  font-size: 1.28rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: .1em;
}
.actions { display: grid; gap: .6rem; }
#check-type:not([hidden]) + .actions { margin-top: .85rem; }
#employee-lookup:not([hidden]) {
  display: grid;
  gap: .55rem;
}
#employee-lookup:not([hidden]) label { margin: 0; }
#employee-lookup:not([hidden]) ~ .actions { margin-top: .6rem; }
button {
  min-height: 3.13rem;
  padding: .65rem .9rem;
  border: 1px solid transparent;
  border-radius: .48rem;
  color: inherit;
  font-weight: 670;
  cursor: pointer;
}
button:disabled { opacity: .72; cursor: default; }
.secondary { border-color: #6688ae; background: #0a2139; }
.secondary:hover { background: #1c3d5f; }
.quiet {
  margin-top: .4rem;
  padding-inline: 0;
  color: #bbd1ea;
  background: transparent;
  font-size: .9rem;
}
#status {
  margin: .85rem 0 0;
  padding: .65rem .8rem;
  border-left: 2px solid #7caffe;
  background: #142f4c;
  color: #e0ecff;
  font-size: .9375rem;
}
#status[data-error] {
  border-color: #ffaaa4;
  background: #442a37;
  color: #ffe0dc;
}
#status:empty { display: none; }

body.confirmed {
  background:
    linear-gradient(115deg, #061322c2, #061322a0),
    url("portada/equipo.webp") center / cover no-repeat,
    var(--ink);
}
.confirmed .barra { justify-content: center; min-height: 5rem; border: 0; }
.confirmed .barra img { width: clamp(5rem, 11vw, 9rem); }
.confirmed .barra a { display: none; }
.receipt {
  color: var(--paper);
  width: min(100% - 2rem, 48rem);
  max-height: calc(100svh - 2rem);
  padding: 0;
  border: 1px solid #81a8ca;
  border-radius: .65rem;
  background: var(--ink);
  box-shadow: 0 1.75rem 5rem #01060abd;
}
.receipt::backdrop { background: #020a1570; }
.receipt-layout {
  display: grid;
  grid-template-columns: clamp(3.9rem, 15vw, 10rem) minmax(0, 1fr);
}
.success-rail {
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(133deg, #b7edcb11 0 1px, transparent 1px 4px),
    linear-gradient(160deg, var(--green) 12%, var(--green-deep) 100%);
  border-right: 1px solid #7ee2b972;
}
.success-mark {
  width: clamp(.95rem, 4vw, 2.5rem);
  height: clamp(1.8rem, 7.2vw, 4rem);
  margin-top: -.75rem;
  border: solid white;
  border-width: 0 clamp(4px, .8vw, 9px) clamp(4px, .8vw, 9px) 0;
  transform: rotate(42deg);
}
.receipt-copy {
  padding: clamp(1.12rem, 4.5vw, 2.8rem);
  background:
    linear-gradient(110deg, #233d57 0%, transparent 58%) top / 100% 1px no-repeat,
    linear-gradient(140deg, #102944, var(--ink) 79%);
}
.receipt h2 {
  margin: 0;
  font-size: clamp(1.6rem, 4.3vw, 3.1rem);
  font-weight: 730;
  line-height: 1.04;
  letter-spacing: -.04em;
}
.receipt h2:focus { outline: none; }
#receipt-identity { margin-top: clamp(.8rem, 2.5vw, 1.35rem); }
#receipt-name, #receipt-number { margin: 0; }
#receipt-name { font-size: clamp(1.04rem, 2.6vw, 1.64rem); font-weight: 650; line-height: 1.25; }
#receipt-number { margin-top: .25rem; color: var(--muted); font-size: clamp(.9rem, 1.8vw, 1.2rem); }
#receipt-time {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: .45rem;
  margin: clamp(.6rem, 2vw, 1.05rem) 0 0;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  line-height: 1;
}
#receipt-hour { font-size: clamp(3.25rem, 14vw, 7rem); letter-spacing: -.065em; }
#receipt-period { font-size: clamp(1.12rem, 3vw, 2.4rem); white-space: nowrap; }
.receipt-done {
  display: block;
  width: min(100%, 28rem);
  min-height: 3rem;
  margin-top: clamp(1rem, 3vw, 1.65rem);
  padding: .61rem .95rem;
  border: 1px solid #849ebf;
  border-radius: .3rem;
  background: #1833507a;
  color: inherit;
  font-size: clamp(1rem, 1.9vw, 1.25rem);
  font-weight: 680;
  text-align: center;
  text-decoration: none;
}
.receipt-done:hover { background: var(--surface); }

@media (max-width: 46rem) and (orientation: portrait) {
  main { width: min(100% - 1.4rem, 34rem); }
  .barra { margin-inline: .25rem; margin-bottom: .9rem; }
  .station {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "intro" "lens" "panel";
    grid-template-rows: auto;
  }
  .station.compact { margin-inline: auto; }
  .intro { padding: 1.2rem 1.12rem .9rem; }
  .compact .intro { padding-bottom: 0; }
  .lens {
    min-height: clamp(12.5rem, 38svh, 23rem);
    border-left: 0;
    border-block: 1px solid #66829e55;
  }
  .guide { width: min(49%, 11rem); }
  [data-stage="camera"] .panel { padding-block: .75rem; }
  .confirmed .barra { padding-top: .7rem; }
  body.compact-screen {
    background-image: linear-gradient(165deg, #061322ce, #061322db 46%, var(--ink) 89%), url("portada/equipo-vertical.webp");
  }
  body.confirmed {
    background-image: linear-gradient(160deg, #061322a3, #061322ec 75%), url("portada/equipo-vertical.webp");
  }
}
@media (orientation: landscape) and (max-height: 34rem) {
  .barra img { width: 3.6rem; }
  .intro, .panel { padding: .9rem; }
  .lens { min-height: 15rem; }
  .station.compact { margin-top: 0; }
}
