/* Charly's Recon — Android app layer. Every rule is scoped to html.appmode, so the website is unchanged. */
html.appmode{padding:0!important;-webkit-text-size-adjust:100%}
html.appmode body{background:var(--bg);-webkit-tap-highlight-color:transparent;overscroll-behavior-y:none;-webkit-user-select:none;user-select:none}
html.appmode input,html.appmode textarea,html.appmode select,html.appmode .mono,html.appmode td{-webkit-user-select:text;user-select:text}

/* ---------- shell: no sidebar, navy app bar, bottom tabs ---------- */
html.appmode .shell,html.appmode .shell.collapsed{display:block;min-height:100vh}
html.appmode .side{display:none!important}
html.appmode .top{position:sticky;top:0;z-index:40;background:var(--side);border:0;padding:10px 12px 6px;gap:8px;flex-wrap:nowrap;backdrop-filter:none}
html.appmode #sideToggle,html.appmode #searchBox,html.appmode .top>.relwrap:last-child{display:none!important}
html.appmode .acc-chip{background:var(--side-2);border-color:#2B3A4F;color:#fff;max-width:calc(100vw - 130px);height:40px;padding:0 12px;border-radius:10px}
html.appmode .acc-chip svg{color:#3CCBB5;flex:none}
html.appmode .acc-chip select{color:#fff;max-width:calc(100vw - 190px);font-size:14px;text-overflow:ellipsis}
html.appmode .acc-chip select option{color:#0F1B2A;background:#fff}
html.appmode .acc-chip span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html.appmode .top .icon-btn,html.appmode #appSearch{width:44px;height:44px;border:0;background:transparent;color:var(--side-ink);border-radius:10px}
html.appmode .top .icon-btn:active{background:var(--side-2)}
html.appmode .top .icon-btn .dot{border-color:var(--side);top:4px;right:4px}
html.appmode .notif{position:fixed;left:8px;right:8px;top:58px;width:auto;max-height:70vh}
html.appmode #banner .content{padding:12px 14px 0}

html.appmode .content{padding:0 14px calc(92px + var(--kb,0px));max-width:none}
html.appmode .page-head{background:var(--side);color:#fff;margin:0 -14px 14px;padding:4px 18px 18px;gap:12px;align-items:flex-start;flex-direction:column}
html.appmode .page-head h1{font-size:24px;color:#fff}
html.appmode .page-head .crumb{color:var(--side-muted);font-size:12.5px;margin-bottom:2px}
html.appmode .page-head p{color:var(--side-muted);font-size:13px;line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
html.appmode .page-head p.open{-webkit-line-clamp:unset}
html.appmode .page-head .actions{width:100%;gap:8px}
html.appmode .page-head .actions .btn:not(.primary):not(.danger),html.appmode .page-head .actions label.btn{background:var(--side-2);border-color:#2B3A4F;color:#fff}
html.appmode .page-head .actions .select,html.appmode .page-head .actions .input{background:var(--side-2);border-color:#2B3A4F;color:#fff}
html.appmode .page-head .seg{background:var(--side-2);border-color:#2B3A4F}
html.appmode .page-head .seg button{color:var(--side-ink)}
html.appmode .page-head .seg button.on{background:var(--brand);color:#fff}

#appTabs{display:none}
html.appmode #appTabs{display:grid;position:fixed;left:0;right:0;bottom:0;z-index:45;grid-template-columns:repeat(var(--tabs,5),minmax(0,1fr));background:var(--surface);border-top:1px solid var(--line);padding:6px 4px 8px}
html.appmode #app[hidden] #appTabs,html.appmode.kb-open #appTabs{display:none}
#appTabs a{display:flex;flex-direction:column;align-items:center;gap:3px;padding:4px 0;text-decoration:none;color:var(--muted);font-size:11px;font-weight:700;position:relative}
#appTabs a span.pill{width:56px;height:30px;border-radius:999px;display:grid;place-items:center;transition:background .15s}
#appTabs a svg{width:21px;height:21px}
#appTabs a.on{color:var(--brand);font-weight:800}
#appTabs a.on span.pill{background:var(--brand-soft)}
#appTabs a em{position:absolute;top:0;left:calc(50% + 6px);min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--claim);color:#fff;font:800 10.5px/18px var(--sans);font-style:normal;text-align:center;border:2px solid var(--surface)}

/* ---------- touch sizes ---------- */
html.appmode .btn{min-height:42px;padding:9px 14px;border-radius:10px}
html.appmode .btn.sm{min-height:34px;padding:6px 11px}
html.appmode .input,html.appmode .select,html.appmode select.input{min-height:44px;font-size:15px}
html.appmode .t td .input,html.appmode .t td .select{min-height:38px}
html.appmode .seg{display:flex;width:100%}
html.appmode .seg button{flex:1;min-height:36px}

/* ---------- cards and KPIs ---------- */
html.appmode .grid{gap:12px}
html.appmode .kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
html.appmode .kpi{padding:13px 13px 12px}
html.appmode .kpi strong{font-size:22px;margin:6px 0 2px}
html.appmode .kpi .k-top{font-size:12px;gap:6px}
html.appmode .kpi .k-ico{width:28px;height:28px}
html.appmode .kpi .k-sub{font-size:11.5px;line-height:1.35}
html.appmode .kpi:hover{transform:none}
html.appmode .cols-2,html.appmode .cols-3{grid-template-columns:1fr}
html.appmode .card-h{padding:12px 14px;flex-wrap:wrap}
html.appmode .toolbar{padding:10px 12px}
html.appmode .toolbar .grow{flex:1 1 100%}
html.appmode .row2{grid-template-columns:1fr!important}

/* ---------- tables become cards (only tables built by the shared table() helper) ---------- */
html.appmode .tbl-wrap:has(td[data-label]){overflow:visible;padding:10px 10px 2px;background:var(--bg)}
html.appmode table.t:has(td[data-label]),html.appmode table.t:has(td[data-label]) tbody{display:block}
html.appmode table.t:has(td[data-label]) thead{display:none}
html.appmode table.t:has(td[data-label]) tr{display:flex;flex-direction:column;background:var(--surface);border:1px solid var(--line);border-radius:12px;margin:0 0 10px;padding:10px 12px;box-shadow:var(--shadow)}
html.appmode table.t:has(td[data-label]) tr.sel{border-color:var(--brand);background:var(--brand-soft)}
html.appmode table.t:has(td[data-label]) td{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:4px 0;border:0;white-space:normal;text-align:right;background:transparent!important;min-width:0;overflow-wrap:anywhere}
html.appmode table.t:has(td[data-label]) td[data-label]::before{content:attr(data-label);color:var(--muted);font-size:11.5px;font-weight:700;text-align:left;flex:none;max-width:45%;text-transform:none}
html.appmode table.t:has(td[data-label]) td:first-child{order:-1}
html.appmode table.t:has(td[data-label]) td:nth-child(1)[data-label]::before,html.appmode table.t:has(td[data-label]) td:nth-child(2):has(button.link)::before{display:none}
html.appmode table.t:has(td[data-label]) td:nth-child(1)[data-label],html.appmode table.t:has(td[data-label]) td:nth-child(2):has(button.link){justify-content:flex-start;font-size:14px;font-weight:700}
html.appmode table.t:has(td[data-label]) td:empty{display:none}
html.appmode table.t:has(td[data-label]) td:not([data-label]){justify-content:flex-start}
html.appmode .pager{padding:10px 12px}
html.appmode .tbl-wrap:not(:has(td[data-label])){-webkit-overflow-scrolling:touch}

/* ---------- order drawer, modals, search ---------- */
html.appmode .drawer{width:100%;padding:0;animation:none}
html.appmode .drawer-h{background:var(--side);color:#fff;border:0;padding:12px 12px 14px 18px}
html.appmode .drawer-h .btn.ghost{color:#fff;min-width:44px}
html.appmode .drawer-h *{color:inherit}
html.appmode .drawer-b{padding:16px 16px calc(28px + var(--kb,0px))}
html.appmode .modal{left:0;right:0;top:auto;bottom:0;transform:none;width:100%;max-height:90vh;border-radius:20px 20px 0 0;animation:sheet .2s ease;padding-bottom:var(--kb,0px)}
html.appmode .modal-f{flex-wrap:wrap}
html.appmode .modal-f .btn{flex:1 1 auto}
@keyframes sheet{from{transform:translateY(40px);opacity:.3}}
html.appmode .spot{left:0;right:0;top:0;bottom:0;width:100%;transform:none;border-radius:0;border:0;display:flex;flex-direction:column}
html.appmode .spot-top{padding:12px 14px}
html.appmode .spot-top kbd,html.appmode .spot-ft,html.appmode .spot-prev,html.appmode .spot-meta{display:none}
html.appmode .spot-body{grid-template-columns:1fr;max-height:none;flex:1;overflow:hidden;grid-template-rows:minmax(0,1fr) auto}
html.appmode .spot-col{border:0}
html.appmode .spot-qa{border-top:1px solid #1F2937!important;display:flex;flex-wrap:wrap;gap:6px;padding:10px 12px!important}
html.appmode .spot-qa .spot-sec{width:100%;padding:0 2px 4px}
html.appmode .spot-qa-i{width:auto;border:1px solid #1F2937;border-radius:999px;padding:8px 12px}
html.appmode .spot-qa-i kbd{display:none}
html.appmode .spot-r{padding:12px 16px;font-size:14px}
html.appmode #appSearchClose{display:none}
html.appmode .spot #appSearchClose{display:grid;place-items:center;width:40px;height:40px;border:0;background:transparent;color:#CBD5E1;font-size:22px}
html.appmode .toasts{left:12px;right:12px;bottom:calc(84px + var(--kb,0px))}
html.appmode .toast{width:100%}
html.appmode .toast .tact{margin-left:auto;border:0;background:transparent;color:var(--brand-2);font:800 13px var(--sans);padding:4px 6px}

/* ---------- upload: big teal picker ---------- */
html.appmode .drop{border-color:var(--brand-2);background:var(--brand-soft);color:var(--brand-ink);padding:26px 16px}
html.appmode .drop strong{font-size:16px}
html.appmode .drop strong::after{content:'';}

/* ---------- scan returns ---------- */
html.appmode #rvNat{min-height:54px;font-size:16px;font-weight:800}
html.appmode .scan-in{font-family:var(--mono)}

/* ---------- menu page ---------- */
.am-prof{display:flex;gap:14px;align-items:center;background:var(--side);margin:0 -14px 14px;padding:6px 18px 22px;color:#fff}
.am-prof .av{width:52px;height:52px;border-radius:14px;background:var(--brand);display:grid;place-items:center;font-size:21px;font-weight:800;color:#fff;flex:none}
.am-prof b{font-size:17px;display:block}
.am-prof small{color:var(--side-muted);font-size:12.5px;font-weight:600}
.am-grp{margin:0 0 14px}
.am-grp h6{margin:0 4px 8px;font-size:12px;font-weight:800;color:var(--muted);text-transform:uppercase;letter-spacing:.06em}
.am-list{background:var(--surface);border:1px solid var(--line);border-radius:12px;overflow:hidden}
.am-item{display:flex;align-items:center;gap:12px;width:100%;min-height:52px;padding:10px 14px;border:0;border-bottom:1px solid var(--line);background:none;color:var(--ink);font:600 14.5px var(--sans);text-align:left;text-decoration:none;cursor:pointer}
.am-item:last-child{border-bottom:0}
.am-item:active{background:var(--surface-2)}
.am-item .ic{width:34px;height:34px;border-radius:9px;background:var(--brand-soft);color:var(--brand);display:grid;place-items:center;flex:none}
.am-item .ic svg{width:18px;height:18px}
.am-item .tx{flex:1;min-width:0}
.am-item .tx small{display:block;color:var(--muted);font-size:12px;font-weight:500}
.am-item .chev{color:var(--line-2)}
.am-item em{font-style:normal;background:var(--claim);color:#fff;font-size:11px;font-weight:800;padding:1px 8px;border-radius:10px}
.am-item.danger{color:var(--claim)}
.am-item.danger .ic{background:var(--claim-soft);color:var(--claim)}
.am-sw{position:relative;width:46px;height:28px;flex:none}
.am-sw input{position:absolute;opacity:0;inset:0;margin:0;cursor:pointer}
.am-sw i{position:absolute;inset:0;border-radius:99px;background:var(--line-2);transition:background .15s}
.am-sw i::after{content:'';position:absolute;left:3px;top:3px;width:22px;height:22px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.25);transition:transform .15s}
.am-sw input:checked+i{background:var(--brand)}
.am-sw input:checked+i::after{transform:translateX(18px)}
.am-foot{text-align:center;color:var(--muted);font-size:12px;margin:6px 0 10px}

/* ---------- sign in screen ---------- */
html.appmode #publicView{background:var(--side);min-height:100vh}
html.appmode .pub{background:var(--side)}
html.appmode .pub-nav,html.appmode .pub-foot{display:none!important}
html.appmode #pubLogin,html.appmode #pubSignup,html.appmode #pubLegal{min-height:100vh;display:flex;flex-direction:column;padding:0}
html.appmode #pubLogin[hidden],html.appmode #pubSignup[hidden],html.appmode #pubLegal[hidden]{display:none}
.am-hero{padding:46px 26px 30px;color:#fff}
.am-hero .lg{width:60px;height:60px;border-radius:16px;background:#12233A;display:grid;place-items:center;margin-bottom:18px}
.am-hero .lg svg{width:34px;height:34px;color:#fff}
.am-hero h1{margin:0;font-size:27px;font-weight:800;letter-spacing:-.02em}
.am-hero p{margin:6px 0 0;color:var(--side-muted);font-size:14.5px;line-height:1.5}
html.appmode #pubLogin .login-card,html.appmode #pubSignup .login-card{flex:1;max-width:none;border-radius:24px 24px 0 0;border:0;box-shadow:none;padding:28px 22px calc(28px + var(--kb,0px))}
html.appmode #pubLogin .brandmark{display:none}
html.appmode #pubLogin .login-card::before{content:'Sign in';display:block;font-size:20px;font-weight:800;margin-bottom:16px}
html.appmode #pubLegal{background:var(--surface);padding:16px}
.am-bio{display:flex;gap:10px;align-items:center;margin:2px 0 12px;font-size:14px;font-weight:600;color:var(--ink-2)}
.am-bio input{width:20px;height:20px;accent-color:var(--brand)}
.am-back{display:inline-flex;align-items:center;gap:6px;color:#fff;background:none;border:0;font:700 14px var(--sans);padding:14px 16px}

/* ---------- fixes after device test ---------- */
html.appmode .content{overflow-x:hidden}
html.appmode .grid>*{min-width:0}
html.appmode .page-head .crumb{display:none}
html.appmode table.t:has(td[data-label]) tr{position:relative}
html.appmode table.t:has(td[data-label]) td:first-child:has(input[data-sel]){position:absolute;right:12px;top:10px;padding:0}
html.appmode table.t:has(td[data-label]) td:first-child:has(input[data-sel])+td{padding-right:34px}
html.appmode table.t:has(td[data-label]) input[data-sel]{width:20px;height:20px;accent-color:var(--brand)}
html.appmode .toolbar .select,html.appmode .toolbar select{flex:1 1 calc(50% - 8px);min-width:0}
html.appmode .spot-body{display:flex;flex-direction:column}
html.appmode .spot-body #spRes{flex:1 1 auto;min-height:0;overflow-y:auto}
html.appmode .spot-body #spQa{flex:none}
html.appmode .spot-top input::-webkit-search-cancel-button{display:none;-webkit-appearance:none}
html.appmode #rvBox{display:flex;flex-direction:column}
html.appmode #rvBox>*{order:6}
html.appmode #rvBox>label.field:first-child{order:1}
html.appmode #rvBox>#rvNat{order:2}
html.appmode #rvBox>label.chk{order:3;margin:10px 0 16px}
html.appmode #rvBox>label.field:has(#rvScan){order:4}
html.appmode #rvBox>p.muted{display:none}

/* ---------- page opened inside a native app screen ---------- */
html.appmode.embed .top,html.appmode.embed #appTabs{display:none!important}
html.appmode.embed .content{padding-bottom:28px}
html.appmode.embed .page-head{padding-top:14px}
html.appmode.embed .toasts{bottom:16px}
