:root{
  --navy:#0B1B3A;
  --navy-2:#122A54;
  --navy-3:#1B3A6E;
  --gold:#F4B400;
  --gold-2:#FFD966;
  --gold-deep:#C8860A;
  --cream:#FBF4E4;
  --cream-2:#F3E6C8;
  --red:#B4232E;
  --ink:#16213E;
  --ink-soft:#5B6787;
  --muted:#8A93AC;
  --ok:#2E8B57;
  --warn:#C8860A;
  --page-bg:#F8F6F0;
  --surface:#FFFFFF;
  --border:#E7E1CF;
  --border-soft:#EFEAD9;
  --line:rgba(244,180,0,0.35);
  --shadow:0 10px 28px rgba(22,33,62,0.10);
  --shadow-soft:0 6px 16px rgba(22,33,62,0.06);
  --radius:18px;
  --font-display:'Baloo 2','Arial Black', Impact, sans-serif;
  --font-body:'Poppins','Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
}
*{box-sizing:border-box; -webkit-tap-highlight-color:transparent;}
html,body{
  margin:0;padding:0; font-family:var(--font-body); color:var(--ink); overflow:hidden;
  height:100%; width:100%;
  background-color:#EFE9D8;
  background-image:
    linear-gradient(rgba(37,49,84,0.42),rgba(37,49,84,0.42)),
    url('../assets/bg-house.jpg');
  background-size:cover;
  background-position:center;
  background-repeat:no-repeat;
}
#app{
  width:100%; max-width:400px; margin:0 auto; height:100vh; height:100svh; position:relative; overflow:hidden;
  background-color:var(--page-bg);
  background-image:
    linear-gradient(rgba(248,246,240,0.82),rgba(248,246,240,0.82)),
    url('../assets/bg-house.jpg');
  background-size:cover;
  background-position:center;
  background-repeat:no-repeat;
  box-shadow:0 0 70px rgba(10,20,45,0.35);
}
.screen{display:none; height:100vh; height:100svh; flex-direction:column; animation:fadeIn .35s ease; overflow:hidden;}
.screen.active{display:flex;}
@keyframes fadeIn{from{opacity:0; transform:translateY(8px);} to{opacity:1; transform:translateY(0);}}
button{font-family:inherit; cursor:pointer;}
input,select{font-family:inherit;}
a{color:inherit;}
svg.icon{display:block; flex:none;}

