/* CareGrow clinic admin — builds on /super-admin/styles.css tokens */
.view { display: flex; flex-direction: column; gap: 20px; }
.row-gap { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font: 600 11px var(--f-body); margin-left: 6px; }
.role-chip { font-family: var(--f-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--primary-deep); }
.hold-banner { background: var(--amber-wash); color: var(--ink); border: 1px solid var(--amber); border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; font-size: 14px; }
.muted-text { color: var(--ink-faint); font-size: 13px; }
.form-panel .form-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.form-panel label, .modal-card label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--ink-soft); font-weight: 500; }
.form-panel input, .form-panel select, .form-panel textarea, .modal-card input, .modal-card select, .modal-card textarea, .search, .mini {
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font: 14px var(--f-body); color: var(--ink);
}
.form-panel textarea, .modal-card textarea { resize: vertical; }
label.check { flex-direction: row; align-items: center; gap: 8px; }
.file-btn { cursor: pointer; display: inline-flex; align-items: center; }
.ghost.danger { color: var(--red); border-color: var(--red); margin-right: auto; }
.modal-card.wide { max-width: 860px; }
a.ghost { text-decoration: none; display: inline-flex; align-items: center; }

.logo-row { display: flex; align-items: center; gap: 14px; }
.logo-preview { width: 56px; height: 56px; border-radius: 12px; background: var(--surface-2) center/cover no-repeat; border: 1px solid var(--line); }
.logo-preview.round { border-radius: 50%; }

