/* ============================================================
   ROUNDS — Medical Voice Notes
   styles.css
   ============================================================ */

/* ────────────────────────────────────────────────────────────
   1. Design Tokens
   ──────────────────────────────────────────────────────────── */
:root {
  /* Palette — Warm Clinical × FIGS Lagoon Teal */
  --bg:           #FAFAF6;
  --surface:      #F0EDE6;
  --surface-2:    #E6DFD3;
  --accent:       #14B8A6;
  --accent-light: #5EEAD4;
  --accent-dim:   rgba(20, 184, 166, 0.12);
  --text:         #1A2332;
  --text-muted:   #6B7A8D;
  --danger:       #C44B3B;
  --warning:      #D4A520;
  --border:       #E0D8CC;
  --white:        #FFFFFF;

  /* Fonts */
  --font-serif: 'Libre Baskerville', Georgia, serif;
  --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Radii */
  --radius:     14px;
  --radius-sm:  8px;

  /* Safe area */
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left:   env(safe-area-inset-left, 0px);
  --safe-right:  env(safe-area-inset-right, 0px);
}


/* ────────────────────────────────────────────────────────────
   2. Reset & Base
   ──────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--accent);
  color: var(--white);
}

::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: var(--surface);
}

::-webkit-scrollbar-thumb {
  background: var(--accent-light);
  border-radius: 4px;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol {
  list-style: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}


/* ────────────────────────────────────────────────────────────
   3. Typography
   ──────────────────────────────────────────────────────────── */
.text-serif {
  font-family: var(--font-serif);
}

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.25;
}

h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }

.text-muted {
  color: var(--text-muted);
}

.text-accent {
  color: var(--accent);
}

.text-danger {
  color: var(--danger);
}


/* ────────────────────────────────────────────────────────────
   4. Screen System (mobile-first fixed screens)
   ──────────────────────────────────────────────────────────── */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.38s ease, transform 0.38s ease, visibility 0s 0.38s;
  overflow: hidden;
  z-index: 1;
}

.screen.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 2;
  transition: opacity 0.38s ease, transform 0.38s ease, visibility 0s 0s;
}

/* 3D screen transitions */
.screen-enter-forward {
  transform: translateX(100%);
}

.screen-enter-back {
  transform: translateX(-30%);
  opacity: 0.5;
}

.screen-exit-forward {
  transform: translateX(-30%);
  opacity: 0.5;
}

.screen-exit-back {
  transform: translateX(100%);
}


/* ────────────────────────────────────────────────────────────
   5. Screen Header
   ──────────────────────────────────────────────────────────── */
.screen-header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  height: 56px;
  min-height: 56px;
  padding: 0 16px;
  padding-top: var(--safe-top);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  z-index: 10;
}

.screen-header-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
}

.screen-header .back-btn {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text);
  transition: background 0.2s ease;
}

.screen-header .back-btn:active {
  background: var(--surface);
}

.screen-header .back-btn svg {
  width: 22px;
  height: 22px;
}

.screen-header .header-actions {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
}

.screen-header .header-actions button {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-muted);
  transition: background 0.2s ease, color 0.2s ease;
}

.screen-header .header-actions button:active {
  background: var(--surface);
}

.screen-header .header-actions button svg {
  width: 20px;
  height: 20px;
}


/* ────────────────────────────────────────────────────────────
   6. Screen Body
   ──────────────────────────────────────────────────────────── */
.screen-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  padding-bottom: 120px;
  -webkit-overflow-scrolling: touch;
}


/* ────────────────────────────────────────────────────────────
   7. Bottom Navigation
   ──────────────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: stretch;
  background: var(--white);
  border-top: 1px solid var(--border);
  padding-bottom: var(--safe-bottom);
  z-index: 100;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 0;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  transition: color 0.2s ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item svg {
  width: 22px;
  height: 22px;
  transition: color 0.2s ease;
}

.bottom-nav-item.active {
  color: var(--accent);
}

.bottom-nav-item:active {
  opacity: 0.7;
}


/* ────────────────────────────────────────────────────────────
   8. Buttons
   ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  text-align: center;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.12s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.97);
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
}

.btn-primary:hover {
  background: #4D7A63;
}

.btn-primary:active {
  background: #436E58;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

.btn-secondary:hover {
  background: var(--accent-dim);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}

.btn-danger:hover {
  background: #B3402F;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 10px 16px;
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--surface);
}

.btn-lg {
  padding: 16px 28px;
  font-size: 16px;
  width: 100%;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon svg {
  width: 20px;
  height: 20px;
}


/* ────────────────────────────────────────────────────────────
   9. Cards
   ──────────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-body {
  padding-top: 8px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.stat-card .stat-number {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.stat-card .stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}


/* ────────────────────────────────────────────────────────────
   10. Badges & Tags
   ──────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1;
  white-space: nowrap;
}

.badge-success {
  background: var(--accent);
  color: var(--white);
}

.badge-warning {
  background: var(--warning);
  color: var(--text);
}

.badge-danger {
  background: var(--danger);
  color: var(--white);
}

.badge-muted {
  background: var(--surface);
  color: var(--text-muted);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}

.tag .tag-remove {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.tag .tag-remove:hover {
  color: var(--danger);
}


/* ────────────────────────────────────────────────────────────
   11. Forms
   ──────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 15px;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.form-input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 15px;
  color: var(--text);
  min-height: 100px;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  line-height: 1.5;
}

.form-textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-select {
  width: 100%;
  padding: 14px 40px 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 15px;
  color: var(--text);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7A8D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}


/* ────────────────────────────────────────────────────────────
   12. Encounter Type Pills
   ──────────────────────────────────────────────────────────── */
.type-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.type-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: var(--white);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.type-pill:hover {
  border-color: var(--accent-light);
  background: var(--accent-dim);
}

.type-pill.active {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}

.type-pill svg {
  width: 16px;
  height: 16px;
}


/* ────────────────────────────────────────────────────────────
   13. Filter Pills (encounters list)
   ──────────────────────────────────────────────────────────── */
.filter-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 4px 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filter-pills::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--white);
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.filter-pill:hover {
  border-color: var(--accent-light);
}

.filter-pill.active {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}


/* ────────────────────────────────────────────────────────────
   14. Sort Pills
   ──────────────────────────────────────────────────────────── */
.sort-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 4px 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.sort-pills::-webkit-scrollbar {
  display: none;
}

.sort-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--white);
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.sort-pill:hover {
  border-color: var(--accent-light);
}

.sort-pill.active {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}

.sort-pill svg {
  width: 14px;
  height: 14px;
}


/* ────────────────────────────────────────────────────────────
   15. Dashboard Styles
   ──────────────────────────────────────────────────────────── */