/* ---------- shared bits ---------- */
.topbar{display:flex; align-items:center; gap:8px; padding:9px 16px; background:rgba(248,246,240,0.92); position:sticky; top:0; z-index:40; backdrop-filter:blur(6px); border-bottom:1px solid var(--border); flex:none;}
.topbar .back{width:30px;height:30px;border-radius:50%;background:var(--surface);border:1px solid var(--border);color:var(--navy);display:flex;align-items:center;justify-content:center;flex:none; box-shadow:var(--shadow-soft); font-size:14px;}
.topbar .title{font-weight:700; font-size:13.5px; letter-spacing:.3px; color:var(--ink); line-height:1.2;}
.topbar .sub{font-size:10px; color:var(--gold-deep); font-weight:600; line-height:1.2;}
.step-track{display:flex; gap:4px; padding:0 16px 8px; background:rgba(248,246,240,0.92); flex:none;}
.step-track i{flex:1; height:3px; border-radius:3px; background:var(--border);}
.step-track i.done{background:var(--gold);}
.content{flex:1; min-height:0; padding:12px 18px 6px; display:flex; flex-direction:column; overflow:hidden;}
.footer-fixed{flex:none; position:sticky; bottom:0; padding:10px 18px 14px; background:linear-gradient(0deg,var(--page-bg) 65%,rgba(248,246,240,0)); }
.btn{display:flex;align-items:center;justify-content:center;gap:8px; width:100%; padding:11px 16px; border-radius:13px; border:none; font-weight:800; font-size:14px; letter-spacing:.2px;}
.btn-primary{background:linear-gradient(180deg,var(--gold-2),var(--gold)); color:var(--navy); box-shadow:0 8px 20px rgba(244,180,0,0.32);}
.btn-primary:active{transform:scale(.98);}
.btn-primary:disabled{opacity:.4; box-shadow:none;}
.btn-outline{background:var(--surface); border:1.5px solid var(--border); color:var(--navy);}
.btn-ghost{background:var(--surface); color:var(--ink-soft); border:1px solid var(--border);}
.btn-danger{background:#FBEAEA; color:var(--red); border:1px solid #F0C9CB;}
.eyebrow{color:var(--gold-deep); font-weight:800; font-size:10.5px; letter-spacing:1.4px; text-transform:uppercase; margin-bottom:4px;}
h1.h{font-size:18.5px; line-height:1.22; margin:0 0 5px; font-weight:800; color:var(--ink);}
p.lead{color:var(--ink-soft); font-size:12.5px; line-height:1.42; margin:0 0 12px;}
.field{margin-bottom:10px;}
.field label{display:block; font-size:11px; font-weight:700; color:var(--ink-soft); margin-bottom:4px; letter-spacing:.3px;}
.field input, .field select{width:100%; padding:10px 12px; border-radius:11px; border:1.5px solid var(--border); background:var(--surface); color:var(--ink); font-size:14px; outline:none;}
.field input::placeholder{color:var(--muted);}
.field input:focus, .field select:focus{border-color:var(--gold); box-shadow:0 0 0 3px rgba(244,180,0,0.14);}
.field .err{color:var(--red); font-size:10.5px; margin-top:4px; display:none; font-weight:600;}
.field.invalid input{border-color:var(--red);}
.field.invalid .err{display:block;}
.phone-row{display:flex; gap:8px;}
.phone-row .code{flex:none; width:52px; padding:10px 8px; border-radius:11px; border:1.5px solid var(--border); background:var(--surface); color:var(--ink); font-weight:700; text-align:center; font-size:14px;}
.choice-cards{display:flex; flex-direction:column; gap:8px;}
.choice-card{display:flex; align-items:center; gap:11px; padding:12px 14px; border-radius:14px; border:1.5px solid var(--border); background:var(--surface); box-shadow:var(--shadow-soft);}
.choice-card.selected{border-color:var(--gold); background:#FFFBEF; box-shadow:0 0 0 3px rgba(244,180,0,0.14) inset, var(--shadow-soft);}
.choice-card .icon{width:38px;height:38px;border-radius:11px;background:#FFF3D0;display:flex;align-items:center;justify-content:center; flex:none; color:var(--gold-deep);}
.choice-card .txt b{display:block; font-size:14px; color:var(--ink);}
.choice-card .txt span{font-size:11px; color:var(--ink-soft);}
.badge-pill{display:inline-flex; align-items:center; gap:6px; background:#FFF3D0; color:var(--gold-deep); padding:4px 9px; border-radius:20px; font-size:10px; font-weight:800; letter-spacing:.4px;}

/* ---------- landing (built from the original artwork, cut into sections for fast, progressive loading) ---------- */
#screen-landing .hero{position:relative; padding:0; display:flex; flex-direction:column; justify-content:center; height:100%; overflow:hidden; background:#0B1B3A;}
#screen-landing .hero .art-stack{flex:none; width:100%; display:flex; flex-direction:column; overflow:visible; margin:0 auto;}
.art-slice{display:block; width:100%; height:auto; line-height:0; flex:none;}
.hotspot-wrap{position:relative; line-height:0; flex:none;}
.hotspot{position:absolute; background:transparent; border:none; padding:0; margin:0; cursor:pointer; -webkit-tap-highlight-color:rgba(244,180,0,0.25);}
.hotspot:active{background:rgba(255,255,255,0.08);}
.staff-link-onart{position:relative; display:flex; align-items:center; justify-content:center; gap:14px; text-align:center; padding:8px 20px; background:#0B1B3A; flex:none;}
.staff-link-onart button{background:none;border:none;color:#8FA0CC;font-size:11px; text-decoration:underline; font-weight:600;}
.landing-headline{position:relative; flex:none; text-align:center; padding:clamp(16px,3.6vh,26px) 20px clamp(18px,3.8vh,28px); background:linear-gradient(180deg,#3E639C 0%,#4C6EA0 100%);}
.landing-headline .lh-l1{font-family:var(--font-body); font-style:italic; font-weight:600; font-size:clamp(13px,2.8vh,18px); color:#EAF0FF;}
.landing-headline .lh-l2{font-family:var(--font-body); font-weight:700; font-size:clamp(14px,3vh,20px); color:#fff; margin-top:6px; line-height:1.35;}
.landing-headline .lh-l2 .lh-brand{display:inline-block; font-family:var(--font-display); font-weight:800; color:var(--gold); letter-spacing:.3px; font-size:1.2em; margin:0 2px; text-shadow:0 1px 0 #8C5D00, 0 4px 12px rgba(244,180,0,0.4);}
.landing-headline .lh-tagline{font-family:var(--font-body); font-weight:600; font-style:italic; font-size:clamp(11px,2.3vh,15px); color:var(--gold-2); letter-spacing:.3px; margin-top:8px;}
/* Native script fonts per language, kept separate from the Latin "ROOF KA RAKSHAK" which always stays in the brand display font */
.landing-headline[data-lang="hi"] .lh-l1, .landing-headline[data-lang="hi"] .lh-l2, .landing-headline[data-lang="hi"] .lh-tagline,
.landing-headline[data-lang="mr"] .lh-l1, .landing-headline[data-lang="mr"] .lh-l2, .landing-headline[data-lang="mr"] .lh-tagline{font-family:'Noto Sans Devanagari', var(--font-body);}
.landing-headline[data-lang="gu"] .lh-l1, .landing-headline[data-lang="gu"] .lh-l2, .landing-headline[data-lang="gu"] .lh-tagline{font-family:'Noto Sans Gujarati', var(--font-body);}
.landing-headline[data-lang="pa"] .lh-l1, .landing-headline[data-lang="pa"] .lh-l2, .landing-headline[data-lang="pa"] .lh-tagline{font-family:'Noto Sans Gurmukhi', var(--font-body);}
.landing-headline[data-lang="bn"] .lh-l1, .landing-headline[data-lang="bn"] .lh-l2, .landing-headline[data-lang="bn"] .lh-tagline{font-family:'Noto Sans Bengali', var(--font-body);}
.landing-headline[data-lang="or"] .lh-l1, .landing-headline[data-lang="or"] .lh-l2, .landing-headline[data-lang="or"] .lh-tagline{font-family:'Noto Sans Oriya', var(--font-body);}
.landing-headline[data-lang="ta"] .lh-l1, .landing-headline[data-lang="ta"] .lh-l2, .landing-headline[data-lang="ta"] .lh-tagline{font-family:'Noto Sans Tamil', var(--font-body);}
.landing-headline[data-lang="te"] .lh-l1, .landing-headline[data-lang="te"] .lh-l2, .landing-headline[data-lang="te"] .lh-tagline{font-family:'Noto Sans Telugu', var(--font-body);}
.landing-headline[data-lang="kn"] .lh-l1, .landing-headline[data-lang="kn"] .lh-l2, .landing-headline[data-lang="kn"] .lh-tagline{font-family:'Noto Sans Kannada', var(--font-body);}
.landing-headline[data-lang="ml"] .lh-l1, .landing-headline[data-lang="ml"] .lh-l2, .landing-headline[data-lang="ml"] .lh-tagline{font-family:'Noto Sans Malayalam', var(--font-body);}
.lang-select{display:inline-block; background:rgba(255,255,255,0.08); color:#8FA0CC; border:1px solid rgba(244,180,0,0.35); border-radius:16px; font-size:10.5px; font-weight:700; padding:3px 20px 3px 10px; font-family:var(--font-body); appearance:none; -webkit-appearance:none; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6' fill='%238FA0CC'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 8px center;}
.lang-select:focus{outline:none; border-color:var(--gold);}

/* ---------- camera (viewfinder stays dark by nature of a live camera feed; chrome around it is light) ---------- */
.cam-wrap{position:relative; flex:1; min-height:0; background:#000; border-radius:16px; overflow:hidden; display:flex; align-items:center; justify-content:center; box-shadow:var(--shadow);}
.cam-wrap video, .cam-wrap canvas.captured{width:100%; height:100%; object-fit:cover; position:absolute; inset:0;}
.frame-overlay{position:absolute; inset:0; pointer-events:none; z-index:5;}
.cam-toolbar{position:absolute; bottom:12px; left:0; right:0; display:flex; align-items:center; justify-content:center; gap:22px; z-index:6;}
.shutter{width:58px;height:58px;border-radius:50%; background:#fff; border:4px solid rgba(244,180,0,0.9); box-shadow:0 6px 18px rgba(0,0,0,0.5);}
.cam-side-btn{width:38px;height:38px;border-radius:50%; background:rgba(0,0,0,0.5); border:1px solid rgba(255,255,255,0.3); color:#fff; display:flex; align-items:center; justify-content:center;}
.cam-hint{position:absolute; top:10px; left:0; right:0; text-align:center; z-index:6;}
.cam-hint span{background:rgba(0,0,0,0.55); color:var(--gold-2); font-size:10.5px; font-weight:700; padding:5px 12px; border-radius:20px; border:1px solid rgba(244,180,0,0.3);}
.mode-tabs{display:flex; gap:6px; margin-bottom:8px; flex:none;}
.mode-tab{flex:1; display:flex; align-items:center; justify-content:center; gap:5px; text-align:center; padding:7px; border-radius:11px; font-size:11px; font-weight:800; background:var(--surface); border:1.5px solid var(--border); color:var(--ink-soft);}
.mode-tab.active{background:#FFF3D0; border-color:var(--gold); color:var(--gold-deep);}
.upload-fallback{text-align:center; margin-top:7px; font-size:11px; color:var(--ink-soft); flex:none;}
.upload-fallback label{color:var(--gold-deep); font-weight:700; text-decoration:underline; cursor:pointer;}

/* ---------- badge ---------- */
.badge-tabs{display:flex; gap:8px; margin:2px 0 8px; flex:none;}
.badge-tab{flex:1; text-align:center; padding:8px; border-radius:12px; border:1.5px solid var(--border); background:var(--surface); font-weight:800; font-size:11.5px; color:var(--ink-soft);}
.badge-tab.active{border-color:var(--gold); background:#FFF3D0; color:var(--gold-deep);}
.badge-canvas-wrap{flex:1; min-height:0; border-radius:16px; overflow:hidden; box-shadow:var(--shadow); background:var(--border-soft); display:flex; align-items:center; justify-content:center; padding:6px;}
.badge-canvas-wrap canvas{width:auto; height:100%; max-width:100%; display:block; border-radius:9px;}
.share-row{display:flex; gap:8px; margin-top:10px; flex:none;}
.share-btn{flex:1; display:flex; flex-direction:column; align-items:center; gap:5px; padding:9px 6px; border-radius:12px; background:var(--surface); border:1px solid var(--border); color:var(--ink); font-size:10px; font-weight:700; box-shadow:var(--shadow-soft);}
.share-btn:active{border-color:var(--gold);}
.share-btn .ic{color:var(--gold-deep);}

/* ---------- thanks ---------- */
.thanks-wrap{flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; padding:16px 24px; background:transparent;}
.thanks-wrap .big-shield{margin-bottom:8px;}
.thanks-wrap h1{font-size:20px; margin:0 0 6px; color:var(--ink);}
.thanks-wrap p{color:var(--ink-soft); font-size:12.5px; line-height:1.5;}

/* ---------- staff login ---------- */
.role-select{display:flex; gap:8px; margin-bottom:10px;}
.role-opt{flex:1; text-align:center; padding:10px 6px; border-radius:12px; border:1.5px solid var(--border); background:var(--surface); font-size:11px; font-weight:800; color:var(--ink-soft); box-shadow:var(--shadow-soft);}
.role-opt.active{border-color:var(--gold); background:#FFF3D0; color:var(--gold-deep);}
.role-opt .r-ic{display:flex; align-items:center; justify-content:center; margin-bottom:4px; color:inherit;}

/* ---------- dashboard ---------- */
#screen-dashboard{background:var(--cream); color:var(--ink);}
.dash-top{background:var(--navy); padding:16px 18px 60px; position:relative;}
.dash-top-row{display:flex; align-items:center; justify-content:space-between;}
.dash-user{display:flex; align-items:center; gap:10px;}
.dash-user .av{width:38px;height:38px;border-radius:50%; background:var(--gold); color:var(--navy); font-weight:900; display:flex; align-items:center; justify-content:center; font-size:14px;}
.dash-user .nm{font-size:13.5px; font-weight:800; color:#fff;}
.dash-user .rl{font-size:11px; color:var(--gold-2); font-weight:700;}
.icon-btn{width:36px;height:36px;border-radius:10px; background:rgba(255,255,255,0.1); border:1px solid rgba(255,255,255,0.15); color:#fff; display:flex; align-items:center; justify-content:center;}
.scope-line{margin-top:14px; font-size:12px; color:#AEB9DD;}
.scope-line b{color:var(--gold-2);}
.stat-cards{display:grid; grid-template-columns:repeat(2,1fr); gap:10px; margin:-46px 16px 0; position:relative; z-index:5;}
.stat-card{background:#fff; border-radius:14px; padding:14px; box-shadow:0 10px 24px rgba(11,27,58,0.12);}
.stat-card .num{font-size:22px; font-weight:900; color:var(--navy);}
.stat-card .lbl{font-size:11px; color:#7C8AAE; font-weight:700; margin-top:2px;}
.stat-card .delta{font-size:10.5px; font-weight:800; margin-top:6px; display:inline-block; padding:2px 7px; border-radius:8px;}
.delta.up{background:#E4F5EA; color:var(--ok);}
.delta.mid{background:#FFF3D6; color:var(--warn);}
.dash-body{flex:1; min-height:0; overflow-y:auto; padding:16px 16px 90px;}
.section-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:12px;}
.section-head h3{font-size:15.5px; margin:0; color:var(--navy);}
.link-btn{display:inline-flex; align-items:center; gap:5px; background:none;border:none; color:var(--gold-deep); font-weight:800; font-size:12.5px;}
.filter-bar{display:flex; gap:8px; overflow-x:auto; padding-bottom:10px; margin-bottom:12px; -webkit-overflow-scrolling:touch;}
.filter-bar::-webkit-scrollbar{display:none;}
.chip-select{flex:none; padding:9px 12px; border-radius:20px; border:1.5px solid #E3D9BE; background:#fff; font-size:12px; font-weight:700; color:#4A5578;}
.search-box{display:flex; align-items:center; gap:8px; background:#fff; border:1.5px solid #E3D9BE; border-radius:14px; padding:11px 14px; margin-bottom:12px; color:var(--muted);}
.search-box input{border:none; outline:none; flex:1; font-size:14px; background:none; color:var(--ink);}
.dealer-card{background:#fff; border-radius:16px; padding:14px; margin-bottom:10px; box-shadow:0 6px 16px rgba(11,27,58,0.06); display:flex; gap:12px; align-items:center;}
.dealer-card .thumb{width:50px;height:50px; border-radius:50%; background:linear-gradient(135deg,#1B3A6E,#0B1B3A); display:flex; align-items:center; justify-content:center; color:var(--gold-2); font-weight:900; font-size:16px; flex:none; border:2px solid var(--gold);}
.dealer-card .info{flex:1; min-width:0;}
.dealer-card .info .nm{font-size:14.5px; font-weight:800; color:var(--navy); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.dealer-card .info .meta{font-size:11.5px; color:#7C8AAE; margin-top:2px;}
.dealer-card .info .meta2{font-size:11px; color:#9AA6C4; margin-top:2px;}
.status-tag{font-size:10px; font-weight:800; padding:4px 9px; border-radius:20px; white-space:nowrap;}
.status-tag.invited{background:#EDEFF7; color:#5A6690;}
.status-tag.started{background:#FFF3D6; color:var(--warn);}
.status-tag.photo{background:#DDEBFF; color:#2A5FB0;}
.status-tag.completed{background:#E4F5EA; color:var(--ok);}
.chev{color:#C7CEE2;}
.empty-state{text-align:center; padding:40px 20px; color:#9AA6C4;}
.empty-state .ic{margin:0 auto 10px; color:#C7BE9E;}
.bottom-nav{position:fixed; bottom:0; left:0; right:0; max-width:400px; margin:0 auto; background:#fff; border-top:1px solid #EDE4C8; display:flex; z-index:50; box-shadow:0 -6px 18px rgba(11,27,58,0.06);}
.bottom-nav button{flex:1; background:none; border:none; padding:11px 4px 9px; display:flex; flex-direction:column; align-items:center; gap:3px; color:#9AA6C4; font-size:10.5px; font-weight:700;}
.bottom-nav button.active{color:var(--gold-deep);}
.bottom-nav button .ic{display:flex; justify-content:center;}

/* modal */
.modal-backdrop{position:fixed; inset:0; background:rgba(22,33,62,0.45); z-index:100; display:none; align-items:flex-end; justify-content:center;}
.modal-backdrop.active{display:flex;}
.modal-sheet{max-width:400px; width:100%; background:#fff; border-radius:22px 22px 0 0; max-height:90vh; overflow-y:auto; color:var(--ink); animation:slideUp .3s ease;}
@keyframes slideUp{from{transform:translateY(30px); opacity:0;} to{transform:translateY(0); opacity:1;}}
.modal-handle{width:40px; height:4px; background:#E3D9BE; border-radius:3px; margin:12px auto 4px;}
.modal-head{display:flex; align-items:center; justify-content:space-between; padding:14px 20px;}
.modal-head h3{margin:0; font-size:16px; color:var(--navy);}
.modal-close{width:30px;height:30px;border-radius:50%; background:#F3E6C8; border:none; font-size:15px; color:var(--navy);}
.modal-body{padding:0 20px 26px;}
.detail-row{display:flex; justify-content:space-between; padding:11px 0; border-bottom:1px solid #F1EAD6; font-size:13.5px;}
.detail-row span:first-child{color:#7C8AAE; font-weight:600;}
.detail-row span:last-child{font-weight:700; color:var(--navy); text-align:right;}
.mini-badge-preview{border-radius:16px; overflow:hidden; margin:16px 0; box-shadow:var(--shadow); background:var(--border-soft); padding:6px;}
.mini-badge-preview canvas{width:100%; display:block; border-radius:10px;}
.filter-sheet .field{margin-bottom:14px;}
.filter-sheet .field label{color:#7C8AAE;}
.filter-sheet .field input, .filter-sheet .field select{color:var(--ink); border-color:#E3D9BE; background:#FBF6E9;}
.toast{position:fixed; bottom:26px; left:50%; transform:translateX(-50%); background:var(--navy); color:#fff; padding:12px 20px; border-radius:30px; font-size:13px; font-weight:700; z-index:200; box-shadow:var(--shadow); display:none; border:1px solid var(--gold); max-width:88%; text-align:center;}
.toast.show{display:block; animation:fadeIn .25s ease;}
.hidden{display:none !important;}
