@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&family=DM+Sans:wght@400;500&display=swap');

:root {
  --primary: #0D0221;
  --primary-mid: #0A0E27;
  --accent: #150E56;
  --light: #3D2C8D;
  --bg: #C5C5C5;
  --white: #FFFFFF;
  --off-white: #FAF5FC;
  --text: #2D1B3D;
  --text-secondary: #6B5077;
  --text-muted: #A68FB5;
  --border: #E8D5F0;
  --happy: #43A047;
  --happy-bg: #E8F5E9;
  --needs-water: #FB8C00;
  --needs-water-bg: #FFF3E0;
  --overdue: #E53935;
  --overdue-bg: #FFEBEE;
  --shadow-sm: 0 1px 3px rgba(74, 20, 140, 0.06);
  --shadow-md: 0 4px 12px rgba(74, 20, 140, 0.08);
  --shadow-lg: 0 8px 30px rgba(74, 20, 140, 0.12);
  --radius: 12px;
  --radius-lg: 16px;
}

::selection {
  background: var(--light);
  color: var(--primary);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Nunito', sans-serif;
}

.hidden-input {
  display: none;
}

/* ─── APP SHELL ─── */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-mid) 50%, var(--accent) 100%);
  padding: 2rem 1.5rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.app-header::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(206, 147, 216, 0.2), transparent 70%);
  border-radius: 50%;
}

.app-header::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08), transparent 70%);
  border-radius: 50%;
}

.header-inner {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}

.header-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.25rem;
}

.header-title {
  color: var(--white);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.header-sub {
  color: var(--light);
  font-size: 0.875rem;
  margin-top: 0.25rem;
  font-weight: 400;
}

.app-main {
  flex: 1;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  padding: 1.5rem;
}

/* ─── STATS ROW ─── */
.stats-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.stat-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: var(--white);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 80px;
  flex-shrink: 0;
}

.stat-chip:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-chip.active {
  border-color: var(--accent);
  background: var(--bg);
  box-shadow: 0 0 0 3px rgba(142, 36, 170, 0.1);
}

.stat-chip.happy.active { border-color: var(--happy); background: var(--happy-bg); }
.stat-chip.needs-water.active { border-color: var(--needs-water); background: var(--needs-water-bg); }
.stat-chip.overdue.active { border-color: var(--overdue); background: var(--overdue-bg); }

.stat-emoji { font-size: 1.25rem; }
.stat-num { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 1.25rem; color: var(--text); }
.stat-label { font-size: 0.7rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }

/* ─── PLANT GRID ─── */
.plant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

/* ─── PLANT CARD ─── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.plant-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow-sm);
  position: relative;
  animation: fadeInUp 0.5s ease both;
}

.plant-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: var(--shadow-lg);
}

.card-status-bar {
  height: 3px;
  width: 100%;
}

.status-happy .card-status-bar { background: var(--happy); }
.status-needs-water .card-status-bar { background: var(--needs-water); }
.status-overdue .card-status-bar { background: var(--overdue); }

.card-img {
  width: 100%;
  height: 180px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg);
}

.card-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: linear-gradient(135deg, var(--bg), var(--off-white));
}

.card-body {
  padding: 1rem;
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-badge {
  font-size: 1.1rem;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-happy { background: var(--happy-bg); }
.badge-needs-water { background: var(--needs-water-bg); }
.badge-overdue { background: var(--overdue-bg); }

.card-species {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.125rem;
  font-style: italic;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.water-progress {
  margin-top: 0.5rem;
  height: 4px;
  background: var(--bg);
  border-radius: 2px;
  overflow: hidden;
}

.water-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.fill-happy { background: var(--happy); }
.fill-needs-water { background: var(--needs-water); }
.fill-overdue { background: var(--overdue); }

/* ─── FAB ─── */
.fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  color: var(--white);
  font-size: 1.75rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(74, 20, 140, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(74, 20, 140, 0.4);
}

/* ─── EMPTY STATE ─── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}

.empty-illustration {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: fadeInUp 0.6s ease both;
}

.empty-state h2 {
  font-size: 1.25rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* ─── BUTTONS ─── */
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--primary));
  color: var(--white);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-full { width: 100%; }

