/* V0.68: collapsible farm map and compact persisted state per farm. */
.farm-map-panel .panel-head {
  transition: padding .18s ease, border-color .18s ease;
}
.map-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 38px;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 11px;
  color: #1672d4;
  transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease;
}
.map-toggle-btn:hover {
  color: #075fbd;
  border-color: #78afe9;
  background: #e8f3ff;
}
.map-toggle-btn:active { transform: translateY(1px); }
.map-toggle-chevron {
  position: relative;
  width: 14px;
  height: 14px;
}
.map-toggle-chevron::before,
.map-toggle-chevron::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 2px;
  background: currentColor;
  transform: translate(-50%, -50%);
  transition: opacity .16s ease, transform .16s ease;
}
.map-toggle-chevron::before {
  width: 14px;
  height: 2px;
}
.map-toggle-chevron::after {
  width: 2px;
  height: 14px;
  opacity: 0;
}
.farm-map-panel.is-collapsed .map-toggle-chevron::after {
  opacity: 1;
}
.farm-map-panel.is-collapsed {
  min-height: 0 !important;
}
.farm-map-panel.is-collapsed .panel-head {
  align-items: center !important;
  padding-top: 16px;
  padding-bottom: 16px;
}
.farm-map-panel.is-collapsed .farm-map,
.farm-map-panel.is-collapsed .farm-map-legend,
.farm-map-panel.is-collapsed #mapConfigBtn,
.farm-map-panel.is-collapsed #mapEditBtn,
.farm-map-panel.is-collapsed #mapResetBtn {
  display: none !important;
}
html[data-theme="dark"] .map-toggle-btn {
  color: #70b7ff;
  border-color: #315d89;
  background: #17283a;
}
html[data-theme="dark"] .map-toggle-btn:hover {
  color: #a6d3ff;
  border-color: #438bd6;
  background: #1c3550;
}
@media (max-width: 760px) {
  .farm-map-panel .panel-head { align-items: flex-start; }
  .map-toggle-btn { margin-left: auto; }
  .farm-map-panel.is-collapsed .panel-head { gap: 10px; }
}

