:root {
  --navy: #12325b; --navy-2: #1d4a80; --saffron: #f28c28; --bg: #f3f5f9; --card: #fff; --ink: #18202c; --muted: #657084; --line: #dfe4ec;
  --ok: #1e8e4f; --ok-bg: #e5f5ec; --warn: #b26a00; --warn-bg: #fff3df; --danger: #c62828; --danger-bg: #fdeaea; --info-bg: #e8f0fb; --foreign: #6a3cbc; --foreign-bg: #f0e9fb;
  --r: 12px; --shadow: 0 1px 2px rgba(16, 32, 60, .06), 0 4px 14px rgba(16, 32, 60, .05);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif; color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 15px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
body.no-scroll { overflow: hidden; }
a { color: var(--navy-2); }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; } h4 { font-size: .95rem; margin-top: .6em; }
p { margin: .3em 0 .7em; }
.muted { color: var(--muted); } .small, small { font-size: .82rem; } .mono { font-family: ui-monospace, Consolas, monospace; letter-spacing: .02em; }
.boot { padding: 40vh 0; text-align: center; color: var(--muted); }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* buttons and inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; border: 1px solid var(--navy); background: var(--navy); color: #fff; padding: .55em 1em; border-radius: 9px;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; min-height: 40px; white-space: nowrap; }
.btn:hover { background: var(--navy-2); }
.btn.ghost { background: #fff; color: var(--navy); border-color: var(--line); } .btn.ghost:hover { border-color: var(--navy); }
.btn.sm { min-height: 32px; padding: .3em .7em; font-size: .85rem; } .btn.xs { min-height: 26px; padding: .15em .5em; font-size: .78rem; }
.btn.big { min-height: 48px; padding: .7em 1.3em; font-size: 1rem; } .btn.full { width: 100%; }
.btn:disabled { opacity: .6; cursor: progress; }
label { display: flex; flex-direction: column; gap: .25em; font-size: .85rem; font-weight: 600; color: #3a4556; }
input, select, textarea { font: inherit; font-weight: 400; color: var(--ink); border: 1px solid #cdd4df; border-radius: 8px; padding: .55em .65em; background: #fff; min-height: 42px; width: 100%; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9cc0f0; border-color: var(--navy-2); }
label.check { flex-direction: row; align-items: flex-start; gap: .6em; font-weight: 500; }
label.check input { width: 20px; min-height: 20px; margin-top: .15em; flex: none; }
.spin { width: 14px; height: 14px; border: 2px solid rgba(255, 255, 255, .5); border-top-color: #fff; border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* layout helpers */
.row { display: flex; gap: .5em; align-items: center; } .row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; } .row.end { justify-content: flex-end; margin-top: .6em; }
.row.center { justify-content: center; } .row.gap { gap: .9em; } .grow { flex: 1; min-width: 180px; }
.grid1, .grid2, .grid3, .grid4 { display: grid; gap: .8em; grid-template-columns: 1fr; margin-bottom: .6em; }
@media (min-width: 640px) { .grid2, .grid3, .grid4 { grid-template-columns: 1fr 1fr; } .span2, .span3, .span4 { grid-column: 1 / -1; } }
@media (min-width: 980px) { .grid3 { grid-template-columns: repeat(3, 1fr); } .grid4 { grid-template-columns: repeat(4, 1fr); } }
.grid2 > h4, .grid3 > h4, .grid4 > h4 { grid-column: 1 / -1; margin: .4em 0 0; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; border: 1px solid #e8ecf2; }
.card.soft { background: #f8fafc; box-shadow: none; } .card.narrow { max-width: 820px; margin: 0 auto; }
.two-col { display: grid; gap: 14px; grid-template-columns: 1fr; } .two-col > .card { margin: 0 0 14px; }
@media (min-width: 980px) { .two-col { grid-template-columns: 1fr 1fr; } .two-col.wide-left { grid-template-columns: 1.5fr 1fr; } }
.nowrap { white-space: nowrap; }

/* app shell */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1em; background: var(--navy); color: #fff; padding: 8px 14px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: .5em; color: #fff; text-decoration: none; font-size: 1.15rem; }
.brand img { width: 32px; height: 32px; } .brand b { color: var(--saffron); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 600; letter-spacing: .01em; }
.brand-tag { font-size: .68rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #c4d2e6; border-top: 1px solid rgba(255,255,255,.25); padding-top: 2px; margin-top: 2px; white-space: nowrap; }
.brand:hover .brand-tag { color: #fff; }
.who { display: flex; align-items: center; gap: .7em; } .who-text { display: flex; flex-direction: column; text-align: right; line-height: 1.15; }
.who-text small { color: #c4d2e6; } .who .btn.ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: #8a96a8; flex: none; } .live-dot.on { background: #3ddc84; box-shadow: 0 0 0 4px rgba(61, 220, 132, .2); }
.side { position: fixed; z-index: 15; background: #fff; border-top: 1px solid var(--line); bottom: 0; left: 0; right: 0; display: flex; overflow-x: auto; padding-bottom: env(safe-area-inset-bottom); }
.side a { flex: 1; min-width: 72px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 600; }
.side a.on { color: var(--navy); } .side a.on .ic { stroke: var(--saffron); }
.main { padding: 14px 14px 90px; max-width: 1280px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6em; margin-bottom: 10px; }
.page-actions { display: flex; gap: .5em; } .picker { min-width: 220px; }
@media (max-width: 640px) { .who-text small { display: none; } .who-text b { font-size: .85rem; } .brand-tag { font-size: .58rem; letter-spacing: .06em; } }
@media (max-width: 420px) { .brand-tag { display: none; } }
@media (min-width: 900px) {
  .side { top: 56px; bottom: 0; right: auto; width: 210px; flex-direction: column; border-top: 0; border-right: 1px solid var(--line); padding: 12px 8px; }
  .side a { flex: none; flex-direction: row; gap: .7em; font-size: .92rem; padding: 10px 12px; border-radius: 9px; }
  .side a.on { background: #eef3fa; } .main { margin-left: 210px; padding: 22px 26px 40px; }
}

/* stats and tags */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
@media (min-width: 700px) { .stats { grid-template-columns: repeat(3, 1fr); } .stats.five { grid-template-columns: repeat(5, 1fr); } }
.stat { background: #fff; border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); text-decoration: none; color: inherit; display: flex; flex-direction: column; border: 1px solid #e8ecf2; border-top: 4px solid var(--navy); }
.stat b { font-size: 1.9rem; line-height: 1.1; } .stat b small { font-size: .9rem; color: var(--muted); font-weight: 500; } .stat span { color: var(--muted); font-size: .85rem; }
.stat.warn { border-top-color: var(--saffron); } .stat.danger { border-top-color: var(--danger); } .stat.danger b { color: var(--danger); }
a.stat:hover { border-color: #b8c7dc; }
.tag { display: inline-block; font-size: .74rem; font-weight: 700; padding: .12em .55em; border-radius: 99px; background: #edf0f5; color: #475266; vertical-align: middle; white-space: nowrap; }
.tag.indian { background: var(--ok-bg); color: var(--ok); } .tag.foreign { background: var(--foreign-bg); color: var(--foreign); } .tag.staying { background: var(--info-bg); color: var(--navy-2); }
.tag.danger { background: var(--danger-bg); color: var(--danger); } .tag.warnt { background: var(--warn-bg); color: var(--warn); } .tag.sm { font-size: .68rem; }
.badge { font-size: .75rem; font-weight: 700; padding: .2em .6em; border-radius: 6px; white-space: nowrap; } .badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.warn { background: var(--warn-bg); color: var(--warn); }
.banner { padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; background: var(--info-bg); }
.banner.warn { background: var(--warn-bg); color: #6b4200; } .banner.danger { background: var(--danger-bg); color: #7d1414; } .banner.ok { background: var(--ok-bg); color: #145c33; }

/* tables */
.tbl-wrap { overflow-x: auto; background: #fff; border-radius: var(--r); box-shadow: var(--shadow); margin-bottom: 14px; border: 1px solid #e8ecf2; }
.card .tbl-wrap { box-shadow: none; border: 0; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: #f7f9fc; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid #edf0f4; vertical-align: top; }
.tbl tr.click, .tbl.results tr[data-b], .tbl.reg tr[data-b] { cursor: pointer; } .tbl tr.click:hover td, .tbl.results tr:hover td { background: #f6f9fd; }
.tbl.small td { padding: 6px 8px; font-size: .82rem; } .tbl td.detail { max-width: 340px; word-break: break-word; font-size: .78rem; color: var(--muted); }

/* hotel portal */
.hotel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1em; }
.daily { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .8em; border-left: 5px solid var(--line); }
.daily.due { border-left-color: var(--saffron); background: #fffaf2; } .daily.done { border-left-color: var(--ok); }
.notice { border-left: 4px solid var(--navy-2); padding: 6px 10px; margin: 8px 0; background: #f7f9fc; border-radius: 6px; } .notice.expiry { border-color: var(--saffron); } .notice.daily_close { border-color: var(--danger); }
.notice p { margin: 2px 0; }
.rooms { display: grid; gap: 10px; margin-bottom: 16px; } @media (min-width: 900px) { .rooms { grid-template-columns: 1fr 1fr; } }
.room-card { display: flex; gap: 12px; align-items: center; background: #fff; border-radius: var(--r); padding: 12px; box-shadow: var(--shadow); cursor: pointer; border: 1px solid #e8ecf2; }
.room-card.out { opacity: .7; } .room-card:hover { border-color: #b8c7dc; }
.room-no { min-width: 56px; height: 56px; border-radius: 10px; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; }
.room-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; } .room-body .g { display: block; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.stepper button { width: 44px; height: 42px; border: 0; background: #f2f5f9; font-size: 1.3rem; cursor: pointer; } .stepper b { min-width: 40px; text-align: center; font-size: 1.15rem; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 12px; background: #fff; flex-wrap: wrap; }
.seg button, .seg a { border: 0; background: #fff; padding: .5em 1em; font: inherit; font-weight: 600; cursor: pointer; color: var(--muted); text-decoration: none; }
.seg .on { background: var(--navy); color: #fff; }
.guest-form { border-left: 5px solid var(--navy); }
.demo-pick select { border-style: dashed; background: #fffaf2; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 10px 0; } @media (min-width: 700px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { position: relative; aspect-ratio: 1.58; border: 2px dashed #b9c4d4; border-radius: 12px; background: #f7f9fc; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 0; overflow: hidden; font: inherit; color: var(--muted); }
.tile.req { border-color: #e2a35a; } .tile.has { border-style: solid; border-color: var(--ok); }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile-ic { font-size: 1.6rem; } .tile-l { position: relative; font-weight: 700; font-size: .85rem; }
.tile.has .tile-l { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(18, 50, 91, .85); color: #fff; padding: 3px 6px; display: flex; justify-content: space-between; }
.ocr-status { font-size: .88rem; padding: 8px 10px; border-radius: 8px; background: #f2f5f9; margin-bottom: 10px; min-height: 1em; }
.ocr-status:empty { display: none; } .ocr-status.ok { background: var(--ok-bg); color: #145c33; } .ocr-status.warn { background: var(--warn-bg); color: #6b4200; } .ocr-status.busy { background: var(--info-bg); }
.cap-opts { display: grid; gap: 10px; margin: 12px 0; }
.webcam video { width: 100%; border-radius: 10px; background: #000; max-height: 60vh; }
.reminder, .red-alert { text-align: center; } .big-ic { font-size: 3rem; }
.red-alert { border: 3px solid var(--danger); border-radius: 12px; padding: 14px; background: var(--danger-bg); } .red-alert h2 { color: var(--danger); }

/* register (print) */
.register { background: #fff; padding: 16px; border-radius: var(--r); box-shadow: var(--shadow); }
.reg-head { text-align: center; border-bottom: 2px solid #222; margin-bottom: 10px; } .tbl.reg td.sig { min-width: 90px; }
.reg-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1em; margin-top: 12px; font-size: .85rem; }
.print-only { display: none; }

/* police */
.unit-bar { display: flex; justify-content: space-between; align-items: center; gap: 1em; flex-wrap: wrap; }
.bars { display: flex; align-items: flex-end; gap: 2px; padding-top: 16px; }
.bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bar i { display: block; width: 70%; background: linear-gradient(var(--navy-2), var(--navy)); border-radius: 4px 4px 0 0; min-height: 2px; }
.bar-v { font-size: .68rem; color: var(--muted); } .bar-l { font-size: .68rem; color: var(--muted); margin-top: 3px; }
.map { width: 100%; height: auto; } .map-bg { fill: #eef3f8; }
.pin circle { fill: rgba(29, 74, 128, .8); stroke: #fff; stroke-width: 2; cursor: pointer; } .pin.unv circle { fill: rgba(242, 140, 40, .9); }
.pin-n { fill: #fff; font-size: 14px; font-weight: 700; pointer-events: none; } .pin-l { fill: #3a4556; font-size: 14px; pointer-events: none; }
.recent { padding: 8px 0; border-bottom: 1px solid #edf0f4; cursor: pointer; } .recent:last-child { border: 0; }
.alert-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid #edf0f4; cursor: pointer; }
.sev { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; padding: .15em .5em; border-radius: 5px; background: #edf0f5; white-space: nowrap; }
.high .sev { background: var(--danger); color: #fff; } .medium .sev { background: var(--warn-bg); color: var(--warn); } .low .sev { background: var(--info-bg); color: var(--navy-2); }
.alert-card { background: #fff; border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); margin-bottom: 10px; border-left: 5px solid var(--line); }
.alert-card.high { border-left-color: var(--danger); background: #fff8f8; } .alert-card.medium { border-left-color: var(--saffron); }
.alert-strip { background: var(--danger); color: #fff; font-weight: 700; padding: 8px 12px; border-radius: 8px; margin-bottom: 10px; }
.filters label[hidden] { display: none; }
.note { background: #fffbe8; padding: 6px 10px; border-radius: 6px; }
.kv-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 16px; margin: 10px 0; } @media (min-width: 700px) { .kv-grid { grid-template-columns: repeat(4, 1fr); } }
.kv-grid > div { display: flex; flex-direction: column; } .kv-grid small { color: var(--muted); }
.guest-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 12px 0; }
.docs { display: flex; flex-wrap: wrap; gap: 10px; } .doc { display: flex; flex-direction: column; text-decoration: none; font-size: .78rem; color: var(--muted); }
.doc img { width: 180px; height: 114px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #f3f5f9; }
.person-head { display: flex; gap: 14px; align-items: flex-start; } .avatar { width: 84px; height: 84px; border-radius: 12px; object-fit: cover; background: #dfe5ee; flex: none; }

/* admin */
.tree, .tree ul { list-style: none; margin: 0; padding-left: 18px; } .tree { padding-left: 0; }
.tree li { position: relative; } .tree ul li::before { content: ''; position: absolute; left: -12px; top: 0; bottom: 50%; border-left: 1px solid #c8d0dc; border-bottom: 1px solid #c8d0dc; width: 10px; }
.tnode { display: flex; flex-wrap: wrap; align-items: center; gap: .5em; padding: 6px 8px; margin: 4px 0; border-radius: 8px; background: #f7f9fc; } .tnode.off { opacity: .5; }
.lvl { font-size: .68rem; font-weight: 800; text-transform: uppercase; color: var(--saffron); } .tact { margin-left: auto; display: flex; gap: 4px; }

/* modal and toasts */
.modal-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(12, 22, 40, .55); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 10px; overflow-y: auto; }
.modal { position: relative; background: #fff; border-radius: 14px; width: 100%; max-width: 560px; padding: 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.modal.wide { max-width: 980px; } .modal-x { position: absolute; right: 8px; top: 6px; border: 0; background: none; font-size: 1.8rem; cursor: pointer; color: var(--muted); width: 40px; height: 40px; }
.modal h3 { padding-right: 36px; }
#toasts { position: fixed; z-index: 60; right: 12px; bottom: 80px; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 24px)); }
.toast { background: var(--navy); color: #fff; padding: 12px 14px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); transition: opacity .4s, transform .4s; font-size: .9rem; }
.toast.ok { background: var(--ok); } .toast.err { background: var(--danger); } .toast.warn { background: #8a5200; } .toast.out { opacity: 0; transform: translateY(10px); }
.error-card { border-left: 5px solid var(--danger); }

/* public */
.public { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.pub-top { background: var(--navy); }
.pub-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; flex-wrap: wrap; gap: .5em; }
.pub-top nav { display: flex; gap: 1em; } .pub-top nav a { color: #dbe6f5; text-decoration: none; font-weight: 600; }
.public main { flex: 1; padding: 10px 14px 30px; max-width: 1180px; width: 100%; margin: 0 auto; }
.public footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 16px; }
.login-wrap { display: grid; gap: 20px; } @media (min-width: 960px) { .login-wrap { grid-template-columns: 1fr 460px; align-items: start; } }
.hero { color: #fff; padding: 22px; background: var(--navy); border-radius: var(--r); } .hero h1 { font-size: 2rem; } .hero p { color: #d4e0f0; font-size: 1.05rem; }
.ticks { padding-left: 1.1em; color: #e8eef7; } .ticks li { margin: .3em 0; }
.login-card form { display: grid; gap: 12px; margin-bottom: 10px; }
.demo-acc h4 { margin: .8em 0 .3em; font-size: .78rem; text-transform: uppercase; color: var(--muted); letter-spacing: .04em; }
.acc-list { display: flex; flex-wrap: wrap; gap: 6px; }
.acc { border: 1px solid var(--line); background: #f9fbfd; border-radius: 8px; padding: 5px 9px; cursor: pointer; text-align: left; display: flex; flex-direction: column; font: inherit; font-size: .82rem; }
.acc:hover { border-color: var(--navy); } .acc small { color: var(--muted); font-size: .72rem; }
.samples { display: grid; gap: 14px; } @media (min-width: 900px) { .samples { grid-template-columns: 1fr 1fr; } }
.sides { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; } .sides img { width: 100%; border: 1px solid var(--line); border-radius: 8px; } .sides figure { margin: 0; } figcaption { font-size: .8rem; color: var(--muted); }

@media print {
  .top, .side, .no-print, .page-head, #toasts, .filters, .btn, .seg { display: none !important; }
  .main { margin: 0; padding: 0; } body { background: #fff; font-size: 11px; } .tbl-wrap, .register, .card { box-shadow: none; border: 0; }
  .tbl th, .tbl td { border: 1px solid #555; padding: 4px; } .print-only { display: block; } .tag { border: 1px solid #999; }
}

/* Demo mode banner (DEMO_MODE=1 on a server) */
.demo-banner { position: sticky; top: 0; z-index: 30; background: #b3261e; color: #fff; text-align: center; font-weight: 600; font-size: .85rem; padding: 6px 12px; }

/* ---- Full-screen in-page camera (capture.js) ---- */
html.cam-open, html.cam-open body { overflow: hidden; overscroll-behavior: none; }
.cam { position: fixed; inset: 0; z-index: 100; background: #000; color: #fff; height: 100vh; height: 100dvh; overflow: hidden; touch-action: manipulation; user-select: none; }
.cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam video.mirror { transform: scaleX(-1); }
.cam-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; z-index: 3; }
.cam-guide { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); aspect-ratio: var(--ratio); width: min(90vw, calc((100dvh - 280px) * var(--ratio)));
  border: 3px solid #fff; border-radius: 14px; box-shadow: 0 0 0 200vmax rgba(0, 0, 0, .45); z-index: 1; pointer-events: none; }
.cam-top { position: absolute; top: 0; left: 0; right: 0; z-index: 4; padding: calc(12px + env(safe-area-inset-top)) 16px 18px; text-align: center; background: linear-gradient(rgba(0, 0, 0, .65), transparent); }
.cam-top { text-shadow: 0 1px 3px rgba(0, 0, 0, .9); }
.cam-top b { display: block; font-size: 1.05rem; } .cam-top small { display: block; opacity: .92; font-size: .9rem; margin-top: 2px; }
.cam-bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(0, 0, 0, .75)); }
.cam-bar[hidden] { display: none; }
.cam-bar > .cam-btn:first-child { justify-self: start; }
.cam-review { grid-template-columns: 1fr 1fr; }
.cam-review > .cam-btn { justify-self: stretch; }
.cam-btn { background: rgba(255, 255, 255, .16); color: #fff; border: 1px solid rgba(255, 255, 255, .45); border-radius: 999px; padding: 10px 18px; font-size: 1rem; min-height: 46px; cursor: pointer; }
.cam-use { background: var(--ok); border-color: var(--ok); font-weight: 600; }
.cam-side { justify-self: end; display: flex; gap: 8px; }
.cam-ic { width: 48px; height: 48px; padding: 0; font-size: 1.2rem; }
.cam-shutter { width: 76px; height: 76px; border-radius: 50%; border: 5px solid #fff; background: #fff; box-shadow: inset 0 0 0 4px #000; cursor: pointer; }
.cam-shutter:disabled { opacity: .35; }
.cam-shutter:active { transform: scale(.93); }
/* Landscape: controls in a column on the right, like a phone camera */
@media (orientation: landscape) {
  .cam-guide { left: calc(50% - 60px); top: 50%; width: min(calc(100vw - 280px), calc((100dvh - 110px) * var(--ratio))); }
  .cam-top { right: 130px; padding-top: calc(8px + env(safe-area-inset-top)); }
  .cam-bar { left: auto; top: 0; width: calc(130px + env(safe-area-inset-right)); grid-template-columns: none; grid-template-rows: 1fr auto 1fr; justify-items: center;
    padding: 12px calc(12px + env(safe-area-inset-right)) 12px 12px; background: linear-gradient(90deg, transparent, rgba(0, 0, 0, .75)); }
  .cam-bar > .cam-btn:first-child { justify-self: center; align-self: start; }
  .cam-side { justify-self: center; align-self: end; flex-direction: column; }
  .cam-review { grid-template-rows: auto auto; align-content: center; gap: 16px; }
}
.cam-blur { position: absolute; left: 12px; right: 12px; top: calc(70px + env(safe-area-inset-top)); z-index: 5; background: var(--warn); color: #fff; font-weight: 600; text-align: center; padding: 10px 14px; border-radius: 10px; }
.cam-blur[hidden] { display: none; }
.cam-attn { background: var(--saffron); border-color: var(--saffron); font-weight: 600; }
.cam-focus { position: fixed; z-index: 6; width: 70px; height: 70px; margin: -35px 0 0 -35px; border: 2px solid #ffd54a; border-radius: 50%; pointer-events: none; animation: camfocus .9s ease-out forwards; }
@keyframes camfocus { from { transform: scale(1.4); opacity: 1; } to { transform: scale(1); opacity: 0; } }
.cam-shutter.busy { animation: campulse .5s ease-in-out infinite alternate; opacity: 1; }
@keyframes campulse { from { transform: scale(1); } to { transform: scale(.88); } }
/* ID fields that failed a check after auto-fill */
label.fchk input, label.fchk select { border-color: var(--warn); background: var(--warn-bg); }
label .fchk-msg { display: block; color: var(--warn); font-size: .78rem; font-weight: 600; margin-top: 2px; }
