:root {
  --green-950: #04180d;
  --green-900: #082414;
  --green-800: #123821;
  --green-700: #1f5b33;
  --green-500: #5bbf2a;
  --cream: #f6f5ed;
  --surface-bg: rgba(255, 255, 255, 0.46);
  --panel-bg: rgba(255, 255, 255, 0.86);
  --panel-border: rgba(255, 255, 255, 0.78);
  --task-bg: rgba(255, 255, 255, 0.62);
  --ink: #102016;
  --muted: #657267;
  --amber: #e5a720;
  --danger: #bf462a;
  --shadow: 0 22px 60px rgba(8, 36, 20, 0.18);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(90deg, rgba(246, 245, 237, 0.94), rgba(246, 245, 237, 0.78)), url("https://images.unsplash.com/photo-1463320726281-696a485928c7?auto=format&fit=crop&w=2200&q=85") center / cover fixed;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.dark-theme {
  --surface-bg: rgba(4, 24, 13, 0.64);
  --panel-bg: rgba(8, 36, 20, 0.84);
  --panel-border: rgba(126, 201, 92, 0.23);
  --task-bg: rgba(255, 255, 255, 0.11);
  --ink: #f5fff2;
  --muted: rgba(230, 246, 222, 0.72);
  background: linear-gradient(120deg, rgba(4, 24, 13, 0.97), rgba(8, 48, 28, 0.92)), url("https://images.unsplash.com/photo-1501004318641-b39e6451bec6?auto=format&fit=crop&w=2200&q=85") center / cover fixed;
}

button, a, input, select, textarea { font: inherit; }
p, h1, h2, h3, h4 { margin-top: 0; }
p { color: var(--muted); line-height: 1.5; }
button { min-height: 42px; border: 0; border-radius: 8px; cursor: pointer; font-weight: 800; }
input, select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(31, 91, 51, 0.16);
  border-radius: 8px;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--green-500); box-shadow: 0 0 0 4px rgba(91, 191, 42, 0.16); }
label { display: grid; gap: 8px; color: var(--muted); font-size: 0.9rem; font-weight: 800; }

.is-hidden { display: none !important; }
.kicker { margin: 0 0 4px; color: var(--green-700); font-size: 0.82rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0; }
body.dark-theme .kicker { color: #98df77; }

.brand { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; }
.brand img { width: 40px; height: 40px; object-fit: contain; }

.mobile-blocker {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(140deg, rgba(4, 24, 13, 0.96), rgba(31, 91, 51, 0.86)), url("https://images.unsplash.com/photo-1492496913980-501348b61469?auto=format&fit=crop&w=1400&q=85") center / cover;
}

.mobile-blocker-card {
  width: min(100%, 520px);
  padding: 26px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.3);
}

.mobile-blocker-card img {
  width: 78px;
  height: 78px;
  object-fit: contain;
  margin-bottom: 18px;
}

.mobile-blocker-card h1 {
  margin-bottom: 12px;
  font-size: clamp(1.7rem, 8vw, 2.35rem);
  line-height: 1.05;
}

.mobile-blocker-card a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 12px;
  padding: 0 16px;
  color: #fff;
  background: var(--green-700);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 900;
}

body.mobile-web-blocked {
  overflow: hidden;
}

body.mobile-web-blocked .auth-shell,
body.mobile-web-blocked .app-shell,
body.mobile-web-blocked .robot-launcher,
body.mobile-web-blocked .robot-panel,
body.mobile-web-blocked .toast {
  display: none !important;
}

@media (min-width: 768px) {
  .mobile-blocker { display: none !important; }
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(380px, 520px);
  gap: 20px;
  padding: 20px;
}

