/* Redrawn 2 and 5 on Pixelify Sans's pixel grid; every other character comes from Pixelify Sans */
@font-face{font-family:"GD Digits";font-weight:500 600;font-display:block;unicode-range:U+0032,U+0035;src:url(data:font/woff2;base64,d09GMgABAAAAAAKoAA8AAAAABawAAAJQAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGyAcKgZgP1NUQVQqADwRCAqBNIElATYCJAMKCwgABCAFhCYHIAwHG40EERWU/xQ/Duy2qQlMhaP3M0169vHw/Droz30zCyOBSUgbBTcpuW60E4y0zR/z8/M6pPLi4HhLZ+fhQxMC4Oo0TWkWgcxaKnLESrNm4a4BKR04ggcejMXzBTD28/SEr9tEA79Aj4gYMXYU9Ny9VaCs+hqKvv0HDFRaDkUBCJTVUmsJQqs4c9zC2Wqj5yBP7dNQJUjn00ZsHlDitQ7+Jh8iPjr+MJd10Dnb9f832Z5ogoC4nc6jsUwIpQWqC9SXlkyZujAgCYgsDQUJGarLBKrLtUZJuZCEaVHgNyzuFrcFIERRqAQyUBI5uqAbIAdJiDyvW/1bqlLJ8RVKlB9TVrkop2wJFaJ8lPPK9mpEBWUDqVSIctnUD/vmCVval2y/bVHdfnVtbzZs5eKV368vH7xw/OKDL1d2aZZPmTV4+MPhQ1vrWi/d933I4lXDBrcePLzk8CHlhkxa9RIIBC9qzng8plLXH6Wz7Bu8bzS/HXz5VH+bbsX8ND3tRUkJBPcO0h3jdNsQ0k/rZGIa5A2BTF3CQB6Vt0Mm8jI4zgRCVcchqegKZHp6tM5BKKFuVIeSKkcbqKhLdF9X3vKrGLVQFJSP1XFky3v3AeXFWDFCGwi8wIcPRfBgA5IMj/COshoeVc5R0sCybWheQZHGfkdT1AvXJayhbewkuXKRAB01g6tl7T19v4EN41X1CzVtK6PKj7z6dXi737Yh1w6TfxEptspl+kNVzfIMzNB3ov+8/1wnFSua2qmZdPKKuPfdRYr93RfE89QrTgjqp6NYczjfAgA=) format("woff2")}
@font-face{font-family:"GD Digits";font-weight:700;font-display:block;unicode-range:U+0032,U+0035;src:url(data:font/woff2;base64,d09GMgABAAAAAAKsAA8AAAAABXQAAAJUAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGyAcKgZgP1NUQVQqADwRCAqBNIElATYCJAMKCwgABCAFg3AHIAwHG1cECB6FccNdot9kkjfeFKVdg6jGdO//g6BSQkmsSDgG3dSnisBWqOgS6bpOhC6T/vn2c3czy0t7F2emSJx8t0Re53VK8FIIjVTgeen2/m5ER5xhHnmqQRRpm7oJ2Iu1LbVExqYfWWCvXT42cIIP1KS/PA+wMEq3CQr5JCgiMUI8quvoVgR4ZYuAR+fyCDwMwFoAQIBXqSgbxhY6x1QehOF5AFP16oIDIVerYF1Y5FPlnxEFOD8dI/DGH1Ra2/8T9J0CAAKQpy5APjsh3ATEQZDNds2QKgRQBCCtLgAooEGcnYA4h3IAJ0MoVUpjgR5oM3NFAICQsYQAaABOYEAdQCsAgAGgCGmTiHe5Qs7xgMM/4sUXH16nBuIXX+RVOhDAGwgJSKzzWOjaxEZNqGYrFamL8FrWuzy/fJOZ7ZIeXn6ul5uLopXNPf/1dWdp7rH0zfJd996ubFcf7Ovydo3frwFAgOD9pvZ7JNTy79b6CXCdl6wAwMNd9hatk1RzKk04KQCCiyP1QkBrAsjECkgna4AKINASFQ185pViJ+0BDiDTRdS7rrhd6lqD37FBdYdEnLpTOPlaUF0qDAL+TCdiqp/dRiCyyCgEkgrJy8rLQY5IGGSLYsKwKDgLcnDGUyBbMgENc6VCejQqkkDGSJTyVCJFXUYGgVKe5iLtSsDJwDrYMSpTpllIHcVMDCFDVCFP0Sdg3eSkZd3fDWsbayMNDQim9ukDjDwBReQhTmdl1J9EFVcyQkRC0qpSVvoJZwgZG2NLjzBvpuzAmNlDqmRPxC7smA0A) format("woff2")}
/* Layout: scan-first desk. Left rail (desktop) / bottom tabs (tablet, phone). Chunky 8-bit keys on calm warm neutrals. */
:root{
  --bg:#F6F4F0; --surface:#FFFDF9; --sunk:#EDEAE4; --sunk-2:#E4E0D8; --line:#DDD8CF; --edge:#CBC4B8;
  --ink:#25221E; --muted:#6E685E; --faint:#9A9387;
  --blue:#1463FF; --blue-press:#0B4FD6; --blue-soft:#E2EBFF; --blue-ink:#FFFFFF;
  --orange:#FF5E1A; --orange-press:#DB4A0B; --orange-soft:#FFE7DA; --orange-ink:#FFFFFF;
  --ok:#17804B; --ok-soft:#DDF3E6; --bad:#C8311F; --bad-soft:#FBE1DC; --hold:#8A5A00; --hold-soft:#F8ECCB;
  --shadow:0 1px 0 rgba(60,50,35,.06), 0 8px 24px -12px rgba(60,50,35,.18);
  --f-pix:"GD Digits", "Pixelify Sans", "Courier New", ui-monospace, monospace;
  --f-body:"Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono:"IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --r:10px; --r-sm:7px; --r-lg:14px;
  --rail:224px;
}
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]){
  --bg:#161513; --surface:#1F1D1A; --sunk:#282622; --sunk-2:#312E29; --line:#38352F; --edge:#4A463E;
  --ink:#F2EEE7; --muted:#A8A194; --faint:#7C766B;
  --blue:#4C8DFF; --blue-press:#2F74F0; --blue-soft:#1B2944; --blue-ink:#0B1020;
  --orange:#FF7A3A; --orange-press:#F0621F; --orange-soft:#3B2416; --orange-ink:#1A0C04;
  --ok:#4CC486; --ok-soft:#173226; --bad:#FF7B69; --bad-soft:#3A1C17; --hold:#E7B64A; --hold-soft:#342913;
  --shadow:0 1px 0 rgba(0,0,0,.3), 0 10px 28px -14px rgba(0,0,0,.6);
  color-scheme:dark; } }
