/* VoiceXP Booking 06. Mobile first. Light and dark. One accent, big type, big targets. */
@font-face { font-family: 'Manrope'; src: url(../fonts/manrope.woff2) format('woff2'); font-weight: 200 800; font-style: normal; font-display: swap; }

:root {
  --canvas: #f2f2f2; --bg: #ffffff; --card: #ffffff; --tile: #f3f3f3; --ink: #0b0b0b; --muted: #626262; --line: #e4e4e4;
  --accent: #1f6f6a; --accent-ink: #ffffff; --accent-soft: #e5f1f0;
  --rec: #e5352f; --live: #0a9b4f; --live-ink: #ffffff; --live-soft: rgba(10, 155, 79, .34); --live-edge: rgba(10, 155, 79, .26);
  --amber: #f0a500; --closed: #2b2b2b;
  --warn-bg: #fff3d1; --warn-ink: #5a4300; --ok: #12843f; --off: #8b8b8b;
  --radius: 22px; --gap: 12px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --bar-h: 88px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 8px 22px rgba(0, 0, 0, .06);
  --kw: 84px; --kh: 156px; --kr: 24px; --kb: 44px;
  --col: 100vw; --pad: 20px;
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
:root[data-clinic="physio"] { --accent: #3b5bdb; --accent-soft: #e6ebff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #000000; --bg: #131313; --card: #1b1b1b; --tile: #1f1f1f; --ink: #f6f6f6; --muted: #a2a2a2; --line: #2c2c2c;
    --accent: #5cc5bc; --accent-ink: #04201d; --accent-soft: #14302d;
    --rec: #ff5a52; --live: #2fd77a; --live-ink: #04210f; --live-soft: rgba(47, 215, 122, .34); --live-edge: rgba(47, 215, 122, .22);
    --amber: #ffbf2e; --closed: #cfcfcf;
    --warn-bg: #3a2f10; --warn-ink: #ffe3a1; --ok: #55c27a; --off: #707070;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 22px rgba(0, 0, 0, .45);
  }
  :root[data-clinic="physio"]:not([data-theme="light"]) { --accent: #8aa2ff; --accent-soft: #1e2749; --accent-ink: #0b1233; }
}
:root[data-theme="dark"] {
  --canvas: #000000; --bg: #131313; --card: #1b1b1b; --tile: #1f1f1f; --ink: #f6f6f6; --muted: #a2a2a2; --line: #2c2c2c;
  --accent: #5cc5bc; --accent-ink: #04201d; --accent-soft: #14302d;
  --rec: #ff5a52; --live: #2fd77a; --live-ink: #04210f; --live-soft: rgba(47, 215, 122, .34); --live-edge: rgba(47, 215, 122, .22);
  --amber: #ffbf2e; --closed: #cfcfcf;
  --warn-bg: #3a2f10; --warn-ink: #ffe3a1; --ok: #55c27a; --off: #707070;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 22px rgba(0, 0, 0, .45);
}
@media (min-width: 720px) { :root { --col: 680px; --kb: 48px; } }
@media (min-width: 1100px) { :root { --col: 960px; } }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  background: var(--canvas); color: var(--ink);
  font: 500 16px/1.4 var(--font);
  display: flex; flex-direction: column; height: 100dvh; overflow: hidden; overscroll-behavior: none;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body[data-layout="flow"] { display: block; height: auto; min-height: 100dvh; overflow: auto; }
button, input, select, summary { font: inherit; color: inherit; }
button { cursor: pointer; }
.ic { width: 22px; height: 22px; display: block; flex: 0 0 auto; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a { color: var(--accent); }

/* ---------- header ---------- */
.top { width: 100%; max-width: var(--col); margin: 0 auto; padding: calc(12px + var(--safe-t)) var(--pad) 12px; }
.toprow { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.02em; cursor: pointer; min-width: 0; }
.brand span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; border-radius: 13px; background: var(--ink); color: var(--canvas); font-size: 14px; font-weight: 800; letter-spacing: 0; }
.menubtn { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--bg); color: var(--ink); display: grid; place-items: center; box-shadow: var(--shadow); flex: 0 0 auto; }
.statusrow { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; min-height: 36px; }
.statusbtn { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0; border: 0; background: transparent; font-size: 14px; font-weight: 700; color: var(--ink); text-align: left; }
.statusbtn .chd { width: 16px; height: 16px; color: var(--muted); }
.statusbtn[aria-expanded="true"] .chd { transform: rotate(180deg); }
.sdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--off); flex: 0 0 auto; }
.sdot.s-open { background: var(--live); box-shadow: 0 0 0 4px var(--live-soft); }
.sdot.s-closing { background: var(--amber); box-shadow: 0 0 0 4px rgba(240, 165, 0, .28); }
.sdot.s-closed { background: var(--closed); }
.welcome { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.statuspop { position: absolute; left: 0; top: 100%; z-index: 50; width: min(320px, calc(100vw - 2 * var(--pad))); margin-top: 6px; padding: 16px; border-radius: 22px; background: var(--bg); box-shadow: 0 14px 40px rgba(0, 0, 0, .22); border: 1px solid var(--line); animation: pop .16s ease-out; }
.sp-date { margin: 0 0 8px; font-size: 14px; font-weight: 800; }
.sp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.sp-list li { display: grid; grid-template-columns: 14px 1fr auto; align-items: center; gap: 10px; min-height: 40px; font-size: 15px; }
.sp-name { font-weight: 700; }
.sp-time { color: var(--muted); font-weight: 600; font-size: 14px; }
.sp-more { margin-top: 8px; width: 100%; min-height: 44px; border-radius: 14px; border: 0; background: var(--tile); font-weight: 700; font-size: 14px; }

/* ---------- the white panel ---------- */
.panel { flex: 1; min-height: 0; width: 100%; max-width: var(--col); margin: 0 auto; display: flex; flex-direction: column; background: var(--bg); border-radius: 30px 30px 0 0; box-shadow: 0 -10px 36px rgba(0, 0, 0, .07); overflow: hidden; position: relative; }
body[data-layout="flow"] .panel { overflow: visible; }
@media (min-width: 720px) {
  body { padding-bottom: 22px; }
  .panel { border-radius: 30px; box-shadow: 0 10px 44px rgba(0, 0, 0, .09); }
}

/* ---------- search ---------- */
.searchwrap { padding: 20px var(--pad) 4px; z-index: 5; }
.search { position: relative; }
.search input {
  width: 100%; height: 58px; border: 0; border-radius: 20px; background: var(--tile); color: var(--ink);
  padding: 0 60px 0 20px; font-size: 17px; font-weight: 600; letter-spacing: -.01em;
}
.search input::placeholder { color: var(--muted); font-weight: 500; }
.search input:focus-visible { outline: 3px solid var(--ink); outline-offset: 0; }
.search.hasclear input { padding-left: 48px; }
.search.hasok input { padding-right: 96px; }
.search input.done { color: var(--muted); }
.dictate { position: absolute; right: 0; top: 0; width: 58px; height: 58px; border: 0; background: transparent; color: var(--ink); display: grid; place-items: center; border-radius: 20px; }
.dictate.on { color: var(--live); animation: pulse 1s ease-in-out infinite; }
.qclear { position: absolute; left: 6px; top: 0; width: 42px; height: 58px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; }
.qclear .ic { width: 18px; height: 18px; }
.qok { position: absolute; right: 56px; top: 0; height: 58px; width: 32px; display: grid; place-items: center; color: var(--ok); }
.qok .ic { width: 20px; height: 20px; }

.chips { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 1 0 auto; min-height: 42px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--tile); font-weight: 700; font-size: 15px; }
.chip.on { background: var(--ink); color: var(--bg); }
@media (max-width: 430px) { .chip { padding: 0 12px; font-size: 14.5px; } .chips { gap: 6px; } }
@media (max-width: 380px) { .chip { padding: 0 9px; font-size: 14px; } }

