html, body { min-height: 100%; background: #f3f5f9; color: #141a26; }
body.phone { -webkit-tap-highlight-color: transparent; }
.wrap { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: env(safe-area-inset-top) 0 calc(100px + env(safe-area-inset-bottom)); }
.appbar { padding: 18px 22px 14px; display: flex; align-items: center; gap: 12px; }
.logo { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, #2f6bff, #19b37b); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 17px; flex: none; }
.appbar .nm { font-size: 19px; font-weight: 700; }
.appbar .sub { font-size: 13px; color: #6b7487; margin-top: 2px; }
main { display: flex; flex-direction: column; flex: 1; }
.card { margin: 6px 18px; background: #fff; border-radius: 22px; padding: 22px; box-shadow: 0 6px 24px rgba(20,30,60,.07); }
.card h2 { font-size: 22px; }
.desc { font-size: 15px; color: #4b5466; line-height: 1.6; margin-top: 8px; }
.done, .idle { text-align: center; padding: 34px 22px 28px; }
.chk { width: 96px; height: 96px; border-radius: 50%; background: #19b37b; margin: 0 auto; display: grid; place-items: center; box-shadow: 0 10px 30px rgba(25,179,123,.35); }
.chk.lt { background: #f08a3c; box-shadow: 0 10px 30px rgba(240,138,60,.35); }
.chk.out { background: #4b6bd6; box-shadow: 0 10px 30px rgba(75,107,214,.35); }
.chk.bad { background: #d24545; box-shadow: 0 10px 30px rgba(210,69,69,.3); }
.chk.idle { background: #2f6bff; box-shadow: 0 10px 30px rgba(47,107,255,.3); }
.done h2, .idle h2 { font-size: 30px; margin-top: 20px; }
.done.err h2 { font-size: 25px; }
.done .tm { font-size: 46px; font-weight: 700; margin-top: 6px; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.tag { display: inline-block; margin-top: 12px; padding: 7px 16px; border-radius: 20px; background: #e5f7ef; color: #0f8a5c; font-weight: 700; font-size: 15px; }
.tag.late { background: #fff0e5; color: #c25a12; }
.tag.gray { background: #eef1f6; color: #4b5466; }
.who { margin-top: 14px; font-size: 14px; color: #6b7487; }
.pend { margin-top: 14px; font-size: 14px; background: #fff7e6; color: #8a5a00; border-radius: 12px; padding: 10px 12px; line-height: 1.5; }
.row { display: flex; justify-content: space-between; font-size: 15px; padding: 11px 0; border-top: 1px solid #eef0f4; }
.row:first-child { border-top: 0; }
.row span:first-child { color: #6b7487; }
.spacer { flex: 1; }
.scanbtn { position: fixed; left: 50%; transform: translateX(-50%); width: calc(100% - 36px); max-width: 444px; bottom: calc(24px + env(safe-area-inset-bottom)); height: 60px; border-radius: 18px; background: #2f6bff; color: #fff; font-size: 19px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 10px; box-shadow: 0 10px 24px rgba(47,107,255,.35); border: 0; z-index: 3; }
.scanbtn.ghost { background: #fff; color: #2f6bff; text-decoration: none; box-shadow: 0 6px 18px rgba(20,30,60,.1); }
.scanbtn:active { filter: brightness(.95); }
.reg label { display: block; font-size: 14px; color: #4b5466; margin-top: 16px; }
.reg select, .reg input { display: block; width: 100%; margin-top: 6px; height: 52px; border: 1px solid #d9dee8; border-radius: 14px; padding: 0 14px; font-size: 17px; background: #fff; color: #141a26; -webkit-appearance: none; appearance: none; }
.reg select { background-image: linear-gradient(45deg, transparent 50%, #6b7487 50%), linear-gradient(135deg, #6b7487 50%, transparent 50%); background-position: calc(100% - 22px) 23px, calc(100% - 16px) 23px; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
.reg input:focus, .reg select:focus { outline: 2px solid #2f6bff; border-color: transparent; }
.primary { display: block; width: 100%; margin-top: 22px; height: 56px; border: 0; border-radius: 16px; background: #2f6bff; color: #fff; font-size: 18px; font-weight: 700; text-align: center; line-height: 56px; text-decoration: none; }
.primary:disabled { opacity: .6; }
a.primary.link { width: auto; margin: 16px 18px; }
.notice { margin-top: 14px; font-size: 14px; background: #fdecec; color: #a12c2c; padding: 10px 12px; border-radius: 12px; line-height: 1.5; }
.notice.ok { background: #e5f7ef; color: #0f6e4a; }
.fine { font-size: 12px; color: #8a92a3; margin-top: 14px; line-height: 1.5; }
.spin { width: 56px; height: 56px; margin: 10px auto 0; border-radius: 50%; border: 5px solid #e2e7f0; border-top-color: #2f6bff; animation: sp 0.8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; top: calc(16px + env(safe-area-inset-top)); transform: translateX(-50%); background: #151b28; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 20; max-width: 90%; }

/* scanner */
.scanner { position: fixed; inset: 0; background: #000; z-index: 10; color: #fff; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.frame { position: absolute; left: 50%; top: 46%; width: 70vmin; height: 70vmin; max-width: 300px; max-height: 300px; transform: translate(-50%, -50%); border-radius: 18px; box-shadow: 0 0 0 200vmax rgba(0,0,0,.42); }
.frame i { position: absolute; width: 46px; height: 46px; border: 5px solid #fff; }
.frame i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-radius: 16px 0 0 0; }
.frame i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-radius: 0 16px 0 0; }
.frame i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 16px; }
.frame i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-radius: 0 0 16px 0; }
.frame.hit i { border-color: #19e39a; }
.scanhead { position: absolute; top: calc(30px + env(safe-area-inset-top)); left: 0; right: 0; text-align: center; font-size: 19px; font-weight: 700; text-shadow: 0 2px 8px rgba(0,0,0,.6); z-index: 2; }
.scanhead small { display: block; font-size: 14px; font-weight: 400; opacity: .85; margin-top: 4px; }
.scanfoot { position: absolute; left: 22px; right: 22px; bottom: calc(100px + env(safe-area-inset-bottom)); text-align: center; font-size: 16px; background: rgba(0,0,0,.55); padding: 14px; border-radius: 16px; z-index: 2; line-height: 1.5; }
.close { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(28px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.16); color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 14px; padding: 12px 34px; font-size: 16px; z-index: 2; }
