:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #f1f5f2;
  --surface: #ffffff;
  --surface-strong: #e9f1ed;
  --text: #13231d;
  --muted: #5f7069;
  --line: #c7d5cf;
  --accent: #087a55;
  --accent-strong: #075f44;
  --accent-soft: #d9f0e6;
  --action: #0369a1;
  --action-strong: #075985;
  --danger: #b3261e;
  --danger-soft: #fae4e2;
  --shadow: 0 10px 26px rgba(20, 47, 36, 0.08);
  --shadow-strong: 0 18px 46px rgba(20, 47, 36, 0.13);
}

#legacyEstimatorRoot {
  display: contents;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  position: fixed;
  inset: 0;
  min-width: 320px;
  width: 100%;
  margin: 0;
  color: var(--text);
  background: var(--bg);
}

body::before {
  position: fixed;
  inset: 0 0 auto;
  height: 4px;
  content: "";
  background: var(--accent);
  z-index: 50;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 42px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 0 14px;
  color: #ffffff;
  background: var(--accent);
  cursor: pointer;
  transition:
    color 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

button:hover {
  background: var(--accent-strong);
}

button:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

button.secondary {
  color: var(--text);
  border-color: var(--line);
  background: #ffffff;
}

button.secondary:hover {
  background: var(--surface-strong);
}

button.danger {
  color: var(--danger);
  border-color: #edbab6;
  background: var(--danger-soft);
}

button.danger:hover {
  background: #f8d4d0;
}

button.is-active {
  color: #ffffff;
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

button.icon-button {
  width: 34px;
  min-height: 34px;
  padding: 0;
  color: var(--muted);
  border-color: transparent;
  background: transparent;
}

button.icon-button:hover {
  color: var(--text);
  background: var(--surface-strong);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
}

input,
select,
textarea {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text);
  background: #ffffff;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(15, 138, 99, 0.24);
  outline-offset: 2px;
}

textarea {
  min-height: 104px;
  resize: vertical;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  text-transform: uppercase;
}

.app-shell {
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.estimator-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px 18px;
  min-height: 38px;
  border-top: 1px solid rgba(199, 213, 207, 0.84);
  padding: 8px 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.94);
  font-size: 0.76rem;
  font-weight: 650;
  line-height: 1.35;
  text-align: center;
  flex-wrap: wrap;
}

.estimator-footer strong {
  color: var(--text);
  font-weight: 850;
}

.cookie-preference-footer {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 18px;
  border: 1px solid rgba(7, 95, 68, 0.18);
  border-radius: 8px;
  box-shadow: 0 18px 54px rgba(19, 35, 29, 0.18);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
}

.cookie-preference-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.cookie-preference-copy strong {
  font-size: 0.98rem;
}

.cookie-preference-copy span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.48;
}

.cookie-preference-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.cookie-preference-actions button {
  white-space: nowrap;
}

.cookie-settings-button {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 1100;
  min-height: 44px;
  border-color: rgba(7, 95, 68, 0.22);
  border-radius: 999px;
  padding: 0 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 30px rgba(19, 35, 29, 0.16);
}

.cookie-settings-button:hover {
  color: #ffffff;
  background: var(--accent-strong);
}

@media (max-width: 680px) {
  .cookie-preference-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .cookie-preference-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .cookie-preference-actions button,
  .cookie-settings-button {
    width: 100%;
  }

  .cookie-settings-button {
    right: max(16px, env(safe-area-inset-right));
  }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.estimator-home-link {
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  min-width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  padding: 0;
  color: transparent;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  background: #ffffff url("/assets/brand/property-improvement-mark.png") center / 86% auto no-repeat;
  font-size: 0;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-indent: -999px;
}

.topbar h1 {
  margin: 2px 0 0;
  font-size: clamp(1.25rem, 2vw, 1.8rem);
  line-height: 1.1;
}

.eyebrow {
  margin: 0;
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.project-mode-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px;
  background: #f5faf7;
}

.project-mode-switcher:empty {
  display: none;
}

.project-mode-switcher button {
  min-height: 34px;
  border: 0;
  border-radius: 5px;
  padding: 0 11px;
  color: #345048;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 850;
  box-shadow: none;
}

.project-mode-switcher button:hover {
  background: #e6f2ec;
  transform: none;
}

.project-mode-switcher button.is-selected {
  color: #ffffff;
  background: var(--accent-strong);
}

.estimator-guide-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  padding: 0 10px;
  color: var(--accent-strong);
  font-size: 0.83rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.quote-intent-notice {
  padding: 8px 20px;
  color: #123f31;
  border-bottom: 1px solid #b6d9cc;
  background: #e8f5f0;
  font-size: 0.84rem;
}

.quote-intent #requestQuotesButton {
  box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.2);
}

#requestQuotesButton {
  min-width: 250px;
  white-space: nowrap;
}

.workspace {
  display: grid;
  grid-template-columns:
    minmax(210px, 250px)
    minmax(300px, 340px)
    minmax(500px, 1fr)
    minmax(260px, 300px);
  gap: 18px;
  width: min(1920px, 100%);
  height: 100%;
  min-height: 0;
  margin: 0 auto;
  padding: 18px;
  overflow: auto;
}

[data-workspace-mode="satellite"] .grid-only-setting {
  display: none !important;
}

[data-workspace-mode="satellite"] .design-toolbar {
  display: none;
}

.analytics-consent {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10000;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  width: min(700px, calc(100% - 36px));
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 18px;
  background: #ffffff;
  box-shadow: 0 22px 62px rgba(5, 35, 26, 0.23);
}

.analytics-consent p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.analytics-consent-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fence-type-column,
.sidebar,
.summary,
.canvas-column,
.project-elements-panel {
  min-width: 0;
}

.fence-type-column,
.sidebar,
.summary {
  display: grid;
  align-content: start;
  gap: 12px;
}

