/* Heed — Demo styles */

.demo {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
}

.demo-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: #fcfcfa;
  flex-wrap: wrap;
  gap: 8px;
}

.demo-tabs {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.demo-tab {
  background: transparent;
  border: 0;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 6px;
  transition: background 150ms ease, color 150ms ease;
  white-space: nowrap;
}
.demo-tab:hover { color: var(--text-primary); }
.demo-tab.on {
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.demo-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.dot-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  position: relative;
  box-shadow: 0 0 0 0 rgba(26,122,78,0.4);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(26,122,78,0.35); }
  70% { box-shadow: 0 0 0 6px rgba(26,122,78,0); }
  100% { box-shadow: 0 0 0 0 rgba(26,122,78,0); }
}

.demo-body {
  padding: 0;
  min-height: 520px;
  background: #fcfcfa;
}

/* ---- Patient flow ---- */
.patient-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 24px 56px;
  gap: 28px;
}

.trail {
  display: flex;
  align-items: center;
  gap: 8px;
}
.trail-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
  transition: background 200ms ease, transform 200ms ease;
}
.trail-dot.on { background: var(--accent); transform: scale(1.2); }
.trail-line {
  width: 36px;
  height: 1px;
  background: var(--border-strong);
}

.screen-frame {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px 28px 24px;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.demo-screen {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.demo-eyebrow {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 10px;
}

.sms-bubble {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
}
.sms-from {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}
.sms-text {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-primary);
}
.sms-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 14px;
  letter-spacing: 0.04em;
}

.tap-hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
  animation: tapBounce 1.6s ease-in-out infinite;
}
@keyframes tapBounce {
  0%, 100% { transform: translateY(0); opacity: 0.9; }
  50% { transform: translateY(-3px); opacity: 1; }
}

.back-link {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-size: 13px;
  padding: 0;
  align-self: flex-start;
  font-family: inherit;
}
.back-link:hover { color: var(--text-primary); }

.chip {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  font-family: inherit;
  transition: all 150ms ease;
}
.chip:hover { border-color: var(--text-secondary); color: var(--text-primary); }
.chip-on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.chip-on:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }

.ta {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  background: var(--bg);
  color: var(--text-primary);
  transition: border-color 150ms ease, background 150ms ease;
}
.ta:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}

.g-card {
  margin-top: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}
.g-card-head { display: flex; gap: 12px; align-items: center; }
.g-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
}
.g-card-body {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin-top: 12px;
}

.side-note {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-align: center;
  max-width: 380px;
}

/* ---- Clinic view ---- */
.clinic-stage {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 520px;
  background: var(--surface);
}

.clinic-side {
  border-right: 1px solid var(--border);
  background: #fcfcfa;
  display: flex;
  flex-direction: column;
}
.clinic-side-head {
  padding: 16px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-bottom: 1px solid var(--border);
}
.clinic-list {
  display: flex;
  flex-direction: column;
}
.clinic-row {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
  padding: 14px 16px;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background 120ms ease;
}
.clinic-row:hover { background: var(--bg); }
.clinic-row.on {
  background: var(--surface);
  box-shadow: inset 2px 0 0 var(--accent);
}
.clinic-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.clinic-row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.clinic-row-preview {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
}
.tag-intercepted {
  background: var(--accent-tint);
  color: var(--accent-dark);
}
.tag-posted {
  background: #f0f0ec;
  color: var(--text-muted);
}

.clinic-main {
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
}
.clinic-main-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.clinic-meta-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.meta-cell {
  padding: 12px 16px;
  border-right: 1px solid var(--border);
  background: #fcfcfa;
}
.meta-cell:last-child { border-right: 0; }

.clinic-quote {
  margin-top: 20px;
  padding: 18px 20px;
  background: var(--bg);
  border-left: 2px solid var(--accent);
  border-radius: 0 8px 8px 0;
}

.clinic-reply {
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  background: var(--surface);
}

@media (max-width: 720px) {
  .clinic-stage { grid-template-columns: 1fr; }
  .clinic-side { border-right: 0; border-bottom: 1px solid var(--border); max-height: 240px; overflow-y: auto; }
  .clinic-meta-row { grid-template-columns: 1fr; }
  .meta-cell { border-right: 0; border-bottom: 1px solid var(--border); }
  .meta-cell:last-child { border-bottom: 0; }
  .clinic-main { padding: 20px; }
}