.auth-visual {
  min-height: calc(100vh - 40px);
  display: grid;
  align-content: space-between;
  padding: 28px;
  color: #fff;
  background: linear-gradient(120deg, rgba(4, 24, 13, 0.92), rgba(12, 61, 36, 0.48)), url("https://images.unsplash.com/photo-1492496913980-501348b61469?auto=format&fit=crop&w=1600&q=85") center / cover;
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.auth-brand { color: #fff; }
.auth-copy { max-width: 760px; }
.auth-copy h1 { margin-bottom: 16px; font-size: clamp(2.2rem, 5vw, 5rem); line-height: 0.98; }
.auth-copy p { max-width: 640px; color: rgba(255, 255, 255, 0.82); }

.auth-card {
  align-self: center;
  display: grid;
  gap: 18px;
  padding: 24px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; background: rgba(31, 91, 51, 0.08); border-radius: 8px; }
.auth-tabs button { color: var(--green-900); background: transparent; }
.auth-tabs button.active { color: #fff; background: var(--green-700); }
.auth-form { display: none; gap: 16px; }
.auth-form.active { display: grid; }
.auth-form h2 { margin-bottom: 0; font-size: 2.2rem; }
.primary-action, .primary-small { color: #fff; background: linear-gradient(135deg, var(--green-500), #2b7d2b); }
.primary-small { min-height: 38px; padding: 0 14px; }
.guest-action, .ghost-button, .text-button {
  color: var(--green-900);
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(31, 91, 51, 0.14);
}
.text-button { min-height: 34px; padding: 0 8px; color: var(--green-700); background: transparent; border: 0; }
.social-block { display: grid; gap: 10px; text-align: center; color: var(--muted); }
.social-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.social-grid button {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-height: 62px;
  padding: 8px 6px;
  color: var(--green-900);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(31, 91, 51, 0.14);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.1;
}
.social-logo {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
}
.social-logo svg { display: block; width: 100%; height: 100%; }
.social-logo.google { background: rgba(255, 255, 255, 0.62); }
.social-logo.apple { padding: 2px; color: #102016; background: rgba(16, 32, 22, 0.08); }
.social-logo.apple svg { fill: currentColor; }
.social-logo.facebook { background: rgba(24, 119, 242, 0.08); }
.social-name { font-weight: 400; }
.auth-note { margin: 0; font-size: 0.86rem; }
.checkbox-row { grid-template-columns: 18px 1fr; align-items: start; gap: 10px; color: var(--muted); font-weight: 700; }
.checkbox-row input { width: 18px; min-height: 18px; margin-top: 3px; }

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  min-height: 100vh;
  padding: 16px;
}
.sidebar {
  position: sticky;
  top: 16px;
  height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  padding: 22px 18px;
  color: #fff;
  background: linear-gradient(180deg, rgba(5, 30, 16, 0.94), rgba(4, 24, 13, 0.98)), url("https://images.unsplash.com/photo-1520412099551-62b6bafeb5bb?auto=format&fit=crop&w=700&q=70") center / cover;
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.nav { display: grid; gap: 8px; margin-top: 30px; }
.nav button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 42px;
  padding: 10px 12px;
  color: rgba(255, 255, 255, 0.84);
  background: transparent;
  border-radius: 8px;
}
.nav button.active, .nav button:hover { color: #fff; background: rgba(91, 191, 42, 0.22); }
.nav-title {
  margin: 12px 8px 2px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}
.sidebar-support {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
}
.sidebar-support button,
.sidebar-support a {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  font-weight: 900;
  text-decoration: none;
}
.sidebar-support button { background: rgba(191, 70, 42, 0.74); }
.sidebar-support .sidebar-weather-card {
  display: grid;
  min-height: 86px;
  justify-items: start;
  padding: 12px;
  background: linear-gradient(135deg, rgba(74, 103, 177, 0.92), rgba(20, 43, 91, 0.92));
}
.sidebar-weather-card span,
.sidebar-weather-card small { color: rgba(255, 255, 255, 0.72); }
.sidebar-weather-card strong { font-size: 1.35rem; }
.profile { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, 0.14); }
.profile-copy { min-width: 0; flex: 1; }
.profile-copy strong, .profile-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile span { display: block; color: rgba(255, 255, 255, 0.62); font-size: 0.84rem; }
.avatar { display: grid; width: 44px; height: 44px; place-items: center; color: #fff; background: var(--green-500); border-radius: 50%; font-weight: 900; }
.profile-logout {
  display: grid;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  place-items: center;
  padding: 0;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
}
.profile-logout:hover { color: #fff; background: rgba(191, 70, 42, 0.86); }
.profile-logout svg { width: 20px; height: 20px; fill: currentColor; }

.dashboard {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 18px;
  background: var(--surface-bg);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  backdrop-filter: blur(18px);
}
.topbar, .section-title, .tasks li, .top-actions, .row-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.top-actions { justify-content: flex-end; flex-wrap: wrap; }
.theme-switch {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  width: 76px;
  min-height: 38px;
  padding: 4px;
  color: var(--green-900);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(31, 91, 51, 0.16);
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(8, 36, 20, 0.1);
}
.theme-switch .theme-icon {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: rgba(16, 32, 22, 0.5);
}
.theme-switch svg { width: 18px; height: 18px; fill: currentColor; }
.theme-knob {
  position: absolute;
  z-index: 1;
  left: 4px;
  width: 30px;
  height: 30px;
  background: var(--amber);
  border-radius: 50%;
  transition: transform 0.18s ease, background 0.18s ease;
}
.theme-switch.is-dark .theme-knob {
  transform: translateX(38px);
  background: var(--green-700);
}
.theme-switch:not(.is-dark) .theme-icon.sun,
.theme-switch.is-dark .theme-icon.moon { color: #fff; }
body.dark-theme .theme-switch {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
}
body.dark-theme .theme-switch .theme-icon { color: rgba(255, 255, 255, 0.58); }
body.dark-theme .theme-switch.is-dark .theme-icon.moon { color: #fff; }
.api-input { width: min(340px, 100%); grid-template-columns: 34px minmax(180px, 1fr); align-items: center; color: var(--muted); }
.compact-control { width: min(190px, 100%); gap: 4px; }
.compact-control select, .compact-control input { min-height: 38px; padding: 7px 10px; }
.topbar h1 { margin-bottom: 0; font-size: clamp(1.7rem, 3vw, 3rem); line-height: 1.02; }
.guest-banner {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  color: #fff;
  background: linear-gradient(135deg, rgba(191, 70, 42, 0.92), rgba(130, 78, 24, 0.9));
  border-radius: 8px;
}
.guest-banner span { color: rgba(255, 255, 255, 0.84); }

.weather-banner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(320px, 0.7fr) minmax(360px, 1.15fr);
  align-items: center;
  gap: 18px;
  min-height: 170px;
  padding: 18px;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(120deg, rgba(74, 103, 177, 0.98), rgba(20, 43, 91, 0.96)),
    radial-gradient(circle at 82% 24%, rgba(255, 255, 255, 0.16), transparent 24%),
    radial-gradient(circle at 70% 78%, rgba(91, 191, 42, 0.16), transparent 20%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.weather-copy, .weather-metrics, .weather-live-map { position: relative; z-index: 1; }
.weather-banner .kicker,
.weather-banner p { color: rgba(255, 255, 255, 0.78); }
.weather-banner h2 {
  margin-bottom: 6px;
  font-size: clamp(1.55rem, 2.7vw, 2.4rem);
  line-height: 1.05;
}
.weather-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.weather-metrics article {
  min-width: 100px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  backdrop-filter: blur(8px);
}
.weather-metrics span {
  display: block;
  margin-bottom: 5px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}
.weather-metrics strong { font-size: 1.25rem; }
.weather-live-map {
  height: 136px;
  overflow: hidden;
  background: rgba(4, 24, 13, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
}
.weather-live-map iframe {
  display: block;
  width: 100%;
  height: 210px;
  margin-top: -36px;
  border: 0;
}

.device-link-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 18px;
  padding: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(229, 247, 219, 0.82));
  border: 1px solid rgba(91, 191, 42, 0.28);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
body.dark-theme .device-link-panel {
  background: linear-gradient(135deg, rgba(8, 36, 20, 0.88), rgba(18, 56, 33, 0.78));
}
.device-link-panel.locked { opacity: 0.72; }
.device-link-panel h2 { margin-bottom: 8px; font-size: clamp(1.4rem, 2.4vw, 2.15rem); line-height: 1.1; }
.device-link-panel p { margin-bottom: 0; }
.pairing-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(31, 91, 51, 0.12);
  border-radius: 8px;
}
.pairing-qr {
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  color: var(--green-900);
  background:
    linear-gradient(90deg, var(--green-900) 12px, transparent 12px) 0 0 / 28px 28px,
    linear-gradient(var(--green-900) 12px, transparent 12px) 0 0 / 28px 28px,
    #fff;
  border: 6px solid #fff;
  border-radius: 8px;
  font-weight: 900;
}
.pairing-card small { display: block; color: var(--muted); font-weight: 800; }
.pairing-card strong { display: block; margin: 4px 0 10px; font-size: 1.3rem; color: var(--green-900); }
.settings-device-link {
  margin-bottom: 18px;
}
.settings-subtitle {
  margin: 24px 0 12px;
}
.password-form button {
  align-self: end;
  min-height: 48px;
}

.panel-view { display: none; gap: 18px; }
.panel-view.active { display: grid; min-height: 0; }
.assistant-workspace { min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  min-height: 270px;
  padding: 26px;
  color: #fff;
  background: linear-gradient(90deg, rgba(5, 30, 16, 0.84), rgba(5, 30, 16, 0.22)), url("https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=1800&q=85") center / cover;
  border-radius: 8px;
}
.hero > div { align-self: end; max-width: 620px; }
.hero .kicker, .hero p { color: rgba(255, 255, 255, 0.82); }
.hero h2 { margin-bottom: 8px; font-size: clamp(3rem, 7vw, 5.8rem); line-height: 0.92; }

.scanner { align-self: center; display: grid; gap: 14px; padding: 14px; background: rgba(4, 24, 13, 0.44); border: 1px solid rgba(255, 255, 255, 0.24); border-radius: 8px; backdrop-filter: blur(14px); }
.scan-frame { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 8px; }
.scan-frame img, .plant img { width: 100%; height: 100%; object-fit: cover; }
.scan-frame i { position: absolute; z-index: 2; width: 34px; height: 34px; border-color: rgba(255, 255, 255, 0.86); }
.scan-frame i:nth-child(1) { top: 16px; left: 16px; border-top: 4px solid; border-left: 4px solid; }
.scan-frame i:nth-child(2) { top: 16px; right: 16px; border-top: 4px solid; border-right: 4px solid; }
.scan-frame i:nth-child(3) { bottom: 16px; left: 16px; border-bottom: 4px solid; border-left: 4px solid; }
.scan-frame i:nth-child(4) { right: 16px; bottom: 16px; border-right: 4px solid; border-bottom: 4px solid; }
.scanner button { color: #fff; background: linear-gradient(135deg, var(--green-500), #2b7d2b); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stats article, .panel, .plant {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.stats article { display: grid; gap: 6px; padding: 18px; }
.stats span, .tasks span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--green-900);
  background: rgba(91, 191, 42, 0.18);
  border-radius: 50%;
  font-weight: 900;
}
.stats strong { font-size: 2rem; }
.stats p, .tasks p { margin-bottom: 0; }

.main-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.75fr); gap: 18px; }
.farm-readiness-panel { grid-column: 1 / -1; }
.readiness-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.readiness-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  background: var(--task-bg);
  border-left: 5px solid var(--green-500);
  border-radius: 8px;
}
.readiness-item span { color: var(--muted); font-size: 0.92rem; }
.readiness-item.danger { border-left-color: var(--danger); background: rgba(191, 70, 42, 0.09); }
.readiness-item.warning { border-left-color: var(--amber); background: rgba(229, 167, 32, 0.12); }
.readiness-item.info { border-left-color: #4a75c9; }
.readiness-item.ok { border-left-color: var(--green-500); }
.panel { padding: 18px; }
.section-title { margin-bottom: 16px; }
.section-title h3 { margin-bottom: 0; font-size: 1.35rem; }

.scan-list { display: grid; gap: 12px; }
.scan-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--task-bg);
  border: 1px solid rgba(31, 91, 51, 0.1);
  border-radius: 8px;
}
.scan-icon { display: grid; width: 44px; height: 44px; place-items: center; color: #fff; background: var(--green-700); border-radius: 8px; font-weight: 900; }
.scan-card h4 { margin-bottom: 4px; }
.scan-card p { margin-bottom: 0; }
.scan-thumb {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: cover;
  background: var(--green-100);
  border: 1px solid rgba(31, 91, 51, 0.16);
  border-radius: 8px;
}
.scan-missing-image {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  color: var(--green-900);
  background: rgba(91, 191, 42, 0.16);
  border: 1px solid rgba(31, 91, 51, 0.16);
  border-radius: 8px;
}
.scan-missing-image svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.scan-name-cell {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.scan-name-cell strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}
.diagnosis-card {
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: start;
}
.diagnosis-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}
.diagnosis-grid span {
  display: grid;
  gap: 3px;
  min-height: 62px;
  padding: 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(31, 91, 51, 0.1);
  border-radius: 8px;
}
.diagnosis-grid strong {
  margin: 0;
  color: var(--ink);
}
.diagnosis-steps {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--muted);
}
.diagnosis-actions {
  justify-content: flex-start;
  margin-top: 12px;
}
.diagnosis-actions button { min-height: 36px; }
.status-pill { display: inline-flex; min-width: 76px; justify-content: center; padding: 6px 10px; color: #fff; background: var(--green-700); border-radius: 999px; font-size: 0.8rem; font-weight: 900; }
.status-pill.warning { background: var(--amber); color: var(--green-950); }
.status-pill.danger { background: var(--danger); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 13px 12px; text-align: left; border-bottom: 1px solid rgba(31, 91, 51, 0.12); }
th { color: var(--muted); font-size: 0.82rem; text-transform: uppercase; }
td button { min-height: 34px; padding: 0 12px; color: var(--green-900); background: rgba(91, 191, 42, 0.16); }

.cycle-list-header p { margin: 4px 0 0; }
.cycle-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
}
.cycle-filters .compact-control:first-child { width: min(460px, 100%); }
.cycle-table { min-width: 1040px; }
.cycle-crop-cell {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.cycle-crop-cell small { display: block; color: var(--muted); }
.cycle-crop-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--green-700);
  background: rgba(209, 230, 24, 0.24);
  border-radius: 8px;
  font-weight: 900;
}
.cycle-status {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 12px;
  color: var(--green-950);
  background: #d6ed00;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 900;
}
.cycle-status.harvested {
  color: #1f6b3d;
  background: #d9f8df;
}
.cycle-progress-mini {
  display: inline-block;
  width: 74px;
  height: 7px;
  margin-right: 8px;
  overflow: hidden;
  vertical-align: middle;
  background: rgba(31, 91, 51, 0.12);
  border-radius: 999px;
}
.cycle-progress-mini i {
  display: block;
  height: 100%;
  background: #d6ed00;
  border-radius: inherit;
}
.cycle-back-button {
  justify-self: start;
  margin-bottom: 10px;
}
.cycle-detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}
.cycle-detail-top h3 {
  margin-bottom: 4px;
  font-size: 1.7rem;
  font-weight: 500;
}
.cycle-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.danger-button {
  color: var(--danger);
  background: rgba(191, 70, 42, 0.08);
  border-color: rgba(191, 70, 42, 0.18);
}
.cycle-progress-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 22px;
  padding: 24px;
  color: #fff;
  background: #3f681d;
  border-radius: 8px;
}
.cycle-progress-hero p,
.cycle-progress-hero small { color: rgba(255, 255, 255, 0.72); }
.cycle-progress-hero span {
  font-size: 1.8rem;
}
.cycle-progress-bar {
  grid-column: 1 / -1;
  height: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.32);
  border-radius: 999px;
}
.cycle-progress-bar i {
  display: block;
  height: 100%;
  background: #d6ed00;
  border-radius: inherit;
}
.cycle-progress-hero small:last-child { justify-self: end; }
.cycle-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.cycle-metrics article {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  padding: 18px;
  background: var(--panel-bg);
  border: 1px solid rgba(31, 91, 51, 0.12);
  border-radius: 8px;
}
.cycle-metrics span,
.cycle-farm-card span {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--green-700);
  background: rgba(209, 230, 24, 0.2);
  border-radius: 8px;
  font-weight: 900;
}
.cycle-metrics strong { font-size: 1.1rem; }
.cycle-metrics small { color: var(--muted); }
.cycle-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.48fr);
  gap: 16px;
}
.cycle-info-card {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 22px;
  background: var(--panel-bg);
  border: 1px solid rgba(31, 91, 51, 0.12);
  border-radius: 8px;
}
.cycle-info-card.large { grid-column: span 1; }
.cycle-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.cycle-info-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cycle-info-grid span,
.cycle-farm-card,
.cycle-info-card button {
  padding: 14px;
  background: rgba(31, 91, 51, 0.06);
  border-radius: 8px;
}
.cycle-info-grid small,
.cycle-farm-card small { display: block; color: var(--muted); }
.cycle-farm-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.cycle-info-card button {
  min-height: 46px;
  color: var(--ink);
  text-align: left;
}
.cycle-info-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}
.advanced-diagnosis-result {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px;
  background: var(--task-bg);
  border: 1px solid rgba(31, 91, 51, 0.12);
  border-radius: 8px;
}
.advanced-diagnosis-result h4 { margin-bottom: 0; }
.advanced-diagnosis-result ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  gap: 14px;
}
.inventory-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.inventory-summary article {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--task-bg);
  border: 1px solid rgba(31, 91, 51, 0.12);
  border-radius: 8px;
}
.inventory-summary .low-stock { background: rgba(209, 230, 24, 0.18); }
.inventory-summary .inventory-value {
  color: var(--green-950);
  background: #d6ed00;
}
.inventory-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--green-700);
  background: rgba(209, 230, 24, 0.2);
  border-radius: 8px;
  font-size: 1.35rem;
}
.inventory-icon.warn { color: #ff7a1a; }
.inventory-icon.money { color: var(--green-900); background: rgba(255, 255, 255, 0.38); }
.inventory-summary small { color: var(--muted); }
.inventory-summary strong { font-size: 1.35rem; font-weight: 500; }
.inventory-filters {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(180px, 0.9fr) minmax(180px, 0.9fr) minmax(180px, 0.8fr);
  gap: 14px;
  margin-bottom: 18px;
}
.inventory-filters .compact-control { width: 100%; }
.inventory-check {
  grid-template-columns: 18px 1fr;
  align-items: center;
  min-height: 46px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(31, 91, 51, 0.16);
  border-radius: 8px;
}
.inventory-check input {
  width: 16px;
  min-height: 16px;
  padding: 0;
}
.inventory-card {
  display: grid;
  min-height: 210px;
  overflow: hidden;
  background: var(--panel-bg);
  border: 1px solid rgba(31, 91, 51, 0.12);
  border-radius: 8px;
}
.inventory-card header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
}
.inventory-card header small {
  display: block;
  color: var(--muted);
}
.inventory-sprout {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--green-500);
  background: rgba(91, 191, 42, 0.12);
  border-radius: 8px;
  font-size: 1.6rem;
}
.inventory-quantity {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 0 20px 20px;
}
.inventory-quantity strong {
  display: block;
  font-size: 1.6rem;
  font-weight: 500;
}
.inventory-quantity small {
  display: block;
  color: var(--muted);
}
.inventory-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding: 14px 20px;
  background: rgba(31, 91, 51, 0.04);
}
.inventory-card footer button {
  min-height: 34px;
  padding: 0 4px;
  color: #7a9911;
  background: transparent;
}
.inventory-card footer span button { color: var(--muted); }
.finance-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.finance-summary article {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--task-bg);
  border: 1px solid rgba(31, 91, 51, 0.12);
  border-radius: 8px;
}
.finance-summary .net-profit {
  color: var(--green-950);
  background: #d6ed00;
}
.finance-summary .finance-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: #31b75a;
  background: rgba(209, 230, 24, 0.2);
  border-radius: 8px;
  font-size: 1.55rem;
  font-weight: 400;
}
.finance-summary .finance-icon.up { color: #ef4d3f; }
.finance-summary .finance-icon.calc { color: var(--green-900); background: rgba(255, 255, 255, 0.38); }
.finance-summary small {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
}
.finance-summary strong { font-size: 1.5rem; }
.finance-date-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.finance-date-row label {
  grid-template-columns: auto 150px;
  align-items: center;
  color: var(--ink);
}
.finance-tabs {
  display: flex;
  gap: 24px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(31, 91, 51, 0.12);
}
.finance-tabs button {
  min-height: 44px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border-bottom: 2px solid transparent;
  border-radius: 0;
}
.finance-tabs button.active {
  color: var(--green-700);
  border-bottom-color: #d6ed00;
}
.finance-filters {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(200px, 0.8fr) minmax(200px, 0.8fr);
  gap: 14px;
  margin-bottom: 18px;
}
.finance-filters .compact-control { width: 100%; }
.finance-table {
  min-width: 1080px;
  overflow: hidden;
  border: 1px solid rgba(31, 91, 51, 0.12);
  border-radius: 8px;
}
.finance-table thead { background: rgba(31, 91, 51, 0.05); }
.finance-table small { color: var(--muted); }
.finance-amount {
  font-weight: 900;
  white-space: nowrap;
}
.finance-amount.income { color: #31b75a; }
.finance-amount.expense { color: #ef4d3f; }
.finance-actions {
  display: flex;
  gap: 6px;
}
.finance-actions button {
  min-width: 34px;
  padding: 0;
  color: var(--muted);
  background: transparent;
}
.advanced-diagnosis-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: 16px;
}
.advanced-diagnosis-form {
  display: grid;
  gap: 14px;
}
.upload-zone {
  min-height: 220px;
  place-items: center;
  justify-items: center;
  padding: 24px;
  color: var(--green-900);
  background: rgba(91, 191, 42, 0.1);
  border: 2px dashed rgba(31, 91, 51, 0.28);
  border-radius: 8px;
  text-align: center;
}
.upload-zone input { display: none; }
.upload-zone.drag-over {
  border-color: var(--green-500);
  background: rgba(91, 191, 42, 0.2);
}
.advanced-diagnosis-result img {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 8px;
}

.plants { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.farm-list {
  display: grid;
  gap: 18px;
}
.farm-location-tools {
  display: grid;
  gap: 12px;
  margin: 14px 0 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(31, 91, 51, 0.12);
  border-radius: 8px;
}
.location-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.map-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  background: rgba(230, 245, 220, 0.7);
  border: 1px solid rgba(31, 91, 51, 0.12);
  border-radius: 8px;
}
.map-tools button {
  min-height: 34px;
  padding: 0 12px;
  color: var(--green-900);
  background: #fff;
  border: 1px solid rgba(31, 91, 51, 0.14);
  border-radius: 8px;
  font-weight: 900;
}
.map-tools button:hover,
.map-tools button.active {
  color: #fff;
  background: var(--green-700);
}
.field-hint {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}
.location-suggestions button {
  min-height: 34px;
  padding: 0 12px;
  color: var(--green-900);
  background: #e3f3d8;
  border: 1px solid rgba(31, 91, 51, 0.14);
  border-radius: 999px;
}
.parcel-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.parcel-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.parcel-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  align-items: center;
  min-height: 74px;
  padding: 12px;
  text-align: left;
  color: var(--ink);
  background: var(--task-bg);
  border: 1px solid rgba(31, 91, 51, 0.12);
}
.parcel-card.active { outline: 3px solid rgba(91, 191, 42, 0.28); }
.parcel-card-select {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 6px 10px;
  align-items: center;
  padding: 0;
  color: inherit;
  text-align: left;
  background: transparent;
  border: 0;
}
.parcel-card-select > span {
  grid-row: 1 / span 2;
  width: 38px;
  height: 38px;
  border: 2px solid rgba(0, 0, 0, 0.18);
  border-radius: 8px;
}
.parcel-card small { color: var(--muted); }
.parcel-card-actions {
  display: flex;
  gap: 6px;
}
.parcel-card-actions button {
  min-height: 30px;
  padding: 0 10px;
  color: var(--green-900);
  background: #e3f3d8;
  border: 1px solid rgba(31, 91, 51, 0.14);
  border-radius: 8px;
  font-weight: 900;
}
.danger-button { color: #b1321f !important; }
.garden-pin-panel {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  background: linear-gradient(135deg, rgba(231, 246, 220, 0.92), rgba(255, 255, 255, 0.72));
  border: 1px solid rgba(31, 91, 51, 0.14);
  border-radius: 8px;
}
.garden-pin-panel p {
  margin: 4px 0 0;
  color: var(--muted);
}
.garden-pin-icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  background: #fff;
  border: 1px solid rgba(31, 91, 51, 0.12);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(8, 36, 20, 0.12);
}
.garden-pin-icon svg {
  width: 52px;
  height: 52px;
}
.plant-location-picker {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(31, 91, 51, 0.12);
  border-radius: 8px;
}
.plant-location-map {
  min-height: 280px;
  overflow: hidden;
  border: 1px solid rgba(31, 91, 51, 0.16);
  border-radius: 8px;
  background: #d7e2cf;
}
.farm-map-board {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid rgba(31, 91, 51, 0.16);
  border-radius: 8px;
  background: #d7e2cf;
}
.farm-map-board.is-hidden { display: none; }
.farm-google-map,
.farm-map-board iframe,
.farm-map-board svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.farm-google-map {
  z-index: 1;
  display: none;
}
.farm-map-board.google-ready .farm-google-map { display: block; }
.farm-map-board.google-ready iframe,
.farm-map-board.google-ready svg { display: none; }
.farm-map-board iframe { border: 0; }
.farm-map-board svg { z-index: 2; cursor: crosshair; }
.parcel-shape {
  fill-opacity: 0.76;
  stroke: #172016;
  stroke-width: 5;
  cursor: pointer;
}
.parcel-shape.active { stroke: #fff; stroke-width: 8; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.36)); }
.parcel-label {
  fill: #fff;
  paint-order: stroke;
  stroke: rgba(0,0,0,0.7);
  stroke-width: 4;
  font-size: 26px;
  font-weight: 900;
}
.parcel-draft-line {
  fill: rgba(244, 210, 31, 0.38);
  stroke: var(--amber);
  stroke-width: 6;
}
.parcel-draft-point { fill: #fff; stroke: var(--green-700); stroke-width: 4; }
.map-hint {
  position: absolute;
  z-index: 3;
  right: 14px;
  bottom: 14px;
  max-width: 460px;
  padding: 10px 12px;
  color: var(--green-900);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(8, 36, 20, 0.14);
}
.parcel-map-popup {
  display: grid;
  gap: 4px;
  min-width: 180px;
  color: var(--green-900);
  font-family: inherit;
}
.parcel-map-popup strong { font-size: 1rem; }
.parcel-map-popup span,
.parcel-map-popup small { color: var(--muted); }
.parcel-modal-card {
  width: min(980px, 94vw);
}
.parcel-modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: 16px;
}
.parcel-preview-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(31, 91, 51, 0.12);
  border-radius: 8px;
}
.parcel-preview-map {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(66, 109, 53, 0.36), rgba(228, 214, 137, 0.42)),
    repeating-linear-gradient(25deg, rgba(31, 91, 51, 0.12) 0 2px, transparent 2px 48px);
  border: 1px solid rgba(31, 91, 51, 0.16);
  border-radius: 8px;
}
.parcel-preview-map svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.farm-category {
  display: grid;
  gap: 12px;
}
.farm-category-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.farm-category-title h4 {
  margin: 2px 0 0;
  font-size: 1.18rem;
}
.farm-category-title span {
  display: inline-grid;
  min-width: 34px;
  height: 34px;
  place-items: center;
  color: #fff;
  background: var(--green-700);
  border-radius: 999px;
  font-weight: 900;
}
.farm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.plant { overflow: hidden; }
.farm-location-alert {
  margin: 10px 10px 0;
  padding: 8px 10px;
  color: #3d2600;
  background: #f4ad19;
  border: 1px solid rgba(61, 38, 0, 0.16);
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 900;
}
.plant img { display: block; height: 150px; }
.plant > .plant-card-image {
  width: 100%;
  height: 150px;
  object-fit: cover;
}
.plant > .plant-photo-placeholder {
  width: 100%;
  height: 150px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid rgba(31, 91, 51, 0.12);
  border-radius: 0;
  background: linear-gradient(135deg, rgba(91, 191, 42, 0.18), rgba(234, 242, 226, 0.88));
}
.plant > .plant-photo-empty svg {
  width: 34px;
  height: 34px;
}
.plant div { padding: 12px; }
.plant h4 { margin-bottom: 4px; }
.plant p { margin-bottom: 10px; }
.plant .farm-location-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  color: var(--muted);
}
.farm-pin-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  color: #fff;
  background: var(--green-700);
  border-radius: 999px;
  font-weight: 900;
  white-space: nowrap;
}
.farm-pin-button span,
.plant-map-pin {
  position: relative;
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  background: linear-gradient(145deg, #64c832, #1f6b39);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 8px 18px rgba(31, 91, 51, 0.22);
}
.farm-pin-button span::before,
.plant-map-pin span {
  content: "";
  width: 10px;
  height: 10px;
  background:
    radial-gradient(circle at 50% 20%, #fff 0 2px, transparent 3px),
    linear-gradient(90deg, transparent 0 4px, #fff 4px 6px, transparent 6px),
    #e8f8db;
  border-radius: 50%;
  transform: rotate(45deg);
}
.farm-pin-button span {
  width: 18px;
  height: 18px;
  box-shadow: none;
}
.plant strong { display: block; padding: 0 12px 12px; }
.plant .plant-actions {
  display: flex;
  gap: 8px;
  padding: 0 12px 12px;
}
.plant .plant-actions button { flex: 1; min-height: 34px; }
meter { width: 100%; height: 8px; }

.tasks { display: grid; gap: 12px; padding: 0; margin: 0; list-style: none; }
.tasks.large li { min-height: 72px; }
.tasks li { padding: 12px; background: var(--task-bg); border-radius: 8px; }
.tasks button { min-width: 74px; padding: 0 10px; color: var(--green-900); background: rgba(255, 255, 255, 0.74); }

.detail-grid, .form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.detail-grid article {
  padding: 16px;
  background: var(--task-bg);
  border-radius: 8px;
}

.detail-grid article.wide { grid-column: 1 / -1; }
.wide-field { grid-column: 1 / -1; }
.detail-grid strong { display: block; margin-bottom: 6px; }
.plant-detail-hero {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}
.plant-detail-photo {
  width: 110px;
  height: 90px;
  object-fit: cover;
  border: 1px solid rgba(31, 91, 51, 0.16);
  border-radius: 8px;
}
.plant-detail-hero h4 {
  margin-bottom: 4px;
  font-size: 1.45rem;
  overflow-wrap: anywhere;
}
.plant-detail-hero span { color: var(--muted); }
.plant-detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.plant-detail-actions button { white-space: nowrap; }
.plant-location-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, rgba(234, 242, 226, 0.92), rgba(255, 255, 255, 0.96));
}
.map-modal-card {
  max-width: 980px;
}
.plant-map-shell {
  position: relative;
  min-height: 460px;
  overflow: hidden;
  border: 1px solid rgba(31, 91, 51, 0.14);
  border-radius: 8px;
  background: #dbe8d3;
}
.plant-map-shell iframe {
  width: 100%;
  height: 460px;
  border: 0;
}
.plant-map-shell > .plant-map-pin {
  position: absolute;
  z-index: 2;
  top: 22px;
  left: 22px;
}
.map-help-text {
  margin-top: 10px;
  color: var(--muted);
}
.health-trend {
  display: flex;
  align-items: end;
  gap: 10px;
  min-height: 130px;
  padding-top: 12px;
}
.health-trend span {
  display: grid;
  width: min(64px, 16%);
  min-width: 46px;
  height: 118px;
  align-items: end;
  justify-items: center;
  gap: 6px;
}
.health-trend i {
  display: block;
  width: 100%;
  min-height: 8px;
  background: linear-gradient(180deg, var(--green-500), var(--green-700));
  border-radius: 8px 8px 2px 2px;
}
.health-trend small {
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}
.plant-mini-gallery {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
.plant-mini-gallery > button {
  display: grid;
  gap: 6px;
  min-height: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  text-align: left;
}
.plant-gallery-photo {
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  height: auto;
  object-fit: cover;
  border: 1px solid rgba(31, 91, 51, 0.14);
  border-radius: 8px;
}
.plant-mini-gallery small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  overflow-wrap: anywhere;
}
.plant-timeline-list {
  display: grid;
  gap: 8px;
}
.plant-timeline-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 10px 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid rgba(31, 91, 51, 0.12);
  text-align: left;
}
.plant-timeline-list b {
  min-width: 0;
  overflow-wrap: anywhere;
}
.plant-timeline-list span {
  color: var(--muted);
  font-weight: 700;
  text-align: right;
}
.form-actions { justify-content: flex-end; margin-top: 16px; }