.status { font-family: var(--f-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; padding: 3px 9px; border-radius: 999px; display: inline-block; }
.status.booked { background: var(--surface-2); color: var(--ink-soft); }
.status.confirmed { background: var(--primary-wash); color: var(--primary-deep); }
.status.completed { background: #efe9fb; color: #6a46c2; }
.status.cancelled { background: var(--amber-wash); color: var(--amber); text-decoration: line-through; }
.status.noshow { background: var(--amber-wash); color: var(--red); }

.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days label { flex-direction: row; align-items: center; gap: 4px; background: var(--surface-2); padding: 6px 10px; border-radius: 8px; font-size: 13px; }

/* profile */
.profile-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.alert-chip { background: #fdecea; color: #b3261e; border-radius: 8px; padding: 8px 12px; font-size: 13px; margin: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tab { background: none; border: none; padding: 10px 14px; font: 500 14px var(--f-body); color: var(--ink-soft); border-bottom: 2px solid transparent; }
.tab.active { color: var(--primary-deep); border-bottom-color: var(--primary); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-top: 14px; }
.tile { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; cursor: pointer; max-width: 100%; }
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; }
.tile .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 7px; font-size: 11px; background: rgba(0,0,0,.55); color: #fff; }
.tile .pdf { font-family: var(--f-mono); font-size: 13px; color: var(--ink-soft); }
.visit-form { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.visits { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.visit { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--bg); }
.visit .vh { font-size: 12px; color: var(--ink-faint); margin-bottom: 6px; }
.visit p { margin: 0; white-space: pre-wrap; font-size: 14px; }
.visit .rx { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.visit.unread { border-color: var(--primary); }
.cam-video { width: 100%; max-height: 60vh; background: #000; border-radius: 12px; }

/* chat */
.chat { display: grid; grid-template-columns: 240px 1fr; grid-template-rows: minmax(0, 1fr); height: calc(100vh - 170px); min-height: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.chat-list { border-right: 1px solid var(--line); overflow-y: auto; padding: 8px; min-height: 0; }
.chat-list-head { font-family: var(--f-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); padding: 10px 8px 6px; }
.chat-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.chat-item:hover { background: var(--surface-2); }
.chat-item.active { background: var(--primary-wash); color: var(--primary-deep); }
.chat-item small { color: var(--ink-faint); font-size: 11px; text-transform: capitalize; }
.chat-thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.chat-thread-head { padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 600; }
.chat-msgs { flex: 1 1 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 72%; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); font-size: 14px; overflow-wrap: anywhere; align-self: flex-start; }
.msg.mine { align-self: flex-end; background: var(--primary-wash); }
.msg .who { font-size: 11px; color: var(--primary-deep); font-weight: 600; margin-bottom: 2px; }
.msg .meta { font-size: 11px; color: var(--ink-faint); text-align: right; margin-top: 3px; }
.msg .mention { color: var(--primary-deep); font-weight: 600; }
.chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.chat-input input { flex: 1; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: 14px var(--f-body); color: var(--ink); min-width: 0; }
@media (max-width: 760px) {
  .chat { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr); height: calc(100dvh - 190px - env(safe-area-inset-bottom, 0px)); min-height: 360px; }
  .chat-list { border-right: none; }
  .chat .chat-thread { display: none; }
  .chat.thread-open .chat-list { display: none; }
  .chat.thread-open .chat-thread { display: flex; }
  .msg { max-width: 88%; }
}
body.readonly [data-write] { opacity: .45; pointer-events: none; }

#muteBtn.needs-sound { border-color: var(--amber); color: var(--amber); animation: cgPulse 1.6s ease-in-out infinite; }
@keyframes cgPulse { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--amber) 25%, transparent); } }
@media (prefers-reduced-motion: reduce) { #muteBtn.needs-sound { animation: none; } }

/* chat history + attachments */
.chat-input { align-items: center; }
.attach-btn { cursor: pointer; font-size: 20px; padding: 6px 8px; border-radius: 8px; line-height: 1; }
.attach-btn:hover { background: var(--surface-2); }
.chat-attach-status { padding: 6px 16px; font-size: 13px; color: var(--primary-deep); border-top: 1px solid var(--line); }
.day-sep { display: flex; align-items: center; gap: 10px; margin: 10px 0 4px; color: var(--ink-faint); font-size: 12px; }
.day-sep::before, .day-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.day-sep span { background: var(--surface-2); padding: 3px 10px; border-radius: 999px; }
.load-earlier { align-self: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--primary-deep); border-radius: 999px; padding: 6px 14px; font: 600 12px var(--f-body); cursor: pointer; }
.chat-start { align-self: center; color: var(--ink-faint); font-size: 12px; }
.att { display: block; margin: 2px 0 6px; max-width: 280px; }
.att-img img, .att-video video { width: 100%; max-height: 260px; object-fit: cover; border-radius: 10px; display: block; cursor: pointer; background: #000; }
.att-loading { font-size: 12px; color: var(--ink-faint); }
.att-file { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: 14px var(--f-body); color: var(--ink); cursor: pointer; }
.att-file span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-file small { color: var(--ink-faint); }

/* profile + settings */
.site-card-body { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px; flex-wrap: wrap; }
.site-card-body > div:first-child { min-width: 0; flex: 1 1 320px; }
.k-label { font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-faint); margin-bottom: 6px; }
.site-url { display: block; font-family: var(--f-mono); font-size: 15px; color: var(--primary-deep); overflow-wrap: anywhere; margin-bottom: 6px; }
.btn-link { text-decoration: none; display: inline-flex; align-items: center; }
.settings { gap: 0 !important; }
.setting { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.setting.col { flex-direction: column; align-items: stretch; gap: 10px; }
.setting h3 { font-size: 15px; margin: 0 0 2px; }
.setting p { margin: 0; }
.setting-sub { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 640px) { .setting-sub { grid-template-columns: 1fr; } }
.switch { position: relative; width: 46px; height: 26px; flex: 0 0 auto; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--primary-wash); color: var(--primary-deep); border-radius: 999px; padding: 5px 6px 5px 12px; font-size: 13px; }
.chip button { border: none; background: transparent; color: inherit; cursor: pointer; font-size: 12px; padding: 2px 6px; border-radius: 999px; }
.chip button:hover { background: rgba(0,0,0,.08); }

.legal { font-size: 11px; line-height: 1.5; color: var(--ink-faint); }

/* ───────── Mobile app shell: bottom tabs + slide-in menu ───────── */
.chat-thread-head { display: flex; align-items: center; gap: 8px; }
.chat-back { display: none; background: none; border: none; color: var(--primary-deep); font-size: 30px; line-height: 1; padding: 0 8px 4px 0; cursor: pointer; }
.chat-item { min-height: 44px; }
.tabbar { display: none; }
.drawer-backdrop { display: none; }
.install-btn { width: 100%; }
.ios-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; color: var(--ink-soft); }
@media (max-width: 760px) {
  .chat-back { display: inline-block; }
  .chat-input { padding: 8px 10px; }
  .msg { max-width: 86%; }
  .att { max-width: 220px; }
  .topbar { margin-bottom: 14px; }
  .topbar-actions .lbl { display: none; }
  .topbar-actions .ghost { min-height: 38px; padding: 6px 10px; }
  #muteBtn { font-size: 12px; }

  /* sidebar → slide-in menu (opened from "More") */
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(82vw, 300px); flex-direction: column; align-items: stretch; flex-wrap: nowrap;
    padding: calc(20px + env(safe-area-inset-top, 0px)) 16px calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 60;
    transform: translateX(-102%); transition: transform .22s ease; overflow-y: auto; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .sidebar nav { flex-direction: column; }
  .sidebar .nav-item { padding: 12px 12px; font-size: 15px; }
  .side-foot { margin: auto 0 0; flex-direction: column; align-items: stretch; }
  .me { flex-direction: column; align-items: flex-start; }
  .drawer-backdrop { display: block; position: fixed; inset: 0; background: rgba(8,12,22,.5); z-index: 55; }
  .drawer-backdrop[hidden] { display: none; }

  /* bottom tab bar */
  .content { padding-bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--surface); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -6px 20px rgba(0,0,0,.06); }
  .tabbar[hidden] { display: none; }
  .tabbar button { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: none; padding: 6px 2px; border-radius: 12px; color: var(--ink-faint); font: 500 11px var(--f-body); min-height: 52px; cursor: pointer; }
  .tabbar button .ti { font-size: 20px; line-height: 1.1; filter: grayscale(1); opacity: .7; }
  .tabbar button.active { color: var(--primary-deep); background: var(--primary-wash); }
  .tabbar button.active .ti { filter: none; opacity: 1; }
  .tab-badge { position: absolute; top: 2px; right: calc(50% - 22px); margin: 0; }

  /* profile / settings / gallery */
  .profile-head { gap: 8px; }
  .tabs { overflow-x: auto; }
  .tab { white-space: nowrap; padding: 10px 12px; }
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .setting { padding: 14px 0; }
  .site-card-body .row-gap { width: 100%; }
  .site-card-body .row-gap > * { flex: 1; justify-content: center; }
  .cam-video { max-height: 55dvh; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

/* ───────── v2 polish: icons, header, compact cards, chat list ───────── */
.ic { width: 18px; height: 18px; flex: 0 0 auto; }
.icon-btn { display: inline-flex; align-items: center; gap: 6px; position: relative; }
.icon-btn .badge { margin-left: 2px; }
tr.tap { cursor: pointer; }
tr.tap:hover td { background: var(--surface-2); }

/* chat list rows */
.chat-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; }
.chat-item .avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto;
  background: var(--primary-wash); color: var(--primary-deep); font: 700 13px var(--f-body); }
