/* ============================================================
   Növénytan — Modern LED-style UI
   ============================================================ */

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

:root {
  /* Surface & background */
  --bg-base: #f0f8ec;
  --bg-gradient: radial-gradient(120% 80% at 50% -10%, #d9f0cf 0%, #f0f8ec 55%, #eaf3e3 100%);
  --surface: #ffffff;
  --surface-muted: #f5fbf2;
  --surface-glass: rgba(255, 255, 255, 0.72);

  /* Borders */
  --border: rgba(22, 78, 38, 0.10);
  --border-strong: rgba(22, 78, 38, 0.22);
  --border-focus: #22c55e;

  /* Brand greens */
  --brand-50:  #f0fdf4;
  --brand-100: #dcfce7;
  --brand-200: #bbf7d0;
  --brand-300: #86efac;
  --brand-400: #4ade80;
  --brand-500: #22c55e;   /* primary */
  --brand-600: #16a34a;
  --brand-700: #15803d;
  --brand-800: #0d4d24;
  --brand-900: #052e14;

  /* Accents */
  --lime: #84cc16;
  --lime-glow: rgba(132, 204, 22, 0.55);
  --primary-glow: rgba(34, 197, 94, 0.45);

  /* Text */
  --text: #0a1a10;
  --text-strong: #052e14;
  --text-muted: #4a6357;
  --text-faint: #7e9388;
  --text-on-brand: #ffffff;

  /* Status */
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-glow: rgba(220, 38, 38, 0.35);
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --warning-glow: rgba(217, 119, 6, 0.35);
  --success: #16a34a;
  --info: #0ea5e9;

  /* Shadows + glow */
  --shadow-xs: 0 1px 2px rgba(7, 30, 14, 0.04);
  --shadow-sm: 0 2px 6px rgba(7, 30, 14, 0.06);
  --shadow-md: 0 6px 18px rgba(7, 30, 14, 0.10);
  --shadow-lg: 0 16px 40px rgba(7, 30, 14, 0.15);
  --shadow-card: 0 4px 16px rgba(15, 76, 36, 0.08);
  --shadow-glow: 0 0 0 4px rgba(34, 197, 94, 0.18), 0 0 32px rgba(34, 197, 94, 0.30);
  --shadow-glow-strong: 0 0 0 6px rgba(34, 197, 94, 0.22), 0 0 48px rgba(34, 197, 94, 0.40);

  /* Geometry */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 999px;

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition: 200ms var(--ease);
}

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-base);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: contain;
  text-rendering: optimizeLegibility;
}

input, button, textarea, select { font: inherit; color: inherit; }
button { border: none; cursor: pointer; background: transparent; }
a { color: var(--brand-600); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--brand-700); }

#root { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

/* ============================================================
   Splash / Loading
   ============================================================ */
.splash {
  flex: 1; min-height: 60vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 24px;
}
.splash-logo {
  font-size: 72px;
  filter: drop-shadow(0 8px 24px var(--primary-glow));
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(34, 197, 94, 0.15);
  border-top-color: var(--brand-500);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner-inline {
  display: inline-block; width: 16px; height: 16px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}
.btn-secondary .spinner-inline,
.btn-link .spinner-inline {
  border-color: rgba(34, 197, 94, 0.25);
  border-top-color: var(--brand-500);
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse-glow { 0%, 100% { box-shadow: 0 0 0 0 var(--primary-glow); } 50% { box-shadow: 0 0 0 12px transparent; } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* ============================================================
   Auth pages
   ============================================================ */
.auth-page {
  flex: 1; display: flex; flex-direction: column;
  padding: 32px 22px;
  padding-top: max(env(safe-area-inset-top, 24px), 24px);
  padding-bottom: max(env(safe-area-inset-bottom, 24px), 24px);
  justify-content: center;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  animation: fadeIn 400ms var(--ease-out);
}
.auth-page h1 {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--brand-600) 0%, var(--brand-800) 50%, var(--brand-700) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-align: center;
  margin-bottom: 6px;
}
.auth-page .subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 15px;
}
.auth-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-card), 0 0 0 1px var(--border);
  position: relative;
  overflow: hidden;
}
.auth-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand-500), var(--lime), var(--brand-500));
  background-size: 200% 100%;
  animation: shimmer 4s linear infinite;
}
.auth-card .field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 16px;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.auth-card .field-hint {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 6px;
}

