:root {
  color-scheme: dark;
  --night-soil: #061b18;
  --deep-reed: #0c332c;
  --deep-reed-2: #10443a;
  --rice-white: #eaf5ea;
  --mist: #a8bdb5;
  --seedling: #79d0a3;
  --water-vein: #38b7c5;
  --grain-gold: #f2b65b;
  --risk: #f06f67;
  --planned: #778a84;
  --surface: rgba(7, 39, 34, 0.94);
  --surface-raised: rgba(12, 51, 44, 0.96);
  --surface-muted: rgba(13, 55, 47, 0.62);
  --border: rgba(149, 205, 183, 0.17);
  --border-strong: rgba(121, 208, 163, 0.36);
  --shadow: 0 20px 65px rgba(0, 12, 10, 0.26);
  --map-land-high: #174b40;
  --map-land-low: #0a2b27;
  --map-contour: rgba(121, 208, 163, 0.11);
  --font-body: "Source Han Sans SC", "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-data: "IBM Plex Mono", "SFMono-Regular", "Cascadia Code", "Roboto Mono", monospace;
  --radius-lg: 18px;
  --radius-md: 12px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
}

html[data-theme="light"] {
  color-scheme: light;
  --night-soil: #edf5ef;
  --deep-reed: #dcebe1;
  --deep-reed-2: #cce1d4;
  --rice-white: #12352e;
  --mist: #506861;
  --seedling: #1f7a54;
  --water-vein: #126f7d;
  --grain-gold: #936100;
  --risk: #b5423b;
  --planned: #52645e;
  --surface: rgba(250, 253, 250, 0.96);
  --surface-raised: rgba(239, 247, 241, 0.98);
  --surface-muted: rgba(218, 236, 224, 0.72);
  --border: rgba(34, 91, 73, 0.16);
  --border-strong: rgba(31, 127, 91, 0.35);
  --shadow: 0 20px 65px rgba(35, 73, 58, 0.12);
  --map-land-high: #b8dbc8;
  --map-land-low: #8ebca8;
  --map-contour: rgba(21, 96, 72, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--night-soil);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--rice-white);
  background:
    radial-gradient(circle at 62% 18%, color-mix(in srgb, var(--water-vein) 9%, transparent), transparent 34%),
    linear-gradient(180deg, color-mix(in srgb, var(--night-soil) 88%, #000 12%), var(--night-soil));
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: 10px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--rice-white);
  color: var(--night-soil);
  transform: translateY(-150%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  width: min(100%, 2048px);
  margin: 0 auto;
  padding: 14px;
}

.app-header {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(250px, auto) minmax(330px, 1fr);
  align-items: center;
  gap: var(--space-4);
  padding: 8px 6px 13px;
  border-bottom: 1px solid var(--border-strong);
}

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

.brand-mark {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  stroke: var(--seedling);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-lockup p,
.brand-lockup h1 {
  margin: 0;
}

.brand-name {
  color: var(--seedling);
  font-weight: 650;
  font-size: 13px;
  letter-spacing: 0.08em;
}

.brand-name span {
  margin-left: 6px;
  color: var(--mist);
  font-family: var(--font-data);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.brand-lockup h1 {
  margin-top: 3px;
  font-size: clamp(22px, 1.6vw, 30px);
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.current-context {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.current-context > span {
  color: var(--mist);
  font-size: 12px;
}

.current-context strong {
  min-width: 0;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.current-context em {
  flex: 0 0 auto;
}

.header-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.connection-state {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--mist);
  font-size: 12px;
}

.connection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--seedling);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--seedling) 14%, transparent);
}

.icon-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-muted);
  cursor: pointer;
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: var(--seedling);
  outline: none;
}

.clock {
  min-width: 84px;
  text-align: right;
  color: var(--rice-white);
  font-family: var(--font-data);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.operations-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 14px;
}

.operation-stat {
  min-width: 0;
  min-height: 82px;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-content: center;
  gap: 2px 10px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.operation-stat::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--water-vein);
}

.operation-stat--accent::before {
  background: var(--seedling);
}

.operation-stat--attention::before {
  background: var(--grain-gold);
}

.operation-stat span {
  color: var(--mist);
  font-size: 13px;
}