.btn-secondary {
  background: var(--white);
  color: var(--text);
  border: 1.5px solid var(--border);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.btn-danger {
  background: var(--overdue);
  color: var(--white);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}

.btn-back {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.95rem;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  padding: 0.25rem 0;
  transition: color 0.2s;
}

.btn-back:hover { color: var(--accent); }

.btn-icon {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 8px;
  transition: background 0.2s;
}

.btn-icon:hover { background: var(--bg); }
.btn-danger-icon:hover { background: var(--overdue-bg); }

.btn-water {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, #0288D1, #0277BD);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 1.5rem;
}

.btn-water:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(2, 136, 209, 0.3); }

/* ─── FORM ─── */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.view-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.header-actions {
  display: flex;
  gap: 0.25rem;
}

.plant-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-label {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input {
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: 44px;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(142, 36, 170, 0.1);
}

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

/* ─── PHOTO UPLOAD ─── */
.photo-upload-area {
  display: flex;
  justify-content: center;
}

.photo-label {
  cursor: pointer;
  display: block;
  width: 100%;
  max-width: 300px;
}

.photo-placeholder {
  width: 100%;
  height: 200px;
  border: 2px dashed var(--light);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--off-white);
  transition: border-color 0.2s, background 0.2s;
}

.photo-placeholder:hover {
  border-color: var(--accent);
  background: var(--bg);
}

.photo-icon { font-size: 2.5rem; }
.photo-text { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }

.photo-preview {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius-lg);
}

