/* 
 * Smart Flora IoT - Professional Botanical Design System
 * 100% Solid Colors (No Gradients) • Zero Emojis (Pure SVG Icons)
 * Adaptive Responsive Grid (Mobile-first, Tablet & Desktop Friendly)
 * Subtle Ambient Foliage Watermark • Luxury Botanical Dark Mode
 */

:root {
  /* Light Theme (Brochure Solid Flat Cream & Forest Palette) */
  --bg-page: #F4F1EA;
  --bg-card: #FFFFFF;
  --bg-card-subtle: #ECE8DE;
  --bg-badge: #DFD8CB;

  --forest-dark: #1E382B;
  --forest-deep: #13251D;
  --forest-medium: #2C4E3D;
  --forest-light: #3D6650;
  
  --accent-amber: #C2673B;
  --accent-amber-bg: #F8EAE2;
  --accent-blue: #28586E;
  --accent-blue-bg: #E6EFF3;
  --accent-emerald-bg: #E3EDE6;

  --text-title: #14261D;
  --text-body: #324439;
  --text-muted: #5C6E64;
  --text-light: #8E9F95;
  
  --border-light: #DCD5C7;
  --border-subtle: #E7E1D4;

  /* Ambient Subtle Foliage Watermark (Very gentle, not screaming) */
  --leaf-fill-main: #1E382B;
  --leaf-fill-sub: #2D523E;
  --leaf-fill-cut: #F4F1EA;
  --leaf-opacity-heavy: 0.12;
  --leaf-opacity-med: 0.08;
  --leaf-opacity-light: 0.04;

  --gauge-bg: #F8F6F1;
  --gauge-border: #DCD5C7;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --transition: all 0.18s ease;
}

/* Luxury Botanical Dark Mode (Deep Obsidian Night Slate - Warm, Refined & Executive) */
[data-theme="dark"] {
  --bg-page: #0C110E;
  --bg-card: #141C18;
  --bg-card-subtle: #1B2520;
  --bg-badge: #232E28;

  --forest-dark: #4DA377;
  --forest-deep: #3A885F;
  --forest-medium: #5CB889;
  --forest-light: #76C298;

  --accent-amber: #DF8F56;
  --accent-amber-bg: #281D14;
  --accent-blue: #5495A8;
  --accent-blue-bg: #15242C;
  --accent-emerald-bg: #17291F;

  --text-title: #F3EFE9;
  --text-body: #C9D5CD;
  --text-muted: #85978D;
  --text-light: #5B6E64;

  --border-light: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.05);

  --leaf-fill-main: #4DA377;
  --leaf-fill-sub: #3A885F;
  --leaf-fill-cut: #0C110E;
  --leaf-opacity-heavy: 0.08;
  --leaf-opacity-med: 0.05;
  --leaf-opacity-light: 0.02;

  --gauge-bg: #111714;
  --gauge-border: #232E28;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  min-height: 100%;
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-body);
  line-height: 1.35;
  padding: clamp(6px, 1.2vh, 16px) clamp(8px, 1.6vw, 24px);
  padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
  display: flex;
  justify-content: center;
  align-items: flex-start;
  position: relative;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* =============================================================
   Layer 1: Ambient Botanical Foliage Watermark
   ============================================================= */
.foliage-frame {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.3s ease;
}

.foliage-top-left {
  top: -15px;
  left: -20px;
  opacity: var(--leaf-opacity-heavy);
}

.foliage-top-midleft {
  top: -5px;
  left: 28%;
  opacity: var(--leaf-opacity-light);
}

.foliage-top-right {
  top: -12px;
  right: -15px;
  opacity: var(--leaf-opacity-heavy);
}

.foliage-mid-left {
  top: 42%;
  left: -24px;
  opacity: var(--leaf-opacity-med);
}

.foliage-mid-right {
  top: 48%;
  right: -24px;
  opacity: var(--leaf-opacity-med);
}

.foliage-bottom-left {
  bottom: -20px;
  left: -20px;
  opacity: var(--leaf-opacity-heavy);
}

.foliage-bottom-right {
  bottom: -20px;
  right: -20px;
  opacity: var(--leaf-opacity-heavy);
}

.leaf-main { fill: var(--leaf-fill-main); }
.leaf-sub { fill: var(--leaf-fill-sub); }
.leaf-cut { fill: var(--leaf-fill-cut); }
.leaf-stem { stroke: var(--leaf-fill-main); opacity: 0.5; }

/* =============================================================
   App Container (Compact, Cohesive & Full-Featured Layout)
   ============================================================= */
.app-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.1vh, 14px);
  position: relative;
  z-index: 1;
  min-height: 100%;
  flex: 1;
}

/* Header Bar */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(6px, 1vh, 12px) clamp(10px, 1.4vw, 20px);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  flex-shrink: 0;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 9px;
}

.brand-icon-wrap {
  background: var(--forest-dark);
  color: #FFFFFF;
  width: clamp(32px, 4.2vmin, 44px);
  height: clamp(32px, 4.2vmin, 44px);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

[data-theme="dark"] .brand-icon-wrap {
  color: #0C110E;
}

.brand-icon-wrap svg {
  width: clamp(16px, 2.3vmin, 22px);
  height: clamp(16px, 2.3vmin, 22px);
  fill: currentColor;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.header-leaf-accent {
  fill: var(--forest-dark);
  opacity: 0.85;
}

.app-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 1.8vmin, 1.45rem);
  font-weight: 700;
  color: var(--text-title);
  line-height: 1.1;
}

.subtitle {
  font-size: clamp(0.64rem, 1.1vmin, 0.85rem);
  color: var(--text-muted);
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: clamp(5px, 0.8vw, 8px);
}

