:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --text: #111827;
  --muted: #667085;
  --subtle: #98a2b3;
  --line: #e5e7eb;
  --green: #159947;
  --green-deep: #087a35;
  --green-soft: #e8f7ee;
  --blue: #2563eb;
  --orange: #f59e0b;
  --red: #dc2626;
  --yellow: #a3c30f;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}

.is-hidden {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
select,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.app {
  min-height: 100vh;
}

.topbar {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 300px;
  min-width: 300px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  position: relative;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 62%, #e7f8ec 0 40%, transparent 41%);
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  bottom: 8px;
  width: 16px;
  height: 30px;
  border-radius: 16px 16px 4px 16px;
  background: var(--green);
  transform-origin: bottom center;
}

.brand-mark::before {
  left: 10px;
  transform: rotate(-36deg);
}

.brand-mark::after {
  right: 10px;
  transform: rotate(36deg);
}

.brand h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.toolbar-field,
.date-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.toolbar-field span {
  color: #344054;
  font-weight: 700;
  white-space: nowrap;
}

.toolbar select,
.toolbar input,
.left-panel select,
.left-panel input {
  height: 42px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  outline: none;
}

.toolbar select {
  min-width: 144px;
  padding: 0 12px;
}

.toolbar input {
  min-width: 160px;
  padding: 0 12px;
}

.date-field {
  height: 42px;
  padding: 0 10px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #fff;
}

.date-field input {
  height: 36px;
  min-width: 154px;
  padding: 0;
  border: 0;
}

.calendar-dot {
  width: 18px;
  height: 18px;
  display: inline-block;
  border: 2px solid var(--green);
  border-radius: 4px;
  position: relative;
}

.calendar-dot::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 5px;
  height: 2px;
  background: var(--green);
}

.icon-btn {
  width: 42px;
  height: 42px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  font-size: 26px;
  line-height: 1;
}

.icon-btn.ghost {
  font-size: 18px;
  color: #1f2937;
}

.display-toggle-btn {
  height: 42px;
  padding: 0 14px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.display-toggle-btn.active {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.user-chip {
  height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #344054;
  white-space: nowrap;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #159947, #43c978);
  position: relative;
}

.avatar::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 11px 0 3px #fff;
}

.workspace {
  display: grid;
  grid-template-columns: 280px minmax(420px, 1fr) 420px;
  gap: 14px;
  padding: 16px;
  align-items: start;
}

.left-panel,
.right-panel {
  display: grid;
  gap: 14px;
}

.control-card,
.detail-card,
.chart-card,
.map-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.control-card,
.detail-card {
  padding: 16px;
}

.right-panel .detail-card {
  padding: 18px;
}

.control-card h2,
.detail-card h2,
.chart-head h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #111827;
  font-size: 16px;
  line-height: 1.2;
}

.control-card h3 {
  margin: 20px 0 10px;
  font-size: 15px;
}

.control-card label,
.control-card select {
  width: 100%;
}

.control-card select,
.control-card input {
  width: 100%;
  margin-top: 12px;
  padding: 0 12px;
}

