:root{
  --midnight:#004C54;
  --midnight2:#002B2E;
  --silver:#A5ACAF;
  --black:#0B0F12;
  --white:#FFFFFF;

  --bg:#F5F7FA;
  --card:#FFFFFF;
  --line:#E6EAEE;
  --muted:#5A6772;

  --radius:18px;
  --shadow:0 14px 38px rgba(11,15,18,.10);
  --shadow2:0 8px 20px rgba(11,15,18,.10);

  --tap:54px;
  --max:980px;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:var(--bg);
  color:var(--black);
}
.bg{
  position:fixed; inset:0;
  background:
    radial-gradient(1200px 800px at 20% 10%, rgba(0,76,84,.16), transparent 60%),
    radial-gradient(900px 700px at 80% 20%, rgba(165,172,175,.14), transparent 60%),
    radial-gradient(1000px 800px at 60% 90%, rgba(0,43,46,.10), transparent 60%),
    linear-gradient(180deg, #F7FAFC, #F3F6F9);
  pointer-events:none;
}
.topbar{
  position:sticky; top:0; z-index:20;
  padding:14px 14px calc(14px + env(safe-area-inset-top));
  background:linear-gradient(180deg,var(--midnight),var(--midnight2));
  color:var(--white);
  display:flex; align-items:center; justify-content:space-between;
  box-shadow:0 8px 20px rgba(0,0,0,.14);
}
.brand{display:flex; flex-direction:column; gap:4px}
.logo{
  font-weight:900; letter-spacing:.6px;
  font-size:20px;
}
.sub{opacity:.9; font-size:12px}
.top-actions{display:flex; gap:10px}
.chip{
  height:40px; min-width:40px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.18);
  background:rgba(255,255,255,.08);
  color:var(--white);
  font-size:18px;
}
.shell{
  max-width:var(--max);
  margin:0 auto;
  padding:16px 14px 92px;
}
.panel{animation:fade .12s ease-out}
.hidden{display:none !important}
@keyframes fade{from{opacity:.4; transform:translateY(3px)}to{opacity:1; transform:none}}

