/* Tresenfrei Team: one stylesheet, everything served from our own server (no CDNs).
   The look follows coss ui (https://coss.com/ui, Cal.com, components MIT licensed): neutral
   surfaces with hairline alpha borders, 10px radius, small shadows, medium weights. Its React
   components are not used; the tokens and component styles are rewritten here in plain CSS.
   Colour roles: brand green only for actions and the current tab, amber only for "asked for
   you", red only for late and now. Font: Inter (SIL Open Font License 1.1), vendor/OFL-Inter.txt. */

@font-face {
  font-family: "Inter";
  src: url("/static/vendor/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --background: #fafafa;
  --card: #ffffff;
  --foreground: #262626;
  --strong: #171717;
  --muted-foreground: #686868;
  --faint: #8f8f8f;
  --border: rgb(0 0 0 / 8%);
  --input: rgb(0 0 0 / 11%);
  --muted: rgb(0 0 0 / 4%);
  --ring: #a3a3a3;
  --primary: #0c6152;
  --primary-hover: #0a5246;
  --primary-foreground: #ffffff;
  --primary-tint: rgb(12 97 82 / 8%);
  --wish: #b45309;
  --wish-tint: rgb(245 158 11 / 12%);
  --wish-line: rgb(245 158 11 / 36%);
  --ok: #047857;
  --ok-tint: rgb(16 185 129 / 10%);
  --late: #b91c1c;
  --late-solid: #dc2626;
  --late-tint: rgb(239 68 68 / 8%);
  --late-line: rgb(239 68 68 / 32%);
  --info: #1d4ed8;
  --info-tint: rgb(59 130 246 / 8%);
  --info-line: rgb(59 130 246 / 28%);
  --closed: repeating-linear-gradient(135deg, rgb(0 0 0 / 3.5%) 0 6px, transparent 6px 12px);
  --t0: #2f6f9f;
  --t1: #8a4f9e;
  --t2: #b8651f;
  --t3: #3b8456;
  --t4: #6b6f2a;
  --t5: #a33b5c;
  --t6: #3f6b74;
  --t7: #7a5a3a;
  --shadow-xs: 0 1px 2px rgb(0 0 0 / 5%);
  --shadow-sm: 0 1px 3px rgb(0 0 0 / 6%), 0 1px 2px -1px rgb(0 0 0 / 6%);
  --shadow-lg: 0 12px 24px -6px rgb(0 0 0 / 10%), 0 4px 8px -4px rgb(0 0 0 / 6%);
  --edge: inset 0 -1px rgb(0 0 0 / 4%);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius: 10px;
  --radius-xl: 14px;
  --radius-2xl: 16px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --nav-h: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #161616;
    --card: #1c1c1c;
    --foreground: #f0f0f0;
    --strong: #fafafa;
    --muted-foreground: #9a9a9a;
    --faint: #7a7a7a;
    --border: rgb(255 255 255 / 8%);
    --input: rgb(255 255 255 / 11%);
    --muted: rgb(255 255 255 / 5%);
    --ring: #737373;
    --primary: #5fc4ab;
    --primary-hover: #74cfb8;
    --primary-foreground: #04201a;
    --primary-tint: rgb(95 196 171 / 14%);
    --wish: #fbbf24;
    --wish-tint: rgb(245 158 11 / 16%);
    --wish-line: rgb(245 158 11 / 40%);
    --ok: #34d399;
    --ok-tint: rgb(16 185 129 / 16%);
    --late: #f87171;
    --late-solid: #ef4444;
    --late-tint: rgb(239 68 68 / 16%);
    --late-line: rgb(239 68 68 / 40%);
    --info: #60a5fa;
    --info-tint: rgb(59 130 246 / 16%);
    --info-line: rgb(59 130 246 / 40%);
    --closed: repeating-linear-gradient(135deg, rgb(255 255 255 / 3.5%) 0 6px, transparent 6px 12px);
    --t0: #6fa8d6;
    --t1: #c08fd2;
    --t2: #e39a5a;
    --t3: #74c08f;
    --t4: #c2c46a;
    --t5: #e07c9b;
    --t6: #7fb3bd;
    --t7: #c9a07a;
    --shadow-xs: 0 1px 2px rgb(0 0 0 / 30%);
    --shadow-sm: 0 1px 3px rgb(0 0 0 / 35%);
    --shadow-lg: 0 16px 32px -8px rgb(0 0 0 / 60%);
    --edge: inset 0 1px rgb(255 255 255 / 5%);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--background);
  color: var(--foreground);
  font: 15px/1.5 var(--font);
  font-feature-settings: "cv11";
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
svg { flex: none; max-width: 24px; max-height: 24px; }
.t, .appt b, .when, .msg .by, .badge, .daygrid .hours, .next .clock, .count { font-variant-numeric: tabular-nums; }
button { cursor: pointer; }
a { color: var(--primary); text-underline-offset: 3px; }
h1, h2, h3 { color: var(--strong); margin: 0; }
h1 { font-size: 24px; line-height: 1.2; font-weight: 600; letter-spacing: -0.022em; }
h2 { font-size: 15px; line-height: 1.4; font-weight: 600; letter-spacing: -0.006em; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: var(--radius-md); }

/* ---------------------------------------------------------------- plain pages */

.plain-page { max-width: 30rem; margin: 15vh auto 0; padding: 0 20px; display: grid; gap: 14px; justify-items: start; }
.plain-page .fine { color: var(--muted-foreground); font-size: 13px; margin-top: 24px; }
.noscript { padding: 20px; }
.splash { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted-foreground); }