@media (min-width: 1181px) {
  .topbar {
    min-height: 72px;
    padding: 12px 20px;
  }

  .brand-mark {
    width: 38px;
    min-width: 38px;
    height: 38px;
  }

  .workspace {
    grid-template-columns:
      minmax(240px, 270px)
      minmax(330px, 360px)
      minmax(400px, 1fr)
      minmax(230px, 260px);
    grid-template-rows: minmax(680px, calc(100dvh - 132px)) auto;
    align-content: start;
    gap: 10px;
    padding: 10px;
    overflow: auto;
  }

  .fence-type-column,
  .sidebar,
  .canvas-column,
  .summary {
    position: static;
    height: 100%;
    min-height: 0;
    max-height: none;
    overflow: hidden;
  }

  .fence-type-column {
    grid-template-rows: auto minmax(0, 1fr);
    align-content: stretch;
    gap: 8px;
  }

  .fence-type-heading {
    padding: 0 2px;
  }

  .fence-type-heading h2 {
    margin: 2px 0 3px;
    font-size: 1rem;
  }

  .fence-type-heading > p:last-child {
    font-size: 0.72rem;
    line-height: 1.25;
  }

  .fence-type-bubbles {
    grid-auto-rows: minmax(92px, auto);
    gap: 7px;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 2px;
    scrollbar-width: thin;
  }

  .fence-type-bubble {
    grid-template-columns: 112px minmax(0, 1fr);
    min-height: 92px;
  }

  .fence-type-bubble img {
    width: 112px;
    height: 100%;
    min-height: 0;
    aspect-ratio: auto;
  }

  .fence-type-bubble-body {
    align-content: center;
    gap: 3px;
    min-width: 0;
    padding: 6px 7px;
  }

  .fence-type-bubble-title {
    align-items: start;
    flex-direction: column;
    gap: 0;
  }

  .fence-type-bubble-title strong {
    font-size: 0.82rem;
  }

  .fence-type-bubble-title > span {
    font-size: 0.61rem;
  }

  .fence-type-description {
    display: -webkit-box;
    overflow: hidden;
    font-size: 0.68rem;
    line-height: 1.22;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .fence-type-best {
    overflow: hidden;
    font-size: 0.65rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .fence-type-price {
    padding-top: 3px;
    font-size: 0.75rem;
  }

  .fence-type-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px 5px;
    padding-top: 2px;
    font-size: 0.6rem;
  }

  .fence-type-detail-grid span {
    gap: 0;
  }

  .sidebar,
  .summary {
    gap: 8px;
  }

  .panel,
  .data-panel {
    padding: 11px;
  }

  .control-panel > summary {
    min-height: 43px;
    padding: 0 11px;
  }

  .control-panel > :not(summary) {
    margin-right: 11px;
    margin-left: 11px;
  }

  .control-panel > :last-child {
    margin-bottom: 10px;
  }

  .control-panel .section-title {
    margin-top: 10px;
  }

  .panel > * + * {
    margin-top: 8px;
  }

  input,
  select {
    min-height: 36px;
    padding: 6px 8px;
  }

  button {
    min-height: 36px;
  }

  .split-fields,
  .toggle-row,
  .button-grid {
    gap: 6px;
  }

  .checkbox-label {
    min-height: 34px;
    padding: 6px 8px;
  }

  .selected-fence-type {
    gap: 5px;
    padding: 10px;
  }

  .microcopy,
  .note {
    font-size: 0.73rem;
    line-height: 1.3;
  }

  [data-workspace-mode="satellite"] .sidebar .section-title,
  [data-workspace-mode="satellite"] .sidebar .microcopy {
    display: none;
  }

  [data-workspace-mode="satellite"] .canvas-column {
    grid-template-rows: minmax(0, 1fr);
  }

  [data-workspace-mode="grid"] .canvas-column {
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .canvas-column {
    gap: 10px;
  }

  .estimate-strip {
    gap: 8px;
  }

  .estimate-strip article {
    padding: 9px 10px;
  }

  .estimate-strip strong {
    font-size: 1.25rem;
  }

  .workspace-panel,
  .map-workspace-panel,
  .map-canvas-wrap,
  .plan-wrap {
    min-height: 0;
  }

  .map-workspace-panel {
    grid-template-rows: minmax(0, 1fr);
    height: 100%;
    gap: 8px;
  }

  .map-search-panel {
    padding: 10px;
  }

  .map-search-heading {
    margin-bottom: 6px;
  }

  #mapSearchInput,
  .map-search-form button {
    min-height: 60px;
  }

  .map-search-status {
    min-height: 0;
    margin-top: 4px;
  }

  .map-canvas-wrap {
    height: 100%;
  }

  .summary-panel dl {
    gap: 7px;
  }

  .summary-panel dt,
  .summary-panel dd {
    font-size: 0.82rem;
  }

  .media-dropzone {
    min-height: 86px;
    padding: 10px;
  }

  .media-dropzone strong {
    font-size: 0.82rem;
  }

  .media-dropzone span,
  .media-status,
  .media-empty {
    font-size: 0.7rem;
  }
}

.fence-type-heading {
  padding: 2px 2px 4px;
}

.fence-type-heading h2 {
  margin: 3px 0 6px;
  font-size: 1.15rem;
}

.fence-type-heading > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.fence-type-bubbles {
  display: grid;
  gap: 10px;
}

.fence-type-bubble {
  display: grid;
  min-height: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  color: var(--text);
  background: #ffffff;
  box-shadow: var(--shadow);
  text-align: left;
}

.fence-type-bubble:hover {
  border-color: #8eb9a6;
  background: #ffffff;
  transform: translateY(-1px);
}

.fence-type-bubble.is-selected {
  border-color: var(--accent);
  background: #f7fcf9;
  box-shadow: 0 0 0 3px rgba(8, 122, 85, 0.14);
}

.fence-type-bubble img {
  display: block;
  width: 100%;
  height: 132px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.fence-type-bubble-body {
  display: grid;
  gap: 6px;
  padding: 11px;
}

.fence-type-bubble-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.fence-type-bubble-title strong {
  font-size: 0.9rem;
}

.fence-type-bubble-title > span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
  white-space: nowrap;
}

.fence-type-description {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.fence-type-best {
  color: var(--accent-strong);
  font-size: 0.7rem;
  font-weight: 800;
}

.fence-type-price {
  border-top: 1px solid var(--line);
  padding-top: 7px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.fence-type-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.25;
}

.fence-type-detail-grid span {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.fence-type-detail-grid b {
  color: var(--text);
  font-size: 0.64rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.selected-fence-type {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  border: 1px solid rgba(7, 95, 68, 0.16);
  border-radius: 8px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(12, 120, 86, 0.08), rgba(31, 111, 178, 0.08)),
    #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.selected-fence-type span,
.selected-fence-type small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.selected-fence-type span {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.selected-fence-type strong {
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.1;
}

.selected-fence-type small {
  justify-self: start;
  border: 1px solid rgba(7, 95, 68, 0.16);
  border-radius: 999px;
  padding: 4px 8px;
  color: #075f44;
  background: rgba(236, 253, 245, 0.9);
}

.fence-setup-fields {
  gap: 9px;
}

.fence-setup-field {
  position: relative;
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  border: 1px solid #d7e4df;
  border-radius: 8px;
  padding: 10px;
  color: var(--text);
  background: #ffffff;
}

.fence-setup-field > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.035em;
}

.fence-setup-field input {
  min-height: 42px;
  border-color: #d7e4df;
  padding-right: 34px;
  background: #f8fbf9;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 900;
}

.fence-setup-field::after {
  position: absolute;
  top: 43px;
  right: 22px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  content: "ft";
  pointer-events: none;
}

.fence-setup-field small {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.3;
}

.fence-action-grid button {
  min-height: 42px;
}

.area-addon-list {
  display: grid;
  gap: 10px;
}

.area-addon-list label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid #d7e4df;
  border-radius: 7px;
  padding: 10px;
  background: #f7fbf9;
  font-size: 0.86rem;
  font-weight: 750;
}

.area-addon-list input {
  width: auto;
  margin-top: 2px;
}

.area-addon-list label > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.area-addon-list label strong {
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 900;
}

.area-addon-list label small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
}

.retaining-wall-guide {
  display: grid;
  gap: 9px;
  border: 1px solid rgba(124, 74, 45, 0.2);
  border-radius: 8px;
  padding: 11px;
  color: #3f2a1d;
  background: #fffaf4;
}

.retaining-wall-guide[hidden] {
  display: none;
}

.retaining-wall-guide div,
.retaining-wall-guide ul {
  margin: 0;
}

.retaining-wall-guide div {
  display: grid;
  gap: 3px;
}

.retaining-wall-guide strong {
  font-size: 0.84rem;
  font-weight: 950;
}

.retaining-wall-guide span,
.retaining-wall-guide li,
.retaining-wall-guide small {
  color: #6f4c33;
  font-size: 0.73rem;
  font-weight: 750;
  line-height: 1.35;
}

.retaining-wall-guide ul {
  padding-left: 18px;
}

.retaining-wall-options-panel {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(124, 74, 45, 0.22);
  border-radius: 8px;
  padding: 12px;
  background: linear-gradient(180deg, #fffaf4 0%, #ffffff 100%);
}

.retaining-wall-options-panel[hidden] {
  display: none;
}

.retaining-wall-designer-heading {
  border-color: rgba(124, 74, 45, 0.24);
  background: #fff7ed;
}

.retaining-wall-designer {
  display: grid;
  gap: 10px;
}

.retaining-wall-quick-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.retaining-wall-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.retaining-wall-choice {
  display: grid;
  gap: 5px;
  min-height: 92px;
  border: 1px solid #ead9c7;
  border-radius: 8px;
  padding: 11px;
  color: #3f2a1d;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.retaining-wall-choice:hover,
.retaining-wall-choice:focus-visible {
  border-color: rgba(124, 74, 45, 0.48);
  box-shadow: 0 10px 20px rgba(124, 74, 45, 0.1);
}

.retaining-wall-choice.is-selected {
  border-color: #7c4a2d;
  background: #fff4e8;
  box-shadow: inset 0 0 0 1px rgba(124, 74, 45, 0.16);
}

.retaining-wall-choice strong {
  font-size: 0.86rem;
  font-weight: 950;
}

.retaining-wall-choice span {
  color: #6f4c33;
  font-size: 0.74rem;
  font-weight: 750;
  line-height: 1.35;
}

.retaining-wall-check-grid {
  grid-template-columns: 1fr;
}

.retaining-wall-designer-note {
  margin: 0;
  box-shadow: none;
}

@media (max-width: 760px) {
  .retaining-wall-quick-stats,
  .retaining-wall-choice-grid {
    grid-template-columns: 1fr;
  }
}

.deck-options-panel {
  display: grid;
  gap: 10px;
  border: 1px solid #cfe0d9;
  border-radius: 8px;
  padding: 12px;
  background: #f6fbf8;
}

.deck-options-panel[hidden],
.porch-options-panel[hidden],
.concrete-options-panel[hidden],
.pool-options-panel[hidden],
.asphalt-options-panel[hidden],
.hot-tub-options-panel[hidden],
.sport-court-options-panel[hidden] {
  display: none;
}

.concrete-options-panel,
.pool-options-panel,
.asphalt-options-panel,
.hot-tub-options-panel,
.sport-court-options-panel {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(71, 85, 105, 0.18);
  border-radius: 8px;
  padding: 12px;
  background: linear-gradient(180deg, #f8fafc 0%, #f6fbf8 100%);
}

.pool-options-panel {
  border-color: rgba(14, 116, 144, 0.2);
  background: linear-gradient(180deg, #eefbff 0%, #f6fbf8 100%);
}

.hot-tub-options-panel {
  border-color: rgba(14, 116, 144, 0.2);
  background: linear-gradient(180deg, #f0fdfa 0%, #f8fafc 100%);
}

.asphalt-options-panel {
  border-color: rgba(48, 52, 59, 0.22);
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.sport-court-options-panel {
  border-color: rgba(29, 78, 216, 0.2);
  background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
}

.concrete-designer-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(71, 85, 105, 0.14);
  padding-bottom: 10px;
}

.concrete-designer-heading strong {
  display: block;
  color: #334155;
  font-size: 0.92rem;
  font-weight: 950;
}

.concrete-designer-heading span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.35;
}

.concrete-designer,
.pool-designer,
.asphalt-designer,
.hot-tub-designer,
.sport-court-designer,
.concrete-designer-section {
  display: grid;
  gap: 12px;
}

.sport-court-choice-grid,
.sport-court-line-grid,
.sport-court-check-grid {
  display: grid;
  gap: 8px;
}

.sport-court-choice-grid {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.sport-court-choice {
  display: grid;
  min-height: 72px;
  gap: 5px;
  border: 1px solid rgba(29, 78, 216, 0.2);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.sport-court-choice strong {
  font-size: 0.82rem;
  font-weight: 950;
}

.sport-court-choice span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
}

.sport-court-choice:hover,
.sport-court-choice:focus-visible,
.sport-court-choice.is-selected {
  border-color: #1d4ed8;
  background: #dbeafe;
  outline: none;
}

.sport-court-info-card {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(29, 78, 216, 0.18);
  border-radius: 10px;
  padding: 10px;
  background: #f8fafc;
}

.sport-court-info-card strong,
.sport-court-info-card span,
.sport-court-info-card small {
  display: block;
}

.sport-court-info-card strong {
  color: #172554;
  font-weight: 950;
}

.sport-court-info-card span,
.sport-court-info-card small {
  color: var(--muted);
  line-height: 1.35;
}

.sport-court-colorizer {
  gap: 14px;
}

.sport-court-color-toggle {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-height: 48px;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 8px;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.sport-court-color-toggle:hover {
  border-color: rgba(37, 99, 235, 0.35);
  background: #ffffff;
}

.sport-court-color-toggle:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.sport-court-color-toggle input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #2563eb;
}

.sport-court-color-toggle strong,
.sport-court-color-toggle small {
  display: block;
}

.sport-court-color-toggle strong {
  color: #172554;
  font-size: 0.86rem;
  font-weight: 950;
}

.sport-court-color-toggle small {
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 700;
  line-height: 1.35;
}

.sport-court-color-options {
  display: grid;
  gap: 12px;
}

.sport-court-color-empty,
.sport-court-color-note {
  margin: 0;
  padding: 10px 12px;
  border: 1px dashed rgba(37, 99, 235, 0.28);
  border-radius: 8px;
  background: rgba(239, 246, 255, 0.72);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.4;
}

.sport-court-color-group {
  display: grid;
  gap: 7px;
}

.sport-court-color-group.is-disabled {
  opacity: 0.6;
}

.sport-court-color-heading {
  display: grid;
  gap: 2px;
}

.sport-court-color-heading strong {
  color: #172554;
  font-size: 0.8rem;
  font-weight: 950;
}

.sport-court-color-heading small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
}

.sport-court-swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 7px;
}

.sport-court-swatch {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  min-height: 44px;
  gap: 8px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 8px;
  padding: 7px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.sport-court-swatch:disabled {
  cursor: not-allowed;
}

.sport-court-swatch-color {
  width: 26px;
  height: 26px;
  border: 1px solid rgba(15, 23, 42, 0.22);
  border-radius: 6px;
  background: var(--swatch-color);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.sport-court-swatch span:last-child {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.2;
}

.sport-court-swatch:hover,
.sport-court-swatch:focus-visible,
.sport-court-swatch.is-selected {
  border-color: #1d4ed8;
  background: #eff6ff;
  outline: none;
}

.sport-court-swatch:focus-visible {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.sport-court-inline-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 40px;
  border: 1px solid rgba(29, 78, 216, 0.22);
  border-radius: 6px;
  padding: 0 13px;
  color: #1d4ed8;
  background: #eff6ff;
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
}

.sport-court-inline-link:hover,
.sport-court-inline-link:focus-visible {
  border-color: #1d4ed8;
  background: #dbeafe;
  outline: none;
}

.sport-court-fence-section {
  gap: 10px;
}

.sport-court-fence-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.sport-court-fence-option {
  display: grid;
  gap: 5px;
  min-height: 78px;
  border: 1px solid rgba(51, 65, 85, 0.2);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.sport-court-fence-option strong,
.sport-court-fence-option span {
  display: block;
}

.sport-court-fence-option strong {
  color: #172554;
  font-size: 0.82rem;
  font-weight: 950;
}

.sport-court-fence-option span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
}

.sport-court-fence-option:hover,
.sport-court-fence-option:focus-visible,
.sport-court-fence-option.is-selected {
  border-color: #1d4ed8;
  background: #eff6ff;
  outline: none;
}

.sport-court-fence-option.is-selected {
  box-shadow: inset 0 0 0 1px rgba(29, 78, 216, 0.42);
}

.sport-court-fence-option:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  background: #f8fafc;
}

@media (max-width: 520px) {
  .sport-court-fence-options {
    grid-template-columns: 1fr;
  }
}

.sport-court-overlay-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.sport-court-overlay-card {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 10px;
  padding: 10px;
  background: #f8fafc;
}

.sport-court-overlay-card strong,
.sport-court-overlay-card small {
  display: block;
}

.sport-court-overlay-card small {
  margin-top: 2px;
  color: var(--muted);
  line-height: 1.35;
}

.sport-court-overlay-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.sport-court-overlay-fields input {
  width: 100%;
}

.option-field-with-info {
  display: grid;
  gap: 5px;
}

.option-field-with-info > span:first-child {
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 850;
}

.field-control-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
}

.field-control-row .option-info-button {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
}

.pool-entry-picker {
  display: grid;
  gap: 8px;
}

.pool-entry-heading {
  display: grid;
  gap: 2px;
}

.pool-entry-heading h4 {
  margin: 0;
  color: #0f3f5f;
  font-size: 0.78rem;
  font-weight: 950;
}

.pool-entry-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.35;
}

.pool-entry-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.pool-entry-card {
  position: relative;
  display: grid;
  border: 1px solid #d5e7f0;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.pool-entry-card.is-selected {
  border-color: #0ea5e9;
  box-shadow: 0 10px 22px rgba(14, 165, 233, 0.16);
}

.pool-entry-card-button {
  display: grid;
  min-height: 100%;
  border: 0;
  border-radius: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.pool-entry-card-button:focus-visible {
  outline: 3px solid rgba(14, 165, 233, 0.38);
  outline-offset: -3px;
}

.pool-entry-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.pool-entry-card-copy {
  display: grid;
  gap: 4px;
  padding: 8px;
  padding-right: 42px;
}

.pool-entry-card-copy strong {
  color: #0f3f5f;
  font-size: 0.76rem;
  font-weight: 950;
  line-height: 1.2;
}

.pool-entry-card-copy small,
.pool-entry-card-copy em {
  color: var(--muted);
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 750;
  line-height: 1.3;
}

.pool-entry-card-copy small {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.pool-entry-card .option-info-button {
  position: absolute;
  right: 7px;
  bottom: 7px;
}

#poolDesigner .concrete-quick-stats,
#poolDesigner .split-fields,
#poolDesigner .button-grid,
#poolDesigner .pool-entry-card-grid {
  grid-template-columns: 1fr;
}

.concrete-designer-section {
  gap: 9px;
}

.concrete-designer-section-head {
  display: grid;
  gap: 2px;
}

.concrete-designer-section h3 {
  margin: 0;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 950;
}

.concrete-designer-section p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
}

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

.concrete-quick-stats > div {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(71, 85, 105, 0.14);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.concrete-quick-stats span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.035em;
}

.concrete-quick-stats strong {
  color: #0f172a;
  font-size: 1rem;
  font-weight: 950;
}

.concrete-option-card-grid,
.concrete-check-grid {
  display: grid;
  gap: 8px;
}

.concrete-earthwork-section {
  border: 1px solid rgba(71, 85, 105, 0.16);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.concrete-earthwork-empty {
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 10px;
  color: var(--muted);
  background: #f8fafc;
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.35;
}

.concrete-earthwork-results,
.concrete-terrain-results {
  display: grid;
  gap: 8px;
}

.concrete-earthwork-results > div,
.concrete-terrain-results > div {
  display: grid;
  gap: 3px;
  border: 1px solid #d5dde8;
  border-radius: 8px;
  padding: 9px;
  background: #f8fafc;
}

.concrete-earthwork-results span,
.concrete-terrain-results span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.035em;
}

.concrete-earthwork-results strong,
.concrete-terrain-results strong {
  color: #0f172a;
  font-size: 0.92rem;
  font-weight: 950;
}

.concrete-earthwork-results small,
.concrete-terrain-results small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
  line-height: 1.3;
}

.concrete-earthwork-results.is-stale > div {
  border-color: #f2c94c;
  background: #fffdf0;
}

.concrete-earthwork-warning {
  margin: 0;
  border-left: 3px solid #b7791f;
  padding: 7px 9px;
  color: #5f370e;
  background: #fff8e1;
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.35;
}

.concrete-option-card,
.concrete-check-card {
  border-color: #d5dde8;
}

.concrete-option-card.is-selected {
  border-color: #475569;
  box-shadow: 0 8px 18px rgba(71, 85, 105, 0.13);
}

.concrete-option-card strong,
.concrete-check-card strong {
  color: #263241;
}

.concrete-info-button {
  color: #334155;
  border-color: rgba(71, 85, 105, 0.24);
  background: #f1f5f9;
}

.concrete-info-button:hover,
.concrete-info-button:focus-visible {
  color: #ffffff;
  border-color: #475569;
  background: #475569;
}

.hot-tub-more-details {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(14, 116, 144, 0.16);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.hot-tub-more-details summary {
  cursor: pointer;
  color: #0f5f6f;
  font-size: 0.82rem;
  font-weight: 950;
}

.hot-tub-more-details[open] summary {
  margin-bottom: 8px;
}

.porch-options-panel {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(120, 53, 15, 0.18);
  border-radius: 8px;
  padding: 12px;
  background: linear-gradient(180deg, #fffaf4 0%, #f8fbf8 100%);
}

.porch-designer-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(120, 53, 15, 0.12);
  padding-bottom: 10px;
}

.porch-designer-heading strong {
  display: block;
  color: #5a2e0c;
  font-size: 0.92rem;
  font-weight: 950;
}

.porch-designer-heading span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.35;
}

.porch-designer {
  display: grid;
  gap: 12px;
}

.porch-designer-section {
  display: grid;
  gap: 9px;
}

.porch-designer-section-head {
  display: grid;
  gap: 2px;
}

.porch-designer-section h3 {
  margin: 0;
  color: #5a2e0c;
  font-size: 0.82rem;
  font-weight: 950;
}

.porch-designer-section p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
}

.porch-option-card-grid {
  display: grid;
  gap: 8px;
}

.porch-option-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
  border: 1px solid #ead7c2;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.porch-option-card.is-selected {
  border-color: #9a5f24;
  box-shadow: 0 8px 18px rgba(154, 95, 36, 0.12);
}

.porch-option-card > button:first-child {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-height: 74px;
  border: 0;
  border-radius: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.porch-option-card img {
  width: 82px;
  height: 100%;
  min-height: 74px;
  object-fit: cover;
}

.porch-option-card span {
  display: grid;
  gap: 3px;
  padding: 8px 0;
  min-width: 0;
}

.porch-option-card strong {
  color: #4a2a0d;
  font-size: 0.78rem;
  font-weight: 950;
}

.porch-option-card small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.option-info-button {
  align-self: center;
  justify-self: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  border: 1px solid rgba(120, 53, 15, 0.24);
  border-radius: 999px;
  padding: 0;
  color: #78350f;
  background: #fff7ed;
  font-size: 0.82rem;
  font-weight: 950;
}

.option-info-button:hover,
.option-info-button:focus-visible {
  color: #ffffff;
  border-color: #9a5f24;
  background: #9a5f24;
}

.porch-select-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.porch-allowance-grid {
  display: grid;
  gap: 8px;
}

.porch-allowance-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid #ead7c2;
  border-radius: 8px;
  padding: 9px;
  background: #ffffff;
}

.porch-allowance-card label {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin: 0;
}

.porch-allowance-card input {
  width: auto;
  margin-top: 3px;
}

.porch-allowance-card span {
  display: grid;
  gap: 2px;
}

.porch-allowance-card strong {
  color: #4a2a0d;
  font-size: 0.76rem;
  font-weight: 950;
}

.porch-allowance-card small {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.25;
}

.porch-feature-item .deck-stair-actions {
  min-width: 92px;
}

.porch-edge-action-menu button {
  text-align: left;
}

.option-info-dialog {
  width: min(760px, calc(100vw - 28px));
  border: 0;
  border-radius: 12px;
  padding: 0;
  background: transparent;
}

.option-info-dialog::backdrop {
  background: rgba(15, 23, 42, 0.52);
}

.option-info-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(0, 1.15fr);
  overflow: hidden;
  border: 1px solid rgba(120, 53, 15, 0.18);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.option-info-media {
  min-height: 100%;
  background: #fff7ed;
}

.option-info-media img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
}

.option-info-body {
  display: grid;
  gap: 12px;
  padding: 22px;
}

.option-info-kicker {
  color: #9a5f24;
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.option-info-body h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.25rem;
}

.option-info-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.option-info-cost,
.option-info-pros-cons > div {
  display: grid;
  gap: 5px;
  border: 1px solid #ead7c2;
  border-radius: 8px;
  padding: 10px;
  background: #fffaf4;
}

.option-info-cost strong,
.option-info-pros-cons strong {
  color: #5a2e0c;
  font-size: 0.76rem;
  font-weight: 950;
}

.option-info-cost span {
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.35;
}

.option-info-pros-cons {
  display: grid;
  gap: 8px;
}

.option-info-pros-cons ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.option-info-card menu {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  margin: 0;
  border-top: 1px solid #ead7c2;
  padding: 12px 16px;
  background: #fffaf4;
}

@media (max-width: 680px) {
  .option-info-card {
    grid-template-columns: 1fr;
  }

  .option-info-media img {
    min-height: 180px;
    max-height: 240px;
  }

  .option-info-body {
    padding: 16px;
  }
}

.deck-options-panel .button-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.deck-item-controls {
  display: grid;
  gap: 9px;
  border: 1px solid rgba(139, 94, 52, 0.14);
  border-radius: 8px;
  padding: 10px;
  background: #fffaf3;
}

.area-item-controls[hidden] {
  display: none;
}

.deck-item-controls-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.deck-item-controls-header > div {
  display: grid;
  gap: 2px;
}

.deck-item-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.deck-item-controls-header strong {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 900;
}

.deck-item-controls-header span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.deck-item-controls-header .text-button {
  min-height: 36px;
  border: 1px solid rgba(139, 94, 52, 0.28);
  border-radius: 999px;
  padding: 0 11px;
  color: #6b3f1f;
  background: #ffffff;
  font-size: 0.75rem;
  font-weight: 900;
}

.deck-item-controls-header .text-button:hover,
.deck-item-controls-header .text-button:focus-visible {
  color: #ffffff;
  border-color: #8b5e34;
  background: #8b5e34;
}

.deck-item-controls-header .text-button.danger {
  border-color: rgba(185, 28, 28, 0.22);
  color: #991b1b;
}

.deck-item-controls-header .text-button.danger:hover,
.deck-item-controls-header .text-button.danger:focus-visible {
  color: #ffffff;
  border-color: #991b1b;
  background: #991b1b;
}

.deck-item-controls-header .text-button:disabled {
  opacity: 0.46;
  cursor: not-allowed;
}

.deck-item-controls-header .text-button:disabled:hover,
.deck-item-controls-header .text-button:disabled:focus-visible {
  color: #6b3f1f;
  border-color: rgba(139, 94, 52, 0.28);
  background: #ffffff;
}

.deck-item-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.deck-item-tabs button {
  min-height: 36px;
  border: 1px solid rgba(139, 94, 52, 0.18);
  border-radius: 999px;
  padding: 7px 10px;
  color: #5a3719;
  background: #ffffff;
  font-size: 0.72rem;
  font-weight: 850;
}

.deck-item-tabs button.is-selected,
.deck-item-tabs button:hover,
.deck-item-tabs button:focus-visible {
  color: #ffffff;
  border-color: #8b5e34;
  background: #8b5e34;
}

.deck-suggestion-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.deck-suggestion-row span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.deck-suggestion-row button {
  min-height: 34px;
  border: 1px solid #cfe0d9;
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--text);
  background: #ffffff;
  font-size: 0.78rem;
  font-weight: 850;
}