:root[data-theme="dark"]{
  --bg:#161513; --surface:#1F1D1A; --sunk:#282622; --sunk-2:#312E29; --line:#38352F; --edge:#4A463E;
  --ink:#F2EEE7; --muted:#A8A194; --faint:#7C766B;
  --blue:#4C8DFF; --blue-press:#2F74F0; --blue-soft:#1B2944; --blue-ink:#0B1020;
  --orange:#FF7A3A; --orange-press:#F0621F; --orange-soft:#3B2416; --orange-ink:#1A0C04;
  --ok:#4CC486; --ok-soft:#173226; --bad:#FF7B69; --bad-soft:#3A1C17; --hold:#E7B64A; --hold-soft:#342913;
  --shadow:0 1px 0 rgba(0,0,0,.3), 0 10px 28px -14px rgba(0,0,0,.6);
  color-scheme:dark; }

*{box-sizing:border-box}
html,body{height:100%}
body{background:var(--bg); color:var(--ink); font-family:var(--f-body); font-size:15px; line-height:1.45; -webkit-font-smoothing:antialiased; -webkit-tap-highlight-color:transparent}
button,input,select,textarea{font:inherit; color:inherit}
h1,h2,h3{margin:0; text-wrap:balance; line-height:1.15}
p{margin:0}
svg[viewBox="0 0 12 12"]{width:20px; height:20px; flex:none; display:inline-block; vertical-align:middle}
a{color:var(--blue)}
:focus-visible{outline:3px solid var(--blue); outline-offset:2px}
.pix{font-family:var(--f-pix); letter-spacing:.01em}
.mono{font-family:var(--f-mono); font-size:.9em}
.num{font-variant-numeric:tabular-nums}
.muted{color:var(--muted)}
.faint{color:var(--faint)}
.small{font-size:13px}
.tiny{font-size:12px}
.eyebrow{font-size:11.5px; font-weight:700; letter-spacing:.09em; text-transform:uppercase; color:var(--muted)}
.row{display:flex; align-items:center; gap:10px}
.row.wrap{flex-wrap:wrap}
.stack{display:flex; flex-direction:column; gap:12px}
.grow{flex:1; min-width:0}
.sr{position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0)}
.ellip{white-space:nowrap; overflow:hidden; text-overflow:ellipsis}