.operation-stat strong {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  color: var(--rice-white);
  font-family: var(--font-data);
  font-size: clamp(24px, 2vw, 34px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.operation-stat small {
  min-width: 0;
  color: var(--mist);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "map"
    "metrics"
    "actions"
    "capabilities"
    "quality";
}

.surface {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.surface:focus {
  outline: 2px solid var(--water-vein);
  outline-offset: 3px;
}

.surface-header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.surface-header p,
.surface-header h2 {
  margin: 0;
}

.surface-header h2 {
  margin-top: 1px;
  font-size: clamp(16px, 1.05vw, 20px);
  line-height: 1.25;
  letter-spacing: 0.02em;
}

.eyebrow {
  color: var(--water-vein);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.surface-meta {
  flex: 0 0 auto;
  color: var(--mist);
  font-size: 12px;
}

.state-pill {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-style: normal;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.state-online {
  color: var(--seedling);
  background: color-mix(in srgb, var(--seedling) 9%, transparent);
}

.state-planned,
.state-disabled {
  color: var(--planned);
  background: color-mix(in srgb, var(--planned) 9%, transparent);
}

.state-attention {
  color: var(--grain-gold);
  background: color-mix(in srgb, var(--grain-gold) 9%, transparent);
}

.state-risk {
  color: var(--risk);
  background: color-mix(in srgb, var(--risk) 9%, transparent);
}

.map-panel {
  grid-area: map;
  min-height: 500px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--water-vein) 9%, transparent), transparent 45%),
    var(--surface);
}

.map-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  color: var(--mist);
  font-size: 12px;
}

.map-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.site-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--mist);
  font-size: 12px;
}

.site-picker select {
  min-width: 160px;
  min-height: 44px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface-muted);
  color: var(--rice-white);
  font: inherit;
  cursor: pointer;
}

.site-picker select:focus-visible {
  outline: 2px solid var(--grain-gold);
  outline-offset: 2px;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-symbol {
  font-family: var(--font-data);
  font-style: normal;
  font-size: 13px;
}

.legend-symbol--online {
  color: var(--seedling);
}

.legend-symbol--planned {
  color: var(--planned);
}

.legend-symbol--attention {
  color: var(--grain-gold);
}

.map-stage {
  height: 430px;
  min-height: 0;
  position: relative;
  overflow: hidden;
  padding: 10px 16px 16px;
}

.standard-map-shell {
  position: absolute;
  inset: 10px 12px 14px 12px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  margin: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--water-vein) 24%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-muted) 88%, var(--night-soil));
  box-shadow: inset 0 0 28px color-mix(in srgb, var(--water-vein) 8%, transparent);
}

.standard-map-shell figcaption {
  padding: 4px 8px 5px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-raised) 92%, transparent);
  color: var(--mist);
  font-size: 12px;
  line-height: 1.25;
  text-align: center;
}

.standard-map-canvas {
  width: 100%;
  height: 100%;
  max-width: 100%;
  min-height: 0;
  position: relative;
  justify-self: stretch;
  overflow: hidden;
  touch-action: none;
  cursor: default;
}

.map-panzoom {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.standard-map-canvas.is-zoomed {
  cursor: grab;
}

.standard-map-canvas.is-dragging {
  cursor: grabbing;
}

.map-zoom-controls {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: color-mix(in srgb, var(--night-soil) 90%, transparent);
  box-shadow: 0 8px 24px rgb(0 0 0 / 18%);
  z-index: 8;
}

.map-zoom-controls button {
  min-width: 32px;
  min-height: 32px;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--rice-white);
  font: 700 13px/1 var(--font-body);
  cursor: pointer;
}

.map-zoom-controls button:hover,
.map-zoom-controls button:focus-visible {
  border-color: var(--water-vein);
  outline: 0;
}

.map-zoom-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.map-zoom-controls output {
  min-width: 42px;
  color: var(--mist);
  font: 600 12px/1 var(--font-data);
  text-align: center;
}