.deck-suggestion-row button.is-selected,
.deck-suggestion-row button:hover,
.deck-suggestion-row button:focus-visible {
  color: #ffffff;
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

.deck-field-note {
  align-self: end;
  min-height: 42px;
  border: 1px dashed #cfe0d9;
  border-radius: 7px;
  padding: 9px 10px;
  color: var(--muted);
  background: #ffffff;
  font-size: 0.75rem;
  font-weight: 750;
  line-height: 1.35;
}

.deck-options-panel button.is-active {
  color: #ffffff;
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

.deck-stair-list {
  display: grid;
  gap: 8px;
}

.deck-stair-empty {
  border: 1px dashed #c8d9d1;
  border-radius: 7px;
  padding: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  text-align: center;
}

.deck-stair-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid #d7e4df;
  border-radius: 7px;
  padding: 10px;
  background: #ffffff;
}

.deck-stair-item.is-selected {
  border-color: rgba(139, 94, 52, 0.44);
  background: #fffaf3;
  box-shadow: 0 8px 18px rgba(139, 94, 52, 0.1);
}

.deck-stair-actions {
  display: grid;
  gap: 6px;
  min-width: 74px;
}

.deck-stair-item strong,
.deck-stair-item span,
.deck-stair-item small {
  display: block;
}

.deck-stair-item span {
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 750;
}

.deck-stair-item small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

[data-project-mode="fence"] .area-setup-panel,
[data-project-measurement="area_polygon"] #fenceSetupPanel,
[data-project-measurement="line_height"] #fenceSetupPanel,
[data-project-measurement="area_polygon"] #gatePanel,
[data-project-measurement="line_height"] #gatePanel,
[data-project-measurement="area_polygon"] #finishFenceButton,
[data-project-measurement="line_height"] #finishFenceButton,
[data-project-measurement="area_polygon"] #clearPlanButton,
[data-project-measurement="line_height"] #clearPlanButton,
[data-project-measurement="area_polygon"] #calculateGradeButton,
[data-project-measurement="line_height"] #calculateGradeButton,
[data-project-measurement="area_polygon"] #openGradeProfileButton {
  display: none;
}

