@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/noto-sans-cyrillic-ext-400.woff2") format("woff2");
  unicode-range: U+0460-052F, U+0490-04FF, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/noto-sans-cyrillic-ext-600.woff2") format("woff2");
  unicode-range: U+0460-052F, U+0490-04FF, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/noto-sans-cyrillic-ext-700.woff2") format("woff2");
  unicode-range: U+0460-052F, U+0490-04FF, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/noto-sans-cyrillic-400.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+2116;
}
@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/noto-sans-cyrillic-600.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+2116;
}
@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/noto-sans-cyrillic-700.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+2116;
}
@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/noto-sans-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/noto-sans-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/noto-sans-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f3f8fc;
  --surface: #fbfdff;
  --surface-2: #e6f2f9;
  --ink: #1b3346;
  --muted: #5a7386;
  --action: #d4eaf7;
  --action-ink: #163e5c;
  --action-border: #b3d0e4;
  --action-hover: #c3e0f3;
  --accent: #2a6f9a;
  --sage: #e4f1f8;
  --sage-ink: #1f5270;
  --line: #d3e3ee;
  --input: #8aabbf;
  --shadow: 0 8px 28px rgba(36, 78, 110, 0.06);
  --radius: 18px;
  --danger-bg: #f8e8ec;
  --danger-ink: #6d303c;
  --wait-bg: #e7f3fa;
  --wait-ink: #1a4a68;
  --ok-bg: #dceef6;
  --ok-ink: #1c5574;
  font-family: "Noto Sans", sans-serif;
  color: var(--ink);
  background: var(--bg);
  color-scheme: light;
  accent-color: var(--accent);
}

* { box-sizing: border-box; }
body { margin: 0; font-size: 17px; line-height: 1.55; background: var(--bg); color: var(--ink); }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; background: var(--surface); padding: 8px 12px; z-index: 5; }