.china-map {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.standard-china-map {
  min-height: 0;
  object-fit: contain;
  object-position: center;
  background: #fff;
}

.vector-china-map {
  background: transparent;
}

.vector-province {
  stroke: color-mix(in srgb, var(--water-vein) 48%, var(--surface-raised));
  stroke-width: 0.8;
  transition: fill 160ms ease, opacity 160ms ease;
}

.vector-province--tone-0 { fill: color-mix(in srgb, var(--seedling) 28%, var(--surface-muted)); }
.vector-province--tone-1 { fill: color-mix(in srgb, var(--water-vein) 20%, var(--surface-muted)); }
.vector-province--tone-2 { fill: color-mix(in srgb, var(--grain-gold) 15%, var(--surface-muted)); }
.vector-province--tone-3 { fill: color-mix(in srgb, var(--seedling) 18%, var(--surface-raised)); }

.vector-province:hover {
  fill: color-mix(in srgb, var(--water-vein) 34%, var(--surface-raised));
}

.vector-map-loading {
  fill: var(--mist);
  font-family: var(--font-body);
  font-size: 18px;
}

.map-markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.map-shadow {
  fill: color-mix(in srgb, var(--water-vein) 16%, transparent);
  filter: url(#softGlow);
  transform: translateY(4px);
}

.map-land {
  fill: url(#landV2);
  stroke: color-mix(in srgb, var(--seedling) 58%, transparent);
  stroke-width: 2;
}

.map-fields {
  fill: url(#fieldLines);
  opacity: 0.85;
}

.life-line,
.province-line {
  fill: none;
  stroke-linecap: round;
}

.life-line {
  stroke-width: 2;
  stroke-dasharray: 9 8;
}

.life-line--water {
  stroke: color-mix(in srgb, var(--water-vein) 42%, transparent);
}

.life-line--field {
  stroke: color-mix(in srgb, var(--seedling) 30%, transparent);
}

.province-line {
  stroke: color-mix(in srgb, var(--rice-white) 11%, transparent);
  stroke-width: 1;
}

.map-island {
  fill: var(--map-land-high);
  stroke: color-mix(in srgb, var(--seedling) 45%, transparent);
}

.map-marker {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  position: absolute;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  z-index: 3;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(var(--marker-scale, 1));
}

.marker-core {
  width: 14px;
  height: 14px;
  position: absolute;
  left: 5px;
  top: 5px;
  display: block;
  border-radius: 50%;
  border: 2px solid var(--planned);
  background: var(--surface-raised);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.marker-core::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: inherit;
  background: var(--planned);
}

.marker-label {
  position: absolute;
  left: 22px;
  top: 0;
  padding: 3px 7px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--night-soil) 84%, transparent);
  color: var(--mist);
  font-size: 12px;
  white-space: nowrap;
  transition: color 180ms ease, background 180ms ease;
}

.map-marker--online .marker-core {
  border-color: var(--seedling);
  box-shadow: 0 0 0 7px color-mix(in srgb, var(--seedling) 10%, transparent);
}

.map-marker--online .marker-core::after {
  background: var(--seedling);
}

.map-marker.is-selected .marker-core,
.map-marker:hover .marker-core,
.map-marker:focus-visible .marker-core {
  transform: scale(1.13);
  border-color: var(--water-vein);
  box-shadow: 0 0 0 9px color-mix(in srgb, var(--water-vein) 12%, transparent), 0 0 24px color-mix(in srgb, var(--water-vein) 30%, transparent);
}

.map-marker--online.is-selected .marker-core::after {
  background: var(--seedling);
}

.map-marker--planned.is-selected .marker-core::after {
  background: var(--planned);
}

.map-marker.is-selected .marker-label,
.map-marker:hover .marker-label,
.map-marker:focus-visible .marker-label {
  color: var(--rice-white);
  background: color-mix(in srgb, var(--deep-reed-2) 94%, transparent);
}

.map-marker:focus-visible {
  outline: 2px solid var(--grain-gold);
  outline-offset: 2px;
  border-radius: 50%;
}

.marker-kashgar { left: 14%; top: 46%; }
.marker-changsha-crop { left: 68%; top: 72%; }
.marker-changsha-live { left: 71%; top: 69%; }
.marker-wuhan { left: 72%; top: 63%; }
.marker-panyu { left: 75%; top: 85%; }
.marker-yangjiang { left: 70%; top: 88%; }
.marker-maoming { left: 65%; top: 88%; }
.marker-guizhou { left: 59%; top: 72%; }
.marker-guilin { left: 66%; top: 78%; }

.selected-base-card {
  width: 222px;
  position: absolute;
  right: 14px;
  top: 12px;
  padding: 14px 15px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-raised) 94%, transparent);
  backdrop-filter: blur(10px);
}

.selected-base-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.selected-base-heading > span {
  color: var(--water-vein);
  font-size: 12px;
  font-weight: 700;
}

.selected-base-card h3,
.selected-base-card p {
  margin: 0;
}

.selected-base-card h3 {
  margin-top: 7px;
  font-size: 20px;
}

.selected-base-card p {
  margin-top: 6px;
  color: var(--mist);
  font-size: 12px;
  line-height: 1.55;
}

.selected-base-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 12px;
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px solid var(--border);
  color: var(--mist);
  font-size: 12px;
}

.capability-panel {
  grid-area: capabilities;
}

.capability-body {
  padding: 15px;
}

.capability-section + .capability-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.capability-section h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 10px;
  font-size: 13px;
}

.capability-section h3 span {
  color: var(--mist);
  font-family: var(--font-data);
  font-size: 12px;
  font-weight: 500;
}

.capability-list {
  display: grid;
  height: auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  overflow: visible;
}

.capability-item {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 5px 6px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-muted);
}