.icon-btn {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  color: var(--forest-dark);
  width: clamp(32px, 4.2vmin, 42px);
  height: clamp(32px, 4.2vmin, 42px);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.icon-btn svg {
  width: clamp(16px, 2.3vmin, 22px);
  height: clamp(16px, 2.3vmin, 22px);
  fill: currentColor;
}

.icon-btn:hover {
  background: var(--forest-dark);
  color: #FFFFFF;
}

[data-theme="dark"] .icon-btn:hover {
  color: #0C110E;
}

/* Data Source Toggle (Mock / Live) */
.data-source-btn {
  display: flex !important;
  align-items: center;
  gap: 5px;
  width: auto !important;
  padding: 0 10px;
  font-size: clamp(10px, 1.5vmin, 12px);
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.data-source-btn svg {
  width: 14px !important;
  height: 14px !important;
  opacity: 0.6;
}

.data-source-label {
  pointer-events: none;
}

.data-source-btn.data-source-live {
  background: var(--forest-dark);
  color: #FFFFFF;
  border-color: var(--forest-dark);
  box-shadow: 0 0 0 2px rgba(30, 56, 43, 0.15);
}

.data-source-btn.data-source-live svg {
  opacity: 1;
  fill: #4ADE80;
}

[data-theme="dark"] .data-source-btn.data-source-live {
  background: var(--forest-light);
  border-color: var(--forest-light);
  color: #0C110E;
}

[data-theme="dark"] .data-source-btn.data-source-live svg {
  fill: #22C55E;
}

/* Notification Header Button & Status Dot */
.notif-btn {
  position: relative;
}

.notif-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  pointer-events: none;
}

.notif-dot.dot-ok {
  background: #22C55E;
  box-shadow: 0 0 0 2px var(--cream-bg);
}

.notif-dot.dot-warn {
  background: #F59E0B;
  box-shadow: 0 0 0 2px var(--cream-bg);
  animation: pulseWarn 2s infinite ease-in-out;
}

.notif-dot.dot-blocked {
  background: #EF4444;
  box-shadow: 0 0 0 2px var(--cream-bg);
}

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

/* Notification Permission Banner */
.notification-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: clamp(6px, 1.1vh, 12px);
  border-radius: 12px;
  background: rgba(30, 56, 43, 0.05);
  border: 1px solid rgba(30, 56, 43, 0.12);
  backdrop-filter: blur(8px);
  animation: slideDownBanner 0.3s ease-out;
}

.notification-banner.hidden {
  display: none !important;
}

@keyframes slideDownBanner {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.banner-icon-wrap {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(30, 56, 43, 0.08);
  color: var(--forest-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.banner-icon-wrap svg {
  fill: currentColor;
}

.banner-body {
  flex: 1;
  min-width: 0;
}

.banner-title {
  font-family: var(--font-sans);
  font-size: clamp(0.78rem, 1.3vmin, 0.85rem);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.25;
}

.banner-desc {
  font-family: var(--font-sans);
  font-size: clamp(0.68rem, 1.15vmin, 0.75rem);
  color: var(--color-text-muted);
  line-height: 1.3;
  margin-top: 2px;
}

.btn-banner-action {
  font-family: var(--font-sans);
  font-size: clamp(0.72rem, 1.2vmin, 0.8rem);
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  background: var(--forest-dark);
  color: #FFFFFF;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.btn-banner-action:hover {
  background: #2D5240;
  transform: translateY(-1px);
}

.btn-banner-action:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
}

/* Dark mode adjustments for banner */
[data-theme="dark"] .notification-banner {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .banner-icon-wrap {
  background: rgba(255, 255, 255, 0.08);
  color: var(--forest-light);
}

[data-theme="dark"] .btn-banner-action {
  background: var(--forest-light);
  color: #0C110E;
}

[data-theme="dark"] .btn-banner-action:hover {
  background: #B4DFC4;
}

[data-theme="dark"] .notif-dot.dot-ok {
  box-shadow: 0 0 0 2px #0C110E;
}
[data-theme="dark"] .notif-dot.dot-warn {
  box-shadow: 0 0 0 2px #0C110E;
}
[data-theme="dark"] .notif-dot.dot-blocked {
  box-shadow: 0 0 0 2px #0C110E;
}

/* =============================================================
   Dashboard Grid (Mobile 1-Col, Tablet/Desktop 2-Col)
   ============================================================= */
.dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.1vh, 14px);
  flex: 1;
  min-height: 0;
  height: 100%;
}

.dashboard-col {
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.1vh, 14px);
  flex: 1;
  min-height: 0;
}

/* =============================================================
   Card Section Common Headers & Badges
   ============================================================= */
.card-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.card-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-card-subtle);
  color: var(--forest-dark);
  border: 1px solid var(--border-light);
  padding: clamp(2px, 0.5vh, 4px) clamp(8px, 1vw, 12px);
  border-radius: var(--radius-full);
  font-size: clamp(0.65rem, 1.2vmin, 0.88rem);
  font-weight: 700;
  letter-spacing: 0.01em;
}

[data-theme="dark"] .card-badge-pill {
  background: #18241D;
  color: #72C798;
  border-color: #25372D;
}

.card-badge-pill svg {
  fill: currentColor;
}

.live-tag {
  font-size: clamp(0.63rem, 1.1vmin, 0.85rem);
  font-weight: 700;
  color: var(--forest-dark);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  padding: clamp(2px, 0.5vh, 4px) clamp(6px, 0.8vw, 10px);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 5px;
}

[data-theme="dark"] .live-tag {
  color: #72C798;
  background: #18241D;
  border-color: #25372D;
}

.live-tag .dot {
  width: 5px;
  height: 5px;
  background-color: var(--forest-dark);
  border-radius: 50%;
}

[data-theme="dark"] .live-tag .dot {
  background-color: #72C798;
}

/* =============================================================
   Hero Plant Health & Moisture Card
   ============================================================= */
.status-card-user {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: clamp(8px, 1.2vh, 16px) clamp(12px, 1.4vw, 20px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(4px, 0.8vh, 10px);
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
  flex: 1.25;
  min-height: 0;
}

[data-theme="dark"] .status-card-user {
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.hero-gauge-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: clamp(3px, 0.6vh, 6px);
  flex: 1;
  min-height: 0;
}

.circular-gauge-container {
  width: clamp(92px, 14vmin, 150px);
  height: clamp(92px, 14vmin, 150px);
  aspect-ratio: 1 / 1;
  flex-shrink: 1;
  border-radius: 50%;
  background: var(--gauge-bg);
  border: 2px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: var(--transition);
  box-shadow: 0 6px 22px rgba(0,0,0,0.05), inset 0 2px 6px rgba(0,0,0,0.02);
}

[data-theme="dark"] .circular-gauge-container {
  border-color: rgba(77, 163, 119, 0.25);
  box-shadow: 0 6px 24px rgba(0,0,0,0.45), inset 0 2px 6px rgba(0,0,0,0.35);
}

.gauge-svg-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  pointer-events: none;
}

.gauge-ring-track {
  stroke: var(--gauge-border);
  opacity: 0.35;
}

.gauge-ring-fill {
  stroke: var(--forest-dark);
  transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.3s ease;
}