/* ---------------------------------------------------------------- shell */

.app { min-height: 100dvh; }
.shell { min-height: 100dvh; padding-bottom: calc(var(--nav-h) + var(--safe-b)); }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + var(--safe-t)) 16px 10px;
  background: color-mix(in srgb, var(--background) 84%, transparent);
  backdrop-filter: saturate(1.6) blur(16px);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid var(--border);
}
.topbar .logo { width: 28px; height: 28px; flex: none; border-radius: 7px; }
.topbar .where { min-width: 0; flex: 1; line-height: 1.3; }
.topbar .where b { display: block; color: var(--strong); font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .where span { display: block; color: var(--muted-foreground); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.live-dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-tint); }

.view { padding: 20px 16px 32px; max-width: 640px; margin: 0 auto; display: grid; gap: 20px; }
.view.wide { max-width: none; }
.view.chatmode { padding: 0; max-width: none; display: block; }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(16px);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-top: 1px solid var(--border);
}
.nav button {
  position: relative; display: grid; justify-items: center; align-content: center; gap: 2px;
  border: 0; background: none; color: var(--muted-foreground); font-size: 11px; font-weight: 500; padding: 6px 2px;
}
.nav button svg { width: 24px; height: 24px; }
.nav button[aria-current="page"] { color: var(--primary); font-weight: 600; }
.nav .count {
  position: absolute; top: 3px; left: calc(50% + 5px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--late-solid); color: #fff; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px var(--card);
}

@media (min-width: 900px) {
  .shell { padding-bottom: 0; padding-left: 88px; }
  .nav { top: 0; right: auto; width: 88px; height: auto; grid-template-columns: 1fr; grid-auto-rows: 68px; align-content: start; padding-top: 68px; border-top: 0; border-right: 1px solid var(--border); }
}

/* ---------------------------------------------------------------- common pieces */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.page-head .titles { display: grid; gap: 2px; min-width: 0; }
.page-head .sub { color: var(--muted-foreground); font-size: 15px; }
.lead { color: var(--muted-foreground); font-size: 14px; margin-top: -8px; }
.muted { color: var(--muted-foreground); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: grid; gap: 10px; }
.section { display: grid; gap: 8px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 2px; }
.section-title .muted { font-size: 13px; }

/* coss Card: white, hairline border, small shadow, slightly heavier bottom edge */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xs), var(--edge); padding: 14px 16px;
}
.card.flat { box-shadow: none; }
.card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  margin: 2px -16px -14px; padding: 10px 16px 12px; border-top: 1px solid var(--border);
  background: var(--muted); border-radius: 0 0 calc(var(--radius-2xl) - 1px) calc(var(--radius-2xl) - 1px);
}

/* coss Frame / Group: rows in one bordered box, separated by hairlines */
.frame {
  list-style: none; margin: 0; padding: 0;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xs), var(--edge); overflow: hidden;
}
.frame > * + * { border-top: 1px solid var(--border); }

/* coss Empty */
.empty { text-align: center; color: var(--muted-foreground); padding: 36px 20px; display: grid; gap: 6px; justify-items: center; font-size: 14px; }
.empty b { color: var(--strong); font-size: 16px; font-weight: 600; }
.empty .btn { margin-top: 8px; }