.capability-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  color: var(--seedling);
  font-size: 12px;
  font-weight: 700;
}

.capability-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.capability-copy strong {
  font-size: 12px;
  font-weight: 650;
}

.capability-copy span {
  color: var(--mist);
  font-size: 11px;
  line-height: 1.15;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
}

.capability-item.is-planned .capability-icon {
  color: var(--planned);
  border-color: color-mix(in srgb, var(--planned) 45%, transparent);
}

.record-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.record-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--mist);
  font-size: 12px;
}

.record-tag::before {
  content: "◇";
  color: var(--planned);
}

.metrics-panel {
  grid-area: metrics;
}

.metrics-body {
  min-height: 0;
  padding: 14px 16px 16px;
}

.metric-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.metric-card {
  min-width: 0;
  position: relative;
  overflow: hidden;
  padding: 12px 13px;
  border-radius: 10px;
  background: var(--surface-muted);
  border-top: 2px solid var(--seedling);
}

.metric-card.is-updated {
  outline: 1px solid color-mix(in srgb, var(--seedling) 58%, transparent);
  outline-offset: -1px;
}

.metric-card:nth-child(2) {
  border-top-color: var(--water-vein);
}

.metric-card:nth-child(3) {
  border-top-color: var(--grain-gold);
}

.metric-card span {
  display: block;
  color: var(--mist);
  font-size: 12px;
}

.metric-card strong {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 5px;
  font-family: var(--font-data);
  font-size: clamp(23px, 1.75vw, 32px);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.metric-card strong small {
  color: var(--mist);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
}

.metric-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  color: var(--mist);
  font-size: 12px;
}

.freshness {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--seedling);
}

.freshness::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.trend-wrap {
  margin-top: 14px;
}

.trend-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.trend-heading strong,
.trend-heading span {
  display: block;
}

.trend-heading strong {
  font-size: 13px;
}

.trend-heading span {
  margin-top: 2px;
  color: var(--mist);
  font-size: 12px;
}

.trend-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.trend-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--mist);
  font-size: 12px;
}

.trend-legend i {
  width: 13px;
  height: 3px;
  border-radius: 999px;
  background: var(--series-color);
}

.trend-chart {
  width: 100%;
  height: 140px;
  display: block;
  overflow: visible;
}

.trend-grid line {
  stroke: var(--border);
  stroke-width: 1;
}

.trend-line {
  fill: none;
  stroke: var(--series-color);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.trend-dot {
  fill: var(--surface);
  stroke: var(--series-color);
  stroke-width: 2.5;
}

.trend-axis-labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3px 0 5px;
  color: var(--mist);
  font-size: 12px;
  line-height: 1;
}

.metrics-empty {
  min-height: 280px;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
}

.metrics-empty[hidden] {
  display: none;
}

.metrics-empty > span {
  color: var(--planned);
  font-size: 48px;
}

.metrics-empty strong {
  margin-top: 6px;
  font-size: 17px;
}

.metrics-empty p {
  max-width: 390px;
  margin: 6px 0 0;
  color: var(--mist);
  font-size: 12px;
}

.action-column {
  grid-area: actions;
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 14px;
}

.decision-body,
.feeding-body,
.alert-list {
  padding: 15px 16px;
}

.empty-decision {
  min-height: 124px;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
}

.empty-symbol {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  color: var(--seedling);
  font-size: 18px;
}

.empty-decision strong {
  margin-top: 8px;
  font-size: 17px;
}

.empty-decision p {
  max-width: 310px;
  margin: 5px 0 0;
  color: var(--mist);
  font-size: 12px;
}

.approved-advice {
  display: grid;
  gap: 10px;
}

.approved-advice-heading,
.advice-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.approved-advice-heading time,
.advice-meta {
  color: var(--mist);
  font-size: 12px;
}

.approved-advice h3,
.approved-advice p {
  margin: 0;
}

.approved-advice h3 {
  font-size: 18px;
}

.approved-advice p {
  color: var(--mist);
  font-size: 12px;
}

.advice-evidence {
  margin: 0;
  padding: 10px 10px 10px 28px;
  border-radius: 9px;
  background: var(--surface-muted);
  color: var(--mist);
  font-size: 12px;
}

.advice-meta {
  padding-top: 9px;
  border-top: 1px solid var(--border);
}

.feeding-body {
  display: grid;
  gap: 14px;
}

.feeding-primary {
  padding: 13px;
  border-radius: 10px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--grain-gold) 9%, transparent), var(--surface-muted));
  border-left: 3px solid var(--grain-gold);
}

.feeding-primary span,
.feeding-primary small {
  display: block;
}

.feeding-primary span {
  color: var(--mist);
  font-size: 12px;
}