.calendar-grid, .user-grid, .settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.calendar-grid article, .user-grid article, .settings-grid article {
  display: grid;
  gap: 8px;
  min-height: 120px;
  padding: 16px;
  background: var(--task-bg);
  border-radius: 8px;
}
.calendar-grid span, .user-grid span, .settings-grid span { color: var(--muted); }
.account-settings-grid { margin-bottom: 16px; }
.calendar-grid ul {
  display: grid;
  gap: 8px;
  padding-left: 18px;
  margin: 0;
}
.care-month-planner {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(420px, 1fr) minmax(120px, 150px);
  gap: 18px;
  align-items: start;
}
.month-phone-card {
  position: relative;
  display: grid;
  grid-row: 1 / span 2;
  gap: 12px;
  padding: 18px;
  background: #fbf8ff;
  border: 1px solid rgba(77, 95, 159, 0.14);
  border-radius: 26px;
  box-shadow: 0 18px 46px rgba(77, 95, 159, 0.16);
}
.month-head {
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  align-items: center;
  text-align: center;
}
.month-head button {
  min-height: 34px;
  color: #4d5f9f;
  background: transparent;
  font-size: 1.5rem;
}
.month-head strong {
  color: #31415f;
  font-size: 0.9rem;
  text-transform: capitalize;
}
.month-weekdays, .month-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.month-weekdays span {
  color: #6d758d;
  font-size: 0.74rem;
  font-weight: 800;
  text-align: center;
}
.month-days {
  gap: 6px 2px;
  padding-top: 4px;
}
.month-day {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 6px;
  min-height: 42px;
  color: #3d4964;
  font-size: 0.82rem;
}
.month-day.muted { color: #b7bdca; }
.month-day.today span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #fff;
  background: #7d8abd;
  border-radius: 999px;
}
.month-day div {
  display: flex;
  min-height: 8px;
  gap: 3px;
}
.month-day i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
}
.treatment-timeline {
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(77, 95, 159, 0.14);
}
.treatment-row {
  display: grid;
  grid-template-columns: 92px repeat(35, minmax(4px, 1fr));
  align-items: center;
  gap: 2px;
  min-height: 25px;
}
.treatment-row > span {
  color: #47718d;
  font-size: 0.72rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.treatment-row b {
  grid-column: var(--start) / span var(--span);
  min-height: 12px;
  overflow: hidden;
  padding: 0 8px;
  color: #fff;
  background: var(--bar);
  border-radius: 999px;
  font-size: 0.62rem;
  line-height: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.month-task-feed {
  display: grid;
  gap: 10px;
}
.month-task-feed article {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 12px;
  background: var(--task-bg);
  border-radius: 12px;
}
.month-task-feed article.treatment {
  border-left: 5px solid var(--danger);
}
.month-task-feed span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #fff;
  border-radius: 10px;
  font-weight: 900;
}
.month-task-feed strong { display: block; }
.month-task-feed p { margin-bottom: 0; }
.month-action-feed {
  display: grid;
  gap: 10px;
}
.month-action-feed button {
  min-height: 54px;
  min-width: 74px;
  padding: 0 10px;
  color: #4d5f9f;
  background: #eef1ff;
  border-radius: 8px;
  font-weight: 900;
}
.month-action-feed button.timeline {
  color: #4d5f9f;
  background: #eef1ff;
}
.month-care-zone {
  display: grid;
  grid-column: 2 / 4;
  gap: 12px;
}
.month-care-title {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.care-timeline {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.care-timeline-shell {
  display: grid;
  gap: 12px;
  min-height: 0;
  padding: 16px;
  background: linear-gradient(145deg, rgba(226, 246, 238, 0.96), rgba(255, 255, 255, 0.92));
  border: 1px solid rgba(31, 91, 51, 0.12);
}
.timeline-plant-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.timeline-plant-head strong {
  display: block;
  color: var(--green-900);
  font-size: 1.08rem;
}
.timeline-plant-head span {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 999px;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.82);
}
.timeline-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
}
.timeline-date {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
}
.timeline-date i {
  display: block;
  width: 13px;
  height: 13px;
  background: #fff;
  border: 3px solid var(--plant-color);
  border-radius: 999px;
}
.timeline-task-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  background: #fff;
  border: 1px solid rgba(31, 91, 51, 0.1);
  border-left: 5px solid var(--plant-color);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(4, 24, 13, 0.08);
}
.timeline-task-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--plant-color);
  background: rgba(91, 191, 42, 0.13);
  background: color-mix(in srgb, var(--plant-color) 16%, #fff);
  border-radius: 999px;
  font-weight: 900;
}
.timeline-task-card div {
  min-width: 0;
  flex: 1;
}
.timeline-task-card strong,
.timeline-task-card small {
  display: block;
  overflow-wrap: anywhere;
}
.timeline-task-card small,
.timeline-task-card em {
  color: var(--muted);
  font-style: normal;
}
.timeline-action {
  min-width: 86px;
  padding: 0 12px;
  color: var(--green-900);
  background: #ffe77a;
  border-radius: 999px;
}
.sub-section {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(31, 91, 51, 0.1);
}

