/* DocIn web app. Same palette and type as docin.co.in. */
:root {
  --ground: #F5F6F2; --card: #FFFFFF; --ink: #13201B; --muted: #4D5450; --faint: #5F6662;
  --line: #E1E4DE; --border: #D5D9D2; --chip: #F3F4F1;
  --brand: #0B6E4F; --brand-soft: #DDF3E9; --brand-text: #0A5C40;
  --away: #C2690B; --away-soft: #FCEBD5; --away-text: #7A4105;
  --danger: #A12A1E;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Figtree", "Segoe UI", system-ui, -apple-system, "Noto Sans", sans-serif;
  --tabbar: 64px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.5;
  padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); }
a { color: var(--brand); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 99; }
.skip:focus { left: 8px; }
[hidden] { display: none !important; }

/* top bar */
.appbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: rgba(245,246,242,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -0.02em; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: var(--brand); display: inline-flex; align-items: center; justify-content: center; }
.langpick { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--card); border-radius: 22px; padding: 0 10px; min-height: 40px; color: var(--muted); }
.langpick select { border: 0; background: transparent; min-height: 38px; max-width: 120px; color: var(--ink); font-weight: 600; }

/* bottom tabs */
.tabbar { position: fixed; inset: auto 0 0 0; z-index: 20; display: flex; justify-content: space-around; background: var(--card);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); height: calc(var(--tabbar) + env(safe-area-inset-bottom)); }
.tabbar a { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--faint); text-decoration: none; font-size: 12px; font-weight: 600; min-width: 0; }
.tabbar a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; padding: 0 2px; }
.tabbar a.on { color: var(--brand); }
.dotcount { position: absolute; top: 6px; left: calc(50% + 6px); background: var(--brand); color: #fff; font-size: 11px; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }

/* page */
main { outline: none; }
.page { max-width: 760px; margin: 0 auto; padding: 16px 16px 32px; display: flex; flex-direction: column; gap: 14px; }
.page.wide { max-width: 1180px; }
.page.narrow { max-width: 560px; }
.h1 { font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1.1; letter-spacing: -0.02em; margin: 0; }
.h2 { font-family: var(--display); font-weight: 800; font-size: 23px; line-height: 1.15; letter-spacing: -0.01em; margin: 0; }
.h3 { font-weight: 800; font-size: 17px; margin: 0; }
.eyebrow { margin: 0; color: var(--brand); font-weight: 700; font-size: 13px; }
.muted { color: var(--muted); margin: 0; }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.strong { font-weight: 700; }
.error { color: var(--danger); }
.note { color: var(--muted); background: var(--chip); border-radius: 12px; padding: 10px 12px; margin: 0; }
.mt6 { margin-top: 6px; } .mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt20 { margin-top: 20px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.top { align-items: flex-start; }
.row.wrap { flex-wrap: wrap; }
.gap8 { gap: 8px; }
.grow { flex: 1; min-width: 0; }
.right { text-align: end; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 420px) { .two { grid-template-columns: 1fr; } }
.loading { padding: 24px; text-align: center; color: var(--muted); }
.empty { padding: 20px; border-radius: 16px; background: var(--card); border: 1px dashed #C9CEC6; color: var(--muted); text-align: center; }
.back { text-decoration: none; font-weight: 600; font-size: 14px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 14px;
  border: 1px solid var(--brand); background: var(--brand); color: #fff; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--brand-text); }
.btn.ghost { background: var(--card); color: var(--ink); border-color: var(--border); }
.btn.ghost:hover { background: var(--chip); }
.btn.soft { background: var(--brand-soft); color: var(--brand-text); border-color: transparent; }
.btn.small { min-height: 38px; padding: 0 12px; font-size: 14px; border-radius: 12px; }
.btn.big { min-height: 54px; font-size: 17px; }
.btn.danger { color: var(--danger); }
.btn:disabled, .btn.busy { opacity: .6; cursor: progress; }
.linkbtn { background: none; border: 0; padding: 6px 0; color: var(--brand); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; align-self: flex-start; }
.linkbtn.light { color: inherit; }

/* nearby */
.topbar { display: flex; justify-content: flex-start; }
.placebtn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 1px solid var(--border); border-radius: 22px; background: var(--card); font-weight: 600; cursor: pointer; color: var(--brand); }
.placebtn span { color: var(--ink); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; flex-wrap: wrap; }
.banner.away { background: #FBF4EA; color: var(--away-text); }
.banner span { flex: 1; min-width: 180px; font-size: 14px; }
.search { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); color: var(--muted); }
.search input { flex: 1; border: 0; outline: none; background: transparent; min-width: 0; height: 46px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip { flex: none; min-height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--border); background: var(--card); font-weight: 600; font-size: 14px; cursor: pointer; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.switch { display: flex; align-items: center; gap: 10px; font-weight: 700; cursor: pointer; min-height: 40px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 44px; height: 26px; border-radius: 13px; background: #B9BFB8; position: relative; flex: none; transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 10px; background: #fff; transition: transform .15s; }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 3px solid var(--brand); outline-offset: 2px; }
.dot, .badge i, .legend i, .docchips i { display: inline-block; width: 8px; height: 8px; border-radius: 4px; margin-inline-end: 6px; vertical-align: middle; }
.nearby-grid { display: grid; gap: 14px; }
@media (min-width: 900px) { .nearby-grid { grid-template-columns: 1.1fr 1fr; align-items: start; } .nearby-grid > div:first-child { position: sticky; top: 80px; } }
.map { height: 260px; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: #E8ECE6; z-index: 0; }
@media (min-width: 900px) { .map { height: 520px; } }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.pin-wrap { background: none; border: 0; }
.pin { width: 28px; height: 28px; border-radius: 14px; border: 2px solid #fff; color: #fff; font-weight: 800; font-size: 13px; display: grid; place-items: center; box-shadow: 0 1px 4px rgba(0,0,0,.25); flex: none; }
.listhead { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.card.dashed { border-style: dashed; border-color: #B9BFB8; }
.ccard { display: flex; gap: 12px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.cname { font-weight: 700; font-size: 17px; color: var(--ink); text-decoration: none; }
.cname::after { content: " ›"; color: var(--faint); }
.dist { float: inline-end; color: var(--muted); font-size: 13px; margin-inline-start: 8px; }
.badge { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 14px; font-weight: 700; font-size: 13px; white-space: nowrap; }
.docchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.docchips span { display: inline-flex; align-items: center; min-height: 26px; padding: 0 8px; border-radius: 8px; background: var(--chip); font-size: 12px; font-weight: 600; }
.tokline { margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--brand-text); }
.cfoot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.dcard { display: flex; flex-direction: column; gap: 8px; }
.dname { font-size: 16px; }
.verified { color: var(--brand); font-weight: 700; }
.chipbtn { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; min-height: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid var(--border); background: var(--card); font-weight: 600; font-size: 13px; cursor: pointer; }
.chipbtn.on { background: var(--brand-soft); color: var(--brand-text); border-color: transparent; }
.links { display: flex; flex-wrap: wrap; gap: 16px; }

/* tokens */
.tokbox { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.tokbox > .row { width: 100%; }
.mytoken { width: 100%; background: var(--brand); color: #fff; border-radius: 16px; padding: 14px 16px; }
.mytoken.called { background: #0B7A55; box-shadow: 0 0 0 4px #7EE2B8; }
.bignum { font-family: var(--display); font-weight: 800; font-size: 40px; line-height: 1; display: block; }
.tokpanel { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.tokpanel summary { cursor: pointer; font-weight: 600; font-size: 14px; min-height: 32px; display: flex; align-items: center; }
details.tokpanel > summary { color: var(--muted); }
.tokstats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tokstats > div { background: var(--chip); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; }
.queue { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.queue li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 10px; background: var(--chip); }
.queue li b { min-width: 28px; }
.queue li.called { background: var(--brand-soft); }
.queue li.done, .queue li.skipped { opacity: .55; }
.queue em { font-style: normal; font-size: 11px; background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 0 5px; }

/* clinic dashboard */
.hero { color: #fff; border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 2px; }
.herotitle { font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: -0.01em; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.segbtn { min-height: 48px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); font-weight: 700; cursor: pointer; }
.segbtn.on.in { background: #0B7A55; border-color: #0B7A55; color: #fff; }
.segbtn.on.away { background: var(--away); border-color: var(--away); color: #fff; }
.segbtn.on.done { background: #6B716E; border-color: #6B716E; color: #fff; }
.awaybox { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 14px; background: #FBF4EA; }
.awaybox .row { align-items: flex-end; }
.code { font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: 6px; }
.addbtn { display: flex; align-items: center; justify-content: center; min-height: 50px; border-radius: 14px; border: 1px dashed #9AA19C; color: var(--ink); font-weight: 700; text-decoration: none; }
.docrow { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.radio { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.radio input { margin-top: 4px; accent-color: var(--brand); width: 18px; height: 18px; }

/* forms */
.field { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; }
.field input, .field select { min-height: 48px; padding: 0 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); font-weight: 400; font-size: 16px; }
.codeinput { text-transform: uppercase; letter-spacing: 6px; font-weight: 800 !important; font-size: 22px !important; }

/* toast + dialog */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar) + 16px + env(safe-area-inset-bottom)); z-index: 60;
  background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 14px; max-width: min(92vw, 460px); font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.dialog { position: fixed; inset: 0; z-index: 70; background: rgba(19,32,27,.45); display: grid; place-items: center; padding: 16px; }
.dlg { background: var(--card); border-radius: 18px; padding: 18px; width: min(420px, 100%); display: flex; flex-direction: column; gap: 14px; }
.dlg p { margin: 0; font-weight: 600; }

/* right-to-left */
[dir="rtl"] .cname::after { content: " ‹"; }

/* places from OpenStreetMap (not on DocIn yet) */
.ccard.place { background: #FAFBF9; border-style: dashed; }
.pin.grey { background: #8B928E; width: 14px; height: 14px; margin-top: 5px; box-shadow: none; }
.pname { font-weight: 700; font-size: 16px; }
.cfoot.wrap { flex-wrap: wrap; }

/* plans outside India */
.card.plan { border-color: #E9D5B5; background: #FFFBF4; }
.card.plan.locked { border-color: #E8C4C0; background: #FFF6F5; }
.dlg .h3 { margin: 0; }
