/* Layout: field-office console — district index | map | achievement ledger */
:root {
  --bg: #eef1ea;
  --surface: #ffffff;
  --ink: #1c281e;
  --muted: #5b6a5d;
  --line: #d6ddd0;
  --accent: #1f6b45;
  --accent-ink: #ffffff;
  --sun: #d9971c;
  --map-bg: #e3e9df;
  --district-fill: #f7f8f3;
  --district-stroke: #8a9a8b;
  --good: #1f7a3f;
  --warn: #b7791f;
  --bad: #c0392b;
  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", Roboto, sans-serif;
  --font-data: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141a15; --surface: #1c241d; --ink: #e6ece4; --muted: #9aa99c; --line: #2f3a31;
    --accent: #5fbf86; --accent-ink: #0f1a12; --sun: #f0b54a; --map-bg: #18201a;
    --district-fill: #222c24; --district-stroke: #5d6e60; --good: #5fbf86; --warn: #e3a94a; --bad: #ef7a6c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141a15; --surface: #1c241d; --ink: #e6ece4; --muted: #9aa99c; --line: #2f3a31;
  --accent: #5fbf86; --accent-ink: #0f1a12; --sun: #f0b54a; --map-bg: #18201a;
  --district-fill: #222c24; --district-stroke: #5d6e60; --good: #5fbf86; --warn: #e3a94a; --bad: #ef7a6c;
  color-scheme: dark;
}

html, body { height: 100%; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; }
button, input, select { font: inherit; color: inherit; }

.app {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  grid-template-rows: auto auto minmax(0, 1fr);
  grid-template-areas: "top top" "tools tools" "map panel";
}

.topbar {
  grid-area: top;
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 24px;
  padding-block: 14px 12px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.brand-kicker { display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.brand h1 { margin: 2px 0 0; font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -.01em; text-wrap: balance; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.crumb { background: none; border: 0; padding: 4px 6px; border-radius: 4px; cursor: pointer; color: var(--accent); font-weight: 600; }
.crumb.is-current { color: var(--ink); cursor: default; }
.crumb:focus-visible, .district-list button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--sun); outline-offset: 2px; }
.crumb-sep { color: var(--muted); }

.sidebar { grid-area: side; display: flex; flex-direction: column; gap: 8px; padding: 14px 12px; border-right: 1px solid var(--line); background: var(--surface); min-height: 0; }
.field-label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
#districtSearch { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
.district-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 0; }
.district-list button {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 7px 8px; border: 0; border-radius: 5px; background: none; text-align: left; cursor: pointer;
}
.district-list button:hover { background: var(--bg); }
.district-list button.is-active { background: var(--accent); color: var(--accent-ink); }
.has-data-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sun); flex: none; }

.map-wrap { grid-area: map; position: relative; min-height: 0; }
#map { position: absolute; inset: 0; background: var(--map-bg); }
.map-tools {
  position: absolute; z-index: 500; top: 12px; left: 12px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px;
  padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font-size: 13px;
}
.map-tools label { color: var(--muted); }
.map-tools select { padding: 4px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--bg); }
.map-msg {
  position: absolute; z-index: 500; left: 50%; bottom: 16px; transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 10px 14px; border-radius: 8px;
  background: var(--ink); color: var(--bg); font-size: 14px;
}
.legend {
  position: absolute; z-index: 500; right: 12px; bottom: 12px; max-width: 220px;
  padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font-size: 12px;
}
.legend:empty { display: none; }
.legend-row { display: flex; align-items: center; gap: 6px; }
.legend-swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; }

