* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "PingFang SC", "Microsoft YaHei", sans-serif; background: #f0f2f5; color: #1a1a2e; }

.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1a5276, #2ecc71); }
.login-card { background: #fff; padding: 2.5rem; border-radius: 12px; width: 380px; box-shadow: 0 8px 32px rgba(0,0,0,.15); }
.login-card h1 { font-size: 1.3rem; margin-bottom: .25rem; }
.subtitle { color: #666; margin-bottom: 1.5rem; font-size: .9rem; }
.login-card label { display: block; margin-bottom: 1rem; font-size: .85rem; color: #444; }
.login-card input { display: block; width: 100%; margin-top: .35rem; padding: .6rem .75rem; border: 1px solid #ddd; border-radius: 6px; font-size: 1rem; }
.login-card button { width: 100%; padding: .75rem; background: #1565c0; color: #fff; border: none; border-radius: 6px; font-size: 1rem; cursor: pointer; }
.login-card button:hover { background: #0d47a1; }
.error { color: #c0392b; font-size: .85rem; margin-top: .5rem; }
.remember-label { display: flex !important; align-items: center; gap: .5rem; margin-bottom: 1rem !important; cursor: pointer; user-select: none; }
.remember-label input { width: auto; margin: 0; }

.app-shell { display: flex; height: 100vh; overflow: hidden; }
.sidebar { width: 220px; background: #1a2744; color: #fff; display: flex; flex-direction: column; flex-shrink: 0; }
.brand { padding: 1.25rem; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand h1 { font-size: .95rem; line-height: 1.4; }
.brand p { font-size: .75rem; color: #90caf9; margin-top: .5rem; }
.menu {
  flex: 1; min-height: 0; padding: .75rem 0; overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(187, 222, 251, .72) transparent;
}
.menu::-webkit-scrollbar { width: 10px; }
.menu::-webkit-scrollbar-track { background: transparent; }
.menu::-webkit-scrollbar-thumb {
  background-color: rgba(187, 222, 251, .55);
  border: 2px solid #1a2744;
  border-radius: 999px;
}
.menu::-webkit-scrollbar-thumb:hover { background-color: rgba(227, 242, 253, .92); }
.menu-item { display: block; width: 100%; text-align: left; padding: .75rem 1.25rem; background: none; border: none; color: #b0bec5; cursor: pointer; font-size: .9rem; }
.menu-item:hover, .menu-item.active { background: rgba(255,255,255,.08); color: #fff; }
.menu-item.active { border-left: 3px solid #42a5f5; }
.menu-group { border-bottom: 1px solid rgba(255,255,255,.06); }
.menu-group-title {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: .75rem 1.25rem; background: none; border: none; color: #cfd8dc;
  cursor: pointer; font-size: .9rem; text-align: left;
}
.menu-group-title:hover { background: rgba(255,255,255,.06); color: #fff; }
.menu-caret { font-size: .7rem; opacity: .75; transition: transform .15s ease; }
.menu-group:not(.open) .menu-caret { transform: rotate(-90deg); }
.menu-group:not(.open) .menu-sub { display: none; }
.menu-sub { padding-bottom: .25rem; }
.menu-sub-item {
  padding-left: 2rem; font-size: .85rem;
}
.menu-sub-item.active { border-left: 3px solid #42a5f5; }
.logout-btn { margin: 1rem; padding: .5rem; background: rgba(255,255,255,.1); border: none; color: #ccc; border-radius: 6px; cursor: pointer; }
.logout-btn:hover { background: rgba(255,255,255,.18); color: #fff; }

.main { flex: 1; overflow: hidden; position: relative; }
.view { display: none; height: 100%; }
.view.active { display: flex; flex-direction: column; }

/* 勿在 #viewMap 上写死 display:flex，否则会压过 .view{display:none}，导致切走地图后仍占满主区、其它菜单像没反应 */
#viewMap { position: relative; }
#viewMap.active { display: flex; flex-direction: column; }
#viewMap #map { flex: 1; min-height: 0; }
.sentinel-guide-bar {
  flex-shrink: 0;
  margin: 0 .75rem .5rem;
  padding: .55rem .75rem .65rem;
  background: linear-gradient(180deg, #f4f8fc 0%, #eef4fa 100%);
  border: 1px solid #d5e3f0;
  border-radius: 8px;
  color: #37474f;
  font-size: .8rem;
  line-height: 1.45;
}
.sentinel-guide-bar.hidden { display: none !important; }
.sentinel-guide-head {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  margin-bottom: .35rem;
}
.sentinel-guide-head strong { font-size: .85rem; color: #1a2744; }
.sentinel-guide-toggle {
  border: 1px solid #cfd8dc; background: #fff; color: #546e7a;
  border-radius: 4px; padding: .15rem .45rem; font-size: .72rem; cursor: pointer;
}
.sentinel-guide-toggle:hover { border-color: #90caf9; color: #1565c0; }
.sentinel-guide-steps { margin: 0 0 0 1.1rem; padding: 0; }
.sentinel-guide-steps li { margin: .2rem 0; }
.sentinel-guide-steps em { font-style: normal; color: #1565c0; font-weight: 600; }
.sentinel-guide-text { margin: 0; color: #455a64; }
.sentinel-guide-bar.collapsed .sentinel-guide-body,
.sentinel-guide-bar.collapsed .sentinel-guide-text { display: none; }
.sentinel-guide-bar.collapsed .sentinel-guide-head { margin-bottom: 0; }
@media (max-width: 768px) {
  .sentinel-guide-bar { margin: 0 .5rem .4rem; font-size: .75rem; }
}
.toolbar { display: flex; gap: .5rem; padding: .5rem .75rem; background: #fff; border-bottom: 1px solid #e0e0e0; align-items: center; flex-wrap: wrap; }
.toolbar select { padding: .4rem .6rem; border: 1px solid #ccc; border-radius: 4px; min-width: 120px; }
.toolbar-check {
  display: inline-flex; align-items: center; gap: .35rem; height: 34px;
  padding: 0 .6rem; border: 1px solid #d5dde5; border-radius: 4px;
  background: #f8fafc; color: #37474f; font-size: .85rem; cursor: pointer;
  user-select: none;
}
.toolbar-check-group {
  display: inline-flex; align-items: center; gap: .65rem; flex-wrap: wrap;
}
.toolbar-check-group.hidden { display: none; }
#mapFilterWrap.hidden { display: none; }
#ovmapCompanySelect {
  min-width: 7.5rem;
  padding: .2rem .4rem;
  border: 1px solid #cfd8dc;
  border-radius: 6px;
  background: #fff;
  color: #37474f;
  font-size: .85rem;
}

.legend-ovmap .swatch.dot {
  width: 10px; height: 10px; border-radius: 50%;
}

.ovmap-popup h4 { margin: 0 0 .35rem; font-size: .95rem; }
.ovmap-popup .ovmap-meta { color: #666; font-size: .78rem; margin-bottom: .45rem; }
.ovmap-detail-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.ovmap-detail-table th {
  text-align: left; color: #555; font-weight: 600; padding: .2rem .45rem .2rem 0;
  white-space: nowrap; vertical-align: top;
}
.ovmap-detail-table td { padding: .2rem 0; color: #222; }
.ovmap-fert-g1 { color: #1b5e20; font-weight: 700; }
.ovmap-fert-g2 { color: #e65100; font-weight: 700; }
.ovmap-fert-g3 { color: #b71c1c; font-weight: 700; }
.legend-ovmap .ovmap-fert-legend {
  display: flex; gap: .7rem; margin-top: .35rem; font-weight: 700;
}
.ovmap-fert-tooltip {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  pointer-events: none !important;
}
.ovmap-fert-tooltip::before { display: none !important; }
.leaflet-container:not(.ovmap-show-fert) .ovmap-fert-tooltip { display: none; }
.ovmap-fert-label {
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  pointer-events: none;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 1px 1px 0 #fff, -1px -1px 0 #fff;
}
.ovmap-fert-id {
  font-size: 10px;
  font-weight: 700;
  color: #263238;
  margin-bottom: 1px;
}
.ovmap-fert-grid {
  display: grid;
  grid-template-columns: auto auto;
  column-gap: 6px;
  row-gap: 0;
  justify-content: center;
}
.toolbar-check.hidden { display: none; }
.toolbar-check input { margin: 0; width: 14px; height: 14px; accent-color: #1565c0; }
.parcel-name-host {
  background: transparent !important;
  border: none !important;
  overflow: visible !important;
}
.parcel-name-chip {
  position: relative;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #78909c;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  line-height: 1.25;
  color: #263238;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  pointer-events: none;
  text-align: center;
  display: inline-block;
  width: max-content;
  max-width: none;
  transform-origin: center center;
  white-space: nowrap;
  overflow: visible;
  box-sizing: border-box;
}
.parcel-label-area {
  font-variant-numeric: tabular-nums;
  color: #1565c0;
}

.toolbar-hint { margin-left: auto; font-size: .75rem; color: #888; white-space: nowrap; }
.selection-bar {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .25rem .55rem; background: #fff8e1; border: 1px solid #ffe082;
  border-radius: 4px; font-size: .8rem; color: #5d4037;
}
.selection-bar.hidden { display: none; }
.selection-bar strong { color: #e65100; }
.toolbar-hint.hidden { display: none; }
#basemapSelect { min-width: 120px; }
#geovisYearSelect { min-width: 110px; }
#imageryMeta { max-width: 420px; overflow: hidden; text-overflow: ellipsis; color: #1565c0; }
#colorModeSelect { min-width: 132px; }
#brigadeSelect { min-width: 168px; max-width: 240px; }
#viewMap:not(.map-edit-mode) .map-edit-only { display: none !important; }
#viewMap.map-edit-mode .map-readonly-only { display: none !important; }
#viewMap.map-edit-mode .toolbar-hint.map-edit-only { display: inline; margin-left: auto; }
#viewMap:not(.map-edit-mode) .toolbar-hint.map-readonly-only { margin-left: auto; }
.btn { padding: .4rem .9rem; border: 1px solid #ccc; background: #fff; border-radius: 4px; cursor: pointer; font-size: .85rem; }
.btn.primary { background: #1565c0; color: #fff; border-color: #1565c0; }
.btn.danger { background: #c0392b; color: #fff; border-color: #c0392b; }
.btn:hover { opacity: .9; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:disabled:hover { opacity: .45; }
.btn.active { background: #e3f2fd; border-color: #1565c0; color: #1565c0; font-weight: 600; }
#map.box-select-mode { cursor: crosshair; }
.leaflet-container.coord-pick-on,
.leaflet-container.fmt-measure-on,
.leaflet-container.fmt-area-on { cursor: crosshair; }
.farm-map-tools {
  clear: both;
  position: relative;
  z-index: 1000;
  font-family: inherit;
  /* 与 Leaflet 缩放条同一套外框，保证上下等宽对齐 */
  border: 2px solid rgba(0, 0, 0, .2);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .35);
  overflow: visible;
}
.farm-map-tools .fmt-main {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: #37474f;
  cursor: pointer;
  box-shadow: none;
}
.farm-map-tools .fmt-wrench { display: block; width: 16px; height: 16px; }
.farm-map-tools .fmt-main:hover { background: #f4f4f4; }
.farm-map-tools .fmt-main.is-active {
  background: #e3f2fd;
  color: #1565c0;
}
.farm-map-tools .fmt-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  min-width: 132px;
  background: #fff;
  border: 1px solid #cfd8dc;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
  padding: 4px;
  z-index: 1200;
}
.farm-map-tools .fmt-menu.hidden { display: none; }
.farm-map-tools .fmt-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 7px 10px;
  border-radius: 4px;
  font-size: 13px;
  color: #263238;
  cursor: pointer;
}
.farm-map-tools .fmt-item:hover { background: #eceff1; }
.farm-map-tools .fmt-item.is-on {
  background: #e3f2fd;
  color: #1565c0;
  font-weight: 600;
}

/* 左上角缩放 + 工具：统一边距与间距，竖向对齐成一列 */
.leaflet-top.leaflet-left .leaflet-control {
  margin-left: 10px !important;
  margin-top: 10px !important;
}
.leaflet-top.leaflet-left .leaflet-control + .leaflet-control {
  margin-top: 6px !important;
}
.leaflet-touch .leaflet-bar {
  border: 2px solid rgba(0, 0, 0, .2);
  box-shadow: 0 1px 5px rgba(0, 0, 0, .35);
}
.leaflet-touch .leaflet-bar a {
  width: 30px;
  height: 30px;
  line-height: 30px;
}
.leaflet-touch .leaflet-control-zoom-in,
.leaflet-touch .leaflet-control-zoom-out {
  font-size: 18px;
}
.fmt-hint {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 1100;
  pointer-events: none;
  background: rgba(26, 39, 68, 0.9);
  color: #fff;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 4px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,.28);
  max-width: calc(100% - 24px);
  overflow: hidden;
  text-overflow: ellipsis;
}
.fmt-hint.hidden { display: none; }
.fmt-measure-label, .fmt-area-label { background: none !important; border: none !important; }
.fmt-measure-label span, .fmt-area-label span {
  display: inline-block;
  background: rgba(198, 40, 40, .92);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.fmt-area-label span { background: rgba(21, 101, 192, .92); }
.fmt-vertex { background: none !important; border: none !important; }
.fmt-vertex span {
  display: block; width: 10px; height: 10px; margin: 1px;
  border-radius: 50%; background: #1565c0; border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.25);
}
.fmt-vertex.is-first span {
  background: #fff; border-color: #1565c0; box-shadow: 0 0 0 2px #1565c0;
}
.coord-hover-hud {
  position: absolute;
  z-index: 1200;
  pointer-events: none;
  background: rgba(26, 39, 68, 0.92);
  color: #fff;
  font-size: 12px;
  line-height: 1.35;
  padding: 5px 8px;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,.28);
  transform: translate(14px, 14px);
}
.coord-hover-hud.hidden { display: none; }
.coord-hover-hud small { display: block; color: #b0bec5; font-size: 10px; }
.leaflet-pane.coord-pick-pane { z-index: 700; }
.coord-pin-icon { background: none !important; border: none !important; }
.coord-pin {
  display: flex; align-items: flex-start; gap: 6px;
  pointer-events: auto;
}
.coord-pin-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: #ff3d00; border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.35), 0 1px 4px rgba(0,0,0,.35);
  flex-shrink: 0; margin-top: 5px;
}
.coord-pin-card {
  background: #fff; border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,.22);
  padding: 4px 6px 4px 8px;
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.coord-pin-text {
  font-size: 12px; font-variant-numeric: tabular-nums;
  color: #1a2744; cursor: pointer; user-select: all;
}
.coord-pin-copy {
  border: 1px solid #cfd8dc; background: #f5f7fa; border-radius: 4px;
  font-size: 11px; padding: 2px 6px; cursor: pointer; color: #1565c0;
}
.coord-pin-copy:hover { background: #e3f2fd; border-color: #90caf9; }
.coord-pin-copy.copied { color: #2e7d32; border-color: #a5d6a7; background: #e8f5e9; }
.box-select-overlay {
  position: absolute;
  inset: 0;
  z-index: 650;
  cursor: crosshair;
  background: transparent;
}

#map, #agMap { flex: 1; min-height: 0; position: relative; z-index: 1; width: 100%; }
#viewAgri { position: relative; }
#agMeta { max-width: 680px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #2e7d32; margin-left: auto; }
#agMeta.ag-meta-loading { color: #1565c0; }
#agMeta.ag-meta-warn { color: #c62828; }
.leaflet-container { cursor: default; }

.parcel-panel {
  position: absolute; top: 60px; right: 12px; width: 300px;
  background: #fff; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,.15);
  padding: 1rem; z-index: 1000; max-height: calc(100% - 80px); overflow-y: auto;
  pointer-events: auto;
}
.parcel-panel.hidden { display: none; }
.parcel-panel.parcel-name-only select:disabled,
.parcel-panel.parcel-name-only textarea:disabled,
.parcel-panel.parcel-name-only input:disabled,
.parcel-panel.parcel-name-only .color-select-btn:disabled {
  background: #f3f4f6;
  color: #555;
  cursor: not-allowed;
  opacity: 1;
}
.parcel-panel h3 { margin-bottom: .75rem; font-size: 1rem; }
.parcel-panel label { display: block; margin-bottom: .6rem; font-size: .8rem; color: #555; }
.parcel-panel input, .parcel-panel select, .parcel-panel textarea {
  display: block; width: 100%; margin-top: .2rem; padding: .4rem; border: 1px solid #ddd; border-radius: 4px; font-size: .85rem;
}
.parcel-panel input[readonly] {
  background: #f3f4f6; color: #555; cursor: not-allowed;
}
.field-hint { display: block; margin-top: .25rem; font-size: .75rem; color: #888; }
.field-hint.warn { color: #c0392b; font-weight: 600; }
.form-actions { display: flex; gap: .4rem; margin-top: .75rem; flex-wrap: wrap; }

.color-select { position: relative; margin-top: .2rem; }
.color-select-btn {
  display: flex; align-items: center; gap: .45rem; width: 100%;
  padding: .4rem .5rem; border: 1px solid #ddd; border-radius: 4px;
  background: #fff; cursor: pointer; font-size: .85rem; text-align: left;
}
.color-select-btn .swatch {
  width: 14px; height: 14px; border-radius: 2px; border: 1px solid rgba(0,0,0,.2); flex-shrink: 0;
}
.color-select-arrow { margin-left: auto; color: #888; font-size: .75rem; }
.color-select-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 1100;
  max-height: 220px; overflow-y: auto; background: #fff; border: 1px solid #ddd;
  border-radius: 4px; box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
.color-select-menu.hidden { display: none; }
.color-select-option {
  display: flex; align-items: center; gap: .45rem; width: 100%;
  padding: .45rem .55rem; border: none; background: none; cursor: pointer;
  font-size: .85rem; text-align: left;
}
.color-select-option:hover { background: #f0f4f8; }
.color-select-option .swatch {
  width: 14px; height: 14px; border-radius: 2px; border: 1px solid rgba(0,0,0,.2); flex-shrink: 0;
}

.legend {
  position: absolute; bottom: 24px; left: 12px; background: rgba(255,255,255,.92);
  padding: .6rem .8rem; border-radius: 6px; z-index: 900; max-height: 200px; overflow-y: auto;
  font-size: .75rem; box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.legend h4 { margin-bottom: .4rem; }
.legend-item { display: flex; align-items: center; gap: .4rem; margin-bottom: .2rem; }
.legend-soil .legend-item { font-size: .72rem; }
.legend-soil .swatch { width: 18px; height: 12px; }

.soil-edit-toolbar {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.soil-edit-toolbar.hidden { display: none; }

.soil-warp-canvas { position: absolute; left: 0; top: 0; pointer-events: none; }

.soil-corner-handle-wrap {
  background: none !important;
  border: none !important;
}
.soil-corner-handle {
  display: block;
  width: 14px;
  height: 14px;
  margin: 1px;
  border-radius: 50%;
  background: #ffd600;
  border: 2px solid #333;
  box-shadow: 0 0 0 1px rgba(255,255,255,.8);
  cursor: grab;
}
.soil-corner-handle-wrap.leaflet-dragging .soil-corner-handle { cursor: grabbing; }

.soil-rotate-handle-wrap {
  background: none !important;
  border: none !important;
}
.soil-rotate-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #1565c0;
  box-shadow: 0 1px 5px rgba(0,0,0,.28);
  cursor: grab;
  font-size: 13px;
  line-height: 1;
  color: #1565c0;
  user-select: none;
}
.soil-rotate-handle::before {
  content: '↻';
  display: block;
  margin-top: -1px;
}
.soil-rotate-handle-wrap.leaflet-dragging .soil-rotate-handle {
  cursor: grabbing;
  background: #e3f2fd;
}

.soil-assign-panel {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
  padding: .25rem .5rem;
  background: rgba(255,255,255,.92);
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.soil-assign-panel.hidden { display: none; }
.soil-assign-field {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .82rem;
}
.soil-assign-field span { color: #555; white-space: nowrap; }
.soil-assign-field select { min-width: 110px; max-width: 160px; }

.soil-rotate-btn {
  min-width: auto;
  padding: .35rem .55rem;
  font-size: .85rem;
}

.soil-move-handle-wrap {
  background: none !important;
  border: none !important;
  text-align: center;
}
.soil-move-handle {
  display: block;
  width: 22px;
  height: 22px;
  margin: 3px auto 0;
  border-radius: 50%;
  background: #42a5f5;
  border: 2px solid #fff;
  box-shadow: 0 1px 6px rgba(0,0,0,.35);
  cursor: move;
}
.soil-move-handle-wrap.selected .soil-move-handle {
  background: #1565c0;
  box-shadow: 0 0 0 3px rgba(255,214,0,.55), 0 1px 6px rgba(0,0,0,.35);
}
.soil-move-handle-wrap.leaflet-dragging .soil-move-handle { cursor: grabbing; }
.soil-move-label {
  display: block;
  max-width: 88px;
  margin: 0 auto 2px;
  padding: 1px 4px;
  font-size: .65rem;
  line-height: 1.2;
  color: #1565c0;
  background: rgba(255,255,255,.92);
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.swatch { width: 14px; height: 14px; border-radius: 2px; border: 1px solid rgba(0,0,0,.2); }

#viewSupply, #viewStats, #viewSync, #viewOrgDefs, #viewBrigades, #viewUsers, #viewLoginLogs, #viewAgri, #viewPlantProtection, #viewExternalApi, #viewAiSettings, #viewBackups { flex: 1; min-height: 0; overflow: hidden; }
#viewOrgDefs.active,
#viewBrigades.active,
#viewUsers.active,
#viewLoginLogs.active,
#viewSync.active,
#viewAiSettings.active,
#viewExternalApi.active,
#viewBackups.active {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#viewSupply.active { display: flex; flex-direction: column; min-height: 0; }
#viewSupply iframe { width: 100%; flex: 1 1 auto; min-height: 0; border: none; }

.ctx-menu {
  position: fixed; z-index: 2000; min-width: 140px;
  background: #fff; border: 1px solid #ddd; border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,.15); padding: .35rem 0;
}
.ctx-menu.hidden { display: none; }
.ctx-menu button {
  display: block; width: 100%; text-align: left; padding: .55rem 1rem;
  border: none; background: none; cursor: pointer; font-size: .9rem;
}
.ctx-menu button:hover { background: #f0f4f8; }
.ctx-menu button.danger { color: #c0392b; }
.ctx-menu button.danger:hover { background: #fdecea; }
.ctx-menu .ctx-menu-label {
  padding: .35rem 1rem .25rem; font-size: .75rem; color: #888; border-bottom: 1px solid #eee;
}
.ctx-menu button.ctx-menu-disabled,
.ctx-menu button:disabled {
  color: #aaa; cursor: default;
}
.ctx-menu button.ctx-menu-disabled:hover,
.ctx-menu button:disabled:hover { background: none; }

.batch-summary {
  font-size: .8rem; color: #1a5276; background: #e8f4fd;
  padding: .55rem .65rem; border-radius: 4px; margin-bottom: .55rem; line-height: 1.5;
}
.batch-hint { font-size: .78rem; color: #888; margin-bottom: .75rem; line-height: 1.4; }
.field-hint.common { color: #2e7d32; }
.field-hint.mixed { color: #e65100; }

.stats-grid { padding: 1.5rem; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; width: 100%; }
.stats-tree-page {
  padding: 1.25rem 1.5rem 2rem;
  overflow-y: auto;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.stats-hero {
  background: linear-gradient(135deg, #1565c0, #0d47a1);
  color: #fff;
  border-radius: 10px;
  padding: 1.25rem 1.4rem 1.35rem;
  box-shadow: 0 4px 16px rgba(13, 71, 161, .25);
}
.stats-hero-kicker { font-size: .82rem; opacity: .85; margin-bottom: .35rem; }
.stats-hero-num { font-size: 2rem; font-weight: 700; letter-spacing: .02em; }
.stats-hero-num small { font-size: 1rem; font-weight: 500; opacity: .9; }
.stats-hero-meta { margin-top: .4rem; font-size: .82rem; opacity: .85; }
.stats-bubbles {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  padding: .15rem 0 .35rem;
}
.stats-bubble {
  appearance: none;
  border: 0;
  cursor: pointer;
  width: 11.5rem;
  min-height: 11.5rem;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  box-shadow: 0 8px 22px rgba(21, 101, 192, .18);
  transition: transform .18s ease, box-shadow .18s ease;
  padding: 1.1rem .85rem;
}
.stats-bubble:hover, .stats-bubble:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(21, 101, 192, .28);
  outline: none;
}
.stats-bubble.is-plant {
  background: radial-gradient(circle at 32% 28%, #66bb6a, #2e7d32 62%, #1b5e20);
}
.stats-bubble.is-aqua {
  background: radial-gradient(circle at 32% 28%, #4fc3f7, #0277bd 62%, #01579b);
}
.stats-bubble.is-undefined {
  width: 8.5rem;
  min-height: 8.5rem;
  background: radial-gradient(circle at 32% 28%, #bcaaa4, #8d6e63 62%, #6d4c41);
}
.stats-bubble-label {
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .06em;
  opacity: .95;
}
.stats-bubble-num {
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.15;
  margin-top: .35rem;
  font-variant-numeric: tabular-nums;
}
.stats-bubble-unit { font-size: .78rem; opacity: .88; margin-top: .1rem; }
.stats-bubble-meta { font-size: .72rem; opacity: .82; margin-top: .35rem; }
.stats-region-plain {
  border: 1px solid #eceff1;
  border-radius: 8px;
  margin-bottom: .4rem;
  background: #fff;
}
.stats-card {
  background: #fff;
  border-radius: 10px;
  padding: 1rem 1.15rem 1.2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.stats-card h3 { margin: 0 0 .35rem; font-size: 1rem; color: #1a2744; }
.stats-subh { margin: 1rem 0 .45rem; font-size: .88rem; color: #37474f; }
.stats-note { margin: 0 0 .85rem; font-size: .78rem; color: #78909c; line-height: 1.45; }
.stats-empty { font-size: .82rem; color: #90a4ae; padding: .35rem 0 .6rem; }
.stats-tree-node { border: 1px solid #eceff1; border-radius: 8px; margin-bottom: .45rem; background: #fafbfc; }
.stats-tree-node > summary { list-style: none; cursor: pointer; }
.stats-tree-node > summary::-webkit-details-marker { display: none; }
.stats-tree-row {
  display: grid;
  grid-template-columns: minmax(7rem, max-content) minmax(6.5rem, auto) 4.2rem 4.2rem minmax(5rem, 1fr);
  gap: .45rem .7rem;
  align-items: center;
  padding: .55rem .75rem;
  font-size: .86rem;
}
/* summary 的 ▸/▾ 会占一格，单独留窄列，避免把名称挤到右侧 */
.stats-tree-node > summary.stats-tree-row {
  grid-template-columns: 1em minmax(7rem, max-content) minmax(6.5rem, auto) 4.2rem 4.2rem minmax(5rem, 1fr);
}
.stats-tree-node > summary.stats-tree-row::before {
  content: '▸';
  color: #90a4ae;
  width: 1em;
  text-align: center;
}
.stats-tree-node[open] > summary.stats-tree-row::before { content: '▾'; }
.stats-tree-name {
  font-weight: 600;
  color: #263238;
  text-align: left;
  justify-self: start;
}
.stats-tree-area {
  font-variant-numeric: tabular-nums;
  color: #1565c0;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}
.stats-tree-count {
  font-variant-numeric: tabular-nums;
  color: #78909c;
  text-align: right;
  white-space: nowrap;
}
.stats-tree-pct {
  font-variant-numeric: tabular-nums;
  color: #455a64;
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
}
.stats-bar {
  display: block; height: 7px; background: #eceff1; border-radius: 99px; overflow: hidden;
}
.stats-bar i { display: block; height: 100%; border-radius: 99px; background: #90a4ae; }
.stats-bar-owned i { background: #2e7d32; }
.stats-bar-expansion i { background: #ef6c00; }
.stats-bar-plant i { background: #2e7d32; }
.stats-bar-aqua i { background: #0277bd; }
.stats-bar-undefined i { background: #8d6e63; }
.stats-bar-region i { background: #5c6bc0; }
.stats-tree-row.is-owned .stats-tree-name { color: #2e7d32; }
.stats-tree-row.is-expansion .stats-tree-name { color: #e65100; }
.stats-tree-children { padding: 0 .55rem .55rem 1.15rem; }
.stats-tree-row.is-type {
  padding: .32rem .45rem;
  font-weight: 400;
  background: #fff;
  border-radius: 6px;
  margin-bottom: .25rem;
}
#map.draw-pan-active { cursor: grab !important; }
#map.draw-pan-active.leaflet-dragging { cursor: grabbing !important; }
#drawPanBtn.active { background: #1565c0; color: #fff; border-color: #1565c0; }

@media (max-width: 640px) {
  .stats-tree-page { padding: 1rem .75rem 1.5rem; }
  .stats-bubbles { gap: .7rem; }
  .stats-bubble { width: 8.8rem; min-height: 8.8rem; padding: .85rem .6rem; }
  .stats-bubble-num { font-size: 1.25rem; }
  .stats-tree-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "name pct"
      "area count"
      "bar bar";
  }
  .stats-tree-node > summary.stats-tree-row {
    grid-template-columns: 1em 1fr auto;
    grid-template-areas:
      "toggle name pct"
      ". area count"
      ". bar bar";
  }
  .stats-tree-node > summary.stats-tree-row::before { grid-area: toggle; }
  .stats-tree-name { grid-area: name; }
  .stats-tree-pct { grid-area: pct; }
  .stats-tree-area { grid-area: area; text-align: left; }
  .stats-tree-count { grid-area: count; }
  .stats-bar { grid-area: bar; }
}
.stat-card { background: #fff; padding: 1.25rem; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.stat-card.wide { grid-column: 1 / -1; }
.stat-card h3 { font-size: .85rem; color: #666; margin-bottom: .5rem; }
.stat-card .num { font-size: 1.6rem; font-weight: 600; color: #1565c0; }
.data-table { width: 100%; border-collapse: collapse; font-size: .85rem; margin-top: .5rem; }
.data-table th, .data-table td { padding: .5rem; border-bottom: 1px solid #eee; text-align: left; }
.data-table th { background: #f5f5f5; }

.sync-scroll {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  width: 100%;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}
.sync-panel { padding: 2rem; }
.sync-panel pre { margin-top: 1rem; background: #1e1e1e; color: #aed581; padding: 1rem; border-radius: 6px; font-size: .85rem; }
.client-sync-log-entry { margin: .5rem 0; border: 1px solid #e2e8f0; border-radius: 6px; padding: .5rem .75rem; background: #fff; }
.client-sync-log-entry summary { cursor: pointer; font-size: .9rem; line-height: 1.4; }
.client-sync-log-body {
  margin: .5rem 0 0;
  max-height: min(60vh, 560px);
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: #1e1e1e;
  color: #c5e1a5;
  padding: .75rem;
  border-radius: 4px;
  font-size: .8rem;
  -webkit-overflow-scrolling: touch;
}

.org-def-panel { width: 100%; max-width: none; }
.org-def-card { background: #fff; border: 1px solid #e8e8e8; border-radius: 8px; padding: 1rem 1.25rem; margin-bottom: 1rem; width: 100%; }
.org-def-card h3 { margin: 0 0 .75rem; font-size: 1.05rem; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.org-def-card .tag-code { font-size: .75rem; color: #666; background: #f0f0f0; padding: .15rem .45rem; border-radius: 4px; font-weight: normal; }
.org-def-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; margin-bottom: .75rem; }
.org-def-field { display: inline-flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.org-def-field label { font-size: .82rem; color: #555; white-space: nowrap; margin: 0; }
.org-def-field input { padding: .4rem .55rem; border: 1px solid #ddd; border-radius: 4px; font-size: .88rem; }
.org-def-field input[id^="org-name-"] { width: 14rem; }
.org-def-field input[id^="org-short-"] { width: 6rem; }
.org-def-field input[id^="org-code-"] { width: 3.5rem; text-align: center; }
.org-def-row .btn { flex-shrink: 0; padding: .4rem .75rem; font-size: .88rem; }
.org-def-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin: .5rem 0 1rem; }
.org-def-regions-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.org-def-regions-head h4 { margin: 0; font-size: .92rem; color: #444; }
.org-def-region-table input[type="color"] { width: 2.5rem; height: 1.75rem; padding: .1rem; border: 1px solid #ddd; border-radius: 4px; cursor: pointer; vertical-align: middle; }
.org-def-region-table td:nth-child(3) { width: 4rem; }
.org-def-region-table td:nth-child(2) input { width: 3rem; text-align: center; }
.org-def-region-actions { white-space: nowrap; }
.org-def-region-actions .btn-link + .btn-link { margin-left: .5rem; }
.org-def-region-add td { background: #fafafa; }
.org-def-region-add input[type="text"]::placeholder { color: #aaa; }
.btn-link.danger { color: #c0392b; }
.org-def-bases h4 { margin: 0 0 .5rem; font-size: .92rem; color: #444; }
.org-def-empty { color: #888; font-size: .88rem; padding: .5rem 0; }
.hint-inline { font-size: .78rem; color: #888; }
.data-table input[type="text"] { width: 100%; min-width: 120px; padding: .35rem .45rem; border: 1px solid #ddd; border-radius: 4px; font-size: .85rem; }
@media (max-width: 640px) {
  .org-def-field input[id^="org-name-"] { width: 100%; min-width: 8rem; }
}
.brigade-panel { padding: 1.5rem; overflow-y: auto; height: 100%; width: 100%; box-sizing: border-box; }
.brigade-toolbar { margin-bottom: 1rem; }
.brigade-toolbar h2 { margin-bottom: .35rem; }
.brigade-toolbar .hint { color: #666; font-size: .85rem; margin-bottom: .75rem; }
.brigade-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.brigade-form { background: #fff; padding: 1rem; border-radius: 8px; margin-bottom: 1rem; box-shadow: 0 2px 8px rgba(0,0,0,.06); max-width: 420px; }
.brigade-form.hidden { display: none; }
.brigade-form label { display: block; margin-bottom: .6rem; font-size: .85rem; color: #555; }
.brigade-form input { display: block; width: 100%; margin-top: .25rem; padding: .45rem; border: 1px solid #ddd; border-radius: 4px; }
.brigade-form input[type="color"] { height: 36px; padding: .2rem; }
.brigade-form select { display: block; width: 100%; margin-top: .25rem; padding: .45rem; border: 1px solid #ddd; border-radius: 4px; }
.user-brigade-checks {
  max-height: 220px;
  overflow: auto;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: .35rem .6rem;
  margin-top: .25rem;
  background: #fff;
}
.user-brigade-checks .user-brigade-empty { color: #888; font-size: .82rem; padding: .3rem 0; }
.brigade-form .user-brigade-checks label {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: 0;
  padding: .28rem 0;
  font-size: .85rem;
  color: #333;
  cursor: pointer;
}
.brigade-form .user-brigade-checks input[type="checkbox"] {
  display: inline-block;
  width: auto;
  margin: 0;
  flex-shrink: 0;
}
.brigade-region-block { margin-bottom: 1.25rem; }
.brigade-region-block h3 { margin: 0 0 .5rem; font-size: .95rem; color: #333; font-weight: 600; }
.brigade-region-block h3 .brigade-region-meta { font-weight: normal; color: #888; font-size: .8rem; margin-left: .5rem; }
.brigade-company-block { margin-bottom: 1.75rem; }
.brigade-company-block > h3 { margin: 0 0 .75rem; font-size: 1.05rem; border-bottom: 1px solid #eee; padding-bottom: .35rem; }
.brigade-unassigned { color: #c0392b; }
.tag { display: inline-block; padding: .15rem .45rem; border-radius: 4px; font-size: .75rem; }
.tag-supply { background: #e3f2fd; color: #1565c0; }
.tag-manual { background: #e8f5e9; color: #2e7d32; }
.btn-link { background: none; border: none; color: #1565c0; cursor: pointer; padding: 0 .25rem; font-size: .85rem; }
.btn-link.danger { color: #c0392b; }

.soil-popup { min-width: 280px; max-width: 620px; }
.soil-popup h4 { margin: 0 0 .35rem; font-size: 1rem; color: #263238; }
.soil-meta { display: flex; flex-wrap: wrap; gap: .35rem .75rem; color: #607d8b; font-size: .78rem; margin-bottom: .55rem; }
.soil-empty { color: #607d8b; font-size: .88rem; padding: .35rem 0; }
.soil-data-section { margin-top: .65rem; }
.soil-data-section h5 { margin: 0 0 .35rem; color: #37474f; font-size: .85rem; }
.soil-data-table-wrap { max-width: 600px; max-height: 220px; overflow: auto; border: 1px solid #e5e9ef; border-radius: 4px; background: #fff; }
.soil-data-table { border-collapse: collapse; width: max-content; min-width: 100%; font-size: .76rem; }
.soil-data-table th, .soil-data-table td { padding: .35rem .45rem; border-bottom: 1px solid #edf0f4; border-right: 1px solid #edf0f4; white-space: nowrap; text-align: left; }
.soil-data-table th { background: #f6f8fa; color: #455a64; font-weight: 600; position: sticky; top: 0; z-index: 1; }
.soil-data-table tbody th { position: sticky; left: 0; z-index: 2; }
.soil-sample-popup { min-width: 300px; max-width: 520px; }
.soil-sample-table { width: 100%; }
.soil-sample-table td:nth-child(2) { font-variant-numeric: tabular-nums; }

.soil-sample-table td:nth-child(2) { font-variant-numeric: tabular-nums; }

.iot-marker-wrap { background: transparent; border: none; }
.iot-marker {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.28);
  color: #fff; line-height: 0;
  transition: transform .12s ease, box-shadow .12s ease;
}
.iot-marker:hover { transform: scale(1.08); box-shadow: 0 3px 10px rgba(0,0,0,.32); }
.iot-marker .iot-svg { display: block; pointer-events: none; }
.iot-marker.iot-online.iot-cam { background: linear-gradient(145deg, #1976d2, #0d47a1); }
.iot-marker.iot-online.iot-wx { background: linear-gradient(145deg, #43a047, #1b5e20); }
.iot-marker.iot-online.iot-soil { background: linear-gradient(145deg, #8d6e63, #4e342e); }
.iot-marker.iot-online.iot-mon { background: linear-gradient(145deg, #8e24aa, #4a148c); }
.iot-marker.iot-online.iot-mach { background: linear-gradient(145deg, #fb8c00, #e65100); }
.iot-marker.iot-online.iot-ctl { background: linear-gradient(145deg, #546e7a, #263238); }
.iot-marker.iot-online.iot-sen { background: linear-gradient(145deg, #00acc1, #006064); }
.iot-marker.iot-offline, .iot-marker.iot-invalid {
  background: linear-gradient(145deg, #bdbdbd, #757575) !important;
  color: #f5f5f5;
  opacity: .92;
}
.iot-marker.iot-loc-estimate {
  box-shadow: 0 0 0 2px rgba(255,255,255,.95), 0 0 0 4px rgba(21,101,192,.45);
}
.iot-marker.iot-loc-estimate.iot-offline,
.iot-marker.iot-loc-estimate.iot-invalid {
  box-shadow: 0 0 0 2px rgba(255,255,255,.95), 0 0 0 4px rgba(158,158,158,.55);
}
.iot-legend-marker {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; margin-right: .4rem; vertical-align: middle;
}
.iot-legend-marker .iot-marker {
  width: 22px; height: 22px; border-width: 1.5px;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
.iot-legend-marker .iot-marker:hover { transform: none; }
.legend-iot-block .legend-item {
  display: flex; align-items: center; gap: .15rem;
}
.legend-iot-block { margin-top: .65rem; padding-top: .55rem; border-top: 1px solid #e0e0e0; }
.legend-iot-block h4 { margin: 0 0 .35rem; font-size: .85rem; }

/* 国控水质监测站 */
.water-station-marker-wrap { background: transparent; border: none; }
.water-station-marker {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 2.5px solid #fff; box-shadow: 0 2px 7px rgba(0,0,0,.28);
  color: #fff; line-height: 1; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
  background: linear-gradient(145deg, #90a4ae, #546e7a);
}
.water-station-marker:hover { transform: scale(1.1); box-shadow: 0 3px 11px rgba(0,0,0,.34); }
.water-station-marker .wq-drop {
  width: 10px; height: 10px; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: rgba(255,255,255,.95);
  margin-bottom: 1px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.08);
}
.water-station-marker .wq-lv {
  font-size: 9px; font-weight: 700; letter-spacing: -0.02em;
  text-shadow: 0 1px 1px rgba(0,0,0,.25);
  line-height: 1.05; max-width: 30px; overflow: hidden; text-overflow: ellipsis;
}
.water-station-marker.wq-lv1 { background: linear-gradient(145deg, #29b6f6, #0277bd); }
.water-station-marker.wq-lv2 { background: linear-gradient(145deg, #26a69a, #00695c); }
.water-station-marker.wq-lv3 { background: linear-gradient(145deg, #66bb6a, #2e7d32); }
.water-station-marker.wq-lv4 { background: linear-gradient(145deg, #ffca28, #f9a825); color: #3e2723; }
.water-station-marker.wq-lv5 { background: linear-gradient(145deg, #ff9800, #e65100); }
.water-station-marker.wq-lv6 { background: linear-gradient(145deg, #ef5350, #b71c1c); }
.water-station-marker.wq-lv0 { background: linear-gradient(145deg, #b0bec5, #607d8b); }
.water-station-marker.wq-legend {
  width: 22px; height: 22px; margin-right: .35rem; flex-shrink: 0;
  pointer-events: none; box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
.water-station-marker.wq-legend .wq-drop { width: 8px; height: 8px; margin: 0; }
.water-station-marker.wq-legend .wq-lv { display: none; }
.water-station-popup strong.wq-lv1 { color: #0277bd; }
.water-station-popup strong.wq-lv2 { color: #00695c; }
.water-station-popup strong.wq-lv3 { color: #2e7d32; }
.water-station-popup strong.wq-lv4 { color: #f9a825; }
.water-station-popup strong.wq-lv5 { color: #e65100; }
.water-station-popup strong.wq-lv6 { color: #c62828; }
.water-station-popup strong.wq-lv0 { color: #607d8b; }

/* GB5084 灌溉标准对照 */
.wq-irrig-banner {
  margin: .35rem 0 .5rem; padding: .45rem .55rem; border-radius: 6px;
  font-size: .76rem; line-height: 1.45;
}
.wq-irrig-ok {
  background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9;
}
.wq-irrig-bad {
  background: #fff3e0; color: #e65100; border: 1px solid #ffe0b2;
}
.wq-irrig-severe {
  background: #ffebee; color: #b71c1c; border: 1px solid #ffcdd2;
}
.wq-irrig-title { font-weight: 700; margin-bottom: .2rem; }
.wq-irrig-list { margin: .15rem 0 .25rem 1.1rem; padding: 0; }
.wq-irrig-list li { margin: .1rem 0; }
.wq-irrig-note { color: #6d4c41; font-size: .7rem; opacity: .92; }
.wq-irrig-severe .wq-irrig-note { color: #6d1b1b; }
.iot-table tr.wq-row-fail { background: #fff8e1; }
.iot-table tr.wq-row-fail td { border-bottom-color: #ffe082; }
.iot-val.wq-val-fail { color: #e65100 !important; font-weight: 700; }
.iot-val.wq-val-fail-severe { color: #b71c1c !important; font-weight: 700; }
.iot-val.wq-val-warn { color: #ef6c00 !important; font-weight: 700; }
.wq-badge {
  display: inline-block; margin-left: .3rem; padding: 0 .28rem;
  font-size: .65rem; font-weight: 700; border-radius: 3px; line-height: 1.3;
  vertical-align: middle;
}
.wq-badge-fail { background: #ffe0b2; color: #e65100; }
.wq-badge-severe { background: #ffcdd2; color: #b71c1c; }
.wq-badge-warn { background: #fff3e0; color: #ef6c00; }
.wq-limit-hint {
  font-size: .68rem; font-weight: 500; color: #e65100; margin-top: .12rem; line-height: 1.3;
}
.wq-limit-hint.muted { color: #78909c; font-weight: 400; }
.water-station-marker.wq-irrig-alert {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #e65100, 0 2px 7px rgba(0,0,0,.28);
}
.water-station-marker .wq-alert-dot {
  position: absolute; top: -2px; right: -2px;
  width: 9px; height: 9px; border-radius: 50%;
  background: #e53935; border: 1.5px solid #fff;
  box-shadow: 0 0 0 1px rgba(229,57,53,.35);
}
.water-station-marker { position: relative; }
.wq-station-role {
  font-size: .78rem; color: #0d47a1; background: #e3f2fd;
  border-radius: 4px; padding: .2rem .45rem; margin: 0 0 .35rem;
  display: inline-block;
}
.iot-table tr.wq-metric-clickable { cursor: pointer; }
.iot-table tr.wq-metric-clickable:hover { background: #e8f5e9; }
.iot-table tr.wq-metric-active { background: #e3f2fd !important; }
.wq-chart-hint {
  margin-left: .35rem; font-size: .65rem; font-weight: 600;
  color: #1565c0; background: #e3f2fd; border-radius: 3px; padding: 0 .28rem;
}
.wq-series-mount {
  margin-top: .45rem; padding: .4rem .45rem;
  border: 1px solid #e5e9ef; border-radius: 6px; background: #fafcfe;
}
.wq-series-head {
  display: flex; justify-content: space-between; gap: .5rem;
  font-size: .76rem; margin-bottom: .2rem; color: #455a64;
}
.wq-series-svg { width: 100%; height: auto; display: block; }
.wq-chart-axis { font-size: 8px; fill: #90a4ae; }
.wq-chart-dot { fill: #0277bd; }
.wq-series-foot, .wq-series-empty, .wq-series-loading {
  font-size: .72rem; color: #78909c; margin-top: .2rem;
}
.wq-series-empty.iot-error { color: #c62828; }

.iot-popup h4 { margin: 0 0 .35rem; font-size: .95rem; }
.iot-popup { min-width: 240px; font-size: .82rem; line-height: 1.5; }
.iot-popup-rich { min-width: 300px; max-width: 400px; }
.iot-popup-loading .iot-empty { color: #666; padding: .5rem 0; }
.iot-meta { color: #546e7a; font-size: .78rem; margin: .25rem 0 .45rem; }
.iot-empty { color: #888; padding: .35rem 0; font-size: .8rem; }
.iot-empty.iot-error { color: #c62828; }
.iot-empty.iot-offline-hint { color: #757575; }
.iot-table-wrap { max-height: 220px; overflow: auto; border: 1px solid #e5e9ef; border-radius: 6px; margin-top: .35rem; }
.iot-table { width: 100%; border-collapse: collapse; font-size: .76rem; }
.iot-table th, .iot-table td { padding: .35rem .45rem; border-bottom: 1px solid #edf0f4; text-align: left; }
.iot-table th { background: #f6f8fa; color: #455a64; font-weight: 600; position: sticky; top: 0; }
.iot-table td.iot-val { font-variant-numeric: tabular-nums; font-weight: 600; color: #1565c0; }
.iot-table tr.iot-row-offline td { color: #9e9e9e; }
.iot-table tr.iot-warn td.iot-val { color: #ef6c00; }
.iot-table tr.iot-warn-high td.iot-val { color: #c62828; }
.iot-video-wrap { margin-top: .4rem; border-radius: 8px; overflow: hidden; background: #000; width: 100%; }
.iot-video { width: 100%; display: block; background: #000; object-fit: contain; }
.iot-video-wrap-lg { width: 100%; }
.iot-ez-wrap {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  position: relative;
  background: #000;
  overflow: hidden;
}
.iot-ez-wrap > div,
.iot-ez-wrap iframe,
.iot-ez-wrap canvas,
.iot-ez-wrap video {
  width: 100% !important;
  height: 100% !important;
  display: block;
}
.iot-video-lg {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: min(52vh, 480px);
  object-fit: contain;
}
.iot-popup-video { min-width: 0; max-width: 100%; width: 100%; }
.iot-popup-leaflet-video .leaflet-popup-content {
  margin: 12px 14px;
  width: min(680px, calc(92vw - 40px)) !important;
  box-sizing: border-box;
}
.iot-popup-leaflet-video .leaflet-popup-content-wrapper { max-width: min(708px, calc(92vw - 16px)); }
.iot-ptz-wrap { margin-top: .5rem; padding-top: .45rem; border-top: 1px solid #e8ecf0; }
.iot-ptz-label { font-size: .76rem; color: #607d8b; margin-bottom: .35rem; }
.iot-ptz-grid {
  display: grid;
  grid-template-columns: repeat(3, 2.4rem);
  gap: .25rem;
  justify-content: center;
}
.iot-ptz-btn {
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid #cfd8dc;
  border-radius: 6px;
  background: #f5f7fa;
  color: #37474f;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.iot-ptz-btn:hover { background: #e3f2fd; border-color: #90caf9; }
.iot-ptz-btn:active { background: #bbdefb; }
.iot-ptz-spacer { width: 2.4rem; height: 2.4rem; }
.iot-popup-leaflet-video.leaflet-popup { margin-bottom: 12px; }
.iot-loc-hint { color: #607d8b; font-style: italic; }
.iot-popup-leaflet .leaflet-popup-content { margin: 10px 12px; }
.iot-status-online { color: #2e7d32; font-weight: 600; }
.iot-status-offline { color: #757575; font-weight: 600; }
.iot-status-invalid { color: #9e9e9e; font-weight: 600; }

#viewPlantProtection.active { display: flex; flex-direction: column; }
.pp-toolbar { flex-wrap: wrap; gap: .5rem; }
#viewPlantProtection.pp-recon-on .pp-rc-hide { display: none !important; }
#viewPlantProtection:not(.pp-recon-on) .pp-rc-only { display: none !important; }
#viewPlantProtection.pp-recon-on:not(.pp-recon-map-on) .pp-rc-map-only { display: none !important; }
#viewPlantProtection:not(.pp-recon-on) .pp-rc-map-only { display: none !important; }
#viewPlantProtection.pp-recon-on .pp-rc-only,
#viewPlantProtection.pp-recon-on.pp-recon-map-on .pp-rc-map-only {
  display: inline-flex !important;
  align-items: center;
  gap: .35rem;
  font-size: .82rem;
  white-space: nowrap;
}
#viewPlantProtection.pp-recon-on #ppReconAccountSelect {
  font: inherit;
  min-width: 14rem;
  padding: 0 .55rem;
  border: 1px solid #cfd8dc;
  border-radius: 4px;
  background: #fff;
}
.pp-recon-table-wrap {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.pp-recon-table-wrap.hidden { display: none !important; }
#viewPlantProtection.pp-recon-on:not(.pp-recon-map-on) #ppMapWrap {
  display: none !important;
}
#viewPlantProtection.pp-recon-on.pp-recon-map-on #ppReconTableWrap {
  display: none !important;
}
#viewPlantProtection.pp-recon-map-on .pp-map-legend:not(:has(.pp-traj-legend:not(.hidden))) {
  display: none;
}
.pp-recon-table-scroll { overflow: auto; flex: 1; min-height: 0; }
.pp-recon-table-scroll .pp-data-table,
.pp-recon-total-table {
  width: 100%;
  table-layout: fixed;
}
.pp-recon-col-check { width: 2.4rem; }
.pp-recon-col-date { width: 7.2rem; }
.pp-recon-col-mode { width: 5.6rem; }
.pp-recon-col-qty { width: 16rem; }
.pp-recon-col-team { width: auto; }
.pp-recon-col-inc { width: 9.5rem; }
.pp-recon-col-area { width: 7.5rem; }
.pp-recon-col-rate { width: 8.5rem; }
.pp-recon-col-act { width: 11.5rem; }
.pp-recon-col-act-wide { width: 14.5rem; }
.pp-recon-total-wrap {
  flex-shrink: 0;
  border-top: 1px solid #cfd8dc;
  background: #f4f7f4;
}
.pp-recon-total-table {
  margin: 0;
}
.pp-recon-total-table td {
  font-weight: 600;
  background: #f4f7f4;
  border-bottom: none;
  color: #1b5e20;
}
.pp-recon-total-table tbody tr:hover { background: transparent; }
.pp-data-table td.pp-recon-total-qty { white-space: normal; }
.pp-recon-day-total td { font-weight: 600; background: #f4f7f4; }
.pp-recon-page-total {
  padding: .55rem .85rem;
  border-top: 1px solid #dce3dc;
  font-size: .9rem;
}
.pp-recon-dot {
  display: inline-block;
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  margin-right: .3rem;
  vertical-align: middle;
}
.pp-recon-dot.green { background: #2e7d32; }
.pp-recon-dot.red { background: #c62828; }
.pp-recon-filters { flex-shrink: 0; }
.pp-recon-actions { white-space: nowrap; }
.pp-recon-actions .btn { padding: .15rem .4rem; font-size: .75rem; }
.pp-recon-detail-bar { gap: .55rem; }
.pp-recon-detail-date { font-size: 1rem; margin-right: .4rem; }
.pp-recon-check-col { width: 2.2rem; text-align: center; }
.pp-recon-check-col input { vertical-align: middle; }
tr.pp-recon-abn-row td { background: #fff8f7; }
.pp-recon-abn { color: #c62828; font-weight: 600; white-space: nowrap; }
.pp-recon-abn-hint {
  display: block;
  font-weight: 500;
  font-size: .72rem;
  color: #c62828;
  margin-top: .12rem;
  white-space: normal;
  line-height: 1.3;
}
.pp-recon-legend-title {
  font-weight: 600;
  color: #37474f;
  margin-top: .1rem;
}
.pp-swatch.pp-recon-mode-spray {
  background: #fff;
  border: 2px solid #1565c0;
}
.pp-swatch.pp-recon-mode-sow {
  background: #fff;
  border: 2px solid #ef6c00;
}
.pp-swatch.pp-recon-mode-both {
  background: #fff;
  border: 2px dashed #6a1b9a;
}
#ppReconSummaryPane, #ppReconDetailPane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
#ppReconSummaryPane.hidden, #ppReconDetailPane.hidden { display: none !important; }
#viewPlantProtection.pp-timeline-on .pp-tl-hide { display: none !important; }
#viewPlantProtection.pp-timeline-on .pp-tl-only { display: inline-flex !important; align-items: center; }
#viewPlantProtection.pp-timeline-on .pp-tl-only.toolbar-hint,
#viewPlantProtection.pp-timeline-on #ppTimelineMeta.pp-tl-only {
  display: inline !important;
}
#viewPlantProtection:not(.pp-timeline-on) .pp-tl-only { display: none !important; }
#viewPlantProtection:not(.pp-timeline-on):not(.pp-table-on) .pp-map-back-btn,
#viewPlantProtection.pp-recon-on .pp-map-back-btn { display: none !important; }
#viewPlantProtection.pp-timeline-on .pp-map-back-btn,
#viewPlantProtection.pp-table-on .pp-map-back-btn {
  display: inline-flex;
  align-items: center;
}
#viewPlantProtection.pp-strip-on .pp-strip-hide { display: none !important; }
#viewPlantProtection.pp-strip-on #ppStripLegend { display: inline-flex !important; }
#viewPlantProtection:not(.pp-strip-on) #ppStripLegend { display: none !important; }
.pp-mode-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .82rem;
  white-space: nowrap;
}
.pp-mode-select-wrap select {
  font: inherit;
  padding: .28rem .45rem;
  border: 1px solid #cfd8dc;
  border-radius: 4px;
  background: #fff;
  min-width: 8.5rem;
}
.pp-timeline-arrow {
  min-width: 2rem;
  font-weight: 700;
  font-size: 1rem;
  padding: .28rem .45rem;
  line-height: 1;
}
.pp-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid #90a4ae;
  flex: 0 0 auto;
  margin-top: .15rem;
}
.pp-swatch.white { background: #fff; border-color: #455a64; }
.pp-swatch.idle-green { background: #66bb6a; border-color: #2e7d32; }
.pp-swatch.brigade { background: linear-gradient(135deg, #66bb6a, #42a5f5); }
#viewPlantProtection.pp-timeline-on { position: relative; }
#viewPlantProtection.pp-timeline-on:not(.pp-timeline-show-idle) .pp-tl-legend-idle { display: none !important; }
#ppAttributionBtn.hidden { display: none !important; }
#ppaExpandBtn.hidden { display: none !important; }
#ppaMeta.ppa-meta-ok { color: #2e7d32; }
#ppaMeta.ppa-meta-warn { color: #c62828; }
.ppa-dialog {
  width: min(1100px, 96vw);
  max-height: min(90vh, 900px);
  display: flex;
  flex-direction: column;
}
.ppa-header-actions { display: flex; align-items: center; gap: .35rem; }
#ppAttributionModal.ppa-docked {
  align-items: stretch;
  justify-content: flex-end;
  pointer-events: none;
}
#ppAttributionModal.ppa-docked .pp-dji-backdrop {
  display: none;
}
#ppAttributionModal.ppa-docked .ppa-dialog {
  pointer-events: auto;
  width: min(460px, 92vw);
  max-height: calc(100vh - 1.5rem);
  margin: .75rem;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,.28);
}
#ppAttributionModal.ppa-docked .ppa-table-scroll {
  max-height: 28vh;
  min-height: 120px;
}
#ppAttributionModal.ppa-docked .ppa-parcel-detail {
  max-height: calc(100vh - 210px);
}
#ppAttributionModal.ppa-docked .ppa-multi-list {
  max-height: calc(100vh - 220px);
}
#ppAttributionModal.ppa-docked .ppa-modal-hint {
  font-size: .72rem;
}
.ppa-modal-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .65rem;
  padding: .55rem .85rem; border-bottom: 1px solid #e0e0e0; background: #fafafa;
}
.ppa-modal-toolbar .btn.active { background: #e3f2fd; border-color: #90caf9; }
.ppa-modal-hint {
  margin: .55rem .85rem 0; font-size: .8rem; color: #607d8b; line-height: 1.45;
}
#ppAttributionModal.ppa-cover-map {
  inset: auto;
  align-items: stretch;
  justify-content: stretch;
}
#ppAttributionModal.ppa-cover-map .pp-dji-backdrop { display: none; }
#ppAttributionModal.ppa-cover-map .ppa-dialog {
  width: 100%;
  height: 100%;
  max-height: none;
  border-radius: 0;
  box-shadow: none;
}
#ppAttributionModal.ppa-cover-map .ppa-table-scroll {
  max-height: none;
  min-height: 0;
}
#ppAttributionModal.ppa-hints-collapsed #ppaHintBody { display: none; }
.ppa-num { text-align: right; font-variant-numeric: tabular-nums; }
.ppa-team-mode { display: inline-flex; gap: .25rem; align-items: center; }
.ppa-team-mode.hidden { display: none; }
.ppa-progress {
  margin: .45rem .85rem 0;
  padding: .5rem .65rem;
  border: 1px solid #dce7dc;
  border-radius: 8px;
  background: #f7faf7;
}
.ppa-progress-summary {
  font-size: .8rem;
  color: #37474f;
  line-height: 1.45;
  margin-bottom: .35rem;
}
.ppa-progress-days {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  max-height: 7.2rem;
  overflow: auto;
}
.ppa-day-chip {
  display: inline-flex;
  align-items: center;
  padding: .12rem .45rem;
  border-radius: 999px;
  font-size: .72rem;
  line-height: 1.35;
  border: 1px solid transparent;
  white-space: nowrap;
}
.ppa-day-done {
  background: #e8f5e9;
  color: #1b5e20;
  border-color: #a5d6a7;
}
.ppa-day-partial {
  background: #fff8e1;
  color: #e65100;
  border-color: #ffe082;
}
.ppa-day-pending {
  background: #fff3e0;
  color: #bf360c;
  border-color: #ffcc80;
}
.ppa-day-skipped {
  background: #eceff1;
  color: #455a64;
  border-color: #cfd8dc;
}
#ppAttributionModal.ppa-docked .ppa-progress-days {
  max-height: 4.6rem;
}
.ppa-modal-pane {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
  padding: .35rem .85rem .85rem;
}
.ppa-modal-pane.hidden { display: none; }
.ppa-table-scroll { flex: 1; min-height: 280px; max-height: 52vh; }
.ppa-detail-toolbar {
  display: flex; flex-wrap: wrap; gap: .4rem; align-items: center;
  margin-bottom: .45rem;
}
.ppa-parcel-detail {
  flex: 1; min-height: 0; overflow: auto;
  border: 1px solid #eceff1;
  border-radius: 8px;
  padding: .75rem .8rem;
  background: #fff;
}
.ppa-parcel-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem;
  margin-bottom: .55rem;
}
.ppa-parcel-head h3 { margin: 0; font-size: 1.05rem; }
.ppa-muted { color: #78909c; font-size: .78rem; margin: .15rem 0 0; }
.ppa-warn { color: #e65100; font-size: .78rem; margin: .4rem 0; }
.ppa-parcel-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem;
  margin: .5rem 0 .65rem;
}
.ppa-parcel-stats > div {
  background: #f5f7fa; border-radius: 6px; padding: .45rem .35rem; text-align: center;
}
.ppa-stat-n { display: block; font-weight: 700; font-size: 1.05rem; color: #263238; }
.ppa-stat-l { display: block; font-size: .7rem; color: #78909c; margin-top: .15rem; }
.ppa-parcel-flights { margin-top: .35rem; }
.ppa-parcel-flights h4 {
  margin: 0 0 .4rem; font-size: .85rem; color: #455a64; font-weight: 600;
}
.ppa-parcel-flights table, .ppa-multi-list { width: 100%; font-size: .75rem; }
.ppa-parcel-flights th, .ppa-parcel-flights td {
  padding: .32rem .25rem; border-bottom: 1px solid #eceff1; text-align: left; vertical-align: middle;
}
.ppa-parcel-flights th { color: #607d8b; font-weight: 600; position: sticky; top: 0; background: #fff; }
#ppAttributionModal.ppa-docked .ppa-table-scroll {
  max-height: 28vh;
  min-height: 120px;
}
#ppAttributionModal.ppa-docked .ppa-parcel-detail {
  max-height: calc(100vh - 210px);
}
#ppAttributionModal.ppa-docked .ppa-multi-list {
  max-height: calc(100vh - 220px);
}
#ppAttributionModal.ppa-docked .ppa-modal-hint {
  font-size: .72rem;
}
.ppa-tag-multi {
  display: inline-block; margin-left: .25rem; padding: 0 .3rem;
  background: #fff3e0; color: #ef6c00; border-radius: 3px; font-size: .65rem;
}
.ppa-multi-hint { font-size: .78rem; color: #607d8b; margin: 0 0 .55rem; }
.ppa-multi-list { overflow: auto; max-height: 58vh; }
.ppa-multi-item {
  display: flex; gap: .5rem; align-items: flex-start; justify-content: space-between;
  padding: .5rem 0; border-bottom: 1px solid #eceff1;
}
.ppa-multi-main { display: flex; flex-direction: column; gap: .15rem; font-size: .78rem; min-width: 0; }
.ppa-row-multi { background: #fff8e1; }
.pp-range-filter {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .85rem;
  color: #455a64;
  white-space: nowrap;
}
.pp-range-filter label { display: inline-flex; align-items: center; gap: .3rem; }
.pp-range-filter input[type="date"] {
  font: inherit;
  padding: .25rem .4rem;
  border: 1px solid #cfd8dc;
  border-radius: 4px;
  background: #fff;
}
.pp-range-sep { color: #90a4ae; font-size: .8rem; }
.pp-load-points-btn { padding: .25rem .65rem; font-size: .82rem; }
.pp-load-points-btn.is-stop {
  background: #c0392b;
  color: #fff;
  border-color: #c0392b;
}
.pp-upload-btn { cursor: pointer; margin: 0; }
.pp-upload-btn input { display: none; }
.pp-load-progress {
  display: inline-flex; align-items: center; gap: .45rem;
  min-width: 160px; max-width: 280px; margin-left: .25rem;
  font-size: .78rem; color: #455a64;
}
.pp-load-progress.hidden { display: none !important; }
.pp-load-progress-track {
  flex: 1; height: 6px; border-radius: 3px; background: #e3e8ee; overflow: hidden;
}
.pp-load-progress-fill {
  height: 100%; width: 0%; background: #1565c0; transition: width .15s ease;
}
.pp-toolbar-shell { position: relative; background: #fff; }
.pp-toolbar-shell > .pp-toolbar { border-bottom: none; padding-right: 5.4rem; }
#ppToolbar .btn,
#ppToolbar select,
#ppToolbar input[type="date"],
.pp-toolbar-tools .pp-client-download,
.pp-toolbar-tools .pp-settings-gear {
  height: 34px;
  min-height: 34px;
  font-size: .85rem;
  line-height: 1;
  border-radius: 4px;
}
#ppToolbar .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 .75rem;
}
#ppToolbar .btn.hidden { display: none !important; }
#ppToolbar .pp-timeline-arrow {
  min-width: 34px;
  padding: 0 .5rem;
  font-size: 1rem;
}
#ppToolbar select,
#ppToolbar input[type="date"] {
  padding: 0 .55rem;
  border: 1px solid #cfd8dc;
  background: #fff;
}
.pp-toolbar-tools {
  position: absolute; top: .5rem; right: .5rem; z-index: 4;
  display: flex; align-items: center; gap: .35rem;
}
.pp-settings-gear,
.pp-toolbar-tools .pp-client-download,
.pp-toolbar-tools .pp-settings-gear {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; padding: 0;
  border: 1px solid #ccc; background: #fff; box-shadow: none;
  color: #455a64; cursor: pointer;
}
.pp-settings-gear:hover,
.pp-toolbar-tools .pp-client-download:hover,
.pp-toolbar-tools .pp-settings-gear:hover { background: #eceff1; color: #263238; }
@media (max-width: 900px) {
  .pp-toolbar-shell { height: auto; max-height: none; overflow: visible; }
  .pp-toolbar-tools { top: 7px; }
}
.pp-toolbar-status {
  display: flex; align-items: center; flex-wrap: wrap; gap: .35rem .75rem;
  min-height: 1.7rem; padding: .15rem .75rem .4rem;
  background: #f4f7f8; border-bottom: 1px solid #e0e0e0;
}
.pp-toolbar-status .toolbar-hint,
.pp-toolbar-status #ppMeta,
.pp-toolbar-status #ppTimelineMeta {
  margin-left: 0; max-width: none; flex: 1 1 240px;
  white-space: normal; overflow: visible; text-overflow: unset;
}
.pp-toolbar-status .pp-load-progress { margin-left: 0; max-width: 360px; }
#ppSettingsModal { background: rgba(38, 50, 56, .45); }
.pp-settings-panel {
  width: min(560px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); overflow: auto;
  background: #fff; color: #263238; border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .28);
  padding: 0 0 1rem;
}
.pp-settings-panel header {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  position: sticky; top: 0; z-index: 1;
  padding: .85rem 1rem; background: #fff; border-bottom: 1px solid #eceff1;
}
.pp-settings-panel header h3 { margin: 0; font-size: 1rem; }
.pp-settings-block { margin: 0; padding: .85rem 1rem 0; background: #fff; }
.pp-settings-block h4 { margin: 0 0 .4rem; font-size: .92rem; }
.pp-settings-block .hint { margin: .15rem 0 .45rem; color: #607d8b; font-size: .78rem; line-height: 1.45; }
.pp-settings-block input[type="number"] {
  padding: .2rem .35rem; border: 1px solid #cfd8dc; border-radius: 4px; background: #fff;
}
.pp-settings-block .toolbar-check { display: flex; align-items: center; gap: .35rem; margin: .35rem 0; flex-wrap: wrap; }
.pp-settings-block .toolbar-check input[type="number"] { width: 4.5rem; }
.pp-settings-sub { margin: .55rem 0 .15rem; font-size: .82rem; color: #455a64; }
.pp-settings-range { display: flex; align-items: center; gap: .35rem; font-size: .85rem; flex-wrap: wrap; }
.pp-settings-range input { width: 5rem; }
.pp-settings-actions { margin-top: .75rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.pp-excluded-panel { width: min(1080px, calc(100vw - 2rem)); background: #fff; }
.pp-excluded-body { padding: .85rem 1rem 1rem; background: #fff; }
.pp-excluded-filters { display: flex; flex-wrap: wrap; gap: .45rem .6rem; align-items: end; margin-bottom: .45rem; }
.pp-excluded-filters label { display: flex; flex-direction: column; gap: .15rem; font-size: .78rem; color: #455a64; }
.pp-excluded-filters input, .pp-excluded-filters select {
  min-width: 7rem; padding: .28rem .4rem; border: 1px solid #cfd8dc; border-radius: 4px; background: #fff;
}
.pp-excluded-scroll { max-height: min(58vh, 520px); overflow: auto; border: 1px solid #eceff1; border-radius: 8px; background: #fff; }
.pp-excluded-table { width: 100%; border-collapse: collapse; font-size: .78rem; background: #fff; }
.pp-excluded-table th, .pp-excluded-table td { padding: .4rem .5rem; border-bottom: 1px solid #eceff1; text-align: left; white-space: nowrap; }
.pp-excluded-table th { position: sticky; top: 0; background: #f7f9fb; z-index: 1; }
.pp-excluded-table td.pp-excluded-reason { white-space: normal; color: #c62828; min-width: 10rem; }
.pp-excluded-pager { display: flex; gap: .4rem; align-items: center; margin-top: .55rem; font-size: .8rem; }
.pp-excluded-table .btn { padding: .15rem .45rem; font-size: .75rem; min-height: 0; }
.pp-excluded-table th:first-child, .pp-excluded-table td:first-child { width: 2rem; text-align: center; }
#ppExcludedSelectedHint { align-self: center; }
.pp-settings-progress { margin-top: .65rem; }
.pp-settings-progress.hidden { display: none !important; }
.pp-settings-progress .pp-load-progress-track { height: 8px; }
.pp-settings-progress span { display: block; margin-top: .35rem; font-size: .82rem; color: #455a64; }
#ppMeta { margin-left: auto; max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#ppMeta.pp-meta-ok { color: #2e7d32; }
#ppMeta.pp-meta-warn { color: #c62828; }
.pp-map-wrap { flex: 1; min-height: 0; display: flex; position: relative; }
.pp-parcel-timeline-label-host {
  background: transparent !important;
  border: none !important;
}
.pp-parcel-timeline-label {
  position: relative;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #78909c;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  line-height: 1.25;
  color: #263238;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  pointer-events: none;
  text-align: center;
  display: inline-block;
  transform-origin: center center;
}
.pp-parcel-timeline-label--detail {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}
.pp-parcel-timeline-label--cluster {
  white-space: nowrap;
  border-color: #1565c0;
  background: rgba(255, 255, 255, 0.97);
  padding: 3px 8px;
  color: #0d47a1;
}
.pp-parcel-cluster-frame {
  pointer-events: none;
}
.pp-map-legend {
  position: absolute; left: 12px; bottom: 12px; z-index: 800;
  display: flex; flex-direction: column; gap: .35rem;
  max-width: min(420px, calc(100% - 24px));
  padding: .55rem .75rem; border-radius: 8px;
  background: rgba(255, 255, 255, .94); box-shadow: 0 1px 6px rgba(0, 0, 0, .12);
  font-size: .76rem; color: #455a64; line-height: 1.45;
  pointer-events: none;
}
.pp-legend-item { display: flex; align-items: flex-start; gap: .4rem; }
.pp-dot {
  flex-shrink: 0; width: 10px; height: 10px; margin-top: .15rem;
  border-radius: 50%; border: 1px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12);
}
.pp-dot.green { background: #2e7d32; }
.pp-dot.red { background: #c62828; }
.pp-dot.audit { background: #fbc02d; border-color: #f57f17; }
.pp-marker-audit {
  box-shadow: 0 0 0 2px rgba(245, 127, 23, .85), 0 0 6px rgba(251, 192, 45, .45);
}
.pp-traj-legend {
  display: flex; flex-direction: column; gap: .35rem;
  margin-top: .35rem; padding-top: .35rem;
  border-top: 1px solid rgba(0,0,0,.08);
}
.pp-traj-legend.hidden { display: none; }
.pp-traj-line {
  flex-shrink: 0; width: 22px; height: 4px; border-radius: 2px;
  margin-top: .28rem; box-shadow: 0 0 0 1px rgba(0,0,0,.15);
}
.pp-traj-line.white { background: #ffffff; }
.pp-traj-line.yellow { background: #ffeb3b; }
.pp-marker-active {
  box-shadow: 0 0 0 2px rgba(255, 235, 59, .95), 0 0 7px rgba(255, 235, 59, .45);
}
.pp-marker-selected {
  box-shadow: 0 0 0 2px rgba(21, 101, 192, .85), 0 0 8px rgba(66, 165, 245, .4);
}
.pp-marker-selected.pp-marker-active {
  box-shadow: 0 0 0 4px rgba(21, 101, 192, .85), 0 0 0 7px rgba(255, 235, 59, .75), 0 0 14px rgba(66, 165, 245, .45);
}
.pp-takeoff-marker {
  box-shadow: 0 0 0 3px rgba(13, 71, 161, .9), 0 0 12px rgba(66, 165, 245, .55);
}
.pp-dot.takeoff { background: #42a5f5; border-color: #0d47a1; }
.pp-data-table tr.pp-row-selected { background: #e3f2fd !important; }
.pp-data-table tr.pp-row-selected:hover { background: #bbdefb !important; }
.pp-data-table tr.pp-row-audit { background: #fff9c4 !important; }
.pp-data-table tr.pp-row-audit:hover { background: #fff59d !important; }
.pp-data-table tr.pp-row-audit td.pp-tbl-violation { color: #c62828; font-weight: 700; }
.pp-data-table tr.pp-row-selected.pp-row-audit { background: #ffe082 !important; }
.pp-data-table td.pp-tbl-val-viol {
  color: #c62828 !important;
  font-weight: 700;
}.pp-traj-point-popup { font-size: .82rem; line-height: 1.55; min-width: 160px; }
#ppMap { flex: 1; min-width: 0; min-height: 0; }
.pp-stats-panel {
  width: 0; overflow: hidden; background: #fff; border-left: 1px solid #e0e0e0;
  transition: width .2s ease; display: flex; flex-direction: column;
}
.pp-map-wrap.pp-stats-open .pp-stats-panel {
  width: 360px; max-width: 42vw; overflow-y: auto; padding: .85rem 1rem 1.2rem;
  box-shadow: -4px 0 16px rgba(0,0,0,.06);
}
.pp-strip-panel {
  width: 0;
  overflow: hidden;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #fafbfd 0%, #fff 100%);
  border-left: 1px solid #dfe5eb;
  transition: width .22s ease;
  box-shadow: none;
}
.pp-map-wrap.pp-strip-open .pp-strip-panel {
  width: 380px;
  max-width: 40vw;
  box-shadow: -6px 0 24px rgba(21, 47, 68, 0.08);
}
.pp-strip-panel.hidden { display: none; }
.pp-strip-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .65rem;
  padding: 1rem 1rem .75rem;
  border-bottom: 1px solid #e8edf2;
  background: linear-gradient(135deg, #e8f5e9 0%, #e3f2fd 100%);
}
.pp-strip-panel-title-wrap { min-width: 0; flex: 1; }
.pp-strip-panel-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #1b3a4b;
  line-height: 1.35;
  word-break: break-all;
}
.pp-strip-panel-sub {
  margin: .25rem 0 0;
  font-size: .78rem;
  color: #546e7a;
}
.pp-strip-close-btn {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  color: #546e7a;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.pp-strip-close-btn:hover {
  background: #fff;
  color: #263238;
}
.pp-strip-panel-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: .85rem 1rem 1rem;
  overflow: hidden;
}
.pp-strip-range-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: .28rem .65rem;
  margin-bottom: .75rem;
  border-radius: 999px;
  background: #eef2f7;
  color: #546e7a;
  font-size: .74rem;
  letter-spacing: .01em;
}
.pp-strip-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .55rem;
  margin-bottom: .85rem;
}
.pp-strip-summary-card {
  border-radius: 10px;
  padding: .65rem .45rem;
  text-align: center;
  background: #f5f7fa;
  border: 1px solid #e3e8ee;
}
.pp-strip-summary-card.spray {
  background: #e3f2fd;
  border-color: #bbdefb;
}
.pp-strip-summary-card.sow {
  background: #f1f8e9;
  border-color: #c5e1a5;
}
.pp-strip-summary-num {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  color: #263238;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.pp-strip-summary-card.spray .pp-strip-summary-num { color: #1565c0; }
.pp-strip-summary-card.sow .pp-strip-summary-num { color: #2e7d32; }
.pp-strip-summary-label {
  display: block;
  margin-top: .2rem;
  font-size: .68rem;
  color: #607d8b;
}
.pp-strip-table-head {
  margin-bottom: .45rem;
  font-size: .82rem;
  font-weight: 700;
  color: #37474f;
}
.pp-strip-table-scroll {
  flex: 1;
  min-height: 140px;
  overflow: auto;
  border: 1px solid #e3e8ee;
  border-radius: 10px;
  background: #fff;
}
.pp-strip-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}
.pp-strip-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: .55rem .65rem;
  text-align: left;
  background: #f5f7fa;
  color: #546e7a;
  font-weight: 600;
  border-bottom: 1px solid #e3e8ee;
}
.pp-strip-table tbody td {
  padding: .55rem .65rem;
  border-bottom: 1px solid #f0f3f6;
  color: #263238;
  font-variant-numeric: tabular-nums;
}
.pp-strip-table tbody tr:nth-child(even) { background: #fafbfc; }
.pp-strip-table tbody tr:hover { background: #e8f5e9; }
.pp-strip-table tbody tr:last-child td { border-bottom: none; }
.pp-strip-day-row td {
  background: #eceff1;
  font-size: 12px;
  color: #37474f;
  padding: 8px 10px;
  border-bottom: 1px solid #cfd8dc;
}
.pp-strip-flight-row {
  cursor: pointer;
}
.pp-strip-flight-row:hover { background: #e3f2fd !important; }
.pp-strip-flight-row.is-active {
  background: #bbdefb !important;
}
.pp-strip-flight-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding-left: 14px !important;
}
.pp-strip-flight-idx {
  color: #1565c0;
  font-weight: 600;
  font-size: 12px;
}
.pp-strip-flight-mode {
  color: #455a64;
  font-size: 12px;
}
.pp-strip-flight-id {
  color: #90a4ae;
  font-size: 11px;
}
.pp-strip-tag-multi {
  display: inline-block;
  padding: 0 5px;
  border-radius: 3px;
  background: #fff3e0;
  color: #ef6c00;
  font-size: 11px;
}
.pp-strip-flight-action {
  color: #1565c0;
  font-size: 12px;
  white-space: nowrap;
}
.pp-strip-table td:nth-child(2),
.pp-strip-table td:nth-child(3),
.pp-strip-table th:nth-child(2),
.pp-strip-table th:nth-child(3) {
  text-align: right;
}
.pp-strip-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  margin-top: .5rem;
  border: 1px dashed #cfd8dc;
  border-radius: 10px;
  background: #fafbfc;
}
.pp-strip-empty.hidden { display: none; }
.pp-strip-empty p {
  margin: 0;
  font-size: .82rem;
  color: #78909c;
}
.pp-map-wrap.pp-strip-open #ppMap { flex: 1; min-width: 0; }
.pp-stats-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: 1rem; }
.pp-stat-card {
  background: #f1f8e9; border-radius: 8px; padding: .65rem .5rem; text-align: center;
}
.pp-stat-card.warn { background: #ffebee; }
.pp-stat-num { display: block; font-size: 1.35rem; font-weight: 700; color: #1b5e20; }
.pp-stat-card.warn .pp-stat-num { color: #b71c1c; }
.pp-stat-label { font-size: .72rem; color: #666; }
.pp-chart { margin-bottom: 1rem; }
.pp-chart h4 { margin: 0 0 .5rem; font-size: .88rem; color: #37474f; }
.pp-bar-row { display: grid; grid-template-columns: 88px 1fr 36px; gap: .35rem; align-items: center; margin-bottom: .35rem; font-size: .78rem; }
.pp-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #555; }
.pp-bar-track { height: 8px; background: #eceff1; border-radius: 4px; overflow: hidden; }
.pp-bar-fill { height: 100%; background: linear-gradient(90deg, #66bb6a, #2e7d32); border-radius: 4px; }
.pp-bar-val { text-align: right; color: #333; font-variant-numeric: tabular-nums; }
.pp-excluded-list { max-height: 240px; overflow-y: auto; border: 1px solid #eee; border-radius: 6px; padding: .35rem; }
.pp-excluded-item {
  display: flex; gap: .45rem; align-items: flex-start; padding: .35rem .25rem;
  border-bottom: 1px solid #f0f0f0; font-size: .78rem; cursor: pointer;
}
.pp-excluded-item:last-child { border-bottom: none; }
.pp-excluded-item small { color: #888; }
.pp-empty { color: #888; font-size: .82rem; margin: .25rem 0; }
.pp-popup-actions { margin-top: .5rem; }
.pp-popup-btn { font-size: .78rem; padding: .25rem .55rem; }
#ppStatsBtn.active { background: #2e7d32; color: #fff; border-color: #2e7d32; }
.pp-type-summary { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; margin-bottom: 1rem; }
.pp-type-card { border-radius: 8px; padding: .65rem .75rem; border: 1px solid #e0e0e0; }
.pp-type-card.spread { background: #fff8e1; border-color: #ffe082; }
.pp-type-card.spray { background: #e3f2fd; border-color: #90caf9; }
.pp-type-title { font-weight: 700; font-size: .92rem; margin-bottom: .35rem; }
.pp-type-metrics { display: flex; gap: .75rem; font-size: .78rem; color: #555; margin-bottom: .25rem; }
.pp-type-dosage { font-size: .85rem; color: #1b5e20; font-weight: 600; }
.pp-type-card.spray .pp-type-dosage { color: #0d47a1; }
.pp-type-dosage.muted { color: #999; font-weight: 400; }
.pp-bar-sub { font-size: .72rem; color: #888; margin: -.15rem 0 .35rem 92px; }

.pp-stats-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem; margin-bottom: .75rem;
}
.pp-stats-header h3 { margin: 0; font-size: 1rem; }
.pp-stats-close { font-size: .78rem; padding: .2rem .55rem; }
.pp-stats-filters {
  display: flex; flex-wrap: wrap; gap: .45rem .65rem; align-items: center;
  margin-bottom: .85rem; font-size: .78rem; color: #555;
}
.pp-stats-filters label { display: inline-flex; align-items: center; gap: .25rem; }
.pp-stats-filters input[type="date"] {
  border: 1px solid #cfd8dc; border-radius: 4px; padding: .15rem .35rem; font-size: .78rem;
}
.pp-stats-range-hint { color: #78909c; font-size: .72rem; }
.pp-stats-account-filter {
  margin: 0 0 .85rem; padding: .55rem .65rem; border: 1px solid #e0e0e0;
  border-radius: 6px; background: #fafafa; font-size: .78rem;
}
.pp-stats-account-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem; margin-bottom: .4rem; color: #455a64; font-weight: 600;
}
.pp-stats-acc-list { display: flex; flex-wrap: wrap; gap: .35rem .65rem; }
.pp-stats-acc-item {
  display: inline-flex; align-items: center; gap: .3rem;
  color: #37474f; font-weight: 400; cursor: pointer;
}
.pp-stats-acc-item input { margin: 0; }

.pp-dji-sync-log {
  margin: 0; padding: .75rem 1rem 1rem;
  border-top: 1px solid #e0e0e0; background: #fafafa;
  flex: 1; min-height: 140px; display: flex; flex-direction: column;
}
.pp-dji-sync-log-head {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  margin-bottom: .35rem;
}
.pp-dji-sync-log-head h4 { margin: 0; font-size: .88rem; color: #37474f; }
.pp-dji-sync-log-refresh { font-size: .75rem; padding: .2rem .55rem; }
.pp-dji-sync-log-hint { margin: 0 0 .5rem; font-size: .74rem; color: #78909c; }
.pp-dji-sync-log-list {
  flex: 1; overflow-y: auto; max-height: 220px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .74rem; line-height: 1.45; color: #455a64;
  background: #fff; border: 1px solid #e8e8e8; border-radius: 6px; padding: .55rem .65rem;
}
.pp-dji-sync-log-entry { margin-bottom: .85rem; padding-bottom: .65rem; border-bottom: 1px dashed #eceff1; }
.pp-dji-sync-log-entry:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.pp-dji-sync-log-entry-head { font-weight: 600; color: #263238; margin-bottom: .25rem; }
.pp-dji-sync-log-entry-head .status-failed { color: #c62828; }
.pp-dji-sync-log-entry-head .status-partial { color: #ef6c00; }
.pp-dji-sync-log-entry-head .status-running { color: #1565c0; }
.pp-dji-sync-log-entry-body { white-space: pre-wrap; word-break: break-word; color: #546e7a; }

.pp-dji-modal { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; }
.pp-dji-modal.hidden { display: none; }
.pp-dji-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.pp-dji-dialog {
  position: relative; z-index: 1; width: min(720px, 96vw); max-height: min(88vh, 640px);
  background: #fff; border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,.22);
  display: flex; flex-direction: column; overflow: hidden;
}
.pp-dji-header { display: flex; align-items: center; justify-content: space-between; padding: .65rem 1rem; border-bottom: 1px solid #e0e0e0; }
.pp-dji-header h3 { margin: 0; font-size: 1rem; }
.pp-dji-close { font-size: 1.25rem; line-height: 1; padding: .15rem .5rem; }
.pp-dji-toolbar { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; padding: .55rem 1rem; border-bottom: 1px solid #eee; background: #fafafa; }
.pp-dji-status { font-size: .82rem; color: #666; margin-right: .25rem; }
.pp-dji-status.ok { color: #2e7d32; font-weight: 600; }
.pp-dji-status.warn { color: #c62828; }
.pp-dji-date { font-size: .82rem; display: flex; align-items: center; gap: .25rem; }
.pp-dji-date input { font-size: .82rem; padding: .2rem .35rem; border: 1px solid #ccc; border-radius: 4px; }
.pp-dji-hint { margin: 0; padding: .55rem 1rem; font-size: .78rem; color: #666; background: #fffde7; border-bottom: 1px solid #fff9c4; }
.pp-dji-traj-warn {
  margin: 0;
  padding: .45rem 1rem;
  font-size: .78rem;
  color: #b71c1c;
  background: #ffebee;
  border-bottom: 1px solid #ffcdd2;
}
.pp-dji-traj-warn.hidden { display: none; }
.pp-dji-include-traj { font-size: .82rem; }
.pp-dji-login-panel { flex: 1; min-height: 0; overflow: auto; padding: 1rem; }
.pp-dji-form { display: flex; flex-wrap: wrap; gap: .65rem; align-items: flex-end; max-width: 720px; }
.pp-dji-form label { display: flex; flex-direction: column; gap: .25rem; font-size: .82rem; color: #444; }
.pp-dji-form input { min-width: 180px; padding: .35rem .5rem; border: 1px solid #ccc; border-radius: 4px; font-size: .88rem; }
.pp-dji-form select { min-width: 160px; padding: .35rem .5rem; border: 1px solid #ccc; border-radius: 4px; font-size: .88rem; }
.pp-dji-settings { margin-top: .75rem; padding-top: .75rem; border-top: 1px dashed #ddd; }
.pp-dji-settings.hidden { display: none; }
.pp-dji-settings h4 { margin: 0 0 .35rem; font-size: .9rem; }
.pp-dji-settings-hint { margin: 0 0 .5rem; font-size: .76rem; color: #777; }
.pp-dji-acc-list { list-style: none; margin: .5rem 0 0; padding: 0; max-height: 160px; overflow-y: auto; }
.pp-dji-acc-list li { display: flex; justify-content: space-between; align-items: center; padding: .35rem 0; border-bottom: 1px solid #eee; font-size: .82rem; }
.pp-dji-acc-list button { font-size: .75rem; padding: .15rem .45rem; }
.pp-dji-account-hint { font-size: .78rem; color: #78909c; }
.pp-dji-account-hint.warn { color: #c62828; }
.pp-dji-report {
  margin: 0; padding: .75rem 1rem; border-bottom: 1px solid #eee;
  background: #f8faf8; max-height: 280px; overflow-y: auto;
}
.pp-dji-report.hidden { display: none; }
.pp-dji-report h4 { margin: 0 0 .5rem; font-size: .88rem; }
.pp-dji-report-summary { font-size: .82rem; color: #455a64; margin-bottom: .65rem; }
.pp-dji-report-list { list-style: none; margin: 0; padding: 0; }
.pp-dji-report-list li {
  padding: .45rem .55rem; margin-bottom: .35rem; border-radius: 6px;
  font-size: .8rem; background: #fff; border: 1px solid #e8e8e8;
}
.pp-dji-report-list li.success { border-left: 3px solid #2e7d32; }
.pp-dji-report-list li.empty { border-left: 3px solid #78909c; }
.pp-dji-report-list li.failed { border-left: 3px solid #c62828; }
.pp-dji-report-list .acc-title { font-weight: 600; color: #37474f; }
.pp-dji-report-list .acc-msg { color: #546e7a; margin-top: .15rem; }

.pp-dji-night-sync {
  margin-top: 1rem; padding: .85rem 1rem;
  border: 1px solid #e3eaf0; border-radius: 10px;
  background: linear-gradient(180deg, #f8fbff 0%, #f3f7fb 100%);
}
.pp-night-sync-head {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  margin-bottom: .35rem;
}
.pp-night-sync-head h4 { margin: 0; font-size: .92rem; color: #263238; }
.pp-night-sync-badge {
  flex-shrink: 0; padding: .15rem .55rem; border-radius: 999px;
  background: #e3f2fd; color: #1565c0; font-size: .72rem; font-weight: 600;
}
.pp-night-sync-card {
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem;
  margin-top: .65rem; padding: .75rem .85rem; border-radius: 8px;
  background: #fff; border: 1px solid #e8eef3;
}
.pp-night-sync-toggle {
  display: inline-flex; align-items: center; gap: .55rem; cursor: pointer;
  font-size: .86rem; color: #37474f; user-select: none;
}
.pp-night-sync-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.pp-night-sync-switch {
  width: 42px; height: 24px; border-radius: 999px; background: #cfd8dc;
  position: relative; transition: background .2s ease;
}
.pp-night-sync-switch::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.18); transition: transform .2s ease;
}
.pp-night-sync-toggle input:checked + .pp-night-sync-switch { background: #42a5f5; }
.pp-night-sync-toggle input:checked + .pp-night-sync-switch::after { transform: translateX(18px); }
.pp-night-sync-interval {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .82rem; color: #546e7a;
}
.pp-night-sync-interval select {
  min-width: 110px; padding: .35rem .5rem; border: 1px solid #cfd8dc;
  border-radius: 6px; background: #fff; font-size: .84rem;
}
.pp-night-sync-save { min-width: 96px; }
.pp-night-sync-status {
  margin: .55rem 0 0; font-size: .78rem; color: #607d8b; line-height: 1.45;
}

.pp-popup-divider { border: none; border-top: 1px solid #e0e0e0; margin: .45rem 0; }
.pp-drone-badges { display: inline-flex; flex-wrap: wrap; gap: .25rem; }
.pp-badge {
  display: inline-block; font-size: .68rem; padding: .1rem .4rem; border-radius: 999px;
  font-weight: 600; line-height: 1.3;
}
.pp-badge-online { background: #e8f5e9; color: #2e7d32; }
.pp-badge-offline { background: #eceff1; color: #546e7a; }
.pp-badge-locked { background: #ffebee; color: #c62828; }
.pp-badge-unlocked { background: #e3f2fd; color: #1565c0; }
.pp-device-list { display: flex; flex-direction: column; gap: .45rem; }
.pp-device-card {
  border: 1px solid #e0e0e0; border-radius: 6px; padding: .45rem .55rem; background: #fafafa;
}
.pp-device-head { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-size: .82rem; }
.pp-device-meta { font-size: .72rem; color: #607d8b; margin-top: .2rem; word-break: break-all; }

.pp-map-wrap.pp-traj-loading { pointer-events: none; }

.pp-table-wrap {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
  background: #fff; overflow: hidden;
}
.pp-table-wrap.hidden { display: none; }
.pp-table-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .65rem;
  padding: .55rem .75rem; border-bottom: 1px solid #e0e0e0; background: #fafafa;
  font-size: .82rem;
}
.pp-table-toolbar label { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
.pp-table-toolbar input[type="date"],
.pp-table-toolbar input[type="search"],
.pp-table-toolbar select {
  font: inherit; padding: .25rem .45rem; border: 1px solid #cfd8dc; border-radius: 4px;
}
.pp-table-search input { min-width: 140px; }
.pp-table-count { margin-left: auto; color: #546e7a; font-size: .78rem; }
.pp-table-scroll { flex: 1; min-height: 0; overflow: auto; }
.pp-multi-filter {
  position: relative;
  font-size: .8rem;
}
.pp-multi-filter > summary {
  list-style: none;
  cursor: pointer;
  padding: .25rem .55rem;
  border: 1px solid #cfd8dc;
  border-radius: 4px;
  background: #fff;
  user-select: none;
}
.pp-multi-filter > summary::-webkit-details-marker { display: none; }
.pp-multi-filter-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  min-width: 220px;
  max-width: 300px;
  max-height: 260px;
  overflow: auto;
  background: #fff;
  border: 1px solid #cfd8dc;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
  padding: .45rem .55rem;
}
.pp-multi-filter-actions {
  display: flex;
  gap: .35rem;
  margin-bottom: .4rem;
}
.pp-multi-filter-actions .btn { font-size: .72rem; padding: .1rem .45rem; }
.pp-multi-filter-list { display: flex; flex-direction: column; gap: .28rem; }
.pp-multi-filter-list label {
  display: flex;
  align-items: center;
  gap: .35rem;
  white-space: nowrap;
  font-size: .78rem;
}
.pp-table-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .65rem;
  flex-wrap: wrap;
  padding: .45rem .75rem;
  border-top: 1px solid #eceff1;
  background: #fafafa;
  font-size: .78rem;
  color: #546e7a;
}
.pp-table-page-size {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  white-space: nowrap;
}
.pp-table-page-size select {
  padding: .2rem .4rem;
  border: 1px solid #cfd8dc;
  border-radius: 4px;
  background: #fff;
}
.pp-table-pager-controls {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
}
.chat-log-cell {
  white-space: pre-wrap;
  max-width: 22rem;
  max-height: 7.5rem;
  overflow: auto;
  vertical-align: top;
}
.pp-table-pager .btn { font-size: .74rem; padding: .15rem .5rem; }
.pp-table-pager .pp-page-num {
  min-width: 1.6rem;
  text-align: center;
  padding: .15rem .35rem;
  border-radius: 3px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
}
.pp-table-pager .pp-page-num.active {
  border-color: #90a4ae;
  background: #eceff1;
  font-weight: 600;
}
.pp-stats-query-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: .35rem 0 .55rem;
  flex-wrap: wrap;
}
.pp-stats-pilot-placeholder {
  padding: .65rem .75rem;
  border: 1px dashed #cfd8dc;
  border-radius: 6px;
  background: #fafafa;
  margin-bottom: .75rem;
}
.pp-stats-pilot-placeholder p {
  margin: .35rem 0 0;
  font-size: .75rem;
  color: #78909c;
}
.pp-data-table {
  width: 100%; border-collapse: collapse; font-size: .78rem;
}
.pp-data-table th, .pp-data-table td {
  padding: .45rem .55rem; border-bottom: 1px solid #eceff1; text-align: left;
  white-space: nowrap;
}
.pp-data-table th {
  position: sticky; top: 0; z-index: 2;
  background: #f5f5f5; font-weight: 600; color: #37474f; cursor: pointer;
  user-select: none;
}
.pp-data-table th:hover { background: #eeeeee; }
.pp-data-table th.sort-desc::after { content: ' ↓'; color: #2e7d32; }
.pp-data-table th.sort-asc::after { content: ' ↑'; color: #2e7d32; }
.pp-data-table tbody tr:hover { background: #f1f8e9; }
.pp-data-table .pp-tbl-muted { color: #90a4ae; }
.pp-data-table .pp-tbl-included { color: #2e7d32; font-weight: 600; }
.pp-data-table .pp-tbl-excluded { color: #c62828; }
.pp-data-table .pp-tbl-actions { display: flex; gap: .25rem; }
.pp-data-table .pp-tbl-actions .btn { padding: .15rem .45rem; font-size: .72rem; min-height: 0; }
#ppStatsBtn.active { background: #2e7d32; color: #fff; border-color: #2e7d32; }
#ppMapWrap.pp-hidden { display: none; }
.pp-traj-loading-mask {
  position: absolute; inset: 0; z-index: 1200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .72); backdrop-filter: blur(2px);
  pointer-events: auto;
}
.pp-traj-loading-mask.hidden { display: none; }
.pp-traj-loading-box {
  display: flex; flex-direction: column; align-items: center; gap: .65rem;
  padding: 1rem 1.25rem; border-radius: 10px;
  background: #fff; box-shadow: 0 4px 18px rgba(0,0,0,.12);
  color: #37474f; font-size: .88rem;
}
.pp-traj-spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid #e0e0e0; border-top-color: #42a5f5;
  animation: ppTrajSpin .8s linear infinite;
}
@keyframes ppTrajSpin { to { transform: rotate(360deg); } }

.pp-strip-compute-box {
  display: flex; flex-direction: column; align-items: stretch; gap: .75rem;
  min-width: min(420px, 88vw); max-width: 480px;
  padding: 1.15rem 1.35rem; border-radius: 10px;
  background: #fff; box-shadow: 0 4px 18px rgba(0,0,0,.12);
  color: #37474f;
}
.pp-strip-compute-title {
  margin: 0; font-size: .95rem; font-weight: 600; color: #263238; text-align: center;
}
.pp-strip-compute-track {
  height: 8px; border-radius: 4px; background: #e3e8ee; overflow: hidden;
}
.pp-strip-compute-fill {
  height: 100%; width: 8%; background: #1565c0;
  transition: width .25s ease;
}
.pp-strip-compute-fill.pp-strip-compute-indeterminate {
  width: 35% !important;
  animation: ppStripComputeSlide 1.2s ease-in-out infinite;
}
@keyframes ppStripComputeSlide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}
.pp-strip-compute-hint {
  margin: 0; font-size: .8rem; line-height: 1.45; color: #546e7a; text-align: center;
}

.pp-audit-dates {
  display: flex; flex-wrap: wrap; gap: .75rem 1rem; margin: .55rem 0 .65rem;
}
.pp-audit-dates label {
  display: flex; flex-direction: column; gap: .25rem; font-size: .82rem; color: #546e7a;
}
.pp-audit-dates input { padding: .35rem .5rem; border: 1px solid #ccc; border-radius: 4px; }
.pp-audit-stats { margin-top: .65rem; }
.pp-audit-stat-grid {
  display: flex; flex-wrap: wrap; gap: .65rem 1rem; font-size: .82rem; color: #455a64;
}
.pp-audit-period-item {
  padding: .5rem .6rem; margin-bottom: .35rem; border-radius: 6px;
  background: #fff8e1; border: 1px solid #ffe082; font-size: .82rem;
}
.pp-audit-period-records { color: #78909c; font-size: .76rem; margin-top: .2rem; word-break: break-all; }

.ai-settings-panel { padding: 1rem 1.25rem; overflow: auto; height: 100%; }
.ai-settings-header h2 { margin: 0 0 .35rem; }
.ai-settings-form { max-width: 960px; margin-top: 1rem; }
.ai-settings-active { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; font-size: .88rem; }
.ai-settings-active select { max-width: 280px; padding: .4rem .55rem; border: 1px solid #ccc; border-radius: 4px; }
.ai-provider-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.ai-provider-card {
  padding: .85rem 1rem; border: 1px solid #e0e0e0; border-radius: 8px; background: #fafafa;
}
.ai-provider-card h4 { margin: 0 0 .45rem; font-size: .92rem; }
.ai-provider-card label {
  display: flex; flex-direction: column; gap: .25rem; margin-top: .55rem;
  font-size: .78rem; color: #546e7a;
}
.ai-provider-card input {
  padding: .35rem .5rem; border: 1px solid #ccc; border-radius: 4px; font-size: .88rem;
}
.ai-key-masked { font-size: .78rem; color: #2e7d32; }
.ai-key-masked.muted { color: #78909c; }
.ai-settings-actions { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; }
#viewAiSettings.active { display: flex; flex-direction: column; }

.ext-api-panel { padding: 1rem 1.25rem; overflow: auto; height: 100%; }

.backup-panel {
  padding: 1rem 1.25rem 1.5rem;
  overflow: auto;
  height: 100%;
  box-sizing: border-box;
}
.backup-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .75rem;
}
.backup-header h2 { margin: 0 0 .35rem; }
.backup-header .hint { margin: 0; max-width: 52rem; line-height: 1.45; }
.backup-list { display: flex; flex-direction: column; gap: 1rem; margin-top: .75rem; }
.backup-group {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  padding: .85rem 1rem 1rem;
}
.backup-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .55rem;
  flex-wrap: wrap;
}
.backup-group-head h3 { margin: 0; font-size: 1.05rem; color: #1a2744; }
.backup-table-wrap { overflow-x: auto; }
.backup-table { margin-top: 0; }
.backup-table .backup-name {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .8rem;
  word-break: break-all;
}
.backup-table .backup-size { white-space: nowrap; font-variant-numeric: tabular-nums; }
.backup-size-hint {
  display: inline-block;
  margin-left: .25rem;
  padding: .05rem .35rem;
  border-radius: 4px;
  background: #fff3e0;
  color: #e65100;
  font-size: .72rem;
}
.backup-actions { white-space: nowrap; }
.backup-dl-btn { font-size: .8rem; padding: .25rem .65rem; text-decoration: none; display: inline-block; }
.backup-kind {
  display: inline-block;
  padding: .1rem .45rem;
  border-radius: 4px;
  font-size: .75rem;
  font-weight: 600;
  background: #eceff1;
  color: #455a64;
}
.backup-kind-db { background: #e3f2fd; color: #1565c0; }
.backup-kind-app { background: #e8f5e9; color: #2e7d32; }
.backup-kind-refs { background: #f3e5f5; color: #6a1b9a; }
.backup-kind-soil { background: #fff8e1; color: #f57f17; }
.backup-kind-manifest { background: #f5f5f5; color: #616161; }
.backup-empty { color: #90a4ae; padding: 1.5rem 0; }
.ext-api-header h2 { margin: 0 0 .35rem; }
.ext-api-form { max-width: 960px; margin-top: 1rem; }
.ext-api-form h3 {
  margin: 1.35rem 0 .65rem; font-size: .95rem; color: #37474f;
  border-bottom: 1px solid #e8e8e8; padding-bottom: .35rem;
}
.ext-api-form > label {
  display: flex; flex-direction: column; gap: .25rem;
  margin-top: .65rem; font-size: .82rem; color: #546e7a;
}
.ext-api-form > label input[type="text"],
.ext-api-form > label input[type="password"] {
  padding: .4rem .55rem; border: 1px solid #ccc; border-radius: 4px; font-size: .88rem;
  max-width: 520px;
}
.ext-sentinel-card {
  padding: .85rem 1rem; margin: .75rem 0; border: 1px solid #e0e0e0;
  border-radius: 8px; background: #fafafa;
}
.ext-sentinel-card-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: .65rem 1rem; margin-bottom: .35rem;
}
.ext-sentinel-card-head h4 { margin: 0; font-size: .92rem; flex: 1; }
.ext-sentinel-enabled {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .82rem; color: #546e7a; margin: 0;
}
.ext-sentinel-card label {
  display: flex; flex-direction: column; gap: .25rem; margin-top: .55rem;
  font-size: .78rem; color: #546e7a;
}
.ext-sentinel-test-row {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  margin-top: .55rem;
  flex-wrap: wrap;
}
.ext-sentinel-test-msg { flex: 1; min-width: 160px; font-size: .78rem; }
.ext-sentinel-test-msg.ok { color: #2e7d32; }
.ext-sentinel-test-msg.err { color: #c62828; }
.ext-sentinel-card input[type="text"],
.ext-sentinel-card input[type="password"] {
  padding: .35rem .5rem; border: 1px solid #ccc; border-radius: 4px; font-size: .88rem;
}
#extSentinelAddBtn { margin-top: .5rem; }
.ext-cache-stats {
  margin: .5rem 0 0; padding: .75rem .85rem;
  background: #f5f7f8; border: 1px solid #e0e0e0; border-radius: 8px;
  line-height: 1.55;
}
.ext-cache-stats .muted { color: #78909c; margin-top: .35rem; }
#viewExternalApi.active { display: flex; flex-direction: column; }

.pp-audit-dialog { width: min(820px, 96vw); max-height: min(90vh, 720px); }
.pp-audit-body { padding: 1rem; overflow-y: auto; flex: 1; min-height: 0; }
.pp-audit-body textarea {
  width: 100%; min-height: 110px; padding: .65rem; border: 1px solid #ccc;
  border-radius: 6px; font-size: .88rem; resize: vertical;
}
.pp-audit-actions { margin: .65rem 0; display: flex; gap: .5rem; flex-wrap: wrap; }
.pp-audit-thresholds {
  display: flex; flex-direction: column; gap: .55rem;
  margin: .65rem 0; padding: .65rem .75rem;
  background: #f5f5f5; border-radius: 8px; border: 1px solid #e0e0e0;
}
.pp-audit-threshold-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .65rem;
  font-size: .82rem;
}
.pp-audit-threshold-enable { font-weight: 600; min-width: 160px; }
.pp-audit-threshold-row input[type="number"] {
  width: 88px; padding: .3rem .45rem; border: 1px solid #ccc; border-radius: 4px;
}
.pp-audit-filters {
  display: flex; flex-direction: column; gap: .35rem;
  margin-top: .25rem; padding-top: .45rem; border-top: 1px dashed #d0d0d0;
  font-size: .82rem;
}
.pp-audit-rules, .pp-audit-violations { margin-top: .75rem; }
.pp-audit-rules h4, .pp-audit-violations h4 { margin: 0 0 .45rem; font-size: .88rem; }
.pp-audit-rule-item, .pp-audit-violation-item {
  padding: .45rem .55rem; margin-bottom: .35rem; border-radius: 6px;
  font-size: .82rem; background: #f8faf8; border: 1px solid #e8e8e8;
}
.pp-audit-violation-item.high { border-left: 3px solid #c62828; }
.pp-audit-violation-item.medium { border-left: 3px solid #f9a825; }
.pp-audit-violation-item.info { border-left: 3px solid #78909c; }
.pp-daily-audit-summary {
  margin: .75rem 0;
  padding: .85rem 1rem;
  background: linear-gradient(135deg, #eef6ff 0%, #f7fafc 100%);
  border: 1px solid #c5d8ec;
  border-radius: 8px;
  line-height: 1.55;
  color: #263238;
  font-size: .92rem;
  white-space: pre-wrap;
}
.pp-daily-audit-summary.empty { color: #78909c; background: #f5f7fa; border-color: #e0e6ed; }
.pp-daily-audit-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin-top: .55rem;
  color: #1565c0;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* ── Mobile layout ── */
.mobile-header { display: none; }
.sidebar-backdrop {
  display: none;
  pointer-events: none;
}

@media (max-width: 768px) {
  body.sidebar-lock { overflow: hidden; }

  .mobile-header {
    display: flex; align-items: center; gap: .65rem;
    flex-shrink: 0;
    height: calc(52px + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) .75rem 0;
    background: #1a2744; color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
    z-index: 1100;
  }
  .mobile-menu-btn {
    flex-shrink: 0; width: 44px; height: 44px;
    border: none; border-radius: 8px;
    background: rgba(255,255,255,.1); color: #fff;
    font-size: 1.35rem; line-height: 1; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-menu-btn:active { background: rgba(255,255,255,.2); }
  .mobile-view-title {
    flex: 1; min-width: 0;
    font-size: .95rem; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .mobile-user {
    flex-shrink: 0; max-width: 38%;
    font-size: .72rem; color: #90caf9;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }

  .app-shell {
    flex-direction: column;
    height: 100dvh;
    height: 100vh;
  }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: min(280px, 88vw);
    z-index: 1200;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,.25);
  }
  .app-shell.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1150;
  }
  .app-shell.sidebar-open .sidebar-backdrop {
    display: block;
    pointer-events: auto;
  }

  .main { flex: 1; min-height: 0; }

  .menu-item {
    min-height: 48px; padding: .85rem 1.25rem; font-size: .95rem;
  }
  .menu-group-title { min-height: 48px; font-size: .95rem; }
  .menu-sub-item { font-size: .9rem; padding-left: 2rem; }
  .logout-btn { min-height: 44px; margin: .75rem 1rem 1rem; }

  .toolbar {
    padding: .5rem; gap: .4rem;
    max-height: 42vh; overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    align-items: stretch;
  }
  .toolbar select {
    min-width: 0; min-height: 40px;
    flex: 1 1 calc(50% - .25rem);
    font-size: .88rem;
  }
  #basemapSelect, #colorModeSelect, #geovisYearSelect, #sentinel2LayerSelect {
    flex: 1 1 calc(50% - .25rem);
  }
  #mapFilterWrap {
    display: flex; flex-wrap: wrap; gap: .35rem;
    width: 100%; flex: 1 1 100%;
  }
  #mapFilterWrap select { flex: 1 1 calc(50% - .2rem); }
  .toolbar-check {
    min-height: 40px; font-size: .82rem;
    flex: 0 1 auto;
  }
  .toolbar-check-group { width: 100%; gap: .4rem; }
  .toolbar-hint {
    margin-left: 0 !important; width: 100%;
    white-space: normal; font-size: .72rem; order: 99;
  }
  #imageryMeta, #agMeta, #ppMeta {
    max-width: none; width: 100%; margin-left: 0 !important;
    white-space: normal; order: 98;
  }
  .map-edit-only, .selection-bar, .soil-edit-toolbar {
    width: 100%; flex-wrap: wrap;
  }
  .selection-bar { justify-content: flex-start; }
  .form-actions { flex-direction: column; }
  .form-actions .btn { width: 100%; min-height: 44px; }
  .btn { min-height: 40px; padding: .5rem .85rem; }

  .parcel-panel {
    position: fixed; left: 0; right: 0; top: auto; bottom: 0;
    width: auto; max-height: min(72vh, 520px);
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -6px 28px rgba(0,0,0,.2);
    padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  }
  .legend {
    bottom: 10px; left: 8px; right: 8px;
    max-width: none; max-height: 120px;
    font-size: .68rem;
  }

  .pp-toolbar { padding: .45rem .5rem; }
  .pp-map-wrap { flex-direction: column; }
  .pp-map-wrap.pp-stats-open .pp-stats-panel {
    position: fixed;
    top: calc(52px + env(safe-area-inset-top, 0px));
    left: 0; right: 0; bottom: 0;
    width: 100% !important; max-width: none;
    z-index: 900; overflow-y: auto;
    padding: .85rem .85rem calc(1rem + env(safe-area-inset-bottom, 0px));
    box-shadow: none; border-left: none;
  }
  .pp-map-wrap.pp-strip-open .pp-strip-panel {
    position: fixed;
    top: calc(52px + env(safe-area-inset-top, 0px));
    left: 0; right: 0; bottom: 0;
    width: 100% !important;
    max-width: none;
    z-index: 900;
    box-shadow: none;
    border-left: none;
  }
  .pp-stats-cards { grid-template-columns: repeat(3, 1fr); gap: .35rem; }
  .pp-stat-num { font-size: 1.1rem; }
  .pp-type-summary { grid-template-columns: 1fr; }
  .pp-bar-row { grid-template-columns: 72px 1fr 32px; font-size: .72rem; }
  .pp-bar-sub { margin-left: 72px; }
  .pp-map-legend {
    left: 8px; right: 8px; bottom: 8px;
    max-width: none; font-size: .68rem;
  }

  .pp-dji-dialog {
    width: 100%; max-width: none;
    height: 100dvh; max-height: none;
    border-radius: 0;
  }
  .pp-dji-form label { flex: 1 1 100%; }
  .pp-dji-form input, .pp-dji-form select { min-width: 0; width: 100%; }

  .stats-grid { grid-template-columns: 1fr; padding: 1rem; gap: .75rem; }
  .data-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .brigade-panel, .sync-panel, .user-panel, .login-log-panel { padding: 1rem; }
  .brigade-form { max-width: none; }
  .brigade-actions { flex-direction: column; align-items: stretch; }
  .brigade-actions .btn { width: 100%; }

  .login-page { padding: 1rem; align-items: flex-start; padding-top: max(2rem, 12vh); }
  .login-card {
    width: 100%; max-width: 400px;
    padding: 1.75rem 1.25rem;
  }
  .login-card input, .login-card button { min-height: 44px; }
}

@media (max-width: 400px) {
  .pp-stats-cards { grid-template-columns: 1fr 1fr; }
  .pp-stat-card:last-child { grid-column: 1 / -1; }
  .toolbar select { flex: 1 1 100%; }
}

.session-expiry-banner {
  margin: 0; padding: .55rem .9rem; background: #fff3e0; color: #e65100;
  border-bottom: 1px solid #ffe0b2; font-size: .85rem;
}
.session-expiry-banner.session-expiry-critical { background: #ffebee; color: #c62828; border-color: #ffcdd2; }
.session-expiry-banner.hidden { display: none; }
.pp-night-sync-alert {
  margin: .5rem 0 0; padding: .45rem .6rem; border-radius: 6px; font-size: .78rem;
  background: #fff3e0; color: #e65100; border: 1px solid #ffe0b2;
}
.pp-night-sync-alert.is-error { background: #ffebee; color: #c62828; border-color: #ffcdd2; }
.pp-night-sync-alert.hidden { display: none !important; }
.basemap-loading { animation: basemapShimmer 1.2s ease-in-out infinite; opacity: .75; }
@keyframes basemapShimmer { 0%,100%{filter:brightness(1)} 50%{filter:brightness(1.15)} }
.toolbar-more-btn { display: none; }
@media (max-width: 900px) {
  #viewMap .toolbar .toolbar-collapsible { display: none !important; }
  #viewMap .toolbar.toolbar-expanded .toolbar-collapsible { display: inline-flex !important; }
  #viewMap .toolbar .toolbar-more-btn { display: inline-flex; }
  /* 展开「更多」时也不要把编辑控件露到总览里 */
  #viewMap:not(.map-edit-mode) .toolbar .map-edit-only { display: none !important; }
  /* 地块编辑里名称/面积勾选跟公司筛选一起用，不要收进「更多」 */
  #viewMap.map-edit-mode .toolbar #parcelNameToggleWrap,
  #viewMap.map-edit-mode .toolbar #parcelAreaToggleWrap { display: inline-flex !important; }
}

.pp-client-dialog { max-width: 760px; }
.pp-client-access { padding: 1.2rem; }
.pp-client-hero { display:flex; gap:1rem; align-items:center; padding:1rem; background:#f2f8f4; border:1px solid #d9eadf; border-radius:10px; }
.pp-client-hero h4 { margin:0 0 .35rem; font-size:1.05rem; color:#174f35; }
.pp-client-hero p { margin:0; color:#52655b; line-height:1.55; }
.pp-client-icon { flex:0 0 64px; height:64px; display:grid; place-items:center; border-radius:16px; background:#176b47; color:#fff; font-size:1.05rem; font-weight:700; }
.pp-client-steps { list-style:none; padding:0; margin:1rem 0; display:grid; gap:.65rem; }
.pp-client-steps li { display:flex; gap:.75rem; align-items:flex-start; padding:.7rem .8rem; border:1px solid #e7ece9; border-radius:8px; }
.pp-client-steps li>span { flex:0 0 28px; height:28px; display:grid; place-items:center; border-radius:50%; background:#e2f2e9; color:#176b47; font-weight:700; }
.pp-client-steps p { margin:.2rem 0 0; color:#68756e; }
.pp-client-actions { display:flex; gap:.75rem; align-items:center; flex-wrap:wrap; margin:1rem 0; }
.pp-client-actions a { text-decoration:none; }
.pp-client-download {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  box-shadow: none;
  color: #455a64;
  cursor: pointer;
}
.pp-client-download:hover { background: #eceff1; color: #263238; }
.pp-client-download:focus-visible { outline: 2px solid #90a4ae; outline-offset: 2px; }
.pp-client-version { color:#79867f; font-size:.82rem; }
.pp-client-security { padding:.8rem 1rem; background:#fff8e7; border:1px solid #f1dfad; border-radius:8px; color:#5e5133; }
.pp-client-security ul { margin:.45rem 0 0 1.1rem; padding:0; line-height:1.6; }
.pp-admin-head { display:flex; justify-content:space-between; gap:1rem; align-items:flex-start; }
#clientCooldownAdmin { margin-top: 0; padding-bottom: 1rem; }
#clientSyncLogsAdmin { margin-top: 0; padding-top: 1rem; padding-bottom: 2.5rem; border-top: 1px solid #eef1f4; }

/* 「沧田」智脑 */
#viewJiumingBrain { flex: 1; min-height: 0; overflow: hidden; }
#viewJiumingBrain.active { display: flex; flex-direction: column; }
.jb-toolbar { flex-wrap: wrap; gap: .5rem; align-items: center; }
#jbMeta.jb-meta-ok { color: #2e7d32; }
#jbMeta.jb-meta-warn { color: #c62828; }
.jb-data-status {
  margin: 0 .75rem .5rem;
  padding: .65rem .85rem;
  border-radius: 8px;
  border: 1px solid #cfd8dc;
  background: linear-gradient(180deg, #f7fafc 0%, #eef3f7 100%);
  font-size: .82rem;
  color: #37474f;
  line-height: 1.45;
}
.jb-data-status.jb-st-ok { border-color: #a5d6a7; background: linear-gradient(180deg, #f1f8f2, #e8f5e9); }
.jb-data-status.jb-st-warn { border-color: #ffcc80; background: linear-gradient(180deg, #fff8e1, #fff3e0); }
.jb-data-status.jb-st-none { border-color: #b0bec5; background: linear-gradient(180deg, #eceff1, #e8eef2); }
.jb-status-row { display: flex; flex-wrap: wrap; gap: .5rem .85rem; align-items: center; }
.jb-status-pill {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .2rem .55rem; border-radius: 999px;
  background: #fff; border: 1px solid #cfd8dc; font-size: .75rem;
}
.jb-status-pill.yesterday { border-color: #81c784; color: #2e7d32; }
.jb-status-pill.fresh { border-color: #64b5f6; color: #1565c0; }
.jb-status-pill.ok { border-color: #90a4ae; }
.jb-status-pill.stale, .jb-status-pill.none { border-color: #b0bec5; color: #607d8b; }
.jb-status-reason { color: #546e7a; font-size: .75rem; margin-top: .35rem; }
.jb-date-switch-note {
  color: #e65100;
  font-weight: 600;
  font-size: .8rem;
  margin-top: .4rem;
}
.jb-overpass-block {
  margin-top: .45rem;
  padding: .45rem .55rem;
  border-radius: 6px;
  background: rgba(21, 101, 192, 0.06);
  border: 1px solid rgba(21, 101, 192, 0.22);
}
.jb-overpass-title {
  font-size: .72rem;
  font-weight: 700;
  color: #1565c0;
  margin-bottom: .2rem;
}
.jb-overpass-text { font-size: .78rem; color: #37474f; line-height: 1.45; }
.jb-overpass-group {
  margin-top: .35rem;
  font-size: .72rem;
  color: #607d8b;
  line-height: 1.4;
}
.jb-growth-reference-dialog {
  width: min(1120px, 97vw);
  max-height: 92vh;
}
.jb-growth-reference-dialog .pp-dji-header > div { min-width: 0; }
.jb-growth-reference-meta {
  margin-top: .18rem;
  color: #78909c;
  font-size: .72rem;
  font-weight: 400;
}
.jb-growth-reference-body {
  overflow: auto;
  padding: .85rem 1rem 1rem;
  background: #f7f9fc;
}
.jb-growth-ref-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .55rem;
  margin-bottom: .7rem;
}
.jb-growth-ref-summary > div {
  display: flex;
  align-items: baseline;
  gap: .45rem;
  padding: .55rem .65rem;
  border: 1px solid #dfe6ea;
  border-radius: 7px;
  background: #fff;
}
.jb-growth-ref-summary b { font-size: 1.2rem; color: #37474f; }
.jb-growth-ref-summary span { color: #78909c; font-size: .72rem; }
.jb-growth-ref-summary .better b { color: #2e7d32; }
.jb-growth-ref-summary .lower b { color: #c62828; }
.jb-growth-ref-ai {
  margin-bottom: .75rem;
  padding: .7rem .8rem;
  border: 1px solid #bbdefb;
  border-radius: 8px;
  background: #f3f8fc;
}
.jb-growth-ref-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .35rem;
  color: #1565c0;
  font-size: .82rem;
}
.jb-growth-ref-section-title span { color: #78909c; font-size: .68rem; font-weight: 400; }
.jb-growth-ref-ai p { margin: 0; color: #37474f; font-size: .82rem; line-height: 1.65; }
.jb-growth-ref-table-wrap {
  overflow: auto;
  border: 1px solid #dbe4e7;
  border-radius: 8px;
  background: #fff;
}
.jb-growth-ref-table {
  width: 100%;
  min-width: 850px;
  border-collapse: collapse;
  font-size: .76rem;
}
.jb-growth-ref-table th,
.jb-growth-ref-table td {
  padding: .48rem .55rem;
  border-bottom: 1px solid #e7ecef;
  text-align: center;
  white-space: nowrap;
}
.jb-growth-ref-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef3f6;
  color: #455a64;
}
.jb-growth-ref-table thead th small {
  display: block;
  margin-top: .12rem;
  color: #78909c;
  font-size: .6rem;
  font-weight: 400;
}
.jb-growth-ref-table tbody th { text-align: left; color: #263238; }
.jb-growth-ref-table tbody tr:hover { background: #f7fbfd; }
.jb-growth-ref-table .jb-growth-ref-secondary { background: #fafafa; color: #78909c; }
.jb-growth-ref-ndvi {
  display: block;
  color: inherit;
  font-size: .78rem;
}
.jb-growth-ref-cell-meta {
  display: block;
  margin-top: .13rem;
  color: #90a4ae;
  font-size: .6rem;
  font-weight: 400;
}
.jb-growth-ref-warning {
  display: block;
  max-width: 12rem;
  margin-top: .18rem;
  color: #e65100;
  font-size: .62rem;
  white-space: normal;
  text-align: left;
}
.jb-growth-ref-diff { font-weight: 700; }
.jb-growth-ref-diff.better { color: #2e7d32; }
.jb-growth-ref-diff.lower { color: #c62828; }
.jb-growth-ref-diff.stable { color: #455a64; }
.jb-growth-ref-diff.warning { color: #e65100; }
.jb-growth-ref-tag {
  display: inline-block;
  padding: .16rem .42rem;
  border-radius: 999px;
  background: #eceff1;
  color: #455a64;
  font-size: .68rem;
  font-weight: 600;
}
.jb-growth-ref-tag.better { background: #e8f5e9; color: #2e7d32; }
.jb-growth-ref-tag.lower { background: #ffebee; color: #c62828; }
.jb-growth-ref-tag.warning { background: #fff3e0; color: #e65100; }
.jb-growth-ref-method {
  margin: .65rem 0 0;
  color: #78909c;
  font-size: .68rem;
  line-height: 1.45;
}
.jb-ndvi-panel { overflow: hidden; }
.jb-ndvi-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .55rem;
}
.jb-ndvi-panel-head h3 { margin: 0; }
.jb-ndvi-panel-head select { min-width: 7.5rem; max-width: 11rem; }
.jb-ndvi-region-mean {
  padding: .55rem .65rem;
  border-radius: .45rem;
  background: #f1f8e9;
  color: #2e5d32;
  font-size: .78rem;
  margin-bottom: .55rem;
}
.jb-ndvi-region-mean > strong { display: block; margin-bottom: .35rem; }
.jb-ndvi-region-mean small { display: block; color: #607d68; line-height: 1.35; margin-top: .35rem; }
.jb-ndvi-mean-list { display: flex; gap: .35rem .7rem; overflow-x: auto; white-space: nowrap; }
.jb-ndvi-table-wrap {
  max-height: min(52vh, 28rem);
  overflow: auto;
  border: 1px solid #dbe4e7;
  border-radius: .4rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.jb-ndvi-table {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  min-width: 0;
  font-size: .68rem;
  table-layout: auto;
}
.jb-ndvi-table th, .jb-ndvi-table td {
  padding: .2rem .28rem;
  border-right: 1px solid #e5ecef;
  border-bottom: 1px solid #e5ecef;
  text-align: center;
  white-space: nowrap;
  line-height: 1.2;
  box-sizing: border-box;
}
.jb-ndvi-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eef5f7;
}
.jb-ndvi-table th:first-child,
.jb-ndvi-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  text-align: left;
  background: #fff;
  padding-left: .35rem;
  padding-right: .4rem;
  overflow: visible;
  text-overflow: clip;
}
.jb-ndvi-table thead th:first-child { z-index: 3; background: #eef5f7; text-align: center; }
.jb-ndvi-table thead th.jb-ndvi-grade-head,
.jb-ndvi-table td.jb-ndvi-grade {
  position: sticky;
  left: var(--jb-ndvi-parcel-col, 5.5rem);
  z-index: 1;
}
.jb-ndvi-table thead th.jb-ndvi-grade-head {
  z-index: 3;
  background: #eef5f7;
}
.jb-ndvi-rejected { color: #9e9e9e; text-decoration: line-through; background: #fafafa; }
.jb-ndvi-empty { color: #b0bec5; }
.jb-ndvi-grade {
  font-weight: 700;
  font-size: .62rem;
  letter-spacing: -.01em;
  padding-left: .28rem !important;
  padding-right: .28rem !important;
  overflow: visible;
  text-overflow: clip;
}
.jb-ndvi-sortable {
  cursor: pointer;
  user-select: none;
}
.jb-ndvi-sortable:hover { color: #1565c0; }
.jb-ndvi-parcel-link {
  display: inline;
  width: auto;
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1565c0;
  font: inherit;
  font-weight: 600;
  font-size: .68rem;
  text-align: left;
  cursor: pointer;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}
.jb-ndvi-parcel-link:hover { color: #ef6c00; text-decoration: underline; }
.jb-status-actions { margin-left: auto; display: flex; gap: .4rem; align-items: center; }
.jb-advanced { font-size: .75rem; color: #78909c; }
.jb-advanced summary { cursor: pointer; user-select: none; }
.jb-advanced .btn { margin-top: .35rem; }
.jb-evidence-panel { padding-top: .35rem; }
.jb-evidence-panel summary { cursor: pointer; color: #455a64; font-size: .85rem; }
.jb-evidence-body { margin-top: .45rem; font-size: .78rem; color: #546e7a; line-height: 1.5; }
.jb-evidence-body dl { display: grid; grid-template-columns: 5.5rem 1fr; gap: .2rem .5rem; margin: 0; }
.jb-evidence-body dt { color: #90a4ae; }
.jb-layout {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 0;
}
.jb-side {
  overflow: auto;
  background: #f7f9fc;
  border-right: none;
  padding: .55rem .5rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  flex: 0 0 auto;
  width: min(520px, 42vw);
  min-width: 280px;
  max-width: min(70vw, 900px);
  box-sizing: border-box;
  position: relative;
}
.jb-side-resizer {
  flex: 0 0 6px;
  width: 6px;
  cursor: col-resize;
  background: #e0e4ea;
  position: relative;
  z-index: 5;
  transition: background .12s ease;
}
.jb-side-resizer::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -3px;
  right: -3px;
}
.jb-side-resizer:hover,
.jb-layout.is-side-resizing .jb-side-resizer {
  background: #90caf9;
}
.jb-layout.is-side-collapsed .jb-side-resizer {
  display: none !important;
}
.jb-layout.is-side-resizing {
  cursor: col-resize;
  user-select: none;
}
.jb-layout.is-side-resizing .jb-map {
  pointer-events: none;
}
.jb-side > .jb-panel,
.jb-side > .jb-summary,
.jb-side .jb-ndvi-panel {
  max-width: 100%;
}
.jb-side .jb-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.jb-main {
  position: relative;
  min-height: 0;
  flex: 1 1 auto;
  min-width: 0;
}
.jb-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.jb-card {
  background: #fff; border: 1px solid #e6eaf0; border-radius: 8px; padding: .55rem .65rem;
}
.jb-card-n { font-size: 1.25rem; font-weight: 700; color: #1a2744; }
.jb-card-l { font-size: .72rem; color: #78909c; margin-top: .1rem; }
.jb-card.urgent .jb-card-n { color: #c62828; }
.jb-card.watch .jb-card-n { color: #ef6c00; }
.jb-card.insuff .jb-card-n { color: #546e7a; }
.jb-panel h3 { font-size: .9rem; margin-bottom: .45rem; color: #37474f; }
.jb-mgmt-panel {
  background: #fff;
  border: 1px solid #e0e4ea;
  border-radius: 8px;
  padding: .5rem .55rem .55rem;
  min-width: 17.5rem;
  max-width: 22rem;
}
.jb-mgmt-panel .jb-ndvi-panel-head {
  margin-bottom: .35rem;
}
.jb-mgmt-panel .jb-ndvi-panel-head .btn {
  font-size: .72rem;
  padding: .15rem .45rem;
}
.jb-mgmt-body {
  font-size: .78rem;
  line-height: 1.45;
  color: #37474f;
  max-height: min(42vh, 420px);
  overflow: auto;
}
.jb-mgmt-title {
  font-weight: 700;
  color: #1a2744;
  margin-bottom: .25rem;
}
.jb-mgmt-summary {
  color: #455a64;
  margin-bottom: .3rem;
}
.jb-mgmt-note {
  font-size: .7rem;
  color: #90a4ae;
  margin-bottom: .45rem;
}
.jb-mgmt-suggest {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  margin: 0 0 .55rem;
  padding: 0;
}
.jb-mgmt-suggest li {
  background: #f5f7fa;
  border-radius: 6px;
  padding: .35rem .45rem;
  border-left: 3px solid #90a4ae;
}
.jb-mgmt-suggest li.jb-pri-high { border-left-color: #c62828; background: #fff5f5; }
.jb-mgmt-suggest li.jb-pri-med { border-left-color: #ef6c00; background: #fff8f1; }
.jb-mgmt-suggest li.jb-pri-low { border-left-color: #43a047; }
.jb-mgmt-suggest .jb-pri {
  display: inline-block;
  font-size: .65rem;
  font-weight: 700;
  margin-right: .3rem;
  color: #546e7a;
}
.jb-pri-high .jb-pri { color: #c62828; }
.jb-pri-med .jb-pri { color: #ef6c00; }
.jb-mgmt-suggest .jb-topic {
  display: inline-block;
  font-size: .65rem;
  color: #78909c;
  margin-right: .25rem;
}
.jb-mgmt-sec {
  margin-top: .45rem;
  padding-top: .35rem;
  border-top: 1px dashed #e0e4ea;
}
.jb-mgmt-sec h4 {
  margin: 0 0 .25rem;
  font-size: .78rem;
  color: #546e7a;
}
.jb-mgmt-sec ul {
  margin: 0;
  padding-left: 1rem;
}
.jb-mgmt-province-list {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.jb-mgmt-co-card {
  background: #f8fafc;
  border: 1px solid #e6eaf0;
  border-radius: 8px;
  padding: .45rem .5rem;
  cursor: pointer;
}
.jb-mgmt-co-card:hover {
  border-color: #90caf9;
  background: #f5faff;
}
.jb-mgmt-co-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .4rem;
  margin-bottom: .2rem;
}
.jb-mgmt-card-sum { margin: 0 0 .2rem; }
.jb-mgmt-water { margin: 0 0 .25rem; font-size: .7rem; }
.jb-wq-primary { box-shadow: 0 0 0 2px #1565c0; }
.jb-wq-star {
  position: absolute;
  top: -2px;
  right: -2px;
  color: #f9a825;
  font-size: 10px;
  line-height: 1;
}
.jb-issue-list, .jb-run-logs { list-style: none; display: flex; flex-direction: column; gap: .4rem; }
.jb-issue-item {
  display: flex; gap: .5rem; background: #fff; border: 1px solid #e6eaf0;
  border-radius: 8px; padding: .55rem; cursor: pointer;
}
.jb-issue-item:hover { border-color: #90caf9; background: #f5faff; }
.jb-sev {
  flex-shrink: 0; font-size: .68rem; padding: .15rem .35rem; border-radius: 4px;
  height: fit-content; background: #eceff1; color: #37474f;
}
.jb-sev.urgent { background: #ffebee; color: #c62828; }
.jb-sev.watch { background: #fff3e0; color: #ef6c00; }
.jb-sev.insufficient { background: #eceff1; color: #546e7a; }
.jb-issue-main strong { font-size: .85rem; }
.jb-issue-team { display: block; font-size: .72rem; color: #90a4ae; }
.jb-issue-main p { font-size: .78rem; color: #455a64; margin-top: .2rem; }
.jb-empty { color: #90a4ae; font-size: .8rem; padding: .4rem 0; }
.jb-run-logs li { font-size: .75rem; color: #546e7a; border-bottom: 1px dashed #e0e4ea; padding: .35rem 0; }
.jb-log-status { font-weight: 600; margin-right: .25rem; }
.jb-log-status.ok { color: #2e7d32; }
.jb-log-status.error, .jb-log-status.partial { color: #c62828; }
.jb-log-msg { color: #78909c; margin-top: .15rem; }
.jb-map { width: 100%; height: 100%; min-height: 320px; background: #dfe6ee; }
.jb-map-legend {
  position: absolute; left: .75rem; bottom: .75rem; z-index: 500;
  background: rgba(255,255,255,.92); border-radius: 6px; padding: .35rem .55rem;
  font-size: .75rem; display: flex; gap: .65rem; box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
/* 九溟智脑 · 水质图例：紧凑双列，避免占满左下角 */
#jbMapLegendWater.jb-map-legend,
.jb-map-legend-water {
  display: block;
  max-width: 9.2rem;
  padding: .28rem .4rem .3rem;
  font-size: .68rem;
  line-height: 1.2;
  gap: 0;
}
#jbMapLegendWater .wq-legend-root,
.jb-map-legend-water .wq-legend-root {
  margin: 0;
}
#jbMapLegendWater h4,
.jb-map-legend-water h4 {
  margin: 0 0 .12rem;
  font-size: .72rem;
  font-weight: 700;
  color: #37474f;
}
#jbMapLegendWater .wq-legend-stat,
.jb-map-legend-water .wq-legend-stat {
  color: #607d8b;
  margin: 0 0 .12rem !important;
  font-size: .62rem;
}
#jbMapLegendWater .wq-legend-levels,
.jb-map-legend-water .wq-legend-levels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .04rem .22rem;
  margin: 0 0 .1rem;
}
#jbMapLegendWater .legend-item,
.jb-map-legend-water .legend-item {
  display: flex;
  align-items: center;
  gap: .2rem;
  margin: 0;
  color: #455a64;
  white-space: nowrap;
}
#jbMapLegendWater .water-station-marker.wq-legend,
.jb-map-legend-water .water-station-marker.wq-legend {
  width: 14px;
  height: 14px;
  margin-right: .1rem;
  border-width: 1.5px;
}
#jbMapLegendWater .water-station-marker.wq-legend .wq-drop,
.jb-map-legend-water .water-station-marker.wq-legend .wq-drop {
  width: 5px;
  height: 5px;
}
#jbMapLegendWater .wq-legend-upd,
.jb-map-legend-water .wq-legend-upd {
  color: #90a4ae !important;
  font-size: .58rem;
  margin: .08rem 0 0 !important;
  white-space: normal;
  line-height: 1.25;
}
/* 地图总览水质图例也同样更紧凑 */
.legend.legend-water .wq-legend-root {
  margin: 0;
}
.legend.legend-water .wq-legend-levels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .1rem .4rem;
  margin: .15rem 0 .2rem;
}
.legend.legend-water .wq-legend-stat {
  color: #666;
  margin-bottom: .2rem !important;
  font-size: .72rem;
}
.legend.legend-water .wq-legend-upd {
  color: #888;
  font-size: .68rem;
  margin-top: .15rem !important;
  white-space: normal;
  line-height: 1.3;
}
.legend.legend-water h4 {
  margin: 0 0 .2rem;
  font-size: .8rem;
}
.jb-swatch {
  display: inline-block; width: .65rem; height: .65rem; border-radius: 2px; margin-right: .25rem;
  vertical-align: -1px;
}
.jb-swatch.urgent { background: #c62828; }
.jb-swatch.watch { background: #ef6c00; }
.jb-swatch.insufficient { background: #78909c; background-image: repeating-linear-gradient(-45deg, #78909c, #78909c 3px, #cfd8dc 3px, #cfd8dc 6px); }
.jb-card.jb-card-quiet {
  background: #f5f7fa;
  border-style: dashed;
}
.jb-suggest-quiet {
  line-height: 1.55;
  padding: .6rem .2rem;
}
#jbIssueFilter.jb-dimmed {
  opacity: .45;
  pointer-events: none;
}
.jb-swatch.base {
  background: transparent;
  border: 1.5px solid #607d8b;
  box-sizing: border-box;
}
.jb-swatch.tier1 { background: #b71c1c; }
.jb-swatch.tier2 { background: #e53935; }
.jb-swatch.tier3 { background: #fb8c00; }
.jb-swatch.tier4 { background: #fdd835; }
.jb-swatch.tier5 { background: #9ccc65; }
.jb-swatch.tier6 { background: #43a047; }
.jb-swatch.tier7 { background: #0b6e3f; }
.jb-ai-actions {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-top: .7rem;
}
.jb-ai-chat {
  margin-top: .65rem;
  border-top: 1px solid #e3e8ee;
  padding-top: .65rem;
}
.jb-ai-messages {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  max-height: 320px;
  overflow-y: auto;
  padding-right: .2rem;
}
.jb-ai-message {
  max-width: 92%;
  border-radius: 8px;
  padding: .55rem .65rem;
  line-height: 1.55;
  font-size: .84rem;
}
.jb-ai-message.user {
  align-self: flex-end;
  background: #e8f2ff;
  color: #174a7e;
}
.jb-ai-message.assistant {
  align-self: flex-start;
  background: #f3f6f8;
  color: #263238;
}
.jb-ai-message strong {
  display: block;
  margin-bottom: .2rem;
  font-size: .76rem;
}
.jb-ai-form {
  display: flex;
  gap: .45rem;
  margin-top: .65rem;
}
.jb-ai-form input {
  flex: 1;
  min-width: 0;
}
.jb-weather-body { font-size: .8rem; color: #455a64; line-height: 1.45; }
.jb-weather-body .jb-wx-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; margin-bottom: .4rem;
}
.jb-weather-body .jb-wx-card {
  background: #fff; border: 1px solid #e6eaf0; border-radius: 6px; padding: .4rem .5rem;
}
.jb-weather-body .jb-wx-card b { display: block; font-size: 1.05rem; color: #1a2744; }
.jb-wx-table {
  width: 100%; border-collapse: collapse; font-size: .72rem; margin-top: .25rem;
}
.jb-wx-table th, .jb-wx-table td {
  border-bottom: 1px solid #e0e4ea; padding: .22rem .3rem; text-align: right;
}
.jb-wx-table th:first-child, .jb-wx-table td:first-child { text-align: left; }
.jb-wx-table .jb-wx-future td { color: #1565c0; }
.jb-region-label {
  background: transparent !important; border: 0 !important;
}
.jb-region-label span {
  display: inline-block;
  padding: .15rem .45rem;
  border-radius: 4px;
  background: rgba(21, 101, 192, 0.88);
  color: #fff;
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.jb-map-legend .jb-swatch.region-outline {
  background: transparent;
  border: 2px solid #1565c0;
  box-sizing: border-box;
}
.jb-weather-body .jb-wx-hint,
.jb-wx-hint {
  background: #fff8e1; border: 1px solid #ffe082; border-radius: 6px; padding: .45rem .55rem;
  color: #6d4c41; font-size: .76rem; margin-top: .35rem;
}
.jb-growth-actions { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin-bottom: .45rem; }
.jb-growth-parcel-list {
  max-height: 280px; overflow: auto; background: #fff; border: 1px solid #e6eaf0;
  border-radius: 8px; padding: .35rem .45rem;
}
.jb-growth-parcel-list label {
  display: flex; gap: .4rem; align-items: flex-start; font-size: .78rem;
  padding: .25rem 0; border-bottom: 1px dashed #edf0f4; cursor: pointer;
}
.jb-growth-parcel-list label:last-child { border-bottom: 0; }
.jb-growth-stats { display: flex; flex-direction: column; gap: .35rem; }
.jb-growth-stat-row {
  display: grid; grid-template-columns: 16px 1fr auto auto; gap: .4rem; align-items: center;
  background: #fff; border: 1px solid #e6eaf0; border-radius: 6px; padding: .4rem .5rem;
  font-size: .78rem;
}
.jb-growth-stat-row i { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
.jb-map-legend.hidden { display: none; }
.jb-toolbar #jbDateSelect {
  min-width: 11.5rem;
  max-width: 16rem;
}
.jb-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .82rem;
  color: #546e7a;
}

.jb-drawer {
  position: absolute; top: 0; right: 0; width: min(380px, 92%); height: 100%;
  background: #fff; box-shadow: -4px 0 16px rgba(0,0,0,.12); z-index: 600;
  display: flex; flex-direction: column;
}
.jb-drawer.hidden { display: none; }
.jb-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1rem; border-bottom: 1px solid #eceff1;
  gap: .5rem;
}
.jb-drawer-head h3 { font-size: .95rem; flex: 1; min-width: 0; }
.jb-drawer-head-actions { display: flex; align-items: center; gap: .35rem; flex-shrink: 0; }
.jb-share-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0; border: 1px solid #dce3e8;
  border-radius: 8px; background: #f7fafb; color: #37474f; cursor: pointer;
}
.jb-share-btn:hover { background: #eef5f8; color: #1565c0; border-color: #b0bec5; }
.jb-share-btn.hidden { display: none; }
.jb-share-modal {
  position: absolute; inset: 0; z-index: 700;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 23, 32, .42);
  padding: 1rem;
}
.jb-share-modal.hidden { display: none; }
.jb-share-dialog {
  width: min(320px, 100%);
  background: #fff;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 12px 32px rgba(0,0,0,.18);
  text-align: center;
}
.jb-share-dialog-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .5rem; text-align: left;
}
.jb-share-dialog-head h4 { margin: 0; font-size: .95rem; }
.jb-share-tip {
  margin: 0 0 .75rem; font-size: .78rem; color: #607d8b; line-height: 1.45; text-align: left;
}
#jbShareQr,
.jb-share-qr-img {
  display: block; margin: 0 auto .65rem;
  width: 200px; height: 200px;
  border: 1px solid #eceff1; border-radius: 8px; background: #fff;
  object-fit: contain;
}
.jb-share-name {
  margin: 0 0 .45rem; font-size: .88rem; font-weight: 600; color: #263238;
}
.jb-share-url {
  width: 100%; box-sizing: border-box;
  font-size: .72rem; color: #546e7a;
  border: 1px solid #e0e4ea; border-radius: 6px;
  padding: .4rem .5rem; margin-bottom: .55rem;
  background: #fafbfc;
}
.jb-drawer-body { padding: 1rem; overflow: auto; font-size: .85rem; }
.jb-detail-title { font-size: 1rem; font-weight: 600; margin-bottom: .5rem; }
.jb-detail-suggest { margin-bottom: .75rem; line-height: 1.5; }
.jb-rationale {
  background: #f5f9fc; border: 1px solid #e3eef6; border-radius: 8px;
  padding: .65rem .75rem; margin-bottom: .75rem; line-height: 1.55;
}
.jb-rationale h4 { font-size: .82rem; color: #37474f; margin-bottom: .35rem; }
.jb-rationale p { font-size: .8rem; color: #455a64; margin-bottom: .4rem; }
.jb-ev-explain { font-size: .72rem; color: #90a4ae; margin-top: .15rem; }
.jb-issue-why {
  font-size: .72rem !important; color: #78909c !important; margin-top: .25rem !important;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.jb-muted { color: #90a4ae; font-size: .75rem; margin-bottom: .75rem; }
.jb-evidence { margin: .35rem 0 .75rem 1rem; }
.jb-trend { margin-top: .75rem; }
.jb-trend h4 { font-size: .82rem; margin-bottom: .35rem; }
.jb-trend-row { display: flex; flex-wrap: wrap; gap: .35rem; }
.jb-trend-pt {
  background: #f5f7fa; border-radius: 4px; padding: .25rem .4rem;
  font-size: .68rem; text-align: center; min-width: 3rem; color: #455a64;
}
@media (max-width: 900px) {
  .jb-growth-reference-dialog { width: 98vw; max-height: 94vh; }
  .jb-growth-reference-body { padding: .65rem; }
  .jb-growth-ref-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .jb-growth-ref-section-title { align-items: flex-start; flex-direction: column; gap: .15rem; }
  .jb-layout { flex-direction: column; }
  .jb-side {
    max-height: 42vh;
    width: 100% !important;
    flex-basis: auto !important;
    max-width: 100%;
  }
  .jb-main { min-height: 48vh; }
}


/* 九溟智脑：综合管理建议置顶 + 水质侧栏 + NDVI下降标识 */
#viewJiumingBrain .hidden {
  display: none !important;
}
.jb-mgmt-top {
  padding: .45rem .65rem 0;
  flex-shrink: 0;
}
/* 仅在 .active 时显示；勿写死 display:flex，否则会压过 .view{display:none}，其它菜单点了像没反应 */
#viewJiumingBrain.active {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.jb-mgmt-panel-top {
  max-width: none;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.jb-mgmt-panel-top .jb-mgmt-body {
  max-height: min(28vh, 240px);
}
.jb-mgmt-head {
  align-items: flex-start;
}
.jb-fold-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25rem .55rem;
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  color: #37474f;
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.jb-fold-title:hover { color: #1565c0; }
.jb-fold-title .jb-caret {
  display: inline-block;
  font-size: .65rem;
  color: #90a4ae;
  transition: transform .15s ease;
  transform: rotate(0deg);
}
.jb-mgmt-top.is-collapsed .jb-fold-title .jb-caret {
  transform: rotate(-90deg);
}
.jb-mgmt-top.is-collapsed .jb-mgmt-body {
  display: none;
}
.jb-mgmt-one-line {
  font-weight: 400;
  font-size: .75rem;
  color: #607d8b;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.jb-mgmt-top:not(.is-collapsed) .jb-mgmt-one-line {
  display: none;
}
.jb-mgmt-head-actions {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-shrink: 0;
}
.jb-side-tools {
  display: flex;
  justify-content: flex-end;
  margin: -.15rem 0 .15rem;
}
.jb-side-collapse-btn,
.jb-side-expand-btn {
  font-size: .72rem !important;
  padding: 0 !important;
  width: 34px;
  height: 34px;
  min-width: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-sizing: border-box;
}
.jb-side-icon {
  width: 16px;
  height: 16px;
  display: block;
}
.jb-side-expand-btn {
  position: absolute;
  /* 与 Leaflet 左上控件列左缘对齐，并置于缩放/工具上方 */
  left: calc(0.25rem + 8px);
  top: calc(0.25rem + 8px);
  z-index: 520;
  border: 2px solid rgba(0, 0, 0, .2);
  border-radius: 4px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .35);
  background: #fff;
  color: #37474f;
}
.jb-side-expand-btn:hover {
  background: #f4f4f4;
}
.jb-layout.is-side-collapsed .jb-side {
  display: none !important;
}
#viewJiumingBrain.jb-history-mode .jb-side-expand-btn,
#viewJiumingBrain.jb-history-mode .jb-side-collapse-btn {
  display: none !important;
}
#viewJiumingBrain.jb-history-mode .jb-drawer {
  width: min(440px, 94%);
}
.jb-hist-trend-range {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .45rem;
  margin: .35rem 0 .5rem;
  font-size: .78rem;
}
.jb-hist-trend-range label {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}
.jb-hist-trend-range input[type="date"] {
  font: inherit;
  padding: .12rem .25rem;
  border: 1px solid #cfd8dc;
  border-radius: 4px;
  max-width: 9.5rem;
}
.jb-hist-trend-range .btn {
  font-size: .72rem !important;
  padding: .18rem .45rem !important;
}
.jb-hist-range-lock {
  font-size: .7rem;
  color: #1565c0;
  background: #e3f2fd;
  border-radius: 999px;
  padding: .12rem .45rem;
  white-space: nowrap;
}
.jb-hist-pt.is-selected {
  filter: drop-shadow(0 0 1px rgba(191, 54, 12, .55));
}
.jb-history-date-wrap {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
}
.jb-team-wrap {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .82rem;
  color: #546e7a;
}
.jb-team-wrap.hidden { display: none !important; }
.jb-team-wrap select {
  max-width: 9.5rem;
  min-width: 6.5rem;
}
.jb-history-date-wrap.hidden { display: none !important; }
.jb-history-date-wrap label {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
.jb-history-date-wrap select {
  min-width: 9.5rem;
  max-width: 12rem;
}
#viewJiumingBrain.jb-history-mode .jb-hide-in-history.hidden,
.jb-hide-in-history.hidden {
  display: none !important;
}
.jb-hist-trend-panel {
  margin-top: .85rem;
  padding-top: .65rem;
  border-top: 1px solid #e0e4ea;
}
.jb-hist-trend-head {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  margin-bottom: .35rem;
  font-size: .8rem;
}
.jb-hist-trend-head strong { font-size: .88rem; color: #263238; }
.jb-hist-trend-head span { color: #607d8b; font-size: .72rem; }
.jb-hist-trend-value {
  font-size: .85rem;
  color: #1565c0;
  margin-bottom: .35rem;
  min-height: 1.3em;
}
.jb-hist-trend-svg {
  width: 100%;
  height: auto;
  display: block;
  background: #fafbfc;
  border: 1px solid #e8eef3;
  border-radius: 6px;
}
.jb-hist-trend-hint {
  margin-top: .3rem;
  font-size: .7rem;
  color: #78909c;
}
.jb-hist-pt:hover { opacity: .85; }

.jb-hist-overview { display: flex; flex-direction: column; gap: .85rem; }
.jb-hist-ov-hero {
  padding: .85rem 1rem;
  border-radius: 10px;
  background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 55%, #e3f2fd 100%);
  border: 1px solid #c8e6c9;
}
.jb-hist-ov-kicker { font-size: .72rem; color: #546e7a; }
.jb-hist-ov-ndvi {
  font-size: 1.85rem; font-weight: 700; color: #0b6e3f;
  line-height: 1.2; margin: .2rem 0;
  font-variant-numeric: tabular-nums;
}
.jb-hist-ov-sub { font-size: .75rem; color: #607d8b; }
.jb-hist-ov-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .55rem;
}
.jb-hist-ov-card {
  padding: .65rem .7rem;
  border: 1px solid #e0e6ea;
  border-radius: 8px;
  background: #fafbfc;
}
.jb-hist-ov-card-label { font-size: .7rem; color: #78909c; }
.jb-hist-ov-card-value {
  font-size: 1.25rem; font-weight: 700; color: #263238;
  font-variant-numeric: tabular-nums; margin: .15rem 0;
}
.jb-hist-ov-card-note { font-size: .68rem; color: #90a4ae; }
.jb-hist-ov-section h4 {
  margin: 0 0 .35rem; font-size: .88rem; color: #37474f;
}
.jb-hist-ov-hint {
  margin: .25rem 0 0; font-size: .68rem; color: #90a4ae; line-height: 1.4;
}
.jb-hist-yoy-wrap { overflow-x: auto; }
.jb-hist-yoy-table {
  width: 100%; border-collapse: collapse; font-size: .72rem;
}
.jb-hist-yoy-table th,
.jb-hist-yoy-table td {
  padding: .35rem .3rem; border-bottom: 1px solid #eceff1;
  text-align: left; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.jb-hist-yoy-table th { color: #78909c; font-weight: 600; }
.jb-hist-yoy-table tr.is-current td {
  background: #f1f8e9; color: #1b5e20; font-weight: 600;
}
.jb-hist-yoy-tag {
  display: inline-block;
  margin-left: .25rem;
  padding: 0 .28rem;
  border-radius: 3px;
  font-size: .62rem;
  font-weight: 500;
  color: #607d8b;
  background: #eceff1;
  vertical-align: middle;
}
.jb-hist-yoy-table tr.is-current .jb-hist-yoy-tag {
  color: #1b5e20; background: #c8e6c9;
}
.jb-hist-yoy-table tr.is-past .jb-hist-yoy-tag {
  color: #546e7a; background: #e8eaf0;
}
.jb-hist-yoy-table tr.is-future .jb-hist-yoy-tag {
  color: #1565c0; background: #e3f2fd;
}
.jb-hist-yoy-spark {
  width: 100%;
  height: 56px;
  margin: .35rem 0 .5rem;
  display: block;
}
.jb-hist-grade-list { display: flex; flex-direction: column; gap: .28rem; }
.jb-hist-grade-row {
  display: grid;
  grid-template-columns: 2.6rem 1fr 4.8rem;
  gap: .35rem;
  align-items: center;
  font-size: .72rem;
}
.jb-hist-grade-label {
  padding-left: .35rem;
  border-left: 3px solid #78909c;
  color: #546e7a;
}
.jb-hist-grade-bar {
  height: 8px; background: #eceff1; border-radius: 99px; overflow: hidden;
}
.jb-hist-grade-bar i {
  display: block; height: 100%; border-radius: 99px; min-width: 0;
}
.jb-hist-grade-num {
  text-align: right; color: #78909c;
  font-variant-numeric: tabular-nums;
}
/* 智脑地图：左上控件列 —— 展开侧栏在上，缩放/工具在下，左缘对齐 */
#jbMap .leaflet-top.leaflet-left {
  top: .25rem;
  left: .25rem;
}
#jbMap .leaflet-top.leaflet-left .leaflet-control {
  margin-left: 8px !important;
}
#jbMap .leaflet-top.leaflet-left .leaflet-control:first-child {
  margin-top: 8px !important;
}
#jbMap .leaflet-top.leaflet-left .leaflet-control + .leaflet-control {
  margin-top: 6px !important;
}
/* 侧栏收起时：展开按钮占位在最上，缩放/工具整体下移 */
.jb-layout.is-side-collapsed #jbMap .leaflet-top.leaflet-left {
  top: calc(0.25rem + 8px + 34px + 6px);
}
.jb-layout.is-side-collapsed #jbMap .leaflet-top.leaflet-left .leaflet-control:first-child {
  margin-top: 0 !important;
}
.jb-water-station-list {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  max-height: min(55vh, 640px);
  overflow: auto;
}
.jb-wq-side-card {
  text-align: left;
  border: 1px solid #e0e4ea;
  border-radius: 8px;
  background: #fff;
  padding: .45rem .55rem;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.jb-wq-side-card:hover { border-color: #64b5f6; background: #f5faff; }
.jb-wq-side-card.is-primary { border-color: #1565c0; box-shadow: inset 3px 0 0 #1565c0; }
.jb-wq-side-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .3rem .45rem;
  margin-bottom: .2rem;
}
.jb-wq-side-lv {
  font-size: .68rem;
  font-weight: 700;
  padding: .08rem .3rem;
  border-radius: 4px;
  background: #eceff1;
}
.jb-wq-side-star {
  font-size: .65rem;
  color: #1565c0;
  font-weight: 700;
}
.jb-wq-side-alert {
  font-size: .65rem;
  color: #c62828;
  font-weight: 700;
}
.jb-wq-side-meta { font-size: .7rem; color: #78909c; margin-bottom: .25rem; }
.jb-wq-side-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: .2rem .55rem;
  font-size: .72rem;
  color: #455a64;
}
.jb-ndvi-drop-banner {
  background: #fff5f5;
  border: 1px solid #ef9a9a;
  border-left: 5px solid #c62828;
  border-radius: 8px;
  padding: .55rem .7rem;
  margin-bottom: .55rem;
}
.jb-ndvi-drop-banner strong { color: #b71c1c; display: block; margin-bottom: .2rem; }
.jb-ndvi-drop-banner p { margin: 0; font-size: .8rem; line-height: 1.45; color: #5d4037; }
.jb-ndvi-drop-flag { color: #c62828; font-weight: 700; }

/* 九溟智脑 · 天气地图 */
#jbMapLegendWeather.jb-map-legend,
.jb-map-legend-weather {
  display: block;
  max-width: 12rem;
  padding: .3rem .4rem .35rem;
  font-size: .68rem;
  line-height: 1.25;
  gap: 0;
}
.jb-wx-leg-title {
  font-weight: 700;
  color: #37474f;
  margin-bottom: .15rem;
  font-size: .72rem;
}
.jb-wx-leg-scale {
  display: flex;
  flex-wrap: wrap;
  gap: .15rem .3rem;
  margin-bottom: .1rem;
}
.jb-wx-leg-scale span {
  display: inline-flex;
  align-items: center;
  gap: .12rem;
  font-size: .6rem;
  color: #546e7a;
}
.jb-weather-controls {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .55rem;
  margin-bottom: .45rem;
  font-size: .75rem;
  color: #455a64;
}
.jb-weather-controls label {
  display: flex;
  align-items: center;
  gap: .25rem;
}
.jb-weather-controls input[type=date],
.jb-weather-controls select {
  font-size: .75rem;
  padding: .15rem .3rem;
  border: 1px solid #cfd8dc;
  border-radius: 4px;
  background: #fff;
}
.jb-weather-history-wrap {
  margin-top: .55rem;
  border-top: 1px solid #e0e4ea;
  padding-top: .45rem;
}
.jb-weather-history {
  max-height: min(28vh, 260px);
  overflow: auto;
}
.jb-weather-hist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .68rem;
}
.jb-weather-hist-table th,
.jb-weather-hist-table td {
  border-bottom: 1px solid #eceff1;
  padding: .2rem .25rem;
  text-align: right;
}
.jb-weather-hist-table th:first-child,
.jb-weather-hist-table td:first-child {
  text-align: left;
}
.jb-weather-hist-table thead th {
  color: #78909c;
  font-weight: 600;
  position: sticky;
  top: 0;
  background: #f7f9fc;
}

/* 天气网格内数值标注 */
.jb-wx-grid-label {
  background: transparent !important;
  border: none !important;
}
.jb-wx-grid-label span {
  display: inline-block;
  min-width: 2.4rem;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  color: #1a2744;
  text-shadow:
    0 0 2px #fff,
    0 0 3px #fff,
    1px 0 1px #fff,
    -1px 0 1px #fff,
    0 1px 1px #fff,
    0 -1px 1px #fff;
  pointer-events: none;
  white-space: nowrap;
}
.jb-wx-grid-label.is-extreme span {
  color: #b71c1c;
  font-size: 12px;
  text-shadow:
    0 0 2px #fff,
    0 0 4px #fff,
    1px 0 1px #ffebee,
    -1px 0 1px #ffebee;
}
.jb-wx-grid-label.is-empty span {
  color: #90a4ae;
  font-weight: 500;
}
.jb-wx-side-card.is-extreme {
  border-color: #ef9a9a !important;
  background: #fff5f5 !important;
  box-shadow: inset 3px 0 0 #c62828;
}
.jb-wx-extreme-tag {
  font-size: .65rem;
  font-weight: 700;
  color: #c62828;
  background: #ffcdd2;
  padding: .08rem .3rem;
  border-radius: 3px;
}
.jb-wx-extreme-val {
  background: #c62828 !important;
  color: #fff !important;
  font-weight: 700;
}
.jb-wx-no-extreme {
  color: #78909c;
  font-size: .78rem;
  line-height: 1.45;
}

.jb-poor-filter-dialog { max-width: 520px; }
.jb-poor-filter-body {
  padding: .75rem 1rem 1rem;
  display: grid;
  gap: .65rem;
}
.jb-poor-filter-body label {
  display: grid;
  gap: .25rem;
  font-size: .85rem;
  color: #37474f;
}
.jb-poor-filter-body select {
  padding: .4rem .55rem;
  border: 1px solid #cfd8dc;
  border-radius: 4px;
}
.jb-poor-filter-summary {
  margin-top: .35rem;
  padding: .55rem .65rem;
  background: #fafafa;
  border: 1px solid #eceff1;
  border-radius: 6px;
  font-size: .8rem;
  line-height: 1.45;
}
.jb-poor-filter-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: .35rem;
  font-size: .78rem;
}
.jb-poor-filter-table th,
.jb-poor-filter-table td {
  padding: .25rem .35rem;
  border-bottom: 1px solid #eceff1;
  text-align: left;
}
.jb-poor-filter-side-table .jb-poor-row { cursor: pointer; }
.jb-poor-filter-side-table .jb-poor-row:hover { background: #fff3e0; }
.jb-poor-ndvi { color: #c62828; font-weight: 700; }
.jb-map-legend-poor .jb-swatch.poor-outline {
  display: inline-block;
  width: 14px;
  height: 10px;
  border: 2px solid #c62828;
  background: #ffebee;
  vertical-align: middle;
  margin-right: .2rem;
}

.jb-trend-panel {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 520;
  overflow: hidden;
  background: #f7f9fc;
  padding: .55rem .75rem .7rem;
}
.jb-layout.is-trend-open .jb-trend-panel {
  display: flex !important;
  flex-direction: column;
  gap: .4rem;
}
.jb-trend-head,
.jb-trend-controls,
.jb-trend-metrics {
  flex-shrink: 0;
}
.jb-trend-head {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.jb-trend-head strong { font-size: .92rem; }
.jb-trend-subject { color: #546e7a; font-size: .78rem; flex: 1; }
.jb-trend-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .55rem;
  font-size: .78rem;
}
.jb-trend-presets .btn { padding: .12rem .45rem; font-size: .75rem; }
.jb-trend-presets .btn.is-on {
  background: #1565c0;
  color: #fff;
  border-color: #1565c0;
}
.jb-trend-layer { display: inline-flex; align-items: center; gap: .2rem; }
.jb-trend-metrics { display: flex; flex-direction: column; gap: .45rem; }
.jb-trend-metric-group { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .45rem; }
.jb-trend-metric-group > span {
  flex: 0 0 auto;
  min-width: 2.2rem;
  color: #607d8b;
  font-size: .74rem;
}
.jb-trend-chip {
  border: 1px solid #cfd8dc;
  background: #fafafa;
  border-radius: 999px;
  padding: .08rem .55rem;
  font-size: .72rem;
  cursor: pointer;
}
.jb-trend-chip.is-on {
  background: #e3f2fd;
  border-color: #90caf9;
  color: #0d47a1;
}
.jb-trend-chip.hidden { display: none; }
.jb-trend-notes {
  color: #ef6c00;
  font-size: .72rem;
}
.jb-trend-notes:empty { display: none; }
.jb-trend-charts {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.jb-layout.is-trend-open .jb-map-legend,
.jb-layout.is-trend-open .jb-side-expand-btn {
  visibility: hidden;
  pointer-events: none;
}
.jb-trend-panel-block { margin-bottom: .45rem; }
.jb-trend-panel-block h4 {
  margin: 0 0 .15rem;
  font-size: .75rem;
  color: #455a64;
  font-weight: 600;
}
.jb-trend-svg { width: 100%; height: min(28vh, 260px); display: block; }
.jb-trend-axis { fill: #90a4ae; font-size: 9px; }
.jb-trend-legend {
  font-size: .68rem;
  color: #607d8b;
  display: flex;
  flex-wrap: wrap;
  gap: .2rem .7rem;
}

/* 设备控制 */
#viewDeviceControl.view.active {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-h, 0px));
  min-height: 0;
}
.dc-toolbar {
  flex-wrap: wrap;
  gap: .35rem .6rem;
  align-items: center;
}
.dc-type-filters { display: inline-flex; flex-wrap: wrap; gap: .25rem .5rem; }
.dc-search-wrap { display: inline-flex; align-items: center; gap: .35rem; }
.dc-search-wrap input { min-width: 10rem; }
.dc-range-sep { margin: 0 .25rem; color: #78909c; }
.dc-machinery-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .6rem;
  align-items: center;
  padding: .35rem .75rem;
  background: #f5f8fa;
  border-bottom: 1px solid #e0e6eb;
  font-size: .82rem;
}
.dc-machinery-bar.hidden { display: none; }
.dc-track-status-bar { color: #546e7a; font-size: .78rem; }
.dc-layout {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}
.dc-side {
  width: min(320px, 38vw);
  border-right: 1px solid #e0e6eb;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fafbfc;
}
.dc-side-head { padding: .6rem .75rem .35rem; border-bottom: 1px solid #eceff1; }
.dc-side-head h3 { margin: 0; font-size: .9rem; font-weight: 600; }
.dc-side-hint { margin: .25rem 0 0; font-size: .75rem; color: #78909c; line-height: 1.45; }
.dc-device-list {
  flex: 1;
  overflow: auto;
  padding: .4rem;
  font-size: .8125rem;
  line-height: 1.45;
  color: #37474f;
}
.dc-main {
  flex: 1;
  position: relative;
  min-width: 0;
  min-height: 0;
}
.dc-map { width: 100%; height: 100%; min-height: 280px; }
.dc-map-legend {
  position: absolute;
  left: .5rem;
  bottom: .5rem;
  z-index: 500;
  background: rgba(255,255,255,.92);
  border-radius: 6px;
  padding: .25rem .5rem;
  font-size: .72rem;
  display: flex;
  gap: .6rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.dc-legend-dot {
  display: inline-block;
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  margin-right: .2rem;
  vertical-align: middle;
}
.dc-legend-dot.soil { background: #8d6e63; }
.dc-legend-dot.mach { background: #ff9800; }
.dc-legend-dot.cam { background: #1976d2; }
.dc-selected-badge {
  position: absolute;
  top: .5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 600;
  background: rgba(25,118,210,.92);
  color: #fff;
  padding: .2rem .65rem;
  border-radius: 999px;
  font-size: .78rem;
}
.dc-selected-badge.hidden { display: none; }
.dc-empty, .dc-loading, .dc-error { padding: .75rem; color: #78909c; font-size: .8125rem; line-height: 1.45; }
.dc-error { color: #c62828; }

/* 左侧设备列表 */
.dc-list-item {
  border: 1px solid #e3e8ee;
  border-radius: 8px;
  margin-bottom: .4rem;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.dc-list-item:hover { border-color: #b0bec5; }
.dc-list-item.is-active {
  border-color: #1976d2;
  box-shadow: 0 0 0 1px rgba(25, 118, 210, .25);
}
.dc-list-item.is-search-hit { background: #fffde7; }
.dc-list-item.is-unlocated { opacity: .88; cursor: default; }
.dc-list-item.is-unlocated:hover { border-color: #e3e8ee; }
.dc-list-item > header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem .35rem;
  padding: .5rem .55rem .2rem;
  margin: 0;
  font-size: inherit;
  font-weight: normal;
}
.dc-list-item > header strong {
  flex: 1 1 auto;
  min-width: 0;
  font-size: .875rem;
  font-weight: 600;
  color: #263238;
  line-height: 1.35;
}
.dc-list-code {
  font-size: .6875rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #607d8b;
  background: #f1f4f8;
  padding: .05rem .35rem;
  border-radius: 4px;
}
.dc-list-caret {
  flex: 0 0 auto;
  font-size: .6875rem;
  color: #90a4ae;
  margin-left: .15rem;
}
.dc-list-video {
  flex: 0 0 auto;
  font-size: .6875rem;
  line-height: 1.2;
  padding: .12rem .4rem;
  border-radius: 999px;
  background: #e3f2fd;
  color: #1565c0;
  font-weight: 500;
}
.dc-list-tag {
  flex: 0 0 auto;
  font-size: .6875rem;
  line-height: 1.2;
  padding: .12rem .4rem;
  border-radius: 999px;
  background: #eceff1;
  color: #546e7a;
  font-weight: 500;
}
.dc-list-item[data-cat="soil"] .dc-list-tag { background: #efebe9; color: #6d4c41; }
.dc-list-item[data-cat="machinery"] .dc-list-tag { background: #fff3e0; color: #e65100; }
.dc-list-item[data-cat="camera"] .dc-list-tag { background: #e3f2fd; color: #1565c0; }
.dc-list-sub {
  margin: 0;
  padding: 0 .55rem .45rem;
  font-size: .75rem;
  color: #78909c;
  line-height: 1.4;
  word-break: break-word;
}
.dc-list-detail {
  display: none;
  padding: 0 .55rem .55rem;
  border-top: 1px solid #eef2f5;
  font-size: .8125rem;
}
.dc-list-item.is-expanded .dc-list-detail { display: block; }
.dc-list-section-hint {
  margin: .5rem 0 .35rem;
  padding: .35rem .45rem;
  font-size: .75rem;
  color: #78909c;
  background: #f5f7fa;
  border-radius: 6px;
  line-height: 1.4;
}
.dc-meta-line {
  margin: 0 0 .45rem;
  font-size: .8125rem;
  line-height: 1.45;
  color: #455a64;
}
.dc-meta-line strong { font-size: inherit; font-weight: 600; }
.dc-muted {
  display: block;
  margin-top: .25rem;
  font-size: .75rem;
  color: #90a4ae;
  line-height: 1.4;
}
#viewDeviceControl .dc-table {
  font-size: .75rem;
  margin-top: .35rem;
}
#viewDeviceControl .dc-table th,
#viewDeviceControl .dc-table td {
  padding: .3rem .4rem;
}
#viewDeviceControl .dc-list-detail .btn {
  font-size: .8125rem;
  margin-top: .25rem;
}
#viewDeviceControl .dc-list-detail .iot-ptz-wrap {
  margin-top: .45rem;
}
#viewDeviceControl .dc-list-detail .iot-ptz-label {
  font-size: .75rem;
}
#viewDeviceControl .dc-list-detail .iot-ptz-btn {
  font-size: .875rem;
}
.dc-video-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.dc-video-modal.hidden { display: none; }
.dc-video-dialog {
  background: #fff;
  border-radius: 10px;
  width: min(920px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dc-video-dialog header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .5rem .75rem;
  border-bottom: 1px solid #eceff1;
}
.dc-video-dialog header h3 { margin: 0; font-size: 1rem; }
.dc-video-host { min-height: 360px; background: #000; }
.dc-talk-stage {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #eceff1;
  background: #263238;
}
.dc-talk-stage p { margin: 0; font-size: .95rem; }
.dc-talk-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem .75rem;
  border-top: 1px solid #eceff1;
  background: #fff;
}
.dc-talk-bar.hidden { display: none; }
#dcTalkHoldBtn.is-holding { background: #c62828; border-color: #c62828; color: #fff; }
.dc-talk-bar span { color: #546e7a; font-size: .85rem; }
.dc-video-title-wrap { display: flex; align-items: center; gap: .75rem; }
.dc-video-channel { display: flex; align-items: center; gap: .25rem; font-size: .85rem; }
.dc-video-channel.hidden { display: none; }
.dc-report-actions { display: flex; flex-wrap: wrap; gap: .35rem; margin: .35rem 0; }
.dc-report-title { font-size: .8rem; font-weight: 600; margin-top: .35rem; }
.dc-report-foot {
  display: flex;
  justify-content: flex-end;
  color: #607d8b;
  font-size: .75rem;
  margin: .15rem 0 .4rem;
}
.dc-meta-ok { color: #2e7d32; }
.dc-meta-warn { color: #e65100; }
@media (max-width: 768px) {
  .dc-layout { flex-direction: column; }
  .dc-side { width: 100%; max-height: 38vh; border-right: none; border-bottom: 1px solid #e0e6eb; }
}

#viewFarmPlan { flex: 1; min-height: 0; overflow: hidden; }
#viewFarmPlan.active { display: flex; flex-direction: column; }
.fp-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .6rem; padding: .5rem .75rem; border-bottom: 1px solid #e0e6eb; background: #fff; }
.fp-body { flex: 1; min-height: 0; display: flex; }
.fp-panel { width: 250px; flex-shrink: 0; background: #fff; border-right: 1px solid #e0e6eb; overflow-y: auto; padding: .75rem; font-size: .85rem; }
.fp-right { border-right: none; border-left: 1px solid #e0e6eb; display: flex; flex-direction: column; }
.fp-map-wrap { flex: 1; min-width: 0; position: relative; }
#fpMap { height: 100%; }
.fp-panel h3 { font-size: .92rem; margin-bottom: .5rem; }
.fp-panel .hint { color: #607d8b; font-size: .78rem; margin: .35rem 0; }
.fp-search { width: 100%; padding: .4rem .5rem; border: 1px solid #cfd8dc; border-radius: 4px; margin-bottom: .5rem; }
.fp-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: 0; }
#fpL3Chips { max-height: 180px; overflow-y: auto; }
.fp-level { padding-bottom: .5rem; margin-bottom: .5rem; border-bottom: 1px solid #e0e6eb; }
.fp-autofill-trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.fp-chip { border: 1px solid #cfd8dc; background: #fff; padding: .2rem .55rem; border-radius: 4px; cursor: pointer; font-size: .8rem; }
.fp-chip.on { border-color: #2e7d32; background: #e8f5e9; color: #1b5e20; }
.fp-chip.suggest { border-style: dashed; color: #2e7d32; }
.fp-chip:disabled { opacity: .45; cursor: not-allowed; }
.fp-field { display: block; margin: .4rem 0; }
.fp-field input, .fp-field select { width: 100%; margin-top: .2rem; padding: .35rem .45rem; border: 1px solid #cfd8dc; border-radius: 4px; }
.fp-suggest { border: 1px solid #e0e6eb; max-height: 160px; overflow-y: auto; margin-bottom: .5rem; }
.fp-suggest.hidden,
.fp-level.hidden,
#fpRateBlock.hidden { display: none; }
.fp-suggest button { display: block; width: 100%; text-align: left; padding: .35rem .5rem; border: none; background: #fff; cursor: pointer; font-size: .8rem; }
.fp-suggest button:hover { background: #f5f5f5; }
.fp-locked { opacity: .45; pointer-events: none; }
.fp-actions { margin-top: .75rem; }
.fp-actions .btn { width: 100%; margin-bottom: .4rem; }
.fp-plan-list-title { margin-top: 1rem; }
#viewFarmPlan.fp-team-readonly .fp-write-only { display: none !important; }
#viewFarmPlan.fp-team-readonly .fp-legend-plan { display: none; }
#fpReadonlyHint { display: none; }
#viewFarmPlan.fp-team-readonly #fpReadonlyHint { display: block; }
#viewFarmPlan.fp-team-readonly .fp-plan-list-title { margin-top: 0; }
.fp-plan-list { flex: 1; overflow-y: auto; font-size: .8rem; }
.fp-plan-item { border: 1px solid #eceff1; padding: .45rem .5rem; margin-bottom: .4rem; cursor: pointer; }
.fp-plan-item.on { border-color: #2e7d32; background: #f1f8e9; }
.fp-plan-item-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .4rem; }
.fp-plan-item-head .btn { flex-shrink: 0; padding: .1rem .45rem; font-size: .72rem; }
.fp-plan-item-actions { display: flex; gap: .25rem; flex-shrink: 0; }
.fp-pager { display: flex; justify-content: flex-end; align-items: center; gap: .45rem; flex-wrap: wrap; padding: .4rem 0 0; font-size: .75rem; }
.fp-legend { position: absolute; left: 10px; bottom: 10px; z-index: 500; background: #fff; border: 1px solid #e0e6eb; padding: .45rem .55rem; font-size: .72rem; line-height: 1.45; }
.fp-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 1px solid #9a9a94;
  margin-right: 4px;
  vertical-align: -1px;
}
.fp-detail-title { font-size: .86rem; color: #1b5e20; font-weight: 600; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#viewFarmPlan.fp-detail-on .fp-plan-chrome { display: none !important; }
#viewFarmPlan.fp-detail-on #fpLeft,
#viewFarmPlan.fp-detail-on #fpRight { display: none; }
#viewFarmPlan.fp-detail-on #fpCompanySelect,
#viewFarmPlan.fp-detail-on #fpRegionSelect { display: none; }
#viewFarmPlan.fp-detail-on #fpDetailSide { display: block; width: 280px; }
#viewFarmPlan.fp-detail-on #fpDetailBackBtn,
#viewFarmPlan.fp-detail-on #fpDetailTitle { display: inline-flex; }
#viewFarmPlan:not(.fp-detail-on) #fpDetailBackBtn,
#viewFarmPlan:not(.fp-detail-on) #fpDetailTitle,
#fpDetailSide.hidden { display: none; }
#viewFarmPlan.fp-detail-on .fp-legend-plan { display: none; }
#viewFarmPlan:not(.fp-detail-on) .fp-legend-detail { display: none; }
#fpRateSprayHint.hidden { display: none; }
.fp-detail-body { font-size: .84rem; line-height: 1.65; }
.fp-detail-body .fp-detail-row { display: flex; justify-content: space-between; gap: .5rem; padding: .28rem 0; border-bottom: 1px solid #f0f0f0; }
.fp-detail-body .fp-detail-row b { font-weight: 600; }
.fp-qty-label-host { background: none !important; border: none !important; }
.fp-qty-label {
  transform: translate(-50%, -50%);
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(0,0,0,.16);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 10px;
  line-height: 1.25;
  color: #263238;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
}
.fp-box-overlay { position: absolute; inset: 0; z-index: 800; cursor: crosshair; }
.fp-box-overlay.hidden { display: none; }
.fp-modal { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; }
.fp-modal.hidden { display: none; }
.fp-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.fp-dialog { position: relative; background: #fff; width: min(560px, 94vw); max-height: 86vh; overflow: auto; padding: 1rem; border-radius: 8px; }
.fp-dialog h3 { margin-bottom: .5rem; }
.fp-dialog-actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: .75rem; }
.fp-sku-row { display: flex; justify-content: space-between; gap: .5rem; padding: .35rem 0; border-bottom: 1px solid #f0f0f0; font-size: .82rem; }
@media (max-width: 900px) {
  .fp-body { flex-direction: column; }
  .fp-panel { width: 100%; max-height: 28vh; border-right: none; border-bottom: 1px solid #e0e6eb; }
  .fp-map-wrap { min-height: 40vh; }
}

/* 手机：地图高度固定，筛选和列表面板盖在地图上，不把地图往下挤 */
.mobile-sheet-btn { display: none; }
.map-legend-chip { display: none; }
.mobile-tabbar { display: none; }

@media (max-width: 900px) {
  .mobile-tabbar {
    flex-shrink: 0;
    height: calc(52px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #1a2744;
    z-index: 1050;
  }
  .mobile-tab {
    flex: 1;
    border: none;
    background: transparent;
    color: #90a4ae;
    font-size: .82rem;
    min-height: 44px;
    cursor: pointer;
  }
  .mobile-tab.active { color: #fff; font-weight: 600; }
  .mobile-tab[hidden] { display: none; }

  .toolbar,
  .fp-toolbar,
  .pp-toolbar,
  .dc-toolbar,
  .jb-toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    height: 48px;
    max-height: 48px;
    flex-shrink: 0;
    align-items: center;
    -webkit-overflow-scrolling: touch;
  }
  .toolbar select,
  .fp-toolbar select,
  .pp-toolbar select,
  .dc-toolbar select,
  .jb-toolbar select {
    flex: 0 0 auto;
    min-width: 7.2rem;
    max-width: 11rem;
    min-height: 36px;
  }

  #viewMap { position: relative; }
  #viewMap #map {
    position: absolute;
    inset: 0;
    flex: none;
    height: auto;
    z-index: 1;
  }
  #viewMap .leaflet-top { top: 56px; }
  #viewMap .toolbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 500;
    background: rgba(255,255,255,.96);
  }
  #viewMap .toolbar:not(.toolbar-expanded) #mapFilterWrap {
    width: auto;
    flex: 1 1 auto;
    display: flex;
    flex-wrap: nowrap;
    gap: .35rem;
  }
  #viewMap .toolbar:not(.toolbar-expanded) #companySelect {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
  }
  #viewMap .toolbar.toolbar-expanded {
    top: auto;
    bottom: 0;
    height: auto;
    max-height: min(56vh, 460px);
    overflow-x: hidden;
    overflow-y: auto;
    flex-wrap: wrap;
    align-items: stretch;
    z-index: 860;
    border-radius: 14px 14px 0 0;
    padding-top: 14px;
    padding-bottom: .85rem;
    box-shadow: 0 -6px 24px rgba(0,0,0,.16);
    background-image: linear-gradient(#cfd8dc, #cfd8dc);
    background-size: 36px 4px;
    background-repeat: no-repeat;
    background-position: center 8px;
    background-color: rgba(255,255,255,.96);
  }
  #viewMap .toolbar.toolbar-expanded #mapFilterWrap,
  #viewMap .toolbar.toolbar-expanded .toolbar-check-group,
  #viewMap .toolbar.toolbar-expanded .map-edit-only,
  #viewMap .toolbar.toolbar-expanded .selection-bar,
  #viewMap .toolbar.toolbar-expanded .soil-edit-toolbar {
    width: 100%;
    flex: 1 1 100%;
  }
  #viewMap .toolbar.toolbar-expanded .toolbar-collapsible.hidden,
  #viewMap .toolbar.toolbar-expanded .hidden,
  #viewMap .toolbar.toolbar-expanded .toolbar-collapsible[style*="display:none"],
  #viewMap .toolbar.toolbar-expanded .toolbar-collapsible[style*="display: none"] {
    display: none !important;
  }
  #viewMap .toolbar .toolbar-more-btn {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 .75rem;
    border: 1px solid #cfd8dc;
    border-radius: 6px;
    background: #fff;
    color: #1565c0;
    font-size: .85rem;
  }
  #viewMap .sentinel-guide-bar {
    position: absolute;
    top: 52px;
    left: 8px;
    right: 8px;
    z-index: 480;
    margin: 0;
    max-height: 34vh;
    overflow: auto;
  }

  .map-legend-chip {
    display: inline-flex;
    align-items: center;
    position: absolute;
    left: 10px;
    bottom: 12px;
    z-index: 700;
    min-height: 32px;
    padding: 0 .7rem;
    border: 1px solid #d5dde5;
    border-radius: 999px;
    background: rgba(255,255,255,.94);
    color: #37474f;
    font-size: .75rem;
    cursor: pointer;
  }
  #mapLegend { display: none; }
  #mapLegend.legend-open {
    display: block;
    left: 8px;
    right: 8px;
    bottom: 50px;
    max-height: 34vh;
    z-index: 720;
  }
  #viewMap:has(.parcel-panel:not(.hidden)) .map-legend-chip,
  #viewMap:has(.parcel-panel:not(.hidden)) #mapLegend,
  #viewMap:has(.toolbar.toolbar-expanded) .map-legend-chip,
  #viewMap:has(.toolbar.toolbar-expanded) #mapLegend {
    display: none;
  }

  .parcel-panel {
    position: absolute;
    top: auto;
    right: 0;
    left: 0;
    bottom: 0;
    width: auto;
    max-height: min(52vh, 460px);
    z-index: 900;
  }

  .mobile-sheet-btn { display: inline-flex; flex: 0 0 auto; }

  #viewFarmPlan .fp-body {
    display: block;
    position: relative;
    flex: 1;
    min-height: 0;
  }
  #viewFarmPlan .fp-map-wrap {
    position: absolute;
    inset: 0;
    min-height: 0;
    height: auto;
  }
  #viewFarmPlan .fp-panel {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: min(48vh, 420px);
    z-index: 8;
    border: none;
    border-top: 1px solid #e0e6eb;
    border-radius: 14px 14px 0 0;
    background: #fff;
  }
  #viewFarmPlan.fp-mobile-compose #fpLeft,
  #viewFarmPlan.fp-mobile-plans #fpRight {
    display: block;
  }
  #viewFarmPlan.fp-detail-on #fpDetailSide {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: min(48vh, 420px);
    z-index: 9;
    border-radius: 14px 14px 0 0;
  }
  #viewFarmPlan.fp-mobile-compose .fp-legend,
  #viewFarmPlan.fp-mobile-plans .fp-legend,
  #viewFarmPlan.fp-detail-on .fp-legend { display: none; }
  #viewFarmPlan .fp-legend {
    left: 8px;
    right: 8px;
    max-height: 22px;
    overflow: hidden;
    cursor: pointer;
  }
  #viewFarmPlan .fp-legend.is-open {
    max-height: 32vh;
    overflow: auto;
  }

  #viewPlantProtection .pp-map-wrap {
    display: block;
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }
  #viewPlantProtection #ppMap {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
  }
  #viewPlantProtection .pp-stats-panel,
  #viewPlantProtection .pp-strip-panel {
    position: absolute;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100% !important;
    max-width: none;
    height: auto;
    max-height: min(52vh, 480px);
    z-index: 800;
    transition: none;
    border-radius: 14px 14px 0 0;
    border-left: none;
  }
  #viewPlantProtection .pp-map-wrap:not(.pp-stats-open) .pp-stats-panel,
  #viewPlantProtection .pp-map-wrap:not(.pp-strip-open) .pp-strip-panel {
    display: none !important;
  }
  #ppToolbar {
    flex-wrap: wrap !important;
    align-items: center;
    align-content: flex-start;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    height: auto !important;
    max-height: none;
    row-gap: 4px;
  }
  #ppToolbar > * {
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none !important;
    min-width: max-content;
    white-space: nowrap;
  }
  #ppToolbar .pp-range-filter {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    white-space: normal;
  }
  #ppToolbar .pp-range-filter label,
  #ppToolbar .pp-range-filter input,
  #ppToolbar .pp-range-filter .btn {
    flex: 0 0 auto;
    min-width: max-content;
    white-space: nowrap;
  }
  #ppToolbar .btn,
  #ppToolbar .toolbar-check,
  #ppToolbar select,
  #ppToolbar input,
  #ppToolbar label {
    flex-shrink: 0;
    width: auto;
    max-width: none;
    white-space: nowrap;
    overflow: visible;
  }
  #ppToolbar select {
    min-width: 7.5rem;
    max-width: none;
    padding-right: 1.4rem;
  }
  #ppTimelineMeta,
  #ppMeta {
    flex: 1 0 100% !important;
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    white-space: normal !important;
    overflow: visible;
  }
  .pp-map-legend {
    left: 8px;
    right: 8px;
    bottom: 28px;
    max-width: none;
    max-height: none;
    overflow: visible;
    pointer-events: none;
  }
  .pp-map-legend .pp-legend-item,
  .pp-map-legend .pp-traj-legend {
    white-space: normal;
  }
  #ppMap .leaflet-control-attribution {
    font-size: 10px;
    line-height: 1.2;
    max-width: calc(100% - 16px);
  }

  .dc-layout { position: relative; display: block; }
  .dc-layout.is-list-hidden .dc-side { display: none; }
  .dc-main { position: absolute; inset: 0; }
  .dc-side {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    max-height: min(46vh, 400px);
    z-index: 6;
    background: #fff;
    border-right: none;
    border-top: 1px solid #e0e6eb;
    border-radius: 14px 14px 0 0;
  }
  .dc-map { min-height: 0; }
  .dc-machinery-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    max-height: 44px;
  }

  #viewJiumingBrain .jb-layout { display: block; }
  #viewJiumingBrain .jb-main {
    position: absolute;
    inset: 0;
    min-height: 0;
  }
  #viewJiumingBrain .jb-map { min-height: 0; }
  #viewJiumingBrain .jb-side {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100% !important;
    min-width: 0;
    max-width: none;
    max-height: min(46vh, 400px);
    z-index: 6;
    border-radius: 14px 14px 0 0;
    border-top: 1px solid #e0e6eb;
  }
  #viewJiumingBrain .jb-side-resizer { display: none; }
  #jbMgmtTop:not(.is-collapsed) .jb-mgmt-body { max-height: 26vh; overflow: auto; }
  #jbDataStatus { max-height: 72px; overflow: auto; }
}

@media (min-width: 901px) {
  .dc-layout.is-list-hidden .dc-side { display: none; }
}

@media (max-width: 768px) {
  .mobile-tabbar { display: flex; }
}

/* 小沧：默认可停在右上角，按住图标能拖到页面任意位置 */
body:has(#ctAssistant) .toolbar { padding-right: 4.8rem; }
.ct-assistant { position: static; }
.ct-assistant-btn {
  position: fixed;
  top: 12px;
  right: 14px;
  z-index: 1260;
  width: 58px;
  height: 58px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #e7f6ec;
  cursor: grab;
  touch-action: none;
  user-select: none;
  box-shadow: 0 4px 14px rgba(26, 39, 68, .18);
}
.ct-assistant-btn.is-dragging { cursor: grabbing; }
.ct-assistant-btn:hover { background: #f4fff6; }
.ct-assistant-btn:focus-visible { outline: 2px solid #1565c0; outline-offset: 2px; }
.ct-mascot { width: 100%; height: 100%; display: block; overflow: visible; }
.ct-mascot-bob { transform-origin: 40px 48px; animation: ct-bob 2.6s ease-in-out infinite; }
.ct-sprout { transform-origin: 40px 20px; animation: ct-sprout 3.2s ease-in-out infinite; }
.ct-eyes { transform-box: fill-box; transform-origin: center; animation: ct-look 5.5s ease-in-out infinite; }
.ct-lids {
  transform-box: fill-box;
  transform-origin: center;
  transform: scaleY(0);
  animation: ct-blink 4.8s infinite;
}
.ct-arm { transform-origin: 58px 50px; animation: ct-wave 3.6s ease-in-out infinite; }
.ct-assistant.is-thinking .ct-mouth { transform-origin: 40px 57px; animation: ct-talk .32s ease-in-out infinite; }
.ct-assistant.is-open .ct-assistant-btn { box-shadow: 0 0 0 3px rgba(21, 101, 192, .25); }
@keyframes ct-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2.4px); }
}
@keyframes ct-sprout {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(6deg); }
}
@keyframes ct-look {
  0%, 100% { transform: translateX(0); }
  35% { transform: translateX(1px); }
  70% { transform: translateX(-1px); }
}
@keyframes ct-blink {
  0%, 86%, 100% { transform: scaleY(0); }
  90%, 94% { transform: scaleY(1); }
}
@keyframes ct-wave {
  0%, 68%, 100% { transform: rotate(0deg); }
  78% { transform: rotate(-18deg); }
  88% { transform: rotate(8deg); }
}
@keyframes ct-talk {
  50% { transform: translateY(1px) scaleY(.75); }
}
.ct-assistant-panel {
  position: fixed;
  top: 78px;
  right: 14px;
  z-index: 1260;
  width: min(400px, calc(100vw - 28px));
  height: min(560px, calc(100vh - 104px));
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #d5e0e8;
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(26, 39, 68, .16);
  overflow: hidden;
}
.ct-assistant-panel[hidden] { display: none !important; }
.ct-assistant-head {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .65rem .75rem;
  background: #f3faf5;
  border-bottom: 1px solid #e1eee6;
}
.ct-mascot-mini { width: 42px; height: 42px; flex-shrink: 0; }
.ct-assistant-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ct-assistant-title strong { font-size: .95rem; }
.ct-assistant-title span {
  color: #5d6d7e;
  font-size: .75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ct-assistant-close {
  border: none;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: #607d8b;
  width: 36px;
  height: 36px;
}
.ct-assistant-log {
  flex: 1;
  overflow: auto;
  padding: .75rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  background: #f7f8fa;
}
.ct-msg { max-width: 92%; display: flex; flex-direction: column; gap: .2rem; }
.ct-msg.is-user { align-self: flex-end; }
.ct-msg.is-bot { align-self: flex-start; }
.ct-msg-body {
  padding: .55rem .7rem;
  border-radius: 12px;
  line-height: 1.55;
  font-size: .88rem;
  white-space: pre-wrap;
  word-break: break-word;
}
.ct-msg.is-user .ct-msg-body { background: #1565c0; color: #fff; border-bottom-right-radius: 4px; }
.ct-msg.is-bot .ct-msg-body { background: #fff; color: #1a1a2e; border: 1px solid #e4eaef; border-bottom-left-radius: 4px; }
.ct-msg-note { font-size: .7rem; color: #90a4ae; padding: 0 .15rem; }
.ct-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 4px;
  border-radius: 50%;
  background: #90a4ae;
  animation: ct-dot 1s infinite;
}
.ct-dot:nth-child(2) { animation-delay: .15s; }
.ct-dot:nth-child(3) { animation-delay: .3s; }
@keyframes ct-dot {
  0%, 80%, 100% { opacity: .3; }
  40% { opacity: 1; }
}
.ct-assistant-prompts {
  display: flex;
  gap: .4rem;
  padding: .4rem .75rem 0;
  background: #fff;
}
.ct-assistant-prompts button {
  border: 1px solid #d5e0e8;
  background: #f7faf8;
  color: #2e5a3c;
  border-radius: 999px;
  padding: .25rem .65rem;
  font-size: .75rem;
  cursor: pointer;
}
.ct-assistant-form {
  display: flex;
  gap: .45rem;
  align-items: flex-end;
  padding: .6rem .75rem .75rem;
  background: #fff;
}
.ct-assistant-form textarea {
  flex: 1;
  resize: none;
  border: 1px solid #d0d7de;
  border-radius: 10px;
  padding: .5rem .65rem;
  font: inherit;
  font-size: .88rem;
  min-height: 44px;
}
.ct-assistant-form .btn { height: 36px; }
@media (max-width: 768px) {
  .ct-assistant-btn {
    top: calc(58px + env(safe-area-inset-top, 0px));
    right: 8px;
    width: 48px;
    height: 48px;
  }
  .ct-assistant-panel {
    top: auto;
    left: 8px;
    right: 8px;
    width: auto;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    height: min(68vh, 560px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ct-mascot-bob, .ct-sprout, .ct-eyes, .ct-lids, .ct-arm, .ct-assistant.is-thinking .ct-mouth, .ct-dot {
    animation: none;
  }
}