[data-project-measurement="line_height"] #openGradeProfileButton {
  display: none;
}

[data-project-measurement="area_polygon"] .map-grade-status,
[data-project-measurement="line_height"] .map-grade-status {
  display: none;
}

.panel,
.data-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.control-panel {
  padding: 0;
  overflow: clip;
}

.control-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  padding: 0 14px;
  cursor: pointer;
  list-style: none;
}

.control-panel > summary::-webkit-details-marker {
  display: none;
}

.control-panel > summary::after {
  color: var(--muted);
  content: "+";
  font-size: 1.1rem;
  font-weight: 800;
}

.control-panel[open] > summary::after {
  content: "−";
}

.control-panel > summary span {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 850;
}

.control-panel > summary small {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  text-align: right;
}

.control-panel[open] > summary {
  border-bottom: 1px solid var(--line);
  background: #fbfdfc;
}

.control-panel > :not(summary) {
  margin-right: 14px;
  margin-left: 14px;
}

.control-panel > :last-child {
  margin-bottom: 14px;
}

.control-panel .section-title {
  margin-top: 14px;
}

.feature-parked {
  display: none !important;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.section-title h2 {
  margin: 0;
  font-size: 1rem;
}

.section-title span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.split-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.panel > * + *,
.dialog-body > * + * {
  margin-top: 12px;
}

.toggle-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  color: var(--text);
  background: #ffffff;
}

.checkbox-label input {
  width: auto;
  min-height: auto;
}

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

.fence-grade-tools {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.fence-grade-tools-heading {
  display: grid;
  gap: 3px;
}

.fence-grade-tools-heading strong {
  color: var(--text);
  font-size: 0.88rem;
}

.fence-grade-tools-heading span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.35;
}

.fence-grade-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.fence-grade-actions button {
  min-height: 44px;
  padding: 0 10px;
  font-size: 0.78rem;
}

.fence-grade-actions .map-grade-button {
  border-color: var(--action);
  background: var(--action);
}

.fence-grade-actions .map-grade-button:hover,
.fence-grade-actions .map-grade-button:focus-visible {
  background: var(--action-strong);
}

.canvas-column {
  display: grid;
  grid-template-rows: auto auto minmax(360px, 1fr) auto auto auto;
  gap: 14px;
}

.canvas-column > * {
  min-width: 0;
}

.estimate-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.estimate-strip article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.estimate-strip article:last-child {
  color: #ffffff;
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

.estimate-strip article:last-child span {
  color: rgba(255, 255, 255, 0.76);
}

.design-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 3px 2px 0;
}

.design-toolbar h2 {
  margin: 2px 0 0;
  font-size: 1.15rem;
}

.estimate-strip span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.estimate-strip strong {
  display: block;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.15rem, 2vw, 1.6rem);
  line-height: 1.1;
}

.plan-wrap {
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #edf5f1;
  box-shadow: var(--shadow);
}

.workspace-tabs {
  display: flex;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 3px;
  background: #ffffff;
}

.workspace-tabs[hidden] {
  display: none;
}

.workspace-mode-badge {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.workspace-tabs button {
  min-height: 36px;
  color: var(--muted);
  border-color: transparent;
  border-bottom-color: transparent;
  border-radius: 5px;
  background: transparent;
}

.workspace-tabs button:hover {
  color: var(--text);
  background: var(--surface-strong);
}

.workspace-tabs button.is-active {
  color: #ffffff;
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

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

.map-workspace-panel {
  display: grid;
  gap: 12px;
}

.map-search-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
  box-shadow: var(--shadow-strong);
}

.map-search-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.map-search-heading strong {
  font-size: 0.95rem;
}

.map-search-heading span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
}

.map-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.map-search-field {
  display: block;
}

#mapSearchInput {
  min-height: 62px;
  border-width: 2px;
  padding: 0 18px;
  font-size: 1.05rem;
  font-weight: 700;
}

.map-search-form button {
  border-color: var(--action);
  min-width: 150px;
  min-height: 62px;
  padding: 0 22px;
  background: var(--action);
  font-weight: 850;
}

.map-search-form button:hover {
  border-color: var(--action-strong);
  background: var(--action-strong);
}

.map-search-form button.is-loading::before {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 9px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  border-radius: 50%;
  content: "";
  vertical-align: -2px;
  animation: search-spin 700ms linear infinite;
}

