/* Shared components (audit §2.2). Text colours use *-text tokens. Animations: opacity/transform only. */

/* ---------- keyframes (compositor-friendly) ---------- */
@keyframes sheet-up {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@keyframes toast-in {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@keyframes skel {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}
@keyframes rec-pulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 0; transform: scale(1.35); }
}
@keyframes caret { 50% { opacity: 0; } }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---------- app header ---------- */
.app-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--sp-3);
  height: var(--header-h);
  padding: 0 var(--sp-4);
  padding-top: env(safe-area-inset-top);
  background: rgb(var(--c-primary));
  color: #fff;
  flex: none;
  z-index: 20;
}
.app-header a, .app-header .brand { color: #fff; }
.app-header .brand { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -0.01em; }
.app-header-search {
  width: 100%; max-width: 480px; justify-self: center;
  min-height: var(--hit); padding: 0 var(--sp-3);
  border: 0; border-radius: var(--radius-sm);
  background: rgb(255 255 255 / 0.14); color: #fff;
}
.app-header-search::placeholder { color: rgb(255 255 255 / 0.7); }

/* legacy topbar glass (untouched screens) */
.glass-bar {
  background: rgb(255 255 255 / 0.7);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  backdrop-filter: blur(24px) saturate(1.5);
  border-bottom: 1px solid rgb(var(--c-ink) / 0.08);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass-bar { background: rgb(255 255 255 / 0.94); }
}

/* ---------- side nav ---------- */
.side-nav {
  width: var(--nav-w);
  background: rgb(var(--c-surface));
  border-right: 1px solid rgb(var(--c-line));
  display: flex; flex-direction: column; gap: 2px;
  padding: var(--sp-4) var(--sp-2);
  overflow-y: auto;
}
.side-nav-group {
  padding: var(--sp-4) var(--sp-3) var(--sp-2);
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: rgb(var(--c-mute));
}
.side-nav-item {
  display: flex; align-items: center; gap: var(--sp-2);
  min-height: var(--row-h); padding: 0 var(--sp-3);
  border: 0; border-radius: var(--radius-sm); border-left: 3px solid transparent;
  background: transparent; text-align: left; text-decoration: none;
  font-size: var(--fs-md); font-weight: 500; color: rgb(var(--c-ink)); cursor: pointer;
}
.side-nav-item:hover { background: rgb(var(--c-primary) / 0.06); }
.side-nav-item.is-active {
  border-left-color: rgb(var(--c-accent));
  background: rgb(var(--c-primary) / 0.08);
  color: rgb(var(--c-primary));
  font-weight: 600;
}
@media (min-width: 768px) and (max-width: 1023px) {
  .side-nav { width: 56px; padding-left: var(--sp-1); padding-right: var(--sp-1); }
  .side-nav-group, .side-nav-item > span { display: none; }
  .side-nav-item { justify-content: center; padding: 0; border-left-width: 0; border-bottom: 3px solid transparent; }
  .side-nav-item.is-active { border-bottom-color: rgb(var(--c-accent)); }
}

/* ---------- record tabs ---------- */
.record-tabs {
  display: flex; gap: 0; overflow-x: auto; flex: none;
  background: rgb(var(--c-surface-2));
  border-bottom: 1px solid rgb(var(--c-line));
}
.record-tabs [role="tab"], .record-tabs > button {
  flex: none; min-height: var(--row-h); padding: 0 var(--sp-4);
  border: 0; border-top: 2px solid transparent; border-bottom: 1px solid transparent;
  background: transparent; margin-bottom: -1px;
  font-size: var(--fs-sm); font-weight: 600; color: rgb(var(--c-mute)); cursor: pointer; white-space: nowrap;
}
.record-tabs [role="tab"][aria-selected="true"],
.record-tabs > button[aria-selected="true"],
.record-tabs > button.is-active {
  background: rgb(var(--c-surface));
  color: rgb(var(--c-ink));
  border-top-color: rgb(var(--c-accent));
  border-bottom-color: rgb(var(--c-surface));
}

/* ---------- patient banner + flags ---------- */
.patient-banner {
  position: sticky; top: 0; z-index: 15;
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3);
  min-height: var(--banner-h); padding: var(--sp-2) var(--sp-4);
  background: rgb(var(--c-surface));
  border-bottom: 1px solid rgb(var(--c-line));
}
.patient-banner-avatar {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgb(var(--c-primary) / 0.1); color: rgb(var(--c-primary)); font-size: var(--fs-lg);
}
.patient-banner-name { margin: 0; font-size: var(--fs-xl); font-weight: 700; line-height: 1.2; color: rgb(var(--c-ink)); }
.patient-banner-meta { font-size: var(--fs-sm); color: rgb(var(--c-mute)); }
.patient-banner-flags { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-left: auto; }

