* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { font-family: Rubik, system-ui, sans-serif; background: #faf6f0; color: #2b2622; overscroll-behavior-y: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

#app { height: 100dvh; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; position: relative; overflow: hidden; }
.scroll { flex: 1; overflow-y: auto; padding: env(safe-area-inset-top) 0 96px; }
.center-msg { flex: 1; display: grid; place-items: center; text-align: center; padding: 24px; color: #9a8b7c; }

.hdr { padding: 16px 20px 4px; display: flex; justify-content: space-between; align-items: end; gap: 10px; }
.hdr small { color: #9a8b7c; font-size: 13px; display: block; }
.hdr h1 { margin: 2px 0 0; font-size: 24px; font-weight: 700; }
.back { background: none; border: 0; padding: 0; color: #9a8b7c; font-size: 14px; }
.pill { display: inline-flex; gap: 6px; align-items: center; background: #e8f2ea; color: #2e6b3f; border-radius: 999px; padding: 5px 11px; font-size: 13px; margin: 8px 20px 2px; }
.pill.off { background: #f1e9df; color: #8a735c; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.muted { color: #9a8b7c; font-size: 13px; }
.warn { color: #c2653a; }
.empty { text-align: center; color: #9a8b7c; padding: 40px 24px; line-height: 1.6; }

.floor { margin: 14px 14px 0; }
.floor > b { display: block; font-size: 13px; color: #c2653a; font-weight: 700; margin: 0 6px 6px; }
.area { background: #fff; border-radius: 16px; margin-bottom: 8px; overflow: hidden; box-shadow: 0 1px 2px rgba(60,40,20,.06); }
.area > span { display: block; font-size: 13px; color: #9a8b7c; padding: 10px 14px 2px; }
.task { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-top: 1px solid #f4ede4; width: 100%; background: none; border-inline: 0; border-bottom: 0; text-align: start; }
.area > span + .task { border-top: 0; }
.task .t { flex: 1; font-size: 16px; line-height: 1.3; min-width: 0; }
.task .tr { font-size: 12px; color: #b0a293; margin-top: 2px; }
.dur { font-size: 12px; color: #2e6b3f; background: #e8f2ea; border-radius: 8px; padding: 2px 7px; white-space: nowrap; }
.box { width: 26px; height: 26px; border-radius: 8px; border: 2px solid #d9c9b6; flex-shrink: 0; display: grid; place-items: center; color: #fff; font-size: 16px; }
.task.done .box { background: #c2653a; border-color: #c2653a; }
.task.done .box::after { content: "✓"; }
.task.done .t > div:first-child { text-decoration: line-through; color: #b3a595; }
.del { background: none; border: 0; color: #c9b9a7; font-size: 14px; padding: 6px 8px; border-radius: 8px; white-space: nowrap; }
.del.armed { background: #fdeee2; color: #b4551f; }
.locked { opacity: .45; pointer-events: none; }

.nav { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-around; border-top: 1px solid #eadfd2; background: #fff; padding: 8px 0 calc(10px + env(safe-area-inset-bottom)); }
.nav button { background: none; border: 0; font-size: 12px; color: #a8998a; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 2px 16px; }
.nav button b { font-size: 20px; font-weight: 400; }
.nav button.on { color: #c2653a; font-weight: 600; }
.fab { position: absolute; bottom: calc(76px + env(safe-area-inset-bottom)); inset-inline-start: 16px; background: #c2653a; color: #fff; border: 0; border-radius: 16px; padding: 14px 20px; font-weight: 600; font-size: 16px; box-shadow: 0 6px 16px rgba(120,60,30,.25); }
.prog { margin: 8px 20px 2px; height: 8px; background: #efe5d8; border-radius: 999px; overflow: hidden; }
.prog i { display: block; height: 100%; background: #c2653a; transform-origin: left; transition: transform .25s; }
[dir="rtl"] .prog i { transform-origin: right; }
select.lang { border: 1px solid #e0d3c3; background: #fff; border-radius: 10px; padding: 6px 8px; font-size: 14px; }

.scrim { position: absolute; inset: 0; background: rgba(43,38,34,.35); z-index: 20; }
.sheet { position: absolute; inset: auto 0 0 0; z-index: 21; background: #fff; border-radius: 26px 26px 0 0; padding: 12px 20px calc(22px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 30px rgba(0,0,0,.15); max-height: 92%; overflow-y: auto; }
.grab { width: 40px; height: 5px; border-radius: 3px; background: #e2d6c8; margin: 0 auto 10px; }
.sheet h2 { margin: 0 0 8px; font-size: 20px; }
.lbl { font-size: 13px; color: #9a8b7c; margin: 14px 0 6px; display: block; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { border: 1.5px solid #e6d9ca; background: #fff; border-radius: 12px; padding: 9px 14px; font-size: 15px; }
.chip[aria-pressed="true"] { background: #2b2622; border-color: #2b2622; color: #fff; }
.chip.new { border-style: dashed; color: #9a8b7c; }
.field { width: 100%; border: 1.5px solid #e6d9ca; border-radius: 12px; padding: 12px; font-size: 16px; background: #fff; outline: 0; }
.field:focus { border-color: #c2653a; }
.row { display: flex; gap: 8px; align-items: center; }
.preview { margin-top: 12px; background: #faf6f0; border-radius: 12px; padding: 10px 12px; font-size: 13px; color: #7d6f62; min-height: 58px; }
.preview b { color: #2b2622; font-weight: 500; font-size: 15px; }
.btn { display: block; width: 100%; border: 0; border-radius: 14px; padding: 14px; font-size: 16px; font-weight: 600; margin-top: 10px; }
.btn.pri { background: #c2653a; color: #fff; }
.btn.pri:disabled { background: #e2c7b8; }
.btn.sec { background: #f3ece3; color: #5c4f43; }
.btn.dark { background: #2b2622; color: #fff; }
.btn.small { display: inline-block; width: auto; padding: 8px 14px; font-size: 14px; margin: 0; }
.toast { position: absolute; top: calc(12px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); background: #2b2622; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 30; white-space: nowrap; }
.err { color: #b4551f; font-size: 14px; margin-top: 8px; min-height: 18px; }

.card { background: #fff; border-radius: 18px; margin: 10px 14px; padding: 14px 16px; }
.big { font-size: 40px; font-weight: 800; margin: 2px 0; }
.visit { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-top: 1px solid #f1e8dd; font-size: 15px; gap: 8px; width: 100%; background: none; border-inline: 0; border-bottom: 0; text-align: start; }
.card > .visit:first-child { border-top: 0; }
.edited { display: inline-block; font-size: 11px; background: #fdeee2; color: #b4551f; border-radius: 6px; padding: 1px 6px; margin-inline-start: 4px; vertical-align: middle; }
.month { display: flex; align-items: center; gap: 8px; }
.month button { background: #fff; border: 1px solid #eadfd2; width: 34px; height: 34px; border-radius: 10px; }

.tl { margin: 10px 14px; background: #fff; border-radius: 18px; padding: 6px 16px; }
.tli { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid #f4ede4; }
.tli:first-child { border-top: 0; }
.tli .time { width: 46px; font-weight: 600; font-size: 15px; flex-shrink: 0; }
.tli .what { flex: 1; font-size: 15px; }
.tli .what small { display: block; color: #9a8b7c; font-size: 12px; margin-top: 1px; }
.tli.io .what { font-weight: 600; }
.tli.io .what small { font-weight: 400; }
.tli.missing .time { color: #c2653a; }
.tli.skip .what { color: #b3a595; }
.ed { background: #f3ece3; border: 0; border-radius: 10px; padding: 7px 12px; font-size: 13px; }
.gap { font-size: 12px; color: #b0a293; padding: 0 0 8px; padding-inline-start: 58px; margin-top: -4px; }

.set { background: #fff; border-radius: 18px; margin: 10px 14px; padding: 4px 16px 14px; }
.set .lbl { margin-top: 12px; }
.switch { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; font-size: 15px; }
.switch input { width: 48px; height: 28px; accent-color: #c2653a; }
.linkbox { direction: ltr; text-align: left; font-size: 12px; background: #faf6f0; border-radius: 10px; padding: 8px 10px; word-break: break-all; color: #7d6f62; margin-bottom: 8px; }

.scan { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px 28px; }
.scan.in { background: #2e6b3f; color: #fff; }
.scan.out { background: #2b2622; color: #fff; }
.scan.wait { background: #faf6f0; }
.scan .circle { width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.14); display: grid; place-items: center; font-size: 56px; margin-bottom: 20px; }
.scan.wait .circle { background: #fbeee6; }
.scan h1 { margin: 0; font-size: 28px; }
.scan .clock { font-size: 56px; font-weight: 800; margin: 6px 0; }
.scan p { margin: 0; opacity: .85; line-height: 1.5; }
.scan .btn { background: #fff; color: #2b2622; margin-top: 28px; max-width: 320px; }
.scan.wait .btn { background: #2b2622; color: #fff; }

.remind { margin: 12px 14px; background: #fff; border: 2px solid #c2653a; border-radius: 20px; padding: 18px; text-align: center; }
.remind.soft { border: 1.5px dashed #dcc9b3; }
.remind .tag { width: 80px; height: 80px; border-radius: 50%; margin: 4px auto 12px; background: #fbeee6; display: grid; place-items: center; font-size: 36px; position: relative; }
.remind:not(.soft) .tag::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid #efc3a8; animation: pulse 2s infinite; }
@keyframes pulse { from { transform: scale(.92); opacity: 1; } to { transform: scale(1.3); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .remind .tag::after { animation: none; } }
.remind h2 { margin: 0 0 6px; font-size: 19px; }
.remind p { margin: 0; color: #7d6f62; font-size: 14px; }

.login { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 24px; gap: 4px; }
.login h1 { margin: 0 0 4px; font-size: 28px; }
.login .field { font-size: 28px; text-align: center; letter-spacing: 8px; direction: ltr; }

.nav button { position: relative; }
.badge { position: absolute; top: -2px; inset-inline-end: 8px; min-width: 18px; height: 18px; border-radius: 9px; background: #c2653a; color: #fff; font: 600 11px/18px Rubik, system-ui, sans-serif; text-align: center; padding: 0 5px; font-style: normal; }
.ed .badge { position: static; display: inline-block; margin-inline-start: 6px; }
.payout { padding: 12px 0; border-top: 1px solid #f1e8dd; }
.payout:first-child { border-top: 0; }
.payout b { font-size: 20px; }
.payout .st { font-size: 12px; border-radius: 8px; padding: 2px 8px; background: #f1e9df; color: #8a735c; }
.payout.approved .st { background: #e8f2ea; color: #2e6b3f; }
.payout.rejected b, .payout.cancelled b { text-decoration: line-through; color: #b3a595; }
