*{box-sizing:border-box}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;background:#f5f6f8;color:#1f2937}
.topbar{padding:16px;background:#fff;border-bottom:1px solid #e5e7eb;position:sticky;top:0;z-index:10}.topbar h1{margin:0;font-size:22px}.topbar p{margin:4px 0 0;color:#6b7280;font-size:13px}
.content{padding:12px 12px 86px;max-width:1180px;margin:0 auto}.tab-page{display:none}.tab-page.active{display:block}.card{background:#fff;border-radius:16px;padding:14px;margin-bottom:12px;box-shadow:0 2px 8px rgba(0,0,0,.05)}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px}.upload-box,.upload-inline{display:flex;align-items:center;justify-content:center;text-align:center;padding:12px;background:#fafafa;cursor:pointer;position:relative;border:2px dashed #cbd5e1;border-radius:14px}.upload-box{min-height:96px}.upload-box input,.upload-inline input{position:absolute;inset:0;opacity:0}
.toolbar{display:flex;gap:10px;margin:10px 0}.wrap{flex-wrap:wrap}button{border:0;background:#2563eb;color:#fff;padding:10px 14px;border-radius:12px;cursor:pointer}button.ghost{background:#e5e7eb;color:#111827}button.danger{background:#dc2626}button.small{padding:6px 10px;font-size:12px}
textarea,input,select{width:100%;padding:10px 12px;border:1px solid #d1d5db;border-radius:10px;background:#fff}.preview-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:12px}.preview-item{border:1px solid #e5e7eb;border-radius:12px;padding:8px;background:#fafafa}.preview-item img{width:100%;height:120px;object-fit:cover;border-radius:8px;background:#e5e7eb}
.table-wrap{overflow:auto;border:1px solid #e5e7eb;border-radius:12px}table{width:100%;border-collapse:collapse}th,td{padding:10px 8px;border-bottom:1px solid #e5e7eb;font-size:13px;text-align:left}thead th{background:#eef2ff;position:sticky;top:0;white-space:nowrap}tbody tr:nth-child(even){background:#f8fafc}
.cell-input,.cell-select{min-width:130px;padding:8px 10px;border:1px solid #cbd5e1;border-radius:8px}.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,'Liberation Mono',monospace}
.bottom-nav{position:fixed;bottom:0;left:0;right:0;background:#fff;border-top:1px solid #e5e7eb;display:grid;grid-template-columns:repeat(3,1fr);padding:8px;gap:8px}.nav-btn{background:#f3f4f6;color:#111827}.nav-btn.active{background:#2563eb;color:#fff}
.grid-form{display:grid;grid-template-columns:repeat(5,1fr);gap:8px;margin-bottom:12px}.grid-form.pair{grid-template-columns:repeat(6,1fr)}.hidden{display:none!important}.meta-line{font-size:13px;color:#374151;margin-bottom:8px}.warning-box{padding:10px 12px;border-radius:10px;background:#fef3c7;color:#92400e;margin-bottom:10px}.hint{font-size:12px;color:#6b7280}
@media (max-width:820px){.grid2,.grid-form,.grid-form.pair{grid-template-columns:1fr}}


/* Version 1.2 iPhone-style UI */
:root{
  --ios-bg:#eef2f7;
  --ios-card:#ffffff;
  --ios-text:#0f172a;
  --ios-muted:#64748b;
}
body{
  background: linear-gradient(180deg, #dbeafe 0%, #eef2f7 35%, #f8fafc 100%);
}
main{
  max-width: 480px;
  margin: 0 auto 110px auto;
}
header{
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(14px);
  background: rgba(255,255,255,.72);
  border-bottom: 1px solid rgba(148,163,184,.25);
}
header h1{
  font-size: 1.18rem;
  margin-bottom: 2px;
}
.subtitle{
  color: var(--ios-muted);
  font-weight: 600;
  letter-spacing: .02em;
}
.phone-shell{
  padding: 8px 0 4px 0;
}
.ios-home-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:16px;
}
.app-card{
  border: none;
  background: rgba(255,255,255,.92);
  border-radius: 24px;
  min-height: 148px;
  padding: 20px 12px;
  box-shadow: 0 12px 30px rgba(15,23,42,.08);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:12px;
  transition: transform .12s ease, box-shadow .12s ease;
}
.app-card:active{
  transform: scale(.98);
}
.app-icon{
  width:64px;
  height:64px;
  border-radius:20px;
  background: linear-gradient(180deg, #eff6ff, #dbeafe);
  display:grid;
  place-items:center;
  font-size: 1.9rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.app-label{
  font-weight: 700;
  color: var(--ios-text);
  text-align: center;
}
.app-screen-card{
  border-radius: 26px;
  box-shadow: 0 12px 28px rgba(15,23,42,.08);
}
.screen-topbar{
  display:flex;
  justify-content:flex-start;
  margin-bottom: 8px;
}
.about-box,.setting-box{
  display:grid;
  gap:12px;
}
.full{
  width:100%;
}
.bottom-nav{
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(14px);
  border-top:1px solid rgba(148,163,184,.25);
}
.bottom-nav .nav-btn{
  font-size:.88rem;
}


/* Scan file compact list */
.compact-file-box{
  margin-top:14px;
  padding:14px;
  border:1px solid #dbe3ef;
  border-radius:18px;
  background:#f8fbff;
}
.compact-file-head{
  font-weight:700;
  color:#1e293b;
  margin-bottom:10px;
}
.selected-file-list{
  display:flex;
  flex-direction:column;
  gap:8px;
  max-height:260px;
  overflow:auto;
}
.selected-file-list.empty{
  color:#64748b;
}
.file-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  background:#fff;
  border:1px solid #e2e8f0;
  border-radius:14px;
}
.file-row-left{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.file-kind{
  width:34px;
  height:34px;
  border-radius:10px;
  display:grid;
  place-items:center;
  background:#dbeafe;
  font-size:.95rem;
  flex:0 0 auto;
}
.file-name{
  font-weight:600;
  color:#0f172a;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.file-meta{
  color:#64748b;
  font-size:.86rem;
}
.file-remove{
  border:none;
  background:#fee2e2;
  color:#b91c1c;
  border-radius:10px;
  padding:8px 10px;
  font-weight:700;
}


/* OCR ASN 2.0 polish */
header h1{
  letter-spacing:.01em;
}
.screen-topbar{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  margin-bottom:10px;
}
.back-home-btn{
  border-radius:999px;
  padding:8px 14px;
  font-weight:700;
}
.card h2{
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:0;
}
button, .nav-btn{
  transition:transform .12s ease, opacity .12s ease, box-shadow .12s ease;
}
button:active, .nav-btn:active{
  transform:scale(.98);
}
.table-wrap{
  border-radius:18px;
  overflow:auto;
}
table thead th{
  position:sticky;
  top:0;
  z-index:1;
}
.compact-file-head::before{
  content:"📁 ";
}
.about-box div, .setting-box button{
  font-size: .97rem;
}
.bottom-nav .nav-btn{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
  min-height:60px;
}


/* OCR ASN 3.0 Pro dark theme */
:root{
  --bg-main:#05070b;
  --bg-panel:#0b1220;
  --bg-panel-2:#111827;
  --border:#243041;
  --text-main:#f8fafc;
  --text-soft:#94a3b8;
  --accent:#2563eb;
  --accent-soft:#1d4ed8;
  --danger:#dc2626;
}
html, body{
  background: linear-gradient(180deg,#020617 0%,#05070b 100%) !important;
  color: var(--text-main) !important;
}
body{
  min-height:100vh;
}
header.topbar{
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6,10,18,.92) !important;
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  text-align:center;
}
header.topbar h1{
  color:#ffffff !important;
  margin:0 auto 4px auto !important;
  width:100%;
  text-align:center;
  font-size:1.28rem;
  letter-spacing:.02em;
}
header.topbar .subtitle{
  color: var(--text-soft) !important;
  text-align:center;
  font-weight:600;
}
main.content{
  max-width: 560px;
  margin: 0 auto 32px auto !important;
}
.card, .app-screen-card{
  background: var(--bg-panel) !important;
  color: var(--text-main) !important;
  border:1px solid var(--border) !important;
  box-shadow: 0 14px 34px rgba(0,0,0,.35) !important;
}
h2,h3,th,td,label,span,p,div,strong{
  color: inherit;
}
input, textarea, select{
  background: var(--bg-panel-2) !important;
  color: var(--text-main) !important;
  border:1px solid var(--border) !important;
}
input::placeholder, textarea::placeholder{
  color: var(--text-soft) !important;
}
button, .nav-btn, .app-card{
  border-radius:18px;
}
button{
  background:#1f2937;
  color:#fff;
  border:1px solid var(--border);
}
button.ghost, .ghost{
  background:#111827 !important;
  color:#fff !important;
  border:1px solid var(--border) !important;
}
button.small, .small{
  border-radius:999px !important;
}
button:active, .app-card:active{
  transform:scale(.98);
}
.screen-topbar{
  display:flex;
  justify-content:flex-start;
  margin-bottom:10px;
}
.back-home-btn{
  background:#111827 !important;
  color:#fff !important;
  border:1px solid var(--border) !important;
  border-radius:999px !important;
  padding:8px 14px !important;
  font-weight:700 !important;
}
.phone-shell{
  padding-top: 8px;
}
.ios-home-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
}
.app-card{
  border:none !important;
  background: linear-gradient(180deg,#0f172a 0%, #111827 100%) !important;
  color:#fff !important;
  min-height:148px;
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
}
.app-icon{
  background: linear-gradient(180deg,#1d4ed8,#2563eb) !important;
  color:#fff;
  box-shadow:none !important;
}
.app-label{
  color:#fff !important;
}
.upload-box{
  background:#0f172a !important;
  border:2px dashed #334155 !important;
  color:#fff !important;
}
.upload-box span{
  color:#fff !important;
}
.hint, .meta-line, .file-meta, .subtitle, .warning-box{
  color: var(--text-soft) !important;
}
.compact-file-box{
  background:#0f172a !important;
  border:1px solid var(--border) !important;
}
.file-row{
  background:#111827 !important;
  border:1px solid var(--border) !important;
}
.file-kind{
  background:#1d4ed8 !important;
  color:#fff !important;
}
.table-wrap{
  border-radius:18px;
  border:1px solid var(--border);
}
table{
  background:#0b1220 !important;
  color:#fff !important;
}
table thead th{
  background:#1e293b !important;
  color:#fff !important;
}
table tbody td{
  background:#0b1220 !important;
  color:#fff !important;
  border-color:#243041 !important;
}
.warning-box{
  background:#3f2b05 !important;
  color:#fde68a !important;
  border:1px solid #854d0e !important;
}
#homeTab.tab-page.active{
  display:block;
}
.tab-page:not(.active){
  display:none !important;
}


/* ===== OCR ASN 4.0 PRO dark multi-screen ===== */
:root{
  --bg:#02040a;
  --panel:#0b1220;
  --panel-2:#101826;
  --line:#253246;
  --text:#f8fafc;
  --muted:#94a3b8;
  --blue:#2563eb;
}
html,body{
  background:linear-gradient(180deg,#02040a 0%,#060b14 100%) !important;
  color:var(--text) !important;
}
body{ min-height:100vh; }
header.topbar{
  position:sticky;
  top:0;
  z-index:50;
  background:rgba(3,7,14,.9) !important;
  border-bottom:1px solid var(--line) !important;
  text-align:center;
  backdrop-filter:blur(12px);
}
header.topbar h1{
  color:#fff !important;
  font-size:1.25rem;
  margin:0 auto 4px auto !important;
  text-align:center;
}
header.topbar .subtitle{
  color:var(--muted) !important;
  margin:0 !important;
  font-weight:600;
}
main.content{
  max-width:560px;
  margin:0 auto 26px auto !important;
}
.screen-page{ display:none !important; }
.screen-page.active{ display:block !important; }
.card, .app-screen-card{
  background:var(--panel) !important;
  border:1px solid var(--line) !important;
  color:var(--text) !important;
  box-shadow:0 16px 30px rgba(0,0,0,.30) !important;
}
h2,h3,th,td,label,div,span,p,strong{ color:inherit; }
input, textarea, select{
  background:var(--panel-2) !important;
  color:var(--text) !important;
  border:1px solid var(--line) !important;
}
input::placeholder, textarea::placeholder{ color:var(--muted) !important; }
button{
  background:#182233;
  color:#fff;
  border:1px solid var(--line);
}
button.ghost, .ghost{
  background:#101826 !important;
  color:#fff !important;
  border:1px solid var(--line) !important;
}
button.small, .small{
  border-radius:999px !important;
}
.screen-topbar{
  display:flex;
  justify-content:flex-start;
  align-items:center;
  margin-bottom:10px;
}
.back-home-btn{
  border-radius:999px !important;
  padding:8px 14px !important;
  font-weight:700 !important;
}
.phone-shell{ padding-top:8px; }
.ios-home-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:18px;
}
.big-card{
  min-height:170px !important;
  padding:24px 14px !important;
  border:none !important;
  background:linear-gradient(180deg,#0f172a 0%,#111827 100%) !important;
  box-shadow:0 16px 34px rgba(0,0,0,.35) !important;
}
.app-card{
  border-radius:28px !important;
  color:#fff !important;
}
.app-icon{
  width:76px !important;
  height:76px !important;
  border-radius:24px !important;
  font-size:2.1rem !important;
  background:linear-gradient(180deg,#2563eb,#1d4ed8) !important;
  color:#fff !important;
}
.app-label{
  color:#fff !important;
  font-size:1.05rem !important;
  font-weight:800 !important;
}
.upload-box{
  background:#0f172a !important;
  border:2px dashed #334155 !important;
}
.compact-file-box{
  background:#0f172a !important;
  border:1px solid var(--line) !important;
}
.compact-file-head, .hint, .meta-line, .file-meta{ color:var(--muted) !important; }
.file-row{
  background:#101826 !important;
  border:1px solid var(--line) !important;
}
.file-kind{
  background:#1d4ed8 !important;
  color:#fff !important;
}
.table-wrap{
  border:1px solid var(--line);
  border-radius:18px;
  overflow:auto;
}
table{
  background:#0b1220 !important;
  color:#fff !important;
}
table thead th{
  background:#1e293b !important;
  color:#fff !important;
}
table tbody td{
  background:#0b1220 !important;
  color:#fff !important;
  border-color:#253246 !important;
}
.warning-box{
  background:#3f2b05 !important;
  color:#fde68a !important;
  border:1px solid #854d0e !important;
}
.about-copy-box{
  display:grid;
  gap:10px;
  margin-top:14px;
}
.about-copy-box > div{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
}


/* OCR ASN 4.1 stable bottom nav */
main.content{
  padding-bottom: 96px !important;
}
.bottom-nav{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
  display: flex;
  justify-content: space-around;
  gap: 10px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(2,4,10,.96);
  border-top: 1px solid #253246;
  backdrop-filter: blur(12px);
}
.bottom-nav-btn{
  flex: 1;
  min-height: 54px;
  border-radius: 16px;
  background: #101826 !important;
  color: #ffffff !important;
  border: 1px solid #253246 !important;
  font-weight: 800;
  font-size: 15px;
}
.bottom-nav-btn.active{
  background: linear-gradient(180deg,#2563eb,#1d4ed8) !important;
  border-color: #2563eb !important;
}


/* OCR ASN 4.2 bottom menu only */
.top-utility-bar{
  position: sticky;
  top: 78px;
  z-index: 45;
  display:flex;
  gap:10px;
  justify-content:center;
  padding:10px 14px 4px 14px;
  background: rgba(2,4,10,.88);
  backdrop-filter: blur(10px);
}
main.content{
  padding-top: 6px !important;
  padding-bottom: 92px !important;
}
.phone-shell, .ios-home-grid, .big-card{
  display:none !important;
}
.screen-page{
  display:none !important;
}
.screen-page.active{
  display:block !important;
}
.card h2{
  margin-top:0 !important;
}
.bottom-nav{
  position: fixed;
  left:0; right:0; bottom:0;
  z-index:999;
  display:flex;
  gap:10px;
  padding:10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(2,4,10,.96);
  border-top:1px solid #253246;
  backdrop-filter: blur(12px);
}
.bottom-nav-btn{
  flex:1;
  min-height:56px;
  border-radius:16px;
  background:#101826 !important;
  color:#fff !important;
  border:1px solid #253246 !important;
  font-weight:800;
  font-size:15px;
}
.bottom-nav-btn.active{
  background: linear-gradient(180deg,#2563eb,#1d4ed8) !important;
  border-color:#2563eb !important;
}