.device-admin { display: grid; gap: 14px; margin-bottom: 18px; }
.device-help, .device-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  background: var(--task-bg);
  border: 1px solid rgba(31, 91, 51, 0.1);
  border-radius: 8px;
}
.device-help { align-items: flex-start; flex-direction: column; }
.device-help p { margin-bottom: 0; }
.device-list { display: grid; gap: 10px; }
.device-card span { display: block; margin-top: 4px; color: var(--muted); }
.device-card button {
  min-width: 126px;
  color: #fff;
  background: var(--danger);
}

.empty-state {
  padding: 16px;
  color: var(--muted);
  background: var(--task-bg);
  border-radius: 8px;
}

.scan-detail {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.scan-detail article {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  background: var(--task-bg);
  border-radius: 8px;
}

.scan-detail strong {
  display: block;
  margin-bottom: 4px;
}
.detail-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--green-900);
  background: rgba(91, 191, 42, 0.16);
  border: 1px solid rgba(31, 91, 51, 0.12);
  border-radius: 8px;
}
.detail-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scan-detail article.scan-modal-hero {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 96px;
}
.scan-modal-hero .scan-thumb,
.scan-modal-hero .scan-icon,
.scan-modal-hero .scan-missing-image {
  width: 82px;
  height: 82px;
  border-radius: 10px;
}
.scan-modal-hero .scan-missing-image svg {
  width: 36px;
  height: 36px;
}
.scan-modal-hero strong {
  display: block;
  font-size: 1.25rem;
  overflow-wrap: anywhere;
}
.scan-modal-hero span { color: var(--muted); }

