html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

/* ── Chat panel ─────────────────────────────────────────────────────────── */
#chat-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 3.25rem;
  height: 3.25rem;
  z-index: 1045;
  display: flex;
  align-items: center;
  justify-content: center;
}

#chatPanel {
  width: 495px;
}

#chat-messages {
  display: flex;
  flex-direction: column;
}

.chat-input-area textarea {
  resize: none;
  border-right: 0;
}

.chat-input-area .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/* Bubbles */
.chat-bubble { display: flex; }

.chat-bubble--user  { justify-content: flex-end; }
.chat-bubble--assistant { justify-content: flex-start; }

.chat-bubble__body {
  max-width: 82%;
  padding: .5rem .75rem;
  border-radius: 1rem;
  font-size: .9rem;
  line-height: 1.45;
  word-break: break-word;
}

/* Markdown content inside assistant bubbles */
.chat-bubble--assistant .chat-text p       { margin-bottom: .4rem; }
.chat-bubble--assistant .chat-text p:last-child { margin-bottom: 0; }
.chat-bubble--assistant .chat-text ul,
.chat-bubble--assistant .chat-text ol      { padding-left: 1.25rem; margin-bottom: .4rem; }
.chat-bubble--assistant .chat-text li      { margin-bottom: .15rem; }
.chat-bubble--assistant .chat-text h1,
.chat-bubble--assistant .chat-text h2,
.chat-bubble--assistant .chat-text h3      { font-size: 1rem; font-weight: 600; margin: .5rem 0 .25rem; }
.chat-bubble--assistant .chat-text code    { background: #e0e0e0; padding: .1em .3em; border-radius: 3px; font-size: .85em; }
.chat-bubble--assistant .chat-text pre     { background: #e0e0e0; padding: .5rem; border-radius: 6px; overflow-x: auto; margin-bottom: .4rem; }
.chat-bubble--assistant .chat-text pre code { background: none; padding: 0; }
.chat-bubble--assistant .chat-text strong  { font-weight: 600; }
.chat-bubble--assistant .chat-text hr      { margin: .4rem 0; }

.chat-bubble--user .chat-bubble__body {
  background-color: #198754;
  color: #fff;
  border-bottom-right-radius: .25rem;
  white-space: pre-wrap;
}

.chat-bubble--assistant .chat-bubble__body {
  background-color: #f0f0f0;
  color: #212529;
  border-bottom-left-radius: .25rem;
}

.chat-bubble--error .chat-bubble__body {
  background-color: #f8d7da;
  color: #842029;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ══════════════════════════════════════════════════════════════════════════
   Garden View — Dashboard Redesign (UX-5)
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Hero banner ───────────────────────────────────────────────────────── */
.garden-hero {
  position: relative;
  height: 260px;
  overflow: hidden;
  border-radius: 0 0 1rem 1rem;
}
.garden-hero img.hero-bg {
  width: 100%; height: 100%;
  object-fit: cover;
}
.garden-hero .overlay {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,.72) 0%, rgba(0,0,0,.15) 50%, rgba(0,0,0,.28) 100%);
}
.garden-hero .hero-content {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 1.25rem 1.5rem;
  color: #fff;
}
.garden-hero .hero-content h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: .2rem; }
.garden-hero-fallback {
  background: linear-gradient(135deg, #198754 0%, #20c997 50%, #0dcaf0 100%);
}

/* ── Growth stage progress bar ─────────────────────────────────────────── */
.stage-track {
  display: flex; align-items: center; gap: 0;
  position: relative;
}
.stage-step {
  flex: 1; text-align: center; position: relative; z-index: 1;
}
.stage-dot {
  width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 600;
  border: 2px solid #dee2e6;
  background: #fff; color: #adb5bd;
  transition: all .2s;
}
.stage-step.active .stage-dot {
  background: #198754; color: #fff; border-color: #198754;
  box-shadow: 0 0 0 4px rgba(25,135,84,.2);
}
.stage-step.done .stage-dot {
  background: #198754; color: #fff; border-color: #198754;
}
.stage-label { font-size: .65rem; margin-top: 4px; color: #6c757d; }
.stage-step.active .stage-label { color: #198754; font-weight: 600; }
.stage-connector {
  position: absolute; top: 16px; left: 0; right: 0; height: 3px;
  background: #dee2e6; z-index: 0;
}
.stage-connector-fill {
  height: 100%; background: #198754; transition: width .3s;
}

/* ── Stat tiles ────────────────────────────────────────────────────────── */
.stat-tile {
  border-radius: .75rem;
  padding: .85rem .5rem;
  text-align: center;
  transition: transform .15s;
}
.stat-tile:hover { transform: translateY(-2px); }
.stat-tile .stat-icon { font-size: 1.3rem; margin-bottom: .2rem; }
.stat-tile .stat-value { font-size: 1.15rem; font-weight: 700; }
.stat-tile .stat-label { font-size: .65rem; text-transform: uppercase; letter-spacing: .5px; opacity: .8; }
.stat-tile .stat-range { font-size: .6rem; opacity: .6; }

/* ── Section cards ─────────────────────────────────────────────────────── */
.section-card {
  border: none;
  border-radius: .75rem;
  overflow: hidden;
}
.section-card .card-header {
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,.06);
  padding: .75rem 1rem;
}
.section-header-icon {
  width: 28px; height: 28px; border-radius: .5rem;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .85rem; color: #fff; margin-right: .5rem;
  flex-shrink: 0;
}

/* ── Task items with colored left borders ──────────────────────────────── */
.task-item {
  border-left: 3px solid;
  padding: .5rem .75rem;
  margin-bottom: .5rem;
  border-radius: 0 .5rem .5rem 0;
  background: #fff;
  font-size: .85rem;
}
.task-item.task-feeding    { border-color: #198754; background: #f8fdf9; }
.task-item.task-watering   { border-color: #0dcaf0; background: #f0fdff; }
.task-item.task-training   { border-color: #ffc107; background: #fffdf0; }
.task-item.task-observation{ border-color: #6f42c1; background: #faf8ff; }
.task-item.task-trimming   { border-color: #dc3545; background: #fef8f8; }
.task-item.task-general    { border-color: #6c757d; background: #f8f9fa; }

/* ── Photo grid ────────────────────────────────────────────────────────── */
.photo-grid-item {
  border-radius: .5rem;
  overflow: hidden;
  aspect-ratio: 1;
  position: relative;
}
.photo-grid-item img {
  width: 100%; height: 100%; object-fit: cover;
}
.photo-grid-item .photo-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 4px 6px;
  background: rgba(0,0,0,.5);
  color: #fff; font-size: .6rem;
}

/* ── Growmie insight card ──────────────────────────────────────────────── */
.growmie-card {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 50%, #f0fdfa 100%);
  border: 1px solid rgba(25,135,84,.15);
  border-radius: .75rem;
}

/* ── Settings summary strip ────────────────────────────────────────────── */
.settings-summary-strip {
  background: #fafafa;
  font-size: .8rem;
}

/* ── Ask Growmie CTA ───────────────────────────────────────────────────── */
.growmie-cta-card {
  border: 1px solid rgba(25,135,84,.2);
}

/* ── Grow Log ───────────────────────────────────────────────────────────── */
.grow-log-item {
  cursor: pointer;
  padding: .6rem 0;
  border-bottom: 1px solid rgba(0,0,0,.06);
  transition: background .15s;
}
.grow-log-item:last-child { border-bottom: none; }
.grow-log-item:hover { background: rgba(0,0,0,.02); }

.grow-log-body-preview {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: .82rem;
  color: #6c757d;
}

.grow-log-thumb {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

/* ── Photo scroll container ─────────────────────────────────────────────── */
.photo-grid-scroll {
  max-height: 360px;
  overflow-y: auto;
  overflow-x: hidden;
}