/* coss Button */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 8px 14px; border-radius: var(--radius);
  border: 1px solid var(--input); background: var(--card); color: var(--foreground);
  box-shadow: var(--shadow-xs), var(--edge);
  font-weight: 500; font-size: 15px; line-height: 1.2; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, box-shadow .15s;
}
.btn svg { width: 18px; height: 18px; opacity: .8; margin: 0 -1px; }
.btn:hover { background: color-mix(in srgb, var(--card) 96%, var(--foreground)); }
.btn:active { box-shadow: none; }
.btn.primary {
  background: var(--primary); border-color: var(--primary); color: var(--primary-foreground);
  box-shadow: inset 0 1px rgb(255 255 255 / 16%), 0 1px 2px color-mix(in srgb, var(--primary) 30%, transparent);
}
.btn.primary:hover { background: var(--primary-hover); }
.btn.primary:active { box-shadow: inset 0 1px rgb(0 0 0 / 8%); }
.btn.ok { background: var(--ok-tint); border-color: transparent; color: var(--ok); box-shadow: none; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--foreground); }
.btn.ghost:hover { background: var(--muted); }
.btn.small { min-height: 34px; padding: 6px 11px; font-size: 14px; border-radius: var(--radius-md); gap: 6px; }
.btn.small svg { width: 16px; height: 16px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .64; cursor: default; }
@media (pointer: coarse) { .btn.small::after { content: ""; position: absolute; inset: -5px 0; } }
.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: var(--radius);
  border: 1px solid var(--input); background: var(--card); color: var(--foreground); box-shadow: var(--shadow-xs), var(--edge);
}
.icon-btn svg { width: 20px; height: 20px; opacity: .8; }
.icon-btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.icon-btn.ghost:hover { background: var(--muted); }

/* coss Group: buttons joined into one control */
.group { display: inline-flex; border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.group > * { border-radius: 0; box-shadow: var(--edge); }
.group > :first-child { border-radius: var(--radius) 0 0 var(--radius); }
.group > :last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.group > * + * { margin-left: -1px; }

/* coss Badge */
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 6px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; line-height: 1; white-space: nowrap;
  background: var(--muted); color: var(--foreground); border: 1px solid transparent;
}
.badge svg { width: 13px; height: 13px; opacity: .9; }
.badge.outline { background: transparent; border-color: var(--input); }
.badge.wish { background: var(--wish-tint); color: var(--wish); }
.badge.ok { background: var(--ok-tint); color: var(--ok); }
.badge.late { background: var(--late-tint); color: var(--late); }
.badge.new { background: var(--info-tint); color: var(--info); }
.badge.brand { background: var(--primary-tint); color: var(--primary); }

.who { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--foreground); white-space: nowrap; }
.who::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--faint)); }

.c0 { --c: var(--t0); } .c1 { --c: var(--t1); } .c2 { --c: var(--t2); } .c3 { --c: var(--t3); }
.c4 { --c: var(--t4); } .c5 { --c: var(--t5); } .c6 { --c: var(--t6); } .c7 { --c: var(--t7); }

/* coss Segmented control */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--muted); padding: 2px; border-radius: var(--radius); gap: 2px; }
.seg button {
  border: 1px solid transparent; background: none; min-height: 34px; padding: 5px 10px; border-radius: var(--radius-md);
  font-weight: 500; font-size: 14px; color: color-mix(in srgb, var(--muted-foreground) 85%, transparent);
}
.seg button[aria-pressed="true"] { background: var(--card); color: var(--strong); box-shadow: var(--shadow-sm); border-color: var(--border); }

.daynav { display: flex; align-items: center; gap: 8px; flex: none; }

/* coss Alert */
.notice {
  display: grid; grid-template-columns: 18px 1fr auto; gap: 2px 10px; align-items: start;
  padding: 12px 14px; border-radius: var(--radius-xl); border: 1px solid var(--late-line); background: var(--late-tint); color: var(--late);
  font-size: 14px;
}
.notice svg { width: 18px; height: 18px; margin-top: 1px; }
.notice .text { display: grid; gap: 1px; color: var(--muted-foreground); }
.notice .text b { color: var(--strong); font-weight: 500; }
.notice .btn { align-self: center; }
.notice.info { border-color: var(--border); background: var(--card); color: var(--muted-foreground); }
.notice.brand { border-color: color-mix(in srgb, var(--primary) 28%, transparent); background: var(--primary-tint); color: var(--primary); }