[data-theme="dark"] .gauge-ring-fill {
  stroke: #4DA377;
}

.gauge-inner-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.gauge-icon-wrap {
  width: clamp(22px, 3.2vmin, 32px);
  height: clamp(22px, 3.2vmin, 32px);
  margin-bottom: 2px;
  color: var(--forest-dark);
}

.gauge-icon-wrap svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

[data-theme="dark"] .gauge-icon-wrap {
  color: #4DA377;
}

.gauge-value {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 5.2vmin, 3.6rem);
  font-weight: 800;
  color: var(--text-title);
  line-height: 1;
}

.gauge-sub {
  font-size: clamp(0.68rem, 1.3vmin, 0.96rem);
  font-weight: 800;
  text-transform: uppercase;
  color: var(--accent-amber);
  margin-top: 2px;
  letter-spacing: 0.05em;
}

.phone-status-pill {
  background: var(--forest-dark);
  color: #FFFFFF;
  padding: clamp(4px, 0.8vh, 8px) clamp(12px, 1.6vw, 22px);
  border-radius: var(--radius-full);
  font-size: clamp(0.7rem, 1.3vmin, 0.95rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: var(--transition);
}

[data-theme="dark"] .phone-status-pill {
  color: #0C110E;
  background: #4DA377;
}

.plant-status-message {
  font-size: clamp(0.68rem, 1.25vmin, 0.92rem);
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.35;
  max-width: 480px;
}

.manual-water-bar {
  display: flex;
  width: 100%;
  flex-shrink: 0;
  margin-top: auto;
}

.btn-water-action {
  width: 100%;
  padding: clamp(7px, 1.2vh, 14px) clamp(12px, 1.8vw, 22px);
  background: var(--forest-dark);
  color: #FFFFFF;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: clamp(0.74rem, 1.3vmin, 1rem);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(30, 56, 43, 0.2);
  transition: var(--transition);
}

.btn-water-action svg {
  fill: currentColor;
}

.btn-water-action:hover {
  background: var(--forest-deep);
  transform: translateY(-1px);
}

.btn-water-action:active {
  transform: translateY(0);
}

[data-theme="dark"] .btn-water-action {
  background: #4DA377;
  color: #0C110E;
}

.btn-water-action:disabled,
.btn-water-action.watering-in-progress {
  opacity: 0.7;
  cursor: not-allowed;
  pointer-events: none;
  animation: pulse-water-action 1.4s infinite ease-in-out;
}

@keyframes pulse-water-action {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(0.985); opacity: 0.9; }
}

/* =============================================================
   Unified Plant Hydration & Water Reservoir Card (Side-by-Side Instruments)
   ============================================================= */
.unified-hydration-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: clamp(8px, 1.3vh, 16px) clamp(10px, 1.4vw, 20px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(6px, 1vh, 12px);
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
  flex: 1.2;
  min-height: 0;
}

[data-theme="dark"] .unified-hydration-card {
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.unified-header-left {
  display: flex;
  align-items: center;
  gap: clamp(5px, 0.8vw, 10px);
  flex-wrap: wrap;
}

.unified-instruments-row {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: clamp(8px, 1.4vw, 18px);
  padding: clamp(2px, 0.5vh, 6px) 0;
  flex: 1;
  min-height: 0;
}

.instrument-box {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
}

.moisture-instrument {
  flex-direction: column;
  text-align: center;
  gap: clamp(4px, 0.7vh, 8px);
}

.moisture-instrument .circular-gauge-container {
  width: clamp(165px, 28vmin, 230px);
  height: clamp(165px, 28vmin, 230px);
}

.moisture-instrument .gauge-value {
  font-size: clamp(4.4rem, 11vmin, 6.2rem);
  font-weight: 800;
  line-height: 0.92;
}

.moisture-instrument .gauge-sub {
  font-size: clamp(0.78rem, 1.45vmin, 1.05rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

.moisture-instrument .phone-status-pill {
  padding: clamp(3px, 0.6vh, 6px) clamp(12px, 1.5vw, 18px);
  font-size: clamp(0.72rem, 1.25vmin, 0.88rem);
  font-weight: 700;
}

.instrument-divider {
  width: 1px;
  height: clamp(120px, 22vmin, 175px);
  background: var(--border-light);
  border-radius: 1px;
  flex-shrink: 0;
}

[data-theme="dark"] .instrument-divider {
  background: rgba(255, 255, 255, 0.08);
}

.reservoir-instrument {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: clamp(4px, 0.7vh, 8px);
}

.reservoir-instrument .tank-battery-cap {
  width: clamp(30px, 5.5vw, 42px);
  height: clamp(6px, 1vh, 9px);
  margin-bottom: 2px;
}

.reservoir-instrument .tank-battery-body {
  width: clamp(82px, 16vmin, 110px);
  height: clamp(120px, 24vmin, 160px);
  border: 4px solid var(--forest-dark);
  border-radius: 16px;
}

.reservoir-instrument .reservoir-data-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 3px;
  width: 100%;
}

.reservoir-instrument .res-vol-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
}

.reservoir-instrument .res-vol-big {
  font-size: clamp(1.8rem, 4.6vmin, 2.6rem);
  font-weight: 800;
  line-height: 1;
}

.reservoir-instrument .res-vol-unit {
  font-size: clamp(0.74rem, 1.3vmin, 0.92rem);
  font-weight: 700;
  color: var(--text-muted);
}

.reservoir-instrument .res-status-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}

.reservoir-instrument .res-percent-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
}

.reservoir-instrument .res-state-pill {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
}

.reservoir-instrument .res-cycles-text {
  font-size: 0.63rem;
  color: var(--text-muted);
  font-weight: 500;
  display: block;
}

.reservoir-instrument .btn-refill-prominent {
  padding: clamp(3px, 0.6vh, 6px) clamp(10px, 1.4vw, 16px);
  font-size: clamp(0.68rem, 1.15vmin, 0.82rem);
  font-weight: 700;
}

.unified-action-area {
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 0.7vh, 8px);
  width: 100%;
  margin-top: auto;
  padding-top: 2px;
}

.unified-action-area .plant-status-message {
  text-align: center;
  font-size: clamp(0.66rem, 1.15vmin, 0.86rem);
  color: var(--text-muted);
  line-height: 1.25;
}

/* =============================================================
   Water Tank Reservoir Card (Battery Status Style Visual Gauge)
   ============================================================= */
