@font-face { font-family: 'Poppins'; font-weight: 400; font-style: normal; font-display: swap; src: url('/fonts/poppins-400.woff') format('woff'); }
@font-face { font-family: 'Poppins'; font-weight: 500; font-style: normal; font-display: swap; src: url('/fonts/poppins-500.woff') format('woff'); }
@font-face { font-family: 'Poppins'; font-weight: 600 800; font-style: normal; font-display: swap; src: url('/fonts/poppins-700.woff') format('woff'); }
/* Paarik v3 – scaffold inspection
   Concrete background, steel ink, hi-vis yellow for actions, tag colours for results. */
:root {
  --paper: #ECEEE9;
  --surface: #FFFFFF;
  --ink: #1D2830;
  --ink-2: #44525B;
  --steel: #7E8B92;
  --line: #D3D8D2;
  --line-2: #E4E7E2;
  --hivis: #87304F;
  --hivis-ink: #FFFFFF;
  --green: #1F7A47;
  --amber: #E9B200;
  --red: #C33A22;
  --night: #121A1F;
  --night-2: #1C262D;
  --night-line: #2E3A42;
  --r-in: 10px;
  --r-card: 14px;
  --r-btn: 12px;
  --display: 'Barlow Condensed', 'Arial Narrow', 'Roboto Condensed', sans-serif;
  --text: 'Barlow', 'Segoe UI', Roboto, Arial, sans-serif;
  --col: 640px;
  --tabbar-h: 64px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(64px + env(safe-area-inset-top, 0px)); }
html, body { margin: 0; }
body {
  font-family: var(--text); font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--paper);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
}
body.cam { background: var(--night); padding-bottom: env(safe-area-inset-bottom, 0px); }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0; letter-spacing: .005em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--hivis); outline-offset: 2px; }
.muted { color: var(--steel); }
code { font-family: inherit; font-weight: 700; background: var(--line-2); padding: 0 .3rem; border-radius: 4px; }
svg { width: 22px; height: 22px; flex: 0 0 auto; }