.flag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 24px; padding: 0 8px; border-radius: var(--radius-pill);
  font-size: var(--fs-xs); font-weight: 600; line-height: 1;
  border: 1px solid transparent;
}
.flag-ok { background: rgb(var(--c-ok) / 0.12); color: rgb(var(--c-ok-text)); border-color: rgb(var(--c-ok) / 0.3); }
.flag-warn { background: rgb(var(--c-warn) / 0.12); color: rgb(var(--c-warn-text)); border-color: rgb(var(--c-warn) / 0.3); }
.flag-danger { background: rgb(var(--c-danger) / 0.12); color: rgb(var(--c-danger-text)); border-color: rgb(var(--c-danger) / 0.3); }
.flag-info { background: rgb(var(--c-info) / 0.12); color: rgb(var(--c-info-text)); border-color: rgb(var(--c-info) / 0.3); }

/* ---------- section card ---------- */
.section, .card {
  background: rgb(var(--c-surface));
  border: 1px solid rgb(var(--c-line));
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 0;
  margin-bottom: var(--sp-4);
}
.card { padding: var(--sp-4); }
.section-header, .panel-heading {
  display: flex; align-items: center; gap: var(--sp-2);
  min-height: 40px; padding: 0 var(--sp-4);
  background: rgb(var(--c-surface-2));
  border-bottom: 1px solid rgb(var(--c-line));
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: var(--fs-sm); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: rgb(var(--c-mute));
}
.panel-heading {
  background: transparent; border: 0; border-radius: 0; padding: 0 0 var(--sp-2); min-height: 0;
}
.section-body { padding: var(--sp-3) var(--sp-4); }
.section-header .grow, .section-header-actions { margin-left: auto; display: flex; gap: var(--sp-2); }

/* ---------- list group (legacy) ---------- */
.list-group {
  overflow: hidden;
  background: rgb(var(--c-surface));
  border: 1px solid rgb(var(--c-line));
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}
.list-group > * + * { border-top: 1px solid rgb(var(--c-line)); }
.list-row {
  display: flex; align-items: center; gap: var(--sp-3);
  width: 100%; min-height: var(--row-h); padding: 10px var(--sp-4);
  background: none; border: 0; text-align: left; text-decoration: none;
  font-size: var(--fs-md); color: rgb(var(--c-ink));
  cursor: default;
}
a.list-row, button.list-row { cursor: pointer; }
a.list-row:hover, button.list-row:hover { background: rgb(var(--c-surface-2)); }
a.list-row:active, button.list-row:active { background: rgb(var(--c-primary) / 0.06); }
.list-footnote { padding: 6px var(--sp-4) 0; font-size: var(--fs-xs); line-height: 1.5; color: rgb(var(--c-mute)); }

/* ---------- data table + filter + pager ---------- */
.table-wrap, .table-scroll {
  overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
}
.data-table, .table {
  width: 100%; min-width: 560px; border-collapse: collapse; font-size: var(--fs-sm);
}
.data-table th, .data-table td, .table th, .table td {
  padding: 6px var(--sp-3); text-align: left; vertical-align: middle;
  border-bottom: 1px solid rgb(var(--c-line));
  height: var(--row-h);
}
.data-table thead th, .table thead th {
  position: sticky; top: 0; z-index: 1;
  white-space: nowrap; font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: rgb(var(--c-mute)); background: rgb(var(--c-surface-2));
}
.data-table tbody tr:hover, .table tbody tr:hover { background: rgb(var(--c-surface-2)); }
.data-table tbody tr.is-selected { background: rgb(var(--c-primary) / 0.06); }
.data-table tbody tr:last-child td, .table tbody tr:last-child td { border-bottom: 0; }

.filter-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.filter-bar .filter-count { margin-left: auto; font-size: var(--fs-sm); color: rgb(var(--c-mute)); }