/* ---------- shell ---------- */
.shell{min-height:100%; display:grid; grid-template-columns:1fr}
.rail{display:none}
.main{min-width:0; padding-inline:16px; padding-block:0 calc(92px + env(safe-area-inset-bottom,0px))}
.topbar{position:sticky; top:env(safe-area-inset-top,0px); z-index:20; background:color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px); margin-inline:-16px; padding:10px 16px; display:flex; align-items:center; gap:12px; border-bottom:1px solid transparent}
.topbar.scrolled{border-bottom-color:var(--line)}
.topbar h1{font-family:var(--f-pix); font-weight:600; font-size:22px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0}
@media (max-width:480px){ .topbar h1{font-size:19px} }
.brand{display:flex; align-items:center; gap:9px; text-decoration:none; color:var(--ink)}
.brand-mark{width:30px; height:30px; flex:none}
.brand-name{font-family:var(--f-pix); font-weight:700; font-size:18px; line-height:1}
.brand-sub{font-size:11px; color:var(--muted); letter-spacing:.04em}
.topbar .brand{display:flex}
.me-chip{display:flex; align-items:center; gap:8px; padding:4px 10px 4px 4px; border-radius:99px; background:var(--sunk); font-size:13px; border:0; cursor:pointer}
.me-chip img{width:26px; height:26px; border-radius:50%}
.role{font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--blue)}
.content{max-width:1240px; margin-inline:auto; padding-block:12px 24px}

.tabs{position:fixed; left:0; right:0; bottom:0; z-index:30; background:var(--surface); border-top:1px solid var(--line); display:grid; grid-template-columns:repeat(var(--n,5),1fr); padding:6px 6px calc(6px + env(safe-area-inset-bottom,0px))}
.tab{border:0; background:none; display:flex; flex-direction:column; align-items:center; gap:3px; padding:6px 2px; border-radius:var(--r-sm); color:var(--muted); font-size:11.5px; font-weight:600; cursor:pointer; position:relative}
.tab svg{width:24px; height:24px}
.tab[aria-current="page"]{color:var(--blue); background:var(--blue-soft)}
.tab .badge{position:absolute; top:2px; left:calc(50% + 6px)}
.badge{min-width:18px; height:18px; padding:0 5px; border-radius:99px; background:var(--orange); color:var(--orange-ink); font-size:11px; font-weight:700; display:inline-grid; place-items:center; font-variant-numeric:tabular-nums}

@media (min-width:1024px){
  .shell{grid-template-columns:var(--rail) 1fr}
  .rail{display:flex; flex-direction:column; gap:4px; position:sticky; top:0; height:100vh; padding:18px 12px; border-right:1px solid var(--line); background:var(--surface)}
  .rail .brand{padding:4px 8px 18px}
  .rail .tab{flex-direction:row; justify-content:flex-start; gap:12px; padding:10px 12px; font-size:14.5px}
  .rail .tab svg{width:22px; height:22px}
  .rail .tab .badge{position:static; margin-left:auto}
  .rail-foot{margin-top:auto; padding:10px; font-size:12px; color:var(--muted)}
  .tabs{display:none}
  .main{padding-inline:28px; padding-block:0 32px}
  .topbar{margin-inline:-28px; padding:14px 28px}
  .topbar .brand{display:none}
}

/* ---------- buttons ---------- */
.btn{--c:var(--surface); --t:var(--ink); --e:var(--edge); appearance:none; border:1.5px solid var(--e); background:var(--c); color:var(--t); border-radius:var(--r-sm); padding:10px 16px; font-weight:650; font-size:15px; line-height:1.2; display:inline-flex; align-items:center; justify-content:center; gap:8px; cursor:pointer; box-shadow:0 3px 0 var(--e); transform:translateY(0); transition:transform .06s, box-shadow .06s, background .15s; text-decoration:none; white-space:nowrap; min-height:44px}
.btn:active:not(:disabled){transform:translateY(2px); box-shadow:0 1px 0 var(--e)}
.btn:disabled{opacity:.45; cursor:not-allowed; box-shadow:none}
.btn svg{width:18px; height:18px; flex:none}
.btn.primary{--c:var(--blue); --t:var(--blue-ink); --e:var(--blue-press)}
.btn.warn{--c:var(--orange); --t:var(--orange-ink); --e:var(--orange-press)}
.btn.ghost{--c:transparent; --e:transparent; box-shadow:none; color:var(--ink)}
.btn.ghost:hover{background:var(--sunk)}
.btn.soft{--c:var(--sunk); --e:var(--sunk-2)}
.btn.danger{--c:var(--bad-soft); --t:var(--bad); --e:color-mix(in srgb, var(--bad) 45%, var(--bad-soft))}
.btn.sm{padding:6px 11px; font-size:13.5px; min-height:34px; box-shadow:0 2px 0 var(--e)}
.btn.lg{padding:14px 20px; font-size:17px; min-height:54px}
.btn.block{width:100%}
.icon-btn{border:0; background:transparent; width:40px; height:40px; border-radius:var(--r-sm); display:inline-grid; place-items:center; cursor:pointer; color:var(--muted)}
.icon-btn:hover{background:var(--sunk); color:var(--ink)}
.icon-btn svg{width:20px; height:20px}
.link{border:0; background:none; padding:0; color:var(--blue); font-weight:600; cursor:pointer; text-decoration:underline; text-underline-offset:3px; text-decoration-thickness:1.5px}