.reservoir-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: clamp(8px, 1.2vh, 16px) clamp(10px, 1.4vw, 20px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(4px, 0.8vh, 10px);
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
  flex: 0.95;
  min-height: 0;
}

[data-theme="dark"] .reservoir-card {
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.reservoir-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tank-capacity-input-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tank-cap-label {
  font-size: clamp(0.64rem, 1.1vmin, 0.82rem);
  font-weight: 600;
  color: var(--text-muted);
}

.tank-input {
  width: clamp(40px, 4.5vw, 54px);
  padding: 2px 4px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  font-size: clamp(0.68rem, 1.15vmin, 0.85rem);
  font-weight: 700;
  color: var(--text-title);
  text-align: center;
}

.tank-unit {
  padding: 2px 4px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  font-size: clamp(0.68rem, 1.15vmin, 0.85rem);
  font-weight: 700;
  color: var(--text-title);
  cursor: pointer;
}

.reservoir-interactive-body {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 24px);
  flex: 1;
  min-height: 0;
  padding: clamp(2px, 0.5vh, 6px) 0;
}

/* -------------------------------------------------------------
   Battery Status Tank Visual (Pure HTML/CSS - Directly Animated)
   ------------------------------------------------------------- */
.tank-battery-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tank-battery-cap {
  width: clamp(18px, 2.5vw, 24px);
  height: clamp(4px, 0.8vh, 6px);
  background: var(--forest-dark);
  border-radius: 4px 4px 0 0;
  margin-bottom: 2px;
  transition: background 0.3s ease;
}

.tank-battery-body {
  width: clamp(62px, 8.5vmin, 78px);
  height: clamp(86px, 12.5vmin, 116px);
  border: 3.5px solid var(--forest-dark);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.03);
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.06), 0 3px 10px rgba(0,0,0,0.04);
  transition: border-color 0.3s ease;
}

[data-theme="dark"] .tank-battery-cap {
  background: #4DA377;
}

[data-theme="dark"] .tank-battery-body {
  border-color: #4DA377;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.3), 0 3px 10px rgba(0,0,0,0.2);
}

.tank-battery-water {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #38BDF8 0%, #0D9488 100%);
  border-top: 2.5px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
  transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1), background 0.4s ease;
}

[data-theme="dark"] .tank-battery-water {
  background: linear-gradient(180deg, #38BDF8 0%, #059669 100%);
}

.tank-battery-water.low-water {
  background: linear-gradient(180deg, #F87171 0%, #DC2626 100%);
  border-top-color: #FEE2E2;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
  animation: pulseLowWater 1.5s infinite alternate;
}

@keyframes pulseLowWater {
  from { opacity: 0.9; }
  to { opacity: 1; filter: brightness(1.15); }
}


/* -------------------------------------------------------------
   Reservoir Readouts & Refill Action Button
   ------------------------------------------------------------- */
.reservoir-data-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(3px, 0.6vh, 6px);
  flex: 1;
  min-height: 0;
}

.res-status-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.res-percent-badge {
  font-size: clamp(0.68rem, 1.15vmin, 0.85rem);
  font-weight: 800;
  color: var(--forest-dark);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  padding: 1px 7px;
  border-radius: var(--radius-full);
}

[data-theme="dark"] .res-percent-badge {
  color: #72C798;
}

.res-state-pill {
  font-size: clamp(0.64rem, 1.1vmin, 0.8rem);
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--radius-full);
}

.res-state-ok {
  color: #059669;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.res-state-warn {
  color: #DC2626;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

[data-theme="dark"] .res-state-ok {
  color: #34D399;
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(52, 211, 153, 0.3);
}

[data-theme="dark"] .res-state-warn {
  color: #F87171;
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(248, 113, 113, 0.3);
}

.res-vol-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.res-vol-big {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 5.4vmin, 3.4rem);
  font-weight: 800;
  color: var(--text-title);
  line-height: 1;
}

.res-vol-unit {
  font-size: clamp(0.75rem, 1.3vmin, 0.96rem);
  font-weight: 700;
  color: var(--text-muted);
}

.res-cycles-row {
  display: flex;
  align-items: center;
}

.res-cycles-text {
  font-size: clamp(0.66rem, 1.15vmin, 0.85rem);
  color: var(--text-muted);
  font-weight: 500;
}

.res-action-row {
  margin-top: 2px;
}

.btn-refill-prominent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: clamp(5px, 0.8vh, 8px) clamp(10px, 1.4vw, 16px);
  background: var(--bg-card-subtle);
  color: var(--forest-dark);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: clamp(0.7rem, 1.2vmin, 0.86rem);
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-refill-prominent svg {
  fill: currentColor;
}

.btn-refill-prominent:hover {
  background: var(--forest-dark);
  color: #FFFFFF;
}

[data-theme="dark"] .btn-refill-prominent {
  color: #72C798;
}

[data-theme="dark"] .btn-refill-prominent:hover {
  background: #4DA377;
  color: #0C110E;
}

/* =============================================================
   Room Climate Card (DHT11 Sensor Data)
   ============================================================= */
.climate-card-user {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: clamp(8px, 1.4vh, 18px) clamp(10px, 1.4vw, 20px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(4px, 0.8vh, 10px);
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
  flex: 0.95;
  min-height: 0;
}

[data-theme="dark"] .climate-card-user {
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.climate-pill-healthy {
  font-size: clamp(0.63rem, 1.1vmin, 0.85rem);
  font-weight: 700;
  color: var(--forest-dark);
  background: var(--accent-emerald-bg);
  border: 1px solid rgba(30, 56, 43, 0.15);
  padding: clamp(2px, 0.5vh, 4px) clamp(6px, 0.8vw, 10px);
  border-radius: var(--radius-full);
}

[data-theme="dark"] .climate-pill-healthy {
  color: #72C798;
  background: #17291F;
  border-color: rgba(114, 199, 152, 0.25);
}

.climate-pill-warn {
  font-size: clamp(0.63rem, 1.1vmin, 0.85rem);
  font-weight: 700;
  color: var(--accent-amber);
  background: var(--accent-amber-bg);
  border: 1px solid rgba(194, 103, 59, 0.25);
  padding: clamp(2px, 0.5vh, 4px) clamp(6px, 0.8vw, 10px);
  border-radius: var(--radius-full);
}

.climate-tiles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(8px, 1.4vh, 16px);
  flex: 1;
  align-items: stretch;
  min-height: 0;
}

.climate-tile {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: clamp(8px, 1.2vh, 14px) clamp(10px, 1.4vw, 18px);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: clamp(8px, 1.4vw, 16px);
  height: 100%;
  transition: var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.02);
}