.map-search-status {
  min-height: 18px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.map-search-status[data-tone="error"] {
  color: var(--danger);
}

.map-search-status[data-tone="success"] {
  color: var(--accent-strong);
}

.map-search-results {
  position: relative;
  z-index: 5;
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.map-search-result {
  display: grid;
  gap: 2px;
  min-height: 0;
  padding: 11px 12px;
  color: var(--text);
  border-color: var(--line);
  text-align: left;
  background: #ffffff;
}

.map-search-result:hover {
  background: var(--surface-strong);
}

.map-search-result span {
  color: var(--muted);
  font-size: 0.78rem;
}

.drawing-surface-switcher {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef5f1;
}

.drawing-surface-switcher button {
  min-height: 42px;
  border-color: transparent;
  color: var(--muted);
  background: transparent;
  font-weight: 850;
}

.drawing-surface-switcher button.is-active {
  color: #ffffff;
  border-color: var(--action);
  background: var(--action);
  box-shadow: 0 8px 18px rgba(23, 94, 72, 0.18);
}

.drawing-surface-content[hidden] {
  display: none;
}

.map-workspace-panel > .drawing-surface-content:not([hidden]) {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
  height: 100%;
}

.map-canvas-wrap {
  position: relative;
  min-height: clamp(600px, 68vh, 820px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #dce8e2;
  box-shadow: var(--shadow-strong);
}

.map-action-toolbar {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 8;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  width: min(292px, calc(100% - 76px));
  border: 1px solid rgba(199, 213, 207, 0.96);
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 30px rgba(13, 48, 35, 0.18);
}

.map-action-toolbar button {
  min-height: 46px;
  padding: 0 10px;
  font-size: 0.78rem;
}

.map-action-toolbar .map-history-button {
  font-size: 0.92rem;
}

.map-action-toolbar .map-wall-action-button {
  border-color: rgba(124, 74, 45, 0.24);
  color: #6f3d1f;
  background: #fff7ed;
}

.map-action-toolbar .map-wall-action-button:hover,
.map-action-toolbar .map-wall-action-button:focus-visible {
  color: #ffffff;
  border-color: #7c4a2d;
  background: #7c4a2d;
}

.map-action-toolbar .map-wall-action-button.danger {
  border-color: rgba(185, 28, 28, 0.24);
  color: #991b1b;
  background: #fff1f2;
}

.map-action-toolbar .map-wall-action-button.danger:hover,
.map-action-toolbar .map-wall-action-button.danger:focus-visible {
  color: #ffffff;
  border-color: #991b1b;
  background: #991b1b;
}

.mobile-add-gate-button {
  display: none;
}

.map-mode-action-button {
  display: none;
}

.map-grade-status {
  grid-column: 1 / -1;
  display: none;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.3;
}

.map-grade-status:not(:empty) {
  display: block;
}

.map-grade-status[data-tone="error"] {
  color: var(--danger);
}

.map-grade-status[data-tone="success"] {
  color: var(--accent-strong);
}

.map-grade-status[data-tone="warning"] {
  color: #8a5a00;
}

.section-action-menu,
.area-point-action-menu {
  position: fixed;
  z-index: 30;
  display: grid;
  gap: 8px;
  width: min(230px, calc(100vw - 16px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: #ffffff;
  box-shadow: 0 14px 38px rgba(21, 34, 29, 0.2);
}

.section-action-menu[hidden],
.area-point-action-menu[hidden] {
  display: none;
}

.section-action-menu strong,
.area-point-action-menu strong {
  font-size: 0.92rem;
}

.section-action-menu span,
.area-point-action-menu span {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.section-action-menu button,
.area-point-action-menu button {
  width: 100%;
}

.map-canvas {
  position: absolute;
  inset: 0;
}

.map-canvas.mapboxgl-map {
  position: absolute;
  width: 100%;
  height: 100%;
}

.map-fallback {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 28px;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.5;
  text-align: center;
  background: #edf5f1;
}

.map-fallback[hidden] {
  display: none;
}

.uploaded-plan-surface {
  display: grid;
  grid-template-rows: auto minmax(500px, 1fr);
  gap: 12px;
  min-height: clamp(650px, 72vh, 880px);
}

.uploaded-plan-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(180px, 0.9fr) minmax(260px, 1.1fr);
  gap: 10px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(17, 44, 36, 0.08);
}

.uploaded-plan-control-heading,
.uploaded-plan-upload,
.uploaded-plan-scale-card {
  display: grid;
  gap: 6px;
  align-content: center;
}

.uploaded-plan-control-heading strong,
.uploaded-plan-upload strong,
.uploaded-plan-scale-card strong {
  color: var(--text);
  font-size: 0.95rem;
}

.uploaded-plan-control-heading span,
.uploaded-plan-upload span,
.uploaded-plan-scale-card span,
.uploaded-plan-status {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.uploaded-plan-upload {
  min-height: 86px;
  border: 1px dashed rgba(20, 91, 70, 0.38);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  background: #f6fbf8;
}

.uploaded-plan-upload input {
  width: 100%;
  margin-top: 4px;
  font-size: 0.78rem;
}

.uploaded-plan-fields,
.uploaded-plan-scale-actions,
.uploaded-plan-view-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.uploaded-plan-fields label,
.uploaded-plan-scale-actions label {
  display: grid;
  gap: 4px;
  min-width: 96px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.uploaded-plan-scale-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-strong);
}

.uploaded-plan-scale-actions button,
.uploaded-plan-view-actions button {
  min-height: 40px;
  padding: 0 12px;
  font-size: 0.78rem;
}

.uploaded-plan-scale-actions input {
  width: 86px;
}

.uploaded-plan-status {
  min-height: 18px;
  margin: 0;
  font-weight: 750;
}

.uploaded-plan-status[data-tone="error"],
#uploadedPlanScaleStatus[data-tone="error"] {
  color: var(--danger);
}

.uploaded-plan-status[data-tone="success"],
#uploadedPlanScaleStatus[data-tone="success"] {
  color: var(--accent-strong);
}

.uploaded-plan-status[data-tone="warning"],
#uploadedPlanScaleStatus[data-tone="warning"] {
  color: #8a5a00;
}

.uploaded-plan-canvas-wrap {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(45deg, rgba(15, 61, 49, 0.04) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(15, 61, 49, 0.04) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(15, 61, 49, 0.04) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(15, 61, 49, 0.04) 75%),
    #f8fbf9;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
  box-shadow: var(--shadow-strong);
}

.uploaded-plan-canvas,
.uploaded-plan-stage,
.uploaded-plan-svg {
  width: 100%;
  height: 100%;
  min-height: 520px;
}

.uploaded-plan-svg {
  display: block;
  touch-action: none;
  cursor: crosshair;
}

.uploaded-plan-stage.is-calibrating .uploaded-plan-svg {
  cursor: cell;
}

.uploaded-plan-empty-bg {
  fill: rgba(230, 239, 235, 0.92);
}

.uploaded-plan-area,
.uploaded-plan-area-line,
.uploaded-plan-fence-line {
  filter: url(#uploadedPlanLabelShadow);
}

.uploaded-plan-segment-hit,
.uploaded-plan-fence-hit {
  stroke: transparent;
  stroke-width: 28;
  stroke-linecap: round;
  cursor: pointer;
}

.uploaded-plan-point {
  fill: #ffffff;
  stroke: var(--action);
  stroke-width: 3;
  cursor: grab;
  filter: url(#uploadedPlanLabelShadow);
}

.uploaded-plan-point:active {
  cursor: grabbing;
}

.uploaded-plan-point.is-area {
  stroke: #1f6fb2;
}

.uploaded-plan-pole {
  fill: #ffffff;
  stroke: #123c33;
  stroke-width: 2;
}

.uploaded-plan-gate-marker {
  fill: #ffffff;
  stroke: #ac6a00;
  stroke-width: 4;
}

.uploaded-plan-label,
.uploaded-plan-mini-label {
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 5px;
  stroke-linejoin: round;
  font-weight: 850;
  pointer-events: none;
}

.uploaded-plan-label {
  font-size: 18px;
}

.uploaded-plan-mini-label {
  fill: #123c33;
  font-size: 14px;
}

.uploaded-plan-preview-line,
.uploaded-plan-calibration-line {
  fill: none;
  stroke: #0f766e;
  stroke-width: 3;
  stroke-dasharray: 10 8;
}

.uploaded-plan-calibration-point {
  fill: #fff7ed;
  stroke: #b45309;
  stroke-width: 4;
}

@media (max-width: 1180px) {
  .uploaded-plan-controls {
    grid-template-columns: 1fr;
  }
}

.map-gate-marker {
  min-height: 28px;
  padding: 4px 8px;
  color: var(--accent-strong);
  border: 2px solid var(--accent-strong);
  border-radius: 5px;
  background: #ffffff;
  box-shadow: 0 3px 12px rgba(21, 34, 29, 0.24);
  cursor: grab;
  touch-action: none;
  user-select: none;
  white-space: nowrap;
  transition:
    color 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
  backface-visibility: hidden;
  will-change: transform;
}

.map-gate-marker:hover,
.map-gate-marker:focus-visible,
.map-gate-marker:active {
  color: var(--accent-strong);
  border-color: var(--accent-strong);
  background: #ffffff;
}

.map-gate-marker:active {
  cursor: grabbing;
  box-shadow: 0 2px 8px rgba(21, 34, 29, 0.2);
}

.map-deck-stair-marker,
.map-deck-stair-handle {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  padding: 0;
  color: #5a3719;
  background: transparent;
  box-shadow: none;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.map-deck-stair-marker::before,
.map-deck-stair-handle::before {
  display: block;
  width: 20px;
  height: 20px;
  border: 2px solid #6b3f1f;
  border-radius: 999px;
  background:
    linear-gradient(90deg, transparent 45%, rgba(90, 55, 25, 0.55) 45%, rgba(90, 55, 25, 0.55) 55%, transparent 55%),
    linear-gradient(0deg, transparent 45%, rgba(90, 55, 25, 0.55) 45%, rgba(90, 55, 25, 0.55) 55%, transparent 55%),
    #fff8ed;
  box-shadow: 0 2px 8px rgba(60, 38, 18, 0.24);
  content: "";
  transition:
    width 160ms ease,
    height 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.map-deck-stair-marker:hover,
.map-deck-stair-marker:focus-visible,
.map-deck-stair-handle:hover,
.map-deck-stair-handle:focus-visible,
.map-deck-stair-marker.is-selected,
.map-deck-stair-handle.is-selected {
  outline: none;
}

.map-deck-stair-marker:hover::before,
.map-deck-stair-marker:focus-visible::before,
.map-deck-stair-handle:hover::before,
.map-deck-stair-handle:focus-visible::before {
  width: 24px;
  height: 24px;
  border-color: #8b5e34;
  background: #fce9c8;
  box-shadow:
    0 0 0 4px rgba(139, 94, 52, 0.18),
    0 3px 10px rgba(60, 38, 18, 0.28);
}

.map-deck-stair-marker.is-selected::before,
.map-deck-stair-handle.is-selected::before {
  width: 22px;
  height: 22px;
  border-color: #8b5e34;
  background:
    linear-gradient(90deg, transparent 45%, rgba(90, 55, 25, 0.58) 45%, rgba(90, 55, 25, 0.58) 55%, transparent 55%),
    linear-gradient(0deg, transparent 45%, rgba(90, 55, 25, 0.58) 45%, rgba(90, 55, 25, 0.58) 55%, transparent 55%),
    #fce9c8;
  box-shadow:
    0 0 0 4px rgba(139, 94, 52, 0.2),
    0 3px 10px rgba(60, 38, 18, 0.28);
}

.map-deck-stair-marker.is-porch-stair::before,
.map-deck-stair-handle.is-porch-stair::before {
  border-color: #78350f;
  background:
    linear-gradient(90deg, transparent 45%, rgba(120, 53, 15, 0.52) 45%, rgba(120, 53, 15, 0.52) 55%, transparent 55%),
    linear-gradient(0deg, transparent 45%, rgba(120, 53, 15, 0.52) 45%, rgba(120, 53, 15, 0.52) 55%, transparent 55%),
    #fff7ed;
}

.map-porch-column-marker {
  display: grid;
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: transparent;
  cursor: grab;
  touch-action: none;
}

.map-porch-column-marker::before {
  display: block;
  width: 16px;
  height: 16px;
  border: 3px solid #78350f;
  border-radius: 4px;
  background: #fff7ed;
  box-shadow: 0 2px 8px rgba(60, 38, 18, 0.25);
  content: "";
}

.map-porch-column-marker:hover::before,
.map-porch-column-marker:focus-visible::before {
  border-color: #9a5f24;
  background: #fed7aa;
  box-shadow:
    0 0 0 4px rgba(154, 95, 36, 0.18),
    0 3px 10px rgba(60, 38, 18, 0.28);
}

.map-hot-tub-marker {
  display: grid;
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: transparent;
  cursor: grab;
  touch-action: none;
}

.map-hot-tub-marker::before {
  display: block;
  width: 14px;
  height: 14px;
  border: 3px solid #0e7490;
  border-radius: 5px;
  background: #ecfeff;
  box-shadow: 0 2px 8px rgba(8, 47, 73, 0.24);
  content: "";
}

.map-hot-tub-marker:hover::before,
.map-hot-tub-marker:focus-visible::before {
  border-color: #155e75;
  background: #cffafe;
  box-shadow:
    0 0 0 4px rgba(14, 116, 144, 0.18),
    0 3px 10px rgba(8, 47, 73, 0.28);
}

.map-hot-tub-marker:active {
  cursor: grabbing;
}

.map-sport-court-marker {
  display: grid;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: transparent;
  cursor: grab;
  touch-action: none;
}

.map-sport-court-marker.is-inactive {
  cursor: pointer;
}

.map-sport-court-marker::before {
  display: block;
  width: 13px;
  height: 13px;
  border: 3px solid #1d4ed8;
  border-radius: 4px;
  background: #eff6ff;
  box-shadow: 0 2px 8px rgba(30, 64, 175, 0.24);
  content: "";
}

.map-sport-court-marker.is-inactive::before {
  width: 11px;
  height: 11px;
  border-width: 2px;
  border-color: rgba(29, 78, 216, 0.72);
  background: rgba(239, 246, 255, 0.72);
  box-shadow: 0 1px 5px rgba(30, 64, 175, 0.16);
}

.map-sport-court-marker:hover::before,
.map-sport-court-marker:focus-visible::before {
  border-color: #1e3a8a;
  background: #dbeafe;
  box-shadow:
    0 0 0 4px rgba(29, 78, 216, 0.18),
    0 3px 10px rgba(30, 64, 175, 0.28);
}

.map-sport-court-marker:active {
  cursor: grabbing;
}

.map-sport-court-marker.is-inactive:active {
  cursor: pointer;
}

.map-sport-court-rotate-marker,
.map-sport-court-overlay-marker {
  display: grid;
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: transparent;
  cursor: grab;
  touch-action: none;
}

.map-sport-court-rotate-marker::before {
  display: block;
  width: 10px;
  height: 10px;
  border: 2px solid #1e3a8a;
  border-radius: 999px;
  background: #fde68a;
  box-shadow:
    0 0 0 3px rgba(250, 204, 21, 0.35),
    0 2px 7px rgba(30, 58, 138, 0.22);
  content: "";
}

.map-sport-court-overlay-marker::before {
  display: block;
  width: 12px;
  height: 12px;
  border: 2px solid #0f172a;
  border-radius: 999px;
  background: #ffffff;
  box-shadow:
    0 0 0 3px rgba(248, 250, 252, 0.7),
    0 2px 7px rgba(15, 23, 42, 0.22);
  content: "";
}

.map-sport-court-rotate-marker:hover::before,
.map-sport-court-rotate-marker:focus-visible::before,
.map-sport-court-overlay-marker:hover::before,
.map-sport-court-overlay-marker:focus-visible::before {
  transform: scale(1.12);
}

.map-sport-court-rotate-marker:active,
.map-sport-court-overlay-marker:active {
  cursor: grabbing;
}

.map-deck-stair-marker:active,
.map-deck-stair-handle:active {
  cursor: grabbing;
}

.map-deck-stair-shape {
  position: relative;
  display: grid;
  width: var(--stair-width-px, 42px);
  height: var(--stair-run-px, 64px);
  min-width: 34px;
  min-height: 42px;
  place-items: center;
  border: 2px solid #5a3719;
  border-radius: 7px;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(90, 55, 25, 0.28) 0,
      rgba(90, 55, 25, 0.28) 2px,
      transparent 2px,
      transparent 11px
    ),
    rgba(246, 223, 187, 0.92);
  transform: rotate(var(--stair-rotation, 0deg));
  transform-origin: 50% 0;
}

.map-deck-stair-shape b {
  position: absolute;
  top: -6px;
  left: 50%;
  display: block;
  width: calc(100% + 10px);
  height: 8px;
  border: 2px solid #5a3719;
  border-bottom: 0;
  border-radius: 4px;
  background: #fff8ed;
  transform: translateX(-50%);
}

.map-deck-stair-shape small {
  display: block;
  border-radius: 999px;
  padding: 3px 5px;
  color: #5a3719;
  background: rgba(255, 248, 237, 0.86);
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.map-deck-stair-label {
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  display: block;
  min-width: max-content;
  border: 1px solid rgba(90, 55, 25, 0.18);
  border-radius: 999px;
  padding: 4px 7px;
  color: #5a3719;
  background: rgba(255, 248, 237, 0.96);
  box-shadow: 0 5px 14px rgba(60, 38, 18, 0.16);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.map-deck-stair-marker:hover .map-deck-stair-label,
.map-deck-stair-marker:focus-visible .map-deck-stair-label,
.map-deck-stair-handle:hover .map-deck-stair-label,
.map-deck-stair-handle:focus-visible .map-deck-stair-label {
  opacity: 1;
  transform: translate(-50%, 0);
}

.deck-flight-balance {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(139, 94, 52, 0.16);
  border-radius: 8px;
  padding: 10px;
  background: #fffaf3;
}

.deck-flight-balance label {
  display: grid;
  gap: 6px;
}

.deck-flight-balance input[type="range"] {
  width: 100%;
  accent-color: #8b5e34;
}

.deck-flight-balance > span {
  justify-self: start;
  border-radius: 999px;
  padding: 4px 8px;
  color: #5a3719;
  background: #ffffff;
  font-size: 0.72rem;
  font-weight: 900;
}

.deck-flight-balance small {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.map-post-marker,
.map-area-corner-marker {
  display: block;
  width: 24px;
  min-height: 24px;
  border: 3px solid var(--accent-strong);
  border-radius: 999px;
  padding: 0;
  background: #ffffff;
  box-shadow: 0 3px 12px rgba(21, 34, 29, 0.28);
  cursor: grab;
  touch-action: none;
}

.map-area-corner-marker {
  width: 28px;
  min-height: 28px;
  border-color: #7c4a2d;
  box-shadow: 0 3px 14px rgba(82, 49, 23, 0.3);
}

.map-post-marker:hover,
.map-post-marker:focus-visible,
.map-area-corner-marker:hover,
.map-area-corner-marker:focus-visible {
  border-color: #064a36;
  background: #f7fcf9;
}

.map-post-marker:active,
.map-area-corner-marker:active {
  cursor: grabbing;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.media-dropzone {
  display: grid;
  min-height: 112px;
  place-items: center;
  align-content: center;
  border: 1.5px dashed #8ca79b;
  border-radius: 7px;
  padding: 16px;
  color: var(--text);
  text-align: center;
  background: #f7fbf9;
  cursor: pointer;
}

.media-dropzone:hover,
.media-dropzone.is-dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.media-dropzone strong {
  font-size: 0.9rem;
}

.media-dropzone span {
  max-width: 240px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 650;
  line-height: 1.4;
}

.media-upload-limits {
  display: grid;
  gap: 3px;
  max-width: 280px;
  margin: 4px auto 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
  list-style: none;
}

.media-upload-limits li::before {
  color: var(--accent);
  content: "+ ";
  font-weight: 900;
}

.media-dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.media-status {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

.media-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
}

.media-empty {
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.media-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 30px;
  gap: 9px;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px;
  background: #ffffff;
}

.media-assignment {
  grid-column: 2 / 4;
  min-width: 0;
}

.media-assignment-editor {
  display: grid;
  gap: 7px;
}

.media-assignment-editor summary {
  width: fit-content;
  cursor: pointer;
}

.media-assignment-editor .media-target-options {
  margin-top: 7px;
}

.media-preview {
  display: grid;
  width: 54px;
  height: 46px;
  overflow: hidden;
  place-items: center;
  color: var(--muted);
  border-radius: 5px;
  background: var(--surface-strong);
  font-size: 0.68rem;
  font-weight: 800;
}

.media-preview img,
.media-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-details {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.media-details strong,
.media-details span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-details strong {
  font-size: 0.78rem;
}

.media-details span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 650;
}

.source-badge {
  display: inline-block;
  border-radius: 5px;
  padding: 3px 6px;
  color: var(--muted);
  background: var(--surface-strong);
  font-size: 0.72rem;
  font-weight: 800;
}

.source-map {
  color: #125c8a;
  background: #e1f0fa;
}

.source-manual {
  color: #6d5316;
  background: #f7edce;
}

.viewer3d-section {
  min-height: 420px;
}

.viewer3d-title {
  padding: 0 2px;
  flex-wrap: wrap;
}

.viewer3d-title button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.viewer3d {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  border-radius: 8px;
  background: #e8f0ec;
}

.viewer3d canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 390px;
}

.viewer3d-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
  pointer-events: none;
}

.elevation-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

#elevationSvg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 240px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.elevation-bg {
  fill: #eef5f1;
}

.elevation-ground {
  fill: none;
  stroke: #9ab0a9;
  stroke-width: 2;
  stroke-dasharray: 7 7;
}

.elevation-panel-face {
  stroke: rgba(23, 33, 29, 0.68);
  stroke-width: 1.4;
}

.elevation-top-rail {
  fill: none;
  stroke: rgba(23, 33, 29, 0.78);
  stroke-width: 2;
}

.elevation-gate-face {
  fill: #ffffff;
  stroke: var(--accent-strong);
  stroke-width: 2;
}

.elevation-post {
  stroke: #17211d;
  stroke-width: 3;
  stroke-linecap: round;
}

.elevation-post-cap {
  fill: #ffffff;
  stroke: #17211d;
  stroke-width: 1.5;
}

.elevation-transition {
  stroke: var(--danger);
  stroke-width: 3;
  stroke-linecap: round;
}

.elevation-label,
.elevation-transition-label {
  paint-order: stroke;
  stroke: #ffffff;
  stroke-width: 5px;
  stroke-linejoin: round;
  fill: var(--text);
  font-size: 12px;
  font-weight: 850;
  pointer-events: none;
  text-anchor: middle;
}

.elevation-transition-label {
  fill: var(--danger);
}

.elevation-empty {
  fill: var(--muted);
  font-size: 15px;
  font-weight: 750;
  text-anchor: middle;
}

#planSvg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 360px;
  touch-action: none;
  cursor: crosshair;
}

#planSvg.is-panning {
  cursor: grabbing;
}

#gridRulerLayer {
  pointer-events: none;
}

.grid-ruler-background {
  fill: rgba(255, 255, 255, 0.88);
}

.grid-ruler-tick {
  stroke: #789088;
  stroke-width: 1.5;
}

.grid-ruler-label,
.grid-ruler-unit {
  fill: #51665f;
  font-size: 11px;
  font-weight: 850;
  pointer-events: none;
}

.grid-ruler-unit {
  fill: var(--accent-strong);
  font-size: 10px;
  text-transform: uppercase;
}

.segment-line {
  stroke-width: 6;
  stroke-linecap: round;
  fill: none;
}

.segment-label {
  paint-order: stroke;
  stroke: #ffffff;
  stroke-width: 5px;
  stroke-linejoin: round;
  fill: var(--text);
  font-size: 14px;
  font-weight: 800;
  pointer-events: none;
}

.post-distance-label {
  paint-order: stroke;
  stroke: #ffffff;
  stroke-width: 5px;
  stroke-linejoin: round;
  fill: var(--accent-strong);
  font-size: 12px;
  font-weight: 850;
  pointer-events: none;
  dominant-baseline: central;
}

.post-point {
  fill: #ffffff;
  stroke: var(--accent-strong);
  stroke-width: 3;
  cursor: pointer;
}

.post-action-menu {
  position: fixed;
  z-index: 20;
  display: grid;
  gap: 8px;
  width: min(190px, calc(100vw - 16px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
  box-shadow: 0 14px 38px rgba(21, 34, 29, 0.18);
}

.post-action-menu[hidden] {
  display: none;
}

.post-action-menu strong {
  font-size: 0.9rem;
}

.post-action-menu button {
  width: 100%;
}

.fence-pole {
  fill: #ffffff;
  stroke: #28332f;
  stroke-width: 2;
}

.site-object {
  cursor: move;
}

.site-object-shape {
  stroke: rgba(23, 33, 29, 0.72);
  stroke-width: 2;
}

.site-object-label {
  paint-order: stroke;
  stroke: #ffffff;
  stroke-width: 5px;
  stroke-linejoin: round;
  fill: var(--text);
  font-size: 13px;
  font-weight: 850;
  pointer-events: none;
  text-anchor: middle;
  dominant-baseline: central;
}

.gate-marker {
  cursor: grab;
}

.gate-marker:active {
  cursor: grabbing;
}

.gate-hitbox {
  fill: transparent;
}

.gate-bar {
  fill: #ffffff;
  stroke: var(--accent-strong);
  stroke-width: 3;
}

.gate-post {
  stroke: var(--accent-strong);
  stroke-width: 4;
  stroke-linecap: round;
}

.gate-label {
  fill: var(--accent-strong);
  font-size: 12px;
  font-weight: 850;
  pointer-events: none;
  text-anchor: middle;
}

.preview-line {
  stroke: var(--accent-strong);
  stroke-width: 3;
  stroke-dasharray: 8 8;
  fill: none;
}

.preview-length-label {
  paint-order: stroke;
  stroke: #ffffff;
  stroke-width: 7px;
  stroke-linejoin: round;
  fill: var(--accent-strong);
  font-size: 14px;
  font-weight: 900;
  pointer-events: none;
  dominant-baseline: central;
}

.table-wrap {
  overflow-x: auto;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
}

.row-actions button {
  width: 34px;
  min-height: 32px;
}

.empty-row {
  color: var(--muted);
}

.table-input {
  min-width: 72px;
  max-width: 92px;
}

.summary-panel dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.summary-panel {
  border-top: 4px solid var(--accent);
  box-shadow: var(--shadow-strong);
}

.summary-panel .section-title {
  align-items: flex-start;
}

.summary-panel div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.summary-panel dt {
  color: var(--muted);
  font-weight: 700;
}

.summary-panel dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  text-align: right;
}

.note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.media-panel {
  border-color: #a8c8b9;
  background: #f8fcfa;
}

.project-media-report {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(8, 122, 85, 0.18);
  border-radius: 8px;
  padding: 14px;
  background: #f8fcfa;
}

.project-media-report .section-title {
  margin-bottom: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.project-media-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(280px, 1.15fr);
  gap: 12px;
  align-items: stretch;
}

.media-panel > label {
  margin-top: 2px;
}

.media-targets {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.media-targets legend,
.media-assignment-editor summary {
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 900;
}

.media-target-options {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.media-target-option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border: 1px solid rgba(8, 122, 85, 0.18);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--text);
  background: #f7fbf9;
  font-size: 0.74rem;
  font-weight: 850;
}

.media-target-option input {
  width: auto;
  min-height: auto;
  margin: 0;
}

.mobile-project-hint {
  display: none;
}

.microcopy {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.materials-list,
.compact-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.materials-list li,
.compact-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  background: #ffffff;
}

.materials-list li {
  align-items: flex-start;
}

.materials-list li > div {
  display: grid;
  gap: 3px;
}

.materials-list li > strong {
  white-space: nowrap;
}

.materials-list span,
.compact-list span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.materials-list em {
  color: var(--muted);
  font-size: 0.76rem;
  font-style: normal;
  line-height: 1.3;
}

.market-pricing-summary {
  display: grid;
  gap: 8px;
}

.market-pricing-summary div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  background: #ffffff;
}

.market-pricing-summary span,
.market-pricing-summary small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.market-pricing-summary strong {
  text-align: right;
}

.market-pricing-summary small {
  grid-column: 1 / -1;
}

.pricing-editor {
  display: grid;
  gap: 10px;
}

.price-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) repeat(3, minmax(64px, 74px));
  gap: 8px;
  align-items: end;
}

.price-row strong {
  align-self: center;
  font-size: 0.84rem;
}

.price-row label {
  font-size: 0.72rem;
}

dialog {
  width: min(420px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  overflow-y: auto;
  box-shadow: 0 22px 70px rgba(23, 33, 29, 0.2);
}

dialog::backdrop {
  background: rgba(23, 33, 29, 0.36);
}

.quote-request-dialog {
  width: min(620px, calc(100vw - 24px));
}

.tutorial-dialog {
  width: min(1040px, calc(100vw - 24px));
  overflow: hidden;
  background: #ffffff;
}

.tutorial-dialog-shell {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.tutorial-dialog-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.tutorial-dialog-header h2 {
  margin: 2px 0 0;
  font-size: clamp(1.25rem, 2.5vw, 1.8rem);
}

.tutorial-dialog-intro {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.estimator-tutorial-video {
  display: block;
  width: 100%;
  max-height: calc(100dvh - 190px);
  aspect-ratio: 16 / 9;
  border-radius: 7px;
  background: #031f18;
}

.quote-request-intro {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.55;
}

.quote-consent {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  column-gap: 10px;
  margin-top: 4px;
  color: var(--text);
  line-height: 1.45;
}

.quote-consent input {
  margin-top: 3px;
}

.quote-consent span {
  display: block;
}

.quote-address-row {
  grid-template-columns: minmax(0, 1fr) 100px;
}

.turnstile-wrap {
  min-height: 65px;
}

.form-status {
  min-height: 20px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.form-status[data-tone="error"] {
  color: var(--danger);
}

.form-status[data-tone="success"] {
  color: var(--accent-strong);
}

.dialog-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.dialog-body > * + * {
  margin-top: 0;
}

.dialog-actions {
  position: sticky;
  bottom: -16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 0 -16px -16px;
  border-top: 1px solid var(--line);
  padding: 12px 16px 16px;
  background: #ffffff;
}

.grade-profile-dialog {
  width: min(1040px, calc(100vw - 24px));
}

.grade-profile-shell {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.grade-profile-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.grade-profile-header h2,
.grade-pricing-panel h3 {
  margin: 0;
}

.grade-profile-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, auto);
  align-items: end;
  gap: 12px;
}

.grade-profile-message {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

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

.grade-profile-stats article {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: var(--surface-strong);
}

.grade-profile-stats span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.grade-profile-stats strong {
  font-size: 1.08rem;
}

#gradeProfileChart {
  width: 100%;
  min-height: 240px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fbf9;
}

.grade-chart-background {
  fill: #f8fbf9;
}

.grade-chart-gate {
  fill: rgba(3, 105, 161, 0.1);
  stroke: rgba(3, 105, 161, 0.34);
  stroke-dasharray: 6 4;
}

.grade-chart-axis {
  stroke: #9bada6;
  stroke-width: 1.5;
}

.grade-chart-line {
  fill: none;
  stroke: var(--accent-strong);
  stroke-width: 4;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.grade-chart-post {
  fill: #ffffff;
  stroke: var(--text);
  stroke-width: 2;
}

.grade-chart-post-label,
.grade-chart-elevation,
.grade-chart-empty {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.grade-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 750;
}

.grade-legend span::before {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 6px;
  border-radius: 50%;
  content: "";
  background: currentColor;
}

.grade-low {
  color: var(--accent-strong);
}

.grade-moderate {
  color: var(--action-strong);
}

.grade-steep {
  color: #9a5800;
}

.grade-very-steep {
  color: var(--danger);
}

.grade-table-wrap {
  max-height: 250px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.grade-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.grade-table-wrap th,
.grade-table-wrap td {
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
  white-space: nowrap;
}

.grade-table-wrap th {
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 1;
}

.grade-row-moderate td:first-child {
  border-left: 4px solid var(--action);
}

.grade-row-steep td:first-child {
  border-left: 4px solid #b86b00;
}

.grade-row-very-steep td:first-child {
  border-left: 4px solid var(--danger);
}

.grade-pricing-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 14px;
  background: var(--surface-strong);
}

.grade-pricing-panel p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.grade-pricing-fields {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.grade-disclaimer {
  margin: 0;
  border-left: 4px solid #d29822;
  padding: 10px 12px;
  color: #66501f;
  background: #fff8e6;
  font-size: 0.78rem;
  line-height: 1.45;
}

@keyframes search-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 1181px) {
  .fence-type-heading {
    padding: 0 2px;
  }

  .fence-type-heading h2 {
    margin: 2px 0 3px;
    font-size: 1rem;
  }

  .fence-type-heading > p:last-child {
    font-size: 0.72rem;
    line-height: 1.25;
  }

  .fence-type-bubbles {
    align-content: start;
    grid-template-rows: none;
    grid-auto-rows: max-content;
    gap: 7px;
    min-height: 0;
    max-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 2px;
    scrollbar-width: thin;
  }

  .fence-type-bubble {
    grid-template-columns: 112px minmax(0, 1fr);
    height: auto;
    min-height: 92px;
  }

  .fence-type-bubble img {
    width: 112px;
    height: 100%;
    min-height: 92px;
    aspect-ratio: auto;
  }

  .fence-type-bubble-body {
    align-content: center;
    gap: 3px;
    min-width: 0;
    padding: 6px 7px;
  }

  .fence-type-bubble-title {
    align-items: start;
    flex-direction: column;
    gap: 0;
  }

  .fence-type-bubble-title strong {
    font-size: 0.82rem;
  }

  .fence-type-bubble-title > span {
    font-size: 0.61rem;
  }

  .fence-type-description {
    display: -webkit-box;
    overflow: hidden;
    font-size: 0.68rem;
    line-height: 1.22;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .fence-type-best {
    overflow: hidden;
    font-size: 0.65rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .fence-type-price {
    padding-top: 3px;
    font-size: 0.75rem;
  }

  .panel,
  .data-panel {
    padding: 11px;
  }

  .control-panel > summary {
    min-height: 43px;
    padding: 0 11px;
  }

  .control-panel > :not(summary) {
    margin-right: 11px;
    margin-left: 11px;
  }

  .control-panel > :last-child {
    margin-bottom: 10px;
  }

  .control-panel .section-title {
    margin-top: 10px;
  }

  .panel > * + * {
    margin-top: 8px;
  }

  input,
  select {
    min-height: 36px;
    padding: 6px 8px;
  }

  button {
    min-height: 36px;
  }

  .split-fields,
  .toggle-row,
  .button-grid {
    gap: 6px;
  }

  .checkbox-label {
    min-height: 34px;
    padding: 6px 8px;
  }

  .selected-fence-type {
    gap: 1px;
  }

  .microcopy,
  .note {
    font-size: 0.73rem;
    line-height: 1.3;
  }

  .canvas-column {
    grid-template-rows: auto auto minmax(0, 1fr) auto auto auto;
    gap: 10px;
  }

  .estimate-strip {
    gap: 8px;
  }

  .estimate-strip article {
    padding: 9px 10px;
  }

  .estimate-strip strong {
    font-size: 1.25rem;
  }

  .workspace-panel,
  .map-workspace-panel,
  .map-canvas-wrap,
  .plan-wrap {
    min-height: 0;
  }

  .map-workspace-panel {
    grid-template-rows: minmax(0, 1fr);
    height: 100%;
    gap: 8px;
  }

  .map-search-panel {
    padding: 10px;
  }

  .map-search-heading {
    margin-bottom: 6px;
  }

  #mapSearchInput,
  .map-search-form button {
    min-height: 60px;
  }

  .map-search-status {
    min-height: 0;
    margin-top: 4px;
  }

  .map-canvas-wrap {
    height: 100%;
  }

  .summary-panel dl {
    gap: 7px;
  }

  .summary-panel dt,
  .summary-panel dd {
    font-size: 0.82rem;
  }

  .media-dropzone {
    min-height: 86px;
    padding: 10px;
  }

  .media-dropzone strong {
    font-size: 0.82rem;
  }

  .media-dropzone span,
  .media-status,
  .media-empty {
    font-size: 0.7rem;
  }
}

@media (min-width: 1181px) and (max-height: 760px) {
  .topbar {
    min-height: 64px;
    padding: 8px 16px;
  }

  .brand-mark {
    width: 36px;
    min-width: 36px;
    height: 36px;
  }

  .sidebar,
  .summary {
    gap: 6px;
  }

  .control-panel > summary {
    min-height: 36px;
  }

  .control-panel > :not(summary) {
    margin-right: 9px;
    margin-left: 9px;
  }

  .control-panel > :last-child {
    margin-bottom: 8px;
  }

  .sidebar .selected-fence-type {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    min-height: auto;
    padding: 10px;
  }

  .sidebar .selected-fence-type span {
    font-size: 0.66rem;
  }

  .sidebar .selected-fence-type strong,
  .sidebar .selected-fence-type small {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .sidebar label {
    font-size: 0.7rem;
  }

  .sidebar input,
  .sidebar select,
  .sidebar button {
    min-height: 32px;
  }

  [data-workspace-mode="satellite"] .sidebar .button-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  [data-workspace-mode="satellite"] .sidebar .button-grid button {
    padding: 0 5px;
    font-size: 0.68rem;
    line-height: 1.1;
  }

  .sidebar .checkbox-label {
    min-height: 30px;
    padding: 4px 7px;
  }

  .map-search-panel {
    padding: 8px;
  }
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  }

  .fence-type-column {
    grid-column: 1 / -1;
    position: static;
    max-height: none;
    overflow: visible;
  }

  .fence-type-bubbles {
    grid-auto-columns: minmax(210px, 250px);
    grid-auto-flow: column;
    min-height: 286px;
    overflow-x: auto;
    padding: 2px 2px 10px;
    scroll-snap-type: x proximity;
  }

  .fence-type-bubble {
    scroll-snap-align: start;
  }

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

  .sidebar,
  .fence-type-column,
  .summary {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 820px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 8px 12px;
  }

  .brand-lockup {
    gap: 8px;
  }

  .brand-mark {
    width: 34px;
    min-width: 34px;
    height: 34px;
  }

  .topbar h1 {
    font-size: 1.02rem;
  }

  .topbar .eyebrow {
    display: none;
  }

  .topbar-actions {
    width: 100%;
    justify-content: stretch;
    gap: 6px;
  }

  .project-mode-switcher {
    order: 3;
    width: 100%;
    overflow-x: auto;
  }

  .project-mode-switcher button {
    flex: 1 0 auto;
    min-height: 32px;
    padding: 0 9px;
    font-size: 0.76rem;
  }

  .topbar-actions button {
    flex: 1;
    min-height: 36px;
    padding: 0 10px;
    font-size: 0.78rem;
  }

  #requestQuotesButton {
    min-width: 100%;
  }

  .estimator-guide-link {
    justify-content: center;
  }

  .analytics-consent {
    grid-template-columns: 1fr;
  }

  .tutorial-dialog-shell {
    padding: 12px;
  }

  .tutorial-dialog-intro {
    font-size: 0.84rem;
  }

  .workspace,
  .summary {
    grid-template-columns: 1fr;
  }

  .fence-type-column {
    grid-row: 1;
  }

  .canvas-column {
    grid-row: 2;
  }

  [data-workspace-mode="satellite"] .canvas-column {
    grid-template-rows: auto;
  }

  .sidebar {
    grid-row: 3;
  }

  .summary {
    grid-row: 4;
  }

  .pool-entry-card-grid {
    grid-template-columns: 1fr;
  }

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

  [data-project-mode="fence"] .mobile-add-gate-button {
    display: inline-flex;
  }

  .map-mode-action-button:not([hidden]) {
    display: inline-flex;
  }

  .mobile-project-hint:not([hidden]):not(.is-suppressed) {
    position: fixed;
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    left: max(10px, env(safe-area-inset-left));
    z-index: 850;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 3px 9px;
    border: 1px solid rgba(8, 122, 85, 0.18);
    border-radius: 8px;
    padding: 8px 10px;
    color: #294239;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 30px rgba(19, 35, 29, 0.16);
    font-size: 0.72rem;
    line-height: 1.25;
    pointer-events: none;
  }

  .mobile-project-hint strong {
    color: var(--accent-strong);
    font-size: 0.74rem;
    font-weight: 900;
  }

  .mobile-project-hint span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-project-hint em {
    grid-column: 1 / -1;
    color: var(--muted);
    font-style: normal;
    font-weight: 800;
  }

  [data-workspace-mode="satellite"] .canvas-column {
    grid-template-rows: auto;
  }

  .map-workspace-panel,
  .map-workspace-panel > .drawing-surface-content:not([hidden]) {
    height: auto;
  }

  .map-canvas-wrap {
    min-height: clamp(480px, 62dvh, 680px);
  }

  .grade-profile-controls,
  .grade-profile-stats,
  .grade-pricing-panel,
  .grade-pricing-fields {
    grid-template-columns: 1fr;
  }

  .grade-pricing-fields {
    grid-column: auto;
  }

  .design-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace-tabs {
    width: 100%;
  }

  .workspace-tabs button {
    flex: 1;
  }
}

@media (max-width: 520px) {
  .workspace {
    padding: 8px;
  }

  .split-fields,
  .toggle-row,
  .button-grid,
  .estimate-strip {
    grid-template-columns: 1fr;
  }

  .price-row {
    grid-template-columns: 1fr;
  }

  .map-search-form {
    grid-template-columns: 1fr;
  }

  .map-search-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  #mapSearchInput,
  .map-search-form button {
    min-height: 56px;
  }

  .map-canvas-wrap {
    min-height: clamp(430px, 58dvh, 620px);
  }

  .map-action-toolbar {
    top: 7px;
    left: 7px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    width: min(218px, calc(100% - 58px));
    padding: 5px;
  }

  .map-action-toolbar button {
    min-height: 34px;
    padding: 0 6px;
    font-size: 0.66rem;
    line-height: 1.05;
  }

  .map-action-toolbar .map-history-button {
    font-size: 0.74rem;
  }

  .grade-profile-shell {
    padding: 12px;
  }
}

/* Current estimator summary presentation. Keep the hidden IDs for export/quote logic. */
.estimate-strip {
  display: none !important;
}

.summary-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
  border-top: 0;
  background:
    linear-gradient(180deg, rgba(231, 244, 238, 0.72), rgba(255, 255, 255, 0) 150px),
    #ffffff;
}

.summary-panel .section-title {
  border-bottom: 1px solid rgba(203, 217, 211, 0.78);
  padding-bottom: 10px;
}

.summary-panel .section-title > div {
  display: grid;
  gap: 2px;
}

#pricePerFoot {
  display: inline-flex;
  width: fit-content;
  min-height: 26px;
  align-items: center;
  border: 1px solid #b7d6c9;
  border-radius: 999px;
  margin-top: 4px;
  padding: 0 9px;
  color: var(--accent-strong);
  background: #f3fbf8;
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

.summary-panel dl {
  display: grid;
  gap: 10px;
  min-height: 0;
  margin: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
  scrollbar-width: thin;
}

.summary-panel dl > div {
  min-width: 0;
}

.summary-panel .summary-metric {
  display: grid;
  grid-template-columns: 1fr;
  align-content: space-between;
  gap: 4px;
  min-height: 0;
  overflow: hidden;
  border: 1px solid #b7d6c9;
  border-radius: 8px;
  padding: 12px;
  background: #f4fbf8;
  box-shadow: 0 8px 22px rgba(8, 122, 85, 0.08);
}

.summary-panel .summary-metric dt,
.summary-panel .summary-metric dd {
  text-align: left;
}

.summary-panel .summary-metric dt {
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.summary-panel .summary-metric dd {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  line-height: 1.12;
}

.summary-panel .summary-kpi-grid {
  display: grid;
  grid-auto-rows: 80px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.summary-panel .summary-range {
  grid-column: 1 / -1;
  border-color: var(--accent-strong);
  color: #ffffff;
  gap: 2px;
  padding: 10px 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0)),
    linear-gradient(135deg, var(--accent-strong), #075985);
  box-shadow: 0 14px 34px rgba(7, 95, 68, 0.22);
}

.summary-panel .summary-kpi:not(.summary-range) {
  gap: 4px;
  padding: 13px 12px;
}

.summary-panel .summary-kpi:not(.summary-range) dt {
  font-size: 0.56rem;
}

.summary-panel .summary-kpi:not(.summary-range) dd {
  overflow-wrap: anywhere;
  font-size: clamp(0.86rem, 1.02vw, 1rem);
  line-height: 1.05;
}

.summary-panel .summary-range dt,
.summary-panel .summary-range dd {
  color: #ffffff;
}

.summary-panel .summary-range dt {
  opacity: 0.8;
}

.summary-panel .summary-range dd {
  overflow-wrap: anywhere;
  font-size: clamp(0.92rem, 1.12vw, 1.08rem);
  line-height: 1.05;
}

.summary-panel .summary-detail-list {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.summary-detail-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 9px 11px;
}

.summary-detail-row:first-child {
  border-top: 0;
}

.summary-detail-row dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.25;
}

.summary-detail-row dd {
  margin: 0;
  color: var(--text);
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  text-align: right;
}

.project-elements-panel {
  display: grid;
  grid-column: 1 / -1;
  gap: 16px;
  border-top: 4px solid var(--accent-strong);
  padding: clamp(16px, 2vw, 22px);
  background:
    linear-gradient(135deg, rgba(8, 122, 85, 0.06), rgba(3, 105, 161, 0.04)),
    #ffffff;
  box-shadow: var(--shadow-strong);
}

.project-elements-panel .section-title {
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.project-elements-panel .section-title h2 {
  font-size: clamp(1.25rem, 2vw, 1.75rem);
}

.project-elements-panel .section-title > span {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border-radius: 999px;
  padding: 0 12px;
  color: var(--accent-strong);
  background: #eefaf4;
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.project-elements-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.project-element-total,
.project-element-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.project-element-total {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  align-items: center;
  gap: 18px;
  padding: 18px;
  border-color: rgba(8, 122, 85, 0.22);
  background:
    linear-gradient(135deg, rgba(8, 122, 85, 0.12), rgba(3, 105, 161, 0.06)),
    #f4fbf8;
}

.project-element-total > div {
  display: grid;
  gap: 3px;
}

.project-element-total dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.project-element-total dl div {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(8, 122, 85, 0.13);
  border-radius: 7px;
  padding: 10px;
  background: #ffffff;
}

.project-element-total dt,
.project-element-total span,
.project-element-total small,
.project-element-card span,
.project-element-card small {
  color: var(--muted);
}

.project-element-total dt,
.project-element-total span,
.project-element-card span {
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.project-element-total dd {
  margin: 0;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.project-element-total strong {
  color: var(--text);
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.project-element-total small,
.project-element-card small {
  font-size: 0.72rem;
  line-height: 1.25;
}

.project-element-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-left: 5px solid var(--element-color, var(--accent));
  padding: 14px;
}

.project-element-card.is-active {
  border-color: color-mix(in srgb, var(--element-color, var(--accent)) 42%, #ffffff);
  border-left-color: var(--element-color, var(--accent));
  background: #fbfffd;
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--element-color, var(--accent)) 18%, transparent),
    0 14px 30px rgba(8, 122, 85, 0.12);
}

.project-element-card.is-active::after {
  position: absolute;
  top: -12px;
  right: 12px;
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--element-color, var(--accent));
  background: #ffffff;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--element-color, var(--accent)) 24%, transparent);
  content: "Selected";
  font-size: 0.62rem;
  font-weight: 950;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.project-element-card.is-empty {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 1fr;
  gap: 6px;
  min-height: 150px;
  align-content: center;
  border-left-color: var(--line);
  background: #f8fbfa;
  text-align: center;
}

.project-element-card strong,
.project-element-card b {
  color: var(--text);
  font-weight: 900;
}

.project-element-card b {
  font-size: 0.94rem;
  font-variant-numeric: tabular-nums;
}

.project-element-card-header,
.project-element-card-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.project-element-card-header {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.project-element-card-header > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.project-element-card-copy {
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.project-element-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.project-element-detail-row {
  display: grid;
  gap: 3px;
  border-radius: 7px;
  padding: 9px;
  background: #f7faf9;
  min-width: 0;
}

.project-element-detail-row span {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.project-element-detail-row strong {
  overflow-wrap: anywhere;
  font-size: 0.74rem;
  line-height: 1.2;
}

.project-element-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.project-element-media {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(3, 105, 161, 0.12);
  border-radius: 8px;
  padding: 10px;
  background: #f7fbff;
}

.project-element-media > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.project-element-media span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.project-element-media strong {
  font-size: 0.78rem;
  text-align: right;
}

.project-element-media small {
  color: var(--muted);
}

.project-element-media-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-element-media-list span {
  max-width: 100%;
  overflow: hidden;
  border-radius: 999px;
  padding: 4px 8px;
  background: #ffffff;
  color: var(--blue-dark);
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0;
}

.project-element-media.is-empty {
  background: #fafcfb;
}

.project-element-card .text-button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  justify-content: center;
  border: 1px solid rgba(3, 105, 161, 0.22);
  border-radius: 7px;
  padding: 0 10px;
  background: #ffffff;
  color: var(--blue-dark);
  font-size: 0.76rem;
  font-weight: 900;
}

.project-element-card .text-button:hover {
  border-color: rgba(3, 105, 161, 0.45);
  background: #f5fbff;
}

.project-element-card .project-element-remove {
  border-color: rgba(185, 28, 28, 0.24);
  color: #991b1b;
}

.project-element-card .project-element-remove:hover {
  border-color: rgba(185, 28, 28, 0.42);
  background: #fff5f5;
}

@media (min-width: 821px) {
  [data-workspace-mode="satellite"] .canvas-column {
    grid-template-rows: minmax(420px, 1fr);
  }
}

@media (min-width: 1181px) {
  .sidebar {
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 2px;
    scrollbar-width: thin;
  }

  .summary {
    grid-template-rows: minmax(0, 1fr);
    align-content: stretch;
    overflow: hidden;
    padding-right: 0;
  }

  .fence-type-column {
    overflow: hidden;
    padding-right: 0;
  }

  .canvas-column {
    overflow: hidden;
  }

  .summary-panel {
    height: 100%;
    padding: 12px;
  }

  .project-elements-panel {
    padding: 18px;
  }

  .summary-panel dl {
    gap: 10px;
  }

  .summary-panel .summary-range {
    padding: 10px 11px;
  }

  .summary-panel .summary-range dd {
    font-size: 0.88rem;
  }

  .summary-panel .summary-range span {
    font-size: 0.66rem;
  }

  .summary-panel .summary-kpi-grid {
    grid-auto-rows: 78px;
    gap: 9px;
  }

  .summary-panel .summary-kpi {
    min-height: 0;
    padding: 13px 11px;
  }

  .summary-panel .summary-metric dt {
    font-size: 0.56rem;
  }

  .summary-panel .summary-kpi dd {
    overflow-wrap: anywhere;
    font-size: 0.8rem;
  }

  .summary-detail-row {
    gap: 8px;
    padding: 6px 8px;
  }

  .summary-detail-row dt {
    font-size: 0.68rem;
  }

  .summary-detail-row dd {
    font-size: 0.76rem;
  }

  .summary-panel .note {
    margin-top: 7px;
    font-size: 0.66rem;
    line-height: 1.22;
  }

  .project-element-total {
    padding: 16px;
  }

  .project-element-card {
    gap: 11px;
    padding: 14px;
  }

  .project-element-total dl,
  .project-element-details {
    gap: 8px;
  }

  .project-element-total dl div,
  .project-element-detail-row {
    padding: 9px;
  }

  .project-element-card span {
    font-size: 0.72rem;
  }

  .project-element-card small,
  .project-element-total small {
    font-size: 0.72rem;
  }
}

@media (max-width: 820px) {
  .canvas-column {
    gap: 10px;
  }

  [data-workspace-mode="satellite"] .canvas-column {
    grid-template-rows: auto;
  }

  .map-workspace-panel {
    gap: 8px;
    height: auto;
  }

  .map-workspace-panel > .drawing-surface-content:not([hidden]) {
    height: auto;
  }

  .map-canvas-wrap {
    min-height: clamp(480px, 62dvh, 680px);
  }

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

  .summary-panel .summary-kpi {
    padding: 10px;
  }

  .summary-panel .summary-kpi dd {
    font-size: 1rem;
  }

  .project-element-total {
    grid-template-columns: 1fr;
  }

  .project-media-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1180px) {
  html,
  body,
  .app-shell,
  .topbar,
  .workspace {
    max-width: 100%;
  }

  .topbar,
  .topbar-actions,
  .project-mode-switcher,
  .workspace,
  .fence-type-column,
  .sidebar,
  .canvas-column,
  .summary,
  .project-elements-panel,
  .map-workspace-panel,
  .map-workspace-panel > .drawing-surface-content:not([hidden]),
  .map-canvas-wrap {
    min-width: 0;
  }

  .topbar {
    overflow: hidden;
  }

  .topbar-actions {
    max-width: 100%;
  }

  .project-mode-switcher {
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .workspace,
  .summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .workspace {
    width: 100%;
    padding: 12px;
  }

  .fence-type-column,
  .sidebar,
  .canvas-column,
  .summary,
  .project-elements-panel {
    grid-column: 1 / -1;
    width: 100%;
  }

  .fence-type-column {
    grid-row: 1;
  }

  .canvas-column {
    grid-row: 2;
  }

  .sidebar {
    grid-row: 3;
  }

  .summary {
    grid-row: 4;
  }

  .project-elements-panel {
    grid-row: 5;
  }
}

@media (max-width: 520px) {
  .map-canvas-wrap {
    min-height: clamp(430px, 58dvh, 620px);
  }

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

  .project-element-total dl,
  .project-element-actions {
    grid-template-columns: 1fr;
  }

  .media-list {
    grid-template-columns: 1fr;
  }
}

.map-canvas,
.map-canvas > .mapboxgl-canvas-container {
  width: 100%;
  height: 100%;
}

.map-canvas > .mapboxgl-canvas-container {
  position: absolute;
  inset: 0;
}

.map-canvas .mapboxgl-canvas {
  width: 100% !important;
  height: 100% !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

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

  .sidebar,
  .topbar-actions,
  .plan-wrap,
  .workspace-tabs,
  .map-workspace-panel,
  .viewer3d-section,
  .row-actions,
  dialog {
    display: none !important;
  }

  .workspace {
    display: block;
  }

  .panel,
  .data-panel,
  .estimate-strip article,
  .project-element-total,
  .project-element-card {
    box-shadow: none;
    break-inside: avoid;
  }
}