.plant-profile {
  display: grid;
  gap: 14px;
}
.profile-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.profile-heading h4 { margin-bottom: 2px; font-size: 1.3rem; }
.profile-heading span:not(.status-pill) { color: var(--muted); }
.profile-review-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(31, 91, 51, 0.12);
  border-radius: 8px;
}
.profile-review-form textarea {
  min-height: 76px;
  resize: vertical;
}
.profile-review-form button {
  align-self: end;
  min-height: 46px;
}
.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.profile-grid article {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  background: var(--task-bg);
  border-radius: 8px;
}
.profile-grid article.wide { grid-column: 1 / -1; }
.profile-grid strong { display: block; margin-bottom: 6px; }
.profile-grid p { margin-bottom: 0; }
.profile-grid ul {
  display: grid;
  gap: 6px;
  padding-left: 18px;
  margin: 0;
}
.example-images {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.example-images figure {
  overflow: hidden;
  margin: 0;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(31, 91, 51, 0.12);
  border-radius: 8px;
}
.example-images img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.example-images figcaption {
  display: grid;
  gap: 2px;
  padding: 8px;
  color: var(--green-900);
  font-size: 0.78rem;
}
.example-images small {
  color: var(--muted);
  font-size: 0.72rem;
  word-break: break-word;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4, 24, 13, 0.58);
  backdrop-filter: blur(10px);
}