.crumbs { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 2px 0; margin: 10px 0 0; padding: 0; font-size: 14px; align-items: center; }
.crumbs li { display: inline-flex; align-items: center; }
.crumbs li + li::before { content: '\203A'; color: var(--muted); margin: 0 8px; font-weight: 700; }
.crumbs button { border: 0; background: transparent; color: var(--muted); font-weight: 700; font-size: 14px; min-height: 34px; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.crumbs [aria-current] { font-weight: 800; color: var(--ink); }
.crumbfilter { width: 38px; height: 38px; margin-top: 8px; border: 0; border-radius: 12px; background: var(--tile); color: var(--ink); display: grid; place-items: center; flex: 0 0 auto; }
.crumbfilter .ic { width: 18px; height: 18px; }

.suggest { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.suggest button { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--tile); font-size: 14px; font-weight: 600; }
.recent { display: grid; gap: 2px; padding: 8px; border-radius: 20px; background: var(--tile); margin-top: 8px; }
.recent .rh { margin: 4px 10px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.recent button { display: block; width: 100%; text-align: left; min-height: 46px; padding: 0 12px; border: 0; border-radius: 12px; background: transparent; font-size: 15px; font-weight: 600; }
.recent button:hover { background: var(--bg); }
.recent .rclear { color: var(--muted); font-size: 13px; }

/* ---------- stage ---------- */
.stage { flex: 1; min-height: 0; overflow-y: auto; padding: 0 var(--pad) calc(var(--bar-h) + var(--kh) + 56px + var(--safe-b)); outline: none; -webkit-overflow-scrolling: touch; }
body[data-layout="flow"] .stage { overflow: visible; }
body[data-view="home"] .stage { display: flex; flex-direction: column; padding-bottom: calc(var(--kb) + var(--safe-b)); }
body[data-view="home"] .view { flex: 1; display: flex; flex-direction: column; }

.caption { font-size: 24px; line-height: 1.25; font-weight: 700; letter-spacing: -.015em; margin: 12px 0; padding: 14px 16px; border-radius: 20px; background: var(--tile); transition: opacity .2s, box-shadow .12s; min-height: 3.2em; }
.caption.live { box-shadow: 0 0 0 3px var(--live); }
.caption .interim { opacity: .5; font-weight: 600; }
.caption mark { background: var(--accent-soft); color: var(--ink); border-radius: 8px; padding: 0 5px; box-shadow: inset 0 -3px 0 var(--accent); animation: pop .28s ease-out; }
.caption .ph { color: var(--muted); font-weight: 600; }
.caption.working::after { content: 'Working\2026'; display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-top: 4px; }
.notice { background: var(--warn-bg); color: var(--warn-ink); border-radius: 18px; padding: 12px 14px; margin: 12px 0 0; font-size: 14px; font-weight: 600; }
/* on the landing, the live words take over the voice band beside the knob */
body[data-view="home"] .caption { position: fixed; z-index: 28; left: calc(var(--pad) + max(0px, (100vw - var(--col)) / 2)); right: calc(var(--kr) + var(--kw) + 16px + max(0px, (100vw - var(--col)) / 2)); bottom: calc(var(--kb) + var(--safe-b)); height: var(--kh); display: flex; align-items: center; margin: 0; padding: 0; background: transparent; box-shadow: none; min-height: 0; overflow: hidden; }
body[data-view="home"] .caption.working::after { display: none; }
body[data-view="home"] .notice { margin-top: 16px; }

.view h2 { font-size: 24px; letter-spacing: -.02em; font-weight: 800; margin: 20px 0 6px; }
.sub { color: var(--muted); font-size: 14px; font-weight: 500; margin: 0 0 10px; }
.hint-line { font-size: 14px; color: var(--muted); margin: 10px 0 4px; font-weight: 600; }
.fade-in { animation: fade .18s ease-out; }

/* ---------- landing ---------- */
.home { padding-top: 2px; flex: 1; display: flex; flex-direction: column; }
.sectlabel { margin: 22px 0 12px; font-size: 14px; font-weight: 800; letter-spacing: -.005em; }
.sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stile { display: flex; align-items: center; gap: 12px; min-height: 70px; padding: 12px 16px 12px 12px; border-radius: 22px; border: 0; background: var(--tile); text-align: left; font-size: 17px; font-weight: 800; letter-spacing: -.015em; transition: transform .12s ease; }
.stile:active { transform: scale(.97); }
.stile .si { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--bg); flex: 0 0 auto; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.stile .si .ic { width: 22px; height: 22px; }
.lastchip { display: flex; align-items: baseline; gap: 8px; margin-top: 14px; min-height: 46px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--accent-soft); font-weight: 700; font-size: 15px; align-self: flex-start; }
.lastchip small { color: var(--muted); font-weight: 600; }
.voiceband { margin-top: auto; padding: 28px calc(var(--kr) + var(--kw) + 14px) 0 0; min-height: calc(var(--kh) + 28px); display: flex; flex-direction: column; justify-content: center; gap: 10px; transition: opacity .2s; }
body.listening[data-view="home"] .voiceband { opacity: 0; }
.orsay { margin: 0; font-size: 14px; font-weight: 700; color: var(--muted); }
.rot { display: grid; }
.exline { grid-area: 1 / 1; border: 0; background: transparent; text-align: left; font-size: 21px; line-height: 1.22; font-weight: 700; letter-spacing: -.02em; color: var(--ink); padding: 4px 0; opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; pointer-events: none; }
.exline.on { opacity: .6; transform: none; pointer-events: auto; }
.exline.out { transform: translateY(-12px); }
.exline.on:hover { opacity: .95; }
@media (min-width: 720px) { .voiceband { padding-right: calc(var(--kr) + var(--kw) + 24px); } .exline { font-size: 24px; } }
@media (min-width: 1100px) { .sections { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stile .sl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 380px) { .stile { padding: 10px 8px; gap: 8px; font-size: 15px; } .stile .si { width: 36px; height: 36px; } .stile .si .ic { width: 20px; height: 20px; } .sections { gap: 10px; } }
@media (max-height: 660px) { .sectlabel { margin-top: 14px; } .stile { min-height: 60px; } .exline { font-size: 19px; } .voiceband { padding-top: 12px; } }

/* a quiet sound line fills the space above the voice band; it moves faster and turns green while listening */
.wave { flex: 1 1 0; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 6px; overflow: hidden; }
.wave i { display: block; width: 4px; height: 56px; border-radius: 2px; background: var(--ink); opacity: .12; transform: scaleY(calc(.12 + var(--h) * .28)); animation: wv 3.2s ease-in-out infinite; animation-delay: calc(var(--i) * -110ms); transition: background .2s, opacity .2s; }
body.listening .wave i { background: var(--live); opacity: .9; animation-duration: .8s; }
@keyframes wv { 0%, 100% { transform: scaleY(calc(.12 + var(--h) * .2)); } 50% { transform: scaleY(calc(.2 + var(--h) * .75)); } }
@media (max-height: 760px) { .wave { display: none; } }
@media (min-width: 720px) { .wave { gap: 8px; } .wave i { width: 5px; } }

/* ---------- doctor cards ---------- */
.docs { display: grid; gap: 12px; margin-top: 10px; }
.docs > .offduty, .docs > .closedcard, .docs > .empty { grid-column: 1 / -1; }
@media (min-width: 1100px) { .docs { grid-template-columns: 1fr 1fr; } }
.doc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); text-align: left; width: 100%; }
.doc.tappable { cursor: pointer; transition: transform .12s ease; }
.doc.tappable:active { transform: scale(.985); }
.dcard { display: grid; gap: 8px; }
.dcard .doc-top, .doc-top { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px 10px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--tile); color: var(--ink); display: grid; place-items: center; font-weight: 800; font-size: 14px; flex: 0 0 auto; }
.doc-name { all: unset; font-size: 19px; font-weight: 800; letter-spacing: -.02em; cursor: pointer; flex: 1 1 130px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-name:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
.apill { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 13px; font-weight: 800; white-space: nowrap; }
.apill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.apill.yes { background: #dff5e7; color: #0c6a33; }
.apill.no { background: var(--tile); color: var(--muted); }
.dlines { display: grid; gap: 3px; padding-left: 54px; }
.dline { font-size: 15px; font-weight: 600; }
.dline.next { font-weight: 800; }
.doc-meta { font-size: 14px; color: var(--muted); font-weight: 600; }
.dtags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-left: 54px; }
.dtags .grow { flex: 1; }
.doc .go { font-size: 26px; color: var(--muted); line-height: 1; margin-left: 4px; }
.tag { display: inline-block; font-size: 12.5px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: var(--tile); color: var(--ink); margin-right: 4px; }
.tag.b-morning { background: #fff0c2; color: #5a4300; } .tag.b-afternoon { background: #dcefff; color: #0d3a63; } .tag.b-evening { background: #e8e2ff; color: #2c2060; }
.tag.muted { background: transparent; color: var(--muted); border: 1.5px dashed var(--muted); padding: 1.5px 9px; }
.cue { font-size: 12.5px; font-weight: 800; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.cue.few { background: var(--warn-bg); color: var(--warn-ink); } .cue.soon { background: var(--accent-soft); color: var(--accent); }
.dcard.off { opacity: .94; }
.offduty { margin-top: 12px; }
.offduty summary { cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.offduty .doc { margin-top: 10px; }
.closedcard { text-align: center; }
.soonest { display: grid; gap: 3px; text-align: left; width: 100%; min-height: 64px; padding: 12px 16px; border-radius: 20px; border: 0; background: var(--ink); color: var(--bg); margin: 10px 0 12px; font-size: 16px; font-weight: 700; }
.soonest b { color: var(--live); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 18px; background: var(--tile); margin: 8px 0 10px; }
.seg { min-height: 44px; border: 0; border-radius: 14px; background: transparent; font-weight: 800; font-size: 14.5px; color: var(--muted); }
.seg.on { background: var(--bg); box-shadow: var(--shadow); color: var(--ink); }
.bk-title { margin-bottom: 0; }
.withdoc { margin: 2px 0 12px; font-size: 21px; color: var(--ink); font-weight: 500; }
.withdoc b { font-weight: 800; }
.headcard { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.headcard .hc-text { display: grid; gap: 3px; }

/* booking tabs, slots, calendar */
.tabs { display: flex; gap: 8px; margin: 10px 0; align-items: stretch; }
.tab { flex: 1; min-height: 52px; border-radius: 16px; border: 0; background: var(--tile); font-weight: 800; padding: 4px 8px; line-height: 1.15; }
.tab small { display: block; font-weight: 600; font-size: 12px; color: var(--muted); }
.tab.on { background: var(--ink); color: var(--bg); }
.tab.on small { color: inherit; opacity: .8; }
.tab.cal { flex: 0 0 52px; width: 52px; padding: 0; display: grid; place-items: center; }
.tab.cal.pillmode { flex: 1; width: auto; }
.group { font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 16px 0 8px; }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 720px) { .slots { grid-template-columns: repeat(4, 1fr); } }
.slot { position: relative; min-height: 56px; border-radius: 16px; border: 0; background: var(--tile); font-weight: 800; font-size: 16px; padding: 6px 4px; line-height: 1.15; }
.slot small { display: block; font-weight: 600; font-size: 11px; color: var(--muted); }
.slot.want { box-shadow: 0 0 0 2px var(--ink); }
.slot.sel { background: var(--ink); color: var(--bg); }
.slot.sel small { color: inherit; }
.slot .badge { position: absolute; top: -7px; right: 6px; background: var(--ink); color: var(--bg); font-size: 10px; font-weight: 800; padding: 1px 7px; border-radius: 999px; }
.more-btn { margin-top: 10px; width: 100%; min-height: 48px; border-radius: 16px; border: 1.5px dashed var(--line); background: transparent; color: var(--muted); font-weight: 700; }
.empty { text-align: center; color: var(--muted); padding: 28px 8px; font-weight: 600; }
.empty button { margin-top: 10px; min-height: 48px; padding: 0 18px; border-radius: 16px; border: 0; background: var(--tile); color: var(--ink); font-weight: 800; }
.cal { background: var(--tile); border-radius: 22px; padding: 12px; margin: 10px 0; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-head button { min-width: 44px; min-height: 44px; border: 0; background: transparent; font-size: 22px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-dow { font-size: 11px; color: var(--muted); padding: 2px 0; font-weight: 700; }
.cal-day { position: relative; min-height: 42px; border-radius: 12px; border: 0; background: transparent; font-size: 15px; font-weight: 700; }
.cal-day.closed { color: var(--off); opacity: .5; }
.cal-day.has::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--live); }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--ink); }
.cal-day.sel { background: var(--ink); color: var(--bg); }
.cal-day.sel::after { background: var(--bg); }
.cal-day:disabled { cursor: default; }

/* hours */
.bcard { display: grid; gap: 8px; }
.bhead { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.bhead strong { font-size: 20px; letter-spacing: -.02em; }
.opill { padding: 5px 11px; border-radius: 999px; font-size: 13px; font-weight: 800; white-space: nowrap; }
.opill.open { background: #dff5e7; color: #0c6a33; } .opill.shut { background: var(--tile); color: var(--muted); }
.hrows { display: grid; gap: 2px; margin-top: 4px; }
.hrow { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 12px 14px; border-radius: 16px; }
.hrow.today { background: var(--tile); }
.hday { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.hday em { font-style: normal; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--ink); background: var(--live-soft); border-radius: 999px; padding: 2px 8px; margin-left: 8px; }
.htime { font-size: 20px; font-weight: 700; text-align: right; letter-spacing: -.01em; }
.hrow.closed .htime, .hrow.closed .hday { color: var(--muted); font-weight: 700; }
@media (min-width: 1100px) { .bcard { grid-column: auto; } }

/* cards, forms, buttons */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 12px 0; box-shadow: var(--shadow); }
.card a { color: var(--accent); font-weight: 700; }
.field { display: grid; gap: 6px; margin: 10px 0; }
.field input { height: 54px; border-radius: 16px; border: 0; background: var(--tile); color: var(--ink); padding: 0 16px; font-size: 19px; font-weight: 600; letter-spacing: .02em; }
.btn { min-height: 54px; padding: 0 22px; border-radius: 999px; border: 0; background: var(--ink); color: var(--bg); font-weight: 800; font-size: 16px; }
.btn.secondary { background: var(--tile); color: var(--ink); }
.btn:disabled { opacity: .45; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.linklike { background: none; border: 0; padding: 4px 0; font: inherit; font-weight: 700; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.sms { background: #e4f4e4; color: #10240f; border-radius: 20px 20px 20px 6px; padding: 12px 14px; max-width: 92%; font-size: 15px; margin: 10px 0; }
.sms a, .sms button.linklike { color: inherit; text-decoration: underline; word-break: break-all; background: none; border: 0; padding: 0; font: inherit; text-align: left; }
.sms .time { display: block; font-size: 11px; opacity: .7; margin-top: 2px; }
.ok-box { border-left: 5px solid var(--live); }
.err { color: #b3261e; font-size: 14px; font-weight: 600; }
.big-check { width: 52px; height: 52px; border-radius: 50%; background: var(--live); color: var(--live-ink); display: grid; place-items: center; margin-bottom: 10px; }
.big-check .ic { width: 28px; height: 28px; }
dl.kv { margin: 10px 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; }
dl.kv dt { color: var(--muted); font-weight: 600; } dl.kv dd { margin: 0; font-weight: 800; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sms { background: #1c3a20; color: #dff3df; }
  :root:not([data-theme="light"]) .err { color: #ff8a80; }
  :root:not([data-theme="light"]) .apill.yes, :root:not([data-theme="light"]) .opill.open { background: #153a27; color: #7fe0a3; }
  :root:not([data-theme="light"]) .tag.b-morning { background: #3d3410; color: #ffe08a; }
  :root:not([data-theme="light"]) .tag.b-afternoon { background: #12304d; color: #a9d4ff; }
  :root:not([data-theme="light"]) .tag.b-evening { background: #2a2250; color: #cfc4ff; }
}
:root[data-theme="dark"] .sms { background: #1c3a20; color: #dff3df; }
:root[data-theme="dark"] .apill.yes, :root[data-theme="dark"] .opill.open { background: #153a27; color: #7fe0a3; }
:root[data-theme="dark"] .tag.b-morning { background: #3d3410; color: #ffe08a; }
:root[data-theme="dark"] .tag.b-afternoon { background: #12304d; color: #a9d4ff; }
:root[data-theme="dark"] .tag.b-evening { background: #2a2250; color: #cfc4ff; }

/* ---------- confirm bar ---------- */
.confirmbar { position: fixed; z-index: 20; bottom: 0; left: max(0px, calc((100vw - var(--col)) / 2)); right: max(0px, calc((100vw - var(--col)) / 2)); background: var(--bg); border-radius: 26px 26px 0 0; box-shadow: 0 -10px 36px rgba(0, 0, 0, .16); display: flex; align-items: center; gap: 12px; padding: 14px var(--pad) calc(14px + var(--safe-b)); min-height: var(--bar-h); }
.cb-text { flex: 1; min-width: 0; display: grid; font-size: 14px; }
.cb-text strong { font-size: 17px; font-weight: 800; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-text span { color: var(--muted); font-weight: 600; }
.cb-btn { min-height: 56px; padding: 0 28px; border-radius: 999px; border: 0; background: var(--ink); color: var(--bg); font-weight: 800; font-size: 17px; }

/* ---------- sheets (filters, info) ---------- */
.sheet, .isheet { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .46); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .2s; }
.sheet { opacity: 1; z-index: 60; }
.isheet.open { opacity: 1; }
.sheet-card, .isheet-card { width: 100%; max-width: 640px; max-height: 86dvh; overflow-y: auto; background: var(--bg); border-radius: 30px 30px 0 0; padding: 10px var(--pad) calc(24px + var(--safe-b)); }
.isheet-card { transform: translateY(40px); transition: transform .24s cubic-bezier(.2, .8, .2, 1); }
.isheet.open .isheet-card { transform: none; }
.isheet-grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 6px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sheet-head h2 { margin: 0; font-size: 26px; letter-spacing: -.025em; font-weight: 800; }
.icon-btn { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--tile); display: grid; place-items: center; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; }
.opt { min-height: 46px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--tile); font-size: 15px; font-weight: 700; }
.opt.on { background: var(--ink); color: var(--bg); }
.opt:disabled { opacity: .4; }
.opt em { font-style: normal; color: var(--muted); font-size: 12px; margin-left: 6px; font-weight: 600; }
.opt.on em { color: inherit; }
.is-lead { font-size: 18px; line-height: 1.45; font-weight: 500; margin: 4px 0 14px; }
.is-h { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 18px 0 8px; }
.is-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.is-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.is-t { display: grid; gap: 1px; min-width: 0; text-align: left; }
.is-t b { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.is-t small { font-size: 13.5px; color: var(--muted); font-weight: 600; }
.is-note { background: var(--warn-bg); color: var(--warn-ink); border-radius: 16px; padding: 10px 14px; font-size: 13.5px; font-weight: 600; margin: 4px 0 12px; }
.is-acc { background: var(--tile); border-radius: 20px; margin-bottom: 8px; padding: 0 16px; }
.is-acc summary { list-style: none; display: flex; align-items: center; justify-content: space-between; min-height: 56px; font-weight: 800; font-size: 17px; cursor: pointer; }
.is-acc summary::-webkit-details-marker { display: none; }
.is-acc summary .ic { width: 20px; height: 20px; color: var(--muted); transition: transform .2s; }
.is-acc[open] summary .ic { transform: rotate(180deg); }
.is-acc p { margin: 0 0 14px; font-size: 15px; line-height: 1.5; color: var(--ink); font-weight: 500; }
.is-card { background: var(--tile); border-radius: 22px; padding: 16px; margin-bottom: 12px; display: grid; gap: 8px; }
.is-card.last { background: var(--accent-soft); }
.is-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.is-row strong { font-size: 19px; letter-spacing: -.02em; }
.is-addr { margin: 0; font-size: 16px; font-weight: 600; }
.is-sub { margin: 0; font-size: 14px; color: var(--muted); font-weight: 600; }
.is-btn { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; padding: 0 18px; border-radius: 999px; border: 0; background: var(--bg); color: var(--ink); font-weight: 800; font-size: 16px; text-decoration: none; width: 100%; margin-bottom: 8px; }
.is-card .is-btn { margin-bottom: 0; }
.is-btn.solid { background: var(--ink); color: var(--bg); }
.is-btn.ghost { background: var(--tile); color: var(--ink); }
.is-card .is-btn.ghost { background: var(--bg); }
.is-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 72px; padding: 14px 18px; margin-bottom: 10px; border-radius: 22px; border: 0; background: var(--tile); text-align: left; }
.is-link > .ic { color: var(--muted); }
.is-edition { margin: 18px 0 0; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }

/* ---------- menu drawer ---------- */
.scrim { position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .42); opacity: 0; transition: opacity .22s; }
.scrim.open { opacity: 1; }
.dmenu { position: fixed; top: 0; right: 0; bottom: 0; z-index: 56; width: min(88vw, 380px); display: flex; flex-direction: column; background: var(--bg); border-radius: 30px 0 0 30px; box-shadow: -14px 0 44px rgba(0, 0, 0, .22); transform: translateX(100%); transition: transform .24s cubic-bezier(.2, .8, .2, 1); padding: calc(14px + var(--safe-t)) 0 calc(16px + var(--safe-b)); }
.dmenu.open { transform: none; }
.dm-head { display: flex; align-items: center; gap: 12px; padding: 4px 20px 14px; }
.dm-head strong { flex: 1; font-size: 19px; letter-spacing: -.02em; font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-list { display: grid; padding: 4px 12px; overflow-y: auto; }
.dm-item { display: flex; align-items: center; gap: 16px; min-height: 66px; padding: 0 12px; border: 0; border-radius: 20px; background: transparent; text-align: left; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.dm-item span { flex: 1; }
.dm-item .ic:last-child { color: var(--muted); width: 20px; height: 20px; }
.dm-item:hover, .dm-item:active { background: var(--tile); }
.dm-item.muted { font-size: 18px; color: var(--muted); }
.dm-sep { border: 0; border-top: 1px solid var(--line); margin: 10px 12px; }
.dm-foot { margin: auto 0 0; padding: 14px 24px 0; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
body.menu-open, body.sheet-open { overscroll-behavior: contain; }

/* ---------- the talk knob ---------- */
.knobwrap { position: fixed; z-index: 30; bottom: calc(var(--bar-h) + 40px + var(--safe-b)); touch-action: none; user-select: none; -webkit-user-select: none; }
body.no-bar .knobwrap { bottom: calc(var(--kb) + var(--safe-b)); }
.knobwrap.right { right: calc(var(--kr) + max(0px, (100vw - var(--col)) / 2)); }
.knobwrap.left { left: calc(var(--kr) + max(0px, (100vw - var(--col)) / 2)); }
/* the label is centred under the knob and never wider than the space beside it */
.knobwrap .lbl { text-wrap: balance; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 10px; width: 120px; text-align: center; white-space: normal; font-size: 13px; line-height: 1.2; font-weight: 800; color: var(--ink); pointer-events: none; }

.cap { position: relative; width: var(--kw); height: var(--kh); border-radius: calc(var(--kw) / 2); background: var(--tile); box-shadow: inset 0 0 0 1.5px var(--line), var(--shadow); transition: width .25s, height .25s, border-radius .25s; touch-action: none; }
.cap.small { width: 60px; height: 112px; border-radius: 30px; }
.cap .chev { position: absolute; left: 0; right: 0; top: 14px; display: grid; justify-items: center; gap: 0; color: var(--muted); pointer-events: none; }
.cap .chev .ic { width: 26px; height: 26px; margin-top: -13px; opacity: .35; }
.cap .chev .ic:first-child { margin-top: 0; }
body:not(.knob-learned) .cap:not(.small):not(.busy):not(.pressed) .chev .ic { animation: chev 1.5s ease-in-out infinite; }
body:not(.knob-learned) .cap .chev .ic:nth-child(3) { animation-delay: 0s; }
body:not(.knob-learned) .cap .chev .ic:nth-child(2) { animation-delay: .18s; }
body:not(.knob-learned) .cap .chev .ic:nth-child(1) { animation-delay: .36s; }
.cap.small .chev { top: 10px; }
.cap.small .chev .ic { width: 20px; height: 20px; }
.cap .notch { position: absolute; left: 12px; right: 12px; height: 0; border-top: 2px dashed var(--line); pointer-events: none; opacity: .9; }
.cap.small .notch { display: none; }
.cap .peg { position: absolute; bottom: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); opacity: .6; }
.cap .peg.c { left: 50%; margin-left: -4px; }
.cap.small .peg { display: none; }
.cap svg.ropes { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; opacity: 0; }
.cap svg.ropes path { stroke: var(--muted); stroke-width: 3; fill: none; stroke-linecap: round; }
.cap.small svg.ropes { display: none; }

.kb { position: absolute; left: 50%; width: 68px; height: 68px; margin-left: -34px; bottom: 5px; border-radius: 50%; border: 0; background: var(--ink); color: var(--bg); display: grid; place-items: center; box-shadow: 0 4px 0 rgba(0, 0, 0, .22), 0 10px 20px rgba(0, 0, 0, .25); touch-action: none; cursor: grab; z-index: 2; transition: transform .08s, box-shadow .08s, background .12s; }
.cap.small .kb { width: 48px; height: 48px; margin-left: -24px; }
.kb .ic { width: 30px; height: 30px; }
.cap.small .kb .ic { width: 22px; height: 22px; }
body:not(.knob-learned) .cap:not(.small):not(.busy):not(.pressed):not(.sliding) .kb { animation: ring 2.6s ease-out infinite; }
.halo { position: absolute; left: 50%; bottom: 5px; width: 68px; height: 68px; margin-left: -34px; border-radius: 50%; pointer-events: none; z-index: 1; opacity: 0; transition: opacity .2s; background: radial-gradient(circle, var(--live-soft) 0%, var(--live-soft) 38%, rgba(0, 0, 0, 0) 70%); transform: scale(1); }
.cap.small .halo { width: 48px; height: 48px; margin-left: -24px; }
.hold { position: relative; width: 72px; height: 72px; }
.hold.small { width: 56px; height: 56px; }
.hold .kb { left: 0; right: 0; bottom: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.hold .halo { left: 0; bottom: 0; margin: 0; width: 100%; height: 100%; }
.pressed .kb { transform: scale(.92) translateY(2px); box-shadow: inset 0 3px 8px rgba(0, 0, 0, .3), 0 0 0 4px var(--live); background: var(--live); color: var(--live-ink); transition: transform .06s, box-shadow .06s, background .06s; }
.pressed .halo { opacity: 1; transition: opacity .12s; transform: scale(calc(2.6 + var(--lvl, 0) * .5)); }
.cap.small.pressed .halo { transform: scale(calc(3.0 + var(--lvl, 0) * .5)); }
.edgeglow { position: fixed; inset: 0; z-index: 25; pointer-events: none; box-shadow: inset 0 0 46px var(--live-edge); opacity: 0; transition: opacity .2s; }
body.listening .edgeglow { opacity: 1; }
.bubble { position: fixed; z-index: 31; right: calc(var(--kr) + var(--kw) + 14px + max(0px, (100vw - var(--col)) / 2)); bottom: calc(var(--kb) + 60px + var(--safe-b)); background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 14px; font-size: 13px; font-weight: 800; }
body:not(.no-bar) .bubble { bottom: calc(var(--bar-h) + 100px + var(--safe-b)); }

/* ---------- lab drawers ---------- */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); z-index: 80; background: var(--bg); overflow-y: auto; padding: calc(14px + var(--safe-t)) 16px 80px; box-shadow: -10px 0 30px rgba(0, 0, 0, .28); border-radius: 24px 0 0 24px; }
.drawer h2 { font-size: 20px; margin: 0 0 8px; display: flex; justify-content: space-between; align-items: center; }
.drawer h3 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 20px 0 6px; }
.drawer label { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; font-size: 14px; font-weight: 600; border-bottom: 1px solid var(--line); }
.drawer select, .drawer input[type=number], .drawer input[type=text], .drawer input[type=datetime-local] { background: var(--tile); color: var(--ink); border: 0; border-radius: 10px; padding: 6px 8px; min-height: 36px; max-width: 55%; }
.drawer input[type=checkbox] { width: 22px; height: 22px; }
.drawer .btns, .logsheet .btns { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.drawer .btns button, .logsheet .btns button { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--tile); font-size: 13px; font-weight: 700; }
.drawer pre, .logsheet pre { background: var(--tile); border-radius: 12px; padding: 10px; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 220px; overflow: auto; }
.logsheet { position: fixed; left: 0; right: 0; bottom: 0; height: 72dvh; z-index: 85; background: var(--bg); border-radius: 26px 26px 0 0; overflow-y: auto; padding: 14px 16px 40px; box-shadow: 0 -12px 36px rgba(0, 0, 0, .3); }
.kgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 8px 0; }
.kpi { background: var(--tile); border-radius: 16px; padding: 10px; }
.kpi b { display: block; font-size: 20px; } .kpi span { font-size: 11px; color: var(--muted); font-weight: 600; }
table.t { width: 100%; border-collapse: collapse; font-size: 12px; margin: 6px 0; }
table.t th, table.t td { border-bottom: 1px solid var(--line); padding: 4px 6px; text-align: left; vertical-align: top; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--bar-h) + 190px); z-index: 90; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 700; max-width: 90vw; }
.ratebox { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.rate { display: inline-flex; gap: 6px; }
.rate button { border: 0; background: var(--bg); color: var(--ink); border-radius: 999px; padding: 0 12px; min-height: 36px; font-size: 13px; font-weight: 700; }
body.testing .knobwrap { }

/* ---------- motion ---------- */
@keyframes pulse { 50% { opacity: .45; } }
@keyframes pop { 0% { transform: scale(.94); opacity: .3; } 100% { transform: scale(1); opacity: 1; } }
@keyframes chev { 0%, 100% { opacity: .25; transform: translateY(2px); } 50% { opacity: 1; transform: translateY(-4px); } }
@keyframes ring { 0% { box-shadow: 0 4px 0 rgba(0, 0, 0, .22), 0 10px 20px rgba(0, 0, 0, .25), 0 0 0 0 var(--live-soft); } 70%, 100% { box-shadow: 0 4px 0 rgba(0, 0, 0, .22), 0 10px 20px rgba(0, 0, 0, .25), 0 0 0 20px rgba(0, 0, 0, 0); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .pressed .halo { transform: scale(2.8) !important; }
}
@media (orientation: landscape) and (max-height: 480px) {
  :root { --kh: 120px; --kw: 72px; }
  .caption { font-size: 18px; min-height: 0; }
  .sections { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-right: calc(var(--kw) + 24px); gap: 8px; }
  .stile { min-height: 48px; padding: 6px 10px; }
  .sectlabel { margin-top: 8px; }
  .kb { width: 56px; height: 56px; margin-left: -28px; }
}

/* phones: the name and the availability pill share one line, so the initials circle steps aside */
@media (max-width: 440px) {
  .dcard .avatar { display: none; }
  .dcard .dlines, .dcard .dtags { padding-left: 0; }
  .doc-name { font-size: 18px; }
  .apill { font-size: 12.5px; padding: 5px 10px; }
}
@media (max-width: 380px) { .doc-name { font-size: 17px; } .apill { font-size: 12px; padding: 4px 8px; gap: 5px; } }
