/* Farmer app shell — green theme, fields + map */

.app-body {
  margin: 0;
  min-height: 100svh;
  background:
    radial-gradient(70% 50% at 10% 0%, rgba(98, 192, 132, 0.16), transparent 55%),
    #f3faf5;
  color: #10251a;
  font-family: "Figtree", sans-serif;
}

.app-top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(243, 250, 245, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(16, 37, 26, 0.1);
}

.app-top-inner {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  min-height: 4.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.app-top .brand-prithvi {
  color: #0b2417;
}

.app-top .brand-scan {
  color: #3f9a63;
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 0.65rem 0.85rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: min(100%, 52rem);
}

.app-nav > a[href="prices.html"],
.app-nav > a[href="/prices"] {
  color: #1f6b45;
  font-weight: 700;
}

.app-nav > a:not(.nav-app):not(.nav-cta) {
  font-weight: 600;
  color: #3a5646;
  text-decoration: none;
}

.app-nav > a.is-active,
.app-nav > a:not(.nav-app):not(.nav-cta):hover {
  color: #0b2417;
}

.app-nav .auth-slot {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin-left: 0.15rem;
  flex-shrink: 0;
}

/* App pages load styles.css too — keep local fallbacks simple */
.app-nav .nav-app {
  background: #2f855a;
  color: #fff !important;
}

.app-main {
  padding: 1.75rem 0 3rem;
}

.app-shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

/* Field detail page — wide shell, stats above, expanded INFO */
.app-shell.field-detail-shell,
.field-detail-shell {
  width: min(1560px, calc(100% - 1.25rem));
}

.field-stats-bar {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

.field-stats-bar .metrics-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 0;
}

.field-stats-bar .satellite-row {
  margin-bottom: 0;
}

.field-detail-layout {
  display: grid;
  grid-template-columns: minmax(440px, 1fr) minmax(0, 1.2fr);
  gap: 1rem 1.35rem;
  align-items: start;
}

.field-detail-sidebar {
  position: sticky;
  top: 5rem;
  display: grid;
  gap: 0.85rem;
  align-content: start;
  padding-bottom: 0.5rem;
}

.field-detail-sidebar .insight-card-wrap {
  margin-bottom: 0;
}

.field-detail-sidebar .insight-card {
  min-height: 0;
}

.field-detail-main {
  min-width: 0;
  display: grid;
  gap: 0.85rem;
  align-content: start;
}

.field-detail-main .field-tools {
  margin-top: 0;
}

@media (max-width: 1280px) {
  .field-stats-bar .metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .field-detail-layout {
    grid-template-columns: minmax(360px, 0.95fr) minmax(0, 1.2fr);
  }
}

@media (max-width: 980px) {
  .field-detail-layout {
    grid-template-columns: 1fr;
  }
  .field-detail-sidebar {
    position: static;
  }
  .field-stats-bar .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.app-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.app-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #3f9a63;
}

.app-page-head h1 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: -0.03em;
  color: #0b2417;
}

.app-lead {
  margin: 0.4rem 0 0;
  color: #3a5646;
}

.app-back {
  display: inline-block;
  margin-bottom: 0.85rem;
  font-weight: 600;
  color: #3a5646;
  text-decoration: none;
}

.app-back:hover {
  color: #0b2417;
}

.app-btn-primary,
.app-btn-ghost,
.app-btn-danger {
  appearance: none;
  border-radius: 999px;
  min-height: 2.75rem;
  padding: 0.65rem 1.15rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
}

.app-btn-primary {
  background: #1f6b45;
  color: #ffffff;
}

.app-btn-primary:hover {
  background: #276749;
  color: #ffffff;
}

.app-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.app-btn-ghost {
  background: #ffffff;
  border: 1px solid rgba(16, 37, 26, 0.14);
  color: #0b2417;
}

.app-btn-danger {
  background: #fff7f7;
  border: 1px solid rgba(155, 28, 28, 0.28);
  color: #9b1c1c;
}

.app-status {
  min-height: 1.35em;
  margin: 0 0 1rem;
  color: #3a5646;
  font-size: 0.95rem;
}

.app-status.is-error {
  color: #9b1c1c;
}

.app-status.is-ok {
  color: #2f7a4d;
}

.app-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 1.1rem;
  align-items: start;
}

.app-panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(16, 37, 26, 0.1);
  border-radius: 20px;
  padding: 1.15rem 1.15rem 1.25rem;
  box-shadow: 0 16px 40px rgba(6, 22, 14, 0.06);
}

.app-panel h2 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.25rem;
  color: #0b2417;
}

.app-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.app-count {
  display: inline-grid;
  place-items: center;
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: #eef6f1;
  color: #0b2417;
  font-size: 0.85rem;
  font-weight: 700;
}

.app-muted {
  margin: 0 0 0.85rem;
  color: #3a5646;
  font-size: 0.92rem;
}

