/* ── Shared Components ──
   UI components reused across MORE THAN ONE shell: the admin team console
   (admin/base.html, admin/login.html) AND the clinic dashboard
   (clinic/base.html). Keeping them here — loaded by every shell — is the
   single source of truth, so a clinic surface can reuse the admin partials
   (status pills, badges, the practice switcher / theme toggle / user-actions
   cluster) without depending on the admin-only component sheet.

   Admin-only components (forms, data tables, tabs, sparklines, filters, …)
   stay in admin-components.css. Pure layout (shell, nav, mobile menu) stays in
   admin-layout.css. Colours come exclusively from tokens.css so light/dark
   both work (scripts/check_dark_mode.py --strict). Issue 1736 follow-up. */

/* ── Status pills ── */
.status-pill,
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.status-complete,
.status-completed,
.status-success {
  background: var(--color-success-bg);
  color: var(--color-success);
}

/* Partial-success state (HotDoc sync runs that completed with some
   failures — see HotdocSyncStatus.PARTIAL). Amber/warning-toned to
   distinguish from full success. PR review finding P2-#7 (issue 798). */
.status-partial {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.status-failed,
.status-error,
.status-cancelled,
.status-canceled {
  background: var(--color-error-bg);
  color: var(--color-error);
}

.status-running,
.status-expired {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.status-pending,
.status-superseded {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

/* Intake-SMS reminder run outcomes (spec 2026-06-28). Sent = success;
   breaker-open / refused-unrestricted are warning-toned (enabled but not
   sending); the neutral operational outcomes fall back to a muted pill.
   (``error`` reuses ``.status-error`` above.) Token-only, so dark-mode safe. */
.status-sent {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.status-breaker_open,
.status-refused_unrestricted {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.status-dry_run,
.status-no_op,
.status-off,
.status-disabled,
.status-quiet_hours,
.status-lease_held,
.status-capped {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.status-in_progress {
  background: var(--color-info-bg);
  color: var(--color-info);
}

/* Keep pills on one line and from being squeezed by flex siblings. */
.status-pill,
.status-badge {
  white-space: nowrap;
  flex-shrink: 0;
}

/* Analysis generation history (spec 2026-07-06, issue 1821 D6): retained
   superseded generations form a quiet audit trail under the admin summary. */
.analysis-history {
  margin-top: var(--space-3);
}

.analysis-history-list {
  list-style: none;
  padding: var(--space-2) 0 0 var(--space-3);
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

/* ── Generic badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.badge-completed {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.badge-pending {
  background: var(--color-info-bg);
  color: var(--color-info);
}

/* Walk-in intake badge (spec 2026-06-28): informational, reuses the info
   tokens so it stays dark-mode-clean. */
.badge-info {
  background: var(--color-info-bg);
  color: var(--color-info);
}

.badge-cancelled {
  background: var(--color-error-bg);
  color: var(--color-error);
}

/* Issues 1684/1686 (F1): "needs review" clinical-escalation badge (admin
   recent-intakes + clinician appointment/recent rows). Both light + dark
   warning tokens are defined in tokens.css so this stays dark-mode-clean. */
.badge-warning {
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
}

/* ── Type pills ── */
.type-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.type-real {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.type-simulation {
  background: var(--color-info-bg);
  color: var(--color-info);
}

.type-test {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

/* ── Header controls ──
   Practice switcher, inline theme toggle, and the user-actions cluster (user
   badge + sign-out). These back the template-shared partials
   components/_practice_switcher.html and _user_actions.html, reused by
   both the admin console and the clinic dashboard. (Pure layout — the
   admin mobile slide-out's theme row / practice block — stays in
   admin-layout.css since only the admin shell has it.) */
.admin-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-user-badge {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.875rem;
  border-radius: var(--radius-full);
}

/* Dark mode cancel/secondary button contrast */
[data-theme="dark"] .btn-secondary,
[data-theme="dark"] .btn.btn-secondary {
  border: 1px solid var(--border-color);
}

.btn-danger {
  background: var(--color-error);
  color: var(--text-on-danger);
}

.btn-danger:hover {
  filter: brightness(0.9);
}

/* ── Generic cards / stats / data tables ──
   Reused by admin pages and clinic CSV import. Shell-specific tone can be
   layered with modifier classes in the shell stylesheet. */
.detail-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border-color-light);
  box-shadow: var(--shadow-sm);
}

.detail-card h2 {
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.detail-card h3 {
  margin: 0 0 0.6rem;
  font-size: var(--text-lg);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border-color-light);
  box-shadow: var(--shadow-sm);
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-subtext {
  color: var(--text-tertiary);
  font-size: 0.85rem;
  margin-top: 6px;
}

.table-wrapper {
  position: relative;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-wrapper .data-table,
.table-wrapper .admin-table {
  min-width: 680px;
}

.data-table,
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color-light);
  box-shadow: var(--shadow-sm);
}

.data-table th,
.data-table td,
.admin-table th,
.admin-table td {
  padding: 14px 16px;
  text-align: left;
  font-size: 0.9rem;
}

.data-table th,
.admin-table th {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-size: 0.75rem;
}

.data-table tbody tr,
.admin-table tbody tr {
  border-bottom: 1px solid var(--border-color-light);
}

.data-table tbody tr:last-child,
.admin-table tbody tr:last-child {
  border-bottom: none;
}

/* `:not(.btn)` because a link that IS a button must keep the BUTTON's colours.
   `.data-table a` outranks `.btn-primary` on specificity, so without the
   exclusion an <a class="btn btn-primary"> in a cell rendered as dark-blue
   underlined text ON the dark-blue button — unreadable (the /admin/demos
   "Manage" action, spec 2026-08-01 D3). */
.data-table a:not(.btn),
.admin-table a:not(.btn) {
  color: var(--color-primary-dark);
  text-decoration: none;
  font-weight: 600;
}

.data-table a:not(.btn):hover,
.admin-table a:not(.btn):hover {
  text-decoration: underline;
}

/* Inline theme toggle (header & mobile menu) */
.theme-toggle-inline {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: none;
  border: 1px solid var(--border-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.theme-toggle-inline:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.theme-toggle-inline svg {
  width: 18px;
  height: 18px;
}

.theme-toggle-inline .icon-sun {
  display: none;
}

.theme-toggle-inline .icon-moon {
  display: block;
}

[data-theme="dark"] .theme-toggle-inline .icon-sun {
  display: block;
}

[data-theme="dark"] .theme-toggle-inline .icon-moon {
  display: none;
}

/* Practice switcher (header) */
.practice-switcher {
  display: inline-flex;
  align-items: center;
  margin: 0;
  flex-shrink: 1;
  min-width: 0;
}

.practice-switcher select {
  padding: 6px 28px 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23808080' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  max-width: 220px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.practice-switcher select:hover {
  background-color: var(--bg-tertiary);
  border-color: var(--color-primary);
}

.practice-switcher select:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.practice-badge {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
}

/* Problem-based GP intake note */
.gp-note-tabs {
  white-space: normal;
}

.gp-note-tab-list {
  display: inline-flex;
  max-width: 100%;
  gap: 4px;
  margin: 0 0 1rem;
  padding: 4px;
  overflow-x: auto;
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
}

.gp-note-tab {
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.2;
  padding: 7px 11px;
  white-space: nowrap;
}

.gp-note-tab:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.gp-note-tab:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.gp-note-tab.is-active {
  border-color: var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
}

.gp-note-tab-panel[hidden] {
  display: none;
}

.gp-note-tab-panel {
  white-space: normal;
}

.gp-note-paragraph {
  white-space: pre-wrap;
}

.gp-note {
  white-space: normal;
}

.gp-note-section {
  margin-top: 1rem;
}

.gp-note-section:first-child {
  margin-top: 0;
}

.gp-note-title,
.gp-note-problem-title,
.gp-note-section-title {
  margin: 0 0 0.45rem;
  color: var(--text-primary);
  letter-spacing: 0;
}

.gp-note-title {
  font-size: 0.98rem;
  font-weight: 700;
}

.gp-note-problem-title {
  font-size: 0.95rem;
  font-weight: 700;
}

.gp-note-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.gp-note-problem {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-color-light);
}

.gp-note-problem:first-of-type {
  margin-top: 0;
}

.gp-note-story,
.gp-note-reason p {
  margin: 0 0 0.7rem;
}

.gp-note-rows {
  margin: 0;
  padding-left: 1.1rem;
}

.gp-note-row {
  margin: 0.2rem 0;
}

.gp-note-label {
  font-weight: 650;
  color: var(--text-secondary);
}

.gp-note-label::after {
  content: ": ";
}

.gp-note-sep {
  color: var(--text-tertiary);
}

.gp-note-sep::after {
  content: " ";
}

.gp-note-sentence-gap::after {
  content: " ";
}

/* Conversation modality glyph — chat bubble / microphone, shown in the admin
   conversation table and next to the clinic summary transcript header.
   Rendered via the shared `modality_icon` macro in components/ui.html. */
.modality-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  padding: 4px;
}

.modality-icon.voice {
  background: var(--color-info-bg);
  color: var(--color-info);
}

.modality-icon.chat {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

/* Note-experiment preview tab (spec 2026-07-07 note-experiment-lane, L2 /
   issue 1850). Cohort-only card rendered on the clinic summary + admin
   conversation pages via components/_note_preview.html; the host page
   supplies its own card chrome (clin-card / detail-card). */
.note-preview-heading {
  margin: 0 0 0.35rem;
  font: var(--text-title);
}

.note-preview-disclaimer {
  margin: 0 0 0.9rem;
  color: var(--text-tertiary);
  font-size: var(--text-sm);
}

.note-preview-panel + .note-preview-panel {
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border-color);
}

.note-preview-panel-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.note-preview-title {
  margin: 0;
  font-size: var(--text-md);
  font-weight: 650;
  font-family: var(--font-mono);
}

.note-preview-meta {
  color: var(--text-tertiary);
  font-size: var(--text-sm);
}

.note-preview-stale-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-full);
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  color: var(--color-warning-text);
  font-size: var(--text-xs);
  font-weight: 600;
}

/* Copy button (GP round-1 F12): copies render_text, the exact PMS payload. */
.note-preview-copy-btn {
  margin-left: auto;
  padding: 0.15rem 0.65rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
}

.note-preview-copy-btn:hover {
  background: var(--border-color);
}

/* Defer-to-consult footer (GP round-1 F4): clinician heads-up that is
   deliberately NOT part of the copied note text. */
.note-preview-deferred {
  margin: 0.45rem 0 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-style: italic;
}

.note-preview-text {
  margin: 0.6rem 0 0;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Footnoted note view (issue 1848): note body with clickable turn-ref
   superscripts. Same chrome as .note-preview-text; the copied payload lives in
   a hidden sibling <pre data-note-preview-payload>. sup.turn-ref styling + the
   tooltip / scroll-to-turn behaviour are shared with the GP-summary footnotes
   (clinic.css / admin-pages.css + clinic-summary.js / conversation-detail.js). */
.note-preview-rendered {
  margin: 0.6rem 0 0;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  overflow-wrap: anywhere;
}

.note-preview-block + .note-preview-block {
  margin-top: 0.9rem;
}

.note-preview-block-heading {
  font-weight: 600;
}

.note-preview-line {
  white-space: pre-wrap;
}

.note-preview-history {
  margin-top: 0.75rem;
}

.note-preview-history > summary {
  cursor: pointer;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.note-preview-history-item {
  margin-top: 0.6rem;
}

/* ── Device management (security) self-service surface ──
   spec 2026-07-21 D9 (issue 1901, PR6). Shared by /admin/security +
   /clinic/security (both shells load shared-components.css). Tokens only —
   no hardcoded hex. */
.dm-surface {
  max-width: var(--container-narrow);
  margin: 0 auto;
}

.dm-surface-narrow {
  max-width: 34rem;
}

.dm-head {
  margin-bottom: var(--space-6);
}

.dm-title {
  margin: 0 0 var(--space-2);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
}

.dm-subtitle {
  margin: 0;
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

.dm-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-sm);
}

.dm-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.dm-card-title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.dm-card-text {
  margin: 0 0 var(--space-3);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  font-size: var(--text-sm);
}

.dm-hint {
  margin: var(--space-2) 0 0;
  color: var(--text-tertiary);
  font-size: var(--text-xs);
}

.dm-pill {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
}

.dm-pill-ok {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.dm-pill-warn {
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
}

.dm-meta {
  margin: 0 0 var(--space-3);
  display: grid;
  gap: var(--space-1);
}

.dm-meta-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: var(--text-sm);
}

.dm-meta-row dt {
  color: var(--text-tertiary);
}

.dm-meta-row dd {
  margin: 0;
  color: var(--text-primary);
}

.dm-inline-form {
  margin: 0;
}

.dm-list {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}

.dm-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: var(--space-3);
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
}

.dm-list-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.dm-list-name {
  font-weight: 600;
  color: var(--text-primary);
}

.dm-list-meta {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.dm-list-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.dm-rename-form {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin: 0;
}

.dm-rename-input {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: var(--text-sm);
  max-width: 12rem;
}

.dm-remove-form {
  margin: 0;
}

.dm-empty {
  margin: var(--space-3) 0 0;
  color: var(--text-tertiary);
  font-size: var(--text-sm);
}

.dm-passkey-status {
  margin: 0 0 var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.dm-status-error {
  color: var(--color-error);
}

/* Sized for SCAN DENSITY, not for looks: the otpauth URI makes a ~57-module
   code, so 12rem left only 3.4 CSS px per module. That cap was never validated
   against a working render — until the viewBox fix (2026-08-04) this QR was
   clipped to 56% of itself and unscannable — so don't shrink it back toward the
   surrounding type scale. 16rem keeps ~4.5 px per module, comfortably inside
   the 34rem `.dm-surface-narrow`. */
.dm-qr {
  display: flex;
  justify-content: center;
  margin: 0 auto var(--space-4);
  max-width: 16rem;
}

.dm-qr svg {
  width: 100%;
  height: auto;
}

.dm-secret-hint {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  text-align: center;
  margin: 0 0 var(--space-4);
}

.dm-secret {
  display: inline-block;
  margin-top: var(--space-1);
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  font-family: var(--font-mono);
  font-size: var(--text-md);
  letter-spacing: 0.05em;
  color: var(--text-primary);
  word-break: break-all;
}

.dm-label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-1);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.dm-code-input {
  width: 100%;
  margin-bottom: var(--space-3);
}

.dm-confirm-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.dm-codes {
  list-style: none;
  margin: 0 0 var(--space-5);
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.dm-code {
  display: block;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color-light);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  text-align: center;
  color: var(--text-primary);
}

/* ── Screen-reader-only text ──
   The one accessible-name / live-region utility for BOTH shells. The clinic
   sheet's `.clin-visually-hidden` predates it and stays for clinic markup;
   new shared components (copy-field's polite announcer) use this. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* A machine-readable payload for a copy button: present in the DOM, shown to
   nobody. The paired `[hidden]` rule is mandatory, not decorative — the UA's
   `display: none` for the `hidden` ATTRIBUTE loses to any author `display`
   rule that matches the element (a house footgun; see AGENTS.md), and a
   payload that leaks into the page would dump raw links mid-layout. */
.copy-payload[hidden] {
  display: none;
}

/* ── Copy-to-clipboard field (spec 2026-08-01 D4) ──
   A read-only value + a Copy button, used wherever the console hands a human
   a link/credential to paste elsewhere. Behaviour: static/js/copy-field.js.
   Markup: components/_copy_field.html. */
.copy-field {
  margin-bottom: var(--space-4);
}

.copy-field-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* "shown once" — the display-once marker. Loud enough to be read BEFORE the
   value is lost, which is the entire job. */
.copy-field-once {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.copy-field-row {
  display: flex;
  align-items: stretch;
  gap: var(--space-2);
}

.copy-field-input {
  flex: 1 1 auto;
  min-width: 0;
  /* A read-only field is still a tap target (tapping selects it, which is the
     manual-copy fallback), so it meets the 44px floor rather than sizing to
     its font. */
  min-height: var(--touch-target-min);
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-overflow: ellipsis;
}

.copy-field-input:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

.copy-field .copy-btn {
  flex: 0 0 auto;
  min-width: 5.5rem;
  min-height: var(--touch-target-min);
}

.copy-btn.is-copied {
  background: var(--color-success-bg);
  border-color: var(--color-success);
  color: var(--color-success);
}

.copy-btn.is-copy-failed {
  background: var(--color-warning-bg);
  border-color: var(--color-warning-border);
  color: var(--color-warning-text);
}

.copy-field-hint {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

/* The display-once frame: the value you cannot come back for reads
   differently from the four you can. */
.copy-field-secret {
  padding: var(--space-3);
  border: 1px solid var(--color-warning-border);
  border-radius: var(--radius-md);
  background: var(--color-warning-bg);
}

.copy-field-secret .copy-field-input {
  background: var(--bg-primary);
}

@media (max-width: 560px) {
  .copy-field-row {
    flex-direction: column;
  }

  .copy-field .copy-btn {
    width: 100%;
  }
}

/* ── QR chip ──
   A rendered walk-in QR on an always-light backing. A QR is only scannable as
   dark modules on a light field, so it must never inherit the dark theme's
   surface (the same rule `.practice-logo-preview` exists for). Shared by the
   demo handover page and the practice detail page — previously each inlined
   its own `style="max-width:220px"` and neither had a backing. */
.qr-chip {
  display: inline-block;
  max-width: 240px;
  padding: var(--space-2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-logo-chip);
}

.qr-chip svg {
  display: block;
  width: 100%;
  height: auto;
}

.qr-chip-block {
  margin: var(--space-4) 0;
}