.pager {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2);
  padding: var(--sp-2) 0; font-size: var(--fs-sm); color: rgb(var(--c-mute));
}
.pager-range { margin-right: auto; }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-3); margin: 0 0 var(--sp-4); }
.page-title { margin: 0; font-size: var(--fs-2xl); font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; color: rgb(var(--c-ink)); }
.page-subtitle { margin: 4px 0 0; font-size: var(--fs-md); color: rgb(var(--c-mute)); }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 8px; border-radius: var(--radius-pill);
  font-size: var(--fs-xs); font-weight: 600; line-height: 1;
  background: rgb(var(--c-ink) / 0.07); color: rgb(var(--c-mute));
}
.badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none;
}
.badge-ok { background: rgb(var(--c-ok) / 0.12); color: rgb(var(--c-ok-text)); }
.badge-warn { background: rgb(var(--c-warn) / 0.12); color: rgb(var(--c-warn-text)); }
.badge-danger { background: rgb(var(--c-danger) / 0.12); color: rgb(var(--c-danger-text)); }
.badge-info { background: rgb(var(--c-info) / 0.12); color: rgb(var(--c-info-text)); }
.badge-muted { background: rgb(var(--c-ink) / 0.06); color: rgb(var(--c-mute)); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--hit); padding: 0 var(--sp-3);
  border: 0; border-radius: var(--radius-sm);
  font-size: var(--fs-sm); font-weight: 600; line-height: 1.2; text-decoration: none; white-space: nowrap;
  background: rgb(var(--c-ink) / 0.06); color: rgb(var(--c-primary));
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: rgb(var(--c-primary)); color: #fff; box-shadow: 0 1px 2px rgb(var(--c-primary) / 0.25); }
.btn-primary:hover:not(:disabled) { background: rgb(var(--c-primary-hover)); }
.btn-secondary {
  background: #fff; color: rgb(var(--c-primary));
  border: 1px solid rgb(var(--c-line));
}
.btn-secondary:hover:not(:disabled) { background: rgb(var(--c-surface-2)); }
.btn-ghost, .btn-plain {
  background: transparent; color: rgb(var(--c-primary)); border: 0;
  padding-left: 10px; padding-right: 10px;
}
.btn-ghost:hover:not(:disabled), .btn-plain:hover:not(:disabled) { background: rgb(var(--c-primary) / 0.06); }
.btn-danger {
  background: #fff; color: rgb(var(--c-danger-text));
  border: 1px solid rgb(var(--c-danger) / 0.45);
}
.btn-danger:hover:not(:disabled) { background: rgb(var(--c-danger) / 0.08); }
.btn-danger-solid { background: rgb(var(--c-danger)); color: #fff; border: 0; }
.btn-danger-solid:hover:not(:disabled) { background: rgb(var(--c-danger-text)); }
.btn-sm { min-height: var(--hit); padding: 0 var(--sp-3); font-size: var(--fs-sm); }
.btn-block { width: 100%; }
.btn-icon, .icon-btn {
  display: inline-grid; place-items: center;
  width: var(--hit); min-width: var(--hit); min-height: var(--hit); padding: 0;
  border: 0; border-radius: var(--radius-sm); background: transparent;
  color: rgb(var(--c-primary)); cursor: pointer;
  transition: background 0.15s;
}
.btn-icon:hover, .icon-btn:hover { background: rgb(var(--c-primary) / 0.07); }
.icon-btn { border-radius: var(--radius-pill); }

/* ---------- segmented ---------- */
.segmented {
  display: flex; gap: 2px; padding: 2px;
  border-radius: var(--radius-sm); background: rgb(var(--c-ink) / 0.07);
}
.segmented > button {
  flex: 1 1 0; min-height: calc(var(--hit) - 4px); padding: 6px 10px;
  border: 0; border-radius: var(--radius-sm); background: transparent;
  font-size: var(--fs-sm); font-weight: 600; color: rgb(var(--c-mute));
  cursor: pointer; transition: background 0.15s, color 0.15s;
}
.segmented > button:hover { color: rgb(var(--c-ink)); }
.segmented > button[aria-pressed="true"],
.segmented > button[aria-checked="true"] {
  background: rgb(var(--c-primary)); color: #fff;
  box-shadow: none;
}

/* ---------- forms ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-3);
}
@media (min-width: 900px) {
  .form-grid { grid-template-columns: 160px 1fr; align-items: start; }
  .form-grid .field-label { padding-top: calc((var(--hit) - 1.2em) / 2); }
  .form-grid .field-hint, .form-grid .field-error { grid-column: 2; }
}
.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-row:last-child { margin-bottom: 0; }
.field-label { display: block; font-size: var(--fs-sm); font-weight: 600; color: rgb(var(--c-ink)); }
.field-label .req, .field-label .required { color: rgb(var(--c-danger-text)); }
.field-hint { font-size: var(--fs-xs); line-height: 1.45; color: rgb(var(--c-mute)); margin: 0; }
.field-error {
  display: flex; align-items: flex-start; gap: 4px; margin: 0;
  font-size: var(--fs-xs); line-height: 1.45; color: rgb(var(--c-danger-text));
}
.input, .select, .textarea {
  display: block; width: 100%; min-height: var(--hit); padding: 8px 12px;
  border: 1px solid rgb(var(--c-line)); border-radius: var(--radius-sm);
  background: #fff; color: rgb(var(--c-ink));
  font-size: var(--fs-md); box-shadow: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder, .textarea::placeholder { color: rgb(var(--c-mute) / 0.85); }
.input:focus, .select:focus, .textarea:focus {
  border-color: rgb(var(--c-accent));
  outline: 2px solid rgb(var(--c-accent));
  outline-offset: 0;
}
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] {
  border-color: rgb(var(--c-danger));
}
.input:disabled, .select:disabled, .textarea:disabled { opacity: 0.6; cursor: not-allowed; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23586476' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.textarea { min-height: 88px; resize: vertical; line-height: 1.5; }

.switch {
  appearance: none; -webkit-appearance: none; position: relative; flex: none;
  width: 40px; height: 22px; margin: 0; border: 0; border-radius: var(--radius-pill);
  background: rgb(var(--c-ink) / 0.16); cursor: pointer; transition: background 0.2s;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.25); transition: transform 0.2s;
}
.switch:checked { background: rgb(var(--c-ok)); }
.switch:checked::after { transform: translateX(18px); }
.switch:disabled { opacity: 0.4; cursor: not-allowed; }
@media (pointer: coarse) {
  .switch { width: 51px; height: 31px; }
  .switch::after { width: 27px; height: 27px; }
  .switch:checked::after { transform: translateX(20px); }
}
.switch-label { display: inline-flex; align-items: center; gap: var(--sp-2); cursor: pointer; }

/* ---------- dialog / drawer / sheet ---------- */
dialog.dialog, dialog.sheet, dialog.drawer {
  width: 100%; max-width: none; max-height: 92vh; max-height: 92dvh;
  margin: auto 0 0; padding: 0;
  border: 0; border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  background: rgb(var(--c-surface)); color: rgb(var(--c-ink)); box-shadow: var(--shadow-2);
}
dialog.dialog[open], dialog.sheet[open], dialog.drawer[open] {
  display: flex; flex-direction: column;
  animation: sheet-up 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
dialog.dialog::backdrop, dialog.sheet::backdrop, dialog.drawer::backdrop {
  background: rgb(0 0 0 / 0.35);
}
.dialog-header, .sheet > form > h2, dialog.sheet h2 {
  display: flex; align-items: center; gap: var(--sp-2);
  flex: none; min-height: var(--header-h); margin: 0; padding: 0 var(--sp-4);
  font-size: var(--fs-lg); font-weight: 700; line-height: 1.25; color: rgb(var(--c-ink));
  border-bottom: 1px solid rgb(var(--c-line));
}
.dialog-header h2 { margin: 0; flex: 1; font: inherit; color: inherit; }
.dialog-body, .sheet-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: var(--sp-4);
}
.sheet-text {
  margin: 0; padding: var(--sp-3); white-space: pre-wrap; font-size: var(--fs-md); line-height: 1.6;
  border-radius: var(--radius-sm); background: rgb(var(--c-ink) / 0.04);
}
.dialog-actions, .sheet-actions {
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--sp-2);
  flex: none; padding: var(--sp-3) var(--sp-4); padding-bottom: max(var(--sp-3), env(safe-area-inset-bottom));
  border-top: 1px solid rgb(var(--c-line));
}
@media (min-width: 768px) {
  dialog.dialog, dialog.sheet {
    width: min(480px, calc(100% - 48px)); margin: auto; border-radius: var(--radius-sheet);
  }
  dialog.dialog.dialog-md { width: min(640px, calc(100% - 48px)); }
  dialog.dialog.dialog-lg { width: min(880px, calc(100% - 48px)); }
  dialog.drawer {
    width: min(480px, calc(100% - 24px)); height: 100%; max-height: 100%;
    margin: 0 0 0 auto; border-radius: var(--radius-sheet) 0 0 var(--radius-sheet);
  }
  .sheet-actions { flex-direction: row; }
  .sheet-actions .btn { flex: 0 0 auto; }
}
/* legacy openSheet form layout */
dialog.sheet > form.stack { padding: var(--sp-4); padding-bottom: max(var(--sp-4), env(safe-area-inset-bottom)); gap: var(--sp-3); }
dialog.sheet > form.stack > h2.panel-heading {
  border: 0; background: transparent; padding: 0; min-height: 0;
  font-size: var(--fs-lg); font-weight: 700; letter-spacing: 0; text-transform: none; color: rgb(var(--c-ink));
}