.feeding-primary strong {
  display: block;
  margin-top: 4px;
  color: var(--grain-gold);
  font-family: var(--font-data);
  font-size: 30px;
}

.feeding-primary small {
  margin-top: 2px;
  color: var(--mist);
  font-size: 12px;
}

.feeding-status-list {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.feeding-status-list div {
  min-width: 0;
  padding: 8px 9px;
  border-radius: 8px;
  background: var(--surface-muted);
}

.feeding-status-list dt {
  color: var(--mist);
  font-size: 12px;
}

.feeding-status-list dd {
  margin: 3px 0 0;
  font-size: 12px;
}

.alert-list {
  display: grid;
  gap: 8px;
}

.alert-item {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 9px;
  background: var(--surface-muted);
  border-left: 3px solid var(--planned);
}

.alert-item--attention {
  border-left-color: var(--grain-gold);
}

.alert-item--risk {
  border-left-color: var(--risk);
}

.alert-level {
  min-width: 45px;
  color: var(--mist);
  font-size: 12px;
  font-weight: 700;
}

.alert-item--attention .alert-level {
  color: var(--grain-gold);
}

.alert-item--risk .alert-level {
  color: var(--risk);
}

.alert-copy {
  min-width: 0;
}

.alert-copy strong,
.alert-copy span {
  display: block;
}

.alert-copy strong {
  font-size: 12px;
}

.alert-copy span {
  margin-top: 2px;
  color: var(--mist);
  font-size: 12px;
  line-height: 1.4;
}

.alert-time {
  color: var(--mist);
  font-family: var(--font-data);
  font-size: 12px;
}

.quality-panel {
  grid-area: quality;
}

.quality-body {
  padding: 15px 16px;
}

.quality-empty {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border-radius: 10px;
  background: var(--surface-muted);
}

.quality-empty > span {
  color: var(--planned);
  font-size: 30px;
}

.quality-empty strong,
.quality-empty p {
  display: block;
  margin: 0;
}

.quality-empty strong {
  font-size: 14px;
}

.quality-empty p {
  margin-top: 3px;
  color: var(--mist);
  font-size: 12px;
}

.quality-types {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.quality-types span {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--mist);
  font-size: 12px;
}

.quality-record-list {
  display: grid;
  gap: 9px;
}

.quality-record {
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-muted);
}

.quality-record-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.quality-record-heading strong {
  font-size: 13px;
}

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

.quality-record-meta div {
  min-width: 0;
}

.quality-record-meta dt,
.quality-record-meta dd {
  margin: 0;
  font-size: 12px;
}

.quality-record-meta dt {
  color: var(--mist);
}