.dashboard-greeting {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.dashboard-date {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-tile {
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px 10px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.stat-tile .stat-value {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.stat-tile .stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.new-encounter-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 56px;
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  margin: 20px 0;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.new-encounter-btn:hover {
  background: #4D7A63;
}

.new-encounter-btn:active {
  transform: scale(0.97);
  background: #436E58;
}

.new-encounter-btn svg {
  width: 22px;
  height: 22px;
}

.recent-section {
  padding-top: 8px;
}

.recent-heading {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.recent-heading .count {
  font-weight: 700;
  color: var(--accent);
}


/* ────────────────────────────────────────────────────────────
   16. Encounter Card
   ──────────────────────────────────────────────────────────── */
.encounter-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.encounter-card:active {
  transform: scale(0.98);
}

.encounter-card-content {
  flex: 1;
  min-width: 0;
}

.encounter-card-patient {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}

.encounter-card-complaint {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
  margin-bottom: 6px;
}

.encounter-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.encounter-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  margin-left: 12px;
}

/* Encounter status indicator */
.encounter-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.encounter-status .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.encounter-status.status-recording .status-dot {
  background: var(--danger);
  animation: pulse 1.2s ease-in-out infinite;
}

.encounter-status.status-recording {
  color: var(--danger);
}

.encounter-status.status-processing .status-dot {
  background: var(--warning);
}

.encounter-status.status-processing {
  color: var(--warning);
}

.encounter-status.status-complete .status-dot {
  background: var(--accent);
}

.encounter-status.status-complete {
  color: var(--accent);
}

.encounter-status.status-reviewed .status-dot {
  background: var(--accent);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.encounter-status.status-reviewed {
  color: var(--accent);
}

/* Favorite star */
.encounter-star {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--border);
  cursor: pointer;
  transition: color 0.2s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.encounter-star svg {
  width: 18px;
  height: 18px;
}

.encounter-star.active {
  color: var(--accent);
}

.encounter-star:active {
  transform: scale(1.2);
}


/* ────────────────────────────────────────────────────────────
   17. Recording Screen
   ──────────────────────────────────────────────────────────── */
.recording-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 20px;
}

.record-timer {
  font-family: var(--font-serif);
  font-size: 48px;
  font-weight: 700;
  letter-spacing: 2px;
  text-align: center;
  color: var(--text);
  margin-bottom: 8px;
}

.record-waveform {
  width: 100%;
  height: 60px;
  margin: 20px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.record-waveform svg {
  width: 100%;
  height: 100%;
}

.record-waveform polyline {
  stroke: var(--accent);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.record-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--danger);
}

.record-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
  animation: pulse 1.2s ease-in-out infinite;
}

.live-transcript {
  width: 100%;
  background: var(--surface);
  padding: 16px;
  border-radius: var(--radius-sm);
  max-height: 120px;
  overflow-y: auto;
  font-size: 14px;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 20px 0;
}

.record-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  width: 100%;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.5;
  }
}


/* ────────────────────────────────────────────────────────────
   18. Processing Screen
   ──────────────────────────────────────────────────────────── */
.processing-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 40px 20px;
}

.processing-orb {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--accent);
  animation: orbPulse 2s ease-in-out infinite;
  margin-bottom: 32px;
}

.processing-status {
  font-size: 16px;
  color: var(--text-muted);
  text-align: center;
  transition: opacity 0.3s ease;
  margin-bottom: 8px;
}

.processing-patient {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
}

@keyframes orbPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(20, 184, 166, 0.4);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 40px 10px rgba(20, 184, 166, 0.2);
  }
}


/* ────────────────────────────────────────────────────────────
   19. Detail Screen Tabs
   ──────────────────────────────────────────────────────────── */
.detail-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.detail-tabs::-webkit-scrollbar {
  display: none;
}

.detail-tab {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.2s ease, border-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.detail-tab:hover {
  color: var(--text);
}

.detail-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.detail-tab-content {
  display: none;
  padding: 20px;
}

.detail-tab-content.active {
  display: block;
}


/* ────────────────────────────────────────────────────────────
   20. SOAP Sections
   ──────────────────────────────────────────────────────────── */
.soap-section {
  margin-bottom: 20px;
  padding-left: 16px;
  border-left: 3px solid var(--border);
}

.soap-section.soap-s {
  border-color: #4A90D9;
}

.soap-section.soap-o {
  border-color: var(--accent);
}

.soap-section.soap-a {
  border-color: var(--warning);
}

.soap-section.soap-p {
  border-color: #9B59B6;
}

.soap-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.soap-s .soap-label { color: #4A90D9; }
.soap-o .soap-label { color: var(--accent); }
.soap-a .soap-label { color: var(--warning); }
.soap-p .soap-label { color: #9B59B6; }

.soap-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
}

.soap-text[contenteditable] {
  outline: none;
  border-radius: var(--radius-sm);
  padding: 4px;
  margin: -4px;
  transition: background 0.2s ease;
}

.soap-text[contenteditable]:focus {
  background: var(--accent-dim);
  outline: 2px solid var(--accent-dim);
}


/* ────────────────────────────────────────────────────────────
   21. ICD Codes
   ──────────────────────────────────────────────────────────── */
.icd-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.icd-tag {
  display: inline-flex;
  align-items: center;
  background: var(--accent-dim);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}


/* ────────────────────────────────────────────────────────────
   22. Vitals Table
   ──────────────────────────────────────────────────────────── */
.vitals-table {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.vital-item {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 10px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.vital-item .vital-value {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.vital-item .vital-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}


/* ────────────────────────────────────────────────────────────
   23. Medication List
   ──────────────────────────────────────────────────────────── */
.med-list {
  list-style: none;
}

.med-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.med-item:last-child {
  border-bottom: none;
}

.med-item-info {
  flex: 1;
}

.med-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.med-item-dose {
  font-size: 13px;
  color: var(--text-muted);
}

.med-item-freq {
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
}


/* ────────────────────────────────────────────────────────────
   24. Suggestions Cards
   ──────────────────────────────────────────────────────────── */
.suggestion-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  border-left: 3px solid var(--border);
}

.suggestion-card.high {
  border-left-color: var(--danger);
}

.suggestion-card.moderate {
  border-left-color: var(--warning);
}

.suggestion-card.low {
  border-left-color: var(--accent);
}

.suggestion-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.suggestion-detail {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

.severity-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 6px;
}

.severity-badge.severity-high {
  background: rgba(196, 75, 59, 0.1);
  color: var(--danger);
}

.severity-badge.severity-moderate {
  background: rgba(212, 165, 32, 0.12);
  color: var(--warning);
}

.severity-badge.severity-low {
  background: var(--accent-dim);
  color: var(--accent);
}

.red-flag-card {
  background: rgba(196, 75, 59, 0.08);
  border: 1px solid var(--danger);
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}

.red-flag-card .red-flag-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--danger);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.red-flag-card .red-flag-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
}


/* ────────────────────────────────────────────────────────────
   25. Patient Summary & Aftercare
   ──────────────────────────────────────────────────────────── */
.summary-text {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  padding: 16px;
}

.aftercare-list {
  list-style: decimal;
  padding-left: 20px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
}

.aftercare-item {
  padding: 8px 0;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease, color 0.2s ease;
}

.copy-btn:hover {
  background: var(--surface);
  color: var(--text);
}

.copy-btn svg {
  width: 14px;
  height: 14px;
}

.section-with-copy {
  position: relative;
}

.section-with-copy .copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
}


/* ────────────────────────────────────────────────────────────
   26. Disclaimer Banner
   ──────────────────────────────────────────────────────────── */
.disclaimer {
  background: var(--surface);
  padding: 10px 16px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  border-top: 1px solid var(--border);
  line-height: 1.4;
}


/* ────────────────────────────────────────────────────────────
   27. Search Bar
   ──────────────────────────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.search-bar svg {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-bar input {
  flex: 1;
  border: none;
  padding: 12px 0 12px 10px;
  font-size: 15px;
  color: var(--text);
  background: transparent;
  outline: none;
}

.search-bar input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}


/* ────────────────────────────────────────────────────────────
   28. Settings
   ──────────────────────────────────────────────────────────── */