.modal-card {
  width: min(1040px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 18px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.inventory-modal-card {
  width: min(920px, 100%);
}
.inventory-modal-card .section-title span {
  display: block;
  max-width: 560px;
  color: var(--muted);
}
.inventory-form-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.inventory-form-grid label:first-child,
.inventory-form-grid label:nth-child(9),
.inventory-form-grid label:nth-child(10) {
  grid-column: span 2;
}
.inventory-form-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding: 14px 16px;
  color: var(--green-900);
  background: linear-gradient(135deg, rgba(232, 246, 220, 0.94), rgba(255, 255, 255, 0.92));
  border: 1px solid rgba(91, 191, 42, 0.22);
  border-radius: 8px;
}
.inventory-form-summary span {
  color: var(--muted);
  font-weight: 800;
}
.inventory-form-summary strong {
  font-size: 1.35rem;
}
.finance-modal-card {
  width: min(700px, 100%);
}
.finance-form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.finance-form-grid label:nth-child(7),
.finance-form-grid label:nth-child(8),
.finance-form-grid label:nth-child(9) {
  grid-column: 1 / -1;
}
.file-attach-label {
  grid-column: 1 / -1;
  cursor: pointer;
}
.file-attach-label input[type="file"] {
  padding: 6px 10px;
  font-size: 0.86rem;
}
.finance-attach-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--task-bg);
  border: 1px solid rgba(31, 91, 51, 0.12);
  border-radius: 8px;
}
.finance-attach-preview img {
  max-width: 120px;
  max-height: 80px;
  object-fit: cover;
  border-radius: 6px;
}
.finance-attach-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--green-700);
  font-size: 0.82rem;
}
.weather-modal-card {
  width: min(960px, 100%);
}
.weather-modal-map {
  height: 420px;
  overflow: hidden;
  background: rgba(4, 24, 13, 0.24);
  border: 1px solid rgba(31, 91, 51, 0.12);
  border-radius: 8px;
}
.weather-modal-map iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.weather-modal-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.weather-modal-metrics article {
  padding: 12px;
  background: var(--task-bg);
  border: 1px solid rgba(31, 91, 51, 0.12);
  border-radius: 8px;
}
.weather-modal-metrics span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}
.weather-modal-metrics strong {
  font-size: 1.25rem;
}
.bugreport-modal-card {
  width: min(640px, 100%);
}
.bugreport-form-grid {
  grid-template-columns: 1fr;
}
.bugreport-form-grid textarea {
  min-height: 120px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--surface-bg);
  border: 1px solid rgba(31, 91, 51, 0.2);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
}