[data-theme="dark"] .climate-tile {
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.climate-tile-left {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.climate-val {
  font-family: var(--font-serif);
  font-size: clamp(2.0rem, 5.2vmin, 3.2rem);
  font-weight: 800;
  color: var(--text-title);
  line-height: 1;
}

.climate-tile-right {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(3px, 0.6vh, 6px);
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.climate-tile-meta-header {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.climate-tile-icon-wrap {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.icon-wrap-temp {
  color: var(--accent-amber);
  background: var(--accent-amber-bg);
  border-color: rgba(194, 103, 59, 0.2);
}

.icon-wrap-humidity {
  color: var(--accent-blue);
  background: var(--accent-blue-bg);
  border-color: rgba(43, 98, 114, 0.2);
}

[data-theme="dark"] .icon-wrap-temp {
  color: #DF8F56;
  background: #281D14;
  border-color: rgba(223, 143, 86, 0.25);
}

[data-theme="dark"] .icon-wrap-humidity {
  color: #5495A8;
  background: #15242C;
  border-color: rgba(84, 149, 168, 0.25);
}

.climate-tile-icon-wrap svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

.climate-label {
  font-size: clamp(0.68rem, 1.2vmin, 0.84rem);
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.climate-status-badge {
  font-size: clamp(0.64rem, 1.15vmin, 0.8rem);
  font-weight: 700;
  color: var(--forest-dark);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

[data-theme="dark"] .climate-status-badge {
  color: #72C798;
  background: #141C18;
  border-color: rgba(255, 255, 255, 0.08);
}

/* =============================================================
   Recent Plant Care History Card (User-Friendly Activity)
   ============================================================= */
.care-history-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: clamp(8px, 1.4vh, 18px) clamp(10px, 1.4vw, 20px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(4px, 0.8vh, 10px);
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
  flex: 1.25;
  min-height: 0;
}

[data-theme="dark"] .care-history-card {
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.btn-demo-link {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  color: var(--forest-dark);
  font-size: clamp(0.63rem, 1.1vmin, 0.85rem);
  font-weight: 700;
  padding: clamp(2px, 0.5vh, 4px) clamp(6px, 0.8vw, 10px);
  border-radius: 5px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-demo-link:hover {
  background: var(--forest-dark);
  color: #FFFFFF;
}

[data-theme="dark"] .btn-demo-link {
  color: #72C798;
}

[data-theme="dark"] .btn-demo-link:hover {
  background: #4DA377;
  color: #0C110E;
}

.care-history-list {
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1vh, 10px);
  flex: 1;
  justify-content: flex-start;
  min-height: 0;
}

.care-history-item {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  padding: clamp(5px, 0.9vh, 12px) clamp(8px, 1.2vw, 16px);
  display: flex;
  align-items: center;
  gap: clamp(6px, 1vw, 12px);
  transition: var(--transition);
}

.care-item-icon {
  width: clamp(22px, 3.2vmin, 34px);
  height: clamp(22px, 3.2vmin, 34px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.care-item-icon svg {
  fill: currentColor;
}

.care-icon-green {
  background: var(--accent-emerald-bg);
  color: var(--forest-dark);
}

[data-theme="dark"] .care-icon-green {
  background: #17291F;
  color: #72C798;
}

.care-icon-blue {
  background: var(--accent-blue-bg);
  color: var(--accent-blue);
}

[data-theme="dark"] .care-icon-blue {
  background: #15242C;
  color: #5495A8;
}

.care-icon-amber {
  background: var(--accent-amber-bg);
  color: var(--accent-amber);
}

[data-theme="dark"] .care-icon-amber {
  background: #281D14;
  color: #DF8F56;
}

.care-item-body {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.care-item-title {
  font-size: clamp(0.68rem, 1.25vmin, 0.9rem);
  font-weight: 700;
  color: var(--text-title);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.care-item-time {
  font-size: clamp(0.6rem, 1.1vmin, 0.78rem);
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* =============================================================
   Water Reservoir Capacity Card
   ============================================================= */
.reservoir-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: clamp(8px, 1.3vh, 16px) clamp(10px, 1.4vw, 20px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(6px, 1vh, 12px);
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
  flex: 0.95;
  min-height: 0;
}

[data-theme="dark"] .reservoir-card {
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

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

.reservoir-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tank-capacity-input-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
}

.tank-cap-label {
  font-size: 0.64rem;
  font-weight: 600;
  color: var(--text-muted);
}

.tank-input {
  width: clamp(38px, 4.5vmin, 50px);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: 5px;
  padding: 2px 4px;
  font-size: clamp(0.68rem, 1.2vmin, 0.92rem);
  font-weight: 700;
  color: var(--text-title);
  text-align: center;
  outline: none;
}

.tank-unit {
  font-size: clamp(0.66rem, 1.1vmin, 0.88rem);
  font-weight: 700;
  color: var(--text-title);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: 5px;
  padding: 2px 4px;
  cursor: pointer;
  outline: none;
}

/* Interactive Cartoon Flask Tank Body */
.reservoir-interactive-body {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 22px);
  flex: 1;
  min-height: 0;
}

.tank-flask-container {
  width: clamp(70px, 11vmin, 95px);
  height: clamp(92px, 14.5vmin, 122px);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.08));
}

.tank-flask-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.flask-cap {
  fill: var(--forest-dark);
}

.flask-handle {
  fill: var(--forest-medium);
}

.flask-glass-outer {
  fill: none;
  stroke: var(--forest-dark);
  stroke-width: 2.6;
}

/* Empty bottle background: clearly visible as empty air when liquid drops */
.flask-empty-bg {
  fill: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .flask-empty-bg {
  fill: rgba(255, 255, 255, 0.06);
}

/* Physical water fill: vibrant cyan-teal, physically drops when consumed */
.flask-water-fill {
  fill: #0D9488;
  transition: height 0.5s ease-out, y 0.5s ease-out;
}

[data-theme="dark"] .flask-water-fill {
  fill: #2DD4BF;
}

.flask-water-fill.low-water {
  fill: #F87171 !important;
}

/* Surface ripple/line on top of water */
.flask-surface-line {
  stroke: #FFFFFF;
  stroke-width: 2.2;
  stroke-linecap: round;
  transition: y1 0.5s ease-out, y2 0.5s ease-out;
  opacity: 0.95;
}

[data-theme="dark"] .flask-surface-line {
  stroke: #E2E8F0;
}

.flask-tick {
  stroke: rgba(0, 0, 0, 0.35);
  stroke-width: 1.2;
}

[data-theme="dark"] .flask-tick {
  stroke: rgba(255, 255, 255, 0.45);
}

.flask-tick-num {
  fill: rgba(0, 0, 0, 0.6);
  font-size: 7.5px;
  font-family: var(--font-mono);
  font-weight: 700;
}

[data-theme="dark"] .flask-tick-num {
  fill: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .flask-cap { fill: #4DA377; }
[data-theme="dark"] .flask-handle { fill: #3A885F; }
[data-theme="dark"] .flask-glass-outer { stroke: #4DA377; }

.reservoir-data-col {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  min-width: 0;
  gap: clamp(3px, 0.6vh, 6px);
  height: 100%;
}

.res-status-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.res-percent-badge {
  font-size: clamp(0.7rem, 1.25vmin, 0.92rem);
  font-weight: 800;
  color: var(--forest-dark);
  background: var(--bg-card-subtle);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
}

[data-theme="dark"] .res-percent-badge {
  color: #72C798;
  background: #1B2520;
}

.res-state-pill {
  font-size: 0.63rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.res-state-ok {
  background: var(--accent-emerald-bg);
  color: var(--forest-dark);
}

[data-theme="dark"] .res-state-ok {
  background: #17291F;
  color: #72C798;
}

.res-state-warn {
  background: var(--accent-amber-bg);
  color: var(--accent-amber);
}

[data-theme="dark"] .res-state-warn {
  background: #281D14;
  color: #DF8F56;
}

.res-vol-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.res-vol-big {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3.8vmin, 2.6rem);
  font-weight: 800;
  color: var(--text-title);
  line-height: 1;
}

.res-vol-unit {
  font-size: clamp(0.74rem, 1.25vmin, 0.96rem);
  font-weight: 700;
  color: var(--text-muted);
}

.res-cycles-text {
  font-size: clamp(0.63rem, 1.15vmin, 0.85rem);
  color: var(--text-muted);
  font-weight: 500;
}

.btn-refill-prominent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  color: var(--forest-dark);
  font-size: clamp(0.68rem, 1.2vmin, 0.9rem);
  font-weight: 700;
  padding: clamp(5px, 0.8vh, 8px) clamp(10px, 1.2vw, 16px);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.btn-refill-prominent svg {
  fill: currentColor;
}

.btn-refill-prominent:hover {
  background: var(--forest-dark);
  color: #FFFFFF;
}

[data-theme="dark"] .btn-refill-prominent {
  color: #72C798;
}

[data-theme="dark"] .btn-refill-prominent:hover {
  background: #4DA377;
  color: #0C110E;
}

.btn-refill svg {
  fill: currentColor;
}

.btn-refill:hover {
  background: var(--forest-dark);
  color: #FFFFFF;
}

[data-theme="dark"] .btn-refill:hover {
  color: #0C110E;
}

/* =============================================================
   Simulation Triggers (3 Horizontal Tiles - Compact & Tactile)
   ============================================================= */
.controls-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.triggers-grid-compact {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.trigger-tile {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

[data-theme="dark"] .trigger-tile {
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.trigger-tile:hover {
  border-color: var(--forest-dark);
  transform: translateY(-1px);
}

.trigger-tile:active {
  transform: translateY(0);
}

.trigger-circle-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 2px;
}

.trigger-circle-icon svg {
  fill: currentColor;
}

.trigger-tile-blue .trigger-circle-icon {
  background: var(--accent-blue-bg);
  color: var(--accent-blue);
}

.trigger-tile-amber .trigger-circle-icon {
  background: var(--accent-amber-bg);
  color: var(--accent-amber);
}

.trigger-tile-emerald .trigger-circle-icon {
  background: var(--accent-emerald-bg);
  color: var(--forest-dark);
}

.trigger-tile-coral .trigger-circle-icon {
  background: #FDF1E7;
  color: #C2673B;
}

[data-theme="dark"] .trigger-tile-coral .trigger-circle-icon {
  background: #2C1E14;
  color: #DF8F56;
}

.trigger-tile-teal .trigger-circle-icon {
  background: #E8F4F2;
  color: #276F68;
}

[data-theme="dark"] .trigger-tile-teal .trigger-circle-icon {
  background: #142725;
  color: #52B4AA;
}

.triggers-row-climate {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-top: 5px;
}

.trigger-tile-title {
  font-family: var(--font-serif);
  font-size: 0.77rem;
  font-weight: 700;
  color: var(--text-title);
  line-height: 1.1;
}

.trigger-tile-sub {
  font-size: 0.61rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1;
}

/* =============================================================
   Live Activity & Device Push Testing Card (Full-Screen Utility)
   ============================================================= */
.live-activity-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

[data-theme="dark"] .live-activity-card {
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

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

.activity-title {
  display: flex;
  align-items: center;
  gap: 5px;
}

.activity-title svg {
  fill: var(--forest-dark);
}

.activity-title h4 {
  font-family: var(--font-serif);
  font-size: 0.81rem;
  font-weight: 700;
  color: var(--text-title);
}

.quick-test-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn-xs {
  padding: 2.5px 7px;
  font-size: 0.63rem;
  font-weight: 700;
  border-radius: 5px;
}

.activity-log-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  overflow: hidden;
}

.activity-log-body {
  padding: 6px 8px;
  max-height: 80px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2.5px;
  font-family: var(--font-mono);
  font-size: 0.64rem;
}

.activity-log-body::-webkit-scrollbar {
  width: 4px;
}

.activity-log-body::-webkit-scrollbar-track {
  background: transparent;
}

.activity-log-body::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}

.log-line.info { color: var(--text-muted); }
.log-line.success { color: var(--forest-dark); }
.log-line.warn { color: var(--accent-amber); }
.log-line.error { color: #DC2626; }

[data-theme="dark"] .log-line.error { color: #F87171; }

.log-time {
  opacity: 0.65;
  margin-right: 3px;
}

/* =============================================================
   Compact Footer Bar
   ============================================================= */
.compact-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(2px, 0.5vh, 6px) clamp(4px, 1vw, 12px);
  font-size: clamp(0.62rem, 1.1vmin, 0.85rem);
  color: var(--text-muted);
  flex-shrink: 0;
}

.quote-small {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 700;
  color: var(--forest-dark);
}

/* =============================================================
   Buttons & Generic Components
   ============================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-family: var(--font-sans);
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--forest-dark);
  color: #FFFFFF;
  padding: 7px 12px;
  font-size: 0.76rem;
}

[data-theme="dark"] .btn-primary {
  color: #0C110E;
}

.btn-primary:hover {
  background: var(--forest-deep);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--forest-dark);
  padding: 7px 12px;
  font-size: 0.76rem;
}

.btn-outline:hover {
  background: var(--bg-card-subtle);
}

.btn-sm {
  padding: 4px 8px;
  font-size: 0.68rem;
  border-radius: 5px;
}

.btn-text {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-text:hover {
  color: var(--forest-dark);
}

/* =============================================================
   Modals with Blurred Background
   ============================================================= */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(12, 17, 14, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 16px;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  max-width: 400px;
  width: 100%;
  box-shadow: 0 10px 28px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  padding: 11px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-card-subtle);
}

.modal-header h3 {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-title);
  display: flex;
  align-items: center;
  gap: 7px;
}

.modal-header h3 svg {
  fill: var(--forest-dark);
}

.btn-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.onboarding-guide-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.device-guide-title {
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--text-title);
}

.device-badge {
  font-size: 0.64rem;
  font-weight: 700;
  padding: 1.5px 6px;
  border-radius: var(--radius-full);
  background: var(--forest-dark);
  color: #FFFFFF;
}

[data-theme="dark"] .device-badge {
  color: #0C110E;
}

.step-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.72rem;
  color: var(--text-body);
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.25;
}

.step-num {
  width: 16px;
  height: 16px;
  background: var(--bg-badge);
  color: var(--forest-dark);
  font-weight: 800;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.onboarding-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.btn-skip {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.68rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 2px;
}

/* Diagnostics in Modal */
.modal-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-group h4 {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-title);
}

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

.modal-actions-row {
  display: flex;
  gap: 7px;
}

.modal-actions-row .btn {
  flex: 1;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--forest-dark);
  color: #FFFFFF;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  z-index: 1000;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

[data-theme="dark"] .toast {
  color: #0C110E;
}

.toast.hidden {
  opacity: 0;
  transform: translate(-50%, 15px);
}

.modal-content-wide {
  max-width: 480px;
}

.terminal-window {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  overflow: hidden;
}

.terminal-body {
  padding: 6px 8px;
  max-height: 90px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2.5px;
  font-family: var(--font-mono);
  font-size: 0.64rem;
}

.terminal-body::-webkit-scrollbar {
  width: 4px;
}

.terminal-body::-webkit-scrollbar-track {
  background: transparent;
}

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

/* =============================================================
   Media Queries: Tablet & Desktop Adaptability (>= 680px)
   ============================================================= */
@media (min-width: 680px) {
  body {
    padding: clamp(10px, 1.8vh, 24px) clamp(16px, 2.5vw, 36px);
  }

  .app-container {
    max-width: 1400px;
    gap: clamp(8px, 1.5vh, 20px);
  }

  .dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(8px, 1.5vh, 20px);
    flex: 1;
    min-height: 0;
    height: 100%;
  }

  .dashboard-col {
    gap: clamp(8px, 1.5vh, 20px);
    height: 100%;
    min-height: 0;
  }

  .circular-gauge-container {
    width: clamp(165px, 26vmin, 235px);
    height: clamp(165px, 26vmin, 235px);
    aspect-ratio: 1 / 1;
    flex-shrink: 1;
  }

  .gauge-value {
    font-size: clamp(4.4rem, 11vmin, 6.2rem);
    font-weight: 800;
    line-height: 0.92;
  }

  .moisture-instrument .circular-gauge-container {
    width: clamp(165px, 26vmin, 235px);
    height: clamp(165px, 26vmin, 235px);
  }

  .moisture-instrument .gauge-value {
    font-size: clamp(4.4rem, 11vmin, 6.2rem);
    font-weight: 800;
    line-height: 0.92;
  }

  .reservoir-instrument .tank-battery-body {
    width: clamp(86px, 15vmin, 114px);
    height: clamp(124px, 22vmin, 168px);
    border-width: 4px;
  }

  .reservoir-instrument .res-vol-big {
    font-size: clamp(2.0rem, 5vmin, 3.0rem);
    font-weight: 800;
    line-height: 1;
  }

  .gauge-sub {
    font-size: clamp(0.72rem, 1.35vmin, 1rem);
    font-weight: 800;
  }

  .phone-status-pill {
    font-size: clamp(0.74rem, 1.35vmin, 1.02rem);
    padding: clamp(4px, 0.9vh, 9px) clamp(14px, 1.6vw, 24px);
  }

  .plant-status-message {
    font-size: clamp(0.74rem, 1.3vmin, 0.96rem);
    max-width: 440px;
  }

  .btn-water-action {
    font-size: clamp(0.82rem, 1.35vmin, 1.05rem);
    padding: clamp(9px, 1.3vh, 15px) clamp(14px, 1.8vw, 24px);
  }

  .climate-tile {
    padding: clamp(10px, 1.5vh, 18px) clamp(10px, 1.4vw, 20px);
  }

  .climate-val {
    font-size: clamp(2.5rem, 5.8vmin, 3.8rem);
  }

  .climate-label {
    font-size: clamp(0.7rem, 1.3vmin, 0.95rem);
  }

  .care-item-title {
    font-size: clamp(0.75rem, 1.35vmin, 1.02rem);
  }

  .care-item-time {
    font-size: clamp(0.65rem, 1.2vmin, 0.88rem);
  }

  .care-history-item {
    padding: clamp(6px, 1.1vh, 14px) clamp(10px, 1.4vw, 18px);
  }
}

/* =============================================================
   Mobile & Small Screens (< 680px): Pure App Full-Screen Fit
   Automatically scales spaces to occupy 100% of any phone screen
   ============================================================= */
@media (max-width: 679px) {
  html, body {
    height: auto;
    min-height: 100%;
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  body {
    padding: clamp(6px, 1.2vh, 12px) clamp(8px, 2vw, 14px);
    padding-bottom: max(20px, env(safe-area-inset-bottom, 20px));
    display: block;
  }

  .app-container {
    height: auto;
    min-height: 100%;
    max-height: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 10px;
    padding: 0;
    overflow: visible;
  }

  .app-header {
    padding: clamp(6px, 0.9vh, 10px) clamp(8px, 1.5vw, 14px);
    flex-shrink: 0;
  }

  .dashboard-grid {
    flex: none;
    min-height: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: auto;
  }

  .dashboard-col:first-child {
    flex: none;
    min-height: auto;
    display: flex;
    flex-direction: column;
  }

  .dashboard-col:last-child {
    flex: none;
    min-height: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  /* Unified Card Auto Scaling on Mobile */
  .unified-hydration-card {
    padding: clamp(8px, 1.2vh, 14px) clamp(10px, 1.6vw, 16px);
    gap: clamp(6px, 1vh, 10px);
    flex: none;
    min-height: auto;
  }

  .unified-instruments-row {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: clamp(6px, 1.2vw, 14px);
    padding: clamp(4px, 0.6vh, 8px) 0;
    flex: none;
  }

  .moisture-instrument .circular-gauge-container {
    width: clamp(140px, 30vmin, 180px);
    height: clamp(140px, 30vmin, 180px);
  }

  .moisture-instrument .gauge-value {
    font-size: clamp(3.4rem, 9.5vmin, 4.6rem);
    font-weight: 800;
    line-height: 0.92;
  }

  .moisture-instrument .gauge-sub {
    font-size: clamp(0.72rem, 1.35vmin, 0.94rem);
    font-weight: 800;
    margin-top: 2px;
  }

  .moisture-instrument .phone-status-pill {
    padding: clamp(3px, 0.5vh, 5px) clamp(10px, 1.4vw, 16px);
    font-size: clamp(0.68rem, 1.2vmin, 0.84rem);
    font-weight: 700;
  }

  .reservoir-instrument {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: clamp(3px, 0.6vh, 6px);
  }

  .reservoir-instrument .tank-battery-cap {
    width: clamp(28px, 5vw, 38px);
    height: clamp(5px, 0.8vh, 7px);
    margin-bottom: 2px;
  }

  .reservoir-instrument .tank-battery-body {
    width: clamp(74px, 15vmin, 98px);
    height: clamp(110px, 22vmin, 150px);
    border-width: 3.5px;
  }

  .reservoir-instrument .reservoir-data-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2px;
    width: 100%;
  }

  .reservoir-instrument .res-vol-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
  }

  .reservoir-instrument .res-vol-big {
    font-size: clamp(2.0rem, 5.2vmin, 2.8rem);
    font-weight: 800;
    line-height: 1;
  }

  .reservoir-instrument .res-vol-unit {
    font-size: clamp(0.74rem, 1.35vmin, 0.95rem);
    font-weight: 700;
  }

  .reservoir-instrument .res-status-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
  }

  .reservoir-instrument .res-percent-badge {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 1.5px 7px;
  }

  .reservoir-instrument .res-state-pill {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1.5px 7px;
  }

  .reservoir-instrument .res-cycles-text {
    font-size: 0.62rem;
    color: var(--text-muted);
  }

  .reservoir-instrument .btn-refill-prominent {
    padding: clamp(3px, 0.6vh, 5px) clamp(10px, 1.4vw, 14px);
    font-size: clamp(0.68rem, 1.15vmin, 0.82rem);
    font-weight: 700;
  }

  .unified-action-area {
    gap: clamp(4px, 0.6vh, 6px);
    padding-top: 2px;
  }

  .unified-action-area .plant-status-message {
    font-size: clamp(0.66rem, 1.15vmin, 0.82rem);
    line-height: 1.25;
  }

  .unified-action-area .btn-water-action {
    padding: clamp(7px, 1vh, 10px) 12px;
    font-size: clamp(0.76rem, 1.3vmin, 0.94rem);
  }

  /* Climate Card Auto Scaling on Mobile - Spacious & Unsquished */
  .climate-card-user {
    padding: clamp(8px, 1.2vh, 12px) clamp(10px, 1.6vw, 16px);
    gap: 8px;
    flex: none;
    min-height: auto;
  }

  .climate-tiles-grid {
    gap: 8px;
  }

  .climate-tile {
    padding: clamp(8px, 1.2vh, 12px) clamp(8px, 1.4vw, 12px);
    gap: 6px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    height: auto;
  }

  .climate-tile-left {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .climate-val {
    font-family: var(--font-serif);
    font-size: clamp(1.8rem, 4.6vmin, 2.4rem);
    font-weight: 800;
    line-height: 1;
    margin: 0;
  }

  .climate-tile-right {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
  }

  .climate-tile-meta-header {
    display: flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
  }

  .climate-label {
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .climate-tile-icon-wrap {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    flex-shrink: 0;
  }

  .climate-tile-icon-wrap svg {
    width: 11px;
    height: 11px;
  }

  .climate-status-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1.5px 6px;
    white-space: nowrap;
  }

  /* Care History Card Auto Scaling on Mobile - Balanced, No Weird Voids */
  .care-history-card {
    padding: clamp(8px, 1.2vh, 12px) clamp(10px, 1.6vw, 16px);
    gap: 8px;
    flex: none;
    min-height: auto;
    overflow: visible;
  }

  .care-history-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: none;
    min-height: auto;
    overflow: visible;
  }

  .care-history-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 7px 10px;
    gap: 8px;
    border-radius: 7px;
    width: 100%;
  }

  /* Show all 3 history items cleanly */
  .care-history-item:nth-child(n+4) {
    display: none;
  }

  .care-history-item:nth-child(3) {
    display: flex !important;
  }

  .care-item-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }

  .care-item-icon svg {
    width: 11px;
    height: 11px;
  }

  .care-item-body {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex: 1;
    min-width: 0;
  }

  .care-item-title {
    font-size: clamp(0.66rem, 1.15vmin, 0.8rem);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .care-item-time {
    font-size: clamp(0.58rem, 1.0vmin, 0.72rem);
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Compact Footer Bar - Always fully visible above home bar */
  .compact-footer-bar {
    padding: 12px 10px max(24px, env(safe-area-inset-bottom, 24px)) 10px;
    font-size: clamp(0.64rem, 1.1vmin, 0.76rem);
    flex-shrink: 0;
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
}

@media (min-width: 1200px) {
  .app-container {
    max-width: 1360px;
  }
}

/* Fallback for ultra-short screens (< 500px height e.g. landscape phone) */
@media (max-height: 499px) {
  html, body {
    overflow-y: auto !important;
    height: auto !important;
  }
  .app-container {
    height: auto !important;
    overflow-y: visible !important;
  }
}
