:root{--bg:#f4f7f6;--paper:#fff;--ink:#18282c;--muted:#56676b;--line:#d6e0de;--teal:#0e6b66;--teal-soft:#e2f0ee;--red:#a33a2c;--red-soft:#f8e4e0;--ok:#2f7a3c;--ok-soft:#e3f2e5;
--sans:"IBM Plex Sans",system-ui,-apple-system,"Segoe UI",sans-serif;--serif:"IBM Plex Serif",Georgia,serif}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.5 var(--sans)}
a{color:var(--teal)}
header.top{background:var(--paper);border-bottom:1px solid var(--line);padding:10px 20px;display:flex;flex-wrap:wrap;gap:16px;align-items:center;justify-content:space-between}
header.top .brand{font-family:var(--serif);font-weight:600;font-size:1.1rem}
header.top nav{display:flex;flex-wrap:wrap;gap:16px;align-items:center}
header.top nav a{text-decoration:none;color:var(--muted)}
header.top nav a.on{color:var(--ink);font-weight:600}
main{max-width:920px;margin:0 auto;padding:28px 20px 60px;display:grid;gap:20px}
main>*,.dash>*,.dash-side>*{min-width:0} /* a wide table or file box must not push the page sideways on a phone */
h1,h2{font-family:var(--serif);font-weight:600;margin:0}
h1{font-size:1.7rem}h2{font-size:1.2rem}
.card{background:var(--paper);border:1px solid var(--line);border-radius:10px;padding:20px;display:grid;gap:14px;align-content:start}
.muted{color:var(--muted)}
form.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:14px}
form.grid>button{align-self:end}
label{display:grid;gap:4px;font-size:.9rem;color:var(--muted)}
input,select{min-width:0;max-width:100%;font:inherit;color:var(--ink);background:var(--paper);border:1px solid var(--line);border-radius:6px;padding:8px 10px}
input:focus,select:focus,button:focus{outline:2px solid var(--teal);outline-offset:1px}
button,.btn{font:600 .95rem var(--sans);border-radius:6px;padding:9px 16px;border:1px solid var(--teal);background:var(--teal);color:#fff;cursor:pointer;justify-self:start}
button.quiet{background:var(--paper);color:var(--ink);border-color:var(--line)}
.notice{padding:10px 14px;border-radius:8px}
.notice.error{background:var(--red-soft);color:var(--red)}
.notice.lite-hint{background:var(--ok-soft);color:inherit}
.notice.ok{background:var(--ok-soft);color:var(--ok)}
table{border-collapse:collapse;width:100%;font-size:.92rem}
th,td{text-align:left;padding:8px 10px;border-bottom:1px solid var(--line);vertical-align:top}
th{font-size:.75rem;text-transform:uppercase;letter-spacing:.05em;color:var(--muted)}
.scroll{overflow-x:auto}
.tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px}
.tile{background:var(--teal-soft);border-radius:8px;padding:12px 14px}
.tile b{display:block;font-size:1.4rem;font-variant-numeric:tabular-nums}
.narrow{max-width:420px;margin:60px auto}
.pill{display:inline-block;font-size:.75rem;padding:2px 8px;border-radius:999px;background:var(--teal-soft);color:var(--teal)}

