:root {
  --green: #259e47; --green-dark: #1b7a36; --green-soft: #e8f5ec;
  --orange: #e8730c; --orange-dark: #c25e06;
  --ink: #1d2320; --muted: #5d6862; --line: #dfe5e1; --bg: #f4f6f5; --white: #fff; --red: #c62828; --amber: #b26a00;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { font: 18px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); -webkit-user-select: none; user-select: none; overscroll-behavior: none; }
button, input { font: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
p { margin: 0 0 .8em; }

.splash { min-height: 100vh; display: grid; place-items: center; background: var(--green); }
.splash img { width: 180px; }

/* gate screens (computer, browser tab) */
.gate { min-height: 100vh; display: grid; place-items: center; background: var(--green); padding: 24px; }
.gate-card { background: var(--white); border-radius: 20px; max-width: 440px; width: 100%; padding: 0 24px 28px; text-align: center; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,.18); }
.gate-logo { background: var(--green); margin: 0 -24px 18px; padding: 18px; }
.gate-logo img { height: 60px; }
.gate-icon { font-size: 56px; }
.gate h1 { font-size: 26px; }
.gate p { color: var(--muted); }
.steps { text-align: left; padding: 0; margin: 16px 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; margin: 0 0 14px; }
.steps li::before { content: counter(s); flex: 0 0 34px; height: 34px; border-radius: 50%; background: var(--green); color: #fff; font-weight: 700; display: grid; place-items: center; }
.kbd { display: inline; border: 1px solid var(--line); border-radius: 8px; padding: 0 6px; background: var(--bg); font-weight: 600; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.gate-card { overflow-wrap: anywhere; }
.share-ico { display: inline-block; width: 20px; height: 20px; vertical-align: -4px; }
.notice-box { background: var(--green-soft); border-radius: 12px; padding: 12px 14px; color: var(--green-dark); font-size: 16px; text-align: left; }
.warn-box { background: #fff4e5; color: var(--amber); border-radius: 12px; padding: 12px 14px; font-size: 16px; text-align: left; margin: 0 0 14px; }
.err-box { background: #fdecea; color: var(--red); border-radius: 12px; padding: 12px 14px; font-size: 16px; text-align: left; margin: 0 0 14px; }

/* app shell */
.app { min-height: 100vh; display: flex; flex-direction: column; padding-bottom: calc(72px + var(--safe-bottom)); }
.topbar { background: var(--green); color: #fff; padding: calc(10px + var(--safe-top)) 18px 12px; display: flex; align-items: center; gap: 12px; }
.topbar img { height: 34px; }
.topbar .who { margin-left: auto; text-align: right; font-size: 15px; line-height: 1.2; }
.topbar .who small { opacity: .85; display: block; }
.content { flex: 1; padding: 18px; max-width: 560px; width: 100%; margin: 0 auto; }

.clock { text-align: center; margin: 8px 0 4px; }
.clock .time { font-size: 56px; font-weight: 800; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.clock .date { color: var(--muted); }
.clock .time small { font-size: 22px; font-weight: 700; color: var(--muted); letter-spacing: 0; margin-left: 4px; }

.punch { display: block; width: 100%; border: 0; border-radius: 28px; color: #fff; font-size: 30px; font-weight: 800; padding: 44px 16px; margin: 22px 0 16px; box-shadow: 0 8px 22px rgba(0,0,0,.18); letter-spacing: .5px; }
.punch small { display: block; font-size: 17px; font-weight: 500; opacity: .9; margin-top: 6px; letter-spacing: 0; }
.punch.entrada { background: var(--green); }
.punch.entrada:active { background: var(--green-dark); }
.punch.salida { background: var(--orange); }
.punch.salida:active { background: var(--orange-dark); }
.punch:disabled { opacity: .7; }

.card { background: var(--white); border-radius: 16px; padding: 16px; margin: 0 0 14px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.card h3 { font-size: 18px; }
.today-list { list-style: none; margin: 0; padding: 0; }
.today-list li { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); }
.today-list li:first-child { border-top: 0; }
.pill { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 14px; font-weight: 700; }
.pill.entrada { background: var(--green-soft); color: var(--green-dark); }
.pill.salida { background: #fdeedd; color: var(--orange-dark); }
.pill.warn { background: #fff4e5; color: var(--amber); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 15px; }

.banner { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; background: #fff4e5; color: #6b4100; border-radius: 16px; padding: 14px 16px; margin: 0 0 14px; font-weight: 600; }
.banner .count { background: var(--orange); color: #fff; border-radius: 999px; min-width: 30px; height: 30px; display: grid; place-items: center; font-weight: 800; }

.field { display: block; margin: 0 0 14px; }
.field span { display: block; font-size: 15px; color: var(--muted); margin: 0 0 6px; font-weight: 600; }
.field input { width: 100%; border: 2px solid var(--line); border-radius: 14px; padding: 14px 16px; font-size: 20px; background: #fff; -webkit-user-select: text; user-select: text; }
.field input:focus { outline: none; border-color: var(--green); }
.btn { display: block; width: 100%; border: 0; border-radius: 16px; padding: 18px; font-size: 20px; font-weight: 800; background: var(--green); color: #fff; }
.btn:active { background: var(--green-dark); }
.btn.secondary { background: #fff; color: var(--ink); border: 2px solid var(--line); font-weight: 700; }
.btn.danger { background: #fff; color: var(--red); border: 2px solid #f3c7c3; }
.btn + .btn { margin-top: 12px; }
.btn:disabled { opacity: .6; }

.login-head { background: var(--green); color: #fff; text-align: center; padding: calc(40px + var(--safe-top)) 20px 34px; border-radius: 0 0 28px 28px; }
.login-head img { height: 70px; }
.login-head h1 { font-size: 24px; margin: 14px 0 0; }

.notice { width: 100%; text-align: left; border: 0; background: var(--white); border-radius: 16px; padding: 16px; margin: 0 0 12px; display: block; box-shadow: 0 1px 3px rgba(0,0,0,.06); color: var(--ink); }
.notice .t { font-weight: 800; font-size: 19px; display: block; margin: 4px 0; }
.notice.pending { border-left: 6px solid var(--orange); }
.notice-body { white-space: pre-wrap; font-size: 19px; -webkit-user-select: text; user-select: text; }
.ack-done { background: var(--green-soft); color: var(--green-dark); border-radius: 14px; padding: 14px; font-weight: 700; }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); display: flex; padding-bottom: var(--safe-bottom); z-index: 5; }
.tabs button { flex: 1; border: 0; background: none; padding: 10px 0 12px; font-size: 13px; color: var(--muted); font-weight: 600; position: relative; }
.tabs button .ico { display: block; font-size: 24px; line-height: 1.1; }
.tabs button.on { color: var(--green-dark); }
.tabs .badge { position: absolute; top: 4px; left: 50%; margin-left: 8px; background: var(--orange); color: #fff; border-radius: 999px; font-size: 12px; min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 5px; }

.overlay { position: fixed; inset: 0; background: rgba(20,30,25,.55); display: grid; place-items: center; z-index: 10; padding: 24px; }
.overlay .box { background: #fff; border-radius: 22px; padding: 26px 22px; text-align: center; max-width: 420px; width: 100%; }
.overlay .big { font-size: 60px; }
.overlay .when { font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums; }
.spinner { width: 54px; height: 54px; border-radius: 50%; border: 6px solid var(--green-soft); border-top-color: var(--green); animation: spin 1s linear infinite; margin: 8px auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.offline { background: var(--red); color: #fff; text-align: center; padding: 6px; font-size: 15px; font-weight: 600; }