/* ---------------------------------------------------------------- login */

.login { max-width: 28rem; margin: 0 auto; padding: calc(40px + var(--safe-t)) 16px 40px; display: grid; gap: 20px; }
.login header { display: grid; gap: 4px; justify-items: start; }
.login header img { width: 48px; height: 48px; border-radius: 12px; margin-bottom: 12px; }
.login header .sub { color: var(--muted-foreground); }
.login > p { color: var(--muted-foreground); }
.person {
  display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
  padding: 12px 16px; border: 0; background: none;
}
.person:hover { background: var(--muted); }
.person .avatar { flex: none; }
.person b { color: var(--strong); display: block; font-weight: 500; }
.person span { color: var(--muted-foreground); font-size: 13px; }
.person .tag { margin-left: auto; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-size: 14px; font-weight: 500; color: var(--foreground); }
/* coss Input */
.field input, .field select, .field textarea, .composer textarea {
  width: 100%; min-width: 0; min-height: 40px; padding: 8px 12px; border-radius: var(--radius);
  border: 1px solid var(--input); background: var(--card); box-shadow: var(--shadow-xs), var(--edge);
  font-size: 16px; transition: border-color .15s, box-shadow .15s;
}
.field select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--muted-foreground) 50%), linear-gradient(135deg, var(--muted-foreground) 50%, transparent 50%); background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible, .composer textarea:focus-visible {
  outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 24%, transparent);
}
.form-error { color: var(--late); font-size: 14px; }

/* coss Avatar */
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: color-mix(in srgb, var(--c, var(--foreground)) 12%, var(--card)); color: var(--c, var(--foreground));
  font-weight: 500; font-size: 13px; letter-spacing: .01em;
}
.avatar.small { width: 30px; height: 30px; font-size: 12px; }
.avatar svg { width: 18px; height: 18px; }

/* ---------------------------------------------------------------- today: next patient */

.next { display: grid; gap: 10px; padding: 16px; }
.next .lineup { display: grid; grid-template-columns: auto 1fr; gap: 0 14px; align-items: baseline; }
.next .clock { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; color: var(--strong); line-height: 1.2; }
.next .name { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; color: var(--strong); line-height: 1.2; overflow-wrap: anywhere; }
.next .until { color: var(--muted-foreground); font-size: 14px; }
.next .what { color: var(--muted-foreground); font-size: 15px; }
.next .wishline { display: flex; align-items: center; gap: 8px; color: var(--wish); font-weight: 500; font-size: 15px; }
.next .wishline svg { width: 18px; height: 18px; }
.next .badges { display: flex; gap: 6px; flex-wrap: wrap; }
.next .card-foot { margin-top: 4px; justify-content: flex-start; }
.next .card-foot .running { flex-basis: 100%; color: var(--muted-foreground); font-size: 13px; }
.next.quiet .name { font-size: 20px; }

/* ---------------------------------------------------------------- day list (therapist and front desk) */

.slot { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: start; }
.slot .t { display: grid; gap: 4px; font-size: 15px; line-height: 24px; font-weight: 600; color: var(--strong); padding: 12px 0 0 16px; }
.slot .t small { font-weight: 400; color: var(--muted-foreground); font-size: 13px; line-height: 21px; }
.slot .body {
  display: grid; gap: 4px; text-align: left; width: 100%; min-width: 0;
  padding: 12px 16px 12px 4px; border: 0; background: none; color: inherit;
}
.slot .body b { color: var(--strong); font-size: 16px; line-height: 24px; font-weight: 500; }
.slot .meta { display: flex; gap: 4px 6px; flex-wrap: wrap; align-items: center; color: var(--muted-foreground); font-size: 14px; line-height: 21px; }
.slot.done .t, .slot.done .body b { color: var(--muted-foreground); font-weight: 400; }
.slot.now { background: var(--primary-tint); }
.slot.now .t { color: var(--primary); }
.slot.gap { grid-template-columns: 52px 1fr; color: var(--muted-foreground); font-size: 13px; }
.slot.gap .t { font-size: 13px; line-height: 20px; font-weight: 400; color: var(--faint); padding: 8px 0 8px 16px; }
.slot.gap .body { padding: 8px 16px 8px 4px; }