/* ---------- chips / pills ---------- */
.chips{display:flex; gap:8px; flex-wrap:wrap}
.chips.scroll{flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; margin-inline:-16px; padding-inline:16px; padding-block:2px 4px}
.chips.scroll::-webkit-scrollbar{display:none}
.chip{border:1.5px solid var(--line); background:var(--surface); border-radius:99px; padding:6px 12px; font-size:13.5px; font-weight:600; color:var(--ink); cursor:pointer; white-space:nowrap; display:inline-flex; align-items:center; gap:6px; min-height:34px}
.chip[aria-pressed="true"]{background:var(--ink); color:var(--bg); border-color:var(--ink)}
.chip .n{font-variant-numeric:tabular-nums; opacity:.7; font-weight:500}
.pill{display:inline-flex; align-items:center; gap:5px; border-radius:6px; padding:2px 8px; font-size:12px; font-weight:700; letter-spacing:.02em; white-space:nowrap; background:var(--sunk); color:var(--muted)}
.pill::before{content:""; width:6px; height:6px; background:currentColor; flex:none}
.pill.in{background:var(--ok-soft); color:var(--ok)}
.pill.out{background:var(--blue-soft); color:var(--blue)}
.pill.late{background:var(--orange-soft); color:var(--orange)}
.pill.soon{background:var(--hold-soft); color:var(--hold)}
.pill.repair{background:var(--hold-soft); color:var(--hold)}
.pill.missing{background:var(--bad-soft); color:var(--bad)}
.pill.retired{background:var(--sunk); color:var(--faint)}
.pill.plain::before{display:none}
.tag{display:inline-flex; align-items:center; gap:4px; font-size:12px; font-weight:600; padding:2px 7px; border-radius:5px; background:var(--sunk); color:var(--muted)}
.tag.warn{background:var(--orange-soft); color:var(--orange)}

/* ---------- cards ---------- */
.card{background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); padding:16px}
.card.flat{box-shadow:none}
.section-h{display:flex; align-items:baseline; gap:10px; margin-bottom:10px}
.section-h h2{font-size:17px; font-weight:700}
.section-h .spacer{flex:1}
.divider{height:1px; background:var(--line); margin-block:4px}

/* ---------- fields ---------- */
.field{display:flex; flex-direction:column; gap:6px; min-width:0}
.field > span{font-size:13px; font-weight:650; color:var(--muted)}
.input, select.input, textarea.input{width:100%; border:1.5px solid var(--line); background:var(--surface); border-radius:var(--r-sm); padding:10px 12px; min-height:44px; font-size:16px}
textarea.input{min-height:90px; resize:vertical; line-height:1.45}
.input:focus{outline:none; border-color:var(--blue); box-shadow:0 0 0 3px var(--blue-soft)}
.search{position:relative}
.search svg{position:absolute; left:12px; top:50%; transform:translateY(-50%); width:18px; height:18px; color:var(--faint); pointer-events:none}
.search .input{padding-left:38px}
.grid2{display:grid; grid-template-columns:1fr 1fr; gap:12px}
@media (max-width:560px){ .grid2{grid-template-columns:1fr} }
.check{display:flex; gap:10px; align-items:flex-start; font-size:14.5px; cursor:pointer}
.check input{width:20px; height:20px; accent-color:var(--blue); margin-top:1px; flex:none}
.switch{display:inline-flex; align-items:center; gap:8px; border:1.5px solid var(--line); border-radius:99px; padding:4px 10px 4px 4px; font-size:13px; font-weight:600; cursor:pointer; background:var(--surface); min-height:34px}
.switch .dot{width:22px; height:22px; border-radius:50%; background:var(--sunk-2); display:grid; place-items:center; color:transparent}
.switch .dot svg{width:14px; height:14px}
.switch[aria-pressed="true"]{border-color:color-mix(in srgb, var(--ok) 50%, var(--line)); background:var(--ok-soft); color:var(--ok)}
.switch[aria-pressed="true"] .dot{background:var(--ok); color:var(--surface)}
.switch.bad[aria-pressed="false"]{border-color:color-mix(in srgb, var(--orange) 50%, var(--line)); background:var(--orange-soft); color:var(--orange)}