/* ─── FREQUENCY PRESETS ─── */
.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.preset-chip {
  padding: 0.5rem 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.825rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-chip:hover { border-color: var(--light); }

.preset-chip.selected {
  background: var(--bg);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 500;
}

.custom-freq {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.freq-label { font-size: 0.825rem; color: var(--text-muted); }
.freq-input { width: 80px; text-align: center; }
.freq-suffix { font-size: 0.825rem; color: var(--text-muted); }

/* ─── DETAIL VIEW ─── */
.detail-view {
  animation: fadeInUp 0.4s ease both;
}

.detail-hero {
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.5rem;
  position: relative;
}

.detail-photo-wrapper {
  display: block;
  cursor: pointer;
}

.detail-photo {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
}

.detail-photo-placeholder {
  width: 100%;
  height: 280px;
  background: linear-gradient(135deg, var(--bg), var(--off-white));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 4rem;
}

.change-photo-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.detail-status-banner {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  backdrop-filter: blur(8px);
}

.banner-happy { background: rgba(67, 160, 71, 0.9); color: var(--white); }
.banner-needs-water { background: rgba(251, 140, 0, 0.9); color: var(--white); }
.banner-overdue { background: rgba(229, 57, 53, 0.9); color: var(--white); }
.banner-emoji { font-size: 1.1rem; }

.detail-info {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.detail-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
}

.detail-species {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.125rem;
}

.detail-stats {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.detail-stat {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.stat-icon {
  font-size: 1.25rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: 10px;
  flex-shrink: 0;
}

.stat-value {
  display: block;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

.stat-desc {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ─── EDIT FORM ─── */
.edit-form {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.edit-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.edit-actions button { flex: 1; }

/* ─── MODAL ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45, 27, 61, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-width: 360px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.modal-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.modal-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
}

.modal-actions button { flex: 1; }

/* ─── LOADING SKELETONS ─── */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.loading-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.skeleton-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.skeleton-img, .skeleton-img-large {
  height: 180px;
  background: linear-gradient(90deg, var(--bg) 25%, var(--off-white) 50%, var(--bg) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-img-large { height: 280px; }

.skeleton-line {
  height: 14px;
  margin: 0.75rem 1rem;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--bg) 25%, var(--off-white) 50%, var(--bg) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-line.wide { width: 70%; }
.skeleton-line.medium { width: 50%; margin-bottom: 1rem; }

.skeleton-detail {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--white);
}

.add-plant-view {
  animation: fadeInUp 0.4s ease both;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 640px) {
  .app-header {
    padding: 1.5rem 1rem 1.25rem;
  }

  .header-title {
    font-size: 1.4rem;
  }

  .app-main {
    padding: 1rem;
  }

  .plant-grid {
    grid-template-columns: 1fr;
  }

  .loading-grid {
    grid-template-columns: 1fr;
  }

  .stats-row {
    gap: 0.375rem;
  }

  .stat-chip {
    min-width: 70px;
    padding: 0.5rem 0.75rem;
  }

  .detail-photo, .detail-photo-placeholder {
    height: 220px;
  }

  .fab {
    bottom: 1.25rem;
    right: 1.25rem;
  }
}

<!-- WALKTHROUGH_SCRIPT:
[
  {"step": 1, "narration": "Welcome to Plantiful! This is your personal plant care dashboard. It shows all your plants at a glance with their watering status.", "view": "user", "highlight_selector": ".app-header", "wait_for": "tap_to_continue"},
  {"step": 2, "narration": "Use these status filters to quickly see which plants are happy, thirsty, or overdue for watering.", "view": "user", "highlight_selector": ".stats-row", "wait_for": "tap_to_continue"},
  {"step": 3, "narration": "Tap the + button to add your first plant. You can upload a photo, set the species, and choose a watering schedule.", "view": "user", "highlight_selector": ".fab", "wait_for": "user_interaction"},
  {"step": 4, "narration": "Fill in your plant's details. Choose from preset watering schedules or set a custom frequency.", "view": "user", "highlight_selector": ".plant-form", "wait_for": "tap_to_continue"},
  {"step": 5, "narration": "Each plant card shows a colored status bar — green for happy, orange for thirsty, red for overdue. Tap any card to see details.", "view": "user", "highlight_selector": ".plant-card", "wait_for": "user_interaction"},
  {"step": 6, "narration": "In the detail view, tap 'Water Now' to mark a plant as freshly watered. You can also edit details or change the photo.", "view": "user", "highlight_selector": ".btn-water", "wait_for": "tap_to_continue"}
]
-->

.care-log-section {
  margin-top: 1.25rem;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.care-log-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.care-log-header h3 {
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}

.care-log-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.care-log-form {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  background: var(--off-white);
}

.care-notes {
  resize: vertical;
  min-height: 90px;
}

.care-log-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.care-log-empty {
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--off-white);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.care-log-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
}

.care-log-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  flex-shrink: 0;
  font-size: 1.15rem;
}

.care-log-content {
  flex: 1;
  min-width: 0;
}

.care-log-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.care-log-topline strong {
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
}

.care-log-topline span {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.care-log-content p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.4;
  word-break: break-word;
}

@media (max-width: 640px) {
  .care-log-header,
  .care-log-topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .care-log-item {
    align-items: flex-start;
  }
}

.photo-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
  margin-bottom: 1rem;
}

.photo-actions .btn-secondary,
.photo-upload-button {
  flex: 1;
  justify-content: center;
}

.photo-upload-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.card-like-actions {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 0.75rem;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 640px) {
  .photo-actions {
    flex-direction: column;
  }
}

.ai-doctor-section {
  margin-top: 1.25rem;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.ai-doctor-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.ai-doctor-header h3 {
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}

.ai-doctor-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.ai-doctor-badge {
  background: var(--bg);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  flex-shrink: 0;
}

.ai-doctor-media {
  margin-bottom: 1rem;
}

.ai-doctor-preview,
.ai-doctor-placeholder {
  width: 100%;
  height: 220px;
  border-radius: var(--radius);
}

.ai-doctor-preview {
  object-fit: cover;
  display: block;
  background: var(--bg);
}

.ai-doctor-placeholder {
  border: 1px dashed var(--border);
  background: var(--off-white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--text-muted);
  text-align: center;
  padding: 1rem;
}

.ai-doctor-placeholder span {
  font-size: 2.5rem;
}

.ai-doctor-actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.ai-doctor-actions .btn-primary,
.ai-doctor-actions .btn-secondary {
  flex: 1;
  justify-content: center;
}

.ai-doctor-error {
  color: var(--overdue);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.ai-doctor-results {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ai-doctor-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--off-white);
  padding: 0.95rem;
}

.ai-doctor-card h4 {
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.ai-doctor-card p,
.ai-doctor-list {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.ai-doctor-list {
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ai-doctor-updated {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.ai-doctor-note {
  background: var(--bg);
}

@media (max-width: 640px) {
  .ai-doctor-header,
  .ai-doctor-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}

.care-chart-section {
  margin-top: 1.25rem;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.care-chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.care-chart-header h3 {
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}

.care-chart-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.care-chart-badge {
  background: var(--bg);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  flex-shrink: 0;
}

.care-chart-wrapper {
  width: 100%;
  min-height: 240px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--off-white);
  padding: 0.75rem;
}

.care-history-canvas {
  width: 100% !important;
  height: 240px !important;
}

.care-chart-empty {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--off-white);
  padding: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .care-chart-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .care-chart-wrapper {
    min-height: 220px;
  }

  .care-history-canvas {
    height: 220px !important;
  }
}