/* URTC suite panels */
.urtc-card {
  margin: 0.85rem 0;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(16, 37, 26, 0.1);
}
.urtc-card h3 {
  margin: 0 0 0.45rem;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.15rem;
}
.urtc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.urtc-table th,
.urtc-table td {
  padding: 0.35rem 0.4rem;
  border-bottom: 1px solid rgba(16, 37, 26, 0.08);
  text-align: left;
}
.risk-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.risk-card {
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(16, 37, 26, 0.1);
  background: #fff;
}
.risk-card header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}
.risk-card h3 { margin: 0; font-size: 1rem; }
.risk-card.is-action { border-color: rgba(197, 48, 48, 0.35); background: #fff5f5; }
.risk-card.is-watch { border-color: rgba(214, 158, 46, 0.4); background: #fffaf0; }
.risk-pill {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}
.risk-pill.is-ok { background: #e6f4ea; color: #1f6b45; }
.risk-pill.is-watch { background: #feebc8; color: #9c4221; }
.risk-pill.is-dry { background: #fed7d7; color: #9b2c2c; }
.urtc-inline {
  display: inline-grid;
  gap: 0.25rem;
  margin: 0 0.75rem 0.75rem 0;
  font-size: 0.86rem;
  font-weight: 700;
}
.drone-canvas {
  width: 100%;
  max-width: 640px;
  margin-top: 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(16, 37, 26, 0.12);
}
.boundary-tools {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.fusion-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.85rem;
}
.sat-chip-muted {
  opacity: 0.55;
}
@media (max-width: 720px) {
  .risk-grid { grid-template-columns: 1fr; }
}

.field-map {
  width: 100%;
  height: min(52vh, 420px);
  min-height: 280px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(16, 37, 26, 0.1);
  background: #1a2e1f;
  z-index: 1;
  position: relative;
}

.field-map .leaflet-container {
  width: 100%;
  height: 100%;
  font: inherit;
  background: #1a2e1f;
}

.field-map .leaflet-tile-pane {
  /* Keep satellite tiles crisp against global img max-width rules */
  filter: none;
}

.field-map-error {
  position: absolute;
  inset: auto 0.75rem 0.75rem;
  z-index: 500;
  margin: 0;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: rgba(15, 23, 20, 0.88);
  color: #f7faf7;
  font-size: 0.82rem;
  font-weight: 600;
  pointer-events: none;
}

.field-check-banner {
  margin: 0.65rem 0 0;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
}

.field-check-banner.is-pending {
  background: #edf2f7;
  color: #2d3748;
  border: 1px solid rgba(45, 55, 72, 0.12);
}

.field-check-banner.is-ok {
  background: #e6f4ea;
  color: #1f6b45;
  border: 1px solid rgba(47, 133, 90, 0.25);
}

.field-check-banner.is-warn {
  background: #fffaf0;
  color: #9c4221;
  border: 1px solid rgba(214, 158, 46, 0.35);
}

.field-check-banner.is-error {
  background: #fff5f5;
  color: #9b2c2c;
  border: 1px solid rgba(229, 62, 62, 0.35);
}

.field-map-detail {
  height: 320px;
  margin-top: 0.75rem;
}

.add-field-form {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.add-field-form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #0b2417;
}

.add-field-form input {
  min-height: 2.75rem;
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  border: 1px solid rgba(16, 37, 26, 0.14);
  font: inherit;
  font-weight: 500;
}

.coord-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.fields-list {
  display: grid;
  gap: 0.65rem;
}

.field-card {
  display: grid;
  gap: 0.25rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: #eef6f1;
  border: 1px solid rgba(16, 37, 26, 0.08);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.field-card:hover {
  border-color: rgba(63, 154, 99, 0.45);
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(6, 22, 14, 0.1);
  background: #f5fbf7;
}

.field-card:active {
  transform: translateY(-1px) scale(0.99);
}

.field-card strong {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.1rem;
  color: #0b2417;
}

.field-card span {
  font-size: 0.88rem;
  color: #3a5646;
}

/* Destination pin for field placement (replaces broken Leaflet PNG box) */
.ps-map-pin {
  background: transparent !important;
  border: 0 !important;
  width: 44px !important;
  height: 56px !important;
}

.ps-map-pin__bubble {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0 auto;
  border-radius: 50%;
  background: #0b2417;
  border: 3px solid #fff;
  box-shadow: 0 8px 18px rgba(6, 22, 14, 0.35);
  transition: background 0.2s ease, transform 0.2s ease;
}

.ps-map-pin__logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
  border-radius: 50%;
}

.ps-map-pin__tip {
  display: block;
  width: 0;
  height: 0;
  margin: -2px auto 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 14px solid #0b2417;
  filter: drop-shadow(0 3px 2px rgba(6, 22, 14, 0.25));
  transition: border-top-color 0.2s ease;
}

.ps-map-pin--pending .ps-map-pin__bubble {
  background: #1a4a33;
  animation: psPinPulse 1.2s ease-in-out infinite;
}

.ps-map-pin--pending .ps-map-pin__tip {
  border-top-color: #1a4a33;
}

.ps-map-pin--ok .ps-map-pin__bubble {
  background: #2f855a;
}

.ps-map-pin--ok .ps-map-pin__tip {
  border-top-color: #2f855a;
}

.ps-map-pin--error .ps-map-pin__bubble {
  background: #9b2c2c;
}

.ps-map-pin--error .ps-map-pin__tip {
  border-top-color: #9b2c2c;
}

@keyframes psPinPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ps-map-pin--pending .ps-map-pin__bubble {
    animation: none;
  }
}

/* Tomorrow.io hyperlocal weather */
.tmrw-card {
  margin: 0 0 1.15rem;
  padding: 1rem 1.05rem;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(232, 245, 238, 0.95), rgba(255, 255, 255, 0.92));
  border: 1px solid rgba(16, 37, 26, 0.1);
}
.tmrw-head h3 {
  margin: 0.15rem 0 0.35rem;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.35rem;
  color: #0b2417;
}
.tmrw-now {
  display: grid;
  grid-template-columns: minmax(140px, 0.7fr) 1.3fr;
  gap: 0.85rem;
  align-items: center;
  margin: 0.85rem 0 1rem;
}
.tmrw-now-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #3f9a63;
}
.tmrw-now-temp {
  display: block;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(2rem, 4vw, 2.6rem);
  line-height: 1;
  color: #0b2417;
}
.tmrw-section-title {
  margin: 1rem 0 0.5rem;
  font-size: 0.95rem;
  color: #1a4a33;
}
.tmrw-hours {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(108px, 1fr);
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scroll-snap-type: x proximity;
}
.tmrw-hour,
.tmrw-day {
  scroll-snap-align: start;
  padding: 0.65rem 0.7rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(16, 37, 26, 0.1);
  display: grid;
  gap: 0.2rem;
}
.tmrw-hour time,
.tmrw-day time {
  font-size: 0.78rem;
  font-weight: 700;
  color: #3a5646;
}
.tmrw-hour strong,
.tmrw-day strong {
  font-size: 1.05rem;
  color: #0b2417;
}
.tmrw-meta {
  font-size: 0.75rem;
  color: #3a5646;
}
.tmrw-days {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.55rem;
}
.tmrw-advice-grid {
  display: grid;
  gap: 0.55rem;
}
.tmrw-advice {
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(16, 37, 26, 0.1);
  background: #fff;
}
.tmrw-advice h4 {
  margin: 0 0 0.25rem;
  font-size: 0.98rem;
}
.tmrw-advice p {
  margin: 0;
  color: #3a5646;
  font-size: 0.9rem;
}
.tmrw-advice ul {
  margin: 0.45rem 0 0;
  padding-left: 1.1rem;
  color: #1a4a33;
  font-size: 0.85rem;
}
.tmrw-advice.is-ok {
  border-color: rgba(47, 133, 90, 0.35);
  background: #f0fff4;
}
.tmrw-advice.is-watch {
  border-color: rgba(214, 158, 46, 0.4);
  background: #fffaf0;
}
.tmrw-advice.is-action {
  border-color: rgba(197, 48, 48, 0.35);
  background: #fff5f5;
}
.tmrw-banner {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: #fffaf0;
  border: 1px solid rgba(214, 158, 46, 0.4);
}
.tmrw-banner p {
  margin: 0.35rem 0 0;
}
.tmrw-stats {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.tmrw-block {
  margin-top: 0.85rem;
}
.tmrw-note {
  margin: 0.5rem 0 0;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  background: #fffaf0;
  border: 1px solid rgba(214, 158, 46, 0.35);
  color: #7b341e;
  font-size: 0.9rem;
}
.tmrw-fields {
  margin-top: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(16, 37, 26, 0.1);
}
.tmrw-fields summary {
  cursor: pointer;
  font-weight: 700;
  color: #1a4a33;
}
.tmrw-field-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.25rem 0.75rem;
  margin: 0.65rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.82rem;
}
.tmrw-field-list code {
  font-size: 0.78rem;
  color: #276749;
}
.tmrw-hour {
  min-width: 118px;
}
@media (max-width: 720px) {
  .tmrw-now {
    grid-template-columns: 1fr;
  }
}

.empty-state {
  padding: 1.25rem 0.25rem 0.5rem;
  color: #3a5646;
  animation: emptyPulse 2.8s ease-in-out infinite;
}

@keyframes emptyPulse {
  0%,
  100% {
    opacity: 0.85;
  }
  50% {
    opacity: 1;
  }
}

.empty-state strong {
  display: block;
  margin-bottom: 0.35rem;
  color: #0b2417;
  font-size: 1.05rem;
}

.empty-state[hidden] { display: none !important; }

/* ---- Tabs ---- */
.app-tab-btn {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  color: #3a5646;
  cursor: pointer;
  padding: 0.35rem 0.1rem;
  border-bottom: 2px solid transparent;
  position: relative;
}
.app-tab-btn.is-active {
  color: #0b2417;
  border-bottom-color: #3f9a63;
}
.alert-badge {
  display: inline-grid;
  place-items: center;
  min-width: 1.3rem;
  height: 1.3rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #c53030;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  margin-left: 0.3rem;
}
.app-tab-panel[hidden] { display: none; }

/* ---- Field cards ---- */
.field-card {
  display: grid;
  gap: 0.3rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: #eef6f1;
  border: 1px solid rgba(16, 37, 26, 0.08);
  border-left: 4px solid #3f9a63;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.field-card:hover { transform: translateY(-1px); border-left-color: #62c084; }
.field-card.level-action { border-left-color: #c53030; background: #fff7f7; }
.field-card.level-watch  { border-left-color: #b7791f; background: #fffaf0; }
.field-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}
.field-card-head strong { font-family: "Fraunces", Georgia, serif; font-size: 1.1rem; color: #0b2417; }
.field-card-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.field-card-badge.level-action { background: #fed7d7; color: #9b2c2c; }
.field-card-badge.level-watch  { background: #fefcbf; color: #744210; }
.field-card-badge.level-info   { background: #c6f6d5; color: #22543d; }
.field-card-meta { font-size: 0.88rem; color: #3a5646; }
.field-card {
  position: relative;
  display: grid;
  gap: 0.45rem;
}
.field-card-link {
  display: grid;
  gap: 0.3rem;
  text-decoration: none;
  color: inherit;
}
.field-delete-btn {
  justify-self: start;
  margin-top: 0.15rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid rgba(197, 48, 48, 0.35);
  border-radius: 999px;
  background: #fff5f5;
  color: #9b2c2c;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.field-delete-btn:hover:not(:disabled) {
  background: #fed7d7;
  border-color: #c53030;
}
.field-delete-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ---- Insight card ---- */
.insight-card-wrap { margin-bottom: 1.25rem; }
.insight-card {
  padding: 1.35rem 1.25rem 1.1rem;
  border-radius: 18px;
  border-left: 5px solid #3f9a63;
  background: #eef6f1;
}
.insight-action { border-left-color: #c53030; background: #fff5f5; }
.insight-watch  { border-left-color: #d69e2e; background: #fffff0; }
.insight-info   { border-left-color: #3f9a63; background: #eef6f1; }
.insight-level {
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.insight-action .insight-level { color: #c53030; }
.insight-watch  .insight-level { color: #b7791f; }
.insight-info   .insight-level { color: #276749; }
.insight-title {
  margin: 0 0 0.4rem;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  color: #0b2417;
  line-height: 1.2;
}
.insight-message { margin: 0 0 0.85rem; color: #2d5016; }
.insight-action-line {
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  background: rgba(11, 36, 23, 0.06);
  color: #0b2417;
  font-weight: 700;
  font-size: 0.95rem;
}
.insight-confidence {
  margin: 0 0 0.85rem;
}
.insight-confidence-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: #3a5646;
  margin-bottom: 0.35rem;
}
.insight-confidence-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(11, 36, 23, 0.1);
  overflow: hidden;
}
.insight-confidence-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #2f855a, #38a169);
  border-radius: inherit;
  transition: width 0.35s ease;
}
.insight-why {
  margin: 0 0 0.75rem;
  color: #3a5646;
  font-size: 0.92rem;
  line-height: 1.45;
}
.insight-factors {
  margin: 0;
  padding: 0 0 0 1.15rem;
  color: #3a5646;
  font-size: 0.92rem;
  display: grid;
  gap: 0.25rem;
}
.insight-evidence {
  margin: 0.85rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(11, 36, 23, 0.08);
  font-size: 0.88rem;
  color: #3a5646;
}
.insight-evidence-title {
  margin: 0 0 0.35rem;
  font-weight: 700;
  color: #0b2417;
}
.insight-evidence ul {
  margin: 0;
  padding: 0 0 0 1.1rem;
  display: grid;
  gap: 0.2rem;
}
.insight-evidence span { color: #718096; }
.insight-provenance {
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  color: #4a5568;
  line-height: 1.4;
}
.insight-age { margin: 0.55rem 0 0; font-size: 0.82rem; color: #718096; }

.continue-banner {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin: 0 0 1rem;
  padding: 0.9rem 1.05rem;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(135deg, #e8f5ee, #f4faf6);
  border: 1px solid rgba(47, 133, 90, 0.25);
}
.continue-banner[hidden] { display: none !important; }
.continue-kicker {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #276749;
}
.continue-banner strong {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.15rem;
  color: #0b2417;
}

.insight-rules {
  margin: 0.85rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(11, 36, 23, 0.08);
  font-size: 0.86rem;
  color: #3a5646;
}
.rule-trace-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.rule-trace-list li {
  display: grid;
  gap: 0.15rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
}
.rule-fired { border-left: 3px solid #c53030; }
.rule-quiet { border-left: 3px solid #a0aec0; opacity: 0.85; }
.rule-flag {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #718096;
}
.rule-fired .rule-flag { color: #c53030; }
.rule-cond { color: #4a5568; font-family: ui-monospace, monospace; font-size: 0.78rem; }
.rule-reason { color: #2d5016; }

.sensitivity-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem;
  align-items: center;
  margin: 0.9rem 0 0;
  font-size: 0.86rem;
  color: #3a5646;
}
.sensitivity-row input[type="range"] { width: 100%; }

.health-map { min-height: 220px; margin: 0.75rem 0; border-radius: 14px; }
.health-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0; }
.health-scrub { margin: 0.75rem 0; }
.health-scrub label { display: grid; gap: 0.35rem; font-size: 0.86rem; color: #3a5646; }
.org-role-pick { display: grid; gap: 0.25rem; font-size: 0.78rem; margin-top: 0.35rem; }
.org-role-pick select {
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(16,37,26,0.15);
}
.auth-phone-stack { margin-bottom: 0.75rem; }
.auth-phone-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ---- Field tool buttons (one panel at a time) ---- */
.field-tools {
  margin: 1.15rem 0 0.65rem;
}
.field-tools-label {
  margin: 0 0 0.55rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #3a5646;
}
.field-tools-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}
.field-tool-btn {
  appearance: none;
  border: 1px solid rgba(16, 37, 26, 0.12);
  background: #fff;
  border-radius: 14px;
  padding: 0.8rem 0.85rem;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 0.2rem;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, color 0.18s ease;
  min-height: 4.4rem;
}
.field-tool-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(47, 133, 90, 0.45);
  background: #f4faf6;
}
.field-tool-btn.is-active {
  background: #1f6b45;
  border-color: #1f6b45;
  color: #fff;
  box-shadow: 0 8px 18px rgba(31, 107, 69, 0.28);
}
.field-tool-btn.is-active .field-tool-title,
.field-tool-btn.is-active .field-tool-desc {
  color: #ffffff;
}
.field-tool-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: inherit;
  line-height: 1.2;
}
.field-tool-btn:not(.is-active) .field-tool-title { color: #0b2417; }
.field-tool-desc {
  font-size: 0.76rem;
  line-height: 1.3;
  color: #3a5646;
}
.field-tool-btn.is-active .field-tool-desc {
  color: rgba(255, 255, 255, 0.88);
}
.field-tool-hint {
  margin: 0.35rem 0 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: #f4faf6;
  border: 1px dashed rgba(47, 133, 90, 0.35);
  color: #3a5646;
  font-size: 0.9rem;
}
.field-tool-panel {
  animation: fieldToolIn 0.28s ease;
  margin-bottom: 1.1rem;
}
@keyframes fieldToolIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 900px) {
  .field-tools-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .field-tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- Crop guide / harvest / inputs / markets ---- */
.crop-plan-form,
.field-input-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  margin: 0.75rem 0 1rem;
}
.crop-plan-form label,
.field-input-form label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.86rem;
  color: #3a5646;
}
.crop-plan-form input,
.field-input-form input,
.field-input-form select {
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(11, 36, 23, 0.15);
  border-radius: 10px;
  font: inherit;
  background: #fff;
}
.crop-plan-form button,
.field-input-form button {
  grid-column: 1 / -1;
  justify-self: start;
}
.field-input-form .span-2 { grid-column: 1 / -1; }
.crop-guide-hero {
  margin: 0.5rem 0 0.85rem;
  padding: 1rem 1.05rem;
  border-radius: 16px;
  background:
    radial-gradient(circle at 12% 20%, rgba(63,154,99,0.16), transparent 42%),
    linear-gradient(145deg, #f4faf6, #e8f2ec);
  border: 1px solid rgba(47, 133, 90, 0.18);
}
.crop-guide-hero h3 {
  margin: 0.15rem 0 0.4rem;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.45rem;
  color: #0b2417;
}
.crop-guide-hero p { margin: 0; color: #3a5646; }
.crop-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 1rem;
}
.crop-meta-grid > div,
.harvest-stats > div {
  padding: 0.65rem 0.7rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(16,37,26,0.08);
  display: grid;
  gap: 0.2rem;
}
.crop-meta-grid span,
.harvest-stats span {
  font-size: 0.74rem;
  color: #3a5646;
  font-weight: 600;
}
.crop-meta-grid strong,
.harvest-stats strong {
  font-size: 0.92rem;
  color: #0b2417;
}
.crop-guide-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  margin-bottom: 0.85rem;
}
.crop-guide-columns h4,
.crop-tips-block h4 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  color: #0b2417;
}
.crop-rec-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.crop-rec-list li {
  padding: 0.6rem 0.7rem;
  border-radius: 12px;
  background: #f7fbf8;
  border: 1px solid rgba(16,37,26,0.08);
  display: grid;
  gap: 0.1rem;
}
.crop-rec-list strong { color: #0b2417; font-size: 0.9rem; }
.crop-rec-list span { color: #2f855a; font-size: 0.78rem; font-weight: 700; }
.crop-rec-list small { color: #3a5646; font-size: 0.76rem; }
.crop-tips-block ul {
  margin: 0 0 0.55rem;
  padding-left: 1.1rem;
  color: #3a5646;
}
.harvest-card {
  margin-top: 1rem;
  padding: 1rem 1.05rem;
  border-radius: 16px;
  border-left: 5px solid #2f855a;
  background: #eef6f1;
}
.harvest-card.harvest-soon { border-left-color: #d69e2e; background: #fffff0; }
.harvest-card.harvest-due { border-left-color: #c53030; background: #fff5f5; }
.harvest-card h3 {
  margin: 0.15rem 0 0.35rem;
  font-family: "Fraunces", Georgia, serif;
  color: #0b2417;
}
.harvest-progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(11,36,23,0.08);
  overflow: hidden;
  margin: 0.75rem 0;
}
.harvest-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f855a, #68d391);
  transition: width 0.45s ease;
}
.harvest-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.usage-list {
  list-style: none;
  margin: 0.85rem 0 0.35rem;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.usage-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(16,37,26,0.1);
}
.usage-row > div:first-child {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}
.usage-row strong { color: #0b2417; }
.usage-row span,
.usage-row small { color: #3a5646; font-size: 0.8rem; }
.usage-side {
  display: grid;
  justify-items: end;
  gap: 0.25rem;
  flex-shrink: 0;
}
.usage-total {
  margin: 0.55rem 0 0;
  font-weight: 700;
  color: #0b2417;
}
.market-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.75rem;
}
.market-card {
  display: flex;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  background:
    linear-gradient(120deg, rgba(247,251,248,0.95), rgba(238,246,241,0.9));
  border: 1px solid rgba(16,37,26,0.1);
}
.market-card h3 {
  margin: 0 0 0.2rem;
  font-size: 1rem;
  color: #0b2417;
}
.market-card p { margin: 0; font-size: 0.82rem; color: #3a5646; }
.market-goods { margin-top: 0.25rem !important; font-weight: 600; color: #2f855a !important; }
.market-side {
  display: grid;
  justify-items: end;
  align-content: center;
  gap: 0.3rem;
  flex-shrink: 0;
}
.market-side strong { color: #0b2417; }
.market-side a {
  color: #2f855a;
  font-weight: 700;
  font-size: 0.82rem;
  text-decoration: none;
}
.market-side a:hover { text-decoration: underline; }
#marketMspNote a { color: #2f855a; font-weight: 700; }

@media (max-width: 860px) {
  .crop-meta-grid,
  .harvest-stats,
  .crop-guide-columns,
  .crop-plan-form,
  .field-input-form {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 560px) {
  .crop-meta-grid,
  .harvest-stats,
  .crop-guide-columns,
  .crop-plan-form,
  .field-input-form {
    grid-template-columns: 1fr;
  }
  .market-card,
  .usage-row {
    flex-direction: column;
  }
  .market-side,
  .usage-side {
    justify-items: start;
    flex-direction: row;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }
}

.scenario-form,
.feedback-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  margin-top: 0.75rem;
}
.scenario-form label,
.feedback-form label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.86rem;
  color: #3a5646;
}
.scenario-form input,
.scenario-form select,
.feedback-form input,
.feedback-form textarea {
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(11, 36, 23, 0.15);
  border-radius: 10px;
  font: inherit;
  background: #fff;
}
.feedback-form textarea { resize: vertical; }
.scenario-form button,
.feedback-form button { grid-column: 1 / -1; justify-self: start; }
.check-row {
  grid-column: 1 / -1;
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
}
.scenario-result {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: #f4faf6;
  border: 1px solid rgba(47, 133, 90, 0.2);
}
.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}
.scenario-grid div {
  display: grid;
  gap: 0.15rem;
}
.scenario-grid span {
  font-size: 0.75rem;
  color: #718096;
}
.scenario-grid strong {
  color: #0b2417;
  font-size: 1.05rem;
}
@media (max-width: 720px) {
  .scenario-form,
  .feedback-form,
  .scenario-grid { grid-template-columns: 1fr; }
}

.bulk-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 0.45rem;
}
.bulk-hint {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
}
.bulk-hint code {
  font-size: 0.78rem;
  background: rgba(11, 36, 23, 0.06);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}
.bulk-upload {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

/* White-label hooks (4.3) — tenant.js sets --tenant-* */
:root {
  --tenant-primary: #1f6b45;
  --tenant-accent: #c4a35a;
}
.app-btn-primary {
  background: var(--tenant-primary, #1f6b45);
  color: #ffffff;
}
.continue-kicker {
  color: var(--tenant-primary, #276749);
}

/* Accessibility modes (5.4) */
html.a11y-large {
  font-size: 118%;
}
html.a11y-contrast body,
html.a11y-contrast .app-body {
  filter: contrast(1.12);
}
html.a11y-contrast .insight-card,
html.a11y-contrast .app-panel {
  border: 2px solid #0b2417;
}
html.a11y-simple .app-muted,
html.a11y-simple .app-kicker,
html.a11y-simple .insight-provenance,
html.a11y-simple .insight-evidence,
html.a11y-simple .insight-rules {
  display: none !important;
}
html.a11y-simple h1,
html.a11y-simple h2 {
  font-size: 1.35em;
  line-height: 1.25;
}

/* Onboarding (7.1) */
.onboard-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(8, 24, 16, 0.45);
  display: grid;
  place-items: end center;
  padding: 1.25rem;
}
.onboard-card {
  width: min(440px, 100%);
  background: #fff;
  border-radius: 16px;
  padding: 1.15rem 1.2rem 1rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}
.onboard-step {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #276749;
}
.onboard-card h2 {
  margin: 0 0 0.4rem;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.35rem;
  color: #0b2417;
}
.onboard-card p { margin: 0 0 0.9rem; color: #3a5646; }
.onboard-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}
.onboard-highlight {
  outline: 3px solid #38a169;
  outline-offset: 4px;
  border-radius: 12px;
  position: relative;
  z-index: 1;
}

/* Safety (5.3) */
.safety-banner {
  margin: 0 0 1rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: #fffaf0;
  border: 1px solid #d69e2e;
}
.safety-banner.is-high {
  background: #fff5f5;
  border-color: #c53030;
}
.safety-banner.is-confirmed {
  opacity: 0.7;
}
.safety-banner strong { display: block; margin-bottom: 0.35rem; color: #0b2417; }
.safety-banner p { margin: 0 0 0.45rem; color: #3a5646; font-size: 0.92rem; }
.safety-disclaimer { font-size: 0.8rem !important; color: #718096 !important; }

.field-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.alert-priority {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #718096;
}
.alert-mute-note { margin: 0 0 0.75rem; }

@media print {
  .app-top,
  .field-top-row,
  .field-actions-row,
  #refreshBtn,
  #loadTrendsBtn,
  #feedbackPanel,
  #scenarioForm,
  .sensitivity-row,
  .onboard-overlay { display: none !important; }
  .app-main { padding: 0; }
  .insight-card, .app-panel { break-inside: avoid; }
}

/* ---- Metrics grid ---- */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}
.metric-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.9rem 0.95rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(16, 37, 26, 0.09);
}
.metric-label { font-size: 0.78rem; font-weight: 700; color: #3a5646; letter-spacing: 0.04em; }
.metric-value { font-family: "Fraunces", Georgia, serif; font-size: 1.6rem; font-weight: 600; color: #0b2417; line-height: 1; }
.metric-unit  { font-size: 0.78rem; color: #718096; }

/* ---- Satellite row ---- */
.satellite-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(16, 37, 26, 0.08);
  margin-bottom: 1.1rem;
  font-size: 0.88rem;
}
.sat-label { font-weight: 700; color: #3a5646; }
.sat-chip { padding: 0.2rem 0.65rem; border-radius: 999px; font-weight: 700; font-size: 0.82rem; }
.sat-on  { background: #c6f6d5; color: #22543d; }
.sat-off { background: #e2e8f0; color: #4a5568; }
.sat-note { color: #718096; font-size: 0.82rem; }

/* ---- Alerts ---- */
.alerts-list { display: grid; gap: 0.75rem; }
.alert-item {
  padding: 0.95rem 1rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(16, 37, 26, 0.09);
  border-left: 4px solid #3f9a63;
}
.alert-item.level-action { border-left-color: #c53030; background: #fff5f5; }
.alert-item.level-watch  { border-left-color: #d69e2e; background: #fffff0; }
.alert-item.is-read { opacity: 0.6; }
.alert-item-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}
.alert-item-head strong { font-size: 1rem; color: #0b2417; }
.alert-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 999px;
  background: #3f9a63;
  flex-shrink: 0;
}
.alert-dot.level-action { background: #c53030; }
.alert-dot.level-watch  { background: #d69e2e; }
.alert-when { margin-left: auto; font-size: 0.82rem; color: #718096; }
.alert-msg { margin: 0 0 0.75rem; color: #3a5646; font-size: 0.95rem; }
.alert-actions { display: flex; gap: 0.55rem; flex-wrap: wrap; }
.alert-goto { font-size: 0.85rem; min-height: 2.2rem; }
.mark-read-btn { font-size: 0.85rem; min-height: 2.2rem; }

/* ---- Field detail extras ---- */
.field-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.field-map-panel { margin-top: 1.1rem; }
.field-map-panel h2 { margin-bottom: 0.5rem; }

.field-facts { display: grid; gap: 0.5rem; margin: 0.9rem 0 0; }
.field-facts div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(16, 37, 26, 0.07);
  font-size: 0.92rem;
}
.field-facts dt { margin: 0; color: #3a5646; font-weight: 600; }
.field-facts dd { margin: 0; color: #0b2417; font-weight: 700; text-align: right; }

/* ---- Trends / forecast ---- */
.trends-panel { margin: 1.1rem 0; }
.outlook-card {
  margin: 0.85rem 0 1rem;
  padding: 1.15rem 1.2rem;
  border-radius: 18px;
  border-left: 5px solid #3f9a63;
  background: linear-gradient(135deg, #eef8f1, #ffffff);
}
.outlook-drying { border-left-color: #c05621; background: linear-gradient(135deg, #fffaf0, #fff); }
.outlook-wetting { border-left-color: #2b6cb0; background: linear-gradient(135deg, #ebf8ff, #fff); }
.outlook-warming { border-left-color: #c53030; background: linear-gradient(135deg, #fff5f5, #fff); }
.outlook-kicker {
  margin: 0 0 0.3rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #3f9a63;
}
.outlook-card h3 {
  margin: 0 0 0.4rem;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.45rem;
  color: #0b2417;
}
.outlook-card p { margin: 0; color: #3a5646; }
.outlook-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.95rem;
}
.outlook-stats div {
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  background: rgba(255,255,255,0.8);
  border: 1px solid rgba(16,37,26,0.08);
}
.outlook-stats span { display: block; font-size: 0.78rem; font-weight: 700; color: #3a5646; }
.outlook-stats strong {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.25rem;
  color: #0b2417;
}

.trend-explanations {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.trend-pill {
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  background: #eef6f1;
  border: 1px solid rgba(16,37,26,0.08);
  font-size: 0.86rem;
  font-weight: 600;
  color: #0b2417;
}

.chart-block { margin-bottom: 0.85rem; }
.chart-legend {
  display: flex;
  gap: 0.85rem;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #3a5646;
}
.leg.past::before, .leg.future::before {
  content: "";
  display: inline-block;
  width: 1rem;
  height: 3px;
  margin-right: 0.35rem;
  vertical-align: middle;
  border-radius: 2px;
}
.leg.past::before { background: #0b2417; }
.leg.future::before { background: #3f9a63; }

/* ---- Satellite archive (MODIS / SMAP / HLS) ---- */
.sat-archive-panel { margin-bottom: 1.25rem; }
.sat-archive-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 0.85rem 0 1rem;
}
.sat-archive-controls label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #3a5646;
}
.sat-archive-controls select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(16,37,26,0.14);
  background: #fff;
  color: #0b2417;
  font: inherit;
}
.sat-catalog {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}
.sat-catalog-chip {
  appearance: none;
  border: 1px solid rgba(16,37,26,0.12);
  background: #f4faf6;
  color: #0b2417;
  border-radius: 12px;
  padding: 0.55rem 0.75rem;
  display: grid;
  gap: 0.15rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.sat-catalog-chip:hover { transform: translateY(-1px); border-color: rgba(63,154,99,0.45); }
.sat-catalog-chip.is-active {
  background: #2f855a;
  border-color: #2f855a;
  color: #fff;
}
.sat-catalog-chip strong { font-size: 0.82rem; }
.sat-catalog-chip span { font-size: 0.74rem; opacity: 0.85; }
.sat-archive-layout {
  display: grid;
  grid-template-columns: minmax(11rem, 15rem) minmax(0, 1fr);
  gap: 0.9rem;
  align-items: stretch;
}
.sat-granule-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 22rem;
  overflow-y: auto;
  padding-right: 0.2rem;
}
.sat-granule {
  appearance: none;
  border: 1px solid rgba(16,37,26,0.1);
  background: #fff;
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  display: grid;
  gap: 0.15rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.sat-granule:hover { border-color: rgba(63,154,99,0.4); }
.sat-granule.is-active {
  background: #eef6f1;
  border-color: #2f855a;
}
.sat-granule strong { font-size: 0.9rem; color: #0b2417; }
.sat-granule span { font-size: 0.74rem; color: #3a5646; line-height: 1.3; }
.sat-granule small { font-size: 0.7rem; color: #2f855a; font-weight: 700; }
.sat-browse-pane {
  min-height: 16rem;
  border-radius: 16px;
  border: 1px solid rgba(16,37,26,0.1);
  background:
    radial-gradient(circle at 20% 15%, rgba(63,154,99,0.12), transparent 45%),
    linear-gradient(160deg, #f7fbf8, #eef4f0 70%, #e7f0ea);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.sat-browse-empty {
  margin: 0;
  padding: 1.5rem;
  text-align: center;
  color: #3a5646;
  font-size: 0.92rem;
  max-width: 22rem;
}
.sat-browse-figure {
  margin: 0;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto auto;
  animation: satFade 0.45s ease;
}
.sat-browse-figure img {
  width: 100%;
  max-height: 20rem;
  object-fit: contain;
  background: #0b2417;
  display: block;
}
.sat-browse-figure figcaption,
.sat-browse-links {
  margin: 0;
  padding: 0.65rem 0.85rem;
  font-size: 0.82rem;
  color: #3a5646;
  background: rgba(255,255,255,0.92);
}
.sat-browse-links a {
  color: #2f855a;
  font-weight: 700;
  text-decoration: none;
}
.sat-browse-links a:hover { text-decoration: underline; }
.sat-archive-status {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: #3a5646;
  min-height: 1.2em;
}
@keyframes satFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 860px) {
  .sat-archive-layout { grid-template-columns: 1fr; }
  .sat-granule-list {
    flex-direction: row;
    max-height: none;
    overflow-x: auto;
    padding-bottom: 0.25rem;
  }
  .sat-granule { min-width: 10.5rem; }
  .sat-archive-controls { grid-template-columns: 1fr; }
}

.chart-wrap {
  position: relative;
  width: 100%;
}
.trend-chart {
  width: 100%;
  height: auto;
  display: block;
  background: #f7fbf8;
  border-radius: 14px;
  border: 1px solid rgba(16,37,26,0.08);
  cursor: crosshair;
  touch-action: pan-y;
  overflow: visible;
}
.chart-plot-bg {
  fill: rgba(255, 255, 255, 0.55);
}
.chart-grid-h {
  stroke: rgba(16, 37, 26, 0.1);
  stroke-width: 1;
  shape-rendering: crispEdges;
  pointer-events: none;
}
.chart-grid-h.is-zero {
  stroke: rgba(16, 37, 26, 0.22);
  stroke-width: 1.25;
}
.chart-grid-v {
  stroke: rgba(16, 37, 26, 0.06);
  stroke-width: 1;
  shape-rendering: crispEdges;
  pointer-events: none;
}
.chart-axis-line {
  stroke: rgba(16, 37, 26, 0.35);
  stroke-width: 1.25;
  shape-rendering: crispEdges;
  pointer-events: none;
}
.chart-axis-y,
.chart-axis-x,
.chart-unit-label,
.chart-forecast-label {
  fill: #3a5646;
  font-size: 9px;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-weight: 600;
  pointer-events: none;
  user-select: none;
}
.chart-unit-label {
  fill: #2f855a;
  font-size: 9px;
  font-weight: 700;
}
.chart-forecast-divider {
  stroke: #3f9a63;
  stroke-width: 1.25;
  stroke-dasharray: 4 3;
  opacity: 0.85;
  pointer-events: none;
}
.chart-forecast-label {
  fill: #2f855a;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.chart-line { stroke-linecap: round; stroke-linejoin: round; }
.past-line { stroke-dasharray: 400; stroke-dashoffset: 400; animation: drawLine 1.1s ease forwards; }
.future-line { opacity: 0; animation: fadeIn 0.6s ease 0.7s forwards; }
.chart-point {
  opacity: 0;
  transform-origin: center;
  animation: fadeIn 0.35s ease 0.85s forwards;
  transition: r 0.15s ease, opacity 0.15s ease;
}
.chart-point.is-active {
  opacity: 1;
  r: 5.5;
  stroke: #fff;
  stroke-width: 2;
}
.chart-hit { cursor: pointer; outline: none; }
.chart-crosshair {
  pointer-events: none;
  transition: opacity 0.12s ease;
}
.chart-tooltip {
  position: absolute;
  z-index: 3;
  transform: translate(-50%, -110%);
  min-width: 7.5rem;
  max-width: 12rem;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  background: #0b2417;
  color: #f7fbf8;
  box-shadow: 0 8px 22px rgba(11, 36, 23, 0.28);
  pointer-events: none;
  display: grid;
  gap: 0.12rem;
  animation: chartTipIn 0.16s ease;
}
.chart-tooltip strong {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #a8d5b8;
}
.chart-tip-value {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;
  color: #fff;
}
.chart-tip-meta {
  font-size: 0.74rem;
  color: rgba(247, 251, 248, 0.78);
}
@keyframes chartTipIn {
  from { opacity: 0; transform: translate(-50%, -95%); }
  to { opacity: 1; transform: translate(-50%, -110%); }
}

.history-strip { margin-top: 1rem; }
.history-strip h3 {
  margin: 0 0 0.55rem;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.1rem;
  color: #0b2417;
}
.history-track {
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
}
.history-chip {
  min-width: 7.5rem;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(16,37,26,0.1);
  display: grid;
  gap: 0.2rem;
}
.history-chip strong { font-size: 0.9rem; color: #0b2417; }
.history-chip span { font-size: 0.78rem; color: #3a5646; }

.reveal-up {
  opacity: 0;
  transform: translateY(10px);
  animation: riseIn 0.55s ease forwards;
}

@keyframes drawLine {
  to { stroke-dashoffset: 0; }
}
@keyframes fadeIn {
  to { opacity: 1; }
}
@keyframes riseIn {
  to { opacity: 1; transform: none; }
}

/* ---- India localization pack ---- */
.india-provider-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.sat-chip.is-ok {
  background: #e8f5ee;
  color: #1f6b45;
  border: 1px solid rgba(31, 107, 69, 0.25);
}

.sat-chip.is-warn {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid rgba(154, 52, 18, 0.22);
}

.india-pack .urtc-card {
  margin-bottom: 0.75rem;
}

.india-json {
  margin: 0;
  max-height: 14rem;
  overflow: auto;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: #f4faf6;
  border: 1px solid rgba(16, 37, 26, 0.08);
  font-size: 0.78rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.india-table-wrap {
  overflow-x: auto;
}

.india-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.india-table th,
.india-table td {
  text-align: left;
  padding: 0.55rem 0.45rem;
  border-bottom: 1px solid rgba(16, 37, 26, 0.08);
  vertical-align: top;
}

.india-scene-list,
.india-scheme-list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.45rem;
}

.india-mandi-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto auto;
  gap: 0.45rem 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(16, 37, 26, 0.07);
  font-size: 0.9rem;
}

@media (max-width: 720px) {
  .india-mandi-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* Social hub */
.social-shell {
  width: min(1120px, calc(100% - 2rem));
}

.social-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
  padding: 0.35rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(16, 37, 26, 0.08);
}

.social-tab {
  border: 0;
  background: transparent;
  color: #3a5646;
  border-radius: 12px;
  padding: 0.7rem 1.15rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.social-tab:hover {
  background: rgba(232, 245, 238, 0.95);
  color: #0b2417;
}

.social-tab.is-active {
  background: #0b2417;
  color: #f4faf6;
  box-shadow: 0 8px 20px rgba(11, 36, 23, 0.18);
}

.social-panel[hidden] {
  display: none !important;
}

.social-panel-hero {
  margin-bottom: 1rem;
}

.social-panel-hero h2 {
  margin: 0.25rem 0 0.45rem;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  letter-spacing: -0.02em;
  color: #0b2417;
}

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .app-grid { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .app-page-head { flex-direction: column; }
  .app-btn-primary, .app-btn-danger { width: 100%; }
  .field-top-row { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .outlook-stats { grid-template-columns: 1fr; }
}