/* ---------- item visuals ---------- */
.thumb{width:56px; height:56px; border-radius:var(--r-sm); background:var(--sunk); display:grid; place-items:center; flex:none; overflow:hidden; color:var(--muted)}
.thumb{position:relative}
.thumb img{position:absolute; inset:0; width:100%; height:100%; object-fit:contain; background:#fff}
.thumb svg{width:60%; height:60%}
.thumb.sm{width:44px; height:44px}
.thumb.lg{width:100%; height:auto; aspect-ratio:4/3; max-width:100%}
.aid{font-family:var(--f-pix); font-weight:700; font-size:18px; letter-spacing:.04em; line-height:1}
.aid.lg{font-size:40px}
.aid.xl{font-size:56px}
.item-line{display:flex; align-items:center; gap:12px; min-width:0}
.item-line .meta{min-width:0; flex:1}
.item-name{font-weight:650; line-height:1.25}
.item-sub{font-size:13px; color:var(--muted)}

/* ---------- desk ---------- */
.desk{display:grid; gap:16px; grid-template-columns:minmax(0,1fr)}
.desk > *{min-width:0}
@media (min-width:860px){ .desk{grid-template-columns:minmax(300px,380px) 1fr; align-items:start} .desk-scan{position:sticky; top:84px} }
.desk-scan{display:flex; flex-direction:column; gap:14px; background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); padding:16px; background-image:radial-gradient(var(--sunk-2) 1px, transparent 1.2px); background-size:12px 12px; background-position:-6px -6px}
.scan-btn{width:100%; min-height:84px; font-size:20px; font-family:var(--f-pix); font-weight:600; letter-spacing:.02em; border-radius:var(--r)}
.scan-btn svg{width:30px; height:30px}
.hint{font-size:12.5px; color:var(--muted); text-align:center}
.or{display:flex; align-items:center; gap:10px; font-size:12px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--faint)}
.or::before,.or::after{content:""; flex:1; height:1px; background:var(--line)}
.id-form{display:flex; gap:8px}
.id-input{flex:1; min-width:0; font-family:var(--f-pix); font-size:34px; font-weight:600; letter-spacing:.28em; text-align:center; border:2px solid var(--line); background:var(--surface); border-radius:var(--r); padding:6px 8px; height:64px; font-variant-numeric:tabular-nums}
.id-input::placeholder{color:var(--sunk-2)}
.id-input:focus{outline:none; border-color:var(--blue); box-shadow:0 0 0 3px var(--blue-soft)}
.id-form .btn{height:64px; min-width:64px; font-family:var(--f-pix); font-size:18px}
.keypad{display:grid; grid-template-columns:repeat(3,1fr); gap:8px}
.key{height:54px; border-radius:var(--r-sm); border:1.5px solid var(--edge); background:var(--surface); box-shadow:0 3px 0 var(--edge); font-family:var(--f-pix); font-size:24px; font-weight:600; cursor:pointer; color:var(--ink)}
.key:active{transform:translateY(2px); box-shadow:0 1px 0 var(--edge)}
.key.fn{font-family:var(--f-body); font-size:13px; font-weight:700; color:var(--muted); background:var(--sunk)}
.key.go{background:var(--blue); color:var(--blue-ink); border-color:var(--blue-press); box-shadow:0 3px 0 var(--blue-press); font-family:var(--f-body); font-size:15px; font-weight:700}
@media (max-width:859px){ .keypad{display:none} .keypad.show{display:grid} }
.kp-toggle{display:none}
@media (max-width:859px){ .kp-toggle{display:inline-flex; align-self:center} }
.scan-msg{min-height:0}
.scan-msg:empty{display:none}
.msg{border-radius:var(--r-sm); padding:10px 12px; font-size:14px; font-weight:600; display:flex; gap:8px; align-items:flex-start}
.msg svg{width:18px; height:18px; flex:none; margin-top:1px}
.msg.err{background:var(--bad-soft); color:var(--bad)}
.msg.info{background:var(--blue-soft); color:var(--blue)}
.msg.warn{background:var(--orange-soft); color:var(--orange)}
.msg.ok{background:var(--ok-soft); color:var(--ok)}
.shake{animation:shake .32s}
@keyframes shake{20%,60%{transform:translateX(-5px)}40%,80%{transform:translateX(5px)}}
@keyframes pop{0%{transform:scale(.96); opacity:.4}100%{transform:scale(1); opacity:1}}
.pop{animation:pop .18s ease-out}
.desk-work{display:flex; flex-direction:column; gap:16px; min-width:0}
.today{display:grid; grid-template-columns:repeat(3,1fr); gap:10px}
.stat{border:1px solid var(--line); background:var(--surface); border-radius:var(--r); padding:10px 12px; text-align:left; cursor:pointer; display:flex; flex-direction:column; gap:2px}
.stat b{font-family:var(--f-pix); font-size:26px; font-weight:600; line-height:1.05; font-variant-numeric:tabular-nums}
.stat span{font-size:12.5px; color:var(--muted); font-weight:600}
.stat.hot{border-color:color-mix(in srgb, var(--orange) 45%, var(--line)); background:var(--orange-soft)}
.stat.hot b{color:var(--orange)}
.panel{background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); overflow:hidden}
.panel-h{display:flex; align-items:center; gap:10px; padding:12px 16px; border-bottom:1px solid var(--line); background:var(--sunk)}
.panel-h h2{font-size:15px; font-weight:750; letter-spacing:.01em}
.panel-h .spacer{flex:1}
.panel-b{padding:14px 16px; display:flex; flex-direction:column; gap:12px}
.panel.ret .panel-h{background:var(--orange-soft)}
.panel.ret .panel-h h2{color:var(--orange)}
.lines{display:flex; flex-direction:column}
.lines > .li{padding:12px 16px; border-top:1px solid var(--line); display:flex; flex-direction:column; gap:10px}
.lines > .li:first-child{border-top:0}
.li-actions{display:flex; gap:8px; flex-wrap:wrap; align-items:center}
.empty{padding:22px 16px; text-align:center; color:var(--muted); display:flex; flex-direction:column; align-items:center; gap:8px}
.empty svg{width:44px; height:44px; color:var(--sunk-2)}
.empty b{color:var(--ink)}
.student-card{display:flex; align-items:center; gap:12px; padding:10px 12px; border:1.5px solid var(--blue); background:var(--blue-soft); border-radius:var(--r)}
.avatar{width:38px; height:38px; border-radius:var(--r-sm); display:grid; place-items:center; font-family:var(--f-pix); font-weight:700; font-size:16px; flex:none; color:#fff}
.results{display:flex; flex-direction:column; border:1px solid var(--line); border-radius:var(--r); overflow:hidden}
.results:empty{display:none}
.result{display:flex; align-items:center; gap:10px; padding:10px 12px; border:0; border-top:1px solid var(--line); background:var(--surface); text-align:left; cursor:pointer; width:100%}
.result:first-child{border-top:0}
.result:hover,.result:focus-visible{background:var(--blue-soft)}
.due-line{display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:var(--r); background:var(--sunk)}
.due-line b{font-weight:700}
.success{display:flex; flex-direction:column; align-items:center; text-align:center; gap:10px; padding:26px 16px}
.success .big-check{width:64px; height:64px; color:var(--ok)}

/* ---------- lists / gear ---------- */
.toolbar{display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-bottom:12px}
.toolbar .search{flex:1 1 240px; min-width:0}
.gear-grid{display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%,230px),1fr)); gap:10px}
.gcard{position:relative; display:flex; gap:12px; align-items:center; padding:10px; border:1px solid var(--line); background:var(--surface); border-radius:var(--r); text-align:left; cursor:pointer; min-width:0; width:100%}
.gcard:hover{border-color:var(--edge)}
.gcard .meta{min-width:0; flex:1; display:flex; flex-direction:column; gap:3px}
.gcard .sel{position:absolute; top:8px; right:8px; width:22px; height:22px; accent-color:var(--blue)}
.gcard.selected{border-color:var(--blue); box-shadow:0 0 0 2px var(--blue-soft)}
.tbl-wrap{overflow-x:auto; border:1px solid var(--line); border-radius:var(--r); background:var(--surface)}
table.tbl{border-collapse:collapse; width:100%; font-size:14px; min-width:760px}
.tbl th{position:sticky; top:0; background:var(--sunk); text-align:left; font-size:12px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--muted); padding:9px 12px; border-bottom:1px solid var(--line); white-space:nowrap}
.tbl th button{border:0; background:none; font:inherit; color:inherit; letter-spacing:inherit; text-transform:inherit; cursor:pointer; padding:0}
.tbl td{padding:9px 12px; border-bottom:1px solid var(--line); vertical-align:middle}
.tbl tr:last-child td{border-bottom:0}
.tbl tbody tr{cursor:pointer}
.tbl tbody tr:hover td{background:color-mix(in srgb, var(--blue-soft) 45%, transparent)}
.tbl td.r,.tbl th.r{text-align:right}
.tbl tfoot td{background:var(--sunk); font-weight:700; border-top:1px solid var(--line)}
.filters{display:grid; grid-template-columns:repeat(auto-fill, minmax(160px,1fr)); gap:10px; padding:12px; border:1px dashed var(--edge); border-radius:var(--r); margin-bottom:12px}
.selbar{position:sticky; bottom:calc(84px + env(safe-area-inset-bottom,0px)); z-index:15; display:flex; gap:10px; align-items:center; padding:10px 12px; margin-top:12px; background:var(--ink); color:var(--bg); border-radius:var(--r); box-shadow:var(--shadow)}
@media (min-width:1024px){ .selbar{bottom:16px} }
.selbar .btn.ghost{color:var(--bg)}

