:root { --ink:#16202a; --muted:#64707d; --line:#dde3e8; --bg:#f4f7f6; --brand:#0f766e; --bad:#b42318; font: 15px/1.45 system-ui, "Segoe UI", "Noto Sans Bengali", sans-serif; color: var(--ink); }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); }
a { color: var(--brand); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 1.2rem; background: #fff; border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; font-size: 1.2rem; text-decoration: none; }
nav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
nav a { text-decoration: none; color: var(--ink); }
main { max-width: 1050px; margin: 1.2rem auto; padding: 0 1rem; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1.2rem 1.4rem; }
.narrow { max-width: 420px; margin: 3rem auto; }
h1 { font-size: 1.4rem; margin: 0 0 .8rem; } h2 { font-size: 1.05rem; margin: 1.2rem 0 .5rem; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.muted { color: var(--muted); } .small { font-size: .85rem; }
label { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; color: var(--muted); margin-bottom: .7rem; }
label.inline { flex-direction: row; align-items: center; gap: .5rem; color: var(--ink); }
label.inline input { width: auto; }
input, select, textarea { font: inherit; color: var(--ink); padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 1rem; }
.grid.six { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.btn { display: inline-block; background: var(--brand); color: #fff; border: 0; border-radius: 8px; padding: .55rem 1rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn.ghost { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn.big { padding: .75rem 1.6rem; margin-top: .5rem; }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; }
.sub { border: 1px dashed var(--line); border-radius: 10px; padding: 1rem; margin-bottom: 1rem; }
.list { display: flex; flex-direction: column; margin-top: .8rem; }
.item { padding: .7rem .4rem; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.item:hover { background: var(--bg); }
details { margin: .5rem 0 1rem; } summary { cursor: pointer; color: var(--brand); margin-bottom: .7rem; }
.medsearch { position: relative; margin-bottom: .7rem; }
.dropdown { position: absolute; z-index: 5; left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px #0002; max-height: 320px; overflow: auto; }
.dropdown button { display: block; width: 100%; text-align: left; padding: .55rem .8rem; border: 0; background: none; font: inherit; cursor: pointer; }
.dropdown button:hover, .dropdown button:focus { background: var(--bg); }
.med { display: grid; grid-template-columns: 1.6fr .7fr 1fr .5fr .9fr 1.3fr auto; gap: .5rem; align-items: center; padding: .6rem; border: 1px solid var(--line); border-radius: 10px; margin-bottom: .5rem; }
.med .x { border: 0; background: none; color: var(--bad); font-size: 1.1rem; cursor: pointer; }
@media (max-width: 760px) { .med { grid-template-columns: 1fr 1fr; } .med > div { grid-column: 1 / -1; } }
.toolbar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar select { width: auto; }
.toast { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: .6rem 1.1rem; border-radius: 8px; }

/* the prescription sheet */
.sheet { background: #fff; width: 210mm; min-height: 297mm; margin: 0 auto; padding: 12mm; border: 1px solid var(--line); display: flex; flex-direction: column; font-size: 13px; }
.sheet.a5 { width: 148mm; min-height: 210mm; padding: 8mm; font-size: 11px; }
.lh { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 2px solid var(--brand); padding-bottom: .6rem; }
.lh h2 { margin: 0; color: var(--brand); font-size: 1.5em; } .lh p { margin: .2rem 0 0; } .lh .right { text-align: right; }
.pt { display: flex; flex-wrap: wrap; gap: .3rem 1.4rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.pt span, .vit span { color: var(--muted); font-size: .85em; text-transform: uppercase; }
.body { display: grid; grid-template-columns: 34% 1fr; flex: 1; }
.body aside { border-right: 1px solid var(--line); padding: .6rem .8rem .6rem 0; }
.body h4 { margin: .7rem 0 .2rem; font-size: .8em; letter-spacing: .05em; text-transform: uppercase; color: var(--brand); }
.body ul { margin: 0; padding-left: 1.1rem; }
.vit div { margin: .1rem 0; }
.allergy { margin-top: .6rem; border: 1px solid var(--bad); color: var(--bad); padding: .3rem .5rem; border-radius: 4px; }
.rxcol { padding: .6rem 0 .6rem 1rem; }
.rxsym { font-size: 2.2em; font-weight: 700; color: var(--brand); line-height: 1; }
.meds { padding-left: 1.3rem; } .meds li { margin-bottom: .7rem; }
.meds .gen { color: var(--muted); font-size: .9em; } .meds .line { margin-top: .1rem; }
.fu { margin-top: 1rem; }
.foot { display: flex; justify-content: space-between; align-items: flex-end; border-top: 1px solid var(--line); padding-top: .6rem; }
.qr { display: flex; gap: .6rem; align-items: center; } .qr small { color: var(--muted); }
.sign { text-align: center; border-top: 1px solid var(--ink); padding-top: .2rem; min-width: 45mm; }
.made { text-align: center; color: var(--muted); font-size: .75em; margin: .4rem 0 0; }
.verify { max-width: 520px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1.4rem; }
.good { color: var(--brand); } .bad { color: var(--bad); }
@media print {
  body { background: #fff; } main { margin: 0; padding: 0; max-width: none; }
  .noprint, .top { display: none !important; }
  .sheet, .sheet.a5 { border: 0; width: auto; min-height: auto; padding: 0; height: calc(100vh - 1mm); }
}