.arrival { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 10px 14px 10px 16px; }
.arrival .t { font-weight: 600; color: var(--strong); font-size: 15px; }
.arrival .main { min-width: 0; display: grid; gap: 4px; text-align: left; border: 0; background: none; padding: 2px 0; color: inherit; }
.arrival .main b { color: var(--strong); font-weight: 500; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arrival .main .meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ---------------------------------------------------------------- practice day grid */

.grid-wrap {
  overflow: auto; margin: 0 -16px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  height: calc(100dvh - var(--nav-h) - var(--safe-b) - var(--safe-t) - 220px); min-height: 360px;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--card);
}
@media (min-width: 900px) { .grid-wrap { height: calc(100dvh - 220px); margin: 0; border: 1px solid var(--border); border-radius: var(--radius-2xl); } }
.daygrid { position: relative; display: grid; grid-template-columns: 40px repeat(var(--cols), minmax(104px, 1fr)); min-width: calc(40px + var(--cols) * 104px); }
.daygrid .head { position: sticky; top: 0; z-index: 5; background: var(--card); padding: 8px 4px; display: grid; justify-items: center; gap: 2px; border-bottom: 1px solid var(--border); }
.daygrid .head .avatar { width: 28px; height: 28px; font-size: 11px; }
.daygrid .head b { font-size: 13px; font-weight: 500; color: var(--strong); white-space: nowrap; }
.daygrid .head span { font-size: 12px; color: var(--muted-foreground); white-space: nowrap; }
.daygrid .corner { position: sticky; top: 0; left: 0; z-index: 7; background: var(--card); border-bottom: 1px solid var(--border); }
.daygrid .hours { position: sticky; left: 0; z-index: 6; background: var(--card); }
.daygrid .hours span { position: absolute; right: 6px; transform: translateY(-50%); font-size: 12px; color: var(--muted-foreground); }
.daygrid .hours span:first-child { transform: none; }
.daygrid .col { position: relative; border-left: 1px solid var(--border); background-image: linear-gradient(var(--border) 1px, transparent 1px); background-size: 100% var(--hour); }
.daygrid .off { position: absolute; left: 0; right: 0; background: var(--closed); }
.daygrid .absent { position: absolute; inset: 0; background: var(--closed); display: grid; place-items: start center; padding-top: 24px; }
.daygrid .absent span { background: var(--card); padding: 3px 8px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; color: var(--muted-foreground); border: 1px solid var(--border); }
.appt {
  position: absolute; left: 3px; right: 3px; overflow: hidden; text-align: left;
  border-radius: var(--radius-md); border: 0; padding: 5px 7px; display: grid; align-content: start; gap: 2px;
  background: color-mix(in srgb, var(--c) 12%, var(--card)); color: var(--strong);
  box-shadow: inset 3px 0 var(--c);
  font-size: 12px; line-height: 1.3;
}
.appt b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt .sub { display: flex; flex-wrap: wrap; gap: 2px 5px; align-items: center; color: var(--muted-foreground); white-space: nowrap; }
.appt .sub svg { width: 12px; height: 12px; }
.appt .w { color: var(--wish); display: inline-flex; }
.appt .a { color: var(--ok); display: inline-flex; }
.appt .l { color: var(--late); font-weight: 600; }
.appt .n { color: var(--info); font-weight: 600; }
.appt.past { opacity: .5; }
.daygrid .nowline { position: absolute; left: 0; right: 0; height: 2px; background: var(--late-solid); z-index: 4; pointer-events: none; }
.daygrid .hours .now { position: absolute; right: 2px; transform: translateY(-50%); z-index: 2; background: var(--late-solid); color: #fff; font-size: 11px; font-weight: 600; padding: 1px 4px; border-radius: 5px; }
.offday { font-size: 14px; color: var(--muted-foreground); margin-top: -8px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted-foreground); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend svg { width: 14px; height: 14px; }
.legend .wish-mark { color: var(--wish); }

/* ---------------------------------------------------------------- requests */

.request { display: grid; gap: 8px; }
.request .top { display: flex; align-items: center; gap: 8px; }
.request .kind { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: 14px; color: var(--primary); }
.request .kind svg { width: 16px; height: 16px; }
.request .kind.cancellation { color: var(--late); }
.request .kind.callback { color: var(--info); }
.request .when { margin-left: auto; font-size: 13px; color: var(--muted-foreground); }
.request .name { font-size: 17px; font-weight: 600; color: var(--strong); letter-spacing: -0.01em; }
.request .summary { color: var(--foreground); }
.request .dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; margin: 2px 0 0; font-size: 14px; }
.request .dl dt { color: var(--muted-foreground); }
.request .dl dd { margin: 0; color: var(--foreground); }
.request .badges { display: flex; gap: 6px; flex-wrap: wrap; }
.request .state { font-size: 14px; color: var(--muted-foreground); display: flex; align-items: center; gap: 6px; }
.request .state svg { width: 16px; height: 16px; }
.request .state.mine { color: var(--primary); font-weight: 500; }
.request .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.request.done .name, .request.done .summary { color: var(--muted-foreground); }
.request.fresh { animation: fresh 2.4s ease-out; }
@keyframes fresh { from { box-shadow: 0 0 0 3px var(--wish-line); } to { box-shadow: var(--shadow-xs); } }