.group{border:1px solid var(--line); border-radius:var(--r-lg); background:var(--surface); overflow:hidden}
.group + .group{margin-top:12px}
.group-h{display:flex; align-items:center; gap:12px; padding:12px 14px; background:var(--sunk); flex-wrap:wrap}
.group-h .grow{min-width:140px}
.loan-row{display:flex; align-items:center; gap:12px; padding:10px 14px; border-top:1px solid var(--line); flex-wrap:wrap}
.loan-row .meta{flex:1 1 200px; min-width:0}
.loan-row .acts{display:flex; gap:6px; margin-left:auto}

/* ---------- sheet ---------- */
.scrim{position:fixed; inset:0; background:rgba(25,20,14,.42); z-index:50; display:flex; align-items:flex-end; justify-content:center; animation:fade .15s}
@keyframes fade{from{opacity:0}}
.sheet{background:var(--bg); width:100%; max-height:92vh; max-height:92dvh; border-radius:18px 18px 0 0; display:flex; flex-direction:column; box-shadow:var(--shadow); animation:up .2s ease-out; padding-bottom:env(safe-area-inset-bottom,0px)}
@keyframes up{from{transform:translateY(24px); opacity:.6}}
.sheet-h{display:flex; align-items:center; gap:10px; padding:14px 16px 10px; border-bottom:1px solid var(--line)}
.sheet-h h2{font-size:18px; font-weight:750; flex:1; min-width:0}
.sheet-b{overflow:auto; padding:16px; display:flex; flex-direction:column; gap:16px; overscroll-behavior:contain}
.sheet-f{padding:12px 16px; border-top:1px solid var(--line); display:flex; gap:10px; justify-content:flex-end; flex-wrap:wrap; background:var(--surface)}
.sheet-f:empty{display:none}
@media (min-width:700px){
  .scrim{align-items:center; padding:24px}
  .sheet{max-width:560px; border-radius:18px; max-height:88vh}
  .sheet.wide{max-width:860px}
}
.kv{display:grid; grid-template-columns:auto 1fr; gap:8px 16px; font-size:14.5px}
.kv dt{color:var(--muted); font-weight:600}
.kv dd{margin:0; min-width:0; overflow-wrap:anywhere}
.note{border-left:3px solid var(--edge); padding:4px 0 4px 12px; display:flex; flex-direction:column; gap:3px}
.note.damage{border-color:var(--orange)}
.note.missing{border-color:var(--bad)}
.note.repair{border-color:var(--hold)}
.note.student{border-color:var(--blue)}
.note .when{font-size:12px; color:var(--muted)}
.ad-head{display:grid; grid-template-columns:132px 1fr; gap:16px; align-items:center}
@media (max-width:480px){ .ad-head{grid-template-columns:96px 1fr} .aid.lg{font-size:32px} }
.ad-photo{position:relative}
.ad-photo .thumb{width:100%; height:auto; aspect-ratio:1}
.value-line{display:flex; align-items:center; gap:10px; padding:10px 12px; border:1px dashed var(--edge); border-radius:var(--r)}
.label-prev{background:#fff; border-radius:8px; padding:8px; border:1px solid var(--line); display:inline-block; max-width:100%}
.label-prev svg,.label-prev img{display:block; width:300px; max-width:100%; height:auto}
.sig-pad{width:100%; height:180px; border:2px dashed var(--edge); border-radius:var(--r); background:var(--surface); touch-action:none; display:block}
.agreement-text{white-space:pre-wrap; font-size:14.5px; line-height:1.55; max-height:260px; overflow:auto; padding:14px; background:var(--surface); border:1px solid var(--line); border-radius:var(--r)}
.sig-img{background:#fff; border-radius:8px; border:1px solid var(--line); max-width:100%; height:auto; width:300px}

/* ---------- manage ---------- */
.tiles{display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%,170px),1fr)); gap:10px}
.tile{border:1px solid var(--line); background:var(--surface); border-radius:var(--r); padding:12px 14px; display:flex; flex-direction:column; gap:2px}
.tile b{font-family:var(--f-pix); font-size:28px; font-weight:600; line-height:1.1; font-variant-numeric:tabular-nums}
.tile span{font-size:12.5px; color:var(--muted); font-weight:600}
.tile.hot b{color:var(--orange)}
.bar{display:flex; height:12px; gap:2px; border-radius:3px; overflow:hidden; background:var(--sunk); min-width:80px}
.bar i{display:block; height:100%}
.bar i.in{background:var(--ok)} .bar i.out{background:var(--blue)} .bar i.late{background:var(--orange)} .bar i.hold{background:var(--hold)} .bar i.bad{background:var(--bad)}
.legend{display:flex; gap:14px; flex-wrap:wrap; font-size:12.5px; color:var(--muted)}
.legend span{display:inline-flex; align-items:center; gap:6px}
.legend i{width:10px; height:10px; display:inline-block}
.chunks{display:grid; grid-template-columns:repeat(20,1fr); gap:3px}
.chunks i{height:14px; background:var(--sunk-2); border-radius:2px}
.chunks i.on{background:var(--blue)}
.chunks i.loan{background:color-mix(in srgb, var(--blue) 40%, var(--sunk-2))}
.manage-layout{display:flex; flex-direction:column; gap:16px}
.subnav{display:flex; gap:6px; flex-wrap:wrap}
.flag{display:flex; gap:12px; align-items:flex-start; padding:12px 14px; border-top:1px solid var(--line)}
.flag:first-child{border-top:0}