/* consultation screen: same shape as the old app */
main.wide{max-width:1280px}
textarea{width:100%;font:inherit;color:var(--ink);background:var(--paper);border:1px solid var(--line);border-radius:6px;padding:10px 12px;resize:vertical;line-height:1.5}
textarea:focus{outline:2px solid var(--teal);outline-offset:1px}
.small{font-size:.82rem}
button.small{padding:4px 10px}
.consult-head{gap:12px}
.consult-title{display:flex;flex-wrap:wrap;justify-content:space-between;gap:12px;align-items:flex-start}
.consult-title h1{font-size:1.35rem}
.consult-title p{margin:2px 0 0}
.consult-meta{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.pill-done{background:var(--ok-soft);color:var(--ok)}
.patient-strip{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:0;margin:0;background:var(--bg);border-radius:8px;padding:8px 4px}
.patient-strip div{padding:2px 12px;border-right:1px solid var(--line);min-width:0}
.patient-strip div:last-child{border-right:0}
.patient-strip dt{font-size:.68rem;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}
.patient-strip dd{margin:0;font-weight:600;overflow-wrap:anywhere}
.steps{display:flex;gap:6px;background:var(--paper);border:1px solid var(--line);border-radius:10px;padding:6px;overflow-x:auto;position:sticky;top:0;z-index:20;box-shadow:0 2px 6px rgba(0,0,0,.05)}
.step-finish{flex:none;white-space:nowrap}form.step-finish{margin:0;display:flex}form.step-finish button{flex:1}
.panel-title{display:flex;gap:8px;align-items:center;font-size:1.05rem;color:var(--muted);border-bottom:1px solid var(--line);padding-bottom:6px;margin-top:8px}
.panel-title .num{display:inline-grid;place-items:center;width:22px;height:22px;border-radius:50%;background:var(--teal);color:#fff;font-size:.75rem;font-family:var(--sans)}
dialog.finish-dialog{max-width:720px;width:calc(100% - 32px);border:1px solid var(--line);border-radius:10px;padding:18px}
dialog.finish-dialog::backdrop{background:rgba(0,0,0,.35)}
dialog.finish-dialog details{border-top:1px solid var(--line);padding:6px 0}dialog.finish-dialog pre{max-height:180px;overflow:auto;margin:4px 0 0}
.review-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:12px}
.step{flex:1;min-width:120px;background:transparent;color:var(--muted);border:1px solid transparent;display:flex;gap:8px;align-items:center;justify-content:center;justify-self:stretch}
.step .num{display:inline-grid;place-items:center;width:22px;height:22px;border-radius:50%;background:var(--bg);font-size:.75rem}
.step.on{background:var(--teal-soft);color:var(--ink);border-color:#b9dad5}
.step.on .num{background:var(--teal);color:#fff}
.consult{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:20px;align-items:start}
@media (max-width:900px){.consult{grid-template-columns:1fr}}
.step-panel{display:grid;gap:16px}
.recorder{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;background:var(--teal-soft);border-radius:8px;padding:8px 10px}.recorder p{margin:0;flex:1 1 240px}
.rec-buttons{display:flex;flex-wrap:wrap;gap:8px}
.recorder.live{background:#fbeeee}
button[aria-pressed=true]{background:var(--ink);color:#fff;border-color:var(--ink)}
.section{display:grid;gap:8px}
.section-head{display:flex;gap:10px;align-items:baseline;flex-wrap:wrap}
.section-head .note-tools{margin-left:auto;display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.linklike{background:none;border:0;padding:2px 4px;color:var(--teal,#1f6f66);text-decoration:underline;cursor:pointer;font:inherit}
.linklike.small{font-size:.8rem}
.linklike:hover{color:#b42318}
.guide summary{cursor:pointer;color:var(--teal);font-size:.88rem}
.guide dl{display:grid;grid-template-columns:minmax(120px,auto) 1fr;gap:4px 12px;font-size:.82rem;margin:8px 0 0}
.guide dt{font-weight:600;color:var(--muted)}
.guide dd{margin:0;color:var(--muted)}
.transcript{white-space:pre-wrap;font:inherit;font-size:.85rem;max-height:320px;overflow:auto;background:var(--bg);padding:10px;border-radius:6px}
.actions{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;border-top:1px solid var(--line);padding-top:14px}
.record{position:sticky;top:12px;max-height:calc(100vh - 24px);overflow:auto}
.rcard{border:1px solid var(--line);border-radius:8px;padding:12px;display:grid;gap:6px}
.rcard.on{border-color:var(--teal)}
.rcard.risk{border-color:var(--red);background:var(--red-soft)}
.rcard-head{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap}
.rcard h3{margin:0;font-size:.75rem;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}
.rcard pre{margin:0;white-space:pre-wrap;font:inherit;font-size:.9rem;max-height:260px;overflow:auto}
.rcard pre.empty{color:var(--muted)}
.rcard pre b.nh{font-weight:600;color:var(--teal)}
.rcard[data-card="history"] pre{max-height:480px}
.rx-live td:first-child{font-weight:600}
.draft-tag{display:inline-flex;gap:8px;align-items:center;font-size:.75rem;font-weight:600;color:#8a5a00;background:#fdf1d8;border-radius:999px;padding:2px 4px 2px 10px}
[hidden]{display:none!important}
button:disabled{opacity:.45;cursor:default}
.btn{text-decoration:none;display:inline-block}
.btn.quiet{background:var(--paper);color:var(--ink);border-color:var(--line)}
.btn.small{padding:4px 10px;font-size:.82rem}
/* home dashboard: same layout as the old app */
.dash-head{display:flex;flex-wrap:wrap;justify-content:space-between;gap:12px;align-items:flex-end}
.dash-head p{margin:2px 0 0}
.eyebrow{font-size:.72rem;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:var(--teal)}
.dash-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.dash-tiles .tile{display:grid;gap:2px;text-decoration:none;color:var(--ink);background:var(--paper);border:1px solid var(--line);border-top:4px solid var(--teal)}
.dash-tiles .tile span{font-weight:600;color:var(--muted)}
.dash-tiles .tile small{color:var(--muted)}
.dash-tiles .t2{border-top-color:#3b6fb6}.dash-tiles .t3{border-top-color:#7a5bb5}
.dash-tiles .t4{border-top-color:#c98a16}.dash-tiles .t5{border-top-color:#b5475b}
.dash{display:grid;grid-template-columns:minmax(280px,340px) minmax(0,1fr);gap:16px;align-items:stretch}
@media (max-width:900px){.dash{grid-template-columns:1fr}}
.cal h2,.queue h2{font-size:1.05rem}
.cal-nav{display:flex;justify-content:space-between;align-items:center}
.cal-grid{table-layout:fixed}
.cal-grid th{text-align:center;padding:4px 0;border:0}
.cal-grid td{padding:2px;border:0;text-align:center}
.cal-grid a{display:block;position:relative;padding:8px 0;border-radius:8px;text-decoration:none;color:var(--ink)}
.cal-grid a.other{color:#aab6b4}
.cal-grid a.today{font-weight:700;color:var(--teal)}
.cal-grid a.sel{background:var(--teal);color:#fff}
.cal-grid a:hover{background:var(--teal-soft)}.cal-grid a.sel:hover{background:var(--teal)}
.cal-grid i,.dot{position:absolute;left:50%;bottom:3px;width:5px;height:5px;margin-left:-2px;border-radius:50%;background:currentColor}
.dot{position:static;display:inline-block;margin:0 4px 1px 0;background:var(--muted)}
.row-actions{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
td.row-actions{display:table-cell}td.row-actions>*{display:inline-block;margin:0 4px 4px 0}
.nowrap{white-space:nowrap}
.row-actions form{margin:0}
.row-done td{color:var(--muted)}
.row-off td{color:#9aa7a5;text-decoration:line-through}
.row-off td.row-actions{text-decoration:none}
.status{display:inline-block;font-size:.75rem;font-weight:600;padding:2px 8px;border-radius:999px;background:var(--bg)}
.s-scheduled{background:#e5edf8;color:#2c5591}
.s-waiting{background:#dff3f5;color:#0e6470}
.s-with_doctor{background:#fdf1d8;color:#8a5a00}
.s-done{background:var(--ok-soft);color:var(--ok)}
.s-cancelled,.s-no_show{background:var(--red-soft);color:var(--red)}
@media print{header.top,.no-print{display:none!important}body{background:#fff}main{padding:0}}
.two{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px}
.search-row{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:end}
.picks{display:grid;gap:4px;max-height:240px;overflow:auto}
.picks a{display:block;padding:6px 10px;border-radius:6px;text-decoration:none;color:var(--ink);border:1px solid var(--line)}
.picks a.on,.picks a:hover{border-color:var(--teal);background:var(--teal-soft)}
.choice{border:0;padding:0;margin:0;display:flex;gap:18px;flex-wrap:wrap}
.choice legend{margin-bottom:6px}
.choice label{display:flex;gap:6px;align-items:center;color:var(--ink);font-size:1rem}
.receipt-head{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;border-bottom:1px solid var(--line);padding-bottom:12px}
.receipt-head p{margin:2px 0 0}
.receipt th{width:160px}
h3.label{margin:0 0 4px;font-size:.72rem;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}
pre.plain{margin:0;white-space:pre-wrap;font:inherit;font-size:.92rem}
table.num td:not(:first-child),table.num th:not(:first-child){text-align:right;font-variant-numeric:tabular-nums}
.dash-tiles .t6{border-top-color:#b5475b}
.quick{display:flex;flex-wrap:wrap;gap:8px;background:var(--paper);border:1px solid var(--line);border-radius:10px;padding:8px}
.quick a{padding:6px 12px;border-radius:6px;background:var(--teal-soft);color:var(--teal);font-weight:600;font-size:.9rem;text-decoration:none}
.quick a:hover{background:#cfe6e2}
.token{margin:8px 0 0;font-size:.9rem}.token b{font-size:1.8rem;display:inline-block;margin-left:6px;vertical-align:middle}
.tok{display:inline-grid;place-items:center;min-width:28px;height:28px;border-radius:6px;background:var(--ink);color:#fff;font-weight:700;font-size:.85rem;margin-right:6px}
.wait-long{color:var(--red);font-weight:600}
.follow-up{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.follow-up input{padding:4px 8px}
/* surgery / procedure plan in the Plan step */
.procedure-form{display:flex;flex-wrap:wrap;gap:8px 10px;align-items:flex-end}
.procedure-form label{display:grid;gap:2px;font-size:.85rem}
.procedure-form .wide{flex:1 1 100%}
.procedure-form .grow{flex:1 1 180px}
.procedure-form input,.procedure-form textarea{padding:5px 8px;width:100%;box-sizing:border-box}
.procedure-form .chips{margin:0}
.pre-op-advice{border:1px solid var(--line,#ddd);border-radius:8px;padding:6px 10px;display:grid;gap:2px;margin:0}
.procedure-form label.check{display:flex;gap:6px;align-items:flex-start;line-height:1.35;color:var(--ink)}
.procedure-form label.check input{width:auto;flex:none;margin-top:3px}
.procedure-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
@media (max-width:900px){.follow-ups{grid-column:auto!important}}
.favs{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.upi{display:flex;gap:16px;align-items:center;flex-wrap:wrap;background:var(--teal-soft);border-radius:8px;padding:12px}
.upi img{background:#fff;border-radius:6px;padding:6px}
.upi p{margin:0;flex:1;min-width:200px}
a.wa{color:#1f7a3f;border-color:#bfe3c9}

/* home fits one screen: compact header and cards, the queue scrolls inside its card */
main.wide{padding-top:16px;gap:14px}
.dash-head{align-items:center}
.dash-head h1{font-size:1.45rem}
.dash-head .quick{border:0;background:none;padding:0;flex:1;justify-content:center}
.dash-tiles{grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px}
.dash-tiles .tile{padding:8px 12px;gap:0}
.dash-tiles .tile b{font-size:1.35rem;line-height:1.3}
.dash .card{padding:16px;gap:10px}
.cal-grid a{padding:5px 0}
.queue-scroll{max-height:max(300px,calc(100vh - 330px));overflow:auto;border:1px solid var(--line);border-radius:8px}
.queue-table th{position:sticky;top:0;background:var(--paper);z-index:1;box-shadow:inset 0 -1px 0 var(--line)}
.queue-table td{padding:6px 10px}
@media (max-width:900px){.queue-scroll{max-height:70vh}.dash-head .quick{justify-content:flex-start;flex-basis:100%;order:3}}

/* examination and diagnosis helpers */
.mse-picks{display:grid;gap:6px;padding:10px;border:1px solid var(--line);border-radius:8px;background:var(--bg,#f7faf9)}
.mse-top{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.mse-row{display:grid;grid-template-columns:150px 1fr;gap:6px;align-items:center}
@media (max-width:600px){.mse-row{grid-template-columns:1fr}}
.mse-title{font-size:.85rem;font-weight:600;color:var(--muted)}
.mse-title i{font-style:normal;color:var(--teal);font-size:.6rem;vertical-align:middle}
.chip{font:inherit;font-size:.82rem;padding:3px 10px;border-radius:999px;border:1px solid var(--line);background:var(--paper);color:var(--ink);cursor:pointer}
.chip:hover{border-color:var(--teal)}
.chip.on{background:var(--teal);border-color:var(--teal);color:#fff}
.chips{display:flex;flex-wrap:wrap;gap:6px}
.vitals{display:grid;grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:10px}
.vitals label{display:grid;gap:4px;font-size:.85rem}
.vitals output{padding:8px 0;font-weight:700}
.dx-tools{display:flex;gap:8px;flex-wrap:wrap}
.dx-tools input{flex:1;min-width:220px}
.tx-suggestions{position:relative;display:grid;gap:6px;padding:10px 12px;border:1px dashed var(--teal);border-radius:8px;margin-bottom:8px;font-size:.92rem}
.tx-suggestions h4{margin:6px 0 0;font-size:.85rem;text-transform:uppercase;letter-spacing:.04em;color:var(--muted)}
.tx-suggestions ul{margin:0;padding-left:18px}
.tx-option{display:grid;gap:2px;padding:6px 0;border-top:1px solid var(--line)}
.tx-head{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.tx-safety{color:var(--red)}
.tx-close{position:absolute;top:6px;right:6px}
@media print{.tx-suggestions{display:none!important}}
.dx-suggestions{display:grid;gap:6px;padding:10px;border:1px dashed var(--teal);border-radius:8px}
.dx-row{display:flex;gap:10px;align-items:baseline;flex-wrap:wrap}
.two-col{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:20px;align-items:start}
/* printable prescription */
.rx-toolbar{display:grid;gap:10px}
.rx-toolbar form{margin:0}
.rx-sheet{background:#fff;border:1px solid var(--line);border-radius:10px;padding:28px 32px;display:grid;gap:14px;max-width:820px;width:100%;margin:0 auto;color:#111}
.rx-head{display:flex;justify-content:space-between;gap:20px;border-bottom:2px solid var(--teal);padding-bottom:12px}
.rx-head h1{font-size:1.5rem}.rx-head p{margin:2px 0 0;color:#444;font-size:.9rem}
.rx-doc{text-align:right;font-size:.9rem}
.rx-head{align-items:flex-start}.rx-clinic{flex:1}.rx-logo{height:64px;max-width:120px;object-fit:contain;flex:none}
.rx-legal{margin:0;text-align:center;font-size:.62rem;color:#666}
.rx-patient{display:grid;grid-template-columns:2fr 1fr 1.3fr 1.2fr 1fr;gap:8px;margin:0;padding:8px 0;border-bottom:1px solid #ccc}
.rx-patient dt{font-size:.7rem;text-transform:uppercase;letter-spacing:.05em;color:#666}.rx-patient dd{margin:0;font-weight:600}
.rx-sheet h2{font-size:1rem;margin:0 0 4px}
.rx-symbol{font-size:1.6rem!important;font-family:var(--serif)}
.rx-table th{color:#555}.rx-table td{padding:8px 10px}.rx-table td:last-child{white-space:nowrap}
.rx-generic{font-size:.85rem;color:#333;font-style:italic}
.rx-small{font-size:.85rem;color:#444;margin:0}
.rx-raw td{color:#333}
.hi{font-size:.9rem;color:#333}
.pre{white-space:pre-wrap;margin:0}
.rx-sign{display:flex;justify-content:space-between;align-items:flex-end;gap:20px;margin-top:28px;break-inside:avoid}
.rx-sign>div:last-child{text-align:center;min-width:220px}
.rx-line{display:block;border-top:1px solid #333;margin-bottom:4px}
.hide-dx .rx-dx,.rx-sheet.lang-hi .en,.rx-sheet.lang-en .hi{display:none}
.rx-sheet .hi{font-size:inherit;color:inherit} /* the print sets sizes per block; Hindi follows them */
.rx-summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:4px 16px;font-size:.78rem;line-height:1.3;color:#222;border-bottom:1px solid #ddd;padding-bottom:6px}
.rx-summary h3{font-size:.7rem;margin:0;text-transform:uppercase;letter-spacing:.05em;color:#555;font-family:var(--sans)}
.rx-summary ul{margin:0;padding-left:14px}
.hide-summary .rx-summary{display:none}
.rx-signature{display:block;max-height:52px;max-width:210px;margin:0 auto 2px;object-fit:contain;mix-blend-mode:multiply}
body.embed{background:#fff}body.embed main{padding:0;max-width:none}body.embed .rx-sheet{border:0;border-radius:0;max-width:none;padding:45px}
body.embed [data-goto]{cursor:pointer}body.embed [data-goto]:hover{outline:1px dashed var(--teal);outline-offset:2px}
.rx-plan{font-size:.8rem;line-height:1.3;color:#333}.rx-plan h2{font-size:.75rem!important;text-transform:uppercase;letter-spacing:.04em;color:#555}
.rx-procedure{border:1px solid #bbb;border-radius:4px;padding:5px 10px;font-size:.85rem;line-height:1.3}
.rx-procedure h2{font-size:.9em!important;text-transform:uppercase;letter-spacing:.04em;color:#444;margin:0 0 2px!important}
.rx-procedure p{margin:1px 0}.rx-procedure ul{margin:1px 0;padding-left:16px}
.rx-advice{display:grid;grid-template-columns:11fr 9fr;gap:0;border:1px solid #bbb;border-radius:4px;font-size:.88rem;line-height:1.35}
.rx-advice.one{grid-template-columns:1fr}
.rx-advice>div{padding:6px 10px}.rx-advice>div+div{border-left:1px solid #bbb}
.rx-advice h2{font-size:1.05em!important;text-transform:uppercase;letter-spacing:.04em;color:#444;margin-bottom:2px!important}
.rx-advice ul{margin:0;padding-left:16px}.rx-advice li{margin:1px 0}
.advice-pick{display:grid;grid-template-columns:11fr 9fr;font-size:1rem;gap:6px 18px;padding:10px;border:1px solid var(--line);border-radius:8px;margin-bottom:8px}
.advice-col{display:grid;gap:4px;align-content:start}
.advice-col label.check{display:flex;gap:6px;align-items:flex-start;line-height:1.35}.advice-col input{flex:none;margin-top:3px}
.advice-quick{grid-column:1/-1;display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.advice-count{grid-column:1/-1;margin:0}.advice-count.over{color:var(--red);font-weight:600}
@media (max-width:700px){.advice-pick{grid-template-columns:1fr}.rx-advice{grid-template-columns:1fr}.rx-advice>div+div{border-left:0;border-top:1px solid #bbb}}
.lang-switch{display:inline-flex;align-items:center;gap:4px;font-size:.85rem;color:var(--muted)}
.lang-switch button{padding:3px 10px;font-size:.85rem;background:var(--paper);color:var(--ink);border:1px solid var(--line);border-radius:0}
.lang-switch button:first-of-type{border-radius:6px 0 0 6px}.lang-switch button:last-of-type{border-radius:0 6px 6px 0;margin-left:-1px}
.lang-switch button.on{background:var(--teal);color:#fff;border-color:var(--teal)}
@media (max-width:600px){.rx-sheet{padding:16px}.rx-patient{grid-template-columns:1fr 1fr}.rx-head{flex-direction:column}.rx-doc{text-align:left}}
/* The sheet is laid out as it prints (compact, A4) on screen too, so what you see fits. */
.rx-sheet{gap:8px;font-size:15px}
.rx-head{padding-bottom:6px!important}.rx-head h1{font-size:1.3rem!important}.rx-head p,.rx-doc{font-size:.82rem!important;line-height:1.3}
.rx-patient{padding:4px 0!important}.rx-table td,.rx-table th{padding:4px 8px!important}.rx-symbol{font-size:1.3rem!important}
.rx-advice{font-size:.7rem!important;line-height:1.25!important}.rx-plan{font-size:.72rem!important;line-height:1.2!important}.rx-sign{margin-top:18px!important}
.rx-sheet.measuring{width:703px;max-width:none;padding:0;border:0}
@media print{.rx-sheet{border:0;padding:12mm 14mm 9mm;max-width:none;min-height:296mm;box-sizing:border-box}main.wide,main{max-width:none;padding:0}@page{size:A4;margin:0}}
.repeat{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:0}
.last-visit dd.pre{white-space:pre-wrap}
.actions form{margin:0}
.check{display:flex;gap:6px;align-items:center;color:var(--ink)}
/* follow-ups: carried-forward notes, visit history column, one-click stable */
.followup-bar{display:flex;gap:14px;align-items:center;justify-content:space-between;flex-wrap:wrap;background:var(--teal-soft);border:1px solid #b9dcd6;border-radius:10px;padding:12px 16px}
.followup-bar form{margin:0}
.outcome-bar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;padding:4px 2px}
.outcome-bar .chip.oc-better.on{background:var(--ok);border-color:var(--ok)}
.outcome-bar .chip.oc-same.on{background:var(--muted);border-color:var(--muted)}
.outcome-bar .chip.oc-worse.on{background:var(--red);border-color:var(--red)}
.oc-bar{display:flex;height:10px;min-width:90px;border-radius:5px;overflow:hidden;background:var(--line)}
.oc-bar i{display:block}.oc-bar .b{background:var(--ok)}.oc-bar .s{background:#9aa9ac}.oc-bar .w{background:var(--red)}
.oc-group{gap:10px}.oc-group h2{font-size:1.1rem}.oc-group table td:first-child{min-width:160px}
.oc-key{display:flex;gap:14px;flex-wrap:wrap}.oc-key span::before{content:"";display:inline-block;width:10px;height:10px;border-radius:2px;margin-right:5px;vertical-align:-1px}
.oc-key .b::before{background:var(--ok)}.oc-key .s::before{background:#9aa9ac}.oc-key .w::before{background:var(--red)}
.stable-btn{background:var(--ok);border-color:var(--ok);font-size:1rem;padding:10px 16px}
.carried{font-size:.72rem;padding:2px 8px;border-radius:999px;background:#fff4dc;color:#8a5a00;border:1px solid #f0d9a4}
.consult.with-history{grid-template-columns:230px minmax(0,1fr) minmax(0,1fr)}
@media (max-width:1100px){.consult.with-history{grid-template-columns:1fr}}
.vhist{position:sticky;top:12px;max-height:calc(100vh - 24px);display:flex;flex-direction:column;gap:8px;padding:14px}
.vhist h2{font-size:1rem}
.vhist-middle{flex:1;min-height:60px;overflow:auto;display:grid;gap:8px;align-content:start;padding:8px 0;border-top:1px dashed var(--line);border-bottom:1px dashed var(--line)}
.hcard{display:grid;gap:2px;text-align:left;width:100%;font:inherit;padding:8px 10px;border-radius:8px;border:1px solid var(--line);background:var(--paper);color:var(--ink);cursor:pointer}
.hcard b{font-size:.75rem;text-transform:uppercase;letter-spacing:.05em;color:var(--teal)}
.hcard span{font-size:.85rem;font-weight:600}.hcard small{font-size:.8rem;color:var(--muted)}
.hcard:hover{border-color:var(--teal)}.hcard.on{border-color:var(--teal);background:var(--teal-soft)}
.review{display:grid;gap:10px}
.review-head{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap}
.review-head h2{font-size:1rem}
.record.reviewing>.rcard,.record.reviewing>.current-record{display:none!important}
.record.reviewing{border-color:var(--teal);background:#fbfdfc}
.hcard .unfinished{font-style:normal;color:var(--red)}

/* the live prescription table */
.rx-live{margin-top:8px}
.rx-live table{width:100%;border-collapse:collapse;font-size:.85rem}
.rx-live th,.rx-live td{text-align:left;padding:4px 6px;border-bottom:1px solid var(--line,#e3e6e8);vertical-align:top}
.rx-live tr.unread td{color:#8a5a00;background:#fff8e8}
.rx-live .rx-live-head{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:4px}

/* status chips: what the microphone or the AI is doing right now */
.stage{display:inline-flex;align-items:center;gap:6px;font-size:.8rem;font-weight:600;padding:3px 10px;border-radius:999px;background:#eef1f2;color:#38464d;width:max-content}
.stage[hidden]{display:none}
.stage.listening{background:#fde8e8;color:#b42318}
.stage.listening::before{content:"";width:8px;height:8px;border-radius:50%;background:#d92d20;animation:stage-pulse 1.2s infinite}
.stage.working{background:#e8f1fb;color:#1d5fa8}
.stage.working::before{content:"";width:9px;height:9px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:stage-spin .8s linear infinite}
.stage.ready{background:#e6f4ea;color:#1e6b3a}
.stage.ready::before{content:"✓"}
.stage.error{background:#fdecea;color:#b42318}
.stage.error::before{content:"⚠"}
@keyframes stage-pulse{50%{opacity:.25}}
@keyframes stage-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.stage::before{animation:none}}
.rx-live th:nth-child(1){width:38%}
.rx-live th:nth-child(2){width:30%}
.rx-live th:nth-child(3){width:12%}
.rx-warnings{margin:0 0 8px;padding:8px 12px 8px 28px;background:#fff8e8;border:1px solid #f0d9a4;border-radius:6px;color:#7a4f00;font-size:.85rem}
.rx-warnings[hidden]{display:none}
.rx-flag{display:block;color:#8a5a00;font-size:.78rem;margin-top:2px}
.notice.warn{background:#fff8e8;border:1px solid #f0d9a4;color:#7a4f00}
.notice.warn ul{margin:4px 0 0 18px;padding:0}
.rx-suggest{display:block;margin-top:4px;font-size:.78rem;padding:3px 8px;border-radius:999px;background:#e8f1fb;color:#1d5fa8;border:1px solid #bcd3ee;cursor:pointer;text-align:left}
.rx-suggest:hover{background:#d6e6f8}
@media print{.rx-flag,.rx-suggest{display:none!important}}

/* consultation fits one screen: each column scrolls inside itself */
@media (min-width:901px){
body.fit-screen{height:100vh;display:flex;flex-direction:column;overflow:hidden}
body.fit-screen main{flex:1;min-height:0;width:100%;max-width:none;display:flex;flex-direction:column;gap:10px;padding:10px 20px 12px}
body.fit-screen .consult-head{display:flex;align-items:center;gap:12px;padding:6px 12px}
body.fit-screen .consult-title{display:contents}
body.fit-screen .consult-title>div:first-child{display:none}
body.fit-screen .patient-strip{flex:1;min-width:0;order:1;display:flex;padding:2px 0;background:none}
body.fit-screen .patient-strip div{flex:1 1 auto;padding:0 10px}
/* ID, age/sex and mobile are short: never cut them; name and address shrink instead */
body.fit-screen .patient-strip div:nth-child(1),body.fit-screen .patient-strip div:nth-child(3),body.fit-screen .patient-strip div:nth-child(4){flex:none}
body.fit-screen .patient-strip div:nth-child(n+5){flex:1 1 0;min-width:70px}
body.fit-screen .patient-strip div:nth-child(2){flex:2 1 0;min-width:150px}
body.fit-screen .patient-strip dt{font-size:.62rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.fit-screen .patient-strip dd{font-size:.9rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.fit-screen .consult-meta{order:2;flex:0 1 auto;max-width:44%;justify-content:flex-end;gap:6px}
body.fit-screen .followup-bar{padding:8px 14px}
body.fit-screen .stable-btn{padding:6px 12px;font-size:.92rem}
body.fit-screen .steps{position:static;flex:none}
body.fit-screen .consult{flex:1;min-height:0;align-items:stretch}
body.fit-screen .consult>*{min-height:0;max-height:none;overflow:auto;position:static;align-content:start}
body.fit-screen .notice{flex:none}
/* the notes column stays put; History's box takes the height left and scrolls inside */
body.fit-screen .notes-card{display:flex;flex-direction:column;overflow:hidden}
body.fit-screen .notes-card>.step-panel{flex:1;min-height:0;overflow:auto;display:flex;flex-direction:column}
body.fit-screen .notes-card>.actions{flex:none}
body.fit-screen textarea[id^=note-]{min-height:max(140px,calc((100vh - 430px) / 2))}
body.fit-screen .step-panel[data-panel=history] .section[data-section=history]{flex:1;min-height:0;display:flex;flex-direction:column}
body.fit-screen #note-history{flex:1;min-height:120px;resize:none}
}
/* a section tab shows work still going on there after the doctor moved on */
.step[data-state]:not([data-state=""])::after{font-size:.75rem;font-weight:700;margin-left:2px}
.step[data-state=working]::after{content:"";width:9px;height:9px;border:2px solid #1d5fa8;border-right-color:transparent;border-radius:50%;animation:stage-spin .8s linear infinite}
.step[data-state=ready]::after{content:"✓";color:var(--ok)}
.step[data-state=error]::after{content:"!";color:#fff;background:var(--red);border-radius:50%;width:16px;height:16px;display:inline-grid;place-items:center}
.step-toast{position:fixed;left:50%;bottom:20px;transform:translateX(-50%);background:var(--ink);color:#fff;padding:8px 14px;border-radius:8px;font-size:.88rem;z-index:50;box-shadow:0 4px 14px rgba(0,0,0,.2)}
.step-toast .linklike{color:#9fe0d8}
/* the clinical record column: the prescription as it will print */
.record-tabs{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.record-tabs button{background:var(--paper);color:var(--muted);border-color:var(--line);padding:5px 12px;font-size:.85rem}
.record-tabs button.on{background:var(--teal-soft);color:var(--ink);border-color:#b9dad5}
.record-tabs #printNow{margin-left:auto;background:var(--teal);color:#fff;border-color:var(--teal)}
.print-preview{position:relative;overflow:hidden;border:1px solid var(--line);border-radius:4px;background:#fff;box-shadow:0 2px 8px rgba(0,0,0,.08);min-height:200px}
.print-preview iframe{position:absolute;top:0;left:0;border:0;width:794px;height:1123px;transform-origin:0 0}
.record[data-view=print]>:not(.record-tabs):not(.print-preview){display:none!important}
.record:not([data-view=print])>.print-preview{display:none}
/* Plan holds the most text: a smaller font than History */
.step-panel[data-panel=plan] textarea{font-size:.85rem;line-height:1.4}
.step-panel[data-panel=plan] .advice-pick select,.step-panel[data-panel=plan] .advice-quick button{font-size:.85rem}
#note-advice{font-size:1rem;line-height:1.5}
/* vitals: a fixed box at the top of Examination */
.vitals-box{display:grid;gap:6px;padding:10px 12px;border:1px solid var(--line);border-radius:8px;background:var(--bg)}
.vitals-box h2{font-size:1rem}.vitals-box .muted{margin:0}
.vitals input.heard{background:#fff8e8;border-color:#e0b85c}

/* AI credits left this month (rupees are shown only to the SAHDOC owner) */
.credit-pill{display:inline-flex;align-items:center;gap:4px;text-decoration:none;color:inherit}
.credits-warn.credit-pill,.tile.credits-warn{background:#fff1dc;color:#8a4b00}
.credits-low.credit-pill,.credits-out.credit-pill,.tile.credits-low,.tile.credits-out{background:#fde8e6;color:#9b2c20}
.warn-text{color:#9b2c20}
.credit-pill svg{fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
/* Owner cost meter */
.cost-table td.n,.cost-table th.n{text-align:right;font-variant-numeric:tabular-nums}
.cost-table tr.sub td{color:var(--muted);font-size:.85rem}
.cost-table details summary{cursor:pointer}
.cost-table details table{margin-top:4px;font-size:.85rem}
.cost-pop .cost-problem{margin:6px 0 0;font-size:.72rem;color:var(--red);white-space:normal;max-width:340px}
.mse-more{width:9.5rem;padding:3px 8px;font-size:.8rem;border:1px dashed var(--line);border-radius:999px;background:var(--paper)}

/* ---- prescription design: letterhead, clean sections; works without background colours ---- */
.rx-sheet{display:flex;flex-direction:column;gap:10px;-webkit-print-color-adjust:exact;print-color-adjust:exact;color:#1b1b1b}
.rx-head{border-bottom:2.5px solid var(--teal)!important;padding-bottom:10px!important;align-items:center!important}
.rx-head h1{font-family:var(--serif);color:var(--teal);font-size:1.55rem!important;letter-spacing:.01em;line-height:1.15;margin:0}
.rx-head .rx-clinic p{color:#555}
.rx-doc{line-height:1.35}.rx-doc b{font-size:1.05rem;color:#111}.rx-doc{color:#444}
.rx-patient{border:1px solid #c9d6d4;border-radius:6px;padding:6px 12px!important;border-bottom:1px solid #c9d6d4!important}
.rx-patient.no-occ{grid-template-columns:2fr 1fr 1.2fr 1fr}
.rx-patient dt{font-size:.62rem;color:var(--teal);letter-spacing:.08em}
.rx-summary{grid-template-columns:1.2fr 1.2fr .8fr!important;gap:6px 18px!important;border-bottom:0!important;padding:2px 0 0!important;font-size:.8rem!important}
.rx-summary h3,.rx-sheet h2,.rx-advice h2,.rx-plan h2{font-family:var(--sans)!important;font-variant:small-caps;text-transform:lowercase!important;
  letter-spacing:.08em!important;color:var(--teal)!important;font-size:.9rem!important;font-weight:600;border-bottom:1px solid #d5e1df;padding-bottom:1px;margin:0 0 3px!important}
.rx-summary li{margin:1px 0}
.rx-dx p{margin:0;font-weight:600}
.rx-symbol{font-family:Georgia,'Times New Roman',serif!important;font-size:2.3rem!important;color:var(--teal)!important;border:0!important;font-variant:normal!important;text-transform:none!important;margin:2px 0 0!important;line-height:1}
.rx-table{width:100%;border-collapse:collapse}
.rx-table th{text-align:left;font-size:.68rem;text-transform:uppercase;letter-spacing:.06em;color:#555;border-bottom:1.5px solid #333;padding:4px 8px!important}
.rx-table td{border-bottom:1px solid #e1e6e5;padding:7px 8px!important;vertical-align:top;font-size:.98rem}
.rx-table td:first-child{color:#777;width:1.5rem}
.rx-table td b{font-size:1.02rem}
.rx-advice{border:1px solid #c9d6d4!important;border-radius:6px!important}
.rx-advice>div+div{border-left:1px solid #c9d6d4!important}
.rx-sign{margin-top:auto!important;padding-top:14px}
.rx-sign>div:last-child{min-width:230px;line-height:1.3}
.rx-next{display:inline-block;border:1.5px solid var(--teal);border-radius:999px;padding:4px 14px;font-size:.9rem;color:#222}
.rx-next b{color:var(--teal)}
.rx-legal{border-top:1px solid #d5e1df;padding-top:4px;font-size:.62rem!important;color:#777!important}
body.embed .rx-sheet{min-height:1123px;box-sizing:border-box}
.rx-sheet h2.rx-symbol{font-family:Georgia,'Times New Roman',serif!important;font-size:1.9rem!important;font-variant:normal;text-transform:none!important;letter-spacing:0!important;border:0;padding:0;margin:4px 0 0!important;line-height:1}
.rx-doc{max-width:42%;flex:none}.rx-head h1{font-size:1.45rem!important}
.back-link{display:inline-block;margin:0 0 8px;font-size:.85rem;color:var(--teal);text-decoration:none}.back-link:hover{text-decoration:underline}
header.top a.brand{color:inherit;text-decoration:none}
.nav-menu{position:relative;display:inline-block}.nav-menu summary{cursor:pointer;list-style:none;color:inherit}
.nav-menu summary::-webkit-details-marker{display:none}.nav-menu summary::after{content:" ▾";font-size:.75em}
.nav-menu.on summary{font-weight:600;color:var(--teal)}
.nav-menu>div{position:absolute;right:0;top:calc(100% + 8px);z-index:40;background:var(--paper);border:1px solid var(--line);border-radius:8px;
  box-shadow:0 6px 20px rgba(0,0,0,.12);padding:6px;display:grid;min-width:210px}
.nav-menu>div a{padding:6px 10px;border-radius:6px;white-space:nowrap}.nav-menu>div a:hover{background:var(--teal-soft)}
.error-page{max-width:560px;margin:40px auto;display:grid;gap:8px}.error-page .actions{display:flex;gap:10px;align-items:center}
.net-banner{position:sticky;top:0;z-index:50;margin:0;padding:8px 16px;background:#fff4d6;color:#6b4a00;border-bottom:1px solid #f0d9a4;font-size:.9rem;text-align:center}

/* ---------- polish shared by every page ---------- */
:root{--bg:#f2f5f4;--shadow:0 1px 2px rgba(16,40,44,.05),0 2px 8px rgba(16,40,44,.04)}
.card{box-shadow:var(--shadow);border-color:#dfe7e5}
header.top{position:sticky;top:0;z-index:45;padding:8px 24px;box-shadow:0 1px 0 var(--line)}
header.top .brand{display:flex;align-items:center;gap:8px;font-size:1.15rem}
header.top .brand img{display:block;height:36px;width:auto}
header.top nav{gap:4px}
header.top nav>a,header.top .nav-menu summary{padding:6px 10px;border-radius:6px;font-size:.95rem}
header.top nav>a:hover,header.top .nav-menu summary:hover{background:var(--teal-soft);color:var(--teal)}
header.top nav>a.on{background:var(--teal-soft);color:var(--teal)}
header.top nav>span.muted{font-size:.85rem;margin:0 6px 0 10px;padding-left:12px;border-left:1px solid var(--line)}
.btn{text-decoration:none;display:inline-block}
.btn.outline{background:var(--paper);color:var(--teal);border-color:var(--teal)}
.btn.outline:hover{background:var(--teal-soft)}
.btn.icon{padding:7px 12px;font-size:1.05rem;line-height:1.2}
.pill.grey{background:#edf1f0;color:var(--muted)}
.empty{color:var(--muted);text-align:center;padding:22px 10px!important;font-size:.92rem}

/* ---------- Today page: full width, one screen, no page scroll ---------- */
body.home-fit main.wide{max-width:none;padding:16px 24px 18px;gap:14px}
.dash-head{align-items:center;gap:16px}
.dash-title h1{font-size:1.5rem;line-height:1.2}
.dash-title p{margin:2px 0 0}
.dash-actions{gap:8px}
.dash-actions .btn{padding:9px 16px}
.dash-tiles{grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px}
.dash-tiles .tile{position:relative;display:grid;grid-template-columns:auto 1fr;grid-template-rows:auto auto;column-gap:12px;align-items:center;
  padding:10px 14px;border:1px solid #dfe7e5;border-top:0;border-left:4px solid var(--teal);border-radius:10px;box-shadow:var(--shadow);transition:box-shadow .15s,transform .15s}
a.tile:hover{box-shadow:0 4px 14px rgba(16,40,44,.1);transform:translateY(-1px)}
.dash-tiles .tile svg{grid-row:1/3;width:34px;height:34px;padding:7px;border-radius:9px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;
  color:var(--accent,var(--teal));background:color-mix(in srgb,var(--accent,var(--teal)) 12%,white)}
.dash-tiles .tile b{font-size:1.45rem;line-height:1.15;grid-column:2}
.dash-tiles .tile span{grid-column:2;font-size:.82rem;font-weight:600;color:var(--ink);line-height:1.25}
.dash-tiles .tile small{grid-column:1/3;font-size:.74rem;margin-top:4px;padding-top:4px;border-top:1px dashed var(--line)}
.dash-tiles .tile{grid-template-rows:auto auto auto}
.dash-tiles .t1{--accent:#0e6b66}.dash-tiles .t2{--accent:#3b6fb6}.dash-tiles .t3{--accent:#7a5bb5}
.dash-tiles .t4{--accent:#c98a16}.dash-tiles .t6{--accent:#c0563b}.dash-tiles .t5{--accent:#b5475b}
.dash-tiles .tile{border-left-color:var(--accent)}
.dash-side{display:flex;flex-direction:column;gap:16px;min-height:0}
.dash .card{padding:14px 16px;gap:10px}
.cal{flex:none}
.cal-nav h2{font-size:1.05rem}
.cal-grid th{font-size:.68rem}
.cal-grid a{padding:4px 0;font-size:.9rem}
.cal-foot{display:flex;justify-content:space-between;align-items:center;gap:8px}
.follow-ups{flex:1;min-height:0;display:flex!important;flex-direction:column}
.follow-ups h2{font-size:1.05rem}
.fu-scroll{flex:1;min-height:0;overflow:auto}
.follow-ups table{font-size:.85rem}.follow-ups td{padding:6px 4px}
.follow-ups h3.label{margin-top:4px}
.queue{display:flex!important;flex-direction:column;min-height:0}
.queue-head{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.queue-head h2{margin-right:6px}
.live-note{margin-left:auto;display:flex;align-items:center;gap:6px}
.live-dot{width:8px;height:8px;border-radius:50%;background:#2f9a55;box-shadow:0 0 0 3px #d9f0e0}
.queue-scroll{flex:1;min-height:0}
.queue-table td{vertical-align:middle}
.queue-table tbody tr:hover td,.queue-table tr:hover td{background:#f7faf9}
.queue-table td.row-actions{text-align:right;white-space:nowrap}
.queue-table td.row-actions>*{margin:2px 0 2px 4px}
.queue-table th:last-child{text-align:right}
.kind{display:inline-block;font-size:.7rem;color:var(--muted);border:1px solid var(--line);border-radius:999px;padding:1px 7px;margin-left:2px}
.s-waiting{background:#fdf1d8;color:#8a5a00}
.s-with_doctor{background:#e5edf8;color:#2c5591}
.s-scheduled{background:#edf1f0;color:#4a5b5f}
@media (min-width:901px) and (min-height:560px){
  body.home-fit{height:100vh;display:flex;flex-direction:column;overflow:hidden}
  body.home-fit main.wide{flex:1;min-height:0;width:100%;display:flex;flex-direction:column}
  body.home-fit main.wide>*{flex:none}
  body.home-fit main.wide>.dash{flex:1 1 0;min-height:0}
  body.home-fit .queue-scroll{max-height:none}
}
@media (min-width:901px) and (max-height:820px){
  .dash-tiles .tile small{display:none}
  .dash-tiles .tile{padding:8px 12px}
  .cal-grid a{padding:2px 0}
  body.home-fit main.wide{padding-top:12px;gap:10px}
}
.fu-row{display:grid;gap:6px;padding:8px 0;border-bottom:1px solid var(--line);font-size:.88rem;line-height:1.35}
.fu-row:last-child{border-bottom:0}
.fu-actions{display:flex;flex-wrap:wrap;gap:6px}.fu-actions form{margin:0}
.fu-actions .btn,.fu-actions button{padding:3px 10px;font-size:.78rem}
.queue-table .pill.small{font-size:.66rem;padding:1px 6px;vertical-align:1px}
@media (min-width:901px) and (min-height:560px){body.home-fit .dash{grid-template-rows:minmax(0,1fr)}}
.queue-table td.who{min-width:190px}
body.home-fit main>.notice{padding:5px 12px;font-size:.85rem}
.checks{list-style:none;margin:0;padding:0;display:grid;gap:2px}
.checks li{display:flex;gap:12px;align-items:center;padding:9px 4px;border-bottom:1px solid var(--line)}
.checks li:last-child{border-bottom:0}
.checks li>b{flex:none;width:26px;height:26px;border-radius:50%;display:grid;place-items:center;font-size:.85rem}
.checks li.ok>b{background:var(--ok-soft);color:var(--ok)}.checks li.todo>b{background:#fdf1d8;color:#8a5a00}
.checks li div{flex:1;display:grid}.checks li small{font-size:.82rem}
.checks label{display:flex;gap:12px;align-items:flex-start;color:var(--ink);font-size:1rem;cursor:pointer}
.checks label input{margin-top:5px;width:18px;height:18px;flex:none}
.lock-warn{position:fixed;bottom:16px;left:50%;transform:translateX(-50%);z-index:60;background:var(--ink);color:#fff;padding:10px 16px;border-radius:8px;box-shadow:0 6px 20px rgba(0,0,0,.2);font-size:.92rem;display:flex;gap:12px;align-items:center}
.lock-warn button{padding:4px 12px;font-size:.85rem}
header.top nav>a.who{color:var(--muted);font-size:.85rem;margin-left:6px;padding-left:12px;border-left:1px solid var(--line);border-radius:0}
.reset-pw{display:inline-block;margin-left:6px}.reset-pw summary{list-style:none;display:inline-block}.reset-pw summary::-webkit-details-marker{display:none}
.reset-pw form{display:flex;gap:6px;margin-top:6px}.reset-pw input{padding:4px 8px;width:11rem}

/* Quick check-in: register → consent → bill → consultation */
.steps{margin:0}
button.big{font-size:1.05rem;padding:12px 22px}
.tick{display:flex;flex-direction:row;gap:8px;align-items:flex-start;color:var(--ink)}
.consent-notice{font-size:1.05rem;line-height:1.7;margin:4px 0}
.consent-extras{display:grid;gap:8px;border-top:1px solid var(--line);padding-top:12px}
.consent-answer{display:flex;gap:12px;flex-wrap:wrap}
.consent-answer button{flex:1 1 240px;justify-self:stretch}
.consent-answer.three button{flex:1 1 200px}
.training-notice{margin:12px 0;padding:10px 12px;border:1px solid var(--line, #ddd);border-radius:10px}
.training-notice summary{cursor:pointer}
button.lang-btn{font-size:.85rem;padding:3px 12px;border:1px solid var(--line)}
.bill-layout{display:grid;grid-template-columns:minmax(300px,1.2fr) minmax(260px,1fr);gap:20px;align-items:start}
@media (max-width:800px){.bill-layout{grid-template-columns:1fr}}
.bill-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.receipt-preview{border-style:dashed}

/* owner dashboard */
.admin-totals{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:10px}
.admin-totals div,.admin-totals a{background:#f6f8f8;border-radius:8px;padding:10px 12px;color:inherit;text-decoration:none}
.admin-totals b{display:block;font-size:1.4rem}
.admin-totals span{color:var(--muted);font-size:.82rem}
.pill.warn{background:#fff1dc;color:#8a4b00}
.licence-banner{margin:0;padding:6px 16px;background:#fff8e8;border-bottom:1px solid #f0d9a4;color:#7a4f00;font-size:.88rem}

/* delete buttons: quiet until hovered */
button.danger{color:#9b2c20}
button.danger:hover{background:#fde8e6}
.row-actions form{display:inline}
.ref-warn{margin:0;padding:6px 8px;border-left:3px solid #c98a00;background:rgba(201,138,0,.1);border-radius:4px}
.follow-up.from-voice{outline:2px solid var(--ok);border-radius:8px}
.voice-hint{color:var(--ok);margin-left:6px}
.lite-tools{margin:4px 0 6px}
.lite-tools .quick{margin:4px 0}
.lite-tools .quick summary{cursor:pointer;color:var(--teal)}
.quick-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:3px 0}
.quick-row>.muted{min-width:84px}
.chips.durations{margin-top:6px}
.chip.quiet-chip{background:transparent;font-size:.78rem}
@media (max-width:700px){.chip{padding:6px 12px;font-size:.9rem}.quick-row>.muted{min-width:100%}}
#testChips{margin:4px 0 6px}
#testChips summary{cursor:pointer;color:var(--teal)}
/* Lite tools stay compact so the note box stays in view: chips scroll inside their own strip */
.notice.lite-hint{font-size:.82rem;padding:6px 10px;margin-bottom:6px}
.lite-tools .quick .chips:not(.durations){max-height:62px;overflow-y:auto;padding:2px}
.lite-tools .chip,#testChips .chip{font-size:.78rem;padding:2px 9px}
#testChips .chips{max-height:62px;overflow-y:auto;padding:2px}
@media (max-width:700px){.lite-tools .chip,#testChips .chip{font-size:.88rem;padding:6px 11px}.lite-tools .quick .chips:not(.durations),#testChips .chips{max-height:120px}}

/* ---------- small screens: tablets held upright and phones ---------- */
@media (max-width:900px){
  /* the section tabs wrap instead of hiding Save draft and Confirm & print off to the side */
  .steps{flex-wrap:wrap;overflow-x:visible}
  .step{min-width:0;flex:1 1 104px;padding:8px 6px}
  .steps .step-finish{flex:1 1 40%}
  .steps button.step-finish,.steps form.step-finish button{justify-content:center}
}
@media (max-width:700px){
  header.top{position:static;padding:6px 12px;gap:6px}
  header.top nav>a,header.top .nav-menu summary{padding:5px 8px;font-size:.9rem}
  header.top nav>a.who{margin-left:0;padding-left:8px}
  main,body.home-fit main.wide{padding:16px 12px 40px}
  .card{padding:14px}
  h1{font-size:1.4rem}
  .dash-tiles{grid-template-columns:1fr 1fr;gap:8px}
  .dash-tiles .tile svg{display:none}
  .dash-tiles .tile b,.dash-tiles .tile span,.dash-tiles .tile small{grid-column:1/-1}
}

/* ---------- prescription: services strip and timings (from Settings › Your details) ---------- */
.rx-services{list-style:none;margin:-4px 0 0;padding:4px 10px;display:flex;flex-wrap:wrap;justify-content:center;gap:2px 0;
  background:#eef6f5;border-radius:4px;font-size:.74rem;line-height:1.35;color:#24474a}
.rx-services li{white-space:nowrap}
.rx-services li+li::before{content:"•";color:var(--teal);margin:0 8px}
.rx-services[hidden],.rx-services:empty{display:none}
.rx-timings{font-size:.78rem!important}.rx-timings b{color:var(--teal);font-weight:600}
.rx-preview{border-top:1px dashed var(--line);padding-top:12px}
.rx-mini{max-width:none;padding:14px 18px;border-radius:8px;gap:8px;box-shadow:none}
.rx-mini .rx-head h1{font-size:1.2rem!important}
.rx-mini .ln{display:block}.rx-mini [data-show]:empty{display:none}
@media print{.rx-services{background:#eef6f5}}

/* ---------- owner dashboard ---------- */
.admin-tiles .tile{grid-template-columns:1fr!important}
.admin-tiles .tile b small{font-size:.9rem;color:var(--muted);font-weight:400}
.admin-tiles .tile-alert{border-top-color:#c0392b;background:#fff7f5}
.plan-mix{margin:-4px 0 0;display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.attn-list{display:grid;gap:0}
.attn-row{display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px 14px;align-items:center;padding:10px 0;border-bottom:1px solid var(--line)}
.attn-row:last-child{border-bottom:0}
.attn-name{font-weight:600;text-decoration:none}
.attn-items{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px}
.flag{display:inline-block;font-size:.76rem;padding:2px 9px;border-radius:999px;background:#edf1f0;color:var(--muted)}
.flag-bad{background:#fde8e6;color:#9b2c20;font-weight:600}
.flag-warn{background:#fff1dc;color:#8a4b00}
.flag-info{background:#e8f1fb;color:#1d5fa8}
.inline-form{display:inline;margin:0}
.clinics-head{display:flex;flex-wrap:wrap;gap:10px 14px;align-items:center}
.clinics-head h2{margin-right:auto}
.clinics-head input[type=search]{flex:1 1 220px;max-width:340px}
.clinic-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(310px,1fr));gap:12px}
.clinic-card{border:1px solid var(--line);border-left:4px solid var(--teal);border-radius:8px;padding:12px 14px;display:grid;gap:8px;align-content:start;background:var(--paper);transition:box-shadow .3s}
.clinic-card[hidden]{display:none}
.clinic-card.state-expired,.clinic-card.state-suspended{border-left-color:#c98a16;background:#fffdf8}
.clinic-card.flash{box-shadow:0 0 0 3px var(--teal)}
.clinic-card header{display:flex;justify-content:space-between;gap:8px;align-items:flex-start}
.clinic-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:4px;margin:0;background:var(--bg);border-radius:6px;padding:6px 8px;text-align:center}
.clinic-stats dt{font-size:.66rem;text-transform:uppercase;letter-spacing:.05em;color:var(--muted)}
.clinic-stats dd{margin:0;font-weight:600;font-variant-numeric:tabular-nums}
.credit-meter .bar{height:6px;border-radius:99px;background:#e3ebe9;overflow:hidden;margin-top:3px}
.credit-meter .bar i{display:block;height:100%;background:var(--teal);border-radius:99px}
.credit-meter.credits-warn .bar i{background:#c98a16}
.credit-meter.credits-low .bar i,.credit-meter.credits-out .bar i{background:#c0392b}
.clinic-licence,.clinic-note{margin:0}
.clinic-edit{width:100%}.clinic-edit[open]{border-top:1px solid var(--line);padding-top:8px}
.clinic-edit summary{list-style:none;display:inline-block}.clinic-edit summary::-webkit-details-marker{display:none}
.clinic-edit form.grid{grid-template-columns:1fr;margin-top:8px}
.clinic-card .row-actions details:not([open]){width:auto}
.admin-bottom{display:grid;grid-template-columns:minmax(0,3fr) minmax(0,2fr);gap:16px;align-items:start}
@media (max-width:900px){.admin-bottom{grid-template-columns:1fr}}
details.card>summary{cursor:pointer;list-style:none}details.card>summary::-webkit-details-marker{display:none}
.recent-list{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.recent-list li{border-bottom:1px solid var(--line);padding-bottom:6px;line-height:1.35}
@media (max-width:520px){.clinic-grid{grid-template-columns:1fr}.clinic-stats{grid-template-columns:repeat(2,1fr)}}

/* ---------- appointments page ---------- */
.appt-layout{grid-template-columns:minmax(300px,380px) minmax(0,1fr)}
@media (max-width:900px){.appt-layout{grid-template-columns:1fr}}
.book-form{display:grid;gap:12px}
.pick-chips{margin-top:6px}.pick-chips .chip{padding:4px 12px}
.taken{margin:6px 0 0}
#clashNote{margin:4px 0 0}
.book-form details.more summary{cursor:pointer;color:var(--teal)}
.book-form details.more[open]{display:grid;gap:10px}
button.big{padding:11px 20px;font-size:1rem}
.book-card .search-row{grid-template-columns:1fr auto}
.booked-note{display:flex;flex-wrap:wrap;gap:8px 14px;align-items:center}
.day-nav{display:flex;flex-wrap:wrap;gap:6px 8px;align-items:center}
.day-nav h2{margin:0 auto 0 6px;font-size:1.15rem}
.day-nav .day-pick{margin:0}.day-nav .day-pick input{padding:5px 8px}
.day-counts{display:flex;flex-wrap:wrap;gap:4px;width:100%}
.appt-table .t-time{white-space:nowrap;font-variant-numeric:tabular-nums}
.appt-table td.row-actions form{display:inline-block}
/* phones: each appointment becomes a small card */
@media (max-width:640px){
  .appt-table thead{display:none}
  .appt-table,.appt-table tbody,.appt-table tr,.appt-table td{display:block;width:auto}
  .appt-table tr{border:1px solid var(--line);border-radius:8px;padding:8px 10px;margin-bottom:8px}
  .appt-table td{border:0;padding:2px 0}
  .appt-table td.t-time{float:right}
  .appt-table td.row-actions{display:block;padding-top:6px}
  .appt-table .btn.small,.appt-table button.small{padding:7px 12px}
}
.admin-tiles .tile>*{grid-column:1/-1!important;grid-row:auto!important;text-align:left;justify-self:start}

/* ---------- visibility pass (4 Nov 2026): larger text, stronger contrast, bigger touch targets ----------
   Everything sized in rem grows with the root size below. Paper layouts (prescription, its live
   preview, the PDF and anything printed) stay at 16px so the A4 sheet still fits one page. */
:root{--bg:#edf2f1;--muted:#475a5e;--line:#c8d6d3;--ink:#13252a}
html{font-size:17px}
@media (min-width:1200px){html{font-size:18px}}
@media (min-width:1600px){html{font-size:19px}}
html:has(.rx-sheet),html:has(body.embed){font-size:16px}
@media print{html{font-size:16px!important}}
body{font-size:1rem;line-height:1.55}
.muted{color:var(--muted)}
label{font-size:.92rem;color:#3d5055}
input,select,textarea{border-color:#b9c9c6}
input:hover,select:hover,textarea:hover{border-color:#94aaa6}
:focus-visible{outline:3px solid var(--teal);outline-offset:2px}
button.quiet,.btn.quiet{border-color:#b9c9c6}
header.top nav a{color:#3f5256}
header.top nav a:hover{color:var(--ink)}
/* small text: nothing on screen smaller than about 13px */
th,.pill,.status,.panel-title .num,.step .num,.rcard h3,.draft-tag,.carried,.hcard b,.flag,.kind,
h3.label,.eyebrow,.cal-grid th,.patient-strip dt,.clinic-stats dt,.queue-table .pill.small,
.dash-tiles .tile small,.fu-actions .btn,.fu-actions button,.cost-pop .cost-problem{font-size:.78rem}
th{color:#3f5256;letter-spacing:.04em}
.patient-strip dt,.clinic-stats dt,h3.label,.rcard h3{letter-spacing:.04em;color:#46595d}
.small,.fu-row,.back-link{font-size:.88rem}
.rx-flag,.rx-suggest,.chip.quiet-chip,.lite-tools .chip,#testChips .chip{font-size:.85rem}
.panel-title .num,.step .num{width:24px;height:24px}
.dash-tiles .tile span{font-size:.88rem}
.dash-tiles .tile b{font-size:1.55rem}
.dash-tiles .tile{border-color:#d3dfdc}
table{font-size:.95rem}
.step{font-size:1rem}
.step.on{border-color:#9fcac3;font-weight:600}
/* consultation: bigger writing area text, readable patient strip */
textarea{line-height:1.6}
.step-panel[data-panel=plan] textarea{font-size:.92rem}
@media (min-width:901px){
  body.fit-screen .patient-strip dt{font-size:.72rem}
  body.fit-screen .patient-strip dd{font-size:.95rem}
}
/* touch screens (phones, tablets): finger-sized buttons and fields */
@media (pointer:coarse){
  button,.btn{min-height:42px}
  input,select{min-height:44px}
  button.small,.btn.small,.fu-actions .btn,.fu-actions button{min-height:36px}
  .chip{min-height:36px}
}
/* phones: the menu sits on one line that slides sideways instead of taking three rows */
@media (max-width:700px){
  header.top{flex-wrap:nowrap}
  header.top nav{flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none;gap:4px;min-width:0}
  header.top nav::-webkit-scrollbar{display:none}
  header.top nav>a,header.top nav>details,header.top nav>form{flex:none;white-space:nowrap}
  header.top nav>a,header.top .nav-menu summary{font-size:.95rem}
  .patient-strip dd{font-size:1rem}
  .nav-menu>div{position:fixed;left:12px;right:12px;top:52px;min-width:0}
  .nav-menu>div a{padding:10px 12px}
}
/* keep the queue's action buttons on screen on a 1366-wide laptop */
.queue-table td.who{min-width:150px}
.queue-table td.row-actions .btn,.queue-table td.row-actions button{padding:5px 10px;font-size:.88rem}
@media (max-width:1400px){.queue-table td.row-actions{white-space:normal;min-width:150px}}
/* consultation on laptop screens: compact recorder so the writing box keeps its room */
@media (min-width:901px){
  body.fit-screen .rec-buttons{gap:6px}
  body.fit-screen .rec-buttons button{padding:7px 12px;font-size:.92rem}
  body.fit-screen .recorder p{font-size:.9rem}
}
@media (min-width:901px) and (max-height:820px){.cal-grid a{padding:1px 0}.cal-grid td,.cal-grid th{padding:2px 4px}}
/* phones: section tabs in a neat 3 + 3 grid; queue rows become cards so the buttons are never off screen */
@media (max-width:900px){
  .steps{display:grid;grid-template-columns:repeat(6,1fr);gap:6px}
  .steps .step{grid-column:span 1;min-width:0;font-size:.9rem;padding:6px 2px;gap:2px;flex-direction:column;white-space:nowrap;overflow:hidden}
  .steps .step-finish{grid-column:span 3;justify-self:stretch}
  .patient-strip{grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}
}
@media (max-width:700px){
  .steps .step{grid-column:span 2;font-size:.88rem}
  header.top{position:relative}
  header.top nav{padding-right:28px}
  header.top::after{content:"";position:absolute;right:0;top:0;bottom:0;width:32px;pointer-events:none;background:linear-gradient(to right,rgba(255,255,255,0),#fff)}
}
@media (max-width:640px){
  .queue-table,.queue-table tbody,.queue-table tr,.queue-table td{display:block;width:auto}
  .queue-scroll{border:0;border-radius:0}
  .queue-table tr:has(th){display:none}
  .queue-table tr{border:1px solid var(--line);border-radius:8px;padding:8px 10px;margin:0 0 8px}
  .queue-table td{border:0;padding:2px 0;min-width:0!important}
  .queue-table td:nth-child(3)::before{content:"Ref: ";color:var(--muted)}
  .queue-table td.row-actions{text-align:left;white-space:normal;padding-top:6px}
  .queue-table td.row-actions>*{margin:2px 6px 2px 0}
}
/* use more of a laptop screen for ordinary pages; placeholders readable but clearly not real entries */
main{max-width:1100px}
::placeholder{color:#7f9093;opacity:1}
/* short laptop screens: the calendar + follow-ups column scrolls instead of hiding follow-ups */
@media (min-width:901px) and (min-height:560px){body.home-fit .dash-side{overflow-y:auto}}
.dash-tiles .tile svg{width:38px;height:38px;padding:8px}
/* short laptop screens (1366x768 Windows, browser bars take ~110px): one step smaller and
   tighter help text, so the notes box stays in view without scrolling the section */
@media (min-width:901px) and (max-height:760px){
  html{font-size:17px}
  body.fit-screen .step-panel p.muted.small{font-size:.8rem;line-height:1.35;margin:2px 0}
  body.fit-screen .recorder{padding:6px 8px}
  body.fit-screen .steps .step{padding-top:6px;padding-bottom:6px}
}
/* laptop screens up to ~900px tall: the long 'Speak naturally…' help sentence hides (its Sort / Tidy
   buttons stay) and the recorder's status sits beside its pill, so the notes box keeps its room */
@media (min-width:901px) and (max-height:900px){
  body.fit-screen .lite-tools>p.muted.small{font-size:0;margin:0}
  body.fit-screen .lite-tools>p.muted.small>button{font-size:.85rem;margin-right:10px}
  body.fit-screen .recorder p{flex:1 1 200px;font-size:.85rem}
}

/* ---------- admin: logins of a clinic, separate admin login ---------- */
.login-list{list-style:none;padding:0;margin:.5rem 0}
.login-list li{display:flex;justify-content:space-between;align-items:center;gap:.5rem;flex-wrap:wrap;padding:.4rem 0;border-bottom:1px solid #e6e2da}
.login-list li.is-blocked b{text-decoration:line-through;color:#9b2c20}
.admin-setup{border:2px solid #c9a227}
.setup-key{font-size:1.05rem;letter-spacing:.06em;word-break:break-all;background:#f5f1e6;padding:.1rem .35rem;border-radius:4px}
.brand small{font-size:.7em;font-weight:400;opacity:.8}
.login-list button.danger{background:#fff;border:1px solid #9b2c20;color:#9b2c20}
.login-list button.danger:hover{background:#fde8e6}

/* ---------- my brand list: speciality generics with the doctor's brands ---------- */
.bl-head{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;align-items:flex-end}
.bl-head-actions{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.bl-count{font-size:.9rem;color:var(--muted)}.bl-count b{color:var(--teal)}
.bl-help{display:block}.bl-help summary{cursor:pointer}.bl-help ul{margin:8px 0 0;padding-left:18px;display:grid;gap:4px}
.bl-tools{display:flex;gap:12px;flex-wrap:wrap;align-items:center;position:sticky;top:0;z-index:5}
.bl-tools input[type=search]{flex:1 1 260px}
.bl-cat>summary{display:flex;justify-content:space-between;align-items:center;gap:10px;cursor:pointer;list-style:none}
.bl-cat>summary::-webkit-details-marker{display:none}
.bl-cat>summary h2{margin:0;font-size:1.05rem}.bl-cat>summary h2::before{content:"▸ ";color:var(--teal)}
.bl-cat[open]>summary h2::before{content:"▾ "}
.bl-table{margin-top:8px}.bl-table td{vertical-align:middle;padding-top:6px;padding-bottom:6px}
.bl-table th:first-child{width:32%}
.bl-form{display:inline-block;min-width:34px;font-size:.75rem;padding:1px 6px;border-radius:6px;background:var(--teal-soft);color:var(--teal);text-align:center}
.bl-brands{display:flex;flex-wrap:wrap;gap:6px;align-items:center;min-height:30px}
.bl-chip{position:relative}
.bl-chip>summary{list-style:none;cursor:pointer;padding:3px 10px;border-radius:999px;background:var(--teal);color:#fff;font-size:.88rem;font-weight:600}
.bl-chip>summary::-webkit-details-marker{display:none}.bl-chip>summary small{font-weight:400;opacity:.85}
.bl-pop{position:absolute;z-index:10;top:calc(100% + 4px);left:0;background:var(--paper);border:1px solid var(--line);border-radius:10px;padding:10px;display:grid;gap:8px;min-width:220px;box-shadow:0 6px 20px rgba(0,0,0,.12)}
.bl-pop form{display:grid;gap:6px}
.bl-add{display:flex;gap:6px;align-items:center}
.bl-add input[name=names]{flex:1;min-width:110px}
.bl-add .bl-co{width:120px}.bl-add .bl-num{width:76px}.bl-add .bl-num[name=pack_size]{width:52px}
.bl-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
@media (max-width:760px){
  .bl-table tr:first-child{display:none}
  .bl-table tr{display:grid;grid-template-columns:1fr;gap:4px;padding:8px 0;border-bottom:1px solid var(--line)}
  .bl-table td{border:0;padding:0}.bl-brands-cell:empty{display:none}
  .bl-add{flex-wrap:wrap}.bl-add input[name=names]{flex:1 1 100%}
  .bl-add .bl-co{flex:1 1 100%;width:auto}.bl-add .bl-num{flex:1}.bl-add button{flex:1}
  .bl-pair{grid-template-columns:1fr 1fr}
  .bl-tools{position:static}
}

/* ---------- listening and writing indicators (6 Nov): the interview recorder, Dictate buttons, tab dots ----------
   Only transform/opacity move, so old Windows PCs and phones stay smooth; "reduce motion" stops it all. */
:root{--rec:#d92d20;--rec-soft:#fdecea;--violet:#4b4fc4;--violet-soft:#ecebfb;--ok-glow:#e3f2e5;--warn:#b25e09;--warn-soft:#fdf0e1}
.recorder{display:grid;grid-template-columns:auto minmax(0,1fr);gap:8px 14px;align-items:center;padding:10px 12px;border-radius:12px;border:1px solid transparent;transition:background .4s,border-color .4s}
.recorder p{margin:0}
.rec-row{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px}
.recorder .rec-buttons{margin-left:auto;justify-content:flex-end;gap:6px}
.recorder .rec-buttons:not(:has(button:not([hidden]))){display:none}
.rec-orb{position:relative;width:52px;height:52px;border-radius:50%;padding:0;display:grid;place-items:center;border:0;background:var(--teal);color:#fff;justify-self:center;box-shadow:0 2px 8px rgba(14,107,102,.25)}
.rec-orb:disabled{opacity:1;cursor:default}
.rec-orb svg{width:24px;height:24px;position:relative;z-index:2;display:none}
.rec-orb .ring{position:absolute;inset:0;border-radius:50%;border:2px solid var(--rec);opacity:0;pointer-events:none}
.rec-orb .halo{position:absolute;inset:-4px;border-radius:50%;opacity:0;pointer-events:none;background:conic-gradient(from 0deg,var(--teal),var(--violet),var(--teal) 60%,transparent 62%,transparent);-webkit-mask:radial-gradient(circle,transparent 58%,#000 60%);mask:radial-gradient(circle,transparent 58%,#000 60%)}
.recorder[data-rec=idle] .i-mic,.recorder[data-rec=listen] .i-mic,.recorder[data-rec=quiet] .i-mic,.recorder[data-rec=pause] .i-play,.recorder[data-rec=gen] .i-spark,.recorder[data-rec=ready] .i-tick,.recorder[data-rec=error] .i-alert{display:block}
.rec-mid{display:grid;gap:4px;min-width:0}
.rec-head{display:flex;flex-wrap:wrap;gap:4px 10px;align-items:center}
.rec-head b{font-size:1rem}
.rec-wave{height:26px;flex:1 1 140px;min-width:100px;display:none;align-items:center;gap:3px;overflow:hidden}
.rec-wave i{flex:1 1 0;max-width:6px;min-width:2px;height:100%;border-radius:3px;background:var(--rec);transform:scaleY(.1);transition:transform .08s linear}
.rec-steps{display:none;flex-wrap:wrap;gap:6px}
.rec-steps .chip{display:inline-flex;align-items:center;gap:6px;font-size:.78rem;padding:2px 10px;border-radius:999px;background:#fff;color:var(--muted);border:1px solid var(--line)}
.rec-steps .chip.done{background:var(--ok-soft);color:var(--ok);border-color:transparent}
.rec-steps .chip.done::before{content:"✓"}
.rec-steps .chip.now{background:#fff;color:var(--violet);border-color:#c9c9f2;font-weight:600}
.rec-steps .chip.now::before{content:"";width:9px;height:9px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:stage-spin .8s linear infinite}
/* listening */
.recorder[data-rec=listen],.recorder[data-rec=quiet]{background:var(--rec-soft);border-color:#f3c5bf}
.recorder[data-rec=listen] .rec-orb,.recorder[data-rec=quiet] .rec-orb{background:var(--rec);box-shadow:0 2px 10px rgba(217,45,32,.3)}
.recorder[data-rec=listen] .ring{animation:rec-ripple 2.4s ease-out infinite}
.recorder[data-rec=listen] .ring.r2{animation-delay:1.2s}
.recorder[data-rec=quiet] .ring{animation:rec-ripple 4s ease-out infinite}
.recorder[data-rec=listen] .rec-wave,.recorder[data-rec=quiet] .rec-wave{display:flex}
.recorder[data-rec=quiet] .rec-wave i{background:#eba49c}
/* no sound meter in this browser: the bars move by themselves */
.recorder.no-level[data-rec=listen] .rec-wave i{animation:rec-bar 1s ease-in-out infinite}
.recorder.no-level .rec-wave i:nth-child(3n){animation-delay:-.3s}.recorder.no-level .rec-wave i:nth-child(3n+1){animation-delay:-.6s}.recorder.no-level .rec-wave i:nth-child(4n){animation-duration:1.4s}
/* paused */
.recorder[data-rec=pause]{background:#eef1f2}
.recorder[data-rec=pause] .rec-orb{background:var(--muted)}
/* writing the notes */
.recorder[data-rec=gen]{background:var(--violet-soft);border-color:#d6d5f5}
.recorder[data-rec=gen] .rec-orb{background:#fff;color:var(--violet)}
.recorder[data-rec=gen] .halo{opacity:1;animation:stage-spin 1.6s linear infinite}
.recorder[data-rec=gen] .i-spark{animation:rec-twinkle 1.6s ease-in-out infinite}
.recorder[data-rec=gen] .rec-steps{display:flex}
/* done */
.recorder[data-rec=ready]{background:var(--ok-soft)}
.recorder[data-rec=ready] .rec-orb{background:var(--ok);animation:rec-pop .5s cubic-bezier(.3,1.6,.5,1)}
/* problem */
.recorder[data-rec=error]{background:var(--warn-soft);border-color:#f0cfa6;animation:rec-nudge .4s ease-in-out}
.recorder[data-rec=error] .rec-orb{background:var(--warn)}
.stage.working{background:var(--violet-soft);color:var(--violet)}
/* notes boxes while SAHDOC writes, and a short green glow when the words land */
textarea.ai-writing{background-image:linear-gradient(100deg,rgba(75,79,196,0) 30%,rgba(75,79,196,.09) 50%,rgba(75,79,196,0) 70%);background-size:250% 100%;background-repeat:no-repeat;animation:rec-shimmer 1.4s ease-in-out infinite;border-color:#c9c9f2}
textarea.ai-filled{border-color:var(--ok);box-shadow:0 0 0 3px var(--ok-glow);transition:box-shadow .6s,border-color .6s}
/* Dictate buttons */
button.dictate,#resultsDictate{display:inline-flex;align-items:center;gap:6px;justify-content:center;transition:background .25s,color .25s,border-color .25s}
button.dict-live{background:var(--rec);border-color:var(--rec);color:#fff}
button.dict-work,button.dict-work:disabled{background:var(--violet-soft);border-color:transparent;color:var(--violet);opacity:1}
button.dict-work::before{content:"";width:9px;height:9px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:stage-spin .8s linear infinite}
button.dict-done{background:var(--ok-soft);border-color:transparent;color:var(--ok)}
.mini{display:inline-flex;align-items:center;gap:2px;height:14px}
.mini i{width:3px;height:100%;border-radius:2px;background:currentColor;animation:rec-bar .9s ease-in-out infinite}
.mini i:nth-child(2){animation-delay:-.2s}.mini i:nth-child(3){animation-delay:-.5s}.mini i:nth-child(4){animation-delay:-.35s}.mini i:nth-child(5){animation-delay:-.65s}
/* section tabs: red dot while recording, violet ring while writing */
.step[data-state=listening]::after{content:"";width:9px;height:9px;border-radius:50%;background:var(--rec);animation:stage-pulse 1.2s infinite}
.step[data-state=working]::after{border-color:var(--violet);border-right-color:transparent}
@keyframes rec-ripple{0%{transform:scale(1);opacity:.55}100%{transform:scale(1.7);opacity:0}}
@keyframes rec-bar{0%,100%{transform:scaleY(.25)}50%{transform:scaleY(1)}}
@keyframes rec-twinkle{50%{transform:scale(.82) rotate(12deg)}}
@keyframes rec-pop{0%{transform:scale(.7)}100%{transform:scale(1)}}
@keyframes rec-nudge{25%{transform:translateX(-4px)}75%{transform:translateX(4px)}}
@keyframes rec-shimmer{0%{background-position:120% 0}100%{background-position:-120% 0}}
@media (max-width:640px){
  .recorder .rec-buttons{margin-left:0;justify-content:flex-start}
  .rec-orb{width:46px;height:46px}
}
@media (min-width:901px) and (max-height:900px){
  body.fit-screen .recorder{padding:6px 10px;gap:4px 12px}
  body.fit-screen .rec-orb{width:44px;height:44px}
  body.fit-screen .rec-orb svg{width:20px;height:20px}
  body.fit-screen .rec-wave{height:20px}
}
@media (prefers-reduced-motion:reduce){
  .recorder,.recorder *,.mini i,button.dict-work::before,textarea.ai-writing,.step::after{animation:none!important;transition:none!important}
  .recorder[data-rec=listen] .ring{opacity:.45;transform:scale(1.2)}
}

/* ---------- voice and AI buttons (6 Nov): easy to spot at a glance ----------
   Teal pill with a white mic = speak. Violet pill with a sparkle and an "AI" tag = AI help (uses credits). */
.voice-btn{display:inline-flex;align-items:center;gap:8px;padding:5px 14px 5px 5px;border-radius:999px;border:0;
  background:linear-gradient(135deg,#0e6b66,#139a8f);color:#fff;font:600 .9rem var(--sans);letter-spacing:.01em;
  box-shadow:0 2px 8px rgba(14,107,102,.32),inset 0 1px 0 rgba(255,255,255,.18);transition:transform .15s,box-shadow .15s,background .25s}
.voice-btn::before{content:"";flex:none;width:26px;height:26px;border-radius:50%;
  background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230e6b66' stroke-width='2.2' stroke-linecap='round'%3E%3Crect x='9' y='3' width='6' height='11' rx='3'/%3E%3Cpath d='M5 11a7 7 0 0 0 14 0M12 18v3'/%3E%3C/svg%3E") center/15px no-repeat}
.voice-btn:hover{transform:translateY(-1px);box-shadow:0 4px 14px rgba(14,107,102,.38)}
.voice-btn:focus-visible{outline:3px solid #9fd8d1;outline-offset:2px}
button.voice-btn.dict-live{background:linear-gradient(135deg,#c4271b,#e5483a);box-shadow:0 0 0 0 rgba(217,45,32,.45);animation:voice-live 1.6s ease-out infinite}
button.voice-btn.dict-live::before{display:none}
button.voice-btn.dict-live{padding-left:14px}
button.voice-btn.dict-work,button.voice-btn.dict-work:disabled{background:linear-gradient(135deg,#ecebfb,#f3f2fd);color:var(--violet);box-shadow:none;padding-left:12px}
button.voice-btn.dict-work::before{display:none}
button.voice-btn.dict-done{background:var(--ok-soft);color:var(--ok);box-shadow:none;padding-left:12px}
button.voice-btn.dict-done::before{display:none}
@keyframes voice-live{0%{box-shadow:0 0 0 0 rgba(217,45,32,.45)}100%{box-shadow:0 0 0 10px rgba(217,45,32,0)}}

.ai-btn{position:relative;display:inline-flex;align-items:center;gap:7px;padding:7px 12px 7px 10px;border-radius:999px;
  border:1px solid transparent;color:#fff;font:600 .9rem var(--sans);
  background:linear-gradient(90deg,#4b4fc4,#8a55d3 50%,#4b4fc4);background-size:200% 100%;
  box-shadow:0 2px 8px rgba(75,79,196,.3),inset 0 1px 0 rgba(255,255,255,.2);transition:transform .15s,box-shadow .15s,background-position .4s}
.ai-btn::before{content:"";flex:none;width:16px;height:16px;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M12 2l1.9 5.6 5.6 1.9-5.6 1.9L12 17l-1.9-5.6-5.6-1.9 5.6-1.9zM19 15l.9 2.1 2.1.9-2.1.9L19 21l-.9-2.1-2.1-.9 2.1-.9z'/%3E%3C/svg%3E") center/contain no-repeat}
.ai-btn::after{content:"AI";font:700 .62rem var(--sans);letter-spacing:.06em;padding:1px 6px;border-radius:999px;background:rgba(255,255,255,.22);color:#fff}
.ai-btn:hover{transform:translateY(-1px);background-position:100% 0;box-shadow:0 4px 14px rgba(75,79,196,.38)}
.ai-btn:focus-visible{outline:3px solid #c9c9f2;outline-offset:2px}
.ai-btn:disabled,.ai-btn.busy{cursor:progress;opacity:1;animation:ai-busy 1.6s linear infinite}
.ai-btn:disabled::before,.ai-btn.busy::before{animation:rec-twinkle 1.2s ease-in-out infinite}
.ai-btn.ai-mini{padding:4px 10px 4px 8px;font-size:.82rem;gap:5px}
.ai-btn.ai-mini::before{width:13px;height:13px}
@keyframes ai-busy{0%{background-position:0 0}100%{background-position:-200% 0}}
/* what the AI returns: a soft violet "reference" panel, clearly not part of the record */
.dx-suggestions,.tx-suggestions{border:1px solid #d6d5f5;background:linear-gradient(180deg,#f6f5fe,#fff 70%);border-radius:10px;padding:12px 14px}
.dx-suggestions::before,.tx-suggestions::before{content:"✦ AI reference for the doctor · check before use";font:700 .7rem var(--sans);letter-spacing:.07em;text-transform:uppercase;color:var(--violet)}
.dx-suggestions .chip:hover{border-color:var(--violet)}
@media (max-width:640px){.dx-tools .ai-btn,.favs .ai-btn{width:100%;justify-content:center}}
@media (prefers-reduced-motion:reduce){.voice-btn,.ai-btn,.ai-btn::before{animation:none!important;transition:none!important}}

/* ---------- step 6: advice, plan and follow-up ---------- */
.step-panel[data-panel=plan] .panel-heading{font-size:1.2rem}
body.fit-screen .step-panel[data-panel=plan] textarea[id^=note-]{min-height:0}
#note-plan{min-height:3.2em;resize:vertical}
#note-advice{min-height:5em}
.fu-block{display:grid;gap:6px;margin-top:4px}
.fu-chips{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:0}
.fu-label{font-weight:600;margin-right:2px}
.fu-chips .chip.on{background:var(--teal);border-color:var(--teal);color:#fff}
.fu-date{display:inline-flex;align-items:center;gap:4px;cursor:pointer}
.fu-date input{border:0;padding:0;background:transparent;font:inherit;color:inherit;max-width:9.5em}
.fu-booked{display:flex;flex-wrap:wrap;gap:6px 12px;align-items:center;background:var(--ok-soft);color:var(--ok);border-radius:8px;padding:6px 10px;font-size:.9rem;font-weight:500;margin:0}
.fu-time{display:inline-flex;gap:4px;align-items:center;color:var(--ink);font-weight:400}
.fu-time input{padding:2px 6px}
.fu-booked .linklike{color:var(--ok)}
.fu-hint{margin:0}
.advice-quick{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:6px}
.advice-dialog{width:min(860px,calc(100vw - 24px));max-height:calc(100vh - 40px);border:1px solid var(--line);border-radius:12px;padding:14px;box-sizing:border-box}
.advice-dialog::backdrop{background:rgba(10,30,30,.35)}
.advice-dialog-head{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:10px;position:sticky;top:-14px;background:var(--paper);padding:4px 0}
.advice-dialog-head h2{font-size:1.1rem;flex:1 1 auto}
.advice-dialog .advice-pick{margin:0}
.proc-add{display:flex;flex-wrap:wrap;gap:8px 12px;align-items:center;border:1px dashed var(--line);border-radius:8px;padding:8px 10px}
.procedure-form .grow2{flex:2 1 240px}
.proc-more summary{cursor:pointer;color:var(--teal);margin:2px 0 6px}
.proc-more>.procedure-form{margin-top:6px}
@media (max-width:600px){.advice-dialog{padding:10px}.fu-date input{max-width:8.5em}}
.rx-plan .rx-next{margin-top:4px}.rx-plan p.pre{margin:0 0 2px}
@media (max-width:900px){.steps .step[data-step=plan]{white-space:normal;line-height:1.15;text-align:center}}
@media (max-width:700px){
  .procedure-form>.chips .chip:nth-child(n+5){display:none}
}
/* step 6: one mic hint; advice in three tick groups (General, condition, procedure) */
.one-mic{margin:-4px 0 0}
.advice-groups{display:grid!important;grid-template-columns:1fr!important;gap:6px;padding:0;border:0}
.advice-groups>details{border:1px solid var(--line);border-radius:8px;padding:6px 10px;display:grid;gap:4px}
.advice-groups>details[open]{padding-bottom:10px}
.advice-groups summary{cursor:pointer;font-size:.92rem}
.advice-groups .group-count{color:var(--ok);font-weight:500}
.procedure-plan{margin-top:6px}
.procedure-plan .section-head h3{font-family:var(--serif);font-size:1rem;margin:0}
.one-mic{display:grid;gap:2px;background:var(--teal-soft);border-radius:8px;padding:8px 12px;margin:0}
.one-mic p{margin:0}.one-mic .example{font-style:italic}
.group-tools{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:2px 0 4px}
.one-mic summary{cursor:pointer;color:var(--teal)}

/* ---------- calendar: types, day / week / month views (Nov 2026) ---------- */
.k-consult{--k:#0e6b66;--ks:#e2f0ee}
.k-follow_up{--k:#1d5fa8;--ks:#e8f1fb}
.k-procedure{--k:#8a5a00;--ks:#fdf1d8}
.k-surgery{--k:#a8324a;--ks:#fbe6ea}
.chip i,.kdot{display:inline-block;width:10px;height:10px;border-radius:3px;background:var(--k,var(--muted));margin-right:5px;vertical-align:-1px}
a.chip{text-decoration:none}
.kind-pick{border:0;padding:0;margin:0;min-width:0}
.kind-pick legend{font-size:.9rem;color:var(--muted);padding:0;margin-bottom:4px}
.kind-pick label.chip{display:inline-flex;align-items:center;color:var(--ink)}
.kind-pick input{position:absolute;opacity:0;width:1px;height:1px}
.kind-pick label.chip:has(input:checked){background:var(--ks);border-color:var(--k);font-weight:600}
.kind-pick label.chip:has(input:focus-visible){outline:2px solid var(--k);outline-offset:2px}
label.chip.tick{display:inline-flex;align-items:center;gap:5px;color:var(--ink)}
label.chip.tick input{margin:0}
label.chip.tick:has(input:checked){background:#e3f2e5;border-color:#2f7a3c}
.op-fields{display:grid;gap:10px;grid-template-columns:repeat(auto-fit,minmax(160px,1fr))}
.free-row{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-top:6px}
.free-row .chips{gap:4px}
.cal-card{gap:10px}
.cal-bar{display:flex;flex-wrap:wrap;gap:6px 8px;align-items:center}
.cal-bar .day-pick{margin:0}.cal-bar .day-pick input{padding:5px 8px}
.view-tabs{display:inline-flex;border:1px solid var(--line);border-radius:8px;overflow:hidden;margin-right:auto}
.view-tabs a{padding:6px 14px;text-decoration:none;color:var(--muted);font-weight:600;font-size:.92rem}
.view-tabs a.on{background:var(--teal);color:#fff}
.cal-title{display:flex;flex-wrap:wrap;gap:6px 12px;align-items:center}
.cal-title h2{font-size:1.15rem}
.cal-title .day-counts{width:auto}
.type-filter{gap:6px}
.type-filter .chip.on{background:var(--ink);border-color:var(--ink);color:#fff}
.closed-day{background:#edf1f0;color:var(--muted)}
/* day: one row per booking, free gap or break, in time order */
.agenda{display:grid;gap:6px;max-height:calc(100vh - 290px);min-height:240px;overflow-y:auto;padding-right:2px}
.ag{border:1px solid var(--line);border-left:4px solid var(--k);border-radius:8px;background:var(--paper)}
.ag-line{display:grid;grid-template-columns:20px 104px minmax(0,1fr) auto;gap:2px 10px;align-items:center;padding:3px 10px;min-height:38px;font-size:.92rem}
details.ag>summary{list-style:none;cursor:pointer}
details.ag>summary::-webkit-details-marker{display:none}
details.ag[open]>summary{border-bottom:1px dashed var(--line)}
.ag-num{font-size:.75rem;color:var(--muted);font-variant-numeric:tabular-nums}
.ag-time{font-variant-numeric:tabular-nums;white-space:nowrap;font-size:.9rem}
.ag-time span{color:var(--muted)}
.ag-who{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ag-sub{color:var(--muted);font-size:.85rem}
.kpill{display:inline-block;font-size:.72rem;font-weight:600;padding:0 7px;border-radius:999px;background:var(--ks);color:var(--k);margin:0 4px}
.preop{color:#8a5a00;font-weight:600;font-size:.78rem;margin-left:4px}.preop.all-done{color:#2f7a3c}
.ag-act{display:flex;gap:5px;align-items:center;justify-content:flex-end}
.ag-act .btn.small,.ag-act .status{padding:2px 9px;font-size:.8rem}
.ag-dots{display:inline-grid;place-items:center;width:28px;height:24px;border:1px solid var(--line);border-radius:6px;color:var(--ink);font-weight:700;line-height:1}
details.ag[open] .ag-dots{background:var(--teal-soft);border-color:var(--teal)}
.ag-detail{display:grid;gap:10px;padding:8px 12px 10px 34px}
.ag-detail .row-actions form{display:inline-block}
.preop-form{display:grid;gap:6px}
.move-row{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.move-row .chip{font-weight:400}
.ag.row-off{opacity:.6}
.ag-visit{background:var(--bg)}
.ag-range{border:1px solid var(--line);border-radius:8px;overflow:hidden;display:grid;flex:none}
.agenda{grid-auto-rows:max-content}
.ag-act a.small.muted{font-size:.75rem;max-width:90px;line-height:1.2;text-align:right}
.ag-range .ag{border-width:1px 0 0 4px;border-radius:0;border-top-color:var(--line)}
.ag-range-head{display:flex;flex-wrap:wrap;gap:4px 12px;align-items:center;padding:4px 10px;background:#edf1f0;font-size:.86rem}
.ag-range-head b{font-variant-numeric:tabular-nums}
.ag-range-head .meter{flex:0 1 120px;height:6px;border-radius:3px;background:var(--line);overflow:hidden}
.ag-range-head .meter span{display:block;height:100%;background:var(--teal)}
.ag-add{margin-left:auto;background:transparent;border:0;color:var(--teal);font-weight:600;font-size:.86rem;padding:2px 4px}
.ag-add:hover{text-decoration:underline}
.ag-free{display:block;width:100%;text-align:left;background:transparent;border:1px dashed #b9c9c6;color:var(--teal);font-weight:600;font-size:.9rem;padding:7px 12px;border-radius:8px}
.ag-free:hover:not(:disabled){background:var(--teal-soft)}
.ag-free:disabled{color:var(--muted);cursor:default}
.ag-break{font-size:.85rem;color:var(--muted);padding:6px 12px;border-radius:8px;background:repeating-linear-gradient(135deg,#edf1f0 0 6px,transparent 6px 12px)}
/* week */
.week-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px}
.wk-day{border:1px solid var(--line);border-radius:8px;padding:6px;display:grid;gap:4px;align-content:start;min-height:200px;min-width:0}
.wk-day.today{border-color:var(--teal);box-shadow:inset 0 0 0 1px var(--teal)}
.wk-day.off{background:repeating-linear-gradient(135deg,#edf1f0 0 6px,transparent 6px 12px)}
.wk-head{display:flex;justify-content:space-between;text-decoration:none;color:var(--ink);font-size:.9rem}
.wk-head+.wk-item,.wk-item{display:block;background:var(--ks);border-left:3px solid var(--k);border-radius:4px;padding:2px 6px;font-size:.8rem;line-height:1.35;color:var(--ink);text-decoration:none;overflow-wrap:anywhere}
/* month */
.month-grid{table-layout:fixed;border-collapse:separate;border-spacing:3px;min-width:560px}
.month-grid th{font-size:.75rem;text-align:center;border:0;padding:2px}
.month-grid td{border:1px solid var(--line);border-radius:6px;padding:0;vertical-align:top;height:78px}
.month-grid td a{display:grid;gap:1px;align-content:start;height:100%;padding:4px 6px;text-decoration:none;color:var(--ink);font-size:.8rem;font-variant-numeric:tabular-nums}
.month-grid td a:hover{background:var(--teal-soft)}
.month-grid .n{font-weight:600}
.month-grid td.other{opacity:.45}
.month-grid td.today{border-color:var(--teal);box-shadow:inset 0 0 0 1px var(--teal)}
.month-grid td.off{background:repeating-linear-gradient(135deg,#edf1f0 0 6px,transparent 6px 12px)}
.mc{display:flex;align-items:center;gap:3px;white-space:nowrap;overflow:hidden}
.mc i{width:8px;height:8px;border-radius:2px;background:var(--k);flex:none}
.mc em{font-style:normal;color:var(--muted)}
/* home's small calendar: one coloured dot per type booked */
.cal-grid .kdots{position:absolute;left:0;right:0;bottom:2px;display:flex;justify-content:center;gap:2px}
.cal-grid .kdots b,.kdots-legend b{display:inline-block;width:5px;height:5px;border-radius:50%;background:var(--k)}
.cal-grid a.sel .kdots b{box-shadow:0 0 0 1px #fff}
.kdots-legend b{width:7px;height:7px;margin:0 2px 0 6px}
.kdots-legend b:first-child{margin-left:0}
.cal-foot{flex-wrap:wrap}
/* settings, reminders, OT list */
.hours-row{display:flex;flex-wrap:wrap;gap:8px 12px;align-items:end}
.hours-row>span{min-width:70px;padding-bottom:10px}
.dur-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px}
.dur-grid label span{color:var(--ink);font-weight:600}
.leave-form{display:flex;flex-wrap:wrap;gap:10px;align-items:end}
.leave-form .grow{flex:1 1 200px}
.leave-warn{margin-top:6px;padding:8px 10px;border-radius:8px;background:#fdf1d8;display:grid;gap:4px}
.leave-who{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.sent-tag{color:#2f7a3c;font-weight:600}
.ot-head{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;border-bottom:2px solid var(--ink);padding-bottom:8px}
.ot-head h1{font-size:1.3rem}
.ot-date{text-align:right}
.ot-table th{font-size:.8rem}
.ot-table td{vertical-align:top}
@media print{.ot-sheet{border:0;padding:0}.ot-table{font-size:12px}}
/* tablets and phones */
@media (max-width:900px){.agenda{max-height:none}}
@media (max-width:760px){
  .week-grid{grid-template-columns:1fr}
  .wk-day{min-height:0;grid-template-columns:repeat(auto-fill,minmax(130px,1fr))}
  .wk-head{grid-column:1/-1}
  .wk-day.off{display:flex;gap:8px;align-items:center}
}
@media (max-width:640px){
  .ag-line{grid-template-columns:16px minmax(0,1fr) auto;grid-template-rows:auto auto;row-gap:0;padding-block:4px}
  .ag-num{grid-row:1/3}
  .ag-time{grid-column:2;font-size:.82rem}
  .ag-who{grid-column:2;grid-row:2}
  .ag-act{grid-column:3;grid-row:1/3}
  .ag-act a.wa,.ag-act a.small.muted{display:none}
  .ag-time{overflow:hidden;text-overflow:ellipsis}
  .ag-time:empty{display:none}
  .ag-time:empty+.ag-who{grid-row:1/3}
  .ag-range-head{flex-wrap:nowrap}.ag-range-head .meter{flex:1 1 40px}
  .ag-add{white-space:nowrap}
  .ag-act .btn.small{padding:6px 10px}
  .ag-detail{padding-left:12px}
  .move-row .chip{padding:7px 12px}
  .view-tabs{margin-right:0;width:100%}.view-tabs a{flex:1;text-align:center}
  .mc em{display:none}
  .month-grid{min-width:0}.month-grid td{height:58px}
  .ot-table thead{display:none}
  .ot-table,.ot-table tbody,.ot-table tr,.ot-table td{display:block}
  .ot-table tr{border:1px solid var(--line);border-radius:8px;padding:6px 10px;margin-bottom:8px}
  .ot-table td{border:0;padding:2px 0}
}

/* booking form: time range or exact time */
.slot-pick{display:grid;gap:8px}
.slot-seg{display:inline-flex;border:1px solid var(--line);border-radius:8px;overflow:hidden;justify-self:start}
.slot-seg label{display:block;padding:6px 14px;cursor:pointer;color:var(--muted);font-weight:600;font-size:.9rem}
.slot-seg input{position:absolute;opacity:0;width:1px;height:1px}
.slot-seg label:has(input:checked){background:var(--teal);color:#fff}
.slot-seg label:has(input:focus-visible){outline:2px solid var(--teal);outline-offset:-2px}
.range-chips label.chip{display:inline-flex;gap:5px;align-items:baseline;color:var(--ink);font-variant-numeric:tabular-nums}
.range-chips input{position:absolute;opacity:0;width:1px;height:1px}
.range-chips small{color:var(--muted);font-size:.75rem}
.range-chips label.chip:has(input:checked){background:var(--teal);border-color:var(--teal);color:#fff}
.range-chips label.chip:has(input:checked) small{color:#e2f0ee}
.range-chips label.chip.full small{color:var(--red)}
.op-fields .wide{grid-column:1/-1}
.mode-table{width:100%}
.mode-table td,.mode-table th{padding:6px 8px;vertical-align:middle}
.mode-table .chips{flex-wrap:nowrap}
.mode-table label.chip{display:inline-flex;gap:4px;align-items:center;color:var(--ink)}
.mode-table label.chip input{margin:0}
.mode-table label.chip:has(input:checked){background:var(--teal-soft);border-color:var(--teal);font-weight:600}

/* Send desk: many WhatsApp messages, one chat after another */
.sd-bar{gap:12px}
.sd-controls{display:flex;flex-wrap:wrap;gap:10px 18px;align-items:center}
.sd-controls .check{display:flex;gap:6px;align-items:center;color:var(--ink);font-size:.95rem}
.sd-mode{display:flex;gap:6px;align-items:center;margin-left:auto}
.sd-mode select{padding:4px 8px;font-size:.88rem}
.sd-go{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.sd-go .muted{flex:1 1 260px}
button.sd-send{background:#1f9d55;border-color:#1f9d55;border-radius:999px;padding:11px 22px;font-size:1rem}
button.sd-send:disabled{opacity:.45;cursor:default}
.sd-progress{height:6px;background:var(--line);border-radius:3px;overflow:hidden}
.sd-progress i{display:block;height:100%;background:#1f9d55;transition:width .3s}
.sd-group h2 .muted{font-family:var(--sans);font-weight:400}
.sd-list{display:grid;border:1px solid var(--line);border-radius:8px;overflow:hidden}
.sd-list .empty{margin:0;padding:12px}
.sd-row{display:grid;grid-template-columns:22px minmax(0,1fr) auto;gap:10px;align-items:center;padding:9px 12px;border-top:1px solid var(--line);border-left:4px solid var(--teal)}
.sd-row:first-child{border-top:0}
.sd-reminder{border-left-color:#3a78c9}.sd-missed{border-left-color:#b86e00}
.sd-pick{width:18px;height:18px;accent-color:#1f9d55;padding:0}
.sd-who{min-width:0;display:grid}
.sd-who span{color:var(--muted);font-size:.85rem;overflow-wrap:anywhere}
.sd-act{display:flex;flex-wrap:wrap;gap:6px;align-items:center;justify-content:flex-end}
.sd-tick{display:none;color:#1f7a3f;font-weight:600;font-size:.88rem;white-space:nowrap}
.sd-undo{padding:0 4px;font-size:.78rem;font-weight:400;background:none;border:0;color:var(--muted);text-decoration:underline}
.sd-row.done{background:#f1f8f3}
.sd-row.done .sd-tick{display:inline}
.sd-row.done .sd-btn{display:none}
.sd-row.cur{background:#e4f5ea;box-shadow:inset 0 0 0 2px #1f9d55}
@media (max-width:600px){.sd-row{grid-template-columns:22px minmax(0,1fr)}.sd-act{grid-column:2;justify-content:flex-start}.sd-mode{margin-left:0}
  button.sd-send{width:100%}}
@media (prefers-reduced-motion:reduce){.sd-progress i{transition:none}}

/* ---------- existing patients: list grouped by day, and the patient card ---------- */
.lab{font-size:.74rem;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);font-weight:600}
.tag{display:inline-block;font-size:.78rem;font-weight:600;padding:1px 8px;border-radius:4px;background:#eef2f1;color:#3f5054;white-space:nowrap}
.tag.fu,.tag.next{background:#e3eef8;color:#1d5a80}
.tag.nw,.tag.new{background:var(--ok-soft);color:var(--ok)}
.tag.up{background:#fdf0e3;color:#8a4b0f}
.tag.down{background:#e3eef8;color:#1d5a80}
.tag.stop{background:var(--red-soft);color:var(--red)}
.ok-text{color:var(--ok)}
.pl-filter{gap:10px}
.pl-search{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:end}
.pl-when{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.pl-when .chip{font-weight:600}
.pl-day{display:flex;flex-direction:row;align-items:center;gap:6px;font-size:.82rem;margin-left:6px}
.pl-day input{padding:3px 6px}
#when_day{display:none}
.pl-list{gap:6px}
.pl-day-head{font-size:1rem;margin-top:10px;padding-bottom:4px;border-bottom:2px solid var(--teal-soft);display:flex;gap:8px;align-items:baseline}
.pl-day-head .muted{font:400 .85rem var(--sans)}
.pl-row{display:grid;grid-template-columns:minmax(200px,1.1fr) 1.4fr auto;gap:6px 14px;align-items:center;padding:9px 0;border-bottom:1px solid var(--line)}
.pl-who{display:flex;flex-direction:column;text-decoration:none;color:var(--ink);min-width:0}
.pl-who b{color:var(--teal)}
.pl-who .muted{font-size:.85rem}
.pl-what{display:flex;flex-wrap:wrap;gap:6px;align-items:center;font-size:.88rem;min-width:0}
.pl-dx{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
.pl-act{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
@media (max-width:700px){.pl-row{grid-template-columns:1fr}.pl-act{justify-content:flex-start}.pl-act .btn{padding:8px 14px}.pl-day{margin-left:0}}
main:has(.pv-strip){max-width:1220px}
.pv-strip{display:flex;flex-wrap:wrap;gap:14px;justify-content:space-between;align-items:center}
.pv-who{display:grid;gap:6px;min-width:0}
.pv-name{display:flex;flex-wrap:wrap;gap:4px 12px;align-items:baseline}
.pv-contact{font-size:.9rem;color:#3f5054}
.pv-chips{display:flex;flex-wrap:wrap;gap:6px}
.pv-chips .chip{cursor:default;background:#eef2f1;border-color:#eef2f1;color:#3f5054;text-decoration:none}
.pv-chips .chip.ok{background:var(--ok-soft);border-color:var(--ok-soft);color:var(--ok)}
.pv-chips .chip.warn{background:#fdf0e3;border-color:#fdf0e3;color:#7a420c}
.pv-actions{display:flex;flex-wrap:wrap;gap:8px}
.pv-actions .btn{text-decoration:none}
.pv-alerts{display:flex;flex-wrap:wrap;gap:10px}
.pv-alert{flex:1 1 320px;border-radius:8px;padding:9px 14px;display:flex;flex-wrap:wrap;gap:8px 12px;align-items:center;justify-content:space-between}
.pv-alert.amber{background:#fdf0e3;color:#7a420c}
.pv-alert.red{background:var(--red-soft);color:var(--red)}
.pv-alert.plain{background:transparent;padding:0 2px;flex:0 1 auto}
.pv-alert summary{cursor:pointer;color:var(--teal)}
.pv-alert-edit{display:flex;gap:6px;margin-top:6px}
.pv-alert-edit input{width:min(360px,70vw)}
.pv-row-btns{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.pv-grid{display:flex;flex-wrap:wrap;gap:16px;align-items:flex-start}
.pv-col{flex:1 1 380px;display:grid;gap:16px;min-width:0}
.pv-history{flex:1.4 1 480px;min-width:0}
.pv-head{display:flex;flex-wrap:wrap;gap:8px;justify-content:space-between;align-items:center}
.pv-filter{display:flex;gap:6px}
.pv-dx1{font-weight:600}
.pv-med{display:flex;flex-wrap:wrap;justify-content:space-between;gap:2px 12px;padding:7px 0;border-bottom:1px solid #eef2f1;font-size:.93rem}
.pv-med:last-child{border-bottom:0}
.pv-med-when{white-space:nowrap}
.pv-vitals{display:grid;grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:10px;font-size:.93rem}
.pv-line{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px;font-size:.92rem}
.pv-visit{display:grid;grid-template-columns:84px 1fr;gap:12px;padding:11px 0;border-bottom:1px solid #eef2f1;font-size:.93rem}
.pv-visit:last-of-type{border-bottom:0}
.pv-date{display:flex;flex-direction:column}
.pv-body{display:grid;gap:4px;min-width:0}
.pv-tags,.pv-links{display:flex;flex-wrap:wrap;gap:6px 12px;align-items:center}
.pv-tags{gap:6px}
.pv-history .pv-visit.old{display:none}
.pv-history.show-old .pv-visit.old{display:grid}
.pv-history.only-changed .pv-visit:not(.has-change){display:none}
.pv-fold summary{cursor:pointer;font-weight:600}
.pv-fold[open]{gap:14px}
@media (max-width:640px){.pv-actions .btn{flex:1 1 auto;text-align:center}.pv-visit{grid-template-columns:62px 1fr;gap:8px}}
.plain-list{list-style:none;margin:6px 0;padding:0}.plain-list li{padding:4px 0;border-bottom:1px solid var(--line,#eee)}

/* ---------- SAHDOC logo ---------- */
.login-logo{margin:0 0 14px}
.login-logo img{display:block;width:100%;max-width:300px;height:auto}
.rx-legal .rx-made{height:11px;width:auto;vertical-align:middle;margin-left:8px;opacity:.75}
@media (max-width:640px){header.top .brand img{height:24px}}

/* ---------- phones and tablets ---------- */
/* Consultation on a phone: the patient line stays short, so the sections start on the first screen.
   The full details are one tap away on the patient's name. */
@media (max-width:900px){
  body.fit-screen .consult-head{padding:8px 12px;gap:8px}
  body.fit-screen .consult-title>div:first-child{display:none}
  body.fit-screen .consult-meta{gap:6px}
  body.fit-screen .consult-meta>.pill:not(.credit-pill){display:none}
  body.fit-screen .patient-strip{display:flex;flex-wrap:wrap;gap:4px 14px;padding:6px 10px}
  body.fit-screen .patient-strip div{border:0;padding:0}
  body.fit-screen .patient-strip dt{display:none}
  body.fit-screen .patient-strip div:nth-child(n+4){display:none}
  body.fit-screen .patient-strip div:nth-child(1) dd{font-weight:400;color:var(--muted)}
}
/* The top menu scrolls sideways on a narrow screen instead of being cut off. */
@media (max-width:700px){
  header.top{padding:8px 12px;gap:8px;flex-wrap:nowrap}
  header.top .brand img{height:30px}
  header.top nav{flex-wrap:nowrap;overflow-x:auto;gap:14px;-webkit-overflow-scrolling:touch;scrollbar-width:none;min-width:0}
  header.top nav::-webkit-scrollbar{display:none}
  header.top nav>*{flex:none;white-space:nowrap}
  header.top .nav-menu>div{position:fixed;top:50px;right:8px;max-height:75vh;overflow-y:auto}
}
/* Touch screens: every button and fold-out is at least 40 px tall, so a finger hits it. */
@media (pointer:coarse){
  button,.btn,a.button,input[type=submit]{min-height:40px}
  button.small,.btn.small,.lang-switch button,.ai-mini,.ag-add{min-height:40px;padding-top:6px;padding-bottom:6px}
  .linklike{min-height:40px}
  summary{min-height:40px;display:flex;align-items:center;cursor:pointer}
}

/* signature card in Settings */
.sign-img{display:block;max-height:70px;max-width:260px;background:#fff;border:1px solid var(--line);padding:6px;border-radius:6px}
.sign-current{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.sign-upload{display:flex;flex-direction:column;gap:8px;align-items:flex-start}
.sign-preview{display:flex;flex-direction:column;gap:6px}
.sign-preview .sign-img{max-height:90px;max-width:320px}
.sign-strength{display:flex;align-items:center;gap:8px}.sign-strength input{width:170px;margin:0}

/* paying SAHDOC for credits or a plan */
.pay-box p{margin:.3em 0}
.pay-ways{display:flex;gap:18px;flex-wrap:wrap;align-items:flex-start;margin:8px 0}
.pay-upi{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.pay-upi img{background:#fff;border:1px solid var(--line);border-radius:8px;padding:6px}
.pay-bank{background:var(--card,#fff);border:1px solid var(--line);border-radius:8px;padding:10px 12px;line-height:1.6}
.pay-done{display:flex;gap:8px;align-items:flex-end;flex-wrap:wrap;margin:8px 0}
.pay-done input{max-width:240px}
.pay-form{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:10px;align-items:end}
.access-list{display:grid;gap:8px}.access-list label.check{display:flex;gap:8px;align-items:flex-start;line-height:1.35;color:var(--ink)}.access-list input{width:auto;flex:none;margin-top:3px}
.fees-switch{display:flex;gap:8px;align-items:flex-start;color:var(--ink)}.fees-switch input{width:auto;flex:none;margin-top:3px}
