/* TriageDesk — clean clinical UI, zero external assets (offline-safe) */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f1f5f9;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --danger: #dc2626;
}

html { font-size: 16px; }
body {
  font-family: system-ui, "Segoe UI", Roboto, "Noto Sans Bengali", "Noto Sans", sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.55;
}

header.app {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff; padding: 20px 18px 16px;
}
.brandrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.25rem; letter-spacing: .2px; }
.brand .cross {
  width: 30px; height: 30px; border-radius: 8px; background: #fff; color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.1rem;
}
#tagline { opacity: .92; font-size: .92rem; margin-top: 2px; }
.hbtns { display: flex; gap: 8px; }
.disclaimer-bar {
  background: #fff7ed; color: #7c2d12; border-bottom: 1px solid #fed7aa;
  font-size: .8rem; padding: 8px 18px;
}

main { max-width: 780px; margin: 22px auto 60px; padding: 0 16px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 26px; box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
}
.card h2 { font-size: 1.3rem; margin-bottom: 14px; }
.center { text-align: center; }
.lead { color: var(--muted); margin: 6px 0 18px; }

.hero { text-align: center; padding: 40px 26px; }
.hero-badge {
  display: inline-block; background: #ccfbf1; color: #0f766e; font-weight: 600;
  font-size: .78rem; padding: 4px 12px; border-radius: 999px; margin-bottom: 12px; letter-spacing: .4px;
}
.hero h2 { font-size: 2rem; }
.how { text-align: left; margin-top: 26px; border-top: 1px dashed var(--line); padding-top: 18px; }
.how h3 { font-size: .95rem; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px; }
.how ol { margin-left: 20px; color: var(--ink); }
.how li { margin: 6px 0; }

.field { margin: 18px 0; }
.flabel { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 8px; }
.optrow { display: flex; gap: 8px; flex-wrap: wrap; }
.optrow.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.opt { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: .9rem; }
.opt input { accent-color: var(--primary); }

.chip {
  border: 1px solid var(--line); background: #f8fafc; color: var(--ink);
  padding: 8px 14px; border-radius: 999px; font-size: .88rem; cursor: pointer;
  transition: all .12s ease; font-family: inherit;
}
.chip:hover { border-color: var(--primary); }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 500; }

textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 12px;
  font: inherit; resize: vertical; background: #f8fafc;
}
textarea:focus, .opt:focus { outline: 2px solid #99f6e4; }

details.more { margin: 6px 0 4px; }
details.more summary { cursor: pointer; color: var(--primary); font-weight: 600; font-size: .9rem; padding: 6px 0; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid transparent;
  border-radius: 10px; padding: 11px 22px; font: inherit; font-weight: 600; cursor: pointer;
  transition: transform .08s ease, background .12s ease; text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.sm { padding: 7px 14px; font-size: .85rem; }
.btn.lg { padding: 14px 34px; font-size: 1.05rem; margin-top: 6px; }

.actions { margin-top: 22px; display: flex; gap: 10px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; }
.hint { color: var(--muted); font-size: .8rem; }

.band { border: 2px solid; border-radius: 14px; overflow: hidden; margin: 14px 0; }
.band-head { color: #fff; padding: 12px 18px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.band-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .8px; opacity: .9; }
.band-value { font-weight: 700; font-size: 1.05rem; }
.band-body { padding: 16px 18px; }
.band-body p { margin: 6px 0; }

.call999 {
  display: block; text-align: center; background: var(--danger); color: #fff; font-weight: 700;
  padding: 12px; text-decoration: none; font-size: 1.05rem;
}
.call999:hover { background: #b91c1c; }

.reasons { list-style: none; }
.reasons li { display: flex; gap: 10px; margin: 10px 0; font-size: .93rem; align-items: flex-start; }
.reasons .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: 0 0 auto; }
.reasons li.none { color: var(--muted); }
.note { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; padding: 12px 14px; border-radius: 10px; font-size: .9rem; }

.pulse {
  width: 46px; height: 46px; border-radius: 50%; border: 4px solid #99f6e4;
  border-top-color: var(--primary); animation: spin 1s linear infinite; margin: 30px auto 18px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Summary sheet */
.print-zone { border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.pz-head { font-weight: 700; margin-bottom: 12px; }
table.pz { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.pz th { text-align: left; color: var(--muted); padding: 7px 10px; width: 18%; vertical-align: top; border-bottom: 1px solid var(--line); font-weight: 600; }
table.pz td { padding: 7px 10px; border-bottom: 1px solid var(--line); }
table.pz td.pre { white-space: pre-line; }
.pz-band { font-weight: 700; }
.pz-foot { margin-top: 12px; font-size: .75rem; color: var(--muted); }

footer.app { max-width: 780px; margin: 0 auto 30px; padding: 0 16px; color: var(--muted); font-size: .78rem; text-align: center; }

/* Settings modal */
.modal {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: none;
  align-items: center; justify-content: center; padding: 18px; z-index: 50;
}
.modal.open { display: flex; }
.modal .box { background: #fff; border-radius: 14px; max-width: 520px; width: 100%; padding: 22px; }
.modal h3 { margin-bottom: 6px; }
.modal p { font-size: .85rem; color: var(--muted); margin-bottom: 14px; }
.modal input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px; font: inherit; margin-bottom: 10px; }

#selftest { font-size: .72rem; color: var(--muted); }
#selftest.bad { color: var(--danger); font-weight: 700; }

/* Print: only the doctor summary */
@media print {
  body * { visibility: hidden; }
  .print-zone, .print-zone * { visibility: visible; }
  .print-zone { position: absolute; inset: 0; border: none; padding: 0; }
  .pz-foot { position: fixed; bottom: 0; }
}
