/* Medi Grow Chamber — same tokens as the Medi Grow website (docs/DESIGN.md there). Phone first. */
@font-face { font-family: "Li Ador Noirrit"; src: url(/fonts/li-ador-noirrit-regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Li Ador Noirrit"; src: url(/fonts/li-ador-noirrit-semibold.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Li Ador Noirrit"; src: url(/fonts/li-ador-noirrit-bold.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --blue-600: #0B4FA8; --blue-700: #093F87; --blue-900: #072F66; --blue-100: #DCE8F8; --blue-50: #EEF4FC;
  --green-500: #16A870; --green-700: #0E7A50; --mint-400: #5EE3A6; --mint-100: #DDF8EA;
  --ink-900: #0A1F44; --ink-700: #33415C; --ink-500: #5B6B85; --ink-300: #A9B4C6; --line: #E3EAF3; --white: #fff;
  --amber-100: #FFF3D6; --amber-700: #8A5A00; --error: #B42318; --error-50: #FDECEA;
  --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-xl: 28px; --r-pill: 999px;
  --sh-1: 0 1px 2px rgba(10,31,68,.06), 0 1px 1px rgba(10,31,68,.04);
  --sh-2: 0 6px 20px -6px rgba(10,31,68,.12), 0 2px 6px rgba(10,31,68,.05);
  --sh-3: 0 24px 48px -16px rgba(11,79,168,.28);
  --ease: cubic-bezier(.16,1,.3,1);
  --font: "Li Ador Noirrit", "Noto Sans Bengali", "Nirmala UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.65; color: var(--ink-700); background: #F5F8FC; font-synthesis: none; }
h1, h2, h3, h4 { color: var(--ink-900); line-height: 1.32; margin: 0 0 .4em; text-wrap: balance; }
h1 { font-size: clamp(26px, 6vw, 40px); } h2 { font-size: clamp(21px, 4.6vw, 28px); } h3 { font-size: 19px; }
p { margin: 0 0 .8em; text-wrap: pretty; }
a { color: var(--blue-600); }
img { max-width: 100%; display: block; }
.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon .accent { stroke: var(--green-500); }
.wrap { width: min(100% - 32px, 1120px); margin-inline: auto; }
.narrow { width: min(100% - 32px, 560px); margin-inline: auto; }
.muted { color: var(--ink-500); } .small { font-size: 15px; } .tiny { font-size: 13px; }
.center { text-align: center; } .row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; } .grow { flex: 1; }
.stack > * + * { margin-top: 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- top bar ---------- */
.top { background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top .wrap { display: flex; align-items: center; gap: 12px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink-900); font-weight: 700; line-height: 1.25; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; background: var(--blue-600); color: #fff; display: grid; place-items: center; font-weight: 700; }
.brand small { display: block; font-weight: 400; color: var(--ink-500); font-size: 13px; }
.top nav { margin-left: auto; display: flex; gap: 4px; }
.top nav a { text-decoration: none; color: var(--ink-700); padding: 8px 12px; border-radius: var(--r-pill); font-size: 15px; display: inline-flex; align-items: center; gap: 6px; }
.top nav a:hover, .top nav a.on { background: var(--blue-50); color: var(--blue-600); }

/* ---------- buttons ---------- */
.btn { --bg: var(--blue-600); --fg: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 22px;
  border-radius: var(--r-pill); border: 0; background: var(--bg); color: var(--fg); font: 700 17px/1 var(--font); text-decoration: none; cursor: pointer;
  box-shadow: var(--sh-1); transition: transform .15s var(--ease), background .15s; -webkit-tap-highlight-color: transparent; }
.btn:hover { background: var(--blue-700); } .btn:active { transform: scale(.98); }
.btn.block { width: 100%; } .btn.sm { min-height: 40px; padding: 0 16px; font-size: 15px; } .btn.lg { min-height: 58px; font-size: 19px; }
.btn.green { --bg: var(--green-700); } .btn.green:hover { background: #0b6542; }
.btn.ghost { --bg: transparent; --fg: var(--blue-600); box-shadow: inset 0 0 0 1.5px var(--blue-600); } .btn.ghost:hover { background: var(--blue-50); }
.btn.soft { --bg: var(--blue-50); --fg: var(--blue-700); box-shadow: none; } .btn.soft:hover { background: var(--blue-100); }
.btn.danger { --bg: #fff; --fg: var(--error); box-shadow: inset 0 0 0 1.5px #F2C4C0; } .btn.danger:hover { background: var(--error-50); }
.btn.mint { --bg: var(--mint-400); --fg: var(--ink-900); } .btn.mint:hover { background: #48d796; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- cards, chips ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--sh-2); }
.card.flat { box-shadow: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: var(--r-pill); font-size: 14px; background: var(--blue-50); color: var(--blue-700); font-weight: 600; line-height: 1.4; }
.chip.green { background: var(--mint-100); color: var(--green-700); } .chip.amber { background: var(--amber-100); color: var(--amber-700); }
.chip.red { background: var(--error-50); color: var(--error); } .chip.grey { background: #EEF1F5; color: var(--ink-500); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green-500); display: inline-block; }
.dot.live { box-shadow: 0 0 0 0 rgba(22,168,112,.5); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(22,168,112,0); } 100% { box-shadow: 0 0 0 0 rgba(22,168,112,0); } }
.notice { display: flex; gap: 10px; align-items: flex-start; background: var(--amber-100); color: var(--amber-700); border-radius: var(--r-md); padding: 12px 16px; font-weight: 600; }
.alert { background: var(--error-50); color: var(--error); border-radius: var(--r-md); padding: 12px 16px; font-weight: 600; }
.ok { background: var(--mint-100); color: var(--green-700); border-radius: var(--r-md); padding: 12px 16px; font-weight: 600; }

/* ---------- forms ---------- */
label { display: block; font-weight: 700; color: var(--ink-900); margin-bottom: 6px; font-size: 16px; }
.field { margin-bottom: 16px; }
.hint { font-size: 14px; color: var(--ink-500); margin-top: 4px; }
input, select, textarea { width: 100%; min-height: 52px; padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--blue-50);
  font: 400 17px/1.4 var(--font); color: var(--ink-900); outline: none; transition: box-shadow .15s, background .15s; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { background: #fff; box-shadow: 0 0 0 3px var(--blue-100); border-color: var(--blue-600); }
:focus-visible { outline: 3px solid var(--blue-600); outline-offset: 2px; }
.seg { display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); gap: 8px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { margin: 0; min-height: 52px; display: grid; place-items: center; text-align: center; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: #fff;
  font-weight: 600; font-size: 15px; cursor: pointer; padding: 6px 4px; line-height: 1.3; transition: all .15s; }
.seg input:checked + label { border-color: var(--blue-600); background: var(--blue-50); color: var(--blue-700); box-shadow: 0 0 0 1px var(--blue-600); }
.seg input:focus-visible + label { outline: 3px solid var(--blue-600); outline-offset: 2px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- public: doctor hero ---------- */
.hero { background: linear-gradient(165deg, #fff 0%, #F4F8FD 40%, #DCE8F8 100%); border-bottom: 1px solid var(--line); padding: 28px 0 32px; }
.doc-head { display: grid; grid-template-columns: 96px 1fr; gap: 18px; align-items: center; }
.avatar { width: 96px; height: 96px; border-radius: 26px; background: var(--blue-600) center/cover; color: #fff; display: grid; place-items: center; font-size: 34px; font-weight: 700; box-shadow: var(--sh-3); }
.avatar.sm { width: 56px; height: 56px; border-radius: 16px; font-size: 22px; box-shadow: none; }
.doc-head h1 { margin: 0; font-size: clamp(24px, 5.4vw, 34px); }
.degrees { color: var(--ink-500); font-size: 15px; margin: 2px 0 6px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.cta-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.section { padding: 28px 0; }
.section h2 { display: flex; align-items: center; gap: 10px; }
.days { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x mandatory; }
.day { flex: none; width: 112px; scroll-snap-align: start; text-decoration: none; border: 1.5px solid var(--line); background: #fff; border-radius: var(--r-md); padding: 12px; color: var(--ink-900); text-align: center; transition: all .15s; }
.day b { display: block; font-size: 15px; } .day span { display: block; font-size: 22px; font-weight: 700; color: var(--blue-600); line-height: 1.3; } .day i { font-style: normal; font-size: 13px; color: var(--ink-500); }
.day.on { border-color: var(--blue-600); box-shadow: 0 0 0 1px var(--blue-600); background: var(--blue-50); }
.day.off { opacity: .55; }
.slot { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.slot + .slot { margin-top: 12px; }
.slot h3 { margin: 0; } .slot .meta { font-size: 15px; color: var(--ink-500); }
.meter { height: 6px; background: var(--blue-50); border-radius: 9px; overflow: hidden; margin-top: 8px; } .meter i { display: block; height: 100%; background: var(--green-500); border-radius: 9px; }
.sched { width: 100%; border-collapse: collapse; font-size: 15px; } .sched td { padding: 10px 4px; border-bottom: 1px solid var(--line); vertical-align: top; } .sched td:first-child { font-weight: 700; color: var(--ink-900); white-space: nowrap; }
.doctor-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.doc-card { display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: center; text-decoration: none; color: inherit; }

/* ---------- ticket ---------- */
.ticket { background: #fff; border-radius: var(--r-xl); box-shadow: var(--sh-3); overflow: hidden; position: relative; }
.ticket-top { background: linear-gradient(150deg, var(--blue-600), var(--blue-900)); color: #fff; padding: 22px 22px 26px; position: relative; }
.ticket-top h1, .ticket-top h2 { color: #fff; }
.serial-big { font-size: 84px; font-weight: 700; line-height: 1; letter-spacing: -1px; color: var(--mint-400); }
.ticket-top .lbl { font-size: 14px; opacity: .8; }
.ticket-cut { height: 22px; background: radial-gradient(circle at 0 50%, #F5F8FC 11px, transparent 12px) left / 50% 100% no-repeat, radial-gradient(circle at 100% 50%, #F5F8FC 11px, transparent 12px) right / 50% 100% no-repeat;
  margin-top: -11px; position: relative; border-top: 2px dashed var(--line); background-color: #fff; }
.ticket-body { padding: 10px 22px 22px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--blue-50); border-radius: var(--r-md); padding: 12px 8px; text-align: center; }
.stat b { display: block; font-size: 26px; color: var(--ink-900); line-height: 1.2; } .stat span { font-size: 13px; color: var(--ink-500); }
.stat.hl { background: var(--mint-100); } .stat.hl b { color: var(--green-700); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 15px; } .kv dt { color: var(--ink-500); } .kv dd { margin: 0; color: var(--ink-900); font-weight: 600; text-align: right; }
.progress { display: flex; gap: 4px; flex-wrap: wrap; } .progress i { width: 22px; height: 22px; border-radius: 6px; background: var(--blue-50); font-style: normal; font-size: 11px; display: grid; place-items: center; color: var(--ink-500); }
.progress i.d { background: var(--mint-100); color: var(--green-700); } .progress i.n { background: var(--green-500); color: #fff; } .progress i.me { background: var(--blue-600); color: #fff; }

/* ---------- TV board ---------- */
.tv { background: var(--blue-900); color: #fff; min-height: 100vh; padding: 3vw; }
.tv h1 { color: #fff; font-size: 3vw; }
.tv-grid { display: grid; gap: 2vw; grid-template-columns: repeat(auto-fit, minmax(30vw, 1fr)); }
.tv-card { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); border-radius: 2vw; padding: 2.4vw; }
.tv-card .now { font-size: 13vw; line-height: 1; font-weight: 700; color: var(--mint-400); }
.tv-card h2 { color: #fff; font-size: 2.4vw; margin: 0; } .tv-card p { font-size: 1.6vw; opacity: .85; }
.tv-next { font-size: 2.2vw; } .tv-next b { display: inline-block; min-width: 3.2vw; padding: .2vw .8vw; margin: .3vw; border-radius: .8vw; background: rgba(255,255,255,.12); text-align: center; }

/* ---------- staff ---------- */
.staff body, body.staff { background: #F2F6FB; }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0; }
.tab { flex: none; text-decoration: none; padding: 10px 16px; border-radius: var(--r-md); background: #fff; border: 1px solid var(--line); color: var(--ink-700); font-size: 15px; line-height: 1.35; }
.tab b { display: block; color: var(--ink-900); } .tab.on { background: var(--blue-600); border-color: var(--blue-600); color: #dbe8ff; } .tab.on b { color: #fff; }
.now-card { background: linear-gradient(150deg, var(--blue-600), var(--blue-900)); color: #dbe8ff; border-radius: var(--r-xl); padding: 20px; box-shadow: var(--sh-3); }
.now-card h2, .now-card b { color: #fff; }
.now-num { font-size: 64px; line-height: 1; font-weight: 700; color: var(--mint-400); }
.next-btn { min-height: 64px; font-size: 21px; width: 100%; }
.qlist { list-style: none; margin: 0; padding: 0; }
.q { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; }
.q + .q { margin-top: 8px; }
.q .n { width: 52px; height: 52px; border-radius: 14px; background: var(--blue-50); color: var(--blue-700); font-weight: 700; font-size: 22px; display: grid; place-items: center; }
.q.present .n { background: var(--mint-100); color: var(--green-700); } .q.in_room { border-color: var(--green-500); box-shadow: 0 0 0 1px var(--green-500); } .q.in_room .n { background: var(--green-500); color: #fff; }
.q.done, .q.no_show { opacity: .6; } .q.done .n { background: #EEF1F5; color: var(--ink-500); }
.q .who { min-width: 0; } .q .who b { color: var(--ink-900); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q .who span { font-size: 13px; color: var(--ink-500); }
.q .acts { display: flex; gap: 6px; }
.ibtn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; color: var(--blue-600); cursor: pointer; text-decoration: none; }
.ibtn:hover { background: var(--blue-50); } .ibtn.g { color: var(--green-700); } .ibtn.r { color: var(--error); }
.filters { display: flex; gap: 6px; overflow-x: auto; margin: 16px 0 10px; }
.filters a { flex: none; text-decoration: none; font-size: 14px; padding: 6px 12px; border-radius: var(--r-pill); background: #fff; border: 1px solid var(--line); color: var(--ink-700); }
.filters a.on { background: var(--ink-900); color: #fff; border-color: var(--ink-900); }
.sheet { position: fixed; inset: 0; background: rgba(10,31,68,.45); display: none; align-items: flex-end; justify-content: center; z-index: 50; }
.sheet:target, .sheet.open { display: flex; }
.sheet-box { background: #fff; width: min(100%, 560px); max-height: 92vh; overflow: auto; border-radius: 24px 24px 0 0; padding: 20px 20px 28px; animation: up .3s var(--ease); }
@media (min-width: 700px) { .sheet { align-items: center; } .sheet-box { border-radius: 24px; } }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
.grid-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
.kpi b { display: block; font-size: 30px; color: var(--ink-900); line-height: 1.2; } .kpi span { font-size: 14px; color: var(--ink-500); }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 10px; }
.bars div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bars i { width: 100%; max-width: 28px; background: var(--blue-600); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.bars span { font-size: 11px; color: var(--ink-500); }
table.list { width: 100%; border-collapse: collapse; font-size: 15px; background: #fff; }
table.list th, table.list td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.list th { font-size: 13px; color: var(--ink-500); font-weight: 600; background: var(--blue-50); }
.tscroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 300px; margin: 0 auto; }
.pinpad button { height: 64px; border-radius: 18px; border: 1px solid var(--line); background: #fff; font: 700 26px var(--font); color: var(--ink-900); cursor: pointer; }
.pinpad button:active { background: var(--blue-50); }
.pin-dots { display: flex; gap: 12px; justify-content: center; margin: 18px 0; } .pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--blue-600); }
.pin-dots i.f { background: var(--blue-600); }
.rx-img { border-radius: var(--r-md); border: 1px solid var(--line); background: #fff; width: 100%; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; } .thumbs img { aspect-ratio: 3/4; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.foot { padding: 28px 0 100px; color: var(--ink-500); font-size: 14px; text-align: center; }
.bottom-bar { position: fixed; bottom: 0; inset-inline: 0; background: #fff; border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr 1fr; gap: 10px; z-index: 30; }
@media (min-width: 900px) { .bottom-bar { display: none; } .foot { padding-bottom: 40px; } }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--ink-900); color: #fff; padding: 10px 18px; border-radius: var(--r-pill); font-size: 15px; z-index: 99; box-shadow: var(--sh-3); }
@media (min-width: 900px) {
  .two-col { display: grid; grid-template-columns: 1.15fr .85fr; gap: 28px; align-items: start; }
  .sticky { position: sticky; top: 80px; }
}
@media (max-width: 380px) { .serial-big { font-size: 72px; } .stat b { font-size: 22px; } .cta-row { grid-template-columns: 1fr; } }
@media print { .noprint { display: none !important; } body { background: #fff; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.brand { min-width: 0; flex: 1; } .brand > span:last-child { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 480px) { body.staff .top nav a { padding: 8px 9px; } body.staff .brand > span:last-child { max-width: 34vw; } }