/* ---------- toast stack ---------- */
.toast-stack {
  position: fixed; z-index: 100;
  display: flex; flex-direction: column; gap: var(--sp-2);
  max-width: min(360px, calc(100% - 24px));
  pointer-events: none;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%);
}
@media (min-width: 768px) {
  .toast-stack {
    top: max(16px, env(safe-area-inset-top));
    right: 16px; left: auto; bottom: auto;
    transform: none;
  }
}
.toast-stack > .toast { pointer-events: auto; position: static; transform: none; left: auto; bottom: auto; }
.toast {
  display: flex; align-items: flex-start; gap: var(--sp-2);
  max-width: 100%; padding: 12px 14px;
  border-radius: var(--radius); background: rgb(var(--c-ink) / 0.92); color: #fff;
  font-size: var(--fs-md); font-weight: 500; box-shadow: var(--shadow-2);
  animation: toast-in 0.2s ease-out;
  border-left: 4px solid transparent;
}
.toast-action {
  margin-left: auto; flex: none;
  padding: 4px 10px; min-height: var(--hit);
  border: 1px solid rgb(255 255 255 / 0.6); border-radius: var(--radius-sm);
  background: transparent; color: inherit; font: inherit; font-weight: 600; cursor: pointer;
}
.toast-dismiss {
  flex: none; margin-left: auto; border: 0; background: transparent; color: inherit;
  font-size: var(--fs-lg); line-height: 1; cursor: pointer; opacity: 0.8; padding: 0 4px;
  min-width: var(--hit); min-height: var(--hit);
}
.toast-ok { background: rgb(var(--c-ok-text)); border-left-color: rgb(var(--c-ok)); }
.toast-error, .toast-danger { background: rgb(var(--c-danger-text)); border-left-color: rgb(var(--c-danger)); }
.toast-warn { background: rgb(var(--c-warn-text)); border-left-color: rgb(var(--c-warn)); }
.sync-pill {
  min-height: var(--hit); padding: 4px 12px; border: 0; border-radius: var(--radius-pill);
  background: rgb(var(--c-warn) / 0.15); color: rgb(var(--c-warn-text));
  font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer;
}