.layer-grid {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.layer-option {
  width: 100%;
  min-height: 52px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px 9px 9px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  text-align: left;
  font-weight: 800;
}

.layer-option.active {
  border-color: var(--green);
  background: #f0fdf4;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.08);
}

.layer-option > span:not(.layer-swatch) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-option small {
  color: #667085;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.layer-swatch {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.layer-swatch svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.layer-swatch.moisture {
  background: linear-gradient(135deg, #ecfeff 0%, #bbf7d0 100%);
  color: #0891b2;
}

.layer-swatch.ndvi {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  color: #16a34a;
}

.layer-swatch.irrigation {
  background: linear-gradient(135deg, #eff6ff 0%, #bfdbfe 100%);
  color: #1d4ed8;
}

.layer-swatch.irrigation-target {
  background: linear-gradient(135deg, #ecfdf5 0%, #fde68a 100%);
  color: #15803d;
}

.layer-swatch.soil-texture {
  background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%);
  color: #9a3412;
}

.layer-swatch.well-zone {
  background: linear-gradient(135deg, #f5f3ff 0%, #e0e7ff 100%);
  color: #6d28d9;
}

.pin-icon,
.layer-icon {
  width: 17px;
  height: 17px;
  display: inline-block;
  border: 2px solid #111827;
  border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
}

.pin-icon::after {
  content: "";
  width: 5px;
  height: 5px;
  position: absolute;
  border-radius: 50%;
  background: #111827;
  transform: translate(4px, 4px);
}

.layer-icon {
  border: 2px solid var(--green);
  border-radius: 4px;
  transform: none;
  position: relative;
}

.layer-icon::before,
.layer-icon::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 2px solid var(--green);
  border-radius: 4px;
  transform: rotate(45deg);
}

.search-row {
  display: grid;
  grid-template-columns: 1fr 38px;
  gap: 8px;
}

.search-row input {
  margin-top: 0;
}

.search-row button {
  height: 42px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  font-size: 18px;
}

.switch-row {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: #344054;
  font-weight: 700;
}

.switch-row button {
  min-width: 66px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 700;
}

.switch-row button:disabled {
  background: #d1d5db;
  cursor: not-allowed;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.kpi-card {
  min-width: 0;
  min-height: 92px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 12px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.045);
}

.kpi-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.kpi-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kpi-icon.green {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  color: #16a34a;
}

.kpi-icon.blue {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #2563eb;
}

.kpi-icon.warm {
  background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
  color: #f97316;
}

.kpi-card span:not(.kpi-icon) {
  display: block;
  color: #475467;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.kpi-card strong {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin-top: 7px;
  color: #111827;
  line-height: 1;
  min-width: 0;
  white-space: nowrap;
}

.kpi-card b {
  font-size: 24px;
  font-weight: 900;
}

.kpi-card small {
  color: #344054;
  font-size: 11px;
  font-weight: 800;
}

.kpi-card.compact-number {
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  padding-right: 8px;
}

.kpi-card.compact-number b {
  font-size: 22px;
}

.kpi-card.compact-number small {
  font-size: 10px;
}

.center-panel {
  display: grid;
  gap: 14px;
}

.map-card {
  height: calc(100vh - 330px);
  min-height: 560px;
  position: relative;
  overflow: hidden;
  padding: 0;
}

#map {
  width: 100%;
  height: 100%;
  background: #d9e4d2;
}

.map-tabs {
  position: absolute;
  top: 16px;
  left: 64px;
  z-index: 600;
  display: flex;
  gap: 8px;
}

.map-tabs button {
  height: 40px;
  min-width: 72px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: #111827;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.16);
}

.map-tabs button.active {
  background: var(--green);
  color: #fff;
}

.map-tabs button:disabled {
  background: rgba(229, 231, 235, 0.94);
  color: #98a2b3;
  cursor: not-allowed;
}

.map-legend {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 600;
  width: 156px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
  color: #111827;
  backdrop-filter: blur(10px);
}

.map-legend strong {
  display: block;
  margin-bottom: 9px;
  font-size: 13px;
  line-height: 1.2;
}

.moisture-legend {
  min-height: 112px;
  display: grid;
  grid-template-columns: 18px 1fr;
  column-gap: 12px;
  align-items: stretch;
}

.moisture-vertical {
  width: 18px;
  height: 112px;
  position: relative;
  border: 1px solid rgba(15, 23, 42, 0.72);
  border-radius: 3px;
  background: linear-gradient(0deg, #b91c1c 0%, #f97316 28%, #facc15 44%, #22c55e 68%, #06b6d4 100%);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16);
}

.moisture-threshold-tick {
  position: absolute;
  left: 100%;
  width: 7px;
  height: 2px;
  background: #111827;
  transform: translateY(50%);
}

.moisture-threshold-label {
  position: absolute;
  left: 0;
  color: #111827;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  transform: translateY(50%);
}

.moisture-vertical-labels {
  position: relative;
  color: #344054;
  font-size: 11px;
  font-weight: 800;
}

.moisture-vertical-labels span {
  position: absolute;
  left: 0;
  white-space: nowrap;
}

.moisture-vertical-labels span:first-child {
  top: 0;
}

.moisture-vertical-labels span:last-child {
  bottom: 0;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 26px;
  color: #111827;
  font-size: 13px;
}

.legend-row i {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: inline-block;
}

.legend-row i.legend-line {
  height: 0;
  border-top: 3px solid var(--legend-color);
  border-radius: 999px;
  background: transparent;
}

.legend-row i.legend-dot {
  width: 16px;
  height: 16px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--legend-color);
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.2),
    0 2px 6px rgba(15, 23, 42, 0.24);
}

.well-marker {
  filter: drop-shadow(0 2px 4px rgba(15, 23, 42, 0.45));
}

.well-marker.active {
  filter:
    drop-shadow(0 0 2px rgba(255, 255, 255, 0.96))
    drop-shadow(0 3px 7px rgba(15, 23, 42, 0.48));
}

.scale-bar {
  position: absolute;
  left: 20px;
  bottom: 20px;
  z-index: 600;
  color: #fff;
  font-weight: 800;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.52);
}