/* ============================================================
   Inputs
   ============================================================ */
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="url"], input[type="date"],
textarea, select {
  width: 100%;
  background: var(--surface-muted);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 16px;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
input:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, textarea:focus {
  background: var(--surface);
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}
textarea { resize: vertical; min-height: 72px; }
input[disabled], textarea[disabled] { opacity: 0.5; cursor: not-allowed; }
input::placeholder, textarea::placeholder { color: var(--text-faint); }

.code-input {
  letter-spacing: 12px;
  font-size: 28px !important;
  font-weight: 700;
  text-align: center;
  font-family: 'JetBrains Mono', ui-monospace, "SF Mono", Consolas, monospace;
  color: var(--brand-700);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: white;
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  background: linear-gradient(180deg, var(--brand-500) 0%, var(--brand-600) 100%);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.20);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}
.btn:hover {
  background: linear-gradient(180deg, var(--brand-400) 0%, var(--brand-500) 100%);
  box-shadow: 0 6px 18px rgba(34, 197, 94, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn:active { transform: translateY(1px); box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary {
  background: var(--surface);
  color: var(--brand-700);
  border: 1.5px solid var(--brand-500);
  box-shadow: 0 1px 2px rgba(7, 30, 14, 0.04), inset 0 0 0 1px transparent;
}
.btn-secondary:hover {
  background: var(--brand-50);
  border-color: var(--brand-600);
  color: var(--brand-800);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.15);
}

.btn-danger {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 4px 12px var(--danger-glow), inset 0 1px 0 rgba(255, 255, 255, 0.20);
}
.btn-danger:hover { background: linear-gradient(180deg, #f87171 0%, #ef4444 100%); }

.btn-link {
  background: transparent;
  color: var(--brand-600);
  padding: 10px;
  margin-top: 14px;
  font-weight: 500;
  box-shadow: none;
  text-align: center;
}
.btn-link:hover { color: var(--brand-800); background: var(--brand-50); }
.btn-link.small { color: var(--text-faint); font-size: 13px; }

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
  margin: 18px 0 4px;
}

/* ============================================================
   App shell
   ============================================================ */
.app-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
  animation: fadeIn 300ms var(--ease-out);
}

.app-header {
  background: linear-gradient(135deg, var(--brand-700) 0%, var(--brand-800) 50%, var(--brand-900) 100%);
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 4px 24px rgba(7, 30, 14, 0.25);
  backdrop-filter: saturate(180%);
}
.app-header::after {
  content: '';
  position: absolute; bottom: -2px; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--brand-400), var(--lime), var(--brand-400), transparent);
  filter: blur(1px);
  opacity: 0.7;
}
.app-header h1 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
}
.app-header .header-right { display: flex; gap: 6px; align-items: center; }
.app-header button {
  color: white;
  font-size: 22px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  position: relative;
}
.app-header button:hover { background: rgba(255, 255, 255, 0.12); }
.app-header button:active { background: rgba(255, 255, 255, 0.18); }
.app-header button.has-badge::after {
  content: '';
  position: absolute; top: 6px; right: 6px;
  width: 9px; height: 9px;
  background: #ef4444;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--brand-800), 0 0 8px rgba(239, 68, 68, 0.8);
  animation: pulse-glow 2s ease-in-out infinite;
}

.tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
  animation: fadeIn 250ms var(--ease-out);
}

/* ============================================================
   Tab bar (bottom navigation)
   ============================================================ */