/* ---------- app bar ---------- */
.appbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: .6rem;
  padding: calc(.55rem + env(safe-area-inset-top, 0px)) 1rem .55rem; background: var(--ink); color: #fff;
}
body.cam .appbar { display: none; }
.appbar-back { background: none; border: 0; color: #fff; padding: .2rem; margin-left: -.3rem; display: grid; place-items: center; }
.brand { display: flex; align-items: center; gap: .5rem; text-decoration: none; color: #fff; margin-right: auto; }
.brand-mark { width: 24px; height: 30px; }
.brand-name { font-family: var(--display); font-weight: 800; font-size: 1.35rem; letter-spacing: .01em; }
.topnav { display: none; gap: .2rem; }
.topnav button { background: none; border: 0; color: #B9C4CA; font-weight: 600; padding: .45rem .75rem; border-radius: 8px; }
.topnav button:hover { color: #fff; }
.topnav button.on { color: var(--hivis-ink); background: var(--hivis); }
.avatar-btn { background: none; border: 0; padding: 0; }
.avatar {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--hivis); color: var(--hivis-ink); font-family: var(--display); font-weight: 800; font-size: 1.05rem;
}
.avatar.xl { width: 64px; height: 64px; font-size: 1.7rem; }

/* ---------- layout ---------- */
main { max-width: var(--col); margin: 0 auto; padding: 1rem 1rem 2rem; }
body.cam main { padding: env(safe-area-inset-top, 0px) .75rem 1.25rem; }
.view { display: grid; gap: 1rem; align-content: start; }
.page-title { font-size: 2rem; font-weight: 800; }
.sec-title { font-size: 1.2rem; font-weight: 700; color: var(--ink-2); }
.sec-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 1rem; display: grid; gap: .8rem; }
.card-title { font-size: 1.35rem; font-weight: 700; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .75rem; }
@media (max-width: 420px) { .grid2 { grid-template-columns: 1fr; } }
.row-btns { display: flex; gap: .5rem; flex-wrap: wrap; }
.link-btn { background: none; border: 0; color: var(--ink); font-weight: 700; text-decoration: underline; text-decoration-color: var(--hivis); text-decoration-thickness: 3px; text-underline-offset: 4px; padding: .2rem 0; }

/* ---------- forms ---------- */
.form { display: grid; gap: .1rem; }
.field { display: block; margin-bottom: .75rem; }
.field > span { display: block; font-weight: 600; font-size: .9rem; color: var(--ink-2); margin-bottom: .3rem; }
input, select, textarea {
  width: 100%; background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-in);
  padding: .7rem .8rem; min-height: 48px; font-size: 1rem;
}
textarea { min-height: auto; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(245,184,0,.5); }
input.invalid { border-color: var(--red); box-shadow: 0 0 0 3px rgba(195,58,34,.18); }
.more { border-top: 1px solid var(--line-2); padding-top: .6rem; margin-top: .2rem; }
.more summary { cursor: pointer; font-weight: 700; padding: .4rem 0 .7rem; list-style: none; display: flex; align-items: center; gap: .4rem; }
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: '+'; display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 6px; background: var(--line-2); font-weight: 800; }
.more[open] summary::before { content: '–'; }
.more summary em { font-style: normal; font-weight: 500; color: var(--steel); }
.switch { display: flex; align-items: center; gap: .7rem; font-weight: 600; padding: .3rem 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { width: 46px; height: 28px; border-radius: 999px; background: var(--line); position: relative; flex: 0 0 auto; transition: background .2s; }
.switch-ui::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + .switch-ui { background: var(--green); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-ui { outline: 3px solid var(--hivis); outline-offset: 2px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px;
  padding: .7rem 1.1rem; border-radius: var(--r-btn); border: 1.5px solid transparent; font-weight: 700; font-size: 1rem;
  text-decoration: none; line-height: 1.2;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-sm { min-height: 40px; padding: .45rem .85rem; font-size: .92rem; }
.btn-block { width: 100%; }
.btn-hivis { background: var(--hivis); color: var(--hivis-ink); border-color: #D9A300; }
.btn-hivis:active { background: #E2AA00; }
.btn-ink { background: var(--ink); color: #fff; }
.btn-line { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-line:hover { border-color: var(--ink-2); }
.btn-danger { background: #fff; color: var(--red); border-color: #E7C2BA; }
.btn-dark-line { background: transparent; color: #DDE5E9; border-color: var(--night-line); }
.btn-xl { justify-content: flex-start; text-align: left; gap: .9rem; padding: 1rem 1.1rem; min-height: 76px; }
.btn-xl svg { width: 30px; height: 30px; }
.btn-xl b { display: block; font-family: var(--display); font-size: 1.45rem; font-weight: 800; }
.btn-xl small { display: block; font-weight: 500; font-size: .9rem; opacity: .8; }
.icon-btn { background: none; border: 0; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; color: var(--ink-2); }
.icon-btn.light { color: #fff; background: rgba(255,255,255,.08); }

/* ---------- home ---------- */
.home-hero { padding: .4rem 0 0; }
.greet { color: var(--steel); font-weight: 600; }
.home-title { font-size: 2.3rem; font-weight: 800; }
.cta-start {
  display: flex; align-items: center; gap: 1rem; width: 100%; text-align: left; border: 0;
  background: var(--hivis); color: var(--hivis-ink); border-radius: 18px; padding: 1.2rem 1.1rem;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.12);
  /* hazard stripe along the right edge – the one decorative touch */
  background-image: repeating-linear-gradient(-45deg, transparent 0 10px, rgba(29,40,48,.9) 10px 20px);
  background-size: 22px 100%; background-repeat: no-repeat; background-position: right;
  padding-right: 2.6rem;
}
.cta-start svg { width: 44px; height: 44px; }
.cta-start b { display: block; font-family: var(--display); font-size: 1.85rem; font-weight: 800; line-height: 1; }
.cta-start small { display: block; font-size: .95rem; font-weight: 500; margin-top: .25rem; }
.cta-start:active { transform: translateY(1px); }

.install-banner { display: flex; align-items: center; gap: .7rem; background: var(--surface); border: 1.5px dashed var(--steel); border-radius: var(--r-card); padding: .7rem .7rem .7rem .9rem; }
.install-banner p { flex: 1; display: grid; font-size: .9rem; }
.install-banner p span { color: var(--steel); }

.tag-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.tag-stat {
  position: relative; border-radius: 10px 10px 12px 12px; padding: 1.3rem .7rem .7rem; color: #fff; border: 0; text-align: left;
}
.tag-stat::before { content: ''; position: absolute; top: .45rem; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 2px rgba(0,0,0,.18); }
.tag-stat b { display: block; font-family: var(--display); font-size: 2.1rem; font-weight: 800; line-height: 1; }
.tag-stat span { font-weight: 600; font-size: .9rem; }
.tag-stat.GREEN { background: var(--green); }
.tag-stat.YELLOW { background: var(--amber); color: #2B2300; /* yellow always needs dark text */ }
.tag-stat.RED { background: var(--red); }

/* ---------- lists (history + recent) ---------- */
.list { display: grid; gap: .55rem; }
.row {
  display: grid; grid-template-columns: auto 1fr auto; gap: .8rem; align-items: center; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: .65rem .75rem;
}
.row:hover { border-color: var(--steel); }
.row-main { min-width: 0; }
.row-title { font-weight: 700; font-size: 1.05rem; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: .88rem; color: var(--steel); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-chev { color: var(--steel); }
.minitag { position: relative; width: 34px; height: 44px; border-radius: 5px 5px 7px 7px; display: grid; place-items: end center; padding-bottom: 5px; color: #fff; font-family: var(--display); font-weight: 800; font-size: .78rem; }
.minitag::before { content: ''; position: absolute; top: 5px; left: 50%; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--surface); }
.minitag.GREEN { background: var(--green); } .minitag.YELLOW { background: var(--amber); color: #2B2300; /* yellow always needs dark text */ } .minitag.RED { background: var(--red); }
.minitag.NONE { background: var(--line); color: var(--ink-2); }
.empty { text-align: center; padding: 2rem 1rem; border: 1.5px dashed var(--line); border-radius: var(--r-card); color: var(--ink-2); display: grid; gap: .6rem; justify-items: center; }
.search input { background: var(--surface); }
.filters { display: flex; gap: .45rem; overflow-x: auto; padding-bottom: .1rem; }
.filters button { flex: 0 0 auto; min-height: 40px; padding: .4rem 1rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; display: inline-flex; align-items: center; gap: .4rem; }
.filters button::before { content: ''; width: .6rem; height: .6rem; border-radius: 50%; background: var(--steel); }
.filters button[data-f="GREEN"]::before { background: var(--green); }
.filters button[data-f="YELLOW"]::before { background: var(--amber); }
.filters button[data-f="RED"]::before { background: var(--red); }
.filters button[data-f="all"]::before { display: none; }
.filters button.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- setup ---------- */
.plan { gap: .6rem; }
.plan-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: s; }
.plan-steps li { counter-increment: s; display: grid; grid-template-columns: 2rem 1fr; gap: .2rem .6rem; padding: .55rem 0; border-top: 1px solid var(--line-2); }
.plan-steps li:first-child { border-top: 0; }
.plan-steps li::before { content: counter(s); grid-row: span 2; width: 1.75rem; height: 1.75rem; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; font-family: var(--display); font-weight: 800; }
.plan-steps b { font-weight: 700; }
.plan-steps span { font-size: .88rem; color: var(--steel); }
.plan-steps li.any::before { content: '★'; background: var(--line-2); color: var(--ink-2); }
.start-actions { display: grid; gap: .6rem; }

/* ---------- camera screens ---------- */
.dark { color: #E8EEF1; }
.cam-top { display: grid; grid-template-columns: auto 1fr auto; gap: .6rem; align-items: center; padding-top: .5rem; }
.cam-title { display: grid; min-width: 0; }
.cam-title b { font-family: var(--display); font-size: 1.45rem; font-weight: 800; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cam-step { font-size: .85rem; color: #9FB0B9; font-weight: 600; }
.pill-btn { display: inline-flex; align-items: center; gap: .35rem; min-height: 40px; padding: .35rem .8rem; border-radius: 999px; border: 1.5px solid var(--night-line); background: var(--night-2); color: #fff; font-weight: 700; font-size: .9rem; }
.pill-btn svg { width: 18px; height: 18px; }
.pill-btn.on { background: var(--hivis); border-color: var(--hivis); color: var(--hivis-ink); }
.pill-btn:disabled { opacity: .5; }
.stepper { display: flex; gap: .35rem; overflow-x: auto; padding-bottom: .1rem; position: relative; scrollbar-width: none; }
.stepper button { flex: 0 0 auto; min-height: 36px; padding: .3rem .75rem; border-radius: 999px; border: 1.5px solid var(--night-line); background: transparent; color: #B8C6CD; font-weight: 600; font-size: .88rem; display: inline-flex; gap: .35rem; align-items: center; }
.stepper button.cur { border-color: var(--hivis); color: #fff; }
.stepper button.ok::before, .stepper button.warn::before { content: ''; width: .55rem; height: .55rem; border-radius: 50%; background: #3BB273; }
.stepper button.warn::before { background: var(--amber); }

.stage { position: relative; aspect-ratio: 3 / 4; max-height: 64vh; width: 100%; background: #000; border-radius: 16px; overflow: hidden; }
@media (min-width: 700px) { .stage { aspect-ratio: 4 / 3; max-height: none; } }
.stage video, .stage img, .stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stage img { object-fit: contain; background: #000; }
.stage canvas { pointer-events: none; }
.frame { position: absolute; inset: 7% 7%; pointer-events: none; }
.frame i { position: absolute; width: 16%; height: 14%; border: 4px solid var(--hivis); }
.frame i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
.frame i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 8px; }
.frame i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 8px; }
.frame i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 8px; }
.stage.has-shot .frame { display: none; }
.qbar { position: absolute; left: .6rem; right: .6rem; bottom: .6rem; display: flex; gap: .35rem; flex-wrap: wrap; }
.qpill { font-size: .8rem; font-weight: 700; padding: .2rem .55rem; border-radius: 999px; background: rgba(18,26,31,.78); color: #fff; }
.qpill.good { background: rgba(31,122,71,.92); }
.qpill.bad { background: rgba(195,58,34,.94); }
.nocam { position: absolute; inset: 0; display: grid; place-content: center; gap: .4rem; text-align: center; padding: 1.5rem; color: #fff; }
.nocam p:last-child { color: #A9B7BF; }
.stage.snap::before { content: ''; position: absolute; inset: 0; background: #fff; z-index: 5; pointer-events: none; animation: snapflash .35s ease-out forwards; }
@keyframes snapflash { from { opacity: .85; } to { opacity: 0; } }

.sheet { background: var(--night-2); border: 1px solid var(--night-line); border-radius: var(--r-card); padding: .8rem .9rem; display: grid; gap: .45rem; }
.sheet-guide { color: #fff; font-weight: 600; }
.sheet-tip { font-size: .85rem; color: #93A4AD; }
.checks-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.checks-mini li { display: grid; grid-template-columns: 1.1rem 1fr; gap: .5rem; font-size: .93rem; color: #CFDAE0; }
.checks-mini li::before { content: ''; width: .8rem; height: .8rem; margin-top: .3rem; border: 2px solid #8FA2AC; border-radius: 3px; }
.checks-mini li.is-crit::before { border-color: #FF8A73; }
.checks-mini li.none { grid-template-columns: 1fr; color: #93A4AD; }
.checks-mini li.none::before { display: none; }
.crit-dot { color: #FF8A73; font-weight: 800; }

.cam-controls { display: flex; align-items: center; justify-content: center; gap: 1.1rem; padding: .2rem 0; }
.shutter { width: 76px; height: 76px; border-radius: 50%; border: 5px solid #fff; background: transparent; padding: 5px; flex: 0 0 auto; }
.shutter span { display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--hivis); transition: transform .1s; }
.shutter:active span { transform: scale(.88); }
.shutter:disabled { opacity: .4; }
.round-btn { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--night-line); background: var(--night-2); color: #fff; font-size: 1.5rem; font-weight: 700; cursor: pointer; }
.round-btn.next { background: var(--hivis); border-color: var(--hivis); color: var(--hivis-ink); }
.round-btn.wide { width: auto; border-radius: 999px; padding: 0 1rem; font-size: .9rem; }
.round-btn.ghost { background: transparent; }

/* live overlays */
.lv-top { position: absolute; top: .6rem; left: .6rem; right: 5rem; display: flex; gap: .35rem; flex-wrap: wrap; }
.lv-state { background: rgba(18,26,31,.82); color: #fff; font-weight: 700; font-size: .85rem; padding: .2rem .6rem; border-radius: 999px; }
.lv-view { background: var(--hivis); color: var(--hivis-ink); font-family: var(--display); font-weight: 800; font-size: 1rem; padding: .05rem .55rem; border-radius: 6px; }
.lv-view:empty { display: none; }
.lv-lock { background: #fff; color: var(--ink); font-weight: 700; font-size: .82rem; padding: .15rem .55rem; border-radius: 999px; }
.lv-hint { position: absolute; left: 50%; bottom: 3.1rem; transform: translateX(-50%); max-width: 88%; background: rgba(18,26,31,.86); color: #fff; font-weight: 600; text-align: center; padding: .45rem .9rem; border-radius: 10px; }
.lv-hint:empty { display: none; }
.lv-ring { position: absolute; top: .5rem; right: .5rem; width: 62px; height: 62px; display: grid; place-items: center; }
.lv-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.lv-ring circle { fill: rgba(18,26,31,.75); stroke-width: 3.5; }
.lv-ring .bg { stroke: rgba(255,255,255,.22); }
.lv-ring .fg { fill: none; stroke: var(--hivis); stroke-linecap: round; stroke-dasharray: 0 97.4; transition: stroke-dasharray .4s; }
.lv-ring b { position: relative; color: #fff; font-family: var(--display); font-size: 1.1rem; }
.lv-done { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; background: rgba(31,122,71,.86); color: #fff; }
.lv-done span { font-size: 4.5rem; line-height: 1; font-weight: 800; }
.lv-done p { font-family: var(--display); font-size: 1.7rem; font-weight: 700; }
.live-stage.busy::after { content: ''; position: absolute; left: 7%; right: 7%; height: 3px; background: var(--hivis); box-shadow: 0 0 14px var(--hivis); animation: scan 1.2s ease-in-out infinite alternate; pointer-events: none; }
@keyframes scan { from { top: 8%; } to { top: 90%; } }

.lv-list { display: grid; gap: .45rem; }
.lv-group { border: 1.5px solid var(--night-line); border-radius: 10px; padding: .5rem .6rem; }
.lv-group[data-view] { cursor: pointer; }
.lv-group.cur { border-color: var(--hivis); }
.lv-group.locked { border-color: #fff; }
.lv-group.complete { border-color: #2F7A52; background: rgba(31,122,71,.14); }
.lv-gh { display: flex; justify-content: space-between; gap: .5rem; font-size: .95rem; color: #fff; }
.lv-gh span { color: #9FB0B9; font-variant-numeric: tabular-nums; font-weight: 600; }
.lv-group ul { list-style: none; margin: .3rem 0 0; padding: 0; display: grid; gap: .25rem; }
.lv-group li { display: flex; align-items: flex-start; gap: .45rem; font-size: .9rem; color: #CFDAE0; }
.lv-ic { flex: 0 0 auto; width: 1.15rem; height: 1.15rem; margin-top: .12rem; border-radius: 50%; display: grid; place-items: center; font-size: .7rem; font-weight: 800; color: #fff; border: 2px solid #5E707A; }
.lv-group li.present .lv-ic { background: #2B9A5C; border-color: #2B9A5C; }
.lv-group li.missing .lv-ic { background: var(--red); border-color: var(--red); }
.lv-group li.partial .lv-ic { background: var(--amber); border-color: var(--amber); color: #2B2300; }
.lv-group li.present { color: #9BE0B7; }
.lv-group li.missing { color: #FFB0A1; }
.lv-votes { color: #8396A0; font-weight: 600; font-size: .78rem; }
.lv-defects { border-top: 1px solid var(--night-line); padding-top: .5rem; color: #FFD6CC; font-size: .9rem; }
.lv-defects h3 { font-size: 1.05rem; color: #fff; }
.lv-defects ul { margin: .2rem 0 0; padding-left: 1rem; }

/* ---------- result: the scaffold tag ---------- */
.result-wrap { display: grid; gap: 1rem; }
.stag {
  position: relative; border-radius: 14px 14px 20px 20px; color: #fff; overflow: hidden;
  box-shadow: 0 1px 0 rgba(0,0,0,.08), 0 10px 28px -14px rgba(29,40,48,.55);
  animation: tagin .5s cubic-bezier(.2,1.3,.4,1) both; transform-origin: 50% 0;
}
@keyframes tagin { from { transform: rotate(-4deg) translateY(-14px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .stag { animation: none; } }
.stag.GREEN { background: var(--green); }
.stag.YELLOW { background: var(--amber); color: #2B2300; /* yellow always needs dark text */ }
.stag.RED { background: var(--red); }
.stag-top { position: relative; padding: 2.4rem 1.2rem 1rem; text-align: center; }
.stag-top::before { /* punched hole with eyelet */
  content: ''; position: absolute; top: .8rem; left: 50%; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%;
  background: var(--paper); box-shadow: 0 0 0 4px rgba(255,255,255,.55), inset 0 2px 3px rgba(0,0,0,.25);
}
.stag-word { font-family: var(--display); font-weight: 800; font-size: clamp(2.6rem, 12vw, 3.6rem); line-height: .95; letter-spacing: .02em; }
.stag-sub { font-weight: 600; margin-top: .35rem; }
.stag-body { background: #fff; color: var(--ink); margin: 0 .7rem; border-radius: 10px 10px 0 0; padding: .9rem 1rem 1rem; display: grid; gap: .7rem; }
.stag-fields { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem 1rem; margin: 0; }
.stag-fields div { min-width: 0; }
.stag-fields dt { font-size: .8rem; color: var(--steel); font-weight: 600; }
.stag-fields dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.stag-score { display: flex; align-items: center; gap: .8rem; border-top: 1.5px dashed var(--line); padding-top: .7rem; }
.stag-score b { font-family: var(--display); font-size: 2.2rem; font-weight: 800; line-height: 1; }
.stag-bar { flex: 1; height: 10px; border-radius: 6px; background: var(--line-2); overflow: hidden; }
.stag-bar i { display: block; height: 100%; background: var(--ink); }
.stag-counts { display: flex; gap: .9rem; font-size: .9rem; font-weight: 700; flex-wrap: wrap; }
.stag-counts .ok { color: var(--green); } .stag-counts .bad { color: var(--red); } .stag-counts .unc { color: #9A7300; }
.stag-note { font-size: .82rem; color: var(--steel); }
.stag-foot { height: 14px; background: #fff; margin: 0 .7rem .7rem; border-radius: 0 0 10px 10px; }

.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.result-actions .btn-hivis { grid-column: 1 / -1; }
.reasons { margin: 0; padding: 0; list-style: none; display: grid; gap: .35rem; }
.reasons li { display: grid; grid-template-columns: .5rem 1fr; gap: .6rem; align-items: baseline; }
.reasons li::before { content: ''; width: .5rem; height: .5rem; border-radius: 50%; background: var(--ink-2); transform: translateY(-.1rem); }

.decision { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; }
.decision button { min-height: 48px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; font-weight: 700; font-size: .9rem; padding: .3rem; }
.decision button.on { border-color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.decision button[data-o="PASS"].on { background: var(--green); color: #fff; border-color: var(--green); box-shadow: none; }
.decision button[data-o="REVIEW"].on { background: var(--amber); color: #2B2300; /* yellow always needs dark text */ border-color: var(--amber); box-shadow: none; }
.decision button[data-o="FAIL"].on { background: var(--red); color: #fff; border-color: var(--red); box-shadow: none; }
@media (max-width: 400px) { .decision { grid-template-columns: 1fr 1fr; } }

.check-group { display: grid; gap: 0; }
.check-group + .check-group { border-top: 1px solid var(--line-2); padding-top: .8rem; margin-top: .4rem; }
.cg-head { display: grid; grid-template-columns: 72px 1fr; gap: .8rem; align-items: center; margin-bottom: .4rem; }
.cg-head img, .cg-head .noimg { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; background: var(--line-2); cursor: zoom-in; }
.cg-head .noimg { display: grid; place-items: center; font-size: .75rem; color: var(--steel); text-align: center; cursor: default; padding: .3rem; }
.cg-head h3 { font-size: 1.2rem; font-weight: 700; }
.cg-head p { font-size: .85rem; color: var(--steel); }
.plist { list-style: none; padding: 0; margin: 0; }
.plist li { display: grid; grid-template-columns: 1.6rem 1fr auto; gap: .5rem; padding: .55rem 0; border-top: 1px solid var(--line-2); align-items: start; }
.ic { width: 1.4rem; height: 1.4rem; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: .8rem; font-weight: 800; margin-top: .05rem; }
.ic.present { background: var(--green); } .ic.missing { background: var(--red); } .ic.unclear { background: var(--amber); color: #2B2300; /* yellow always needs dark text */ }
.pn { font-weight: 700; }
.prule { display: block; font-size: .85rem; color: var(--ink-2); }
.pnote { display: block; font-size: .85rem; color: var(--steel); }
.pc { font-size: .8rem; color: var(--steel); font-variant-numeric: tabular-nums; }
.crit { display: inline-block; font-size: .7rem; font-weight: 800; color: #fff; background: var(--red); padding: .05rem .4rem; border-radius: 4px; vertical-align: .1em; margin-right: .25rem; }
.attention li { background: #FFF5F2; margin: 0 -1rem; padding: .6rem 1rem; border-top: 1px solid #F3D9D2; }
.attention li.unc { background: #FFFAEB; border-top-color: #F2E3B5; }
.defects { margin: 0; padding: 0; list-style: none; display: grid; gap: .4rem; }
.defects li { display: grid; grid-template-columns: auto 1fr; gap: .6rem; align-items: baseline; }
.sev { font-size: .72rem; font-weight: 800; padding: .1rem .4rem; border-radius: 4px; background: var(--line-2); }
.sev.high { background: var(--red); color: #fff; } .sev.medium { background: var(--amber); color: #2B2300; /* yellow always needs dark text */ }
.disclaimer { font-size: .85rem; color: #6B4B00; background: #FFF4D6; border-left: 4px solid var(--amber); padding: .6rem .8rem; border-radius: 6px; }
.signoff { display: flex; gap: .6rem; align-items: flex-start; font-weight: 600; }
.signoff input { width: 22px; height: 22px; min-height: 0; margin-top: .1rem; accent-color: var(--green); flex: 0 0 auto; }

/* ---------- settings ---------- */
.profile-head { display: flex; align-items: center; gap: .9rem; }
.profile-head b { display: block; font-family: var(--display); font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.profile-head span { color: var(--steel); }
.install-card { grid-template-columns: auto 1fr; align-items: start; gap: 1rem; }
.install-icon img { border-radius: 14px; display: block; }
.install-body { display: grid; gap: .6rem; justify-items: start; }
.install-steps { font-size: .93rem; background: var(--paper); border-radius: 10px; padding: .7rem .9rem; }
.install-steps ol { margin: .3rem 0 0; padding-left: 1.2rem; display: grid; gap: .25rem; }
.installed-badge { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; color: var(--green); }
.ed-views { display: grid; gap: .6rem; }
.ed-view { border: 1.5px solid var(--line); border-radius: 12px; padding: .7rem; display: grid; gap: .45rem; background: #FAFBF9; }
.ed-top { display: flex; gap: .4rem; align-items: center; }
.ed-top .ed-num { width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-family: var(--display); font-weight: 800; flex: 0 0 auto; }
.ed-top input { font-weight: 700; }
.ed-x { flex: 0 0 auto; }
.ed-view textarea { font-size: .93rem; }
.kv { margin: 0; display: grid; gap: 0; font-size: .93rem; }
.kv div { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-top: 1px solid var(--line-2); }
.kv dt { color: var(--steel); }
.kv dd { margin: 0; font-weight: 700; text-align: right; }
.kv .okv { color: var(--green); } .kv .badv { color: var(--red); }
.about { text-align: center; font-size: .85rem; color: var(--steel); padding: .5rem 1rem 1rem; }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
}
body.cam .tabbar { display: none; }
.tabbar button { background: none; border: 0; display: grid; justify-items: center; align-content: center; gap: .1rem; color: var(--steel); font-size: .75rem; font-weight: 700; }
.tabbar button svg { width: 24px; height: 24px; }
.tabbar button.on { color: var(--ink); }
.tabbar button.on svg { color: var(--ink); }
.tabbar button.on::after { content: ''; width: 22px; height: 3px; border-radius: 2px; background: var(--hivis); margin-top: .1rem; }
.tabbar .tab-main svg { background: var(--hivis); color: var(--hivis-ink); border-radius: 12px; padding: 5px; width: 34px; height: 34px; }

@media (min-width: 900px) {
  :root { --col: 760px; }
  body { padding-bottom: 0; }
  .tabbar { display: none; }
  .topnav { display: flex; }
  .avatar-btn { margin-left: .4rem; }
  .result-wrap { grid-template-columns: 340px 1fr; align-items: start; }
  .result-wrap > .stag-col { position: sticky; top: 76px; display: grid; gap: .8rem; }
}

/* ---------- loading, toast, lightbox ---------- */
.loading { position: fixed; inset: 0; z-index: 60; background: rgba(18,26,31,.78); display: grid; place-items: center; padding: 1rem; }
.loading-box { background: var(--ink); color: #fff; border-radius: var(--r-card); padding: 1.4rem 1.6rem; text-align: center; width: min(90vw, 320px); }
.scanner { position: relative; height: 84px; border: 3px solid var(--hivis); border-radius: 8px; margin-bottom: 1rem; overflow: hidden;
  background: repeating-linear-gradient(90deg, transparent 0 18px, rgba(245,184,0,.18) 18px 20px), repeating-linear-gradient(0deg, transparent 0 26px, rgba(245,184,0,.18) 26px 28px); }
.scanner::after { content: ''; position: absolute; left: 0; right: 0; height: 3px; background: var(--hivis); box-shadow: 0 0 14px var(--hivis); animation: scan 1.4s ease-in-out infinite alternate; }
@media (prefers-reduced-motion: reduce) { .scanner::after, .live-stage.busy::after { animation: none; top: 50%; } }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 1rem + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; padding: .7rem 1rem; border-radius: 10px; font-weight: 600; max-width: min(92vw, 480px);
  z-index: 70; opacity: 0; visibility: hidden; transition: opacity .2s, transform .2s; pointer-events: none; text-align: center;
}
body.cam .toast { bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); }
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.toast.err { background: var(--red); }
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.92); display: grid; place-items: center; padding: 1rem; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }

/* ---------- print = inspection report ---------- */
@media print {
  body { background: #fff; padding: 0; }
  .appbar, .tabbar, .toast, .no-print, .result-actions, .decision, #ovRemarks, .signoff input { display: none !important; }
  main { max-width: none; padding: 0; }
  .view:not(#view-result) { display: none !important; }
  .result-wrap { grid-template-columns: 1fr !important; }
  .stag { box-shadow: none; animation: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; break-inside: avoid; }
  .card { break-inside: avoid; border-color: #bbb; }
  .ic, .crit, .sev { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

.result-main { display: grid; gap: 1rem; align-content: start; min-width: 0; }

/* ---------- v4: inspection types ---------- */
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
@media (max-width: 360px) { .type-grid { grid-template-columns: 1fr; } }
.type-card {
  display: grid; gap: .45rem; align-content: start; text-align: left; min-height: 150px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-card); padding: .85rem;
}
.type-card:hover { border-color: var(--ink-2); }
.type-card:active { transform: translateY(1px); }
.type-card b { font-family: var(--display); font-size: 1.25rem; font-weight: 700; line-height: 1.1; }
.type-card p { font-size: .85rem; color: var(--steel); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.type-card small { font-size: .8rem; font-weight: 700; color: var(--ink-2); margin-top: auto; }
.type-card.new { border-style: dashed; border-color: var(--steel); background: transparent; place-content: center; justify-items: center; text-align: center; }
.type-card.new .type-icon { background: var(--ink); color: #fff; }
.type-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--hivis); color: var(--hivis-ink); font-family: var(--display); font-weight: 800; font-size: 1.3rem; flex: 0 0 auto; }
.type-icon svg { width: 26px; height: 26px; }
.type-icon.t1 { background: #DCE8F2; color: #1F4D73; }
.type-icon.t2 { background: #E3EFE3; color: #1F5E33; }
.type-icon.t3 { background: #F3E3DA; color: #7A3517; }
.type-icon.t4 { background: #ECE3F2; color: #4F2C6E; }
.type-head { display: grid; grid-template-columns: auto 1fr auto; gap: .8rem; align-items: center; }
.type-head-text { min-width: 0; }
.type-head-name { font-size: 1.7rem; font-weight: 800; }
.type-head p { font-size: .9rem; color: var(--steel); }
.quick { display: grid; gap: .5rem; }
.quick-row { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .1rem; }
.quick-row button { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .5rem; min-height: 48px; padding: .35rem .9rem .35rem .4rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; }
.quick-row .type-icon { width: 36px; height: 36px; border-radius: 50%; font-size: 1rem; }
.quick-row .type-icon svg { width: 20px; height: 20px; }
.btn-ai { background: #E7EEF5; color: #1F4D73; border-color: #C7D6E4; width: 100%; }
.sticky-actions { position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); background: var(--paper); padding: .6rem 0; z-index: 5; }
@media (min-width: 900px) { .sticky-actions { bottom: 0; } }
.type-badge { font-size: .72rem; font-weight: 800; padding: .08rem .45rem; border-radius: 4px; background: var(--line-2); color: var(--ink-2); vertical-align: .15em; }

/* ---------- v4.1: sign in ---------- */
body.locked .appbar, body.locked main, body.locked .tabbar { display: none !important; }
.splash { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: var(--ink); }
.splash-mark { width: 64px; height: 80px; animation: pulse 1.2s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: .55; transform: scale(.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .splash-mark { animation: none; } }
.login {
  position: fixed; inset: 0; z-index: 85; overflow-y: auto; display: grid; place-items: center;
  padding: calc(1.5rem + env(safe-area-inset-top, 0px)) 1.1rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
  background: var(--ink);
  background-image: repeating-linear-gradient(-45deg, transparent 0 22px, rgba(245,184,0,.05) 22px 44px);
}
.login-card { width: min(100%, 400px); background: var(--surface); border-radius: 18px; padding: 1.5rem 1.3rem 1.2rem; display: grid; gap: .5rem; box-shadow: 0 18px 50px -20px rgba(0,0,0,.6); }
.login-brand { display: flex; align-items: center; gap: .55rem; font-family: var(--display); font-weight: 800; font-size: 1.3rem; color: var(--ink); }
.login-mark { width: 30px; height: 38px; }
.login-title { font-size: 2.2rem; font-weight: 800; margin-top: .6rem; }
.login-hint { color: var(--ink-2); margin-bottom: .6rem; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 4.6rem; }
.pw-toggle { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); min-height: 38px; padding: 0 .7rem; border: 0; border-radius: 8px; background: var(--line-2); font-weight: 700; font-size: .88rem; }
.login-err { min-height: 1.4em; color: var(--red); font-weight: 600; font-size: .93rem; margin: -.2rem 0 .3rem; }
.login-card.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.login-foot { text-align: center; color: var(--steel); font-size: .88rem; margin-top: .4rem; }
.account { display: grid; gap: .6rem; }
.account-row { display: flex; align-items: center; gap: .7rem; }
.account-row b { display: block; }
.account-row span { font-size: .88rem; color: var(--steel); }
.account-row .btn { margin-left: auto; }
.warn-box { font-size: .9rem; color: #7A2A18; background: #FFF0EC; border-left: 4px solid var(--red); padding: .6rem .8rem; border-radius: 6px; }

/* ---------- v5 additions ---------- */
.brand-logo { height: 30px; max-width: 120px; object-fit: contain; background: #fff; border-radius: 6px; padding: 2px; }
.asset-info { font-size: .9rem; color: var(--ink-2); background: var(--line-2); border-radius: var(--r-in); padding: .45rem .7rem; }
.due-row .minitag.OVER { background: var(--red); color: #fff; }
.due-row .minitag.SOON { background: var(--line); color: var(--ink); }
.sev-pill { font-size: .75rem; font-weight: 700; text-transform: capitalize; padding: .05rem .45rem; border-radius: 99px; background: var(--line-2); }
.sev-pill.critical, .sev-pill.high { background: var(--red); color: #fff; }
.review-line { font-weight: 600; padding: .5rem .75rem; border-radius: var(--r-in); background: var(--line-2); }
.review-line.approved { background: #DDEFE3; color: var(--green); }
.review-line.rejected { background: #F7DED8; color: var(--red); }
.review-line.pending { background: #FFF3CC; }
.sheet-dlg { border: 0; border-radius: var(--r-card); padding: 1.1rem; width: min(520px, 94vw); }
.sheet-dlg::backdrop { background: rgba(0,0,0,.45); }
.result-actions .review-line { grid-column: 1 / -1; }

/* Admin tab (Console inside the app) */
body.has-admin .tabbar { grid-template-columns: repeat(5, 1fr); }
.topnav .admin-link { color: #fff; border: 1px solid #4A5862; }

/* ---------- v5.1: assets, QR, home tiles, client note ---------- */
.home-tiles { display: grid; gap: .6rem; }
.home-tile { display: flex; align-items: center; gap: .8rem; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: .85rem 1rem; box-shadow: 0 1px 0 rgba(0,0,0,.04); }
.home-tile svg { width: 40px; height: 40px; padding: 8px; border-radius: 12px; background: var(--ink); color: var(--hivis); flex: none; }
.home-tile b { display: block; font-size: 1.05rem; }
.home-tile small { color: var(--steel); }
.home-tile:active { transform: scale(.99); }
.home-note { background: #FFF6D6; border: 1px solid var(--hivis); border-radius: var(--r-in); padding: .6rem .8rem; font-weight: 600; }
.page-title { font-family: var(--display, inherit); font-size: 1.8rem; margin: 0; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin: .3rem 0 .6rem; }
.chips button { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: .3rem .8rem; font-weight: 600; }
.chips button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.qr-box { display: grid; justify-items: center; gap: .4rem; padding: .8rem; background: #fff; border: 1px dashed var(--steel); border-radius: var(--r-in); }
.qr-box canvas, .qr-box img { width: 200px; height: 200px; image-rendering: pixelated; }
.qr-box b { font-size: 1.15rem; letter-spacing: .02em; }
.kv-mini { display: grid; grid-template-columns: auto 1fr; gap: .25rem .8rem; margin: 0 0 .6rem; }
.kv-mini dt { color: var(--steel); } .kv-mini dd { margin: 0; font-weight: 600; }
.row-btns { display: flex; gap: .5rem; flex-wrap: wrap; }
.row-btns .btn { flex: 1 1 auto; }
.locked-note { font-size: .88rem; color: var(--steel); }
input[readonly] { background: var(--line-2); }
.login-logo { max-height: 56px; max-width: 200px; object-fit: contain; }

/* ---------- v5.2 smoothness ---------- */
.view:not([hidden]) { animation: viewIn .28s cubic-bezier(.2,.8,.2,1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.row, .btn, .tag-stat, .home-tile, .cta-start { transition: transform .08s ease, box-shadow .15s ease, background .15s ease; }
.row:active, .btn:active, .tag-stat:active, .home-tile:active, .cta-start:active { transform: scale(.985); }
.sk-row { height: 62px; border-radius: 14px; margin-bottom: .55rem; background: linear-gradient(90deg, #E6E8E3 0%, #F2F3EF 40%, #E6E8E3 80%); background-size: 200% 100%; animation: skel 1.2s linear infinite; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
dialog.sheet-dlg[open] { animation: viewIn .22s cubic-bezier(.2,.8,.2,1); }
@media (prefers-reduced-motion: reduce) { .view:not([hidden]), dialog.sheet-dlg[open], .sk-row { animation: none; } }

/* ---------- v5.3 sign-in: same look as the Console ---------- */
.login { background: radial-gradient(900px 520px at 12% 8%, #1F3140 0%, transparent 60%), radial-gradient(700px 420px at 92% 92%, #3A3214 0%, transparent 60%), #0B131A !important; }
.login-card { border-top: 4px solid var(--hivis); border-radius: 18px; padding: 1.8rem 1.6rem 1.4rem; box-shadow: 0 24px 48px -12px rgba(0,0,0,.55); animation: viewIn .4s cubic-bezier(.2,.8,.2,1); }
.login-brand { font-size: 1.15rem; }
.login-tag { color: var(--steel); font-size: .88rem; margin-top: -.35rem; }
.login-title { font-size: 1.75rem; margin-top: .4rem; }
.login-card .field input { border-radius: 10px; }
.login-card .field input:focus { outline: none; border-color: #B88A00; box-shadow: 0 0 0 4px rgba(245,184,0,.22); }
.login-links { display: flex; justify-content: center; gap: 1rem; font-size: .86rem; margin-top: .2rem; }
.login-links a { color: var(--ink-2); }

/* =====================================================================
   v6 PREMIUM THEME (field app) - same design language as the Console.
   Neutral surfaces, Inter, dark primary actions; the client's brand colour
   (--hivis) is an accent. Result tags keep Green / Yellow / Red.
   ===================================================================== */
:root {
  --paper: #F6F7F9; --surface: #FFFFFF; --ink: #101828; --ink-2: #344054; --steel: #667085;
  --line: #E4E7EC; --line-2: #F2F4F7;
  --green: #15803D; --amber: #EAB308; --red: #DC2626;
  --display: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --text: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --r-in: 10px; --r-card: 16px; --r-btn: 12px;
  --sh-1: 0 1px 2px rgba(16, 24, 40, .05); --sh-2: 0 4px 12px -2px rgba(16, 24, 40, .08);
}
body { font-size: 15.5px; letter-spacing: -.005em; }
h1, h2, h3 { font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }

/* app bar: white */
.appbar { background: rgba(255,255,255,.94); color: var(--ink); border-bottom: 1px solid var(--line); backdrop-filter: saturate(1.4) blur(10px); }
.appbar-back { color: var(--ink); }
.brand { color: var(--ink); }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 1.12rem; letter-spacing: -.01em; }
.topnav button { color: var(--steel); font-weight: 500; }
.topnav button:hover { color: var(--ink); background: var(--line-2); }
.topnav button.on { color: var(--ink); background: var(--line-2); font-weight: 600; }
.topnav .admin-link { color: var(--ink-2); border-color: var(--line); }
.icon-btn.light { color: var(--ink-2); background: var(--line-2); }

/* buttons: dark primary, white secondary */
.btn { border-radius: var(--r-btn); font-weight: 600; font-size: .98rem; border-width: 1px; box-shadow: var(--sh-1); }
.btn-hivis { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-hivis:active { background: #1D2939; }
.btn-ink { background: var(--ink); }
.btn-line { background: #fff; color: var(--ink-2); border-color: #D0D5DD; }
.btn-line:hover { border-color: #98A2B3; color: var(--ink); }
.btn-danger { border-color: #FDA29B; color: #B42318; }
.btn-xl b { font-family: var(--display); font-weight: 700; font-size: 1.2rem; letter-spacing: -.01em; }
.link-btn { color: var(--ink-2); text-decoration-color: var(--hivis); }

/* home */
.greet { color: var(--steel); font-weight: 500; }
.home-title { font-size: 1.85rem; font-weight: 700; letter-spacing: -.03em; }
.cta-start { background: linear-gradient(135deg, #101828 0%, #1D2939 100%); background-image: none; background-color: #101828; color: #fff;
  border-radius: 18px; padding: 1.15rem 1.1rem; box-shadow: 0 12px 24px -12px rgba(16,24,40,.45); position: relative; overflow: hidden; }
.cta-start::after { content: ''; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: var(--hivis); opacity: .18; }
.cta-start svg { width: 48px; height: 48px; padding: 10px; border-radius: 14px; background: var(--hivis); color: var(--hivis-ink); flex: none; }
.cta-start b { font-family: var(--display); font-weight: 700; font-size: 1.35rem; letter-spacing: -.02em; }
.cta-start small { color: #D0D5DD; font-weight: 400; }
.install-banner { border: 1px dashed #D0D5DD; background: var(--surface); }
.tag-stat { border-radius: 14px; box-shadow: var(--sh-1); }
.tag-stat b { font-family: var(--display); font-weight: 700; font-size: 1.8rem; letter-spacing: -.02em; }
.tag-stat span { font-weight: 500; }
.tag-stat.YELLOW { color: #422006; }
.sec-title { font-weight: 600; letter-spacing: -.01em; }
.home-tile { border-color: var(--line); box-shadow: var(--sh-1); }
.home-tile svg { background: var(--line-2); color: var(--ink); }
.home-note { background: #FFFAEB; border-color: #FEDF89; color: #93370D; font-weight: 500; }

/* cards, rows, lists */
.card { border-color: var(--line); box-shadow: var(--sh-1); border-radius: var(--r-card); }
.row { border-color: var(--line) !important; box-shadow: var(--sh-1); }
.row-title { font-weight: 600; }
.row-sub { color: var(--steel); }
.minitag { border-radius: 8px; }
.empty { color: var(--steel); }

/* forms */
.field span, .field > span { color: var(--ink-2); font-weight: 500; }
.field input, .field select, .field textarea, .search input { border: 1px solid #D0D5DD; border-radius: var(--r-in); background: #fff; box-shadow: var(--sh-1); }
.field input:focus, .field select:focus, .field textarea:focus, .search input:focus { outline: none; border-color: var(--ink-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--hivis) 22%, transparent); }
input[readonly] { background: var(--line-2); color: var(--steel); }
.chips button { border-color: #D0D5DD; color: var(--ink-2); font-weight: 500; }
.chips button.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* tab bar */
.tabbar { background: rgba(255,255,255,.97); border-top: 1px solid var(--line); backdrop-filter: blur(10px); }
.tabbar button { color: #98A2B3; font-weight: 500; }
.tabbar button.on { color: var(--ink); font-weight: 600; }
.tabbar button.on::after { background: var(--hivis); }
.tabbar .tab-main svg { background: var(--ink); color: #fff; }

/* sign-in: light, same as the Console */
.login { background: #F6F7F9 !important; }
.login-card { border: 1px solid var(--line); border-top: 0; border-radius: 18px; box-shadow: 0 20px 24px -4px rgba(16,24,40,.08), 0 8px 8px -4px rgba(16,24,40,.03); }
.login-title { font-family: var(--display); font-weight: 700; font-size: 1.6rem; letter-spacing: -.02em; }
.login-tag { color: var(--steel); }
.login-card .field input:focus { border-color: var(--ink-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--hivis) 22%, transparent); }

/* sheets / dialogs */
.sheet-dlg { border-radius: 20px; box-shadow: 0 24px 48px -12px rgba(16,24,40,.25); }
.qr-box { border-color: #D0D5DD; }
/* hide thin scrollbars on horizontal chip rows; readable inactive tab labels (WCAG AA) */
[role=tablist] { scrollbar-width: none; } [role=tablist]::-webkit-scrollbar { display: none; }
.tabbar button { color: #667085; }

/* v6.2: per-check notes, reviewer verdicts, drafts */
.inote, .rnote { display: block; margin-top: .3rem; padding: .35rem .55rem; border-radius: 8px; font-size: .85rem; }
.inote { background: #EFF8FF; color: #175CD3; }
.rnote.yes { background: #ECFDF3; color: #067647; } .rnote.no { background: #FEF3F2; color: #B42318; }
.note-btn { display: inline-block; margin-top: .35rem; border: 0; background: none; color: var(--ink-2); font-weight: 600; font-size: .84rem; padding: 0; text-decoration: underline; text-decoration-color: var(--hivis); text-underline-offset: 3px; }
.note-edit { display: grid; gap: .4rem; margin-top: .4rem; }
.note-edit textarea { width: 100%; border: 1px solid #D0D5DD; border-radius: 10px; padding: .5rem .6rem; font: inherit; }
.draft-row { display: flex; align-items: center; gap: .7rem; padding: .7rem .8rem; background: #fff; border: 1px dashed #D0D5DD; border-radius: 14px; }
.draft-row .row-btns { flex: none; }
#installStores:empty { display: none; }
.draft-row { flex-wrap: wrap; min-width: 0; }
.draft-row .row-main { min-width: 0; flex: 1 1 150px; }
.draft-row .row-title, .draft-row .row-sub { white-space: normal; }
.draft-row .row-btns { flex: 0 0 auto; margin-left: auto; }
.list { min-width: 0; }

/* v6.3: device fonts only (no third-party font requests) */
:root { --display: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Noto Sans Devanagari', sans-serif; --text: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Noto Sans Devanagari', sans-serif; }
body { font-family: var(--text); }

/* v6.3: storage notice, legal links */
.store-note { position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 90; display: flex; gap: .8rem; align-items: center; padding: .8rem 1rem; background: #101828; color: #fff; border-radius: 14px; box-shadow: 0 12px 24px -8px rgba(16,24,40,.4); font-size: .9rem; max-width: 640px; margin: 0 auto; }
.store-note a { color: #FEDF89; }
.store-note .btn { flex: none; background: #fff; color: #101828; border-color: #fff; }
.login-legal { text-align: center; font-size: .82rem; color: var(--steel); margin: .6rem 0 0; }
.login-legal a { color: var(--steel); }
#setPrivacy .switch { margin-bottom: .6rem; }
:focus-visible { outline: 3px solid #175CD3; outline-offset: 2px; }

/* v6.3 accessibility: avatar letters readable on any brand colour */
.avatar, .avatar-btn .avatar, .profile-avatar, .set-avatar { background: #101828 !important; color: #fff !important; }
/* bottom bar: as many equal columns as visible buttons (4 or 5) */
.tabbar { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr; }
.tabbar > button[hidden] { display: none; }
body.has-admin .tabbar { grid-template-columns: none; }

/* =================== v6.4: scanner, asset card, Inspect button =================== */
/* Inspect (centre of the bottom bar): the company's colour, readable icon */
.tabbar .tab-main svg { background: var(--hivis); color: var(--hivis-ink); border-radius: 12px; box-shadow: 0 4px 10px -4px color-mix(in srgb, var(--hivis) 70%, #000); }
.tabbar .tab-main.on svg { box-shadow: 0 0 0 3px color-mix(in srgb, var(--hivis) 35%, transparent), 0 4px 10px -4px color-mix(in srgb, var(--hivis) 70%, #000); }

/* live scanner: full screen camera with a framed target */
.scan-dlg { padding: 0; border: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; background: #000; color: #fff; }
.scan-dlg::backdrop { background: #000; }
.scan-stage { position: relative; width: 100%; height: 100%; overflow: hidden; }
.scan-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: absolute; left: 50%; top: 46%; width: min(72vw, 320px); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 22px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .55); }
.scan-frame i { position: absolute; width: 38px; height: 38px; border: 4px solid var(--hivis, #F5B800); }
.scan-frame .c1 { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-radius: 20px 0 0 0; }
.scan-frame .c2 { top: -2px; right: -2px; border-left: 0; border-bottom: 0; border-radius: 0 20px 0 0; }
.scan-frame .c3 { bottom: -2px; left: -2px; border-right: 0; border-top: 0; border-radius: 0 0 0 20px; }
.scan-frame .c4 { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-radius: 0 0 20px 0; }
.scan-line { position: absolute; left: 8%; right: 8%; height: 2px; background: linear-gradient(90deg, transparent, var(--hivis, #F5B800), transparent); top: 10%; animation: scanline 2.2s ease-in-out infinite; }
@keyframes scanline { 0%, 100% { top: 10%; } 50% { top: 88%; } }
@media (prefers-reduced-motion: reduce) { .scan-line { animation: none; top: 50%; } }
.scan-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 12px; }
.scan-top b { font-size: 1.05rem; font-weight: 600; }
.scan-round { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.16); color: #fff; display: grid; place-items: center; backdrop-filter: blur(6px); }
.scan-round svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.scan-round.on { background: var(--hivis, #F5B800); color: var(--hivis-ink, #101828); }
.scan-hint { position: absolute; left: 16px; right: 16px; top: calc(46% + min(36vw, 160px) + 22px); margin: 0; text-align: center; font-size: .98rem; line-height: 1.45; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.scan-hint.err { background: rgba(180, 35, 24, .92); padding: .7rem .9rem; border-radius: 12px; text-shadow: none; }
.scan-bottom { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: .7rem; justify-content: center; padding: 14px 14px calc(22px + env(safe-area-inset-bottom, 0px)); }
.scan-pill { border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.12); color: #fff; border-radius: 999px; padding: .65rem 1.1rem; font: 600 .95rem var(--text); min-height: 44px; display: inline-flex; align-items: center; backdrop-filter: blur(6px); cursor: pointer; }

/* "Scan QR label" card on Inspect */
.scan-card { width: 100%; display: flex; align-items: center; gap: .9rem; text-align: left; padding: 1rem; margin: .2rem 0 .4rem; border-radius: 18px; border: 0; color: #fff; background: linear-gradient(135deg, #101828, #1D2939); box-shadow: 0 12px 24px -14px rgba(16,24,40,.6); }
.scan-card-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--hivis); color: var(--hivis-ink); display: grid; place-items: center; flex: none; }
.scan-card-icon svg { width: 28px; height: 28px; }
.scan-card b { display: block; font-size: 1.12rem; letter-spacing: -.01em; }
.scan-card small { display: block; color: #D0D5DD; font-size: .86rem; margin-top: .15rem; line-height: 1.35; }
.scan-card .chev { width: 22px; height: 22px; margin-left: auto; flex: none; fill: none; stroke: #98A2B3; stroke-width: 2.4; stroke-linecap: round; }
.or-line { display: flex; align-items: center; gap: .7rem; color: var(--steel); font-size: .85rem; margin: .6rem 0 .2rem; }
.or-line::before, .or-line::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* scan icon inside the asset ID field */
.field-scan { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 10px; border: 0; background: var(--ink); color: #fff; display: grid; place-items: center; }
.field-scan svg { width: 22px; height: 22px; }
.pw-wrap #sfId { padding-right: 54px; }

/* asset card (tag view) */
.as-head { display: flex; align-items: flex-start; gap: .4rem; margin-bottom: .6rem; }
.as-head > div { flex: 1; min-width: 0; }
.as-head .card-title { font-size: 1.35rem; margin: 0; overflow-wrap: anywhere; }
.as-sub { margin: .15rem 0 0; color: var(--steel); font-size: .92rem; }
.icon-round { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink-2); display: grid; place-items: center; flex: none; }
.icon-round svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.qr-panel { background: var(--line-2); border-radius: 16px; padding: 1rem; display: grid; justify-items: center; gap: .55rem; }
.qr-card { background: #fff; border-radius: 12px; padding: 12px; width: min(62vw, 230px); box-shadow: 0 1px 2px rgba(16,24,40,.06); }
.qr-card img { display: block; width: 100%; height: auto; aspect-ratio: 1; image-rendering: pixelated; }
.qr-url { border: 0; background: none; color: var(--ink-2); font-size: .8rem; text-decoration: underline; text-decoration-color: #D0D5DD; overflow-wrap: anywhere; text-align: center; padding: .2rem; }
.as-dl { display: grid; grid-template-columns: max-content 1fr; gap: .55rem 1rem; margin: 1rem 0 .4rem; font-size: .95rem; }
.as-dl dt { color: var(--steel); } .as-dl dd { margin: 0; font-weight: 600; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.tagpill { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.tagpill.GREEN { background: #DCFAE6; color: #067647; } .tagpill.YELLOW { background: #FEF0C7; color: #93370D; } .tagpill.RED { background: #FEE4E2; color: #B42318; } .tagpill.NONE { background: #F2F4F7; color: #475467; }
.due-late { color: #B42318; }
.as-note { background: #ECFDF3; color: #067647; border-radius: 12px; padding: .65rem .8rem; margin: 0 0 .8rem; font-weight: 600; }
.as-del { border: 1px solid #FDA29B; color: #B42318; background: #fff; border-radius: 10px; padding: .45rem .8rem; font-weight: 600; margin-top: .6rem; order: 99; }
.as-btns { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; margin-top: .8rem; }
.as-btns .btn { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .5rem .6rem; font-size: .95rem; }
.as-btns .btn svg { width: 19px; height: 19px; flex: none; }
.as-btns .btn.wide { grid-column: 1 / -1; }
.home-tiles { display: grid; gap: .7rem; }
.as-del { display: inline-block; margin-top: .9rem; }
#assetDlg .row-btns:empty { display: none; }

.img-missing { display: inline-grid; place-items: center; text-align: center; border-radius: 10px; border: 1px dashed #D0D5DD; background: #F9FAFB; color: #667085; font-size: .68rem; line-height: 1.2; padding: 2px; flex: none; }
#setTypes .row-title { white-space: normal; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
#setTypes .row-title > * { flex: none; }

/* v6.7 brand: Paarik burgundy, Poppins headings, logo mark */
:root { --display: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif; --brand-900: #3B0E21; --brand-700: #6E2140; --brand-500: #A1405F; --brand-100: #F7E6EC; }
h1, h2, h3, .page-title, .home-title, .card-title, .brand-name, .login-title, .btn-xl b, .cta-start b, .scan-card b { font-family: var(--display); }
.brand-mark { width: 28px; height: 28px; object-fit: contain; }
.login-mark { width: 34px; height: 34px; object-fit: contain; }
.splash-mark { width: 64px; height: 64px; object-fit: contain; }
.brand-name { font-weight: 700; letter-spacing: -.01em; }
.cta-start { background: linear-gradient(135deg, #3B0E21 0%, #6E2140 100%); box-shadow: 0 14px 28px -14px rgba(110,33,64,.7); }
.cta-start::after { background: #E9A9BD; opacity: .22; }
.scan-card { background: linear-gradient(135deg, #3B0E21, #6E2140); }
.scan-frame i { border-color: #F6C3D2; }
.scan-line { background: linear-gradient(90deg, transparent, #F6C3D2, transparent); }
.scan-round.on { background: #F6C3D2; color: #3B0E21; }
.tabbar button.on::after { background: var(--hivis); }

/* ---------- v6.8: several photos per view, manual checklist ---------- */
.shot-strip { display: flex; gap: .45rem; align-items: center; padding: .55rem .2rem 0; overflow-x: auto; }
.ss-item { position: relative; flex: none; }
.ss-item img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; border: 2px solid transparent; display: block; cursor: zoom-in; }
.ss-item.main img { border-color: var(--hivis); }
.ss-x { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: #101828; color: #fff; font-size: .9rem; line-height: 1; display: grid; place-items: center; }
.ss-add { flex: none; min-height: 56px; padding: 0 .8rem; border-radius: 10px; border: 1.5px dashed #98A2B3; background: #fff; color: var(--ink); font-weight: 700; display: inline-flex; align-items: center; gap: .35rem; }
.ss-add svg { width: 18px; height: 18px; }
.ss-add.need { border-color: #B42318; color: #B42318; }
.ss-count { color: var(--steel); font-size: .78rem; margin-left: auto; padding-right: .2rem; white-space: nowrap; }
.cg-more { display: flex; gap: .4rem; padding: 0 1rem .6rem; flex-wrap: wrap; }
.cg-more img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; cursor: zoom-in; }
.method-note { margin: .2rem 0 0; color: var(--steel); font-size: .88rem; text-align: center; }
.man-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.eyebrow-sm { margin: 0; text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; font-weight: 700; color: var(--hivis); }
.man-progress { min-width: 140px; text-align: right; } .man-progress b { font-size: 1.3rem; } .man-progress span { color: var(--steel); font-size: .8rem; margin-left: .3rem; }
.man-bar { height: 6px; border-radius: 6px; background: #EAECF0; margin-top: .3rem; overflow: hidden; } .man-bar i { display: block; height: 100%; background: var(--hivis); transition: width .25s ease; }
.man-help { background: #F9FAFB; border: 1px solid #EAECF0; border-radius: 12px; padding: .65rem .8rem; font-size: .9rem; color: var(--ink-2); }
.man-group { background: #fff; border: 1px solid #EAECF0; border-radius: 16px; padding: .9rem; margin-top: .8rem; }
.man-gh h2 { margin: 0; font-size: 1.05rem; }
.man-photos { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; margin: .6rem 0 .2rem; }
.man-checks { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .55rem; }
.man-row { border: 1px solid #EAECF0; border-radius: 12px; padding: .7rem; display: grid; gap: .55rem; transition: border-color .2s ease, box-shadow .3s ease; }
.man-row.done { border-color: #D0D5DD; background: #FCFCFD; }
.man-row.flash { box-shadow: 0 0 0 3px rgba(180,35,24,.35); border-color: #B42318; }
.man-q .pn { font-weight: 700; display: block; } .man-q .prule { display: block; color: var(--steel); font-size: .86rem; }
.man-ans { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.ma { min-height: 46px; border-radius: 10px; border: 1.5px solid #D0D5DD; background: #fff; font: 700 .95rem var(--text); color: var(--ink-2); }
.ma-ok.on { background: #067647; border-color: #067647; color: #fff; }
.ma-fail.on { background: #B42318; border-color: #B42318; color: #fff; }
.ma-na.on { background: #475467; border-color: #475467; color: #fff; }
.man-note { font-size: .88rem; }
.man-foot { position: sticky; bottom: calc(70px + env(safe-area-inset-bottom, 0px)); display: grid; grid-template-columns: 1fr 2fr; gap: .6rem; margin-top: 1rem; padding: .7rem 0; background: linear-gradient(transparent, var(--bg, #F6F7F9) 30%); }
.ic.na { background: #EAECF0; color: #475467; }
@media (min-width: 900px) { .man-foot { bottom: 0; } }
#shotStrip { padding: .55rem .9rem 0; }
#view-capture #shotStrip .ss-add { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.45); }
#view-capture #shotStrip .ss-count { color: #D0D5DD; }