.settings-section {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.settings-section:last-child {
  border-bottom: none;
}

.settings-heading {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}

.settings-row-label {
  font-size: 15px;
  color: var(--text);
}

.settings-row-sublabel {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Toggle switch */
.settings-toggle {
  position: relative;
  width: 40px;
  height: 24px;
  background: var(--surface-2);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.settings-toggle.active {
  background: var(--accent);
}

.settings-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

.settings-toggle.active::after {
  transform: translateX(16px);
}


/* ────────────────────────────────────────────────────────────
   29. Toast
   ──────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  padding-top: var(--safe-top);
}

.toast {
  padding: 12px 24px;
  background: var(--text);
  color: var(--white);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  transform: translateY(-20px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: auto;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  max-width: 320px;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.toast-danger {
  background: var(--danger);
}

.toast.toast-success {
  background: var(--accent);
}

.toast.toast-warning {
  background: var(--warning);
  color: var(--text);
}


/* ────────────────────────────────────────────────────────────
   30. Empty States
   ──────────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-state svg {
  width: 80px;
  height: 80px;
  color: var(--text-muted);
  opacity: 0.3;
  margin-bottom: 16px;
}

.empty-state-text {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.empty-state-hint {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 260px;
  line-height: 1.5;
}


/* ────────────────────────────────────────────────────────────
   31. Landing Page — Premium
   ──────────────────────────────────────────────────────────── */
.landing {
  min-height: 100vh;
  background: var(--bg);
  overflow-y: auto;
}

/* ── Nav ── */
.land-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  position: sticky;
  top: 0;
  background: rgba(250, 250, 246, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  z-index: 50;
  border-bottom: 1px solid rgba(224, 216, 204, 0.5);
}

.land-nav-brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.land-logo {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--text);
}

.land-nav-tagline {
  display: none;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  font-weight: 600;
  opacity: 0.8;
}

.land-nav-links {
  display: none;
  align-items: center;
  gap: 28px;
}

.land-nav-link {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: color 0.2s;
}
.land-nav-link:hover { color: var(--text); }

.land-nav-cta {
  padding: 10px 22px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

@media (min-width: 768px) {
  .land-nav-links { display: flex; }
  .land-nav-tagline { display: block; }
}

/* ── Hero ── */
.land-hero {
  position: relative;
  padding: 80px 24px 56px;
  text-align: center;
  overflow: hidden;
}

.land-hero-glow {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse at center, rgba(20, 184, 166, 0.12) 0%, rgba(20, 184, 166, 0.04) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.land-hero-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(20, 184, 166, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse 60% 70% at 50% 40%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 40%, black 20%, transparent 70%);
}

.land-hero-inner {
  max-width: 640px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.land-hero-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-dim);
  padding: 6px 16px;
  border-radius: 100px;
  border: 1px solid rgba(20, 184, 166, 0.15);
}

.land-hero-title {
  font-family: var(--font-serif);
  font-size: 44px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}

.land-hero-sub {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 0;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.land-hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.land-hero-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 20px;
  opacity: 0.7;
  letter-spacing: 0.2px;
}

/* ── CTA Button (premium gradient) ── */
.land-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 36px;
  background: linear-gradient(135deg, #14B8A6 0%, #0D9488 100%);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(20, 184, 166, 0.3), 0 1px 3px rgba(0,0,0,0.08);
}
.land-cta:hover {
  background: linear-gradient(135deg, #0D9488 0%, #0F766E 100%);
  box-shadow: 0 6px 20px rgba(20, 184, 166, 0.4), 0 2px 6px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}
.land-cta:active { transform: translateY(0) scale(0.98); }

/* ── Marquee ── */
.land-marquee {
  background: linear-gradient(135deg, #1A2332 0%, #162030 50%, #1A2332 100%);
  color: rgba(255,255,255,0.9);
  padding: 16px 0;
  overflow: hidden;
  white-space: nowrap;
  border-top: 1px solid rgba(20, 184, 166, 0.15);
  border-bottom: 1px solid rgba(20, 184, 166, 0.15);
}
.land-marquee-track {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  animation: marqueeScroll 30s linear infinite;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
}
.marquee-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(20, 184, 166, 0.5);
}
@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── Section Labels ── */
.land-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--accent);
  font-weight: 700;
  text-align: center;
  margin-bottom: 10px;
}

/* ── Sections ── */
.land-section {
  padding: 72px 24px;
}
.land-section-title {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}
.land-section-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 40px;
  line-height: 1.6;
}
.land-section-alt {
  background: var(--surface);
}
.land-section-cta {
  text-align: center;
  padding: 80px 24px;
  background: linear-gradient(180deg, var(--bg) 0%, var(--surface) 100%);
  position: relative;
}
.land-cta-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 12px;
}
.land-cta-sub {
  font-size: 15px;
  color: var(--text-muted);
  margin-top: 12px;
  margin-bottom: 24px;
  line-height: 1.6;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Feature Cards (glass + accent border) ── */
.land-features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  max-width: 900px;
  margin: 0 auto;
}
.land-feature-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid rgba(224, 216, 204, 0.6);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.02);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.land-feature-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-light) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.land-feature-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(20, 184, 166, 0.06);
  transform: translateY(-2px);
  border-color: rgba(20, 184, 166, 0.2);
}
.land-feature-card:hover::before {
  opacity: 1;
}
.land-feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.12) 0%, rgba(20, 184, 166, 0.06) 100%);
  border: 1px solid rgba(20, 184, 166, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--accent);
}
.land-feature-card h3 {
  font-family: var(--font-serif);
  font-size: 17px;
  margin-bottom: 6px;
  color: var(--text);
  letter-spacing: -0.2px;
}
.land-feature-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Steps ── */
.land-steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  max-width: 800px;
  margin: 0 auto;
}
.land-step {
  text-align: center;
  padding: 24px 20px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: var(--radius);
  border: 1px solid rgba(224, 216, 204, 0.4);
  transition: all 0.3s ease;
}
.land-step:hover {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(20, 184, 166, 0.15);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}
.land-step-num {
  font-family: var(--font-serif);
  font-size: 40px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  line-height: 1;
}
.land-step h3 {
  font-family: var(--font-serif);
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--text);
  letter-spacing: -0.2px;
}
.land-step p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 320px;
  margin: 0 auto;
}

/* ── Privacy ── */
.land-privacy {
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(224, 216, 204, 0.5);
  border-radius: 20px;
  padding: 40px 32px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.land-privacy svg {
  color: var(--accent);
  margin: 0 auto 16px;
}
.land-privacy h2 {
  font-family: var(--font-serif);
  font-size: 24px;
  margin-bottom: 12px;
  color: var(--text);
  letter-spacing: -0.2px;
}
.land-privacy p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ── Footer ── */
/* ── Differentiators Grid ── */
.land-diff-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 32px;
}
.land-diff-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
}
.land-diff-stat {
  font-family: var(--font-serif);
  font-size: 40px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 6px;
}
.land-diff-card h3 {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.land-diff-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Hardware Section ── */
.land-hardware {
  display: flex;
  align-items: center;
  gap: 48px;
  flex-wrap: wrap;
}
.land-hardware-text {
  flex: 1;
  min-width: 280px;
}
.land-hardware-text .land-section-title {
  text-align: left;
}
.land-hardware-text .land-section-label {
  text-align: left;
}
.land-hardware-desc {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-top: 12px;
  margin-bottom: 24px;
}
.land-hardware-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.land-hw-feat {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}
.land-hw-feat svg {
  color: var(--accent);
  flex-shrink: 0;
}
.land-hardware-visual {
  flex: 0 0 200px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.land-pin-mockup {
  width: 140px;
  height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.land-pin-body {
  width: 100px;
  height: 65px;
  background: linear-gradient(135deg, #1A2332 0%, #243044 100%);
  border-radius: 14px;
  position: relative;
  box-shadow: 0 8px 32px rgba(20, 184, 166, 0.15), 0 2px 8px rgba(0,0,0,0.2);
  border: 1px solid rgba(20, 184, 166, 0.2);
}
.land-pin-led {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent), 0 0 16px rgba(20, 184, 166, 0.4);
  animation: pin-pulse 2s ease-in-out infinite;
}
@keyframes pin-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--accent), 0 0 16px rgba(20, 184, 166, 0.4); }
  50% { opacity: 0.5; box-shadow: 0 0 4px var(--accent), 0 0 8px rgba(20, 184, 166, 0.2); }
}
.land-pin-mic {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  background: rgba(255,255,255,0.3);
  border-radius: 50%;
}
.land-pin-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Pricing Grid ── */
.land-pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 32px;
}
.land-pricing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.land-pricing-featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 8px 32px rgba(20, 184, 166, 0.1);
}
.land-pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 4px 14px;
  border-radius: 20px;
  white-space: nowrap;
}
.land-pricing-card h3 {
  font-family: var(--font-serif);
  font-size: 20px;
  color: var(--text);
  margin-bottom: 8px;
}
.land-pricing-price {
  font-family: var(--font-serif);
  font-size: 44px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 20px;
}
.land-pricing-price span {
  font-size: 14px;
  font-weight: 400;
  font-family: var(--font-sans);
  color: var(--text-muted);
}
.land-pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  text-align: left;
  width: 100%;
}
.land-pricing-features li {
  font-size: 13px;
  color: var(--text-muted);
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.4;
}
.land-pricing-features li:last-child {
  border-bottom: none;
}
.land-pricing-card .btn {
  margin-top: auto;
  width: 100%;
}