.tab-bar {
  display: flex;
  background: var(--surface-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--border);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0));
  position: sticky;
  bottom: 0;
  z-index: 50;
  box-shadow: 0 -4px 24px rgba(7, 30, 14, 0.06);
}
.tab-bar button {
  flex: 1;
  padding: 10px 4px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: color var(--transition);
  position: relative;
}
.tab-bar button .icon {
  font-size: 22px;
  transition: transform var(--transition), filter var(--transition);
}
.tab-bar button:hover .icon { transform: translateY(-1px); }
.tab-bar button.active {
  color: var(--brand-700);
}
.tab-bar button.active .icon {
  filter: drop-shadow(0 0 8px var(--primary-glow)) drop-shadow(0 0 16px var(--lime-glow));
  transform: translateY(-1px) scale(1.08);
}
.tab-bar button.active::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px; height: 3px;
  background: linear-gradient(90deg, var(--brand-500), var(--lime));
  border-radius: var(--radius-full);
  box-shadow: 0 0 12px var(--primary-glow);
}

/* ============================================================
   Sections / cards
   ============================================================ */
.section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card), 0 0 0 1px var(--border);
  animation: slideUp 350ms var(--ease-out);
}
.section h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--brand-800);
  margin-bottom: 14px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-700);
  margin: 14px 0 6px;
  letter-spacing: -0.01em;
}

/* ============================================================
   Plant cards (Garden)
   ============================================================ */
.plant-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 0;
  margin-bottom: 12px;
  display: flex;
  gap: 14px;
  align-items: stretch;
  cursor: pointer;
  overflow: hidden;
  box-shadow: var(--shadow-card), 0 0 0 1px var(--border);
  transition: transform 150ms var(--ease), box-shadow var(--transition);
  position: relative;
  animation: slideUp 300ms var(--ease-out);
}
.plant-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(15, 76, 36, 0.15), 0 0 0 1px var(--brand-300);
}
.plant-card:active { transform: translateY(0); }
.plant-card .thumb {
  width: 88px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand-100), var(--brand-200));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  overflow: hidden;
  position: relative;
}
.plant-card .thumb img {
  width: 100%; height: 100%; object-fit: cover;
}
.plant-card .info {
  flex: 1;
  padding: 14px 14px 14px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.plant-card .name {
  font-size: 17px;
  font-weight: 700;
  color: var(--brand-800);
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plant-card .sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plant-card .sci {
  font-size: 12px;
  font-style: italic;
  color: var(--text-faint);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plant-card .loc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.plant-card .arrow {
  align-self: center;
  padding: 0 16px 0 0;
  font-size: 18px;
  color: var(--brand-400);
  opacity: 0.7;
  transition: transform var(--transition);
}
.plant-card:hover .arrow { transform: translateX(2px); opacity: 1; color: var(--brand-600); }

/* ============================================================
   Empty state
   ============================================================ */
.empty {
  padding: 56px 24px;
  text-align: center;
  color: var(--text-muted);
}
.empty .big-emoji {
  font-size: 64px;
  margin-bottom: 16px;
  display: inline-block;
  filter: drop-shadow(0 8px 16px var(--primary-glow));
  animation: float 3s ease-in-out infinite;
}
.empty h3 {
  color: var(--brand-700);
  margin-bottom: 8px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.empty p { font-size: 14px; color: var(--text-muted); }
.empty strong { color: var(--brand-700); font-weight: 600; }

/* ============================================================
   Alert banner (top of garden)
   ============================================================ */
.alert-banner {
  background: linear-gradient(135deg, #fff8e1 0%, #fef3c7 100%);
  border: 1px solid #fcd34d;
  padding: 14px 16px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  cursor: pointer;
  color: #78350f;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(217, 119, 6, 0.15);
  transition: transform var(--transition), box-shadow var(--transition);
  animation: slideUp 350ms var(--ease-out);
}
.alert-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(217, 119, 6, 0.25);
}
.alert-banner.empty-state {
  background: linear-gradient(135deg, var(--brand-50) 0%, var(--brand-100) 100%);
  border-color: var(--brand-200);
  color: var(--brand-800);
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.10);
}

/* ============================================================
   Error / status boxes
   ============================================================ */
.error-box {
  background: var(--danger-bg);
  border: 1px solid #fecaca;
  color: var(--danger);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.08);
}

/* ============================================================
   Camera screen
   ============================================================ */
.camera-preview {
  width: 100%;
  aspect-ratio: 3/4;
  background: linear-gradient(135deg, var(--brand-100), var(--brand-200));
  border: 1.5px dashed var(--brand-300);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 16px;
  color: var(--brand-700);
  font-weight: 500;
  position: relative;
  box-shadow: var(--shadow-card);
}
.camera-preview img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.btn-row {
  display: flex;
  gap: 10px;
}
.btn-row .btn { flex: 1; margin-top: 0; }
input[type="file"].hidden {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.identify-result {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 16px;
  box-shadow: var(--shadow-card), 0 0 0 1px var(--border);
  position: relative;
  overflow: hidden;
  animation: slideUp 400ms var(--ease-out);
}
.identify-result::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--brand-500), var(--lime), var(--brand-500));
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
}
.identify-result h3 {
  font-size: 24px;
  font-weight: 800;
  color: var(--brand-800);
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}
.identify-result .sci {
  font-style: italic;
  color: var(--text-muted);
  font-size: 15px;
}
.identify-result .meta {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-700);
  background: var(--brand-50);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  margin-top: 10px;
  border: 1px solid var(--brand-200);
}
.identify-result .desc {
  margin-top: 12px;
  line-height: 1.55;
  color: var(--text);
}