.photo-preview-card {
  width: min(1120px, calc(100vw - 36px));
  padding: 14px;
}
.photo-preview-card .section-title {
  margin-bottom: 12px;
}
.photo-preview-card span {
  display: block;
  max-width: 760px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.photo-preview-frame {
  display: grid;
  max-height: calc(100vh - 170px);
  place-items: center;
  overflow: hidden;
  background: rgba(4, 24, 13, 0.08);
  border-radius: 8px;
}
.photo-preview-frame img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 170px);
  object-fit: contain;
  border-radius: 8px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 86px;
  z-index: 20;
  max-width: 360px;
  padding: 12px 14px;
  color: #fff;
  background: rgba(4, 24, 13, 0.94);
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.toast.active { opacity: 1; transform: translateY(0); }

.auth-shell:not(.is-hidden) ~ .robot-launcher,
.auth-shell:not(.is-hidden) ~ .robot-panel {
  display: none;
}
.robot-launcher {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 22;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--green-700), var(--green-900));
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  box-shadow: var(--shadow);
}
.robot-launcher span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--green-950);
  background: var(--amber);
  border-radius: 50%;
  font-size: 0.82rem;
}
.robot-panel {
  position: fixed;
  right: 18px;
  bottom: 84px;
  z-index: 32;
  display: grid;
  grid-template-rows: auto minmax(260px, 420px) auto;
  width: min(420px, calc(100vw - 36px));
  overflow: hidden;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.robot-header,
.robot-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid rgba(31, 91, 51, 0.12);
}
.robot-form { border-top: 1px solid rgba(31, 91, 51, 0.12); border-bottom: 0; }
.robot-history {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
  overflow: auto;
}
.robot-message {
  max-width: 86%;
  padding: 10px 12px;
  background: var(--task-bg);
  border: 1px solid rgba(31, 91, 51, 0.1);
  border-radius: 8px;
}
.robot-message.user {
  justify-self: end;
  color: #fff;
  background: var(--green-700);
}
.robot-message strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.78rem;
}
.robot-message p { margin: 0; }
.robot-message small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
}
.robot-message.user small { color: rgba(255, 255, 255, 0.72); }