.quality-record-meta dd {
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sr-only {
  width: 1px;
  height: 1px;
  position: fixed;
  left: 0;
  top: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (min-width: 1024px) and (max-width: 1599px) {
  .app-shell {
    padding: 12px;
  }

  .app-header {
    grid-template-columns: minmax(300px, 1fr) minmax(270px, 0.8fr);
  }

  .current-context {
    order: 3;
    grid-column: 1 / -1;
    justify-self: center;
    margin-top: -3px;
  }

  .operations-strip {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    overflow-x: auto;
    padding-bottom: 3px;
    scrollbar-width: thin;
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    grid-template-areas:
      "map map"
      "metrics actions"
      "capabilities actions"
      "quality quality";
  }

  .map-panel {
    min-height: 520px;
  }

  .map-stage {
    height: 520px;
  }

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

@media (min-width: 1280px) and (max-width: 1599px) {
  .app-header {
    grid-template-columns: minmax(300px, 1fr) auto minmax(280px, 1fr);
  }

  .current-context {
    order: initial;
    grid-column: auto;
    justify-self: center;
    margin-top: 0;
  }
}

@media (min-width: 1024px) and (max-width: 1599px) and (max-height: 800px) {
  .operation-stat {
    min-height: 72px;
    padding-block: 10px;
  }

  .map-panel {
    min-height: 0;
  }

  .map-stage {
    height: 400px;
  }
}

@media (min-width: 1024px) and (max-width: 1150px) {
  .map-panel {
    min-height: 0;
  }

  .map-stage {
    height: auto;
    display: grid;
    grid-template-rows: 400px auto;
  }

  .china-map {
    grid-row: 1;
  }

  .standard-map-shell {
    position: relative;
    inset: auto;
    grid-row: 1;
    height: 400px;
  }

  .map-markers {
    position: absolute;
    inset: 0;
    height: auto;
    pointer-events: none;
  }

  .map-marker {
    pointer-events: auto;
  }

  .selected-base-card {
    width: 100%;
    position: static;
    grid-row: 2;
    margin-top: 8px;
  }
}

@media (min-width: 1600px) and (min-height: 900px) {
  .app-shell {
    height: 100vh;
    min-height: 850px;
    overflow: hidden;
  }

  .dashboard-grid {
    height: calc(100vh - 200px);
    min-height: 660px;
    grid-template-columns: minmax(270px, 0.78fr) minmax(660px, 2.1fr) minmax(340px, 0.98fr);
    grid-template-rows: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "capabilities map actions"
      "quality metrics actions";
  }

  .map-panel,
  .capability-panel,
  .metrics-panel,
  .quality-panel,
  .action-column {
    min-height: 0;
  }

  .map-panel {
    min-height: 0;
  }

  .map-stage {
    height: calc(100% - 70px);
    min-height: 0;
  }

  .selected-base-card {
    top: 16px;
    right: 16px;
    bottom: auto;
  }

  .surface-header {
    height: 70px;
    min-height: 0;
  }

  .capability-body {
    height: calc(100% - 70px);
    overflow: auto;
  }

  .metrics-body {
    height: calc(100% - 70px);
    overflow: hidden;
  }

  .metrics-panel {
    overflow: hidden;
  }

  .action-column {
    max-height: 100%;
    overflow: auto;
    scrollbar-width: thin;
  }
}

@media (min-width: 1600px) and (min-height: 900px) and (max-height: 1079px) {
  .action-column {
    gap: 10px;
  }

  .map-marker:not(.is-selected) .marker-label {
    display: none;
  }

  .selected-base-card {
    width: 260px;
    top: 10px;
    right: 10px;
    bottom: auto;
    padding: 10px 11px;
  }

  .selected-base-card h3 {
    font-size: 17px;
  }

  .selected-base-card p {
    display: none;
  }

  .selected-base-meta {
    margin-top: 7px;
    padding-top: 7px;
  }

  .capability-body {
    padding: 9px 10px;
  }

  .capability-section h3 {
    margin-bottom: 6px;
  }

  .capability-list {
    gap: 5px;
  }

  .capability-item {
    min-height: 42px;
    gap: 6px;
    padding: 4px 6px;
  }

  .capability-icon {
    width: 24px;
    height: 24px;
  }

  .metrics-body {
    padding: 10px 12px 12px;
  }

  .metric-cards {
    gap: 7px;
  }

  .metric-card {
    padding: 8px 10px;
  }

  .metric-card footer {
    margin-top: 4px;
  }

  .trend-wrap {
    margin-top: 7px;
  }

  .trend-heading {
    margin-bottom: 3px;
  }

  .trend-chart {
    height: 90px;
  }

  .decision-body,
  .feeding-body,
  .alert-list {
    padding: 10px 12px;
  }

  .empty-decision {
    min-height: 78px;
  }

  .empty-symbol {
    width: 34px;
    height: 34px;
  }

  .feeding-body {
    gap: 8px;
  }

  .feeding-primary {
    padding: 9px 10px;
  }

  .feeding-status-list {
    gap: 5px;
  }

  .feeding-status-list div {
    padding: 6px 8px;
  }

  .alert-list {
    gap: 5px;
  }

  .alert-item {
    padding: 7px 8px;
  }
}

@media (orientation: landscape) and (min-width: 1280px) and (min-height: 680px) and (max-width: 1599px) {
  .map-tools .map-legend {
    display: none;
  }

  .site-picker select {
    min-width: 150px;
  }

  body {
    overflow: hidden;
  }

  .app-shell {
    height: 100vh;
    min-height: 680px;
    padding: 8px 10px 10px;
    overflow: hidden;
  }

  .app-header {
    height: 64px;
    min-height: 0;
    grid-template-columns: minmax(280px, 1fr) auto minmax(250px, 1fr);
    gap: 10px;
    padding: 5px 4px 9px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .brand-name {
    font-size: 12px;
  }

  .brand-lockup h1 {
    font-size: clamp(20px, 1.7vw, 25px);
  }

  .current-context {
    order: initial;
    grid-column: auto;
    justify-self: center;
    margin-top: 0;
    padding: 7px 11px;
  }

  .connection-state {
    min-height: 36px;
    padding-inline: 10px;
  }

  .icon-button {
    width: 44px;
    height: 44px;
  }

  .clock {
    min-width: 78px;
    font-size: 16px;
  }

  .operations-strip {
    height: 68px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin: 8px 0 10px;
    padding: 0;
    overflow: hidden;
  }

  .operation-stat {
    min-height: 0;
    height: 68px;
    padding: 9px 11px;
  }

  .operation-stat span,
  .operation-stat small {
    font-size: 12px;
  }

  .operation-stat strong {
    font-size: clamp(24px, 2vw, 29px);
  }

  .dashboard-grid {
    height: calc(100vh - 158px);
    min-height: 512px;
    grid-template-columns: minmax(225px, 0.78fr) minmax(560px, 2.08fr) minmax(290px, 1fr);
    grid-template-rows: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "capabilities map actions"
      "quality metrics actions";
    gap: 10px;
  }

  .map-panel,
  .capability-panel,
  .metrics-panel,
  .quality-panel,
  .action-column {
    min-height: 0;
  }

  .surface {
    border-radius: 13px;
  }

  .surface-header {
    height: 54px;
    min-height: 0;
    padding: 8px 12px;
  }

  .surface-header h2 {
    font-size: clamp(15px, 1.12vw, 17px);
  }

  .surface-meta {
    font-size: 12px;
  }

  .map-panel {
    min-height: 0;
  }

  .map-stage {
    height: calc(100% - 54px);
    min-height: 0;
  }

  .map-marker:not(.is-selected) .marker-label {
    display: none;
  }

  .selected-base-card {
    width: 224px;
    top: 8px;
    right: 8px;
    bottom: auto;
    padding: 8px 9px;
  }

  .selected-base-card h3 {
    margin-top: 5px;
    font-size: 16px;
  }

  .selected-base-card p {
    display: none;
  }

  .selected-base-meta {
    margin-top: 6px;
    padding-top: 6px;
  }

  .capability-body {
    height: calc(100% - 54px);
    padding: 7px 8px;
    overflow: hidden;
  }

  .capability-section h3 {
    margin-bottom: 5px;
    font-size: 12px;
  }

  .capability-list {
    gap: 4px;
  }

  .capability-item {
    min-height: 36px;
    gap: 5px;
    padding: 3px 5px;
  }

  .capability-icon {
    width: 22px;
    height: 22px;
  }

  .capability-copy strong,
  .capability-copy span {
    font-size: 12px;
  }

  .metrics-panel {
    overflow: hidden;
  }

  .metrics-body {
    height: calc(100% - 54px);
    padding: 8px 10px 9px;
    overflow: hidden;
  }

  .metric-cards {
    gap: 6px;
  }

  .metric-card {
    padding: 6px 8px;
  }

  .metric-card strong {
    font-size: clamp(21px, 2vw, 27px);
  }

  .metric-card footer {
    margin-top: 3px;
  }

  .trend-wrap {
    margin-top: 5px;
  }

  .trend-heading {
    margin-bottom: 2px;
  }

  .trend-heading span {
    display: none;
  }

  .trend-chart {
    height: clamp(58px, 8vh, 78px);
  }

  .quality-body {
    height: calc(100% - 54px);
    padding: 8px 10px;
    overflow: hidden;
  }

  .quality-empty {
    gap: 8px;
    padding: 8px;
  }

  .quality-empty > span {
    font-size: 24px;
  }

  .quality-types {
    gap: 4px;
    margin-top: 6px;
  }

  .quality-types span {
    padding: 4px 6px;
  }

  .action-column {
    max-height: 100%;
    gap: 8px;
    overflow: hidden;
  }

  .decision-body,
  .feeding-body,
  .alert-list {
    padding: 8px 10px;
  }

  .empty-decision {
    min-height: 64px;
  }

  .empty-symbol {
    width: 30px;
    height: 30px;
  }

  .feeding-body {
    gap: 6px;
  }

  .feeding-primary {
    padding: 7px 8px;
  }

  .feeding-primary strong {
    font-size: 24px;
  }

  .feeding-status-list {
    gap: 4px;
  }

  .feeding-status-list div {
    padding: 5px 6px;
  }

  .alert-list {
    gap: 4px;
  }

  .alert-item {
    padding: 6px 7px;
  }
}

@media (orientation: landscape) and (min-width: 1280px) and (max-width: 1319px) and (min-height: 680px) {
  .action-column {
    gap: 6px;
  }

  .capability-list {
    gap: 3px;
  }

  .capability-body {
    padding-block: 4px;
  }

  .capability-item {
    min-height: 34px;
  }

  .capability-icon {
    width: 20px;
    height: 20px;
  }

  .empty-decision {
    min-height: 40px;
  }

  .empty-decision p,
  .feeding-primary small {
    display: none;
  }

  .feeding-primary {
    padding-block: 5px;
  }

  .feeding-status-list div {
    padding-block: 3px;
  }
}

@media (max-width: 1023px) {
  .app-shell {
    padding: 10px;
  }

  .app-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .current-context {
    grid-column: 1 / -1;
    justify-content: flex-start;
    order: 3;
  }

  .connection-state {
    display: none;
  }

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

  .capability-scroll-controls button {
    display: none;
  }

  .capability-list {
    height: auto;
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    overflow-x: visible;
    overflow-y: visible;
    scroll-snap-type: none;
  }

  .operation-stat:last-child {
    grid-column: 1 / -1;
  }

  .map-panel {
    min-height: 520px;
  }

  .map-stage {
    height: auto;
    min-height: 0;
    display: grid;
    grid-template-rows: 350px auto;
  }

  .china-map {
    grid-row: 1;
  }

  .standard-map-shell {
    position: relative;
    inset: auto;
    grid-row: 1;
    height: 350px;
  }

  .map-markers {
    position: absolute;
    inset: 0;
    height: auto;
    pointer-events: none;
  }

  .map-marker {
    pointer-events: auto;
  }

  .selected-base-card {
    width: 100%;
    position: static;
    grid-row: 2;
    margin-top: 8px;
  }

  .map-legend {
    max-width: 230px;
  }
}

@media (max-width: 767px) {
  body {
    font-size: 14px;
  }

  .app-header {
    gap: 8px;
  }

  .brand-mark {
    width: 39px;
    height: 39px;
  }

  .brand-name span {
    display: none;
  }

  .brand-lockup h1 {
    font-size: 18px;
  }

  .header-actions {
    gap: 6px;
  }

  .clock {
    display: none;
  }

  .current-context {
    border-radius: 10px;
    flex-wrap: wrap;
  }

  .operations-strip {
    gap: 8px;
  }

  .operation-stat {
    min-height: 78px;
    padding: 11px 12px;
  }

  .operation-stat strong {
    font-size: 25px;
  }

  .operation-stat small {
    white-space: normal;
    line-height: 1.3;
  }

  .surface-header {
    align-items: flex-start;
    padding: 12px;
  }

  .surface-meta,
  .map-legend {
    font-size: 12px;
  }

  .map-tools .map-legend,
  .site-picker > span {
    display: none;
  }

  .site-picker select {
    min-width: 145px;
  }

  .map-panel {
    min-height: 490px;
  }

  .map-stage {
    height: auto;
    min-height: 0;
    grid-template-rows: 330px auto;
    padding: 2px 6px 10px;
  }

  .map-markers {
    height: auto;
  }

  .standard-map-shell {
    height: 330px;
  }

  .marker-label {
    display: none;
  }

  .map-marker.is-selected .marker-label {
    display: block;
  }

  .capability-body,
  .metrics-body,
  .decision-body,
  .feeding-body,
  .alert-list,
  .quality-body {
    padding: 12px;
  }

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

  .metric-cards {
    grid-template-columns: 1fr;
  }

  .trend-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .trend-legend {
    justify-content: flex-start;
  }

  .feeding-status-list {
    grid-template-columns: 1fr;
  }

  .alert-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .alert-time {
    grid-column: 2;
  }
}

@media (max-width: 430px) {
  .capability-list {
    grid-template-columns: 1fr;
  }

  .map-legend {
    display: none;
  }

  .map-panel {
    min-height: 460px;
  }

  .map-stage {
    height: auto;
    min-height: 0;
    grid-template-rows: 280px auto;
  }

  .map-markers {
    height: auto;
  }

  .standard-map-shell {
    height: 280px;
  }

  .selected-base-card h3 {
    font-size: 18px;
  }
}

@media (orientation: landscape) and (min-width: 1280px) and (min-height: 680px) {
  .capability-item {
    min-height: 40px;
    gap: 4px;
    padding: 2px 4px;
  }

  .capability-icon {
    width: 20px;
    height: 20px;
    font-size: 10px;
  }

  .capability-copy {
    gap: 0;
  }

  .capability-copy strong {
    font-size: 11px;
    line-height: 1.05;
  }

  .capability-copy span {
    font-size: 10px;
    line-height: 1.08;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .life-line {
    stroke-dashoffset: 52;
    animation: reveal-life-line 1.25s ease-out 180ms forwards;
  }

  .map-marker.data-pulse .marker-core {
    animation: marker-pulse 720ms ease-out;
  }

  .metric-card.is-updated {
    animation: metric-update 720ms ease-out;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@keyframes reveal-life-line {
  from { stroke-dashoffset: 52; opacity: 0; }
  to { stroke-dashoffset: 0; opacity: 1; }
}

@keyframes marker-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--water-vein) 36%, transparent); }
  100% { box-shadow: 0 0 0 18px transparent; }
}

@keyframes metric-update {
  0% { background: color-mix(in srgb, var(--seedling) 18%, var(--surface-muted)); }
  100% { background: var(--surface-muted); }
}