/* ── Pricing responsive ── */
@media (max-width: 767px) {
  .land-pricing-grid {
    grid-template-columns: 1fr;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
  }
  .land-diff-grid {
    grid-template-columns: 1fr 1fr;
  }
  .land-hardware {
    flex-direction: column;
    text-align: center;
  }
  .land-hardware-text .land-section-title,
  .land-hardware-text .land-section-label {
    text-align: center;
  }
  .land-hardware-desc {
    text-align: center;
  }
  .land-hardware-features {
    align-items: center;
  }
}

.land-footer {
  background: linear-gradient(180deg, #1A2332 0%, #141C28 100%);
  color: rgba(255,255,255,0.9);
  padding: 48px 24px 28px;
}
.land-footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.land-footer-brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.land-footer-brand .land-logo {
  color: rgba(255,255,255,0.9);
  font-size: 20px;
}
.land-footer-brand p {
  font-size: 12px;
  color: var(--accent);
  opacity: 0.7;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.land-footer-links {
  display: flex;
  gap: 24px;
}
.land-footer-links a {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: color 0.2s;
  letter-spacing: 0.2px;
}
.land-footer-links a:hover { color: rgba(255,255,255,0.9); }
.land-footer-copy {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 20px;
}
.land-footer-copy p {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  line-height: 1.6;
  text-align: center;
  letter-spacing: 0.2px;
}


/* ────────────────────────────────────────────────────────────
   32. Responsive
   ──────────────────────────────────────────────────────────── */

/* Tablet */
@media (min-width: 768px) {
  .stats-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  .vitals-table {
    grid-template-columns: repeat(4, 1fr);
  }

  .land-features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .land-steps {
    grid-template-columns: repeat(3, 1fr);
  }

  .land-hero-title {
    font-size: 52px;
  }

  .land-hero-glow {
    width: 800px;
    height: 500px;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .land-features-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .land-hero-title {
    font-size: 60px;
  }

  .land-hero {
    padding: 120px 24px 80px;
  }

  .land-hero-glow {
    width: 1000px;
    height: 600px;
  }

  .land-section {
    padding: 88px 24px;
    max-width: 1100px;
    margin: 0 auto;
  }

  .land-section-title {
    font-size: 36px;
  }
}


/* ────────────────────────────────────────────────────────────
   33. Reduced Motion
   ──────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* ────────────────────────────────────────────────────────────
   34. E/M Level Badge
   ──────────────────────────────────────────────────────────── */
.em-badge {
  display: inline-flex;
  align-items: center;
  background: var(--accent-dim);
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
}


/* ────────────────────────────────────────────────────────────
   35. Follow-Up Badge
   ──────────────────────────────────────────────────────────── */
.followup-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-dim);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
}

.followup-badge svg {
  width: 16px;
  height: 16px;
}


/* ────────────────────────────────────────────────────────────
   36. Referral Section
   ──────────────────────────────────────────────────────────── */
.referral-text {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  padding: 16px;
  position: relative;
}

.referral-text .copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
}


/* ────────────────────────────────────────────────────────────
   37. Reviewed Toggle
   ──────────────────────────────────────────────────────────── */
.reviewed-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.reviewed-toggle .check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

.reviewed-toggle .check svg {
  width: 12px;
  height: 12px;
  color: transparent;
  transition: color 0.2s ease;
}

.reviewed-toggle.checked {
  color: var(--accent);
}

.reviewed-toggle.checked .check {
  background: var(--accent);
  border-color: var(--accent);
}

.reviewed-toggle.checked .check svg {
  color: var(--white);
}


/* ────────────────────────────────────────────────────────────
   38. Additional Detail Styles
   ──────────────────────────────────────────────────────────── */
.detail-type-badge {
  text-align: center;
  padding: 4px 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.detail-actions {
  display: flex;
  gap: 12px;
  padding: 24px 0;
  margin-top: 16px;
  border-top: 1px solid var(--border);
}

.detail-actions .btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
}

.suggestions-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 24px 0 12px;
}
.suggestions-section-label:first-child { margin-top: 0; }

.section-copy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.soap-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 20px 0 10px;
}

/* Processing dots */
.processing-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 20px;
}
.processing-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.3;
  animation: processingDot 1.4s infinite ease-in-out both;
}
.processing-dots span:nth-child(1) { animation-delay: -0.32s; }
.processing-dots span:nth-child(2) { animation-delay: -0.16s; }
.processing-dots span:nth-child(3) { animation-delay: 0s; }
@keyframes processingDot {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* Patient grouping */
.patient-group {
  margin-bottom: 20px;
}
.patient-group-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

/* New encounter start button */
.new-encounter-start-btn {
  margin-top: 24px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* Severity badge variants */
.severity-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 6px;
}
.severity-high { background: rgba(196,75,59,0.12); color: var(--danger); }
.severity-moderate { background: rgba(212,165,32,0.15); color: var(--warning); }
.severity-low { background: var(--accent-dim); color: var(--accent); }

/* Live transcript placeholder */
.live-transcript-placeholder {
  color: var(--text-muted);
  font-style: italic;
}

/* Detail body extra padding */
.detail-body {
  padding-bottom: 120px;
}

/* ────────────────────────────────────────────────────────────
   Utilities
   ──────────────────────────────────────────────────────────── */
.flex-row {
  display: flex;
  align-items: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.gap-4 { gap: 4px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }

.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }

.w-full { width: 100%; }
.text-center { text-align: center; }
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ────────────────────────────────────────────────────────────
   Dark Mode
   ──────────────────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:           #1A1E2A;
  --surface:      #242836;
  --surface-2:    #2E3344;
  --accent:       #2DD4BF;
  --accent-light: #5EEAD4;
  --accent-dim:   rgba(45, 212, 191, 0.15);
  --text:         #E8E4DC;
  --text-muted:   #8E99A8;
  --danger:       #E05A4A;
  --warning:      #E4B530;
  --border:       #3A3E4C;
  --white:        #2A2E3A;
}

[data-theme="dark"] .screen-header {
  background: var(--surface);
  border-bottom-color: var(--border);
}

[data-theme="dark"] .bottom-nav {
  background: var(--surface);
  border-top-color: var(--border);
}