/* V0.66: only the filter row stays visible while the ASIC table scrolls. */
.asic-list-controls {
  position: static !important;
  border-bottom: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.asic-panel { overflow: hidden !important; }
.asic-list-controls .toolbar { padding-bottom: 10px !important; }
.asic-sticky-filters {
  position: relative !important;
  top: auto !important;
  z-index: 3 !important;
  margin-top: 0 !important;
  padding-top: 10px !important;
  padding-bottom: 12px !important;
  border-top: 1px solid #e6ebf1;
  border-bottom: 1px solid #e6ebf1;
  background: rgba(255,255,255,.96);
  box-shadow: 0 9px 22px rgba(15,23,42,.06);
  backdrop-filter: blur(12px);
}
.asic-panel > .table-wrap {
  max-height: calc(100vh - 190px) !important;
  min-height: 260px;
  overflow: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.asic-panel > .table-wrap thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 5 !important;
  background: #f7f9fc !important;
  box-shadow: 0 1px 0 #e6ebf1;
}
.table-wrap .asic-data-row td {
  padding-top: 12px !important;
  padding-bottom: 12px !important;
  border-bottom: 1px solid var(--border-soft,#e8edf3) !important;
}
.table-wrap .asic-actions-subrow { display: none !important; }
.asic-more-btn {
  flex: 0 0 auto; width: 28px; height: 28px; padding: 0;
  border: 1px solid #d5deea; border-radius: 8px;
  background: #f4f7fb; color: #344054; font-size: 19px; font-weight: 650;
  line-height: 24px; cursor: pointer;
}
.asic-more-btn:hover { border-color: #8ebcf2; background: #eaf3ff; color: #0969da; }
.table-wrap .asic-select-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 76px !important;
  white-space: nowrap;
}
.table-wrap th.select-col { min-width: 76px !important; text-align: center !important; }
.asic-action-floating {
  position: fixed; z-index: 1000; display: grid; gap: 4px; width: 210px;
  padding: 8px; border: 1px solid #dce4ee; border-radius: 13px;
  background: #fff; box-shadow: 0 18px 48px rgba(15,23,42,.24);
}
.asic-action-floating.hidden { display: none !important; }
.asic-action-menu-title { display: flex; flex-direction: column; padding: 7px 9px 9px; border-bottom: 1px solid #edf1f5; }
.asic-action-menu-title small { color: #7b8493; margin-top: 2px; }
.asic-action-floating button {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 36px;
  padding: 0 10px; border: 0; border-radius: 8px; background: transparent;
  color: #344054; font: 750 12px inherit; text-align: left; cursor: pointer;
}
.asic-action-floating button:hover { background: #eef5ff; color: #0969da; }
.asic-action-floating button.danger { color: #c62828; }
.asic-action-floating button.danger:hover { background: #fff1f2; }
.asic-action-floating button:disabled { opacity: .35; cursor: not-allowed; }
.asic-action-floating button i { width: 17px; font-style: normal; text-align: center; }
html[data-theme="dark"] .asic-sticky-filters { background: rgba(23,30,39,.96); border-color: #354150; }
html[data-theme="dark"] .asic-panel > .table-wrap thead th { background: #202a36 !important; box-shadow: 0 1px 0 #354150; }
html[data-theme="dark"] .asic-more-btn { background: #273240; border-color: #435064; color: #dbe5f1; }
html[data-theme="dark"] .asic-action-floating { background: #171e27; border-color: #354150; }
html[data-theme="dark"] .asic-action-floating button { color: #dbe5f1; }
html[data-theme="dark"] .asic-action-menu-title { border-color: #354150; }
@media (min-width: 921px) {
  .table-wrap th:last-child,
  .table-wrap .asic-data-row td:last-child { width: auto !important; min-width: 100px !important; max-width: none !important; }
}
@media (max-width: 760px) {
  .asic-sticky-filters { position: static !important; }
  .asic-panel > .table-wrap { max-height: none !important; min-height: 0; overflow: visible !important; }
}

/* V0.65 compact ZEC price + network difficulty chart. */
.market-dual-panel {
  display: block !important;
  min-height: 0 !important;
  padding: 0 !important;
  overflow: hidden;
}
.market-dual-head {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 20px 11px !important;
  border-bottom: 1px solid #edf1f5;
}
.market-dual-head h2 { margin: 0 0 3px; }
.market-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #24824a;
  font-size: 11px;
  font-weight: 800;
}
.market-live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2cc76f;
  box-shadow: 0 0 0 4px rgba(44, 199, 111, .11);
}
.market-ranges {
  display: flex;
  gap: 3px;
  padding: 3px;
  border-radius: 9px;
  background: #f1f4f8;
}
.market-ranges button {
  min-width: 42px;
  padding: 6px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #6d7787;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.market-ranges button.active {
  background: #fff;
  color: #0969da;
  box-shadow: 0 2px 8px rgba(32, 60, 104, .10);
}
.market-dual-body {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 205px;
}
.market-dual-summary {
  display: flex !important;
  grid-template-columns: none !important;
  flex-direction: column;
  gap: 9px !important;
  padding: 13px 16px 12px !important;
  border-right: 1px solid #edf1f5;
  background: #fbfcfe;
}
.market-dual-summary .market-metric {
  min-height: 0 !important;
  padding: 9px 11px !important;
  border-left: 3px solid #1477e5;
  border-radius: 9px;
  background: #f4f8ff;
}
.market-dual-summary .market-metric.difficulty {
  border-color: #f0a024;
  background: #fff8ec;
}
.market-dual-summary .market-metric span {
  display: block;
  color: #7b8493;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.market-dual-summary .market-metric strong {
  display: block;
  margin-top: 3px;
  font-size: 20px;
  line-height: 1.05;
}
.market-dual-summary .market-metric b {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.15;
}
.market-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: auto;
  color: #596579;
  font-size: 11px;
}
.market-legend i {
  display: inline-block;
  width: 18px;
  margin-right: 6px;
  border-top: 3px dashed #1477e5;
  vertical-align: middle;
}
.market-legend i.difficulty { border-color: #f0a024; border-style: solid; }
.market-chart-wrap {
  position: relative;
  min-width: 0;
  height: 205px;
  background: linear-gradient(180deg, #fff, #fbfdff);
}
.market-dual-panel .market-chart-wrap canvas {
  display: block;
  width: 100%;
  height: 205px !important;
  max-height: 205px !important;
  padding: 0 !important;
  cursor: crosshair;
}
.market-axis {
  position: absolute;
  top: 7px;
  pointer-events: none;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .04em;
}
.market-axis.left { left: 15px; color: #1477e5; }
.market-axis.right { right: 15px; color: #d98910; }
.market-chart-tooltip {
  position: absolute;
  top: 32px;
  z-index: 2;
  min-width: 158px;
  padding: 8px 10px;
  border: 1px solid #dfe6ef;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 9px 24px rgba(23, 42, 68, .11);
  pointer-events: none;
  font-size: 11px;
}
.market-chart-tooltip b { display: block; margin-bottom: 5px; }
.market-chart-tooltip span { display: flex; justify-content: space-between; gap: 12px; margin-top: 3px; color: #657085; }
.market-chart-tooltip i { font-style: normal; font-weight: 800; }
.market-chart-tooltip i.price { color: #1477e5; }
.market-chart-tooltip i.difficulty { color: #d98910; }
.market-dual-source {
  display: block;
  padding: 5px 14px 8px;
  color: #8a94a3;
  font-size: 10px;
  text-align: right;
}
.market-dual-panel .market-hint:not(:empty) {
  display: block;
  margin: 0;
  padding: 0 16px 9px;
}
html[data-theme="dark"] .market-dual-head,
html[data-theme="dark"] .market-dual-summary { border-color: #354150; }
html[data-theme="dark"] .market-ranges { background: #111820; }
html[data-theme="dark"] .market-ranges button.active,
html[data-theme="dark"] .market-chart-tooltip { background: #202a36; color: #f3f6fa; }
html[data-theme="dark"] .market-dual-summary { background: #171e27; }
html[data-theme="dark"] .market-dual-summary .market-metric.price { background: rgba(20, 119, 229, .12); }
html[data-theme="dark"] .market-dual-summary .market-metric.difficulty { background: rgba(240, 160, 36, .12); }
html[data-theme="dark"] .market-chart-wrap { background: linear-gradient(180deg, #171e27, #141a22); }

@media (max-width: 760px) {
  .market-dual-head { align-items: flex-start; flex-direction: column; }
  .market-dual-body { grid-template-columns: 1fr; }
  .market-dual-summary {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    border-right: 0;
    border-bottom: 1px solid #edf1f5;
  }
  .market-legend { grid-column: 1 / -1; }
  .market-chart-wrap,
  .market-dual-panel .market-chart-wrap canvas { height: 180px !important; max-height: 180px !important; }
}