/* ============================================================
   Plant detail
   ============================================================ */
.detail-header {
  padding: 12px 4px 16px;
  animation: slideUp 300ms var(--ease-out);
}
.detail-header .title {
  font-size: 28px;
  font-weight: 800;
  color: var(--brand-800);
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.detail-header .sub {
  font-size: 15px;
  color: var(--text-muted);
  margin-top: 4px;
}
.detail-header .sci {
  font-style: italic;
  color: var(--text-faint);
  margin-top: 2px;
  font-size: 14px;
}

.care-row {
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--surface-muted);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--brand-400);
}
.care-row .label {
  font-weight: 700;
  color: var(--brand-800);
  font-size: 14px;
  letter-spacing: -0.01em;
}
.care-row .value {
  color: var(--text);
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.55;
}

.warnings-box {
  background: linear-gradient(135deg, #fff8e1 0%, #fef3c7 100%);
  border: 1px solid #fcd34d;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  margin-top: 10px;
  color: #78350f;
}
.warnings-box h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #92400e;
  display: flex;
  align-items: center;
  gap: 6px;
}
.warnings-box .item {
  font-size: 13px;
  margin-bottom: 6px;
  line-height: 1.5;
  padding-left: 4px;
}

.seasons-box {
  background: linear-gradient(135deg, var(--brand-50) 0%, var(--brand-100) 100%);
  border: 1px solid var(--brand-200);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  margin-top: 10px;
  color: var(--brand-800);
}
.seasons-box h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--brand-800);
  display: flex;
  align-items: center;
  gap: 6px;
}
.seasons-box .item {
  font-size: 13px;
  margin-bottom: 6px;
  line-height: 1.5;
  color: var(--text);
}
.seasons-box .item strong { color: var(--brand-800); font-weight: 600; }

.fert-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.fert-item:last-child { border-bottom: none; }
.fert-item .date {
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 500;
}
.fert-item .product {
  color: var(--text);
  margin-top: 4px;
  font-weight: 500;
}
.fert-item .next {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--brand-700);
  font-size: 12px;
  margin-top: 6px;
  background: var(--brand-50);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--brand-200);
}

/* ============================================================
   Chat
   ============================================================ */
.chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-base);
  background-image: var(--bg-gradient);
}
.chat-msg {
  padding: 12px 16px;
  border-radius: 18px;
  max-width: 85%;
  white-space: pre-wrap;
  line-height: 1.5;
  font-size: 15px;
  animation: slideUp 250ms var(--ease-out);
  box-shadow: var(--shadow-sm);
}
.chat-msg.user {
  background: linear-gradient(135deg, var(--brand-500) 0%, var(--brand-700) 100%);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 6px;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.30);
}
.chat-msg.assistant {
  background: var(--surface);
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 6px;
  border: 1px solid var(--border);
}
.chat-bar {
  display: flex;
  padding: 10px;
  gap: 10px;
  background: var(--surface-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--border);
  align-items: flex-end;
}
.chat-bar textarea {
  flex: 1;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1.5px solid var(--border);
  padding: 10px 16px;
  min-height: 40px;
  max-height: 120px;
}
.chat-bar .send-btn {
  background: linear-gradient(135deg, var(--brand-500) 0%, var(--brand-600) 100%);
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px var(--primary-glow);
  transition: transform var(--transition);
}
.chat-bar .send-btn:hover { transform: scale(1.05); box-shadow: 0 6px 18px var(--primary-glow); }
.chat-bar .send-btn:active { transform: scale(0.95); }
.chat-bar .send-btn:disabled { opacity: 0.5; transform: none; }