[data-theme="dark"] .landing {
  background: var(--bg);
}

[data-theme="dark"] .land-nav {
  background: rgba(26, 30, 42, 0.85);
  border-bottom-color: rgba(58, 62, 76, 0.5);
}

[data-theme="dark"] .land-hero {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
}

[data-theme="dark"] .land-hero-glow {
  background: radial-gradient(ellipse at center, rgba(45, 212, 191, 0.1) 0%, rgba(45, 212, 191, 0.03) 40%, transparent 70%);
}

[data-theme="dark"] .land-hero-grid {
  background-image: radial-gradient(circle, rgba(45, 212, 191, 0.06) 1px, transparent 1px);
}

[data-theme="dark"] .land-hero-label {
  background: var(--accent-dim);
  border-color: rgba(45, 212, 191, 0.2);
}

[data-theme="dark"] .land-marquee {
  background: linear-gradient(135deg, var(--surface) 0%, #1E2230 50%, var(--surface) 100%);
  border-color: rgba(45, 212, 191, 0.1);
}

[data-theme="dark"] .land-section-alt {
  background: var(--surface);
}

[data-theme="dark"] .land-feature-card {
  background: rgba(36, 40, 54, 0.7);
  border-color: var(--border);
}
[data-theme="dark"] .land-feature-card:hover {
  border-color: rgba(45, 212, 191, 0.2);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2), 0 8px 24px rgba(45, 212, 191, 0.05);
}

[data-theme="dark"] .land-feature-icon {
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.15) 0%, rgba(45, 212, 191, 0.06) 100%);
  border-color: rgba(45, 212, 191, 0.12);
}

[data-theme="dark"] .land-step {
  background: rgba(36, 40, 54, 0.4);
  border-color: rgba(58, 62, 76, 0.5);
}
[data-theme="dark"] .land-step:hover {
  background: rgba(36, 40, 54, 0.7);
  border-color: rgba(45, 212, 191, 0.15);
}

[data-theme="dark"] .land-privacy {
  background: rgba(36, 40, 54, 0.5);
  border-color: var(--border);
}

[data-theme="dark"] .land-section-cta {
  background: linear-gradient(180deg, var(--bg) 0%, var(--surface) 100%);
}

[data-theme="dark"] .land-diff-card {
  background: var(--surface);
  border-color: var(--border);
}
[data-theme="dark"] .land-diff-card h3 { color: var(--text); }
[data-theme="dark"] .land-pin-body {
  background: linear-gradient(135deg, #0F1520 0%, #1A2332 100%);
  border-color: rgba(20, 184, 166, 0.3);
}
[data-theme="dark"] .land-pricing-card {
  background: var(--surface);
  border-color: var(--border);
}
[data-theme="dark"] .land-pricing-featured {
  border-color: var(--accent);
}
[data-theme="dark"] .land-pricing-card h3 { color: var(--text); }
[data-theme="dark"] .land-pricing-price { color: var(--text); }
[data-theme="dark"] .land-pricing-features li { border-bottom-color: var(--border); }
[data-theme="dark"] .land-footer {
  background: linear-gradient(180deg, var(--surface) 0%, #1A1E28 100%);
}

[data-theme="dark"] .land-footer-copy {
  border-top-color: rgba(255,255,255,0.06);
}

[data-theme="dark"] .card,
[data-theme="dark"] .land-feature-card,
[data-theme="dark"] .suggestion-card,
[data-theme="dark"] .red-flag-card {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-select:focus {
  border-color: var(--accent);
}

[data-theme="dark"] .type-pill {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text-muted);
}

[data-theme="dark"] .type-pill.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

[data-theme="dark"] .filter-pill,
[data-theme="dark"] .sort-pill {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text-muted);
}

[data-theme="dark"] .filter-pill.active,
[data-theme="dark"] .sort-pill.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

[data-theme="dark"] .btn-secondary {
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .btn-secondary:hover {
  background: var(--surface-2);
}

[data-theme="dark"] .encounter-card {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .stat-card {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .search-bar input {
  background: var(--surface-2);
  color: var(--text);
}

[data-theme="dark"] .detail-tabs {
  border-bottom-color: var(--border);
}

[data-theme="dark"] .soap-section {
  background: var(--surface);
}

[data-theme="dark"] .soap-text[contenteditable] {
  color: var(--text);
}

[data-theme="dark"] .vitals-table .vital-item {
  background: var(--surface-2);
}

[data-theme="dark"] .icd-tag {
  background: var(--accent-dim);
}

[data-theme="dark"] .disclaimer {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .processing-area {
  background: var(--bg);
}

[data-theme="dark"] .settings-section {
  border-bottom-color: var(--border);
}

[data-theme="dark"] .settings-row {
  border-bottom-color: var(--border);
}

/* (land-privacy + land-section-cta dark overrides handled in main dark landing block above) */

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg:           #1A1E2A;
    --surface:      #242836;
    --surface-2:    #2E3344;
    --accent:       #2DD4BF;
    --accent-light: #5EEAD4;
    --accent-dim:   rgba(45, 212, 191, 0.15);
    --text:         #E8E4DC;
    --text-muted:   #8E99A8;
    --danger:       #E05A4A;
    --warning:      #E4B530;
    --border:       #3A3E4C;
    --white:        #2A2E3A;
  }
}

/* ────────────────────────────────────────────────────────────
   Modal / Dialog
   ──────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  padding: 20px;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px 20px;
  max-width: 340px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  transform: translateY(10px) scale(0.97);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.modal-message {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.modal-actions .btn {
  min-width: 80px;
  padding: 10px 18px;
  font-size: 14px;
}

/* ────────────────────────────────────────────────────────────
   Loading Skeletons
   ──────────────────────────────────────────────────────────── */
.skeleton {
  background: var(--surface);
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--surface-2) 50%,
    transparent 100%
  );
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.skeleton-stat {
  height: 72px;
  border-radius: var(--radius);
}

.skeleton-card {
  height: 88px;
  border-radius: var(--radius);
  margin-bottom: 10px;
}

.skeleton-text {
  height: 16px;
  margin-bottom: 10px;
}

.skeleton-text.short { width: 60%; }
.skeleton-text.medium { width: 80%; }
.skeleton-text.long { width: 95%; }

.skeleton-heading {
  height: 24px;
  width: 50%;
  margin-bottom: 16px;
}

/* ────────────────────────────────────────────────────────────
   Button & Form States
   ──────────────────────────────────────────────────────────── */
.btn:disabled,
.btn.disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
  top: 50%;
  left: 50%;
  margin: -9px 0 0 -9px;
  color: var(--white);
}

@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

.form-input.error {
  border-color: var(--danger);
  animation: shake 0.3s ease;
}

.form-helper {
  font-size: 12px;
  margin-top: 4px;
  line-height: 1.4;
}

.form-helper.error {
  color: var(--danger);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}

/* ────────────────────────────────────────────────────────────
   Animations — Card Entrance & Tab Transitions
   ──────────────────────────────────────────────────────────── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.encounter-card.animate-in {
  animation: fadeInUp 0.3s ease forwards;
  opacity: 0;
}

.encounter-card.animate-in:nth-child(1) { animation-delay: 0s; }
.encounter-card.animate-in:nth-child(2) { animation-delay: 0.04s; }
.encounter-card.animate-in:nth-child(3) { animation-delay: 0.08s; }
.encounter-card.animate-in:nth-child(4) { animation-delay: 0.12s; }
.encounter-card.animate-in:nth-child(5) { animation-delay: 0.16s; }
.encounter-card.animate-in:nth-child(6) { animation-delay: 0.2s; }
.encounter-card.animate-in:nth-child(7) { animation-delay: 0.24s; }
.encounter-card.animate-in:nth-child(8) { animation-delay: 0.28s; }

.detail-tab-content {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.detail-tab-content:not(.active) {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  position: absolute;
  visibility: hidden;
}

.detail-tab-content.active {
  opacity: 1;
  transform: translateY(0);
  position: relative;
  visibility: visible;
}

/* ────────────────────────────────────────────────────────────
   Accessibility
   ──────────────────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  z-index: 9999;
  font-size: 14px;
  font-weight: 600;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 8px;
}

*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[contenteditable]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ────────────────────────────────────────────────────────────
   Dark Mode Toggle (Settings)
   ──────────────────────────────────────────────────────────── */
.theme-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.theme-toggle-row span {
  font-size: 15px;
  color: var(--text);
}

/* ────────────────────────────────────────────────────────────
   Pause/Resume Recording
   ──────────────────────────────────────────────────────────── */
.record-actions-row {
  display: flex;
  gap: 10px;
  width: 100%;
}

.record-actions-row .btn-pause {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 18px;
  min-width: 100px;
}

.record-actions-row .btn-lg {
  flex: 1;
}

.record-indicator.paused {
  color: var(--warning);
}

.record-indicator.paused .record-pulse {
  background: var(--warning);
  animation: none;
}

/* ────────────────────────────────────────────────────────────
   Audio Player
   ──────────────────────────────────────────────────────────── */
.audio-player {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin: 0 20px 12px;
}

.audio-play-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.audio-play-btn:hover {
  background: var(--accent-light);
}

.audio-scrubber {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}

.audio-scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.audio-time {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  min-width: 36px;
  text-align: right;
}

/* ────────────────────────────────────────────────────────────
   Manual Notes
   ──────────────────────────────────────────────────────────── */
.manual-notes-area {
  margin-top: 16px;
}

.manual-notes-area textarea {
  width: 100%;
  min-height: 80px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
}

.manual-notes-area textarea:focus {
  border-color: var(--accent);
  outline: none;
}

/* ────────────────────────────────────────────────────────────
   Tags
   ──────────────────────────────────────────────────────────── */
.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 8px 20px 0;
}

