@font-face { font-family: 'Fraunces'; src: url('fonts/fraunces-latin-wght-normal.woff2') format('woff2'); font-weight: 300 800; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('fonts/manrope-latin-wght-normal.woff2') format('woff2'); font-weight: 300 800; font-display: swap; }

:root {
  --bg: #f1ece3;
  --panel: #e3dacb;
  --card: #fffdf9;
  --ink: #1c2528;
  --ink-2: #5a6462;
  --ink-3: #8a918d;
  --line: #e4ddd1;
  --line-2: #d6cdbe;
  --slate: #2f4356;
  --slate-2: #47607a;
  --terra: #bf5b33;
  --terra-bg: #f8e1d4;
  --urgent: #b4382c;
  --ok: #3f7a52;
  --chat-bg: #e9e3d7;
  --bub-me: #d9f2c6;
  --bub-them: #ffffff;
  --svc-clean: #dfe7ec;
  --svc-clean-b: #8fa6b6;
  --svc-check: #efe6d2;
  --svc-check-b: #c3a96d;
  --svc-white: #ebe4e9;
  --svc-white-b: #ad93a5;
  --svc-kids: #dfeadd;
  --svc-kids-b: #87a983;
  --row: clamp(22px, calc((100vh - 318px) / 20), 32px);
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Manrope', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--sans); color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--terra); outline-offset: 2px; border-radius: 6px; }
.ico { width: 14px; height: 14px; flex: none; }
svg use { pointer-events: none; }

/* ---------- top bar ---------- */
.top { height: 60px; display: flex; align-items: center; gap: 20px; padding: 0 24px; background: var(--card); border-bottom: 1px solid var(--line); position: relative; z-index: 2; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 30px; height: 30px; color: var(--slate); flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--serif); font-size: 20px; font-weight: 600; letter-spacing: -.01em; font-variation-settings: 'SOFT' 50; }
.brand-sub { font-size: 11.5px; color: var(--ink-2); }
.top-mid { display: flex; align-items: center; gap: 16px; margin-left: 12px; flex: 1; min-width: 0; }
.live { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--ok); background: #e5f0e5; padding: 5px 11px; border-radius: 999px; white-space: nowrap; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; animation: pulse 2.2s infinite; flex: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(63, 122, 82, .45); } 70% { box-shadow: 0 0 0 7px rgba(63, 122, 82, 0); } 100% { box-shadow: 0 0 0 0 rgba(63, 122, 82, 0); } }
.now { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.top-tools { display: flex; align-items: center; gap: 10px; }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 2px; }
.seg-b { border: 0; background: transparent; padding: 5px 10px; border-radius: 7px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.seg-b[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.btn-ghost { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--card); border-radius: 9px; padding: 6px 11px; font-size: 12.5px; font-weight: 600; }
.btn-ghost svg { width: 14px; height: 14px; }
.btn-ghost:hover { border-color: var(--ink-3); }

/* ---------- stage ---------- */
.stage { display: grid; grid-template-columns: 430px minmax(0, 1fr); height: calc(100vh - 60px); min-height: 760px; }
.eyebrow { margin: 0 0 10px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.side-phone { background: var(--panel); display: flex; flex-direction: column; align-items: center; padding: 16px 22px 18px; min-height: 0; border-right: 1px solid var(--line-2);
  background-image: radial-gradient(circle at 20% 10%, rgba(255, 255, 255, .35), transparent 50%); }
.side-phone .eyebrow { align-self: stretch; }

/* phone */
.phone { width: 318px; flex: 1; min-height: 0; max-height: 640px; background: #1b1f22; border-radius: 42px; padding: 9px; box-shadow: 0 1px 0 #3a4045 inset, 0 24px 48px -18px rgba(40, 30, 15, .45), 0 2px 6px rgba(0, 0, 0, .15); }
.screen { height: 100%; border-radius: 34px; overflow: hidden; background: var(--chat-bg); display: flex; flex-direction: column; position: relative; }
.statusbar { height: 30px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 4px 22px 0 26px; font-size: 12.5px; font-weight: 700; background: #fbf8f2; font-variant-numeric: tabular-nums; }
.sb-icons { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; }
.sb-icons i { width: 3px; background: var(--ink); border-radius: 1px; }
.sb-icons i:nth-child(1) { height: 5px; } .sb-icons i:nth-child(2) { height: 8px; } .sb-icons i:nth-child(3) { height: 11px; }
.sb-icons b { width: 20px; height: 10px; border: 1.5px solid var(--ink); border-radius: 3px; margin-left: 5px; position: relative; }
.sb-icons b::after { content: ''; position: absolute; inset: 1.5px 5px 1.5px 1.5px; background: var(--ink); border-radius: 1px; }
.chat-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 12px 9px 8px; background: #fbf8f2; border-bottom: 1px solid #e6dfd2; }
.ch-back { width: 18px; height: 18px; color: var(--ink-2); }
.ch-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--slate); color: #f3efe8; display: grid; place-items: center; flex: none; }
.ch-avatar svg { width: 20px; height: 20px; color: #f3efe8; }
.ch-id { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.ch-name { font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 4px; }
.ch-verified { width: 13px; height: 13px; color: var(--slate-2); }
.ch-sub { font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-sub.is-typing { color: #3f7a52; font-weight: 600; }
.ch-ico { width: 17px; height: 17px; color: var(--ink-2); margin-left: 6px; }

.chat { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 10px 12px; display: flex; flex-direction: column; gap: 4px; scroll-behavior: smooth; scrollbar-width: thin;
  background-color: var(--chat-bg);
  background-image: radial-gradient(rgba(120, 100, 70, .07) 1px, transparent 1.2px); background-size: 14px 14px; }
.divider { align-self: center; margin: 8px 0 4px; }
.divider span { display: inline-block; font-size: 11px; font-weight: 600; color: var(--ink-2); background: #f8f4ec; padding: 3px 10px; border-radius: 7px; box-shadow: 0 1px 0 rgba(0, 0, 0, .05); }
.sys { align-self: center; max-width: 88%; text-align: center; margin: 2px 0 6px; }
.sys span { display: inline-flex; gap: 6px; align-items: flex-start; font-size: 11px; color: #6b5f45; background: #f6ecd0; padding: 5px 10px; border-radius: 8px; line-height: 1.35; text-align: left; }
.sys .ico { width: 12px; height: 12px; margin-top: 1px; }
.sys.staff-note span { background: #e2e9ef; color: #34495c; }
.msg { display: flex; max-width: 100%; }
.msg .b { position: relative; max-width: 84%; padding: 6px 9px 5px; border-radius: 10px; font-size: 13.2px; line-height: 1.38; box-shadow: 0 1px 0.5px rgba(0, 0, 0, .1); }
.msg .txt { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-meta { float: right; display: inline-flex; align-items: center; gap: 3px; margin: 6px 0 -3px 10px; font-size: 10.5px; color: #85857d; font-variant-numeric: tabular-nums; }
.msg-meta .ticks { width: 15px; height: 12px; color: #6e9c78; }
.msg.me { justify-content: flex-end; }
.msg.me .b { background: var(--bub-me); border-top-right-radius: 3px; }
.msg.them .b, .msg.staff .b { background: var(--bub-them); border-top-left-radius: 3px; }
.msg-name { display: block; font-size: 11.5px; font-weight: 700; color: var(--slate-2); margin-bottom: 1px; }
.tpl { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--terra); margin-bottom: 3px; }
.tpl .ico { width: 12px; height: 12px; }
.tpl + .txt { display: block; }
.msg.arrive .b { animation: rise .35s ease-out; }
.msg.me .b { animation: rise .2s ease-out; }
@keyframes rise { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
.streaming .txt::after { content: ''; display: inline-block; width: 6px; height: 12px; margin-left: 2px; background: var(--slate-2); opacity: .5; vertical-align: -1px; animation: blink .8s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: #a19c90; animation: dot 1.1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }
.slots { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; max-width: 84%; }
.msg .slots { clear: both; }
.msg.them { flex-direction: column; align-items: flex-start; }
.slots.two { flex-direction: row; }
.slots.two .qr { flex: 1; }
.qr { white-space: nowrap; background: #fff; border: 0; border-radius: 9px; padding: 8px 10px; font-size: 13px; font-weight: 700; color: var(--slate-2); box-shadow: 0 1px 0.5px rgba(0, 0, 0, .1); text-align: center; transition: background .15s; }
.qr:not(:disabled):hover { background: #f4f1ea; }
.qr:disabled { color: #a7a59e; }
.qr.picked { color: var(--slate); background: #eef2f5; }
.qr.picked::before { content: '✓ '; }
.composer { flex: none; display: flex; align-items: center; gap: 7px; padding: 7px 9px 12px; background: var(--chat-bg); }
.cmp-field { flex: 1; height: 36px; border-radius: 18px; background: #fff; display: flex; align-items: center; padding: 0 14px; color: #9c988f; font-size: 13px; }
.cmp-send { width: 36px; height: 36px; border-radius: 50%; background: var(--slate); display: grid; place-items: center; color: #fff; }
.cmp-send svg { width: 16px; height: 16px; }

/* tray: demo controls */
.tray { width: 100%; margin-top: 12px; flex: none; border: 1.5px dashed #b9ad98; border-radius: 14px; padding: 10px 10px 8px; background: rgba(255, 253, 249, .55); }
.tray-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.tray-title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-2); }
.seg-sm .seg-b { padding: 3px 8px; font-size: 11px; }
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.chip { position: relative; display: flex; gap: 7px; align-items: flex-start; text-align: left; border: 1px solid var(--line-2); background: var(--card); border-radius: 10px; padding: 7px 8px; font-size: 11.8px; line-height: 1.3; min-height: 40px; transition: border-color .15s, transform .15s, background .15s; }
.chip:not(:disabled):hover { border-color: var(--slate-2); transform: translateY(-1px); }
.chip:disabled { opacity: .45; }
.chip.used:not(:disabled) { background: #f7f4ee; }
.chip-n { flex: none; width: 17px; height: 17px; border-radius: 50%; background: var(--slate); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; margin-top: 1px; }
.chip-l { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chip-why { position: absolute; right: 6px; bottom: 4px; font-size: 9.5px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; display: none; }
.chip-skip { background: #f4efe4; border-style: dashed; }
.chip-skip .chip-n { background: var(--terra); }
.chip-skip .ico { display: none; }
.chip-skip b { display: block; font-weight: 700; }
.chip-skip small { display: block; color: var(--ink-2); font-size: 11px; }
.chip-medical .chip-n, .chip-complaint .chip-n { background: var(--urgent); }
.tray-hint { margin: 8px 2px 0; font-size: 11.5px; color: var(--ink-2); min-height: 2.6em; line-height: 1.35; }

/* ---------- clinic side ---------- */
.side-clinic { padding: 16px 22px 18px; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; flex: none; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 9px 14px; display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.stat-v { font-family: var(--serif); font-size: 26px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-l { font-size: 12px; color: var(--ink-2); line-height: 1.25; }
.stat.warn .stat-v { color: var(--terra); }
.clinic-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.card-title { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 17px; letter-spacing: -.01em; line-height: 1.2; }
.card-sub { margin: 2px 0 0; font-size: 12px; color: var(--ink-2); }
.col-right { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; scrollbar-width: thin; padding-right: 2px; }

/* calendar */
.cal-card { display: flex; flex-direction: column; min-height: 0; }
.legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 12px; font-size: 11px; color: var(--ink-2); max-width: 60%; }
.lg { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.lg i { width: 10px; height: 10px; border-radius: 3px; }
.lg-clean i { background: var(--svc-clean); box-shadow: inset 3px 0 var(--svc-clean-b); }
.lg-check i { background: var(--svc-check); box-shadow: inset 3px 0 var(--svc-check-b); }
.lg-white i { background: var(--svc-white); box-shadow: inset 3px 0 var(--svc-white-b); }
.lg-kids i { background: var(--svc-kids); box-shadow: inset 3px 0 var(--svc-kids-b); }
.lg-wa i { background: var(--terra-bg); box-shadow: inset 3px 0 var(--terra); }
.day-pills { display: none; }
.cal { display: grid; grid-template-columns: 44px repeat(6, minmax(0, 1fr)); gap: 0 6px; }
.cal-dh { height: 34px; display: flex; align-items: baseline; gap: 5px; padding: 4px 2px; font-size: 12px; color: var(--ink-2); text-transform: capitalize; }
.cal-dh b { font-family: var(--serif); font-size: 17px; color: var(--ink); font-weight: 600; }
.cal-body { position: relative; }
.cal-axis .ax { position: absolute; right: 6px; transform: translateY(-6px); font-size: 10.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.gl { position: absolute; left: 0; right: 0; border-top: 1px dashed #efe9de; }
.gl.hr { border-top: 1px solid #e9e2d6; }
.blk { position: absolute; left: 0; right: 0; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--ink-3);
  background: repeating-linear-gradient(-45deg, #f3eee5 0 6px, #ebe5da 6px 12px); }
.blk.holiday span { writing-mode: vertical-rl; transform: rotate(180deg); letter-spacing: .08em; text-transform: uppercase; font-weight: 700; font-size: 10.5px; }
.appt { position: absolute; left: 0; right: 0; border-radius: 7px; padding: 4px 7px; overflow: hidden; font-size: 11px; line-height: 1.25; display: flex; flex-direction: column; background: var(--svc-clean); box-shadow: inset 3px 0 var(--svc-clean-b); }
.appt b { font-weight: 700; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 12px; }
.appt span { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 10.5px; }
.appt.short { flex-direction: row; gap: 5px; align-items: center; }
.appt.short span { display: none; }
.appt .ok { position: absolute; top: 5px; right: 5px; width: 11px; height: 11px; color: var(--ok); }
.svc-check { background: var(--svc-check); box-shadow: inset 3px 0 var(--svc-check-b); }
.svc-white { background: var(--svc-white); box-shadow: inset 3px 0 var(--svc-white-b); }
.svc-kids { background: var(--svc-kids); box-shadow: inset 3px 0 var(--svc-kids-b); }
.appt.offered { background: transparent; box-shadow: none; border: 1.5px dashed var(--terra); color: var(--terra); }
.appt.offered b { color: var(--terra); font-weight: 700; }
.appt.offered span { color: var(--terra); }
.appt.wa { background: var(--terra-bg); box-shadow: inset 3px 0 var(--terra), 0 4px 12px -6px rgba(191, 91, 51, .6); z-index: 1; }
.appt.wa b { color: #7a3416; }
.appt.wa .ok { color: var(--terra); }
.appt.wa.st-confirmed { background: #f3cdb8; }
.appt.pop { animation: pop .55s cubic-bezier(.2, .9, .3, 1.3); }
@keyframes pop { 0% { transform: scale(.85); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* conversation card */
.badge-lang { font-size: 11px; font-weight: 800; background: var(--slate); color: #fff; border-radius: 6px; padding: 2px 7px; }
.conv-empty { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2); font-size: 12.5px; background: var(--bg); border-radius: 10px; padding: 12px; }
.conv-empty p { margin: 0; }
.conv-empty .ico { color: var(--terra); width: 16px; height: 16px; margin-top: 1px; }
.who { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 10px; background: var(--bg); border-radius: 10px; }
.av { width: 32px; height: 32px; border-radius: 50%; background: #d8c7ad; color: #5a4526; font-weight: 800; display: grid; place-items: center; }
.who-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.who-t b { font-size: 13.5px; }
.who-t small { font-size: 11px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-l { display: flex; flex-direction: column; align-items: flex-end; font-size: 12.5px; font-weight: 700; line-height: 1.2; }
.who-l small { font-size: 10px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.who-l em { font-style: normal; font-size: 10.5px; color: var(--ok); font-weight: 600; }
.mini { margin: 12px 0 6px; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); }
.none { margin: 0; font-size: 12.5px; color: var(--ink-3); }
.fields { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.fields div { min-width: 0; animation: fade .4s ease-out both; }
.fields div:nth-child(2) { animation-delay: .06s; } .fields div:nth-child(3) { animation-delay: .12s; } .fields div:nth-child(4) { animation-delay: .18s; } .fields div:nth-child(5) { animation-delay: .24s; }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.fields .wide { grid-column: 1 / -1; }
.fields dt { font-size: 10.5px; color: var(--ink-3); }
.fields dd { margin: 0; font-size: 13px; font-weight: 600; }
.fields dd.strike { text-decoration: line-through; color: var(--ink-3); }
.hist { display: block; font-size: 11px; font-weight: 500; color: var(--ink-3); }
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--bg); }
.st::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-held { color: var(--terra); }
.st-booked { color: var(--slate-2); background: #e6ecf1; }
.st-reminded { color: #8a5a12; background: #f5ead2; }
.st-confirmed { color: var(--ok); background: #e3efe3; }
.st-cancelled { color: var(--urgent); background: #f6e1dd; }
.log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.log li { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 6px; font-size: 12px; line-height: 1.35; }
.log li:first-child { animation: fade .4s ease-out; }
.log time { color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 11px; padding-top: 1px; }
.log small { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.log em { font-style: normal; font-size: 10.5px; font-weight: 600; color: var(--slate-2); background: #e9eef2; padding: 1px 6px; border-radius: 5px; }

/* queue */
.count { min-width: 24px; height: 24px; border-radius: 12px; background: var(--terra); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; padding: 0 7px; }
.count.zero { background: var(--line-2); color: var(--ink-2); }
.queue { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.qi { border: 1px solid var(--line); border-radius: 11px; padding: 10px 11px; background: #fff; border-left: 3px solid var(--slate-2); }
.qi.p-urgent { border-left-color: var(--urgent); }
.qi.q-resolved { background: transparent; border-left-color: var(--line-2); opacity: .75; }
.qi.pop { animation: pop .5s cubic-bezier(.2, .9, .3, 1.2); box-shadow: 0 8px 20px -12px rgba(180, 56, 44, .55); }
.qi-top { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.qi-top time { margin-left: auto; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.prio { font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 2px 6px; border-radius: 5px; background: #e6ecf1; color: var(--slate-2); }
.p-urgent .prio { background: #f6e1dd; color: var(--urgent); }
.qi-title { margin: 4px 0 0; font-weight: 700; font-size: 13px; }
.qi-reason, .qi-sum, .qi-next { margin: 6px 0 0; font-size: 12px; color: var(--ink-2); line-height: 1.4; }
.qi-reason span, .qi-sum span, .qi-next span { display: block; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.qi-next { color: var(--ink); }
.qi-act { display: flex; align-items: center; gap: 10px; margin-top: 9px; flex-wrap: wrap; }
.btn-take { display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--slate); color: #fff; border-radius: 8px; padding: 6px 12px; font-size: 12.5px; font-weight: 700; }
.btn-take:hover { background: var(--slate-2); }
.btn-take .ico { color: #fff; }
.btn-back { border: 1px solid var(--line-2); background: var(--card); border-radius: 8px; padding: 5px 10px; font-size: 12px; font-weight: 700; }
.onit { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--ok); }
.done { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.q-resolved .qi-act { margin-top: 4px; }

/* toast + ribbon */
.toast { position: fixed; left: 50%; bottom: 52px; transform: translateX(-50%); z-index: 40; display: inline-flex; align-items: center; gap: 8px; border: 0; background: var(--slate); color: #fff; border-radius: 999px; padding: 9px 16px; font-size: 13px; font-weight: 700; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .5); max-width: calc(100vw - 32px); }
.toast svg { width: 15px; height: 15px; }
.toast[hidden] { display: none; }
.ribbon { position: fixed; right: 12px; bottom: 12px; z-index: 30; font-size: 11.5px; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: rgba(28, 37, 40, .82); color: #f6f1e8; text-decoration: none; }
.ribbon:hover { background: #1c2528; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .stage { height: auto; min-height: 0; align-items: start; }
  .side-phone { position: sticky; top: 0; height: calc(100vh - 60px); min-height: 700px; }
  .clinic-grid { grid-template-columns: minmax(0, 1fr); }
  .col-right { overflow: visible; }
}
@media (max-width: 1280px) { :root { --row: 28px; } }
@media (max-width: 900px) {
  :root { --row: 30px; }
  .top { height: auto; flex-wrap: wrap; padding: 10px 16px; gap: 8px 12px; }
  .top-mid { order: 3; flex-basis: 100%; margin: 0; gap: 10px; flex-wrap: wrap; }
  .top-tools { margin-left: auto; }
  .btn-ghost span { display: none; }
  .stage { display: block; }
  .side-phone { position: static; height: auto; padding: 14px 16px 16px; border-right: 0; border-bottom: 1px solid var(--line-2); }
  .phone { width: 100%; max-width: 420px; height: min(480px, 62vh); flex: none; max-height: none; border-radius: 30px; padding: 6px; }
  .screen { border-radius: 25px; }
  .tray { max-width: 420px; }
  .side-clinic { padding: 16px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat { flex-direction: column; gap: 3px; padding: 9px 12px; }
  .stat-v { font-size: 22px; }
  .card { padding: 13px 13px; }
  .card-head { flex-wrap: wrap; }
  .legend { max-width: none; justify-content: flex-start; }
  .day-pills { display: flex; gap: 6px; margin-bottom: 10px; }
  .pill { flex: 1; min-width: 0; border: 1px solid var(--line-2); background: var(--card); border-radius: 10px; padding: 5px 0; display: flex; flex-direction: column; align-items: center; line-height: 1.15; position: relative; }
  .pill span { font-size: 10.5px; color: var(--ink-2); text-transform: capitalize; }
  .pill b { font-family: var(--serif); font-size: 16px; }
  .pill[aria-pressed="true"] { background: var(--slate); border-color: var(--slate); color: #fff; }
  .pill[aria-pressed="true"] span { color: #dfe6ec; }
  .pill.has::after { content: ''; position: absolute; top: 4px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--terra); }
  .cal { grid-template-columns: 44px minmax(0, 1fr); }
  .cal-col:not(.sel) { display: none; }
  .cal .cal-dh { display: none; }
  .appt.short span { display: inline; }
  .chip { font-size: 12px; }
}
@media (max-width: 380px) {
  .chips { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.chip-skip .chip-l { display: block; }
