/* ============================================================
   Panel de fichajes (tablet primero) · Sistema de Fichajes
   ============================================================ */

/* ---------------------------------------------------------- cabecera */

.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  padding: 12px clamp(14px, 3.5vw, 38px);
  padding-top: max(12px, env(safe-area-inset-top));
  background: var(--band);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(0, 0, 0, .06));
  color: #fff; box-shadow: 0 6px 22px rgba(40, 31, 22, .3);
}
.top-logo { width: 56px; height: 56px; border-radius: 13px; flex: none; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .18); }
.top-id { min-width: 0; }
.top-id h1 { font-family: var(--f-display); font-size: 21px; font-weight: 700; letter-spacing: .01em; line-height: 1.2; }
.top-id .sub { font-size: 12.5px; color: rgba(255, 255, 255, .68); letter-spacing: .14em; text-transform: uppercase; font-weight: 500; margin-top: 2px; }
.top-clock { margin-left: auto; text-align: right; }
.top-clock .time { font-family: var(--f-mono); font-weight: 700; font-size: clamp(26px, 4.5vw, 38px); letter-spacing: .04em; line-height: 1; font-variant-numeric: tabular-nums; }
.top-clock .time small { font-size: .55em; opacity: .65; }
.top-clock .date { font-size: 12.5px; color: rgba(255, 255, 255, .72); margin-top: 4px; }
@media (max-width: 560px) {
  .top { gap: 12px; }
  .top-logo { width: 46px; height: 46px; border-radius: 11px; }
  .top-id h1 { font-size: 16.5px; }
  .top-id .sub { display: none; }
  .top-clock .date { display: none; }
}
@media (max-width: 360px) {
  .top { gap: 9px; padding-left: 12px; padding-right: 12px; }
  .top-logo { width: 42px; height: 42px; }
  .top-id h1 { font-size: 15px; }
  .top-clock .time { font-size: 22px; }
}

/* ---------------------------------------------------------- rejilla de trabajadores */

