/* Dibiliz technician app (Android / PWA) */
html, body { background: var(--bg); }
body { font-size: 15px; overscroll-behavior-y: contain; -webkit-tap-highlight-color: transparent; }
.ic { width: 20px; height: 20px; flex: none; }
.btn { min-height: 44px; border-radius: 10px; }
.btn.sm { min-height: 36px; }
.btn.xl { min-height: 56px; font-size: 17px; border-radius: 12px; width: 100%; }
input, select, textarea { font-size: 16px; min-height: 46px; border-radius: 10px; }

/* login */
.m-login { min-height: 100vh; display: flex; flex-direction: column; background: linear-gradient(170deg, var(--brand) 0%, var(--brand-2) 45%, var(--bg) 45.1%); overflow: hidden; }
.m-login .top-art { position: relative; color: #fff; padding: calc(56px + env(safe-area-inset-top)) 24px 36px; text-align: center; }
.m-login .top-art .rings { width: 380px; height: 380px; left: 50%; top: -120px; margin-left: -190px; }
.m-login .top-art .logo-full { position: relative; width: min(78vw, 300px); height: auto; margin: 0 auto; display: block; }
.m-login .top-art p { position: relative; color: #c9cbe3; margin: 10px 0 0; letter-spacing: .12em; text-transform: uppercase; font-size: 12.5px; font-weight: 600; animation-delay: .25s; }
.m-login form { position: relative; }
.m-login form { margin: 0 16px; background: var(--surface); border-radius: 16px; padding: 22px 18px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 14px; }

/* app chrome */
.m-head { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 0 8px 0 12px; padding-top: env(safe-area-inset-top); background: var(--brand); color: #fff; }
.m-head .t { flex: 1; min-width: 0; font-weight: 650; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-head .t small { display: block; font-weight: 400; font-size: 12px; color: #b9bbd9; }
.m-head .head-mark { width: 30px; height: 30px; margin: 0 4px; }
.hbtn { position: relative; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.hbtn:active { background: rgba(255, 255, 255, .12); }
.hbtn .dot { position: absolute; top: 6px; right: 5px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
#view { padding: 14px 14px calc(84px + env(safe-area-inset-bottom)); max-width: 720px; margin: 0 auto; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: var(--surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; color: var(--muted); font-size: 11.5px; font-weight: 600; text-decoration: none !important; }
.tabbar a.active { color: var(--primary); }
.tabbar a .ic { width: 23px; height: 23px; }

/* content */
.hello { margin: 4px 2px 14px; }
.hello h1 { font-size: 21px; }
.sec { margin: 18px 2px 8px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.m-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow); }
a.m-card { display: block; color: var(--text); text-decoration: none !important; }
a.m-card:active { background: var(--surface-2); }
.m-card .top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.m-card .ref { font-size: 12.5px; color: var(--muted); font-weight: 650; }
.m-card h3 { font-size: 16px; margin: 2px 0 4px; }
.m-card .meta { color: var(--text-2); font-size: 13.5px; display: flex; gap: 6px; align-items: center; margin-top: 3px; }
.m-card .meta .ic { width: 15px; height: 15px; color: var(--muted); }
.live, a.m-card.live { background: linear-gradient(135deg, var(--brand) 0%, #3b4fb8 100%); color: #fff; border: 0; }
.live .ref, .live .meta { color: #d9dcf7; }
.live .meta .ic { color: #d9dcf7; }
.live .timer { font-size: 26px; font-weight: 700; margin-top: 6px; }
.empty-m { text-align: center; padding: 34px 16px; color: var(--muted); background: var(--surface); border: 1px dashed var(--border-strong); border-radius: 14px; }

.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 4px; }
.quick a, .quick button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--primary); font: inherit; font-size: 12.5px; font-weight: 600; text-decoration: none !important; cursor: pointer; }
.quick a:active, .quick button:active { background: var(--primary-soft); }
.quick .ic { width: 22px; height: 22px; }

.step { position: relative; padding-left: 42px; }
.step::before { content: attr(data-n); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 700; display: flex; align-items: center; justify-content: center; }
.step.done::before { content: "✓"; background: var(--success); color: #fff; }
.step h3 { margin: 4px 0 10px; }
.photo-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.photo-btns label { margin: 0; }
.photos { grid-template-columns: repeat(3, 1fr); }
.kv-m { display: grid; grid-template-columns: 96px 1fr; gap: 6px 10px; font-size: 14px; }
.kv-m dt { color: var(--muted); }
.kv-m dd { margin: 0; word-break: break-word; }

.stars-in { display: flex; gap: 6px; }
.stars-in button { border: 0; background: none; font-size: 34px; line-height: 1; color: #d5d8de; padding: 2px; cursor: pointer; }
.stars-in button.on { color: #e3a008; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 999px; padding: 8px 13px; font: inherit; font-size: 14px; cursor: pointer; }
.chips button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.sticky-actions { position: sticky; bottom: calc(66px + env(safe-area-inset-bottom)); display: grid; gap: 8px; padding: 10px 0 4px; background: linear-gradient(transparent, var(--bg) 18%); z-index: 5; }
.notif { display: block; padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none !important; background: var(--surface); }
.notif.unread { background: #f1f6fd; }
.notif b { display: block; }
.install-bar { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--primary-soft); color: #3142a0; margin-bottom: 12px; font-weight: 550; }
.install-bar .grow { flex: 1; }
.offline { position: fixed; top: 0; left: 0; right: 0; z-index: 99; background: var(--danger); color: #fff; text-align: center; font-size: 13px; padding: 4px; padding-top: calc(4px + env(safe-area-inset-top)); }
.modal { border-radius: 16px; }
@media (max-width: 640px) { .modal { border-radius: 0; } }

/* ---------- PPM checklist ---------- */
a.m-card.step { display: block; color: var(--text); text-decoration: none !important; }
.ck-sys summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 16px; cursor: pointer; }
.ck-sys summary::-webkit-details-marker { display: none; }
.ck-item { padding: 12px 0; border-top: 1px solid var(--border); }
.ck-q { font-size: 14px; margin-bottom: 8px; }
.ck-k { display: inline-block; min-width: 30px; font-weight: 700; font-size: 12.5px; color: var(--muted); }
.seg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.seg label { margin: 0; position: relative; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.seg span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 40px; padding: 2px; border: 1px solid var(--border-strong);
  border-radius: 8px; background: var(--surface); color: var(--text-2); font-size: 11.5px; font-weight: 600; line-height: 1.15; cursor: pointer; }
.seg input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 1px; }
.seg input:checked + span { color: #fff; }
.seg input:checked + .seg-ok { background: var(--success); border-color: var(--success); }
.seg input:checked + .seg-not_ok { background: var(--danger); border-color: var(--danger); }
.seg input:checked + .seg-rectified { background: var(--info); border-color: var(--info); }
.seg input:checked + .seg-na { background: #6b7280; border-color: #6b7280; }
.seg input:checked + .seg-not_checked { background: var(--warning); border-color: var(--warning); }
.seg input:disabled:not(:checked) + span { opacity: .45; }
.ck-m { margin-top: 8px; min-height: 42px; font-size: 14px; }
.ck-add { border: 0; background: none; padding: 8px 0 0; color: var(--primary); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.ck-fault { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-top: 1px solid var(--border); }

/* ---------- app lock (fingerprint / face) ---------- */
#applock { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: calc(24px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom)); text-align: center; color: #fff; overflow: hidden;
  background: radial-gradient(circle at 80% 10%, #4a4f9a 0%, transparent 45%), linear-gradient(165deg, var(--brand) 0%, var(--brand-2) 70%, #3b4fb8 100%); }
#applock .rings { width: 420px; height: 420px; left: 50%; top: 50%; margin: -210px 0 0 -210px; }
#applock .logo-full { position: relative; width: min(70vw, 260px); height: auto; margin-bottom: 18px; }
#applock .lock-title { position: relative; font-size: 18px; font-weight: 650; margin: 0; }
#applock .lock-hint { position: relative; color: #c9cbe3; font-size: 14px; max-width: 300px; margin: 0; min-height: 40px; }
#applock .lock-link { position: relative; margin-top: 18px; border: 0; background: none; color: #c9cbe3; font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; padding: 10px; }
.lock-btn { position: relative; width: 92px; height: 92px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .55); background: rgba(255, 255, 255, .12);
  color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; margin: 10px 0 4px; }
.lock-btn .ic { width: 46px; height: 46px; stroke-width: 1.6; }
.lock-btn:active { transform: scale(.96); }
.modal .lock-btn { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-soft); }
@media (prefers-reduced-motion: no-preference) {
  #applock .lock-btn { animation: dbz-pulse-light 2s ease-out infinite; }
}
