dialog[data-kind="trades"] {
  width: min(710px, calc(100% - 20px));
}
.trade-exchange {
  margin-top: 12px;
  --line: #c2ccbb;
  --paper: #faf9ef;
}
.trade-tabs {
  display: flex;
  border-bottom: 1px solid #aebca8;
  gap: 3px;
}
.trade-tabs button {
  background: none;
  color: #566354;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 8px 12px;
  font: 600 14px var(--sans);
  cursor: pointer;
}
.trade-tabs button[aria-selected="true"] {
  background: #e8efdd;
  color: #234931;
  border-bottom-color: #477650;
}
.trade-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(165px, 0.92fr);
  align-items: start;
  gap: 16px;
  padding: 12px 0;
}
.trade-panel[hidden] {
  display: none;
}
.trade-picks {
  min-width: 0;
}
.trade-lots {
  max-height: 240px;
  overflow: auto;
  scrollbar-width: thin;
}
.trade-exchange .trade-lot {
  display: grid;
  grid-template-columns: auto 5px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  width: 100%;
  font: 550 13px/1.3 var(--sans);
  color: #28392b;
  background: none;
  border: 1px solid transparent;
  border-bottom-color: #d7dfcf;
  border-radius: 3px;
  padding: 7px 4px;
  text-align: left;
  cursor: pointer;
  margin: 0;
}
.trade-exchange button.trade-lot {
  grid-template-columns: 5px minmax(0, 1fr) auto;
}
.trade-lot > i,
.trade-lot-info h4 i {
  width: 5px;
  height: 18px;
  background: var(--lot);
  border-radius: 2px;
}
.trade-lot > input {
  appearance: auto;
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #315f42;
}
.trade-lot b {
  font: 650 12px var(--sans);
  white-space: nowrap;
}
.trade-lot small {
  display: block;
  color: #72604d;
  font-size: 10px;
}
.trade-exchange .trade-lot.located {
  border-color: #809779;
}
.trade-exchange .trade-lot:has(:checked) {
  background: #e8efdf;
}
.trade-picks .money-label {
  font: 650 13px var(--sans);
  flex-wrap: wrap;
  gap: 3px;
  margin: 12px 0 4px;
}
.trade-picks .money-label small {
  white-space: nowrap;
}
.trade-picks input[type="number"] {
  width: 100%;
  padding: 6px 8px;
}
.trade-map-column {
  min-width: 0;
}
.trade-map {
  display: grid;
  grid-template-columns: 1.54fr repeat(9, minmax(0, 1fr)) 1.54fr;
  grid-template-rows: 1.54fr repeat(9, minmax(0, 1fr)) 1.54fr;
  aspect-ratio: 1;
  width: 100%;
  max-width: 219px;
  margin: auto;
  background: #d6dfcc;
  border: 2px solid #506b50;
  border-radius: 3px;
  gap: 1px;
}
.trade-map-center {
  grid-area: 2/2/11/11;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #e9eddf;
}
.trade-map-center img {
  width: 85%;
  height: 85%;
  object-fit: contain;
  opacity: 0.45;
  mix-blend-mode: multiply;
}
.map-square {
  position: relative;
  box-sizing: border-box;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  display: grid;
  place-items: center;
  color: #405441;
  background: color-mix(in srgb, var(--lot) 50%, #f7f6ed);
  line-height: 1;
}
.map-square.available {
  background: var(--lot);
  border: 1px solid #385741;
  cursor: pointer;
}
.map-square.located {
  outline: 3px solid #203e2d;
  outline-offset: 0;
  z-index: 1;
}
.map-square.located:before {
  content: "";
  position: absolute;
  inset: 1px;
  border: 1px solid white;
}
.map-square[data-picked]:after {
  content: "✓";
  position: absolute;
  font: bold clamp(9px, 1.3vw, 13px) var(--sans);
  color: #243c2b;
  background: #fafbed;
  border-radius: 50%;
  padding: 0 2px;
}
.map-square > em {
  font: 700 clamp(5px, 0.7vw, 8px) var(--sans);
}
.map-square > svg {
  width: 66%;
  height: 66%;
}
.trade-lot-info h4 {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 700 16px/1.2 var(--serif);
  margin: 8px 0 4px;
}
.trade-lot-info h4 i {
  flex: none;
}
.trade-exchange .trade-lot-info dl {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  margin: 0;
}
.trade-lot-info dl > div {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  font: 500 12px/1.35 var(--sans);
}
.trade-lot-info dd {
  margin: 0;
  text-align: right;
  font-weight: 650;
}
.trade-lot-info dt {
  color: #556351;
}
.trade-totals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.trade-totals > div {
  min-width: 0;
  padding: 7px 9px;
  border-radius: 5px;
  background: #f0ede2;
}
.trade-totals > div + div {
  background: #e9f0e2;
}
.trade-totals > div > span {
  font: 600 12px var(--sans);
}
.trade-totals strong,
.trade-totals small {
  display: block;
}
.trade-totals strong {
  font: 700 20px var(--serif);
}
.trade-totals small,
.trade-cash {
  font: 500 11px/1.4 var(--sans);
  color: #53604e;
}
.estate-name,
.cash-receipt .estate-name {
  display: inline;
  padding: 0 0.21em 0 0.36em;
  border-inline-start: 3px solid var(--estate);
  border-radius: 2px;
  background: color-mix(in srgb, var(--estate) 20%, #faf9ef);
  color: color-mix(in srgb, var(--estate) 39%, #162819);
  font: inherit;
  font-weight: 650;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
@media (max-width: 510px) {
  .trade-panel {
    grid-template-columns: minmax(0, 1.16fr) minmax(106px, 0.84fr);
    gap: 8px;
  }
  .trade-exchange .trade-lot {
    grid-template-columns: auto 3px minmax(0, 1fr);
    column-gap: 4px;
    font-size: 12px;
  }
  .trade-exchange .trade-lot b {
    grid-column: 3;
    font-size: 11px;
  }
  .trade-exchange button.trade-lot {
    grid-template-columns: 3px minmax(0, 1fr);
  }
  .trade-exchange button.trade-lot b {
    grid-column: 2;
  }
  .trade-tabs button {
    flex: 1;
    font-size: 13px;
    padding: 7px 3px;
  }
  .trade-lot-info h4 {
    font-size: 14px;
  }
  .trade-lot-info dl > div {
    flex-wrap: wrap;
    column-gap: 4px;
    font-size: 11px;
  }
  .trade-lot-info dd {
    margin-left: auto;
  }
  .trade-lots {
    max-height: 190px;
  }
  .trade-totals > div {
    padding: 6px;
  }
  .map-square.located {
    outline-width: 2px;
  }
}

.map-square .map-lock {
  width: 95%;
  height: 95%;
  object-fit: contain;
}