.panel { grid-area: panel; overflow-y: auto; padding: 16px; border-left: 1px solid var(--line); background: var(--surface); min-width: 0; }
.panel h2 { margin: 0; font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.panel-empty p { color: var(--muted); line-height: 1.5; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.year { font-family: var(--font-data); font-size: 12px; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.stat { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; }
.stat b { display: block; font-family: var(--font-data); font-weight: 500; font-size: 16px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.table-scroll { overflow-x: auto; }
.crop-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.crop-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.crop-table td { padding: 7px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.crop-table tr { cursor: pointer; }
.crop-table tr:hover td, .crop-table tr.is-hl td { background: var(--bg); }
.num { text-align: right; font-family: var(--font-data); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pct-chip { display: inline-block; min-width: 44px; padding: 1px 6px; border-radius: 10px; font-size: 12px; text-align: center; color: #fff; }
.pct-good { background: var(--good); } .pct-warn { background: var(--warn); } .pct-bad { background: var(--bad); }
.warn { margin-top: 12px; font-size: 13px; color: var(--warn); }

/* Map labels and crop icons */
.leaflet-container { font-family: var(--font-body); background: var(--map-bg); }
/*.district-label { background: none; border: 0; box-shadow: none; padding: 0; font-size: 10.5px; font-weight: 600; color: var(--ink); text-shadow: 0 0 3px var(--surface), 0 0 3px var(--surface); }
.district-label::before { display: none; }
*/
.district-label,
.district-label * {
    background: none !important;border: none !important;box-shadow: none !important;padding: 0 !important;
    font-family: Arial, sans-serif !important;font-size: 10.5px !important;font-weight: 800 !important;color: #172B20 !important;
    text-shadow:
        -1px -1px 2px #FFFFFF,
         1px -1px 2px #FFFFFF,
        -1px  1px 2px #FFFFFF,
         1px  1px 2px #FFFFFF !important;
}

.district-label::before,
.district-label::after {
    display: none !important;
    content: none !important;
}

.crop-icon { overflow: visible; }
/* the icon centre sits on the map point; block name above, crop name below */
.crop-marker { position: relative; width: 0; height: 0; --r: 26px; }
.crop-badge {
  position: absolute; left: calc(var(--r) * -1); top: calc(var(--r) * -1);
  width: calc(var(--r) * 2); height: calc(var(--r) * 2); box-sizing: border-box;
  display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, var(--surface), var(--bg));
  border: 2.5px solid var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,.28); transition: transform .15s ease;
}
.crop-badge:hover { transform: scale(1.12); }
.crop-badge img.ci { width: 84%; height: 84%; }
.blk-name, .crop-name { position: absolute; left: 0; transform: translateX(-50%); white-space: nowrap; pointer-events: none; }
.blk-name { bottom: calc(var(--r) + 4px); padding: 1px 6px; border-radius: 4px; font-size: 12px; font-weight: 700; color: var(--ink); background: var(--surface); border: 1px solid var(--line); }
.blk-name.blk-only { bottom: auto; top: 0; transform: translate(-50%, -50%); }
.crop-name { top: calc(var(--r) + 4px); padding: 1px 7px; border-radius: 10px; font-size: 11px; font-weight: 600; letter-spacing: .02em; background: var(--accent); color: var(--accent-ink); }
#map.many-units:not(.zoomed-in) .crop-marker { --r: 21px; }
#map.many-units:not(.zoomed-in) .crop-name { display: none; }
.lbl-hidden { visibility: hidden; }
img.ci { width: 1.35em; height: 1.35em; object-fit: contain; vertical-align: -0.3em; }
.legend-row img.ci { width: 18px; height: 18px; }

/* Year picker */
.top-right { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.year-wrap { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.year-wrap select { padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); font-family: var(--font-data); font-size: 13px; }

/* Table tweaks */
.crop-table { font-size: 13px; }
.crop-table th, .crop-table td { padding-left: 3px; padding-right: 3px; }
.crop-table td:first-child { overflow-wrap: anywhere; }
.crop-cell { white-space: nowrap; }
.pct-chip { min-width: 38px; padding: 1px 4px; }
.stat b { font-size: 15px; }

/* Popups */
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--ink); }
.popup h3 { margin: 0 0 6px; font-family: var(--font-display); font-size: 15px; }
.popup table { border-collapse: collapse; font-size: 12.5px; }
.popup td { padding: 2px 6px 2px 0; }
.popup .hc-officer { margin-top: 8px; }
.hover-popup .leaflet-popup-content { margin: 12px 14px; }
.hcard { font-size: 13px; color: var(--ink); }
.hc-head { display: flex; align-items: center; gap: 10px; }
.hc-icon { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.hc-icon img.ci { width: 38px; height: 38px; }
.hc-crop { font-family: var(--font-display); font-weight: 700; font-size: 17px; line-height: 1.1; }
.hc-sub { color: var(--muted); font-size: 12px; }
.hc-ach { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.hc-nums { font-family: var(--font-data); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.hc-nums b { font-size: 15px; font-weight: 500; }
.hc-bar { height: 6px; margin-top: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.hc-bar span { display: block; height: 100%; border-radius: 3px; }
.hc-all { margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.hc-officer { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); }
.hc-none { color: var(--muted); font-style: italic; }
.hc-label { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.hc-oname { font-weight: 700; font-size: 14px; margin-top: 3px; }
.hc-odesig { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.hc-line { display: flex; gap: 8px; font-size: 12.5px; padding: 1px 0; }
.hc-k { width: 42px; flex: none; color: var(--muted); }
.hc-line a { color: var(--accent); text-decoration: none; user-select: all; word-break: break-all; }
.hc-line a:hover { text-decoration: underline; }

/* Smaller screens */
@media (max-width: 1000px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(420px, 62vh) auto; grid-template-areas: "top" "tools" "map" "panel"; height: auto; min-height: 100%; }
  .panel { border-left: 0; border-top: 1px solid var(--line); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* achievement-only mode (no target column) */
.share { color: var(--muted); font-family: var(--font-data); font-size: 12px; }
.hc-bar .bar-area { background: var(--accent); }

/* ---------- toolbar: filters + totals ---------- */
.toolbar {
  grid-area: tools; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px;
  padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: 13px; }
.filters label { color: var(--muted); }
.filters select, .filters button { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); max-width: 100%; }
.filters select { min-width: 150px; }
.filters button { cursor: pointer; font-weight: 600; }
.filters button:hover { border-color: var(--accent); }
.totals { display: flex; gap: 22px; }
.totals div { display: flex; flex-direction: column; }
.totals b { font-family: var(--font-data); font-weight: 500; font-size: 20px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.totals span { font-size: 12px; color: var(--muted); }

/* ---------- panel cards (like the reference design) ---------- */
.panel { display: flex; flex-direction: column; gap: 12px; background: var(--bg); padding: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.focus-card { flex: none; }
.list-card { flex: 1; min-height: 0; overflow-y: auto; }
.fc-top { display: flex; align-items: center; gap: 14px; }
.fc-img, .it-img { flex: none; display: grid; place-items: center; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.fc-img { width: 84px; height: 84px; }
.fc-img img.ci { width: 70px; height: 70px; }
.fc-kicker, .lc-kicker { font-size: 12px; color: var(--muted); }
.fc-crop { font-family: var(--font-display); font-size: 26px; font-weight: 800; line-height: 1.1; }
.type-tag { display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 10px; font-size: 11.5px; font-weight: 600; color: var(--tc); border: 1px solid var(--tc); }
.fc-block { margin-top: 14px; font-family: var(--font-display); font-size: 19px; font-weight: 700; }
.fc-dist { color: var(--muted); font-size: 13px; }
.fc-rows { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 7px 10px; margin: 12px 0 0; font-size: 14px; align-items: center; }
.fc-rows dt { color: var(--muted); }
.fc-rows dd { margin: 0; overflow-wrap: anywhere; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 12px; color: #fff; font-family: var(--font-data); font-size: 13px; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-data); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); font-size: 12.5px; }
.copy { margin-left: 4px; padding: 1px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); font-size: 11.5px; cursor: pointer; }
.copy:hover { border-color: var(--accent); }

.list-card h2 { margin: 2px 0 0; font-family: var(--font-display); font-size: 26px; font-weight: 800; }
.lc-sub { margin-top: 2px; font-size: 13px; color: var(--muted); }
.share-bar { display: flex; height: 12px; margin-top: 12px; border-radius: 6px; overflow: hidden; background: var(--line); }
.share-bar span { display: block; height: 100%; }
.share-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 12.5px; }
.chip { display: inline-flex; align-items: center; gap: 5px; cursor: default; }
.chip i { width: 10px; height: 10px; border-radius: 3px; }
.item-list { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px solid var(--line); }
.item { display: flex; gap: 12px; align-items: center; padding: 10px 8px; border-bottom: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.item:hover, .item.is-hl { background: var(--bg); }
.item.is-selected { background: var(--bg); box-shadow: inset 3px 0 0 var(--accent); }
.it-img { width: 46px; height: 46px; }
.it-img img.ci { width: 38px; height: 38px; }
.it-main { flex: 1; min-width: 0; }
.it-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.it-name { font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.it-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.empty { padding: 14px 4px; color: var(--muted); }
.legend-note { margin-top: 4px; font-size: 11px; color: var(--muted); }
.legend-row { cursor: default; }

/* crop icon ring and crop name take the crop type colour */
.crop-marker { --tc: var(--accent); }
.crop-badge { border-color: var(--tc); background: #fff; }
.crop-name { background: var(--tc); color: var(--ti, #fff); }

/* block check under the list */
#warn { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 10px; background: var(--bg); line-height: 1.45; overflow-wrap: anywhere; }
#warn[hidden] { display: none; }

/* Name check report */
#checkDialog { width: min(1100px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: 0 10px 40px rgba(0,0,0,.25); }
#checkDialog::backdrop { background: rgba(20, 30, 22, .45); }
.ck-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.ck-head h2 { margin: 0; font-family: var(--font-display); font-size: 22px; }
.ck-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ck-actions button, #checkBtn { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); cursor: pointer; font-weight: 600; }
.ck-actions button:hover { border-color: var(--accent); }
.ck-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 10px 0 14px; }
.ck-tile { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.ck-tile b { display: block; font-family: var(--font-data); font-weight: 500; font-size: 24px; font-variant-numeric: tabular-nums; }
.ck-tile span { font-size: 12.5px; color: var(--muted); }
.ck-tile.bad { border-color: #e03131; } .ck-tile.bad b { color: #c92a2a; }
.ck-tile.warn { border-color: #f08c00; } .ck-tile.warn b { color: #c66a00; }
.ck-note { padding: 8px 12px; border-radius: 8px; background: var(--bg); }
.ck-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ck-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px; border-bottom: 1px solid var(--line); }
.ck-table td { padding: 7px 6px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.ck-table td.bad { color: #c92a2a; }
#checkBody h3 { margin: 18px 0 2px; font-size: 15px; }
.ck-pre { margin: 6px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--bg); font-family: var(--font-data); font-size: 12.5px; overflow-x: auto; white-space: pre; }

/* ---------- hover card on the map ---------- */
.hover-card { position: absolute; z-index: 900; width: 290px; max-width: calc(100% - 16px); pointer-events: auto;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.22); font-size: 13px; }
.hv-top { display: flex; align-items: center; gap: 12px; }
.hv-top .it-img { width: 58px; height: 58px; }
.hv-top .it-img img.ci { width: 48px; height: 48px; }
.hv-kicker { font-size: 11.5px; color: var(--muted); }
.hv-crop { font-family: var(--font-display); font-size: 19px; font-weight: 800; line-height: 1.1; }
.hv-name { margin-top: 10px; font-family: var(--font-display); font-size: 16px; font-weight: 700; }
.hv-rows { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; margin: 8px 0 0; align-items: center; }
.hv-rows dt { color: var(--muted); white-space: nowrap; }
.hv-rows dd { margin: 0; overflow-wrap: anywhere; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }
.hv-bar { display: flex; height: 8px; margin-top: 10px; border-radius: 4px; overflow: hidden; background: var(--line); }
.hv-bar i { display: block; height: 100%; }
.hv-types { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 5px; font-size: 11.5px; color: var(--muted); }
.hv-types b { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }
.hv-hint { margin-top: 8px; font-size: 11.5px; color: var(--accent); font-weight: 600; }

/* ---------- chosen crop / type card ---------- */
.crop-card { flex: none; display: flex; flex-direction: column; gap: 8px; }
.cc-head { display: flex; align-items: center; gap: 12px; }
.fc-img.small { width: 58px; height: 58px; }
.fc-img.small img.ci { width: 48px; height: 48px; }
.type-swatch { width: 44px; height: 44px; border-radius: 12px; flex: none; }
.cc-name { font-family: var(--font-display); font-size: 21px; font-weight: 800; line-height: 1.1; }
.cc-nums { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.cc-nums div { display: flex; flex-direction: column; }
.cc-nums b { font-family: var(--font-data); font-weight: 500; font-size: 18px; font-variant-numeric: tabular-nums; }
.cc-nums span { font-size: 12px; color: var(--muted); }
.crop-card .muted { font-size: 12.5px; line-height: 1.45; }

/* ---------- crop list ---------- */
.crop-chips-wrap { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.crop-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.crop-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); cursor: pointer; font-size: 12.5px; }
.crop-chip img.ci { width: 24px; height: 24px; border-radius: 50%; background: #fff; }
.crop-chip .dot { margin-right: 0; }
.crop-chip .cn { font-weight: 600; }
.crop-chip .cs { font-family: var(--font-data); font-size: 11px; color: var(--muted); }
.crop-chip:hover { border-color: var(--accent); }
.crop-chip.on { border-color: var(--ink); background: var(--bg); box-shadow: 0 0 0 2px var(--accent); }

/* version label */
.build { font-size: 11.5px; color: var(--muted); font-family: var(--font-data); }

/* districts with achievement entered for a chosen crop */
.item.drow { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 3px 10px; align-items: center; padding: 8px 8px; }
.dr-rank { grid-row: 1 / 3; font-family: var(--font-data); font-size: 12px; color: var(--muted); text-align: right; }
.dr-name { font-weight: 700; font-size: 14.5px; overflow-wrap: anywhere; }
.dr-meta { font-family: var(--font-data); font-size: 12px; color: var(--muted); white-space: nowrap; }
.dr-bar { grid-column: 2 / 4; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.dr-bar i { display: block; height: 100%; border-radius: 3px; }
.item-list .empty b { color: var(--ink); }
.chips-more { padding: 4px 12px; border: 1px dashed var(--line); border-radius: 999px; background: none; color: var(--accent); font-weight: 600; font-size: 12.5px; cursor: pointer; }
.crop-chips-wrap { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }

.hv-actions { display: flex; gap: 8px; margin-top: 10px; }
.hv-btn { padding: 5px 12px; border: 1px solid var(--accent); border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 12.5px; cursor: pointer; }
.hv-btn:hover { filter: brightness(1.08); }
.hv-btn:focus-visible, .hover-card .copy:focus-visible { outline: 2px solid var(--sun); outline-offset: 2px; }

.ck-table tr.ck-cur td { background: var(--bg); font-weight: 600; }