/* ---------------------------------------------------------------- chat */

.channel { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 0; background: none; text-align: left; width: 100%; color: inherit; }
.channel:hover { background: var(--muted); }
.channel .txt { min-width: 0; flex: 1; display: grid; gap: 1px; }
.channel .txt b { color: var(--strong); font-weight: 500; }
.channel .txt span { color: var(--muted-foreground); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel .count { background: var(--primary); color: var(--primary-foreground); border-radius: 11px; min-width: 22px; height: 22px; font-size: 12px; font-weight: 600; display: grid; place-items: center; padding: 0 6px; }
.chat { display: grid; grid-template-rows: auto 1fr auto; height: calc(100dvh - var(--nav-h) - var(--safe-b) - 60px - var(--safe-t)); max-width: 640px; margin: 0 auto; }
@media (min-width: 900px) { .chat { height: calc(100dvh - 60px); } }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 8px 16px 8px 8px; border-bottom: 1px solid var(--border); }
.chat-head .txt { line-height: 1.3; }
.chat-head .txt b { color: var(--strong); font-weight: 600; }
.messages { overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 82%; display: grid; gap: 4px; align-self: flex-start; }
.msg .bubble { background: var(--card); border: 1px solid var(--border); padding: 8px 12px; border-radius: 16px 16px 16px 6px; color: var(--foreground); white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: var(--shadow-xs); }
.msg .by { font-size: 12px; color: var(--muted-foreground); display: flex; gap: 6px; padding: 0 4px; }
.msg.mine { align-self: flex-end; justify-items: end; }
.msg.mine .bubble { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); border-radius: 16px 16px 6px 16px; }
.msg .ref { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--input); background: var(--card); border-radius: var(--radius-md); padding: 5px 9px; font-size: 13px; color: var(--foreground); text-align: left; }
.msg .ref svg { width: 14px; height: 14px; color: var(--muted-foreground); }
.day-sep { align-self: center; font-size: 12px; color: var(--muted-foreground); padding: 4px 0; }
.composer { display: grid; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); background: var(--card); }
.composer .attach { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.composer form { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; resize: none; min-height: 40px; max-height: 140px; }
.composer .icon-btn { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); box-shadow: inset 0 1px rgb(255 255 255 / 16%); }
.composer .icon-btn svg { opacity: 1; }

/* ---------------------------------------------------------------- more */