.banner { background: var(--wait-bg); color: var(--wait-ink); text-align: center; padding: 8px 16px; font-weight: 700; }
.topbar, .public-bar { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 16px 20px; }
.brand { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 20px; }
.langs { display: flex; gap: 8px; }
.langs button, .btn, .btn-quiet { min-height: 44px; border-radius: 12px; padding: 10px 16px; cursor: pointer; }
.btn { background: var(--action); color: var(--action-ink); border: 1px solid var(--action-border); font-weight: 700; }
.btn:hover { background: var(--action-hover); }
.btn-quiet { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.help-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 56px; padding: 14px 22px; border-radius: 16px; background: var(--action); color: var(--action-ink); border: 1px solid var(--action-border); text-decoration: none; font-weight: 700; font-size: 20px; }
.wrap { width: min(1120px, calc(100% - 40px)); margin: 0 auto 48px; }
.card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.grid h2, .grid h3 { overflow-wrap: anywhere; }
.grid.people { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
a.person { text-decoration: none; color: inherit; display: flex; gap: 14px; align-items: flex-start; }
.person { display: flex; gap: 16px; align-items: flex-start; }
a.person h2 { margin: 4px 0; font-size: 20px; }
.app-frame .grid.people { grid-template-columns: 1fr; }
.app-frame .person img { width: 72px; height: 72px; }
.price { font-weight: 700; margin: 6px 0 0; }
.facts { list-style: none; margin: 12px 0; padding: 0; }
.facts li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.facts span { color: var(--muted); }
.facts strong { text-align: right; font-weight: 700; }
.actions-stack { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 20px; }
.actions-stack .row-link { margin: 0; }
.app-frame h2 { font-size: 18px; margin: 22px 0 8px; }
.person img, .avatar { width: 96px; height: 96px; object-fit: cover; border-radius: 18px; background: var(--surface-2); }
.avatar { width: 48px; height: 48px; border-radius: 12px; }
.person.detail { flex-direction: column; }
.person.detail img { width: 96px; height: 96px; }
.days { list-style: none; margin: 8px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); }
.days li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); }
.days li:first-child { border-top: 0; }
.days span { color: var(--muted); font-weight: 700; }
.days strong { font-weight: 650; text-align: right; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters a { text-decoration: none; display: inline-flex; align-items: center; }
.filters a.active { background: var(--action); border-color: var(--action-border); }
.muted { color: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 10px; background: var(--sage); color: var(--sage-ink); font-size: 14px; font-weight: 700; }
.tag.wait { background: var(--wait-bg); color: var(--wait-ink); }
.tag.bad { background: var(--danger-bg); color: var(--danger-ink); }
.note { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.error { background: var(--danger-bg); color: var(--danger-ink); border-radius: 12px; padding: 12px 14px; }

.staff-shell { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 14px 32px; position: sticky; top: 0; height: 100vh; overflow: auto; }
.side h2 { font-size: 13px; letter-spacing: 0.04em; color: var(--muted); margin: 18px 8px 8px; }
.side a { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); border-radius: 12px; padding: 10px 12px; }
.nav-icon { width: 18px; height: 18px; flex: none; }
.side a.active, .side a:hover { background: var(--surface-2); }
.main { padding: 20px 24px 48px; }
.crumbs { color: var(--muted); font-size: 14px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 14px; color: var(--muted); }
label { display: block; font-weight: 700; margin: 14px 0 6px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="time"], select, textarea {
  width: 100%; max-width: 640px; background: var(--surface); border: 1px solid var(--input); border-radius: 12px; padding: 12px 14px; min-height: 44px;
}
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.nav-open { display: none; }
.qr svg { width: 180px; height: 180px; }
.table-scroll { overflow-x: auto; }
table.week { min-width: 720px; }
table.week td, table.week th { white-space: nowrap; font-size: 14px; }
.app-frame table.week { min-width: 640px; }
.secret { font-family: ui-monospace, monospace; background: var(--surface-2); padding: 8px 10px; border-radius: 8px; word-break: break-all; }

body.client { background: #d7e7f2; }
.app-frame { width: min(480px, 100%); min-height: 100vh; margin: 0 auto; background: var(--bg); position: relative; padding-bottom: 92px; box-shadow: 0 0 0 1px var(--line); }
.app-frame #clinic-map { height: 280px; border-radius: 16px; margin: 0 0 16px; border: 1px solid var(--line); }
.app-frame .public-bar { position: sticky; top: 0; z-index: 2; background: rgba(243, 248, 252, 0.94); backdrop-filter: blur(8px); margin: 0; width: auto; border-bottom: 1px solid var(--line); }
.app-frame .wrap { width: calc(100% - 32px); margin: 16px auto 24px; }
.app-frame .help-btn, .app-frame .btn { width: 100%; }
.login-form label input,
.login-form label select,
.login-form label textarea { display: block; width: 100%; margin-top: 6px; box-sizing: border-box; }
.login-form .btn { margin-top: 18px; }
.phone-line { position: relative; display: flex; align-items: center; background: var(--surface); border: 1px solid var(--input); border-radius: 12px; min-height: 48px; }
.phone-line .dial { display: flex; align-items: center; gap: 6px; border: 0; border-right: 1px solid var(--line); background: transparent; padding: 0 12px; min-height: 48px; font-weight: 700; cursor: pointer; white-space: nowrap; font-family: "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.phone-line input { border: 0; flex: 1; min-width: 0; max-width: none; background: transparent; }
.dial-list { position: absolute; z-index: 4; top: calc(100% + 6px); left: 0; right: 0; max-height: 280px; overflow: auto; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.dial-list button { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; text-align: left; font-family: "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.dial-list button[aria-selected="true"], .dial-list button:hover { background: var(--surface-2); }
.dial-list .name { flex: 1; }
.app-frame h1 { font-size: 26px; line-height: 1.25; margin: 8px 0 16px; }
.eyebrow { margin: 8px 0 0; color: var(--accent); font-weight: 700; letter-spacing: 0.02em; }
.row-link, .list-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin: 10px 0; min-height: 52px; }
.list { display: flex; flex-direction: column; }
.list-row strong { display: block; }
.list-row .muted { display: block; font-size: 14px; }
.app-foot { width: calc(100% - 32px); margin: 0 auto 12px; color: var(--muted); font-size: 14px; }
.font-probe { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(480px, 100%); display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); z-index: 3; }
.tabbar a { text-decoration: none; color: var(--muted); text-align: center; font-size: 13px; font-weight: 700; min-height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 12px; }
.tabbar a[aria-current="page"] { background: var(--action); color: var(--action-ink); }
.lang-pick { position: relative; }
.lang-pick summary { list-style: none; cursor: pointer; height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 15px; font-weight: 700; }
.lang-pick summary::-webkit-details-marker { display: none; }
.lang-pick:not([open]) form { display: none; }
.lang-pick form { position: absolute; right: 0; top: calc(100% + 8px); z-index: 6; display: flex; flex-direction: column; gap: 2px; min-width: 168px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.lang-pick button { min-height: 42px; border: 0; border-radius: 12px; background: transparent; text-align: left; padding: 0 10px; cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.lang-pick button[aria-current="true"], .lang-pick button:hover { background: var(--surface-2); }
.lang-pick .flag { font-size: 18px; line-height: 1; }

@media (max-width: 800px) {
  .staff-shell { grid-template-columns: 1fr; }
  .nav-open { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 12px; }
  .side { display: none; position: static; height: auto; }
  .nav-toggle:checked ~ .staff-shell .side { display: block; }
  .wrap { width: min(1120px, calc(100% - 32px)); }
}

/* Sana mascot assistant */
.buddy { --dog: 96px; font-size: 15px; }
.buddy--float { position: fixed; right: 28px; bottom: 28px; z-index: 40; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; }
.buddy--float > * { pointer-events: auto; }
.buddy-launcher { width: var(--dog); height: var(--dog); border: 0; padding: 0; background: radial-gradient(circle at 50% 60%, #ffffff 0 58%, transparent 60%); border-radius: 50%; cursor: pointer; filter: drop-shadow(0 10px 18px rgba(36, 78, 110, .22)); transition: transform .25s cubic-bezier(.3,1.6,.5,1); animation: buddy-in .7s cubic-bezier(.3,1.5,.5,1) both .3s; order: 3; }
.buddy-launcher:hover { transform: translateY(-4px) scale(1.05); }
.buddy-launcher:active { transform: scale(.94); }
.buddy-launcher:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.buddy.is-open .buddy-launcher { transform: scale(.82); }
.dog { width: 100%; height: 100%; display: block; overflow: visible; }
.dog-shadow { fill: rgba(27, 51, 70, .12); }
.dog-tail { transform-origin: 90px 112px; animation: hand-wave .9s ease-in-out 3 1.4s; }
.buddy-launcher:hover .dog-tail { animation: hand-wave .9s ease-in-out infinite; }
.buddy-launcher, .buddy-avatar, .buddy-hero-dog { overflow: hidden; }
.buddy-launcher { background: #fff; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.dog-head { transform-origin: 60px 74px; animation: dog-bob 3.6s ease-in-out infinite; }
.dog-eyes { transform-origin: 60px 47px; animation: dog-blink 4.8s infinite; }
.dog-ear--l { transform-origin: 40px 28px; } .dog-ear--r { transform-origin: 80px 28px; }
.dog-tongue { transform-origin: 60px 64px; transform: scaleY(0); transition: transform .2s; }
.dog-dots { fill: var(--accent); opacity: 0; }
.is-talking .dog-tongue { transform: scaleY(1); }
.is-talking .dog-tongue { animation: dog-pant .22s ease-in-out infinite alternate; }

.is-listening .dog-ear--l { animation: ear-l .6s ease-in-out infinite alternate; }
.is-listening .dog-ear--r { animation: ear-r .6s ease-in-out infinite alternate; }
.is-listening .dog-head { animation: dog-tilt 1.6s ease-in-out infinite alternate; }
.is-thinking .dog-head { animation: dog-think 1.4s ease-in-out infinite alternate; }
.is-thinking .dog-dots { opacity: 1; }
.is-thinking .dog-dots circle { animation: dot 1.2s infinite; }
.is-thinking .dog-dots circle:nth-child(2) { animation-delay: .15s; }
.is-thinking .dog-dots circle:nth-child(3) { animation-delay: .3s; }

.buddy-bubble { order: 1; max-width: 250px; margin: 0 6px 0 0; padding: 12px 14px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 18px 18px 4px 18px; box-shadow: 0 12px 30px rgba(36, 78, 110, .16); line-height: 1.4; cursor: pointer; transform-origin: bottom right; }
.buddy-bubble.pop { animation: bubble-pop .5s cubic-bezier(.3,1.6,.5,1) both; }

.buddy-panel { order: 2; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; overflow: hidden; }
.buddy--float .buddy-panel { width: 380px; height: min(580px, calc(100vh - 160px)); box-shadow: 0 24px 60px rgba(36, 78, 110, .22); transform-origin: bottom right; animation: panel-in .35s cubic-bezier(.2,1.2,.4,1) both; }
.buddy-panel[hidden] { display: none; }
.buddy--page .buddy-panel { height: min(62vh, 560px); min-height: 380px; box-shadow: var(--shadow); }
.buddy-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; background: linear-gradient(135deg, #e6f2f9, #f6fbff); border-bottom: 1px solid var(--line); }
.buddy-avatar { width: 44px; height: 44px; flex: none; background: #fff; border-radius: 50%; border: 1px solid var(--line); }
.buddy-title { flex: 1; display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.buddy-title .muted { font-size: 13px; }
.buddy.is-busy .buddy-title .muted { color: var(--accent); }
.buddy-icon { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 12px; background: transparent; color: var(--muted); cursor: pointer; }
.buddy-icon:hover { background: var(--surface-2); color: var(--ink); }
.buddy-icon svg { width: 20px; height: 20px; }

.buddy-log { flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; background: var(--bg); }
.buddy-msg { max-width: 86%; padding: 10px 13px; border-radius: 18px; line-height: 1.45; word-wrap: break-word; }
.buddy-msg p { margin: 0; white-space: pre-wrap; }
.buddy-msg--bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.buddy-msg--user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.buddy-msg.enter { animation: msg-in .32s cubic-bezier(.2,1.2,.4,1) both; }
.buddy-msg.is-error { background: var(--danger-bg); color: var(--danger-ink); border-color: transparent; }
.buddy-msg.is-pending p { animation: pulse-op 1s infinite; }
.buddy-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; opacity: .85; margin-bottom: 2px; }
.buddy-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.buddy-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.buddy-chip { padding: 6px 11px; border-radius: 999px; background: var(--action); color: var(--action-ink); text-decoration: none; font-size: 14px; border: 1px solid var(--action-border); transition: background .2s; }
.buddy-chip:hover { background: var(--action-hover); }
.buddy-alert { display: block; margin-top: 8px; padding: 8px 10px; border-radius: 12px; background: var(--danger-bg); color: var(--danger-ink); font-weight: 600; text-decoration: none; }
.buddy-typing { display: flex; gap: 5px; padding: 14px 16px; }
.buddy-typing span { width: 8px; height: 8px; border-radius: 50%; background: var(--input); animation: dot 1.2s infinite; }
.buddy-typing span:nth-child(2) { animation-delay: .15s; } .buddy-typing span:nth-child(3) { animation-delay: .3s; }

.buddy-offline { padding: 16px; display: grid; gap: 10px; }
.buddy-offline[hidden], .buddy-bubble[hidden] { display: none; }
.buddy-consent { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 10px 14px; font-size: 13px; line-height: 1.4; color: var(--muted); background: var(--wait-bg); border-top: 1px solid var(--line); cursor: pointer; }
.buddy-consent[hidden] { display: none; }
.buddy-consent input { width: 18px; height: 18px; flex: none; margin: 1px 0 0; accent-color: var(--accent); }
.buddy-consent.shake { animation: shake .45s; color: var(--danger-ink); background: var(--danger-bg); }

.buddy-input { display: flex; align-items: flex-end; gap: 8px; padding: 10px 10px 10px 14px; border-top: 1px solid var(--line); background: var(--surface); margin: 0; }
.buddy-input[hidden] { display: none; }
.buddy-input textarea { flex: 1; min-height: 44px; max-height: 120px; resize: none; padding: 11px 14px; border: 1px solid var(--line); border-radius: 22px; background: var(--bg); font: inherit; color: var(--ink); line-height: 1.35; margin: 0; width: auto; }
.buddy-input textarea:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(42, 111, 154, .14); }
.buddy-mic, .buddy-send { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 0; cursor: pointer; transition: transform .2s cubic-bezier(.3,1.6,.5,1), background .2s; padding: 0; }
.buddy-mic { background: var(--action); color: var(--action-ink); }
.buddy-mic:hover { background: var(--action-hover); transform: scale(1.06); }
.buddy-mic[hidden] { display: none; }
.buddy-send { background: var(--accent); color: #fff; }
.buddy-send:hover { transform: scale(1.06); }
.buddy-send:active, .buddy-mic:active { transform: scale(.92); }
.buddy-mic svg, .buddy-send svg { width: 22px; height: 22px; }
.buddy-input .buddy-send { display: none; }
.buddy.has-text .buddy-input .buddy-send, .buddy-input .buddy-mic[hidden] + .buddy-send { display: grid; animation: pop-in .25s cubic-bezier(.3,1.6,.5,1); }
.buddy.has-text .buddy-mic { display: none; }
.buddy.is-busy .buddy-send, .buddy.is-busy .buddy-mic { opacity: .5; pointer-events: none; }

.buddy-rec { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border-top: 1px solid var(--line); background: var(--surface); animation: msg-in .25s both; }
.buddy-rec[hidden] { display: none; }
.buddy-rec-dot { width: 12px; height: 12px; border-radius: 50%; background: #d9534f; animation: rec 1s ease-in-out infinite; }
.buddy-wave { flex: 1; display: flex; align-items: center; gap: 4px; height: 28px; }
.buddy-wave i { flex: 1; max-width: 6px; height: 100%; border-radius: 3px; background: var(--accent); animation: wave 1s ease-in-out infinite; }
.buddy-wave i:nth-child(2) { animation-delay: .1s } .buddy-wave i:nth-child(3) { animation-delay: .25s } .buddy-wave i:nth-child(4) { animation-delay: .05s } .buddy-wave i:nth-child(5) { animation-delay: .3s } .buddy-wave i:nth-child(6) { animation-delay: .15s } .buddy-wave i:nth-child(7) { animation-delay: .2s }
.buddy-time { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 36px; }
.buddy-ghost { border: 0; background: transparent; color: var(--muted); padding: 8px 10px; border-radius: 12px; cursor: pointer; font: inherit; }
.buddy-ghost:hover { background: var(--surface-2); color: var(--ink); }
.buddy-foot { margin: 0; padding: 6px 14px 10px; font-size: 12px; color: var(--muted); background: var(--surface); text-align: center; }

.buddy-hero { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.buddy-hero h1 { margin: 0 0 4px; }
.buddy-hero p { margin: 0; font-size: 14px; }
.buddy-hero-dog { width: 92px; height: 92px; flex: none; background: #fff; border-radius: 50%; border: 1px solid var(--line); animation: buddy-in .7s cubic-bezier(.3,1.5,.5,1) both; }
.buddy-page:has(.buddy.is-thinking) .buddy-hero-dog .dog-dots { opacity: 1; }
.buddy-page:has(.buddy.is-thinking) .buddy-hero-dog .dog-head { animation: dog-think 1.4s ease-in-out infinite alternate; }
.buddy-page:has(.buddy.is-listening) .buddy-hero-dog .dog-ear--l { animation: ear-l .6s ease-in-out infinite alternate; }
.buddy-page:has(.buddy.is-listening) .buddy-hero-dog .dog-ear--r { animation: ear-r .6s ease-in-out infinite alternate; }
.buddy-page:has(.buddy.is-talking) .buddy-hero-dog .dog-tongue { transform: scaleY(1); animation: dog-pant .35s ease-in-out infinite alternate; }

.buddy-voice-note { font-size: 13px; }

@media (max-width: 760px) {
  .buddy--float { --dog: 68px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); }
  .buddy-bubble { max-width: 220px; font-size: 14px; }
  .buddy--float .buddy-panel { position: fixed; left: 0; right: 0; bottom: 0; width: auto; height: min(82vh, 640px); border-radius: 24px 24px 0 0; transform-origin: bottom center; animation: sheet-in .35s cubic-bezier(.2,1,.3,1) both; padding-bottom: env(safe-area-inset-bottom); }
  .buddy--float.is-open .buddy-launcher, .buddy--float.is-open .buddy-bubble { display: none; }
  .buddy--float.is-open::before { content: ""; position: fixed; inset: 0; background: rgba(27, 51, 70, .28); animation: fade .25s both; pointer-events: auto; }
}

@keyframes hand-wave { 0%,100% { transform: rotate(0) } 30% { transform: rotate(-14deg) } 70% { transform: rotate(10deg) } }
@keyframes dog-bob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-2.5px) } }
@keyframes dog-blink { 0%,92%,100% { transform: scaleY(1) } 95% { transform: scaleY(.1) } }
@keyframes dog-tilt { from { transform: rotate(-7deg) } to { transform: rotate(7deg) } }
@keyframes dog-think { from { transform: rotate(-4deg) translateY(0) } to { transform: rotate(-10deg) translateY(-2px) } }
@keyframes dog-pant { from { transform: scaleY(.75) } to { transform: scaleY(1.1) } }
@keyframes ear-l { from { transform: rotate(0) } to { transform: rotate(-14deg) } }
@keyframes ear-r { from { transform: rotate(0) } to { transform: rotate(14deg) } }
@keyframes dot { 0%,80%,100% { transform: translateY(0); opacity: .45 } 40% { transform: translateY(-4px); opacity: 1 } }
@keyframes buddy-in { from { transform: translateY(40px) scale(.6); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes bubble-pop { from { transform: scale(.4) translateY(10px); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes panel-in { from { transform: scale(.85) translateY(20px); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes sheet-in { from { transform: translateY(100%) } to { transform: none } }
@keyframes msg-in { from { transform: translateY(8px) scale(.97); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes pop-in { from { transform: scale(.5) } to { transform: scale(1) } }
@keyframes pulse-op { 50% { opacity: .35 } }
@keyframes rec { 50% { transform: scale(.7); opacity: .5 } }
@keyframes wave { 0%,100% { transform: scaleY(.25) } 50% { transform: scaleY(1) } }
@keyframes shake { 20%,60% { transform: translateX(-5px) } 40%,80% { transform: translateX(5px) } }
@keyframes fade { from { opacity: 0 } }
@media (prefers-reduced-motion: reduce) {
  .buddy *, .buddy-hero-dog, .buddy-hero-dog * { animation: none !important; transition: none !important; }
}

/* welcome card */
.buddy-bubble { position: relative; max-width: 300px; padding: 16px 16px 14px; border-radius: 22px 22px 6px 22px; cursor: default; }
.buddy-bubble-hi { margin: 0 22px 12px 0; line-height: 1.45; }
.buddy-bubble-hi strong { display: block; font-size: 17px; margin-bottom: 2px; }
.buddy-bubble-x { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.buddy-bubble-x:hover { background: var(--surface-2); color: var(--ink); }
.buddy-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.buddy-bubble .buddy-quick { margin-top: 0; }
.buddy-quick button { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--action-border); background: var(--action); color: var(--action-ink); font: inherit; font-size: 14px; cursor: pointer; transition: transform .2s cubic-bezier(.3,1.6,.5,1), background .2s; opacity: 0; animation: msg-in .35s cubic-bezier(.2,1.2,.4,1) forwards; }
.buddy-quick button:nth-child(2) { animation-delay: .08s } .buddy-quick button:nth-child(3) { animation-delay: .16s } .buddy-quick button:nth-child(4) { animation-delay: .24s }
.buddy-quick button:hover { background: var(--action-hover); transform: translateY(-1px); }
.buddy-quick button[hidden] { display: none; }
.buddy.has-history .buddy-log .buddy-quick { display: none; }
@media (max-width: 760px) { .buddy-bubble { max-width: calc(100vw - 40px); } }

/* booking, visits, doctor cabinet */
.small { font-size: 13px; }
.steps { list-style: none; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; counter-reset: step; }
.steps li { counter-increment: step; display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.steps li::before { content: counter(step); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); font-weight: 700; margin-bottom: 4px; }
.steps li strong { color: var(--ink); font-size: 14px; }
.steps li.is-now { border-color: var(--accent); background: var(--wait-bg); }
.steps li.is-now::before { background: var(--accent); color: #fff; }
.login-form h2 { margin: 18px 0 4px; }
.price-line { font-size: 18px; }
.rating { color: #c98a12; font-size: 18px; margin: 4px 0; }
.booking h2 { margin-top: 0; }
.date-strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.date-chip { flex: none; scroll-snap-align: start; min-width: 64px; padding: 8px 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; font: inherit; transition: background .2s, border-color .2s, transform .15s; }
.date-chip span { font-size: 12px; color: var(--muted); }
.date-chip strong { font-size: 15px; white-space: nowrap; }
.date-chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.date-chip.is-active span { color: rgba(255,255,255,.85); }
.date-chip:active { transform: scale(.96); }
.time-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; margin: 4px 0 10px; animation: msg-in .25s both; }
.time-grid[hidden] { display: none; }
.time-chip { position: relative; margin: 0; }
.time-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.time-chip span { display: block; text-align: center; padding: 10px 0; border-radius: 12px; border: 1px solid var(--action-border); background: var(--action); color: var(--action-ink); font-weight: 600; cursor: pointer; transition: background .2s, transform .15s; }
.time-chip input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; transform: scale(1.03); }
.time-chip input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn-ghost { background: transparent !important; border: 1px solid var(--line) !important; color: var(--muted) !important; margin-top: 8px; }
.btn-call { background: #2f9e6e !important; border-color: #2f9e6e !important; color: #fff !important; display: block; text-align: center; text-decoration: none; animation: call-glow 2s infinite; }
@keyframes call-glow { 0%,100% { box-shadow: 0 0 0 0 rgba(47,158,110,.45) } 50% { box-shadow: 0 0 0 10px rgba(47,158,110,0) } }
.visit-when { font-size: 20px; margin: 6px 0 10px; }
.visit-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin: 0 0 8px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: transform .15s, box-shadow .2s; }
.visit-row:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.visit-row.is-past { opacity: .75; }
.visit-date { display: flex; flex-direction: column; align-items: center; min-width: 52px; padding: 6px 4px; border-radius: 12px; background: var(--surface-2); color: var(--accent); font-size: 13px; }
.visit-date strong { font-size: 16px; }
.visit-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.visit-info .muted { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag.pulse { animation: call-glow 2s infinite; }
.menu-list { display: flex; flex-direction: column; margin: 18px 0; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.menu-list a { padding: 14px 16px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; }
.menu-list a::after { content: "›"; color: var(--muted); }
.menu-list a:last-child { border-bottom: 0; }
.menu-list a:hover { background: var(--surface-2); }
.doctor-head { display: flex; align-items: center; gap: 14px; }
.doctor-head img { border-radius: 50%; object-fit: cover; border: 2px solid #fff; box-shadow: var(--shadow); }
.doctor-head h1 { margin: 0; }
.days li form { margin: 0 0 0 auto; }
.link-btn { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.link-btn:hover { background: var(--danger-bg); color: var(--danger-ink); }
.hours-form { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; align-items: end; }
.hours-form .btn { grid-column: 1 / -1; }
.hours-form label { margin: 0; }
.stars { display: inline-flex; flex-direction: row-reverse; gap: 4px; margin-bottom: 8px; }
.stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars label { font-size: 34px; color: #d7dee4; cursor: pointer; transition: color .15s, transform .15s; margin: 0; }
.stars label:hover, .stars label:hover ~ label, .stars input:checked ~ label { color: #f2b01e; }
.stars label:active { transform: scale(.9); }

/* video call */
.call-body { margin: 0; background: #0f1d28; color: #fff; }
.call { position: fixed; inset: 0; overflow: hidden; background: radial-gradient(circle at 50% 35%, #23455e, #0f1d28 70%); }
.call-remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s; background: #000; }
.call.has-remote .call-remote { opacity: 1; }
.call-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 24px; transition: opacity .4s; }
.call.has-remote .call-placeholder { opacity: 0; pointer-events: none; }
.call-avatar { position: relative; z-index: 1; width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; font-size: 44px; font-weight: 700; background: linear-gradient(135deg, #5aa6d6, #2a6f9a); box-shadow: 0 12px 40px rgba(0,0,0,.35); }
.call-pulse { position: absolute; width: 112px; height: 112px; border-radius: 50%; top: calc(50% - 56px - 34px); border: 2px solid rgba(124,190,232,.6); animation: ring 2s ease-out infinite; }
.call.is-blocked .call-pulse { display: none; }
@keyframes ring { from { transform: scale(1); opacity: 1 } to { transform: scale(1.9); opacity: 0 } }
.call-placeholder strong { font-size: 22px; }
.call-status { color: rgba(255,255,255,.75); max-width: 340px; line-height: 1.45; }
.call-top { position: absolute; top: 0; left: 0; right: 0; padding: calc(14px + env(safe-area-inset-top)) 18px 30px; display: flex; flex-direction: column; gap: 2px; background: linear-gradient(rgba(0,0,0,.45), transparent); }
.call-name { font-weight: 700; font-size: 17px; }
.call-meta { font-size: 13px; color: rgba(255,255,255,.75); font-variant-numeric: tabular-nums; }
.call-self { position: absolute; right: 16px; top: calc(70px + env(safe-area-inset-top)); width: 120px; height: 160px; object-fit: cover; border-radius: 16px; background: #1b3346; border: 2px solid rgba(255,255,255,.25); box-shadow: 0 8px 24px rgba(0,0,0,.35); transform: scaleX(-1); transition: opacity .3s; }
.call.cam-off .call-self { opacity: .25; }
.call-toast { position: absolute; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); transform: translateX(-50%); margin: 0; padding: 10px 16px; border-radius: 14px; background: rgba(0,0,0,.6); backdrop-filter: blur(8px); font-size: 14px; max-width: 90%; text-align: center; animation: msg-in .3s both; }
.call-toast[hidden] { display: none; }
.call-bar { position: absolute; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 14px; padding: 10px 14px; border-radius: 999px; background: rgba(15,29,40,.6); backdrop-filter: blur(12px); }
.call-btn { width: 56px; height: 56px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(255,255,255,.14); color: #fff; cursor: pointer; transition: background .2s, transform .15s; }
.call-btn:hover { background: rgba(255,255,255,.24); }
.call-btn:active { transform: scale(.92); }
.call-btn[hidden] { display: none; }
.call-btn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.call-btn .off { display: none; }
.call-btn[aria-pressed="true"] { background: #fff; color: #0f1d28; }
.call-btn[aria-pressed="true"] .off { display: inline; }
.call-end { background: #e0474c; }
.call-end:hover { background: #c93a3f; }
.call-end svg { fill: currentColor; stroke: none; }
@media (min-width: 900px) { .call-self { width: 220px; height: 150px; right: 24px; } }