/* ---------- student view ---------- */
.hello{display:flex; flex-direction:column; gap:4px; margin-block:6px 16px}
.hello h2{font-family:var(--f-pix); font-size:28px; font-weight:600}
.my-loan{display:grid; grid-template-columns:auto 1fr; gap:14px; align-items:center}
.countdown{font-family:var(--f-pix); font-size:22px; font-weight:600; line-height:1.1}
.countdown.late{color:var(--orange)}
.banner{display:flex; align-items:center; gap:12px; padding:10px 14px; border-radius:var(--r); background:var(--ink); color:var(--bg); margin-block:10px; flex-wrap:wrap}
.banner .btn{--c:var(--bg); --t:var(--ink); --e:var(--edge)}

/* ---------- toast ---------- */
.toasts{position:fixed; left:50%; transform:translateX(-50%); bottom:calc(92px + env(safe-area-inset-bottom,0px)); z-index:80; display:flex; flex-direction:column; gap:8px; align-items:center; width:min(92vw,440px); pointer-events:none}
@media (min-width:1024px){ .toasts{bottom:24px} }
.toast{pointer-events:auto; background:var(--ink); color:var(--bg); padding:11px 14px; border-radius:var(--r); font-size:14px; font-weight:600; box-shadow:var(--shadow); display:flex; gap:12px; align-items:center; animation:up .18s ease-out; width:100%}
.toast .link{color:var(--bg)}
.toast.err{background:var(--bad); color:#fff}

.boot{min-height:60vh; display:grid; place-items:center; text-align:center; padding:40px 16px}
.boot .stack{align-items:center; max-width:420px}
.loader{display:flex; gap:5px}
.loader i{width:10px; height:10px; background:var(--blue); animation:blink 1s infinite steps(2)}
.loader i:nth-child(2){animation-delay:.2s; background:var(--orange)} .loader i:nth-child(3){animation-delay:.4s}
@keyframes blink{50%{opacity:.15}}
@media (prefers-reduced-motion: reduce){ *{animation:none!important; transition:none!important} }

/* ---------- Web version additions ---------- */
.hr{height:1px; background:var(--line); margin:4px 0}
html.no-scroll, html.no-scroll body{overflow:hidden}
.signin{min-height:70vh}
.signin .or{margin:2px 0}
.live-scan{position:fixed; inset:0; z-index:200; background:#0E0D0C; color:#F2EEE7; display:flex; flex-direction:column; padding:max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom))}
.live-scan .ls-top{display:flex; align-items:center; gap:8px; padding:4px 4px 10px}
.live-scan .ls-top b{font-size:20px}
.live-scan .grow{flex:1}
.live-scan .ls-stage{position:relative; flex:1; min-height:0; border-radius:var(--r-lg); overflow:hidden; background:#000}
.live-scan video{width:100%; height:100%; object-fit:cover; display:block}
.live-scan .ls-frame{position:absolute; left:50%; top:50%; width:min(70vw, 360px); aspect-ratio:1.6; transform:translate(-50%,-50%); pointer-events:none}
.live-scan .ls-frame i{position:absolute; width:28px; height:28px; border:4px solid var(--orange)}
.live-scan .ls-frame i:nth-child(1){left:0; top:0; border-right:0; border-bottom:0}
.live-scan .ls-frame i:nth-child(2){right:0; top:0; border-left:0; border-bottom:0}
.live-scan .ls-frame i:nth-child(3){left:0; bottom:0; border-right:0; border-top:0}
.live-scan .ls-frame i:nth-child(4){right:0; bottom:0; border-left:0; border-top:0}
.live-scan .ls-foot{padding:12px 4px 2px; min-height:72px}
.live-scan .ls-result{font-size:17px; font-weight:600; display:flex; align-items:center; gap:8px}
.live-scan .ls-result svg{width:20px; height:20px}
.live-scan .ls-ok{color:#7BE0A7; display:inline-flex; gap:8px; align-items:center}
.live-scan .ls-bad{color:#FF9C8A; display:inline-flex; gap:8px; align-items:center}
.live-scan .muted{color:#B9B2A6}
.live-scan .ls-count{color:#B9B2A6; margin-top:4px}
.tabs[hidden], .rail [hidden]{display:none!important}