.encounter-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.encounter-tag .tag-remove {
  cursor: pointer;
  opacity: 0.6;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}

.encounter-tag .tag-remove:hover {
  opacity: 1;
}

.tag-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tag-add-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.tag-input-inline {
  width: 100px;
  padding: 3px 8px;
  border: 1px solid var(--accent);
  border-radius: 20px;
  font-size: 12px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}

/* ────────────────────────────────────────────────────────────
   Print Stylesheet
   ──────────────────────────────────────────────────────────── */
@media print {
  body {
    background: white !important;
    color: #1A2332 !important;
    overflow: visible !important;
  }

  .screen { display: none !important; }
  .screen#screen-encounter-detail {
    display: block !important;
    position: static !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .screen-header,
  .bottom-nav,
  .detail-tabs,
  .disclaimer,
  .modal-overlay,
  .toast-container,
  .skip-link,
  .detail-actions,
  .reviewed-toggle,
  .detail-type-badge { display: none !important; }

  .detail-body,
  .screen-body {
    padding: 0 !important;
    overflow: visible !important;
  }

  .detail-tab-content {
    display: block !important;
    position: static !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    page-break-inside: avoid;
  }

  .detail-tab-content:not(.active) {
    display: block !important;
    position: static !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .print-header {
    display: block !important;
    text-align: center;
    padding: 20px 0;
    border-bottom: 2px solid #14B8A6;
    margin-bottom: 20px;
  }

  .print-header h1 {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 22px;
    margin-bottom: 4px;
  }

  .print-header .print-meta {
    font-size: 13px;
    color: #6B7A8D;
  }

  .soap-section {
    page-break-inside: avoid;
    background: white !important;
    border: 1px solid #E0D8CC;
  }

  .suggestions-section-label {
    page-break-after: avoid;
  }

  .copy-btn { display: none !important; }
}

.print-header { display: none; }

/* ────────────────────────────────────────────────────────────
   Next Patient Button
   ──────────────────────────────────────────────────────────── */
.next-patient-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  margin-top: 12px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.next-patient-btn:hover {
  background: var(--accent);
  color: white;
}

.hidden {
  display: none !important;
}

/* ────────────────────────────────────────────────────────────
   Phase 8: Demo & Resilience Styles
   ──────────────────────────────────────────────────────────── */

/* Error Recovery Card */
.error-recovery-card {
  background: var(--surface);
  border: 1px solid var(--danger);
  border-left: 4px solid var(--danger);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 20px;
}

.error-recovery-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--danger);
  font-weight: 600;
  font-size: 14px;
}

.error-recovery-header svg {
  flex-shrink: 0;
}

.error-recovery-message {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 14px;
}

.error-recovery-actions {
  display: flex;
  gap: 10px;
}

.error-recovery-actions .btn {
  flex: 1;
  font-size: 13px;
  padding: 10px 14px;
}

/* Pending Analysis Badge */
.badge-pending {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--warning);
}

.badge-pending::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warning);
  animation: pendingPulse 1.5s infinite;
}

@keyframes pendingPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Demo Button on Landing */
.land-demo-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1.5px solid rgba(20, 184, 166, 0.4);
  color: var(--accent);
  padding: 14px 28px;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  letter-spacing: 0.3px;
}

.land-demo-btn:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* Retry status in processing screen */
.processing-retry {
  font-size: 13px;
  color: var(--warning);
  font-weight: 500;
  margin-top: 8px;
  min-height: 20px;
}

/* Demo section in settings */
.demo-section-note {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
}

/* Offline indicator */
.offline-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--warning);
  color: #1A2332;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  justify-content: center;
}

.offline-indicator svg {
  width: 14px;
  height: 14px;
}

/* Dark mode overrides for Phase 8 */
[data-theme="dark"] .error-recovery-card {
  background: var(--surface);
  border-color: var(--danger);
}

[data-theme="dark"] .land-demo-btn {
  border-color: var(--accent);
  color: var(--accent);
}

[data-theme="dark"] .land-demo-btn:hover {
  background: var(--accent-dim);
}

/* ────────────────────────────────────────────────────────────
   Phase 9: Advanced Features Styles
   ──────────────────────────────────────────────────────────── */

/* View Mode Toggle (List / Patients) */
.view-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.view-toggle-btn {
  flex: 1;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-sans);
  text-align: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.view-toggle-btn.active {
  background: var(--accent);
  color: #fff;
}

/* Patient Cards */
.patient-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.patient-card:active {
  transform: scale(0.98);
}

.patient-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.patient-card-name {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.patient-card-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 2px 8px;
  border-radius: 100px;
}