.item { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 16px; }
.item .txt { flex: 1; min-width: 0; display: grid; gap: 1px; }
.item .txt b { color: var(--strong); font-weight: 500; }
.item .txt span { color: var(--muted-foreground); font-size: 14px; }
.me-card { display: flex; align-items: center; gap: 12px; }
.me-card .txt b { color: var(--strong); font-weight: 500; display: block; }
.form-grid { display: grid; gap: 14px 12px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.linkbox { display: grid; gap: 10px; padding: 14px; border-radius: var(--radius-xl); border: 1px solid color-mix(in srgb, var(--primary) 28%, transparent); background: var(--primary-tint); }
.linkbox b { color: var(--strong); font-weight: 500; }
.linkbox code { font-size: 13px; overflow-wrap: anywhere; color: var(--foreground); }
.bullets { margin: 0; padding-left: 18px; display: grid; gap: 6px; }

/* ---------------------------------------------------------------- patient card: coss Drawer */

.overlay {
  position: fixed; inset: 0; z-index: 50; display: grid; align-items: end;
  background: rgb(0 0 0 / 32%); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  animation: fade .3s cubic-bezier(.32, .72, 0, 1);
}
.sheet {
  background: var(--card); border-top: 1px solid var(--border); border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  max-height: 92dvh; overflow-y: auto; box-shadow: var(--shadow-lg);
  padding: 8px 16px 0; display: grid; gap: 16px; animation: up .45s cubic-bezier(.32, .72, 0, 1);
  width: 100%; max-width: 640px; margin: 0 auto;
}
@media (min-width: 700px) { .overlay { align-items: center; } .sheet { border-radius: var(--radius-2xl); border: 1px solid var(--border); } }
.sheet .grab { width: 36px; height: 5px; border-radius: 3px; background: var(--input); justify-self: center; }
.sheet .head { display: flex; align-items: flex-start; gap: 12px; }
.sheet .head .txt { flex: 1; display: grid; gap: 4px; min-width: 0; }
.sheet .head h2 { font-size: 20px; letter-spacing: -0.015em; line-height: 1.25; }
.sheet .head .icon-btn { margin: -4px -8px 0 0; }
.sheet .facts { border-radius: var(--radius-xl); }
.sheet .fact { display: grid; grid-template-columns: 20px 1fr; gap: 12px; padding: 12px 14px; align-items: start; }
.sheet .fact svg { width: 18px; height: 18px; color: var(--muted-foreground); margin-top: 2px; }
.sheet .fact b { color: var(--strong); display: block; font-weight: 500; }
.sheet .fact span { color: var(--muted-foreground); font-size: 14px; }
.sheet .fact .last-hint { display: inline; color: var(--late); font-size: inherit; font-weight: 500; }
.wishbox { display: grid; grid-template-columns: 20px 1fr; gap: 12px; padding: 12px 14px; border-radius: var(--radius-xl); border: 1px solid var(--wish-line); background: var(--wish-tint); color: var(--wish); }
.wishbox svg { width: 20px; height: 20px; }
.wishbox b { color: var(--strong); display: block; font-weight: 600; }
.wishbox span { color: var(--foreground); font-size: 14px; }
.wishbox.none { background: transparent; border-color: var(--border); color: var(--muted-foreground); }
.wishbox.none b { font-weight: 500; }
.wishbox.none span { color: var(--muted-foreground); }
.wishbox.any { background: var(--info-tint); border-color: var(--info-line); color: var(--info); }
.sheet { grid-template-columns: minmax(0, 1fr); }
.sheet .actions {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px 8px;
  margin: 0 -16px; padding: 14px 16px calc(14px + var(--safe-b)); border-top: 1px solid var(--border); background: var(--muted);
}
.sheet .actions .full { grid-column: 1 / -1; }
@media (min-width: 480px) { .sheet .actions { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sheet .actions .label { font-size: 14px; color: var(--muted-foreground); }
.sheet .actions .seg { background: color-mix(in srgb, var(--foreground) 6%, transparent); }
.sheet .foot { grid-column: 1 / -1; font-size: 13px; color: var(--muted-foreground); text-align: center; padding-top: 2px; }
.sheet .note-only { padding-bottom: calc(20px + var(--safe-b)); }

/* ---------------------------------------------------------------- toasts (coss Toast), cover */

.toasts { position: fixed; z-index: 60; left: 0; right: 0; top: calc(12px + var(--safe-t)); display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  pointer-events: auto; max-width: 360px; width: 100%; display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start;
  background: var(--card); color: var(--foreground); padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg), var(--edge); animation: drop .5s cubic-bezier(.22, 1, .36, 1); font-size: 14px; text-align: left;
}
.toast svg { width: 18px; height: 18px; margin-top: 1px; color: var(--muted-foreground); }
.toast.ok svg { color: var(--ok); }
.toast.wish svg { color: var(--wish); }
.toast.late svg { color: var(--late); }
.cover { position: fixed; inset: 0; z-index: 80; background: var(--background); display: none; place-content: center; justify-items: center; gap: 14px; color: var(--muted-foreground); padding: 24px; text-align: center; }
body.covered .cover { display: grid; }

@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(100%); } }
@keyframes drop { from { transform: translateY(calc(-100% - 12px)); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