/* ---------- empty / skeleton / kbd ---------- */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--sp-2); padding: var(--sp-6) var(--sp-4); text-align: center;
}
.empty-icon { font-size: 48px; line-height: 1; opacity: 0.45; }
.empty-title { margin: 0; font-size: var(--fs-lg); font-weight: 600; color: rgb(var(--c-ink)); }
.empty-help { margin: 0; font-size: var(--fs-sm); color: rgb(var(--c-mute)); max-width: 28rem; }

.skeleton {
  display: block; border-radius: var(--radius-sm);
  background: rgb(var(--c-ink) / 0.08);
  animation: skel 1.2s ease-in-out infinite;
  min-height: 1em;
}
.skeleton-row { height: var(--row-h); margin-bottom: var(--sp-2); }

.kbd {
  display: inline-block; padding: 1px 6px;
  border: 1px solid rgb(var(--c-line)); border-bottom-width: 2px; border-radius: 4px;
  background: rgb(var(--c-surface-2));
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: var(--fs-xs); font-weight: 600; color: rgb(var(--c-mute));
  line-height: 1.4;
}

/* rec-pulse ring (used by clinic .rec-btn.is-listening::after when present) */
.rec-pulse-ring, .rec-btn.is-listening::after {
  content: "";
  position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid rgb(var(--c-primary) / 0.45);
  animation: rec-pulse 1.8s ease-out infinite;
  pointer-events: none;
}