.patient-card-meta {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.patient-card-conditions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.condition-chip {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  padding: 2px 8px;
  border-radius: 100px;
  border: 1px solid var(--border);
}

/* Patient Profile Header */
.patient-profile-header {
  padding: 16px 0;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.patient-profile-name {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.patient-profile-stats {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.patient-back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  margin-bottom: 12px;
  border: none;
  background: none;
  padding: 0;
  font-family: var(--font-sans);
}

/* Vital Sparklines */
.vitals-trend-section {
  margin-bottom: 20px;
}

.vitals-trend-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sparkline-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.sparkline-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.sparkline-value {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-sans);
  color: var(--text);
  margin-bottom: 4px;
}

.sparkline-svg {
  width: 100%;
  height: 30px;
}

/* Dashboard Secondary Stats */
.stats-row-secondary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.stats-row-secondary .stat-tile {
  background: var(--surface);
  border-color: transparent;
}

.stats-row-secondary .stat-number {
  font-size: 16px;
  color: var(--text-muted);
}

.stats-row-secondary .stat-label {
  font-size: 10px;
}

/* Selection Mode */
.encounter-card-select {
  position: relative;
  padding-left: 40px;
}

.encounter-card-select .select-checkbox {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.encounter-card-select.selected .select-checkbox {
  background: var(--accent);
  border-color: var(--accent);
}

.encounter-card-select.selected .select-checkbox svg {
  display: block;
}

.encounter-card-select .select-checkbox svg {
  display: none;
  width: 14px;
  height: 14px;
  stroke: #fff;
  stroke-width: 3;
}

/* Selection Floating Bar */
.selection-bar {
  position: fixed;
  bottom: calc(68px + var(--safe-bottom));
  left: 16px;
  right: 16px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 50;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  animation: fadeInUp 0.2s ease;
}

.selection-bar-count {
  font-size: 14px;
  font-weight: 600;
}

.selection-bar-actions {
  display: flex;
  gap: 10px;
}

.selection-bar-actions .btn {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 8px;
}

.btn-selection-export {
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: none;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-sans);
}

.btn-selection-cancel {
  background: transparent;
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.3);
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-sans);
}

/* Quick Start Templates */
.template-section {
  margin-bottom: 20px;
}

.template-section-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.template-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.template-pill {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-sans);
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid transparent;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.template-pill:hover, .template-pill:active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

/* Header action button for Select */
.header-action-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  padding: 4px 8px;
}

/* Dark Mode Overrides for Phase 9 */
[data-theme="dark"] .patient-card {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .sparkline-card {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .condition-chip {
  background: var(--surface-2);
  border-color: var(--border);
}

[data-theme="dark"] .encounter-card-select .select-checkbox {
  border-color: var(--border);
}

[data-theme="dark"] .selection-bar {
  background: var(--accent);
}

[data-theme="dark"] .template-pill {
  background: var(--accent-dim);
  color: var(--accent);
}

/* ────────────────────────────────────────────────────────────
   Phase 9 Runtime: View Toggle Bar, Patient Profile, Selection,
   Vitals Sparklines, Template Picker
   ──────────────────────────────────────────────────────────── */

/* View Mode Toggle Bar */
.view-mode-toggle {
  margin-bottom: 12px;
}

.view-toggle-bar {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}

.view-toggle-bar .view-toggle-btn {
  flex: none;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-sans);
  text-align: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.view-toggle-bar .view-toggle-btn.active {
  background: var(--accent);
  color: #fff;
}

.view-toggle-bar .select-btn {
  border-left: 1px solid var(--border);
}

/* Patient Card — avatar */
.patient-card-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 12px;
}

.patient-card {
  display: flex;
  align-items: flex-start;
}

/* Patient conditions chips */
.patient-conditions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.patient-condition-chip {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  padding: 2px 8px;
  border-radius: 100px;
  border: 1px solid var(--border);
}

/* Patient Profile Header */
.patient-profile-name {
  display: flex;
  align-items: center;
  gap: 8px;
}

.patient-profile-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  padding-left: 32px;
}

.patient-timeline-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.btn-back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  margin-bottom: 12px;
  border: none;
  background: none;
  padding: 0;
  font-family: var(--font-sans);
}

/* Vital Sparklines */
.vital-sparkline {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.vital-sparkline-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  min-width: 40px;
}

.vital-sparkline-svg {
  flex: 1;
  height: 30px;
}

.vital-sparkline-value {
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-sans);
  color: var(--text);
  min-width: 50px;
  text-align: right;
}

/* Selection Mode */
.selectable-card {
  position: relative;
  padding-left: 44px !important;
}

.selection-checkbox {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}

