.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(310px, 1fr);
  gap: 20px;
  align-items: start;
}
.filter-strip {
  grid-template-columns: 1fr 1fr 1.3fr;
  margin-bottom: 0;
}
.filter-field {
  margin: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 18px;
  gap: 7px;
}
.filter-field input,
.filter-field select {
  padding: 5px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.filter-field.crop-control {
  background: #e7f0e7;
}
.period-note {
  font-size: 12px;
  line-height: 1.6;
  color: #62776a;
  margin: 12px 0 22px;
}
#map {
  height: 460px;
  margin: 0 15px;
  border-radius: 18px;
  z-index: 1;
  background: #e4ece2;
  isolation: isolate;
}
#map:focus-visible {
  outline: 3px solid #245844;
}
.map-bottom {
  padding: 3px 20px 18px;
}
.coords {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: end;
}
.coords .field {
  margin: 12px 0 0;
}
.coords input {
  padding: 9px;
  min-width: 0;
}
.coords button {
  padding: 11px;
  white-space: nowrap;
}
.coordinate-readout,
.map-status {
  font-size: 12px;
  color: #617568;
  margin: 12px 20px 0;
  overflow-wrap: anywhere;
}
.coordinate-readout {
  margin-left: 0;
}
.map-status:empty {
  display: none;
}
.analysis,
.parcel-editor {
  padding: 25px;
}
.analysis h2,
.parcel-editor h2 {
  font-size: 24px;
  letter-spacing: -0.7px;
  margin: 12px 0;
}
.analysis-description,
.parcel-editor > p {
  font-size: 13px;
  line-height: 1.7;
  color: #687d6f;
}
.analysis-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
}
.analysis-actions > * {
  flex: 1;
}
.analysis .empty {
  border-top: 1px solid var(--line);
  padding-top: 22px;
}
.iac-result {
  padding-top: 24px;
}
.iac-result > span {
  font-size: 14px;
  font-weight: 650;
}
.iac-number {
  font-size: 70px;
  letter-spacing: -4px;
  color: #245844;
  margin-top: 14px;
}
.iac-number small {
  font-size: 20px;
  letter-spacing: 0;
  color: #7c8b81;
}
.iac-result h3 {
  font-size: 13px;
  font-weight: 500;
  color: #6b7e70;
}
.iac-result p {
  background: #f1f5ee;
  border-radius: 12px;
  padding: 16px;
  font-size: 13px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.result-context {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  font-size: 11px;
  line-height: 1.8;
  color: #62776a;
  overflow-wrap: anywhere;
}
.error {
  padding: 16px;
  background: #fff0ec;
  color: #9e382b;
  font-size: 13px;
  white-space: pre-wrap;
  border: 1px solid #efd4cc;
  border-radius: 12px;
  margin: 12px 0;
  overflow-wrap: anywhere;
}
.loading {
  padding: 20px 0;
  font-size: 13px;
  line-height: 1.7;
}
.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid #c2d3c8;
  border-top-color: #245844;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 8px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.plan {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 8px;
}
.plan h3 {
  font-size: 18px;
}
.plan-metrics {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11px;
  color: #62776a;
}
.plan-metrics b {
  display: block;
  font-size: 20px;
  color: #245844;
}
.rotation {
  list-style: none;
  padding: 0;
}
.rotation li {
  padding: 12px 0 12px 15px;
  border-left: 2px solid #abc4ae;
  position: relative;
  margin: 0 0 5px;
}
.rotation li:before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #245844;
  position: absolute;
  left: -5px;
  top: 16px;
}
.rotation strong,
.rotation span,
.rotation b {
  display: block;
  margin: 0 0 6px;
}
.rotation strong {
  font-size: 14px;
}
.rotation span,
.rotation b,
.rotation p,
details {
  font-size: 12px;
  line-height: 1.6;
}
details summary {
  cursor: pointer;
  color: #245844;
  font-weight: 650;
}
details li {
  margin-bottom: 7px;
}
.parcel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin: 24px 0 16px;
}
.parcel-toolbar p {
  font-size: 13px;
  color: #617568;
}
.parcel-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.parcel-item {
  background: #fff;
  border: 1px solid #dce6dc;
  border-radius: 15px;
  text-align: left;
  padding: 15px;
  color: #526b59;
  overflow-wrap: anywhere;
}
.parcel-item.selected {
  border: 2px solid #245844;
  background: #eaf2e8;
  padding: 14px;
}
.parcel-item strong,
.parcel-item span,
.parcel-item small {
  display: block;
  margin-bottom: 5px;
}
.parcel-item strong {
  color: #243d2c;
}
.parcel-item small {
  font-size: 10px;
}
.parcel-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 12px;
}
.parcel-tools span {
  flex: 1;
}
.danger {
  color: #a64234;
}
.map-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px 12px;
  font-size: 12px;
}
.map-tools .chosen {
  background: #245844;
  color: white;
}
.history-chips {
  padding-left: 20px;
  font-size: 12px;
}
.history-chips li {
  padding: 5px;
}
.history-chips button {
  background: #eef3ea;
  color: #245844;
  border-radius: 5px;
  margin-left: 10px;
}
.map-fallback {
  padding: 25px;
}
.foot {
  line-height: 1.7;
}
.leaflet-control-attribution {
  font-size: 10px !important;
}
.sidebar-foot strong {
  font-size: 12px;
}
.source-grid .view-panel p {
  color: #617568;
}
.leaflet-container {
  font-family: inherit;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #7daf9d !important;
  outline-offset: 3px;
}
@media (max-width: 1200px) {
  .workspace-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(290px, 1fr);
  }
  .coords {
    grid-template-columns: 1fr 1fr;
  }
  .coords button {
    grid-column: 1/-1;
  }
  .parcel-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
  .sidebar {
    width: 74px;
  }
  .coords {
    grid-template-columns: 1fr 1fr auto;
  }
  .coords button {
    grid-column: auto;
  }
  .filter-strip {
    grid-template-columns: 1fr 1fr;
  }
  .filter-field:last-child {
    grid-column: 1/-1;
  }
}
@media (max-width: 720px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    width: 220px;
    height: 100vh;
    box-shadow: 0 10px 30px #0002;
    padding-top: 85px;
  }
  .sidebar.open {
    transform: none;
  }
  .sidebar .nav-btn {
    justify-content: flex-start;
    padding: 13px;
  }
  .sidebar .nav-btn span,
  .sidebar .brand-name {
    display: block;
  }
  .sidebar .brand {
    padding: 0 10px 25px;
  }
  .mobile-menu {
    display: grid;
  }
  .topbar {
    z-index: 30;
  }
  .sidebar {
    z-index: 25;
  }
  .main {
    padding: 24px 16px;
  }
  .heading h1 {
    font-size: 30px;
  }
  .filter-strip {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .filter-field {
    padding: 12px;
  }
  .parcel-list {
    grid-template-columns: 1fr;
  }
  .coords {
    grid-template-columns: 1fr 1fr;
  }
  .coords button {
    grid-column: 1/-1;
  }
  #map {
    height: 360px;
  }
  .crumbs {
    gap: 5px;
  }
  .demo {
    display: none;
  }
  .analysis,
  .parcel-editor {
    padding: 22px;
  }
  .map-tools {
    flex-wrap: wrap;
  }
  .source-grid {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
  }
  * {
    scroll-behavior: auto !important;
  }
}
/* Analysis controls and accessible score bands. */
.parcel-recommendations {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid #d5dfd5;
}
.parcel-recommendations h3 {
  font-size: 15px;
  margin: 0 0 16px;
}
.parcel-recommendations > .primary-button,
.iac-actions > .primary-button {
  width: 100%;
}
.recommendation-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
.recommendation-dates .field {
  margin: 8px 0;
}
.recommendation-dates input {
  min-width: 0;
}
.recommendation-filters {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  align-items: start;
}
.recommendation-filters > .recommendation-dates {
  margin: 0;
  background: #fff;
  padding: 12px 18px;
  border-radius: 16px;
}
.recommendation-filters > .date-error {
  grid-column: 1/-1;
  grid-row: 2;
  margin: 0;
}
.recommendation-filters > .field {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  padding: 18px;
  background: #fff;
  border-radius: 16px;
}
.date-error {
  font-size: 12px;
  margin: 6px 0 0;
  line-height: 1.5;
}
.date-error:empty {
  display: none;
}
input[aria-invalid="true"] {
  border-color: #a4382b;
  background: #fff7f4;
}
.iac-legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  margin: 16px 0;
}
.iac-legend span {
  padding: 5px 8px;
  border-radius: 7px;
  background: #f4f6f2;
}
.iac-low,
.plan-metrics b.iac-low {
  color: #ad3428;
}
.iac-medium,
.plan-metrics b.iac-medium {
  color: #956000;
}
.iac-high,
.plan-metrics b.iac-high {
  color: #236e43;
}
.iac-none {
  color: #718077;
}
.filter-field input[type="search"] {
  padding: 8px 10px;
  border: 1px solid #c6d6c9;
  border-radius: 8px;
  background: white;
  font-size: 12px;
}
@media (max-width: 720px) {
  .recommendation-filters {
    display: block;
  }
  .recommendation-filters > .field {
    margin-top: 12px;
  }
  .recommendation-dates {
    gap: 8px;
  }
  .recommendation-dates input {
    padding: 11px 7px;
  }
}
.point-history,
.economic-editor {
  margin: 20px 0;
  padding: 16px;
  border: 1px solid #dce5db;
  border-radius: 12px;
}
.point-history summary,
.economic-editor summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 12px;
}
.point-history .field {
  margin-bottom: 10px;
}
.economic-editor fieldset {
  min-width: 0;
  border: 1px solid #dce5db;
  border-radius: 8px;
  margin: 14px 0;
  padding: 12px;
}
.economic-editor legend {
  font-weight: 600;
}
.economic-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.economic-fields input {
  width: 100%;
  min-width: 0;
}
.economic-result {
  background: #f1f5ef;
  padding: 16px;
  border-radius: 10px;
  margin: 16px 0;
}
.economic-result h4 {
  margin: 0 0 8px;
}
.economic-result p {
  font-size: 13px;
  line-height: 1.5;
}
.economic-value {
  font-size: 23px;
  color: #245844;
  overflow-wrap: anywhere;
}
.economic-negative {
  color: #a13030;
}
.economic-table {
  overflow-x: auto;
}
.economic-table table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
.economic-table th,
.economic-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid #dce5db;
}
.economic-table caption {
  text-align: left;
  margin-bottom: 8px;
}
@media (max-width: 480px) {
  .economic-fields {
    grid-template-columns: 1fr;
  }
}