.chat-item .ci-main { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 1px; }
.chat-item .ci-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.chat-item .ci-top b { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item .ci-time { color: var(--ink-faint); font-size: 11px; flex: 0 0 auto; text-transform: none; }
.chat-item .ci-sub { color: var(--ink-faint); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item.unread .ci-sub { color: var(--ink); font-weight: 600; }
.chat-item.unread .ci-time { color: var(--primary-deep); font-weight: 600; }
.chat-item .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); flex: 0 0 auto; }

@media (max-width: 760px) {
  /* sticky app header with icon-only actions */
  .topbar { position: sticky; top: 0; z-index: 30; margin: -18px -14px 14px; padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px;
    background: var(--bg);
    border-bottom: 1px solid var(--line); flex-wrap: nowrap; }
  .topbar h1 { font-size: 20px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-actions { flex-wrap: nowrap; gap: 6px; flex: 0 0 auto; }
  .topbar-actions .icon-btn { width: 40px; height: 40px; min-height: 40px; padding: 0; justify-content: center; border-radius: 12px; }
  .topbar-actions .icon-btn .ic { width: 20px; height: 20px; }
  .topbar-actions .icon-btn .badge { position: absolute; top: -4px; right: -4px; }
  #locationSel { max-width: 120px; }
  #muteBtn.needs-sound { color: var(--amber); }

  .tabbar button .ti { width: 23px; height: 23px; filter: none; opacity: 1; }

  /* compact list cards */
  #apptRows td::before, #dashAppts td::before, #patRows td::before, #docRows td::before, #staffRows td::before { content: none !important; }
  #apptRows tr, #dashAppts tr, #patRows tr, #docRows tr, #staffRows tr { display: grid !important; column-gap: 12px; row-gap: 3px; padding: 13px 14px; align-items: center; }
  #apptRows td, #dashAppts td, #patRows td, #docRows td, #staffRows td { display: block !important; padding: 0 !important; min-height: 0 !important; text-align: left !important; font-size: 13px; color: var(--ink-soft); overflow-wrap: anywhere; }
  #apptRows td.empty, #dashAppts td.empty, #patRows td.empty, #docRows td.empty, #staffRows td.empty { grid-column: 1 / -1; text-align: center !important; padding: 18px 0 !important; }

  #apptRows tr { grid-template-columns: 58px minmax(0, 1fr) auto; grid-template-areas: "t n s" "t d d" "t p p" "a a a"; }
  #dashAppts tr { grid-template-columns: 58px minmax(0, 1fr) auto; grid-template-areas: "t n s" "t d d"; }
  #apptRows td:nth-child(1), #dashAppts td:nth-child(1) { grid-area: t; align-self: start; font: 700 14px var(--f-body); color: var(--primary-deep); padding-top: 1px !important; }
  #apptRows td:nth-child(2), #dashAppts td:nth-child(2) { grid-area: n; font: 600 16px var(--f-body); color: var(--ink); }
  #apptRows td:nth-child(3) { grid-area: p; }
  #apptRows td:nth-child(4), #dashAppts td:nth-child(3) { grid-area: d; }
  #apptRows td:nth-child(5), #dashAppts td:nth-child(4) { grid-area: s; justify-self: end; }
  #apptRows td:nth-child(6) { grid-area: a; margin-top: 8px; }
  #apptRows td:nth-child(6) .row-actions { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; gap: 8px; scrollbar-width: none; }
  #apptRows td:nth-child(6) .ghost.xs { flex: 0 0 auto; border-radius: 999px; }

  #patRows tr { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "n o" "p o" "g o"; }
  #patRows td:nth-child(1) { grid-area: n; font: 600 16px var(--f-body); color: var(--ink); }
  #patRows td:nth-child(2) { grid-area: p; }
  #patRows td:nth-child(3) { grid-area: g; }
  #patRows td:nth-child(4) { display: none !important; }
  #patRows td:nth-child(5) { grid-area: o; }
  #patRows td:nth-child(5) .ghost.xs { border: none; color: var(--primary-deep); font-weight: 600; }
  #patRows td:nth-child(5) .ghost.xs::after { content: " ›"; }
  tr.tap:active td { background: transparent; }
  tr.tap:active { background: var(--surface-2); }

  #docRows tr { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "n e" "s e" "d d" "h b"; }
  #docRows td:nth-child(1) { grid-area: n; font: 600 16px var(--f-body); color: var(--ink); }
  #docRows td:nth-child(2) { grid-area: s; color: var(--primary-deep); }
  #docRows td:nth-child(3) { grid-area: d; margin-top: 4px; }
  #docRows td:nth-child(4) { grid-area: h; }
  #docRows td:nth-child(5) { grid-area: b; justify-self: end; font-size: 12px; }
  #docRows td:nth-child(5)::before { content: "Online booking: " !important; color: var(--ink-faint); font: inherit !important; text-transform: none !important; letter-spacing: 0 !important; }
  #docRows td:nth-child(6) { grid-area: e; }

  #staffRows tr { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "n r" "g r" "e e"; }
  #staffRows td:nth-child(1) { grid-area: n; font: 600 16px var(--f-body); color: var(--ink); }
  #staffRows td:nth-child(2) { grid-area: e; font-size: 12px; }
  #staffRows td:nth-child(3) { grid-area: r; }
  #staffRows td:nth-child(4) { grid-area: g; }
  #staffRows .mini { max-width: 140px; }

  .chat-item { padding: 10px 6px; }
  .chat-item .avatar { width: 44px; height: 44px; font-size: 14px; }
  .chat-item .ci-top b { font-size: 15px; }
  .chat-item .ci-sub { font-size: 13.5px; }
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .status.completed { background: #2a2147; color: #c4b0f5; } }
:root[data-theme="dark"] .status.completed { background: #2a2147; color: #c4b0f5; }

/* region + payments */
#setCountry { min-width: 240px; }
.pay { font: 600 10px var(--f-mono); letter-spacing: .03em; padding: 2px 7px; border-radius: 999px; margin-left: 6px; white-space: nowrap; vertical-align: middle; }
.pay.paid { background: #e3f6ea; color: #17803d; }
.pay.due { background: var(--amber-wash); color: var(--amber); }
.status.pending_payment { background: var(--amber-wash); color: var(--amber); }
.pay-keys { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 900px) { .pay-keys { grid-template-columns: 1fr; } }
.install-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.install-btn[hidden] { display: none; }
#payForm .panel-head { gap: 10px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pay.paid { background: #12331f; color: #6fd595; } }
:root[data-theme="dark"] .pay.paid { background: #12331f; color: #6fd595; }

.install-box { display: flex; flex-direction: column; gap: 6px; }
.install-box[hidden] { display: none; }
.install-btn { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.install-os { display: flex; justify-content: center; gap: 14px; font-size: 11px; color: var(--ink-faint); }
.install-os span { display: inline-flex; align-items: center; gap: 4px; }
.install-os .ic { width: 14px; height: 14px; }

/* ── speed & smoothness ── */
a, button, label, input, select, .nav-item { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
@media (prefers-reduced-motion: no-preference) {
  section.view:not([hidden]) { animation: viewIn .16s ease-out; }
  @keyframes viewIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
}
.chat-msgs { -webkit-overflow-scrolling: touch; }

/* ── lab reports ── */
.pad { padding: 14px 18px 18px; }
.rep-head { flex-wrap: wrap; gap: 10px; }
.rep-head .search { flex: 1 1 220px; }
.rep-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.rep-list.pad { margin-top: 0; }
.rep { text-align: left; width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--bg); color: var(--ink); cursor: pointer; display: flex; flex-direction: column; gap: 4px; font: inherit; }
.rep:hover { border-color: var(--primary); }
.rep.new { border-left: 4px solid var(--primary); }
.rep.urgent { border-left-color: var(--red); background: color-mix(in srgb, var(--red) 6%, var(--bg)); }
.rep-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rep-top strong { font-size: 15px; }
.rep-sub { font-size: 13px; color: var(--ink-soft); }
.rep-checked { font-size: 13px; color: #1a7f4b; font-weight: 500; }
.new-tag { background: var(--primary); color: #fff; font: 600 10.5px var(--f-mono, monospace); letter-spacing: .06em; padding: 2px 7px; border-radius: 999px; }
.flag { font: 600 10.5px var(--f-mono, monospace); letter-spacing: .05em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-soft); }
.flag.abnormal { background: var(--amber-wash); color: var(--amber); }
.flag.urgent { background: var(--red); color: #fff; }
.rep-results { display: flex; flex-direction: column; border-bottom: 1px solid var(--line); }
.rep-results button { text-align: left; background: none; border: none; border-top: 1px solid var(--line); padding: 11px 18px; font: inherit; color: var(--ink); cursor: pointer; }
.rep-results button:hover { background: var(--primary-wash); }
.rep-results small, .rep-patient small { color: var(--ink-soft); }
.rep-patient { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; background: var(--primary-wash); border-bottom: 1px solid var(--line); }
.rf-files { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.rf-file { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 13.5px; }
.rf-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-card textarea { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: 14px var(--f-body); color: var(--ink); resize: vertical; }
.rv-body p { margin: 0 0 8px; white-space: pre-wrap; font-size: 14.5px; line-height: 1.55; }
.rv-body .rep-sub { margin-bottom: 10px; }
.rv-files { display: flex; flex-wrap: wrap; gap: 10px; }
.rv-files .att-img img { max-width: 260px; max-height: 260px; border-radius: 10px; cursor: zoom-in; display: block; }
.rv-check { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.rv-check .done { background: #e8f6ee; color: #14633a; border-radius: 10px; padding: 12px 14px; font-size: 14px; }
.rv-check .done p { margin: 6px 0 0; white-space: pre-wrap; color: var(--ink); }
.rv-check .waiting { color: var(--ink-soft); font-size: 14px; }
@media (max-width: 720px) { .rep-head > * { flex: 1 1 100%; } .rv-files .att-img img { max-width: 100%; } }