.selection-checkbox.checked {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.selectable-card.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* Selection Action Bar */
.selection-action-bar {
  position: fixed;
  bottom: calc(68px + var(--safe-bottom));
  left: 16px;
  right: 16px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 50;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  animation: fadeInUp 0.2s ease;
}

.selection-count {
  font-size: 14px;
  font-weight: 600;
}

.selection-actions {
  display: flex;
  gap: 8px;
}

.selection-actions .btn {
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 8px;
}

.selection-actions .btn-primary {
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: none;
}

.selection-actions .btn-secondary {
  background: transparent;
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.3);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

/* Template Picker */
.template-picker {
  margin-bottom: 16px;
}

.template-picker-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.template-pill.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Dark mode additions */
[data-theme="dark"] .view-toggle-bar {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .vital-sparkline {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .patient-condition-chip {
  background: var(--surface-2, var(--surface));
  border-color: var(--border);
}

[data-theme="dark"] .selection-checkbox {
  border-color: var(--border);
}

[data-theme="dark"] .selectable-card.selected {
  background: rgba(20, 184, 166, 0.08);
}

/* ────────────────────────────────────────────────────────────
   Phase 10: Clinical Risk Scores, Bilingual, Orders, Education
   ──────────────────────────────────────────────────────────── */

/* --- 10.1 Clinical Risk Score Cards --- */
.clinical-scores-section {
  margin-bottom: 20px;
}

.score-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  border-left: 3px solid var(--border);
}

.score-card.risk-low {
  border-left-color: #10B981;
}

.score-card.risk-moderate {
  border-left-color: #F59E0B;
}

.score-card.risk-high {
  border-left-color: #EF4444;
}

.score-card.risk-critical {
  border-left-color: #7F1D1D;
  background: rgba(127, 29, 29, 0.04);
}

.score-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.score-card-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.score-card-value {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
}

.score-card-value.risk-low {
  color: #10B981;
}

.score-card-value.risk-moderate {
  color: #F59E0B;
}

.score-card-value.risk-high {
  color: #EF4444;
}

.score-card-value.risk-critical {
  color: #7F1D1D;
}

.score-card-interpretation {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.risk-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.risk-badge.low {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.risk-badge.moderate {
  background: rgba(245, 158, 11, 0.12);
  color: #D97706;
}

.risk-badge.high {
  background: rgba(239, 68, 68, 0.12);
  color: #DC2626;
}

.risk-badge.critical {
  background: rgba(127, 29, 29, 0.15);
  color: #7F1D1D;
}

.score-breakdown-toggle {
  font-size: 12px;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-sans);
  font-weight: 600;
}

.score-breakdown-toggle:hover {
  opacity: 0.8;
}

.score-breakdown {
  display: none;
}

.score-breakdown.visible {
  display: block;
}

.score-component {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.score-component:last-child {
  border-bottom: none;
}

.score-component-name {
  color: var(--text-muted);
}

.score-component-value {
  color: var(--text);
  font-weight: 500;
}

.score-component-points {
  min-width: 40px;
  text-align: right;
  font-weight: 700;
  color: var(--accent);
}


/* --- 10.2 Language Toggle (Bilingual) --- */
.lang-toggle {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 100px;
  overflow: hidden;
  width: fit-content;
  margin-bottom: 12px;
}

.lang-toggle-btn {
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  transition: all 0.2s;
  font-family: var(--font-sans);
}

.lang-toggle-btn.active {
  background: var(--accent);
  color: white;
}

.lang-toggle-btn:hover:not(.active) {
  background: var(--surface);
}


/* --- 10.3 Smart Follow-Up / Clinical Orders --- */
.clinical-orders-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.follow-up-timeline-card {
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.follow-up-timeline-icon {
  color: var(--accent);
  flex-shrink: 0;
}

.follow-up-timeline-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.follow-up-timeline-reason {
  font-size: 13px;
  color: var(--text-muted);
}

.order-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
}

.order-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}

.order-rationale {
  font-size: 12px;
  color: var(--text-muted);
}

.urgency-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.urgency-badge.stat {
  background: #FEE2E2;
  color: #DC2626;
}

.urgency-badge.routine {
  background: var(--accent-dim);
  color: var(--accent);
}

.urgency-badge.prn {
  background: #FEF3C7;
  color: #D97706;
}

.urgency-badge.urgent {
  background: #FEE2E2;
  color: #DC2626;
}

.action-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.action-badge.start {
  background: #D1FAE5;
  color: #059669;
}

.action-badge.adjust {
  background: #FEF3C7;
  color: #D97706;
}

.action-badge.discontinue {
  background: #FEE2E2;
  color: #DC2626;
}

.action-badge.continue {
  background: var(--accent-dim);
  color: var(--accent);
}

.action-badge.monitor {
  background: #DBEAFE;
  color: #2563EB;
}

.precaution-card {
  border: 1px solid #EF4444;
  border-radius: 8px;
  padding: 10px 14px;
  background: #FEF2F2;
  font-size: 13px;
  color: #991B1B;
  margin-bottom: 6px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}


/* --- 10.4 Education / Feedback Tab --- */
.feedback-hero {
  text-align: center;
  padding: 24px 0;
}

.feedback-score-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin: 0 auto 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 4px solid var(--border);
}

.feedback-score-circle.grade-a {
  border-color: var(--accent);
}

.feedback-score-circle.grade-b {
  border-color: #F59E0B;
}

.feedback-score-circle.grade-c {
  border-color: #EF4444;
}

.feedback-score-circle.grade-d,
.feedback-score-circle.grade-f {
  border-color: #7F1D1D;
}

.feedback-score-number {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.feedback-score-grade {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
}

.feedback-bars {
  margin: 20px 0;
}

.feedback-bar-row {
  margin-bottom: 12px;
}

.feedback-bar-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.feedback-bar-track {
  height: 8px;
  background: var(--surface);
  border-radius: 100px;
  overflow: hidden;
}

.feedback-bar-fill {
  height: 100%;
  border-radius: 100px;
  transition: width 0.6s ease;
}

.feedback-bar-fill.bar-good {
  background: #10B981;
}

.feedback-bar-fill.bar-moderate {
  background: #F59E0B;
}

.feedback-bar-fill.bar-low {
  background: #EF4444;
}

.feedback-section {
  margin-bottom: 20px;
}

.strength-card {
  border-left: 3px solid #10B981;
  background: #F0FDF4;
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 6px;
  font-size: 13px;
  color: #065F46;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.improvement-card {
  border-left: 3px solid #F59E0B;
  background: #FFFBEB;
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 6px;
  font-size: 13px;
  color: #92400E;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.missing-card {
  border: 1px dashed #EF4444;
  background: #FEF2F2;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 13px;
  color: #991B1B;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.tip-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
  font-size: 13px;
  color: var(--text);
}

.tip-icon {
  color: #F59E0B;
  flex-shrink: 0;
  margin-top: 2px;
}

.exemplar-card {
  background: var(--surface);
  border-left: 3px solid var(--accent);
  padding: 14px 16px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  font-style: italic;
}


/* --- 10.5 Dark Mode Overrides for Phase 10 --- */

/* Score cards */
[data-theme="dark"] .score-card {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .score-card.risk-critical {
  background: rgba(127, 29, 29, 0.15);
}

[data-theme="dark"] .score-card-value.risk-low {
  color: #34D399;
}

[data-theme="dark"] .score-card-value.risk-moderate {
  color: #FBBF24;
}

[data-theme="dark"] .score-card-value.risk-high {
  color: #F87171;
}

[data-theme="dark"] .score-card-value.risk-critical {
  color: #FCA5A5;
}

/* Risk badges — dark */
[data-theme="dark"] .risk-badge.low {
  background: rgba(16, 185, 129, 0.18);
  color: #34D399;
}

[data-theme="dark"] .risk-badge.moderate {
  background: rgba(245, 158, 11, 0.18);
  color: #FBBF24;
}

[data-theme="dark"] .risk-badge.high {
  background: rgba(239, 68, 68, 0.18);
  color: #F87171;
}

[data-theme="dark"] .risk-badge.critical {
  background: rgba(127, 29, 29, 0.25);
  color: #FCA5A5;
}

/* Score breakdown */
[data-theme="dark"] .score-component {
  border-bottom-color: var(--border);
}

/* Language toggle — dark */
[data-theme="dark"] .lang-toggle {
  border-color: var(--border);
}

[data-theme="dark"] .lang-toggle-btn {
  color: var(--text-muted);
}

[data-theme="dark"] .lang-toggle-btn.active {
  background: var(--accent);
  color: #fff;
}

[data-theme="dark"] .lang-toggle-btn:hover:not(.active) {
  background: var(--surface-2);
}

/* Order cards — dark */
[data-theme="dark"] .order-card {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .follow-up-timeline-card {
  background: var(--accent-dim);
  border-color: var(--accent);
}

/* Urgency badges — dark */
[data-theme="dark"] .urgency-badge.stat,
[data-theme="dark"] .urgency-badge.urgent {
  background: rgba(239, 68, 68, 0.18);
  color: #F87171;
}

[data-theme="dark"] .urgency-badge.routine {
  background: var(--accent-dim);
  color: var(--accent);
}

[data-theme="dark"] .urgency-badge.prn {
  background: rgba(245, 158, 11, 0.18);
  color: #FBBF24;
}

/* Action badges — dark */
[data-theme="dark"] .action-badge.start {
  background: rgba(5, 150, 105, 0.18);
  color: #34D399;
}

[data-theme="dark"] .action-badge.adjust {
  background: rgba(245, 158, 11, 0.18);
  color: #FBBF24;
}

[data-theme="dark"] .action-badge.discontinue {
  background: rgba(239, 68, 68, 0.18);
  color: #F87171;
}

[data-theme="dark"] .action-badge.continue {
  background: var(--accent-dim);
  color: var(--accent);
}

[data-theme="dark"] .action-badge.monitor {
  background: rgba(37, 99, 235, 0.18);
  color: #60A5FA;
}

/* Precaution card — dark */
[data-theme="dark"] .precaution-card {
  border-color: #F87171;
  background: rgba(239, 68, 68, 0.1);
  color: #FCA5A5;
}

/* Feedback score circle — dark */
[data-theme="dark"] .feedback-score-circle {
  border-color: var(--border);
}

[data-theme="dark"] .feedback-score-circle.grade-a {
  border-color: var(--accent);
}

[data-theme="dark"] .feedback-score-circle.grade-b {
  border-color: #FBBF24;
}

[data-theme="dark"] .feedback-score-circle.grade-c {
  border-color: #F87171;
}

[data-theme="dark"] .feedback-score-circle.grade-d,
[data-theme="dark"] .feedback-score-circle.grade-f {
  border-color: #FCA5A5;
}

/* Feedback bar track — dark */
[data-theme="dark"] .feedback-bar-track {
  background: var(--surface-2);
}

/* Strength card — dark */
[data-theme="dark"] .strength-card {
  border-left-color: #34D399;
  background: rgba(16, 185, 129, 0.1);
  color: #6EE7B7;
}

/* Improvement card — dark */
[data-theme="dark"] .improvement-card {
  border-left-color: #FBBF24;
  background: rgba(245, 158, 11, 0.1);
  color: #FDE68A;
}

/* Missing card — dark */
[data-theme="dark"] .missing-card {
  border-color: #F87171;
  background: rgba(239, 68, 68, 0.08);
  color: #FCA5A5;
}

/* Exemplar card — dark */
[data-theme="dark"] .exemplar-card {
  background: var(--surface);
  border-left-color: var(--accent);
  color: var(--text);
}