.scale-bar span {
  width: 100px;
  height: 28px;
  display: block;
  border-left: 3px solid #fff;
  border-bottom: 3px solid #fff;
}

.scale-bar strong {
  position: absolute;
  left: 18px;
  bottom: 5px;
}

.chart-card {
  padding: 0;
  overflow: hidden;
}

.chart-head {
  min-height: 54px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.period-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.period-tabs button {
  height: 30px;
  min-width: 58px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #344054;
  font-weight: 700;
}

.period-tabs button.active {
  background: var(--green);
  color: #fff;
}

.trend-chart {
  height: 250px;
}

.sub-chart-head {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  border-top: 1px solid var(--line);
}

.sub-chart-head h3 {
  margin: 0;
  color: #344054;
  font-size: 15px;
  line-height: 1.2;
}

.ndvi-trend-chart {
  height: 200px;
  margin: 0 16px 12px;
}

.chart-note {
  margin: 0;
  padding: 0 16px 10px;
  color: #667085;
  font-size: 12px;
}

.detail-card h2 {
  margin-bottom: 14px;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.detail-head h2 {
  margin: 4px 0 6px;
  color: #111827;
  font-size: 28px;
  line-height: 1;
}

.detail-head p {
  margin: 0;
  color: #344054;
  font-size: 13px;
}

.detail-head p.is-hidden {
  display: none;
}

.eyebrow {
  color: var(--green-deep);
  font-weight: 800;
}

.crop-pill {
  flex: 0 0 auto;
  margin-top: 8px;
  padding: 7px 15px;
  border-radius: 999px;
  background: #dff5e8;
  color: var(--green-deep);
  font-weight: 800;
}

.crop-pill.status-pill.online {
  background: #dcfce7;
  color: #15803d;
}

.crop-pill.status-pill.offline {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1.05;
  background: #fef3c7;
  color: #b45309;
}

.crop-pill.status-pill.offline small {
  display: block;
  font-size: 11px;
  line-height: 1.1;
  font-weight: 800;
  white-space: nowrap;
}

.crop-pill.status-pill.unbound {
  background: #f2f4f7;
  color: #667085;
}

.metric-grid {
  clear: both;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 0;
  border-top: 0;
}

.metric-grid article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "label label"
    "value delta";
  align-items: end;
  column-gap: 8px;
  row-gap: 6px;
  min-height: 68px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.metric-grid span {
  grid-area: label;
  display: block;
  min-height: 0;
  color: #667085;
  font-size: 12px;
  line-height: 1.2;
}

.metric-grid strong {
  grid-area: value;
  display: block;
  margin-top: 0;
  color: #111827;
  font-size: 20px;
  line-height: 1.05;
  white-space: nowrap;
  overflow-wrap: normal;
}

.metric-grid em {
  grid-area: delta;
  display: inline-flex;
  justify-self: end;
  align-self: end;
  margin-top: 0;
  color: var(--green-deep);
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
}

.metric-grid em:empty {
  display: none;
}

.metric-grid.well-metrics {
  margin-top: 12px;
}

.metric-grid.well-metrics article,
.metric-grid.well-metrics article:last-child {
  min-height: 66px;
  padding: 9px 12px;
}

.metric-grid.well-metrics strong {
  margin-top: 0;
}

.metric-grid.well-metrics em {
  display: none;
}

.metric-grid.target-metrics article {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "label"
    "value"
    "delta";
  align-items: start;
  min-height: 72px;
  row-gap: 5px;
  padding: 10px 12px;
}

.metric-grid.target-metrics span {
  font-size: 12px;
}

.metric-grid.target-metrics strong {
  max-width: 100%;
  font-size: 17px;
  line-height: 1.15;
  white-space: normal;
}

.metric-grid.target-metrics strong#detailIrrigationNeed,
.metric-grid.target-metrics strong#detailNdvi {
  white-space: nowrap;
}

.metric-grid.target-metrics em {
  justify-self: start;
  align-self: start;
  max-width: 100%;
  color: #047857;
  font-size: 11px;
  line-height: 1.25;
  white-space: normal;
}

.well-report-meta {
  margin: 8px 2px 0;
  color: #667085;
  font-size: 13px;
  line-height: 1.35;
}

.well-report-meta.is-hidden {
  display: none;
}

.metric-grid strong.status-value {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 900;
}

.status-value.normal {
  background: #dcfce7;
  color: #15803d;
}

.status-value.warning {
  background: #fef3c7;
  color: #b45309;
}

.status-value.irrigated {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-value.unknown {
  background: #f2f4f7;
  color: #667085;
}

.metric-grid strong.target-value {
  font-size: 20px;
  font-weight: 900;
}

.target-value.target-high {
  color: #15803d;
}

.target-value.target-mid {
  color: #4d7c0f;
}

.target-value.target-low {
  color: #a16207;
}

.target-value.target-under {
  color: #b91c1c;
}

.target-value.target-none {
  color: #667085;
}

.metric-grid.target-metrics strong > span {
  grid-area: auto;
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 3px 4px;
  border-radius: 6px;
  background: #f1f5f9;
}

.metric-grid.target-metrics strong > span b {
  color: #667085;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.metric-grid.target-metrics strong > span i {
  color: #111827;
  font-size: 14px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.1;
}

.metric-grid.target-metrics strong#detailTheta,
.metric-grid.target-metrics strong#detailNdvi {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 4px;
}

.metric-grid.target-metrics strong#detailNdvi {
  display: block;
}

