@import url("https://fonts.googleapis.com/css2?family=Inter:wght@500;600;700;800;900&family=Oswald:wght@500;600;700&display=swap");

:root {
  color-scheme: light;
  --font-display: "Oswald", "Arial Narrow", Impact, sans-serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;
  --ink: #1f2329;
  --muted: #69717d;
  --muted-strong: #3f4650;
  --line: #e2e6ec;
  --line-strong: #cbd2dc;
  --surface: #ffffff;
  --surface-subtle: #f7f8fa;
  --canvas: #fbfcfd;
  --orange: #e8692f;
  --orange-dark: #bf4e1f;
  --blue: #2167e8;
  --danger: #f04b37;
  --wood: #b96b33;
  --wood-dark: #6b3517;
  --steel: #121516;
  --shadow-sm: 0 1px 2px rgba(31, 35, 41, 0.07);
  --shadow-md: 0 10px 30px rgba(31, 35, 41, 0.08);
  --shadow-frame: 0 24px 70px rgba(31, 35, 41, 0.1);
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --control-h: 38px;
  --control-x: 12px;
  --select-arrow-size: 18px;
  --select-arrow-offset: 14px;
  --select-arrow-icon: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 7l4 4 4-4' fill='none' stroke='%233f4650' stroke-width='2.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #f8f5f2 0, #eef1f5 100%);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  overflow: hidden;
  overflow-anchor: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1920px, 100%);
  height: 100vh;
  min-height: 0;
  margin: 0 auto;
  padding: 0;
}

.builder {
  display: grid;
  grid-template-columns: 318px minmax(0, 1fr) 344px;
  grid-template-rows: 82px minmax(0, 1fr) 42px;
  height: 100vh;
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-frame);
  overflow: hidden;
}

.topbar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 314px minmax(260px, 1fr) auto 50px;
  align-items: center;
  gap: 22px;
  min-width: 0;
  padding: 8px 18px 8px 30px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  z-index: 3;
}

.brand-lockup {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: block;
  width: 64px;
  height: 56px;
  object-fit: contain;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
}

h1 {
  font-size: 25px;
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
}

h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon-tile {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.52)),
    linear-gradient(145deg, rgba(232, 105, 47, 0.18), rgba(33, 103, 232, 0.12));
  color: var(--muted-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 2px rgba(31, 35, 41, 0.08);
}

.icon-tile svg,
.settings-button svg,
.pdf-button svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.section-icon,
.card-icon {
  width: 26px;
  height: 26px;
  font-size: 17px;
}

.stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #1f2329;
  font-size: 21px;
}

.top-selectors {
  display: flex;
  align-items: center;
  min-width: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.top-selectors label {
  color: #8b929d;
  font-size: 15px;
}

.project-menu {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(640px, 100%);
  min-width: 0;
}

.file-menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  box-shadow: var(--shadow-sm);
}

.file-menu-button:hover,
.file-menu-button[aria-expanded="true"] {
  border-color: var(--line-strong);
  background: var(--surface-subtle);
}

.document-titlebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  min-width: 260px;
  min-height: 42px;
  padding: 0 14px;
  border-left: 1px solid var(--line);
}

.document-title-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  width: 100%;
  min-height: 38px;
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  text-align: left;
}

.document-title-button:hover {
  border-color: var(--line);
  background: var(--surface-subtle);
}

.project-kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.document-title-button strong,
.project-title-input {
  width: 100%;
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-title-input {
  height: 38px;
  min-height: 0;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: none;
}

.project-title-input:focus {
  border-color: var(--blue);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(33, 103, 232, 0.13);
}

#projectMenuStatus {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 12;
  display: grid;
  width: 300px;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: 0 22px 60px rgba(31, 35, 41, 0.16);
}

.file-menu-panel[hidden] {
  display: none;
}