.board { max-width: 1280px; margin: 0 auto; padding: clamp(16px, 3vw, 30px) clamp(14px, 3.5vw, 38px) 90px; }
.board-bar { display: flex; align-items: baseline; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.board-bar h2 { font-family: var(--f-display); font-size: 19px; color: var(--brand-deep); }
.board-bar .working-now { font-size: 14px; color: var(--muted); }
.board-bar .working-now b { color: var(--green-deep); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 16px; }

.worker {
  position: relative; overflow: hidden; text-align: left; width: 100%;
  border: 1px solid var(--line); border-top-color: transparent; border-radius: 20px;
  background:
    radial-gradient(150px 84px at 100% 0%, rgba(255, 255, 255, .65), transparent 70%),
    linear-gradient(180deg, #FFFEFB, var(--card));
  padding: 16px 17px 15px; cursor: pointer;
  box-shadow: 0 1px 2px rgba(50, 42, 36, .05), 0 12px 24px -16px rgba(50, 42, 36, .55);
  display: flex; flex-direction: column; gap: 11px;
  transition: transform .16s ease, box-shadow .28s ease, border-color .3s;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
/* franja superior con el color propio de cada persona */
.worker::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--wc, var(--brand));
}
.worker:hover { box-shadow: 0 2px 4px rgba(50, 42, 36, .06), 0 18px 32px -18px rgba(50, 42, 36, .6); }
.worker:active { transform: scale(.97); }
.worker.is-on {
  border-color: var(--green-line); border-top-color: transparent;
  background:
    radial-gradient(170px 110px at 100% 0%, rgba(62, 116, 77, .12), transparent 72%),
    linear-gradient(180deg, #FCFEFB, #ECF5E8);
  box-shadow: 0 1px 2px rgba(46, 90, 59, .07), 0 18px 32px -16px rgba(46, 90, 59, .42);
}

/* halo suave detrás del avatar cuando la persona está trabajando */
.w-sheen { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .45s ease; }
.worker.is-on .w-sheen { opacity: 1; background: radial-gradient(96px 96px at 16% 18%, rgba(62, 116, 77, .14), transparent 72%); }

/* estado EN PAUSA: tema ámbar y contadores congelados */
.worker.is-on.is-paused {
  border-color: var(--gold-line);
  background:
    radial-gradient(170px 110px at 100% 0%, rgba(185, 138, 74, .14), transparent 72%),
    linear-gradient(180deg, #FFFDF8, #FBF1DD);
  box-shadow: 0 1px 2px rgba(138, 99, 38, .08), 0 18px 32px -16px rgba(138, 99, 38, .4);
}
.worker.is-on.is-paused .w-sheen { opacity: 1; background: radial-gradient(96px 96px at 16% 18%, rgba(185, 138, 74, .16), transparent 72%); }
.worker.is-on.is-paused .w-timer { color: var(--gold-deep); }
.worker.is-on.is-paused .w-status { background: var(--gold-soft); color: var(--gold-deep); box-shadow: inset 0 0 0 1px var(--gold-line); }
.worker.is-on.is-paused .w-status .dot { background: var(--gold-deep); box-shadow: none; animation: none; }

.w-head { display: flex; align-items: center; gap: 12px; }
.w-id { min-width: 0; flex: 1; }
.w-avatar {
  width: 54px; height: 54px; border-radius: 16px; flex: none;
  display: grid; place-items: center; color: #fff;
  font-family: var(--f-display); font-weight: 700; font-size: 20px;
  background: var(--wc, var(--brand));
  background-image: linear-gradient(145deg, rgba(255, 255, 255, .32), rgba(255, 255, 255, 0) 44%, rgba(0, 0, 0, .17));
  box-shadow: 0 6px 14px -5px var(--wc, var(--brand)), inset 0 1px 0 rgba(255, 255, 255, .3);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
.w-avatar.emoji {
  background: #fff; background-image: none; color: initial; font-size: 27px; text-shadow: none;
  box-shadow: 0 6px 14px -6px var(--wc, var(--brand)), inset 0 0 0 2px var(--wc, var(--brand));
}
.w-name {
  font-family: var(--f-display); font-weight: 700; font-size: 18px; line-height: 1.2; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.w-role { font-size: 12.5px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* estado en forma de chip */
.w-status {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 11px 4px 9px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .085em; text-transform: uppercase;
  background: #EFE8DC; color: var(--muted); box-shadow: inset 0 0 0 1px rgba(50, 42, 36, .05);
}
.w-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.worker.is-on .w-status { background: var(--green-soft); color: var(--green-deep); box-shadow: inset 0 0 0 1px var(--green-line); }
.worker.is-on .w-status .dot { background: var(--green); box-shadow: 0 0 0 3px rgba(62, 116, 77, .18); animation: dotPulse 1.6s ease-in-out infinite; }
@keyframes dotPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.4); opacity: .55; } }

.w-timer {
  font-family: var(--f-mono); font-weight: 700; font-variant-numeric: tabular-nums;
  font-size: 31px; letter-spacing: .01em; color: var(--green-deep); line-height: 1.02;
}
.w-timer.off { color: var(--faint); font-size: 19px; font-weight: 600; }

.w-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: auto; }
.w-sub { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 0; line-height: 1.35; }
.w-sub b { color: var(--ink); font-weight: 700; }

.w-action {
  flex: none; width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(158deg, #4C8A5E, var(--green-deep));
  box-shadow: 0 7px 15px -5px rgba(62, 116, 77, .6), inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .15s ease, background .3s, box-shadow .3s;
}
.w-action svg { width: 18px; height: 18px; }
.w-action.act-start svg, .w-action.act-resume svg { margin-left: 2px; } /* centra ópticamente el triángulo de play */
/* botón de pausar (en turno): ámbar */
.w-action.act-pause {
  background: linear-gradient(158deg, var(--gold), var(--gold-deep));
  box-shadow: 0 7px 15px -5px rgba(185, 138, 74, .6), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.w-action[data-quick] { cursor: pointer; }
.w-action[data-quick]:active { transform: scale(.88); }

/* tarjeta recién cambiada */
.worker.flash { animation: cardFlash .9s ease; }
@keyframes cardFlash {
  0% { box-shadow: 0 0 0 0 rgba(185, 138, 74, .55); }
  100% { box-shadow: 0 0 0 22px rgba(185, 138, 74, 0); }
}

@media (max-width: 540px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 11px; }
  .worker { padding: 13px 13px 13px; gap: 9px; border-radius: 17px; }
  .w-head { gap: 10px; }
  .w-avatar { width: 44px; height: 44px; border-radius: 13px; font-size: 16px; }
  .w-avatar.emoji { font-size: 22px; }
  .w-name { font-size: 15px; }
  .w-role { font-size: 11.5px; }
  .w-status { font-size: 9.5px; padding: 3px 9px 3px 7px; }
  .w-timer { font-size: 25px; }
  .w-timer.off { font-size: 16px; }
  .w-sub { font-size: 11.5px; }
  .w-action { width: 38px; height: 38px; border-radius: 12px; }
  .w-action svg { width: 15px; height: 15px; }
}

/* estado vacío */
.empty {
  border: 2.5px dashed var(--line); border-radius: 22px; padding: 54px 26px; text-align: center;
  color: var(--muted); grid-column: 1 / -1; background: rgba(253, 251, 246, .6);
}
.empty .e-ico { font-size: 40px; margin-bottom: 12px; }
.empty h3 { font-family: var(--f-display); font-size: 20px; color: var(--brand-deep); margin-bottom: 6px; }
.empty p { font-size: 15px; }

/* pie */
.panel-foot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px clamp(14px, 3.5vw, 38px);
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  font-size: 12px; color: var(--muted);
  background: linear-gradient(180deg, rgba(241, 235, 224, 0), rgba(241, 235, 224, .92) 38%);
  pointer-events: none;
}
.panel-foot > * { pointer-events: auto; }
.sync { display: inline-flex; align-items: center; gap: 7px; }
.sync .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.sync.bad .dot { background: var(--red); animation: dotPulse 1s infinite; }
.mute-btn {
  display: inline-flex; align-items: center; gap: 7px; border: 1.5px solid var(--line);
  background: var(--paper); color: var(--muted); border-radius: 999px; padding: 7px 14px;
  font-size: 12.5px; font-weight: 600; cursor: pointer; transition: transform .12s;
}
.mute-btn:active { transform: scale(.94); }
.mute-btn svg { width: 15px; height: 15px; }

.panel-foot { gap: 8px; }
.sync { min-width: 0; }
.sync > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foot-actions { display: inline-flex; align-items: center; gap: 9px; flex: none; }

/* botón «Instalar app» destacado en marrón corporativo */
.install-pill {
  background: var(--brand); color: #fff; border-color: var(--brand);
  box-shadow: 0 4px 12px rgba(106, 87, 73, .3);
}
.install-pill:active { transform: scale(.94); }
@media (max-width: 430px) {
  .install-pill span { display: none; }
  .install-pill { padding: 8px 11px; }
}

/* ============================================================
   INICIO · 3 botones (Administrador / Trabajador / Tablet)
   ============================================================ */

.home {
  min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 24px; padding: 30px 18px calc(22px + env(safe-area-inset-bottom));
}
.home-top { text-align: center; }
.home-logo { width: 78px; height: 78px; border-radius: 20px; margin: 0 auto 12px; box-shadow: 0 12px 30px rgba(50, 42, 36, .3); }
.home-top h1 { font-family: var(--f-display); font-size: 23px; font-weight: 700; color: var(--brand-deep); }
.home-clock {
  font-family: var(--f-mono); font-weight: 700; font-size: 40px; color: var(--brand-deep);
  letter-spacing: .03em; line-height: 1.1; margin-top: 8px; font-variant-numeric: tabular-nums;
}
.home-clock small { font-size: .5em; opacity: .55; }
.home-date { font-size: 13px; color: var(--muted); margin-top: 2px; }

.home-cards { width: min(460px, 100%); display: flex; flex-direction: column; gap: 14px; }
.home-card {
  display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; cursor: pointer;
  padding: 17px 18px; border-radius: 20px; background: var(--card); border: 1.5px solid var(--line);
  box-shadow: 0 2px 6px rgba(50, 42, 36, .06), 0 14px 26px -20px rgba(50, 42, 36, .6);
  transition: transform .14s ease, box-shadow .26s ease, border-color .3s;
  touch-action: manipulation;
}
.home-card:hover { box-shadow: 0 4px 10px rgba(50, 42, 36, .08), 0 18px 30px -18px rgba(50, 42, 36, .55); border-color: var(--faint); }
.home-card:active { transform: scale(.98); }
.hc-ico {
  width: 56px; height: 56px; border-radius: 17px; flex: none; display: grid; place-items: center; color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
}
.hc-ico svg { width: 27px; height: 27px; }
.hc-worker .hc-ico { background: linear-gradient(155deg, #4C8A5E, var(--green-deep)); box-shadow: 0 8px 16px -6px rgba(62, 116, 77, .6), inset 0 1px 0 rgba(255, 255, 255, .25); }
.hc-tablet .hc-ico { background: linear-gradient(155deg, #7E6A57, var(--brand-deep)); box-shadow: 0 8px 16px -6px rgba(106, 87, 73, .55), inset 0 1px 0 rgba(255, 255, 255, .25); }
.hc-admin .hc-ico { background: linear-gradient(155deg, var(--gold), var(--gold-deep)); box-shadow: 0 8px 16px -6px rgba(138, 99, 38, .55), inset 0 1px 0 rgba(255, 255, 255, .25); }
.hc-txt { flex: 1; min-width: 0; }
.hc-t { display: block; font-family: var(--f-display); font-size: 19px; font-weight: 700; color: var(--ink); }
.hc-s { display: block; font-size: 13.5px; color: var(--muted); margin-top: 3px; }
.hc-s b { color: var(--brand-deep); }
.hc-go { flex: none; color: var(--faint); }
.hc-go svg { width: 22px; height: 22px; }

.home-foot { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }

/* ============================================================
   SELECTOR DE TRABAJADOR · «¿Quién eres?»
   ============================================================ */

.pick { max-width: 1080px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column;
  padding: max(16px, env(safe-area-inset-top)) clamp(14px, 4vw, 30px) calc(24px + env(safe-area-inset-bottom)); }
.pick-top { display: flex; align-items: center; gap: 14px; margin: 8px 0 22px; }
.pick-back {
  flex: none; width: 46px; height: 46px; border-radius: 14px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--paper); border: 2px solid var(--line); color: var(--brand);
  transition: transform .12s, background .18s;
}
.pick-back:active { transform: scale(.92); }
.pick-back svg { width: 22px; height: 22px; transform: scaleX(-1); }
.pick-id h1 { font-family: var(--f-display); font-size: 24px; font-weight: 700; color: var(--brand-deep); }
.pick-id p { font-size: 14px; color: var(--muted); margin-top: 2px; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 14px; flex: 1; align-content: start; }
.pick-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center; padding: 20px 12px 15px; border-radius: 20px; cursor: pointer;
  background: linear-gradient(180deg, #FFFEFB, var(--card)); border: 1px solid var(--line); border-top-color: transparent;
  box-shadow: 0 1px 2px rgba(50, 42, 36, .05), 0 12px 24px -16px rgba(50, 42, 36, .55);
  transition: transform .14s ease, box-shadow .26s ease;
  touch-action: manipulation;
}
.pick-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--wc, var(--brand)); }
.pick-card:active { transform: scale(.96); }
.pick-card .big-avatar { width: 60px; height: 60px; font-size: 23px; border-radius: 18px; }
.pick-card .big-avatar.emoji { font-size: 31px; }
.pick-name { font-family: var(--f-display); font-weight: 700; font-size: 15.5px; line-height: 1.2; color: var(--ink); }
.pick-role { font-size: 12px; color: var(--muted); margin-top: -3px; }
.pick-pin {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 3px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px; background: #EFE8DC; color: var(--muted);
}
.pick-pin svg { width: 12px; height: 12px; }
.pick-pin.new { background: var(--gold-soft); color: var(--gold-deep); }

/* ============================================================
   VISTA PERSONAL DEL TRABAJADOR
   ============================================================ */

.wv { min-height: 100dvh; display: flex; flex-direction: column; }
.wv-top {
  display: flex; align-items: center; gap: 12px;
  padding: 12px clamp(14px, 4vw, 28px); padding-top: max(12px, env(safe-area-inset-top));
  background: var(--band); background-image: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(0, 0, 0, .06));
  color: #fff; box-shadow: 0 6px 22px rgba(40, 31, 22, .3);
}
.wv-home {
  flex: none; width: 44px; height: 44px; border-radius: 12px; cursor: pointer; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18);
  transition: transform .12s, background .18s;
}
.wv-home:active { transform: scale(.92); }
.wv-home svg { width: 21px; height: 21px; }
.wv-biz { flex: 1; min-width: 0; font-family: var(--f-display); font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wv-clock { font-family: var(--f-mono); font-weight: 700; font-size: 22px; letter-spacing: .03em; font-variant-numeric: tabular-nums; }
.wv-clock small { font-size: .55em; opacity: .65; }

.wv-main { flex: 1; display: grid; place-items: center; padding: clamp(18px, 4vw, 34px) 18px; }
.wv-card {
  position: relative; overflow: hidden; width: min(440px, 100%); text-align: center;
  padding: 32px 24px 26px; border-radius: 26px;
  background: radial-gradient(220px 120px at 100% 0%, rgba(255, 255, 255, .6), transparent 70%), linear-gradient(180deg, #FFFEFB, var(--card));
  border: 1px solid var(--line); border-top-color: transparent;
  box-shadow: 0 2px 6px rgba(50, 42, 36, .06), 0 26px 50px -28px rgba(50, 42, 36, .6);
}
.wv-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 5px; background: var(--wc, var(--brand)); }
.wv-card.is-on { border-color: var(--green-line); background: radial-gradient(220px 130px at 100% 0%, rgba(62, 116, 77, .12), transparent 72%), linear-gradient(180deg, #FCFEFB, #ECF5E8); }
.wv-card.is-on.is-paused { border-color: var(--gold-line); background: radial-gradient(220px 130px at 100% 0%, rgba(185, 138, 74, .14), transparent 72%), linear-gradient(180deg, #FFFDF8, #FBF1DD); }
.wv-name { font-family: var(--f-display); font-size: 25px; font-weight: 700; color: var(--ink); margin-top: 16px; line-height: 1.2; }
.wv-role { font-size: 14.5px; color: var(--muted); margin-top: 4px; }
.wv-status {
  display: inline-flex; align-items: center; gap: 8px; margin: 16px auto 0;
  padding: 5px 14px 5px 11px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .085em; text-transform: uppercase;
  background: #EFE8DC; color: var(--muted); box-shadow: inset 0 0 0 1px rgba(50, 42, 36, .05);
}
.wv-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.wv-card.is-on .wv-status { background: var(--green-soft); color: var(--green-deep); box-shadow: inset 0 0 0 1px var(--green-line); }
.wv-card.is-on .wv-status .dot { background: var(--green); box-shadow: 0 0 0 3px rgba(62, 116, 77, .18); animation: dotPulse 1.6s ease-in-out infinite; }
.wv-card.is-on.is-paused .wv-status { background: var(--gold-soft); color: var(--gold-deep); box-shadow: inset 0 0 0 1px var(--gold-line); }
.wv-card.is-on.is-paused .wv-status .dot { background: var(--gold-deep); box-shadow: none; animation: none; }
.wv-timer {
  font-family: var(--f-mono); font-weight: 700; font-variant-numeric: tabular-nums;
  font-size: clamp(46px, 14vw, 64px); line-height: 1; color: var(--green-deep); margin: 16px 0 8px;
}
.wv-card.is-on.is-paused .wv-timer { color: var(--gold-deep); }
.wv-timer.off { color: var(--faint); font-size: clamp(22px, 7vw, 30px); font-weight: 600; }
.wv-meta { font-size: 14.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.wv-meta b { color: var(--ink); }
.wv-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.wv-actions .btn { gap: 11px; }
.wv-xl { min-height: 62px; font-size: 19px; }
.wv-xl svg { width: 22px; height: 22px; }
.wv-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px clamp(14px, 4vw, 28px); padding-bottom: max(10px, env(safe-area-inset-bottom));
  font-size: 12px; color: var(--muted);
}

/* botón de inicio en la cabecera de la tablet */
.top-home {
  flex: none; width: 44px; height: 44px; border-radius: 12px; cursor: pointer; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18);
  transition: transform .12s, background .18s;
}
.top-home:active { transform: scale(.92); }
.top-home svg { width: 21px; height: 21px; }
@media (max-width: 360px) { .top-home { width: 40px; height: 40px; } }

/* ---------------------------------------------------------- pantalla de acceso */

.gate {
  min-height: 100dvh; display: grid; place-items: center;
  padding: 26px 16px calc(26px + env(safe-area-inset-bottom));
}
.gate-wrap { filter: drop-shadow(0 24px 50px rgba(40, 31, 22, .3)); width: min(430px, 100%); }
.gate-card {
  background: var(--paper); border-radius: 24px 24px 0 0; padding: 34px 28px 36px; text-align: center;
  -webkit-mask: radial-gradient(circle 9px at 11px calc(100% + 3px), transparent 9px, #000 9.5px) repeat-x;
  -webkit-mask-size: 22px 100%;
  mask: radial-gradient(circle 9px at 11px calc(100% + 3px), transparent 9px, #000 9.5px) repeat-x;
  mask-size: 22px 100%;
}
.gate-logo { width: 84px; height: 84px; border-radius: 19px; margin: 0 auto 18px; box-shadow: 0 10px 26px rgba(50, 42, 36, .3); }
.gate-card h1 { font-family: var(--f-display); font-size: 25px; font-weight: 700; color: var(--ink); }
.gate-card .gate-sub { color: var(--muted); font-size: 14.5px; margin: 8px 0 24px; line-height: 1.5; }
.gate-card form { text-align: left; }
.gate-attempts { margin-top: 14px; font-size: 13.5px; color: var(--muted); text-align: center; }
.gate-attempts b { color: var(--red-deep); }
.gate-foot { margin-top: 18px; font-size: 12px; color: var(--faint); text-align: center; letter-spacing: .04em; }