.h1{margin:6px 0 14px; font-size:22px}
.cards{
  display:grid; grid-template-columns:1fr; gap:12px;
}
.cards.two{grid-template-columns:1fr}
@media(min-width:820px){
  .cards{grid-template-columns:repeat(2,1fr)}
  .cards.two{grid-template-columns:repeat(2,1fr)}
}
.card, .cardStatic{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow2);
  padding:14px;
}
.card{
  text-align:left;
  cursor:pointer;
}
.cardTitle{font-weight:800; margin-bottom:6px}
.cardBody{color:var(--muted); font-size:13px}
.statusRow{display:flex; align-items:center; gap:10px; margin-top:14px}
.statusPill{
  padding:10px 12px; border-radius:999px;
  background:rgba(0,76,84,.12);
  border:1px solid rgba(0,76,84,.18);
  font-weight:700; font-size:13px;
}
.btn{
  height:44px; padding:0 14px;
  border-radius:12px;
  border:1px solid var(--line);
  background:var(--white);
  font-weight:800;
}
.btn.primary{
  background:linear-gradient(180deg,var(--midnight),var(--midnight2));
  color:var(--white);
  border-color:rgba(255,255,255,.18);
}
.panelHead{display:flex; align-items:center; justify-content:space-between; gap:12px}
.panelHeadRight{display:flex; gap:10px}
.toolbar{display:flex; gap:10px; align-items:center; margin:10px 0}
.search{
  flex:1; height:44px; padding:0 12px;
  border-radius:12px; border:1px solid var(--line);
  background:var(--white);
}
.list{display:flex; flex-direction:column; gap:10px; margin-top:10px}
.list.mini{max-height:340px; overflow:auto}
.item{
  background:var(--white); border:1px solid var(--line);
  border-radius:14px; padding:12px;
  box-shadow:var(--shadow2);
}
.itemTop{display:flex; justify-content:space-between; gap:10px}
.itemName{font-weight:900}
.itemSub{color:var(--muted); font-size:12px; margin-top:2px}
.row{display:flex; gap:10px; flex-wrap:wrap}
.field{display:flex; flex-direction:column; gap:6px; margin-top:10px}
.field label{font-weight:800; font-size:12px; color:#233}
.field input, .field textarea, select{
  border:1px solid var(--line);
  border-radius:12px;
  padding:10px 12px;
  font-size:15px;
  background:var(--white);
}
.grid2{display:grid; grid-template-columns:1fr; gap:10px}
@media(min-width:820px){.grid2{grid-template-columns:repeat(2,1fr)}}

.scanWrap{display:grid; grid-template-columns:1fr; gap:12px}
@media(min-width:980px){.scanWrap{grid-template-columns:1.3fr .9fr}}
.camBox{
  position:relative;
  background:var(--black);
  border-radius:var(--radius);
  overflow:hidden;
  border:1px solid rgba(255,255,255,.08);
  min-height:260px;
  box-shadow:var(--shadow);
}
.camVideo{width:100%; height:100%; object-fit:cover; display:block; min-height:260px}
.camOverlay{
  position:absolute; inset:0;
  display:flex; align-items:center; justify-content:center;
  background:rgba(0,0,0,.35);
  color:var(--white);
  text-align:center;
  padding:16px;
}
.overlayMsg{max-width:420px; font-weight:800}
.scanControls, .resultBox{background:var(--white); border:1px solid var(--line); border-radius:var(--radius); padding:14px; box-shadow:var(--shadow2)}
.fileBtn{
  display:inline-flex; align-items:center; justify-content:center;
  height:44px; padding:0 14px;
  border-radius:12px;
  border:1px dashed rgba(0,76,84,.35);
  background:rgba(0,76,84,.06);
  font-weight:900;
  cursor:pointer;
}
.fileBtn input{display:none}
.resultHead{display:flex; justify-content:space-between; align-items:center; gap:10px}
.resultTitle{font-weight:900}
.msg{margin-top:12px; padding:10px 12px; border-radius:12px; background:#F3F6F9; border:1px solid var(--line); color:#223; font-size:13px}
.hint{color:var(--muted); font-size:12px; margin-top:10px}
.sheetNote{margin:14px 0; color:var(--muted); font-size:12px}

.bottomNav{
  position:fixed; left:0; right:0; bottom:0;
  padding:10px 12px calc(10px + env(safe-area-inset-bottom));
  background:rgba(255,255,255,.92);
  border-top:1px solid var(--line);
  backdrop-filter:blur(10px);
  display:flex; gap:8px; justify-content:space-between;
  z-index:30;
}
.navBtn{
  flex:1;
  height:44px;
  border-radius:14px;
  border:1px solid var(--line);
  background:var(--white);
  font-weight:900;
}
.navBtn.active{
  background:rgba(0,76,84,.12);
  border-color:rgba(0,76,84,.25);
}

.toast{
  position:fixed; left:50%; transform:translateX(-50%);
  bottom:86px;
  padding:10px 12px;
  border-radius:999px;
  background:rgba(11,15,18,.92);
  color:var(--white);
  font-weight:800;
  font-size:13px;
  max-width:92vw;
  opacity:0;
  pointer-events:none;
  transition:opacity .15s ease, transform .15s ease;
  z-index:40;
}
.toast.show{opacity:1; transform:translateX(-50%) translateY(-4px)}
.botWrap{
  background:var(--white);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow2);
  padding:14px;
}
.chat{height:52vh; min-height:320px; overflow:auto; display:flex; flex-direction:column; gap:10px; padding:6px}
.bubble{
  max-width:92%;
  padding:10px 12px;
  border-radius:16px;
  border:1px solid var(--line);
  background:#F7FAFC;
}
.bubble.me{align-self:flex-end; background:rgba(0,76,84,.10); border-color:rgba(0,76,84,.20)}
.chatBar{display:flex; gap:10px; margin-top:10px}
.chatBar input{
  flex:1; height:44px; border-radius:14px; border:1px solid var(--line); padding:0 12px;
}
.statusGrid{display:grid; grid-template-columns:1fr; gap:10px; margin-top:10px}
@media(min-width:820px){.statusGrid{grid-template-columns:repeat(2,1fr)}}
.kv{
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px;
  background:#F7FAFC;
}
.k{font-weight:900}
.v{color:var(--muted); font-size:12px; margin-top:4px}