/* ============================================================
   Alerts page
   ============================================================ */
.alert-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  border-left: 4px solid var(--brand-500);
  box-shadow: var(--shadow-card), 0 0 0 1px var(--border);
  animation: slideUp 300ms var(--ease-out);
}
.alert-card.high {
  border-left-color: var(--danger);
  box-shadow: 0 4px 16px var(--danger-glow), 0 0 0 1px var(--border);
}
.alert-card.medium {
  border-left-color: var(--warning);
  box-shadow: 0 4px 16px var(--warning-glow), 0 0 0 1px var(--border);
}
.alert-card .sev {
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.alert-card.high .sev { color: var(--danger); }
.alert-card.medium .sev { color: var(--warning); }
.alert-card.low .sev { color: var(--brand-700); }
.alert-card .summary {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
}
.alert-card .time {
  color: var(--text-faint);
  font-size: 11px;
  margin-top: 8px;
}

.reminder-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  border-left: 4px solid var(--brand-500);
  box-shadow: var(--shadow-card), 0 0 0 1px var(--border);
  animation: slideUp 300ms var(--ease-out);
}
.reminder-card .title {
  font-weight: 700;
  color: var(--brand-800);
  font-size: 15px;
  letter-spacing: -0.01em;
}
.reminder-card .msg {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}
.reminder-card .date {
  color: var(--text-faint);
  font-size: 12px;
  margin-top: 6px;
}
.reminder-card .done-btn {
  background: linear-gradient(135deg, var(--brand-500) 0%, var(--brand-600) 100%);
  color: white;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  margin-top: 10px;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);
  transition: transform var(--transition);
}
.reminder-card .done-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px var(--primary-glow); }

/* Forecast pills */
.forecast-pill-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 8px;
  margin: 6px -4px 0;
  scrollbar-width: none;
}
.forecast-pill-row::-webkit-scrollbar { display: none; }
.forecast-pill {
  flex-shrink: 0;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  text-align: center;
  min-width: 78px;
}
.forecast-pill .time {
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 600;
}
.forecast-pill .temp {
  font-size: 18px;
  font-weight: 700;
  color: var(--brand-800);
  margin: 4px 0 2px;
}
.forecast-pill .weather {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
}

/* ============================================================
   Back button
   ============================================================ */
.back-btn {
  font-size: 15px;
  color: white;
  padding: 6px 12px 6px 6px;
  margin-right: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  font-weight: 500;
}
.back-btn:hover { background: rgba(255, 255, 255, 0.12); }

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed;
  bottom: calc(100px + env(safe-area-inset-bottom, 0));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(7, 30, 14, 0.92);
  color: white;
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  z-index: 200;
  max-width: 92%;
  text-align: center;
  box-shadow: 0 8px 32px rgba(7, 30, 14, 0.40), 0 0 0 1px rgba(34, 197, 94, 0.20);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  animation: slideUp 250ms var(--ease-out);
  line-height: 1.4;
}

/* ============================================================
   Modal (future use)
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(7, 30, 14, 0.60);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.modal-card {
  background: var(--surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 24px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 -20px 48px rgba(0, 0, 0, 0.30);
  animation: slideUp 300ms var(--ease-out);
}
.modal-card h2 {
  color: var(--brand-800);
  margin-bottom: 14px;
  font-size: 22px;
  letter-spacing: -0.02em;
}
@media (min-width: 600px) {
  .modal-backdrop {
    align-items: center;
    padding: 24px;
  }
  .modal-card {
    border-radius: var(--radius-xl);
    max-width: 480px;
    margin: 0 auto;
  }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (min-width: 720px) {
  .app-shell { box-shadow: 0 0 64px rgba(7, 30, 14, 0.08); }
}