.info-dot {
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #98a2b3;
  border-radius: 50%;
  color: #667085;
  font-size: 11px;
}

.info-grid.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.info-grid span,
.weather-grid dt {
  display: block;
  color: #667085;
  font-size: 13px;
}

.info-grid strong {
  display: block;
  margin-top: 10px;
  color: var(--blue);
  font-size: 18px;
}

.irrigation-list {
  display: grid;
  gap: 8px;
  max-height: 168px;
  overflow: auto;
  padding-right: 4px;
}

.irrigation-row,
.irrigation-empty,
.irrigation-total {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.irrigation-row time {
  color: #344054;
  font-weight: 700;
}

.irrigation-row strong,
.irrigation-total strong {
  color: var(--blue);
  font-size: 15px;
}

.irrigation-empty {
  justify-content: center;
  color: #667085;
}

.irrigation-total {
  margin-top: 10px;
  background: #eef6ff;
  color: #344054;
  font-weight: 800;
}

.soil-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.soil-grid dl,
.weather-grid dl {
  margin: 0;
}

.soil-grid dl + dl {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.soil-grid div,
.weather-grid dl div {
  display: grid;
  grid-template-columns: minmax(112px, 1fr) minmax(64px, auto);
  gap: 10px;
  min-height: 34px;
  align-items: center;
}

.soil-grid div.is-hidden,
.sample-date.is-hidden {
  display: none;
}

.soil-grid dt {
  color: #667085;
  font-size: 14px;
  line-height: 1.25;
}

.soil-grid dd,
.weather-grid dd {
  margin: 0;
  color: #111827;
  text-align: right;
  white-space: nowrap;
}

.soil-grid dd {
  font-size: 17px;
  line-height: 1.35;
}

.soil-grid.is-well-properties {
  grid-template-columns: 1fr;
  gap: 0;
}

.soil-grid.is-well-properties dl {
  display: contents;
}

.soil-grid.is-well-properties dl + dl {
  padding-left: 0;
  border-left: 0;
}

.soil-grid.is-well-properties div {
  grid-template-columns: minmax(104px, 1fr) minmax(160px, auto);
  min-height: 36px;
}

.sample-date {
  margin: 12px 0 0;
  color: #667085;
  font-size: 13px;
}

.weather-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.weather-head h2 {
  margin: 0;
}

.weather-head span {
  color: #344054;
  font-size: 14px;
  font-weight: 700;
}

.weather-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.weather-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.weather-metrics article {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(92px, 1fr) auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fafb;
}

.weather-metrics span {
  display: block;
  color: #667085;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
}

.weather-metrics strong {
  display: block;
  color: #111827;
  font-size: 18px;
  line-height: 1.15;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.forecast-panel {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.forecast-title {
  margin-bottom: 10px;
  color: #344054;
  font-size: 14px;
  font-weight: 800;
}

.forecast-box {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.forecast-item {
  min-width: 0;
  min-height: 92px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 3px;
  padding: 8px 6px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
  color: #344054;
  font-size: 11px;
  text-align: center;
}

.forecast-item.current {
  border-color: rgba(37, 99, 235, 0.55);
  background: #eff6ff;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.1);
}

.forecast-item time {
  display: grid;
  gap: 1px;
  color: #667085;
  font-weight: 700;
  line-height: 1.1;
}

.forecast-item time b {
  color: #344054;
  font-size: 12px;
}

.forecast-item time span {
  font-size: 9px;
}

.forecast-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.forecast-icon.clear {
  color: #f59e0b;
}

.forecast-icon.cloud {
  color: #64748b;
}

.forecast-icon.rain {
  color: #2563eb;
}

.forecast-status {
  min-height: 13px;
  color: #2563eb;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.forecast-item strong {
  color: #111827;
  font-size: 14px;
  line-height: 1;
}

.forecast-item em {
  color: var(--blue);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.1;
}

.forecast-item span {
  color: #667085;
  font-size: 10px;
  white-space: nowrap;
  line-height: 1.1;
}

.forecast-empty {
  grid-column: 1 / -1;
  min-height: 88px;
  display: grid;
  place-items: center;
  border: 1px dashed #d0d5dd;
  border-radius: 8px;
  color: #667085;
  font-size: 13px;
}

.leaflet-control-container .leaflet-control {
  border: 0;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: rgba(15, 23, 42, 0.84);
  color: #f8fafc;
}

.leaflet-popup-content-wrapper {
  border: 1px solid rgba(226, 232, 240, 0.28);
  border-radius: 8px;
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.34);
}

.leaflet-popup-content {
  min-width: 168px;
  margin: 10px 12px;
  font-size: 13px;
  line-height: 1.7;
}

.well-popup .leaflet-popup-content {
  min-width: 48px;
  margin: 8px 12px;
  text-align: center;
  line-height: 1.2;
}

.field-label {
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
  pointer-events: none;
}

.field-label::before {
  display: none;
}

.popup-title {
  margin-bottom: 6px;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

.well-popup-title {
  margin-bottom: 0;
  font-size: 16px;
}

.popup-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: #dbeafe;
}

.popup-row span {
  color: #aebfd3;
}

.loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: rgba(246, 248, 251, 0.9);
  color: #111827;
  font-weight: 800;
}

.loading.hidden {
  display: none;
}

@media (min-width: 1600px) {
  .workspace {
    grid-template-columns: 300px minmax(620px, 1fr) 460px;
  }

  .metric-grid strong {
    font-size: 22px;
  }

  .metric-grid.well-metrics strong {
    font-size: 20px;
  }
}

@media (max-width: 1120px) {
  .topbar {
    height: auto;
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .toolbar {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .map-card {
    height: 620px;
  }
}

@media (max-width: 760px) {
  .brand h1 {
    font-size: 22px;
  }

  .toolbar,
  .toolbar-field,
  .date-field,
  .weather-grid,
  .soil-grid,
  .metric-grid,
  .info-grid.two {
    grid-template-columns: 1fr;
    display: grid;
    width: 100%;
  }

  .toolbar select,
  .toolbar input,
  .date-field input {
    min-width: 0;
    width: 100%;
  }

  .map-card {
    min-height: 460px;
    height: 520px;
  }

  .forecast-box {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-legend {
    left: 16px;
    right: auto;
    top: 68px;
  }

  .chart-head,
  .sub-chart-head {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 16px;
  }

  .period-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .period-tabs button {
    flex: 1 0 58px;
  }

  .ndvi-trend-chart {
    height: 190px;
    margin: 0 12px 14px;
  }
}

.android-display,
.android-display body,
.android-display .app {
  min-width: 1440px;
}

.android-display .topbar {
  height: 78px;
  flex-direction: row;
  align-items: center;
  padding: 0 28px;
}

.android-display .brand {
  flex: 0 0 300px;
  min-width: 300px;
}

.android-display .brand h1 {
  font-size: 22px;
}

.android-display .toolbar {
  width: auto;
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.android-display .toolbar-field,
.android-display .date-field {
  width: auto;
  display: inline-flex;
  grid-template-columns: none;
}

.android-display .toolbar select {
  min-width: 144px;
  width: auto;
}

.android-display .toolbar input,
.android-display .date-field input {
  min-width: 154px;
  width: auto;
}

.android-display .workspace {
  grid-template-columns: 250px minmax(760px, 1fr) 340px;
  gap: 12px;
  padding: 14px;
  align-items: start;
}

.android-display .map-card {
  height: 560px;
  min-height: 520px;
}

.android-display .right-panel,
.android-display .left-panel {
  gap: 10px;
}

.android-display .right-panel .detail-card,
.android-display .control-card {
  padding: 12px;
}

.android-display .detail-head {
  gap: 8px;
}

.android-display .detail-head h2 {
  font-size: 24px;
}

.android-display .detail-card h2 {
  margin-bottom: 10px;
}

.android-display .metric-grid,
.android-display .soil-grid,
.android-display .info-grid.two {
  width: auto;
  display: grid;
}

.android-display .metric-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.android-display .metric-grid article {
  min-height: 58px;
  padding: 8px 10px;
}

.android-display .metric-grid span {
  font-size: 11px;
}

.android-display .metric-grid strong {
  font-size: 18px;
}

.android-display .metric-grid em {
  font-size: 10px;
}

.android-display .soil-grid,
.android-display .info-grid.two {
  grid-template-columns: 1fr 1fr;
}

.android-display .soil-grid {
  gap: 12px;
}

.android-display .soil-grid dl + dl {
  padding-left: 12px;
}

.android-display .soil-grid div {
  min-height: 30px;
  grid-template-columns: minmax(92px, 1fr) minmax(54px, auto);
  gap: 8px;
}

.android-display .soil-grid dt {
  font-size: 12px;
}

.android-display .soil-grid dd {
  font-size: 15px;
}

.android-display .irrigation-list {
  max-height: 132px;
  gap: 6px;
}

.android-display .irrigation-row,
.android-display .irrigation-total {
  min-height: 34px;
  padding: 0 9px;
}

.android-display .irrigation-row strong,
.android-display .irrigation-total strong {
  font-size: 14px;
}

.android-display .weather-grid {
  width: auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.android-display .weather-head {
  margin-bottom: 10px;
}

.android-display .weather-metrics {
  gap: 6px;
}

.android-display .weather-metrics article {
  padding: 9px 10px;
  gap: 8px;
}

.android-display .weather-metrics span {
  font-size: 12px;
}

.android-display .weather-metrics strong {
  font-size: 16px;
}

.android-display .forecast-panel {
  padding: 10px;
}

.android-display .forecast-box {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.android-display .forecast-item {
  min-height: 78px;
  padding: 6px 4px;
  font-size: 10px;
}

.android-display .forecast-item time b {
  font-size: 11px;
}

.android-display .forecast-item time span {
  font-size: 8px;
}

.android-display .forecast-icon {
  width: 18px;
  height: 18px;
}

.android-display .map-legend {
  top: 16px;
  right: 16px;
  left: auto;
}

.android-display .chart-head,
.android-display .sub-chart-head {
  flex-direction: row;
  align-items: center;
  padding-left: 16px;
  padding-right: 16px;
}

.android-display .period-tabs {
  width: auto;
  overflow-x: visible;
}

.android-display .period-tabs button {
  flex: 0 0 auto;
}

.android-display .display-toggle-btn {
  width: auto;
  flex: 0 0 auto;
}

.android-display .ndvi-trend-chart {
  height: 200px;
  margin: 0 16px 12px;
}
