:root { --teal: #7c2d12; --teal-d: #7c2d12; --teal-l: #ffedd5; --bg: #fff7ed;
  --teal: #9a3412; --teal-d: #7c2d12; --teal-l: #ffedd5;
  --red: #b91c1c; --amber: #b45309; --green: #15803d; --slate: #334155;
  --bg: #f0fdfa; --card: #ffffff; --border: #d1d5db;
  --radius: 14px;
  font-size: 16px;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: "Noto Sans Bengali", "Segoe UI", system-ui, sans-serif;
  background: var(--bg); color: var(--slate); line-height: 1.55;
}
main { max-width: 980px; margin: 0 auto; padding: 1rem; }
h1, h2 { color: var(--teal-d); margin: 0.6rem 0 0.4rem; }
a { color: var(--teal-d); }

.topbar { background: var(--teal); color: #fff; padding: 0.7rem 1rem; }
.brand { display: flex; align-items: center; gap: 0.7rem; max-width: 980px; margin: 0 auto; }
.brand .logo { font-size: 1.8rem; background: #fff; color: var(--teal); border-radius: 10px; padding: 0 0.45rem; }
.brand .name { font-weight: 800; font-size: 1.15rem; }
.brand .tag { font-size: 0.78rem; opacity: 0.92; }
.langbtn { margin-left: auto; background: #fff; color: var(--teal-d); border: 0; border-radius: 8px; padding: 0.35rem 0.8rem; font-weight: 700; cursor: pointer; }
.nav { display: flex; flex-wrap: wrap; gap: 0.25rem; max-width: 980px; margin: 0.55rem auto 0; }
.nav a { color: #fff; text-decoration: none; padding: 0.3rem 0.7rem; border-radius: 8px; font-size: 0.92rem; opacity: 0.9; }
.nav a.active, .nav a:hover { background: rgba(255,255,255,0.22); opacity: 1; }
.netbanner { text-align: center; font-size: 0.8rem; padding-top: 0.45rem; opacity: 0.95; }
.netbanner.off { color: #fde68a; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; margin: 0.8rem 0; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.8rem; }
@media (max-width: 700px) { .grid2, .grid3, .grid4 { grid-template-columns: 1fr; } }

button, .btn { background: var(--teal); color: #fff; border: 0; border-radius: 10px; padding: 0.6rem 1.1rem; font-size: 1rem; font-weight: 700; cursor: pointer; font-family: inherit; }
button.secondary { background: #e2e8f0; color: var(--slate); }
button.danger { background: var(--red); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

label { display: block; font-weight: 700; margin: 0.55rem 0 0.2rem; }
input[type=text], input[type=number], input[type=date], input[type=tel], select, textarea {
  width: 100%; padding: 0.55rem 0.7rem; border: 1px solid var(--border); border-radius: 10px;
  font-size: 1rem; font-family: inherit; background: #fff;
}
.symgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem; margin: 0.6rem 0; }
@media (max-width: 700px) { .symgrid { grid-template-columns: 1fr; } }
.sym { display: flex; gap: 0.5rem; align-items: center; background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: 0.5rem 0.7rem; cursor: pointer; }
.sym input { width: 1.15rem; height: 1.15rem; accent-color: var(--teal); }

.result { border-radius: var(--radius); padding: 1rem 1.1rem; margin: 0.8rem 0; color: #fff; font-weight: 700; font-size: 1.12rem; }
.result.EMERGENCY { background: var(--red); }
.result.REFER { background: var(--amber); }
.result.POSSIBLE { background: var(--green); }
.result.EARLY { background: #0369a1; }
.result.GENERAL { background: #64748b; }
.chips { margin: 0.5rem 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chip { display: inline-block; background: var(--teal-l); color: var(--teal-d); border-radius: 999px; padding: 0.18rem 0.75rem; font-size: 0.88rem; font-weight: 700; }

.kpi { text-align: center; }
.kpi .num { font-size: 1.9rem; font-weight: 800; color: var(--teal-d); }
.kpi .lbl { font-size: 0.85rem; color: #64748b; }

table.list { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.list th, table.list td { text-align: left; padding: 0.45rem 0.5rem; border-bottom: 1px solid #e2e8f0; }
table.list th { color: var(--teal-d); }

.chart { width: 100%; overflow-x: auto; }
.chart svg { min-width: 560px; width: 100%; height: 240px; }
.bar-a { fill: #0d9488; } .bar-b { fill: #f59e0b; } .bar-c { fill: #60a5fa; }
.axis { font-size: 10px; fill: #64748b; }

#map { height: 360px; border-radius: var(--radius); border: 1px solid var(--border); }
.legend { display: flex; gap: 0.6rem; margin-top: 0.4rem; font-size: 0.8rem; align-items: center; flex-wrap: wrap; }
.swatch { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }

.note { background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 0.6rem 0.8rem; font-size: 0.88rem; margin: 0.5rem 0; }
.small { font-size: 0.82rem; color: #64748b; }
.foot { max-width: 980px; margin: 1.2rem auto; padding: 0.8rem 1rem; font-size: 0.78rem; color: #64748b; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.hero { background: linear-gradient(135deg, var(--teal), var(--teal-d)); color: #fff; border-radius: var(--radius); padding: 1.4rem 1.2rem; margin: 0.8rem 0; }
.hero h1 { color: #fff; }
.rolebtns { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 0.8rem; }
.rolebtns a { background: #fff; color: var(--teal-d); font-weight: 800; text-decoration: none; padding: 0.7rem 1.2rem; border-radius: 10px; }
.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.6rem; margin: 0.8rem 0; }
.actions a { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.9rem; text-align: center; font-weight: 700; text-decoration: none; color: var(--teal-d); }
.actions a:hover { border-color: var(--teal); }
#preview { max-width: 240px; border-radius: 10px; display: none; }
#ocrOut { white-space: pre-wrap; background: #f8fafc; border: 1px dashed var(--border); border-radius: 10px; padding: 0.7rem; min-height: 3rem; }
.pill { display: inline-block; background: var(--teal-l); color: var(--teal-d); font-size: 0.72rem; font-weight: 800; border-radius: 999px; padding: 0.1rem 0.55rem; margin-left: 0.4rem; vertical-align: middle; }