.assistant-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  min-height: 0;
  overflow: hidden;
  flex: 1 1 auto;
}
.assistant-sidebar,
.assistant-main {
  background: var(--panel-bg);
  border: 1px solid rgba(31, 91, 51, 0.12);
  border-radius: 8px;
}
.assistant-sidebar {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 22px;
  overflow-y: auto;
}
#robotConversationList {
  display: grid;
  gap: 8px;
}
#robotConversationList button {
  display: grid;
  justify-items: start;
  gap: 4px;
  min-height: 58px;
  padding: 12px;
  color: var(--ink);
  background: rgba(31, 91, 51, 0.05);
}
#robotConversationList button.active {
  background: rgba(209, 230, 24, 0.18);
  border: 1px solid #d6ed00;
}
#robotConversationList span {
  color: var(--muted);
  font-size: 0.84rem;
}
.assistant-main {
  display: flex;
  flex-direction: column;
  padding: 18px;
  min-height: 0;
}
.assistant-history {
  display: grid;
  align-content: start;
  gap: 14px;
  overflow-y: auto;
  padding: 18px;
  flex: 1 1 auto;
  min-height: 0;
  max-height: calc(100vh - 340px);
}
.assistant-history .robot-message {
  max-width: min(880px, 86%);
  font-size: 1rem;
}
.assistant-history .robot-message.user {
  background: rgba(209, 230, 24, 0.28);
  color: var(--green-950);
}
.assistant-history .robot-message.user small { color: var(--muted); }
.assistant-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(31, 91, 51, 0.12);
}
.assistant-note {
  margin: 10px 0 0;
  text-align: center;
  font-size: 0.82rem;
}

@media (max-width: 1100px) {
  .auth-shell, .app-shell { grid-template-columns: 1fr; }
  .auth-visual { min-height: 420px; }
  .sidebar { position: static; height: auto; }
  .nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero, .main-grid { grid-template-columns: 1fr; }
  .stats, .plants, .farm-grid, .calendar-grid, .user-grid, .settings-grid, .inventory-grid, .finance-summary, .inventory-summary, .readiness-list, .parcel-cards, .parcel-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cycle-detail-grid, .advanced-diagnosis-layout { grid-template-columns: 1fr; }
  .cycle-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finance-filters, .inventory-filters, .assistant-layout, .inventory-form-grid, .finance-form-grid { grid-template-columns: 1fr; }
  .inventory-form-grid label:first-child,
  .inventory-form-grid label:nth-child(9),
  .inventory-form-grid label:nth-child(10),
  .finance-form-grid label:nth-child(7),
  .finance-form-grid label:nth-child(8),
  .finance-form-grid label:nth-child(9) { grid-column: auto; }
  .care-month-planner { grid-template-columns: 1fr; }
  .month-phone-card, .month-care-zone { grid-column: auto; grid-row: auto; }
  .care-timeline { grid-template-columns: 1fr; }
  .weather-banner { grid-template-columns: 1fr; }
  .weather-live-map { height: 180px; }
  .weather-modal-map { height: 280px; }
  .device-link-panel { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .auth-shell, .app-shell { padding: 0; }
  .auth-visual { min-height: 300px; border-radius: 0; }
  .auth-card, .dashboard, .sidebar { border-radius: 0; }
  .topbar, .section-title, .top-actions { align-items: stretch; flex-direction: column; }
  .nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats, .plants, .farm-grid, .calendar-grid, .user-grid, .settings-grid, .social-grid, .detail-grid, .form-grid, .profile-grid, .inventory-grid, .finance-summary, .inventory-summary, .finance-form-grid, .readiness-list, .parcel-cards, .parcel-form { grid-template-columns: 1fr; }
  .finance-date-row label { grid-template-columns: 1fr; }
  .cycle-detail-top, .cycle-actions { align-items: stretch; flex-direction: column; }
  .cycle-metrics, .cycle-info-grid, .cycle-info-grid.three { grid-template-columns: 1fr; }
  .cycle-progress-hero { grid-template-columns: 1fr; }
  .cycle-progress-hero span, .cycle-progress-hero small:last-child { justify-self: start; }
  .profile-review-form { grid-template-columns: 1fr; }
  .timeline-row { grid-template-columns: 58px minmax(0, 1fr); }
  .timeline-task-card { align-items: flex-start; flex-wrap: wrap; }
  .timeline-action { margin-left: 46px; }
  .weather-metrics { grid-template-columns: 1fr; }
  .plant-detail-hero { grid-template-columns: 1fr; }
  .plant-detail-photo { width: 100%; height: auto; aspect-ratio: 16 / 9; }
  .plant-detail-actions { justify-content: stretch; }
  .plant-detail-actions button { flex: 1; }
  .plant-mini-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plant-timeline-list button { align-items: flex-start; flex-direction: column; }
  .plant-timeline-list span { text-align: left; }
  .treatment-row { grid-template-columns: 72px repeat(35, minmax(3px, 1fr)); }
  .month-task-feed article { grid-template-columns: 44px minmax(0, 1fr); }
  .month-action-feed { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .example-images { grid-template-columns: 1fr; }
  .hero { padding: 18px; }
  .scan-card { grid-template-columns: 44px minmax(0, 1fr); }
  .scan-card .status-pill { grid-column: 1 / -1; justify-self: start; }
  .diagnosis-grid { grid-template-columns: 1fr; }
  .diagnosis-actions { align-items: stretch; flex-direction: column; }
  .profile-heading { flex-direction: column; }
  .pairing-card, .device-card { grid-template-columns: 1fr; }
  .device-card { align-items: stretch; flex-direction: column; }
  .robot-launcher { right: 12px; bottom: 12px; }
  .robot-panel { right: 12px; bottom: 76px; width: calc(100vw - 24px); }
}
