.fence-workbench { grid-template-columns: minmax(470px, 1fr) minmax(330px, .68fr); }
.fence-mode-control { margin-top: 10px; }
.fence-run-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.3fr) minmax(110px, .8fr) 36px;
  gap: 8px;
  align-items: end;
  padding: 11px;
  border: 1px solid #d7dfe2;
  border-radius: 7px;
  background: #f8faf9;
}
.fence-run-row label,
.fence-price-grid label {
  color: #2b353a;
  font-size: 13px;
  font-weight: 800;
}
.fence-run-row label span,
.fence-price-grid label span { color: #69767d; font-size: 11px; }
.fence-run-row input,
.fence-price-grid input {
  width: 100%;
  min-height: 43px;
  box-sizing: border-box;
  border: 1px solid #bdc8cd;
  border-radius: 6px;
  padding: 9px 11px;
  background: #fff;
  color: #1f2529;
  font: inherit;
}
.fence-run-row input:focus,
.fence-price-grid input:focus { border-color: #16735f; outline: 3px solid rgba(22, 115, 95, .12); }
.fence-layout-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 13px;
}
.fence-check {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 9px;
  align-items: start;
  min-height: 70px;
  box-sizing: border-box;
  border: 1px solid #d7dfe2;
  border-radius: 7px;
  padding: 12px;
  background: #fff;
  cursor: pointer;
}
.fence-check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: #16735f; }
.fence-check strong,
.fence-check small { display: block; }
.fence-check strong { color: #29343a; font-size: 13px; }
.fence-check small { margin-top: 3px; color: #66747b; font-size: 11px; line-height: 1.35; }
.fence-spec-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fence-details {
  margin-top: 15px;
  border: 1px solid #d4dcdf;
  border-radius: 7px;
  background: #f8faf9;
}
.fence-details summary {
  padding: 13px 15px;
  color: #29343a;
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
}
.fence-details[open] summary { border-bottom: 1px solid #dce3e5; }
.fence-details .concrete-fields,
.fence-price-grid { margin: 0; padding: 14px; }
.fence-price-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.fence-result-grid article { min-height: 78px; }
.fence-visual { margin-top: 18px; padding: 14px 0 2px; border-top: 1px solid #d5dddf; }
.fence-visual-line {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 66px;
  overflow: hidden;
  border-bottom: 4px solid #6b5942;
}
.fence-visual-bay {
  position: relative;
  flex: 1 1 0;
  min-width: 7px;
  height: 38px;
  border-top: 5px solid #9a7446;
  border-bottom: 5px solid #9a7446;
  background: repeating-linear-gradient(90deg, #d2b48a 0, #d2b48a 3px, #f0dfc5 3px, #f0dfc5 5px);
}
.fence-visual-bay::before {
  position: absolute;
  bottom: -12px;
  left: -3px;
  width: 6px;
  height: 58px;
  background: #554c43;
  content: "";
}
.fence-visual-bay:last-child::after {
  position: absolute;
  right: -3px;
  bottom: -12px;
  width: 6px;
  height: 58px;
  background: #554c43;
  content: "";
}
.fence-visual-bay.is-gate { height: 31px; border-color: #397366; background: #b6d4cc; }
.fence-visual p { margin: 9px 0 0; color: #65737b; font-size: 12px; }
.fence-material-table-wrap { overflow-x: auto; margin-top: 16px; }
.fence-material-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.fence-material-table th,
.fence-material-table td { padding: 12px 10px; border-bottom: 1px solid #dce3e5; text-align: right; }
.fence-material-table th:first-child,
.fence-material-table td:first-child { padding-left: 0; text-align: left; }
.fence-material-table thead th { color: #5e6b72; font-size: 12px; text-transform: uppercase; }
.fence-material-table tbody th { color: #29343a; }
.fence-material-table tfoot th,
.fence-material-table tfoot td { border-bottom: 0; color: #174c40; font-weight: 900; }
.fence-table-note { margin: 12px 0 0; color: #65737b; font-size: 12px; }
.fence-reference-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fence-safety {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  margin-top: 20px;
  border-left: 4px solid #c08432;
  padding: 13px 15px;
  background: #fff8e9;
  color: #55452e;
}
.fence-safety p { margin: 0; line-height: 1.55; }
@media (max-width: 1080px) {
  .fence-workbench { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .fence-layout-options,
  .fence-spec-fields,
  .fence-price-grid,
  .fence-reference-grid { grid-template-columns: 1fr; }
  .fence-run-row { grid-template-columns: 1fr minmax(105px, .65fr) 36px; }
  .fence-safety { grid-template-columns: 1fr; }
  .fence-material-table { min-width: 520px; }
}
@media print {
  .fence-actions,
  #fence-reset,
  #fence-add-run,
  .fence-remove,
  .fence-presets { display: none !important; }
}