.file-menu-panel button,
.project-save-action {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.project-save-action {
  width: 100%;
  color: var(--blue);
}

.file-menu-panel button:hover {
  background: var(--surface-subtle);
}

.project-save-action:hover {
  background: rgba(33, 103, 232, 0.08);
}

.project-delete-action {
  color: var(--danger);
}

.file-menu-panel svg,
.project-save-action svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.recent-projects {
  display: grid;
  gap: 5px;
  margin: 5px 0;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.file-menu-section-label {
  padding: 0 10px 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.recent-project-list {
  display: grid;
  gap: 2px;
}

.recent-project-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  min-height: 48px;
  padding: 7px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  text-align: left;
}

.recent-project-item:hover {
  background: var(--surface-subtle);
}

.recent-project-item strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-project-item span,
.recent-project-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.recent-project-empty {
  padding: 8px 10px;
}

select,
input[type="number"],
input[type="text"] {
  width: 100%;
  height: var(--control-h);
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  padding: 0 var(--control-x);
  box-shadow: inset 0 1px 1px rgba(31, 35, 41, 0.03);
}

input[type="number"] {
  appearance: auto;
}

select {
  appearance: none;
  background-color: #fff;
  background-image: var(--select-arrow-icon);
  background-position: right var(--select-arrow-offset) center;
  background-repeat: no-repeat;
  background-size: var(--select-arrow-size) var(--select-arrow-size);
  cursor: pointer;
  padding-right: calc(var(--select-arrow-offset) + var(--select-arrow-size) + 12px);
}

select:focus,
input:focus,
button:focus-visible,
.segmented input:focus-visible + span,
.opening-grid input:focus-visible + span {
  outline: 2px solid rgba(232, 105, 47, 0.32);
  outline-offset: 2px;
}

select:disabled,
input:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.toolbar button,
.settings-button,
.view-tools {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted-strong);
}

.toolbar button {
  display: grid;
  place-items: center;
  gap: 5px;
  min-width: 58px;
  height: 52px;
  padding: 5px 8px;
  border-color: var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.toolbar button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toolbar button small {
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.toolbar button:hover,
.settings-button:hover,
.view-tools:hover {
  background: var(--surface-subtle);
}

.toolbar button:not(:disabled):active {
  transform: translateY(1px);
}

.settings-button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 21px;
}

.control-panel {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 7px;
  background: #f8fafc;
  border-right: 1px solid var(--line);
  overflow: auto;
}

.control-card {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 16px 14px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

legend {
  display: flex;
  align-items: center;
  gap: 8px;
  float: left;
  width: 100%;
  margin: 0 0 6px;
  padding: 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

legend + * {
  clear: both;
}

.grid-2,
.split-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  min-width: 0;
}

.custom-panel,
.custom-post {
  display: none;
}

.custom-panel.show,
.custom-post.show {
  display: grid;
}

.number-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  height: var(--control-h);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  overflow: hidden;
}

.number-wrap input {
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.number-wrap span {
  padding: 0 12px;
  color: var(--muted-strong);
  font-weight: 800;
}

.segmented,
.opening-grid {
  display: grid;
  min-width: 0;
}

.segmented {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.post-material {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.opening-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.segmented label,
.opening-grid label {
  position: relative;
  display: block;
  min-width: 0;
}

.segmented input,
.opening-grid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span,
.opening-grid span {
  display: grid;
  place-items: center;
  min-height: 34px;
  padding: 0 8px;
  background: #fff;
  color: var(--muted-strong);
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.segmented span {
  border-left: 1px solid var(--line);
}

.segmented label:first-child span {
  border-left: 0;
}

.opening-grid span {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.segmented input:checked + span,
.opening-grid input:checked + span {
  border-color: var(--orange);
  background: var(--orange);
  color: #fff;
}

.workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  padding: 7px 14px 8px 14px;
  background: var(--surface);
  overflow: hidden;
  contain: layout paint;
}

.canvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
}

.view-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 10px 0 12px;
  border-color: var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.toggle {
  display: flex;
  grid-template: none;
  align-items: center;
  gap: 8px;
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 800;
}

.toggle input {
  position: absolute;
  opacity: 0;
}

.toggle span {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: #d9dfe8;
}

.toggle span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 160ms ease, background-color 160ms ease;
}

.toggle input:checked + span {
  background: var(--blue);
}

.toggle input:checked + span::after {
  transform: translateX(20px);
}

.drawing-wrap {
  position: relative;
  min-height: min(600px, calc(100vh - 150px));
  height: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background:
    linear-gradient(rgba(36, 44, 54, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 44, 54, 0.055) 1px, transparent 1px),
    var(--canvas);
  background-size: 28px 28px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.drawing-wrap.grid-off {
  background: var(--canvas);
}

#fenceSvg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: min(600px, calc(100vh - 150px));
  overflow-anchor: none;
  transform-origin: center center;
  transition: transform 160ms ease;
}

.canvas-stats {
  position: absolute;
  left: 50%;
  bottom: 30px;
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  width: min(900px, calc(100% - 80px));
  min-height: 74px;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.canvas-stats article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  row-gap: 0;
  padding: 0 16px;
  border-left: 1px solid var(--line);
}

.canvas-stats article:first-child {
  border-left: 0;
}

.canvas-stats .stat-icon {
  grid-row: 1 / 3;
}

.canvas-stats strong {
  color: var(--ink);
  font-size: 21px;
  font-weight: 900;
  white-space: nowrap;
}

.canvas-stats small {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.takeoff-panel {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 7px;
  background: #f8fafc;
  border-left: 1px solid var(--line);
  overflow: auto;
}

.takeoff-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 16px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.notes-card {
  display: none;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  border-top: 1px solid var(--line);
  color: var(--muted-strong);
  font-size: 15px;
  line-height: 1.25;
}

li:first-child {
  border-top: 0;
}

li strong {
  color: var(--ink);
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.estimate-card li {
  min-height: 46px;
}

.pdf-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--blue);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(33, 103, 232, 0.22);
}

.pdf-button svg {
  font-size: 22px;
}

.pdf-button:hover {
  background: #1b5cd1;
}

.statusbar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto minmax(220px, 1fr);
  align-items: center;
  gap: 14px;
  padding: 0 28px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.action-status {
  color: var(--blue);
  font-weight: 800;
  text-align: center;
}

.statusbar strong {
  color: var(--muted-strong);
  font-weight: 800;
  text-align: center;
}

.statusbar span:last-child {
  text-align: right;
}

.settings-dialog,
.project-dialog {
  width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 0;
  box-shadow: var(--shadow-frame);
}

.project-dialog {
  width: min(760px, calc(100vw - 32px));
}

.settings-dialog::backdrop,
.project-dialog::backdrop {
  background: rgba(31, 35, 41, 0.28);
}

.settings-dialog form,
.project-dialog form {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.settings-dialog header,
.project-dialog header,
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.project-dialog header {
  align-items: flex-start;
}

.project-dialog h2 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.1;
}

.project-dialog p {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.settings-dialog header button,
.project-dialog header button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-size: 22px;
}

.project-list {
  display: grid;
  gap: 8px;
  max-height: min(430px, 55vh);
  overflow: auto;
}

.project-list-item,
.project-empty {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 66px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  text-align: left;
}

.project-list-item:hover {
  border-color: var(--line-strong);
}

.project-open-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.project-open-row:hover strong {
  color: var(--blue);
}

.project-list-item strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-list-item span,
.project-empty {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.project-list-item em {
  color: var(--blue);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

.project-row-delete {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid rgba(232, 70, 48, 0.22);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--danger);
  font-size: 12px;
  font-weight: 900;
}

.project-row-delete:hover {
  background: rgba(232, 70, 48, 0.08);
  border-color: rgba(232, 70, 48, 0.38);
}

.project-row-delete svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.project-dialog menu {
  display: flex;
  justify-content: flex-end;
  margin: 0;
  padding: 0;
}

.project-dialog menu button {
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

.settings-row {
  min-height: 46px;
  color: var(--ink);
  font-weight: 800;
}

.settings-row input {
  width: 20px;
  height: 20px;
}

.secondary-action {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--muted-strong);
  font-weight: 900;
}

.secondary-action:hover {
  background: var(--surface-subtle);
}

.compact-rows li {
  min-height: 38px;
}

@media print {
  body {
    background: #fff;
  }

  .topbar,
  .control-panel,
  .canvas-header,
  .pdf-button,
  .statusbar,
  .settings-dialog {
    display: none !important;
  }

  .builder {
    display: block;
    min-height: auto;
    border: 0;
    box-shadow: none;
  }

  .workspace,
  .takeoff-panel {
    display: block;
    padding: 0;
    border: 0;
    background: #fff;
  }

  .drawing-wrap {
    height: 7in;
    min-height: 7in;
    page-break-after: always;
  }

  .takeoff-card {
    break-inside: avoid;
    margin: 0 0 12px;
  }
}

.svg-label {
  fill: var(--steel);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.svg-small {
  fill: var(--muted-strong);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 800;
}

.dim-line,
.mesh-line {
  stroke: var(--steel);
  stroke-width: 1.25;
  vector-effect: non-scaling-stroke;
}

.mesh-line {
  opacity: 0.88;
}

.post-fill {
  fill: var(--wood);
  stroke: var(--wood-dark);
  stroke-width: 1.7;
}

.rail-fill {
  fill: var(--wood);
  stroke: var(--wood-dark);
  stroke-width: 1.5;
}

.metal-fill {
  fill: #171a1b;
  stroke: #050606;
  stroke-width: 1.3;
}

@media (max-width: 1500px) {
  .builder {
    grid-template-columns: 292px minmax(0, 1fr) 300px;
  }

  .topbar {
    grid-template-columns: 288px minmax(300px, 1fr) auto 46px;
  }

  .canvas-stats {
    width: min(760px, calc(100% - 60px));
  }

  .canvas-stats article {
    padding: 0 18px;
  }
}

@media (max-width: 1180px) {
  body {
    overflow: auto;
  }

  .app-shell,
  .builder {
    height: auto;
    min-height: 100vh;
  }

  .builder {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto auto;
  }

  .topbar,
  .control-panel,
  .workspace,
  .takeoff-panel,
  .statusbar {
    grid-column: 1;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .top-selectors {
    width: 100%;
  }

  .toolbar {
    justify-content: start;
    overflow-x: auto;
  }

  .control-panel,
  .takeoff-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 0;
  }

  .pdf-button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .builder {
    border: 0;
    border-radius: 0;
  }

  .topbar,
  .control-panel,
  .workspace,
  .takeoff-panel {
    padding: 12px;
  }

  .brand-lockup {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .brand-mark {
    width: 64px;
    height: 56px;
  }

  h1 {
    font-size: 24px;
  }

  .control-panel,
  .takeoff-panel,
  .grid-2,
  .split-row {
    grid-template-columns: 1fr;
  }

  .top-selectors,
  .project-menu {
    width: 100%;
  }

  .project-menu {
    align-items: stretch;
    flex-direction: column;
  }

  .document-titlebar {
    border-left: 0;
    padding: 0;
  }

  .opening-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .drawing-wrap,
  #fenceSvg {
    min-height: 430px;
  }

  .canvas-stats {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: auto;
    transform: none;
    margin: 12px;
  }

  .canvas-stats article:nth-child(odd) {
    border-left: 0;
  }

  .statusbar {
    grid-template-columns: 1fr;
    min-height: 88px;
    padding: 12px;
    text-align: left;
  }

  .statusbar strong,
  .statusbar span:last-child {
    text-align: left;
  }
}
