@import url("https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Montserrat:wght@300;400;500;600;700;800&display=swap");

:root {
  color-scheme: light;
  --ink: #1d3532;
  --ink-soft: #4f6661;
  --muted: #71827d;
  --line: #ddd1bd;
  --line-strong: #bda984;
  --paper: #f1e8d9;
  --surface: #f3f7f6;
  --surface-2: #fbf6ed;
  --cream: #fffaf2;
  --green: #175c53;
  --green-2: #1d3532;
  --green-3: #132824;
  --accent: #d0a663;
  --accent-soft: #ead7b3;
  --wall: #758071;
  --wall-dark: #46534c;
  --glass: #e3f1f1;
  --danger: #8d342a;
  --shadow: 0 16px 38px rgba(29, 53, 50, 0.13);
  --panel-width: 365px;
  --right-width: 345px;
  --rail-width: 54px;
  --font-display: "DM Serif Display", Georgia, serif;
  --font-ui: Montserrat, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-ui);
  font-weight: 300;
  letter-spacing: 0;
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  height: 100vh;
  display: grid;
  grid-template-rows: 74px minmax(0, 1fr) 36px;
  background: var(--paper);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 22px;
  color: var(--paper);
  background: var(--green-2);
  border-bottom: 2px solid var(--accent);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 390px;
}

.brand-logo {
  width: 178px;
  height: 50px;
  object-fit: contain;
  display: block;
}

.brand-divider {
  width: 1px;
  height: 36px;
  background: rgba(208, 166, 99, 0.5);
}

.product-chip,
.action-button,
.icon-button,
.tool-button,
.mini-button,
.wide-button,
.rail-button {
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.product-chip {
  min-width: 126px;
  height: 40px;
  border-radius: 8px;
  color: var(--paper);
  background: rgba(241, 232, 217, 0.08);
  border-color: rgba(208, 166, 99, 0.48);
  font-weight: 500;
}

.project-title {
  display: grid;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.project-title label {
  font-size: 11px;
  color: rgba(241, 232, 217, 0.68);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.project-title input {
  width: min(360px, 100%);
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--paper);
  background: transparent;
  font-size: 19px;
  font-weight: 600;
}

.save-state {
  color: rgba(241, 232, 217, 0.68);
  font-size: 12px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  min-width: 0;
}

.action-button,
.icon-button {
  height: 40px;
  border-radius: 8px;
  color: var(--paper);
  border-color: rgba(241, 232, 217, 0.38);
  background: rgba(241, 232, 217, 0.04);
}

.action-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 15px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.icon-button {
  width: 40px;
  display: inline-grid;
  place-items: center;
}

.action-button:hover,
.icon-button:hover,
.product-chip:hover {
  color: var(--ink);
  border-color: var(--accent);
  background: var(--accent);
}

svg {
  display: block;
}

.action-button svg,
.icon-button svg,
.tool-button svg,
.rail-button svg,
.render-actions svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workspace {
  min-height: 0;
  height: 100%;
  overflow: hidden;
  display: grid;
  grid-template-columns: var(--rail-width) var(--panel-width) minmax(560px, 1fr) var(--right-width);
  background: var(--surface);
}

.side-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 14px 8px;
  background: var(--paper);
  border-right: 1px solid var(--line);
}

.rail-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--green);
}

.rail-button.is-active,
.rail-button:hover {
  color: var(--paper);
  background: var(--green-2);
}

.control-panel {
  min-height: 0;
  overflow: auto;
  background: var(--surface-2);
  border-right: 1px solid var(--line);
}

.right-panel {
  border-right: 0;
  border-left: 1px solid var(--line);
}

.panel-section {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.grow-section {
  min-height: 320px;
}

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

.section-heading h2 {
  margin: 0;
  color: var(--green-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.help-button {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--ink-soft);
  background: transparent;
  font-family: var(--font-display);
  font-size: 12px;
  line-height: 1;
}

.field-label {
  display: block;
  margin: 10px 0 6px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

select,
input[type="number"],
input[type="text"],
.search-input {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: var(--cream);
  outline: 0;
}

select {
  padding: 0 34px 0 11px;
}

.search-input,
input[type="number"],
input[type="text"] {
  padding: 0 11px;
}

select:focus,
input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(208, 166, 99, 0.24);
}

.segmented,
.view-switch,
.palette-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
}

.segmented button,
.view-switch button,
.palette-tabs button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.segmented button,
.view-switch button {
  flex: 1;
  height: 30px;
}

.segmented button.is-active,
.view-switch button.is-active,
.palette-tabs button.is-active {
  color: var(--paper);
  background: var(--green);
}

.number-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 14px;
}

.number-control > span:first-child {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.stepper {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 24px 34px;
  align-items: center;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--cream);
}

.stepper button {
  height: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  color: var(--green);
  font-weight: 600;
}

.stepper button:hover {
  background: var(--accent-soft);
}

.stepper input {
  min-width: 72px;
  height: 100%;
  border: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-radius: 0;
  text-align: center;
  font-weight: 600;
}

.stepper em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  text-align: center;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.module-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.module-card {
  min-height: 70px;
  padding: 11px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
}

.module-card strong {
  display: block;
  margin-bottom: 10px;
  color: var(--green);
  font-size: 13px;
}

.module-card span {
  display: block;
  color: var(--ink-soft);
  font-size: 12px;
}

.compact-control {
  display: block;
  margin-top: 12px;
}

.muted-line,
.fine-print {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.template-grid button,
.palette-item,
.mini-button,
.wide-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
}

.template-grid button {
  height: 42px;
  cursor: pointer;
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
}

.template-grid button:hover,
.palette-item:hover,
.wide-button:hover,
.mini-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.palette-tabs {
  flex-wrap: wrap;
  overflow-x: visible;
  margin: 10px 0;
}

.palette-tabs button {
  flex: 0 0 auto;
  padding: 0 10px;
  height: 28px;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  padding-bottom: 12px;
}

.palette-item {
  min-height: 104px;
  padding: 8px;
  cursor: pointer;
  text-align: left;
}

.palette-icon {
  height: 30px;
  margin-bottom: 7px;
  color: var(--wall-dark);
}

.palette-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
}

.palette-item strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.15;
}

.palette-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.canvas-area {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr) 54px;
  padding: 18px;
  background:
    linear-gradient(180deg, var(--surface) 0%, var(--paper) 100%);
}

.canvas-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 6px;
}

.tool-cluster {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.94);
  box-shadow: 0 6px 18px rgba(29, 53, 50, 0.08);
}

.tool-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--green);
}

.tool-button:hover,
.tool-button.is-active {
  color: var(--paper);
  background: var(--green-2);
}

.canvas-frame {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(rgba(29, 53, 50, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 53, 50, 0.04) 1px, transparent 1px),
    var(--cream);
  background-size: 28px 28px;
  box-shadow: var(--shadow);
}

#floorplan {
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
}

.canvas-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 2px 0;
}

.canvas-footer label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.canvas-footer select {
  width: 96px;
  height: 34px;
}

.scale-bar {
  width: 238px;
  height: 22px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border: 1px solid var(--green-2);
  border-top: 0;
}

.scale-bar span:nth-child(odd) {
  background: var(--green-2);
}

.canvas-toggles {
  display: flex;
  gap: 8px;
}

.mini-button,
.wide-button {
  min-height: 32px;
  padding: 0 12px;
  cursor: pointer;
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
}

.mini-button.is-active,
.wide-button.is-active {
  color: var(--paper);
  background: var(--green-2);
  border-color: var(--green-2);
}

.wide-button {
  width: 100%;
}

.quote-order-button {
  min-height: 42px;
  margin-bottom: 8px;
  border-color: var(--green);
  font-size: 13px;
  box-shadow: inset 0 -2px 0 rgba(208, 166, 99, 0.55);
}

.quote-request-status {
  margin: 0 0 14px;
}

.price-total {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin: 4px 0 18px;
}

.price-total span {
  color: var(--green-2);
  font-family: var(--font-display);
  font-size: 35px;
  font-weight: 400;
  line-height: 1;
}

.price-total small {
  padding-bottom: 4px;
  color: var(--ink-soft);
  font-size: 12px;
}

.quote-metrics {
  display: grid;
  gap: 10px;
  margin: 0 0 15px;
}

.quote-metrics div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.quote-metrics dt {
  color: var(--ink-soft);
  font-size: 13px;
}

.quote-metrics dd {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.price-breakdown {
  display: none;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
}

.price-breakdown.is-open {
  display: grid;
  gap: 8px;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 12px;
}

.breakdown-row strong {
  color: var(--ink);
}

.selected-card {
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
}

.selected-card.empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

.selected-card strong {
  display: block;
  margin-bottom: 8px;
}

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

.selected-grid label {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
}

.selected-grid input {
  margin-top: 4px;
  height: 32px;
}

.render-actions {
  display: grid;
  gap: 9px;
}

.render-actions button {
  height: 55px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 8px 6px 12px;
  border: 1px solid var(--green-2);
  border-radius: 8px;
  color: var(--green);
  background: var(--cream);
  cursor: pointer;
  font-weight: 600;
}

.render-actions button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.render-actions button span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.render-actions img {
  width: 72px;
  height: 41px;
  object-fit: cover;
  border-radius: 6px;
}

.render-status {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.render-job {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 12px;
}

.payload-details {
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 12px;
}

.payload-details summary {
  cursor: pointer;
  font-weight: 600;
}

#payloadPreview {
  max-height: 170px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--green-3);
  color: var(--surface);
  font-size: 11px;
  line-height: 1.45;
}

.project-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.statusbar {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 22px;
  color: rgba(241, 232, 217, 0.78);
  background: var(--green-2);
  font-size: 12px;
}

.statusbar span:first-child {
  color: var(--paper);
  font-weight: 600;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 54px;
  z-index: 30;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--paper);
  background: var(--green-2);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  font-size: 13px;
  font-weight: 500;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(29, 53, 50, 0.46);
  backdrop-filter: blur(6px);
}

.modal-backdrop[hidden] {
  display: none;
}

.auth-modal {
  position: relative;
  width: min(430px, 100%);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(29, 53, 50, 0.24);
}

.auth-modal h2 {
  margin: 0 0 8px;
  color: var(--green-2);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.1;
}

.auth-modal p {
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.45;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  color: var(--green);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.auth-form input {
  height: 40px;
}

.auth-error {
  min-height: 18px;
  margin: 0;
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
}

.auth-switch {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.auth-switch button {
  border: 0;
  padding: 0;
  color: var(--green);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}

.preview-3d {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 52%, var(--paper) 53%, #d7cfbd 100%);
}

.preview-3d[hidden] {
  display: none;
}

.villa-stage {
  width: min(82%, 960px);
  aspect-ratio: 2.8 / 1;
  perspective: 900px;
}

.villa-model {
  position: relative;
  width: 100%;
  height: 100%;
  transform: rotateX(5deg) rotateY(-10deg);
  transform-style: preserve-3d;
}

.villa-roof {
  position: absolute;
  left: 4%;
  right: 4%;
  top: 6%;
  height: 22%;
  border-radius: 999px;
  background:
    repeating-linear-gradient(0deg, var(--green-2) 0 3px, var(--green-3) 3px 6px);
  box-shadow: 0 16px 34px rgba(29, 53, 50, 0.22);
}

.villa-body {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 24%;
  bottom: 17%;
  border-radius: 70px;
  overflow: hidden;
  background: var(--paper);
  border: 8px solid var(--wall);
}

.ribbing {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(70, 83, 75, 0.22) 0 2px, transparent 2px 6px);
}

.glass,
.door {
  position: absolute;
  top: 13%;
  bottom: 13%;
  border: 3px solid var(--green-3);
  background: linear-gradient(120deg, rgba(227, 241, 241, 0.95), rgba(23, 92, 83, 0.26));
}

.glass-a {
  left: 19%;
  width: 24%;
}

.door {
  left: 46%;
  width: 10%;
  background: linear-gradient(90deg, #856c42, var(--accent));
}

.glass-b {
  left: 60%;
  width: 23%;
}

.villa-shadow {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 9%;
  height: 11%;
  border-radius: 50%;
  background: rgba(29, 53, 50, 0.22);
  filter: blur(9px);
}

.svg-grid line {
  stroke: rgba(70, 83, 75, 0.1);
  stroke-width: 0.01;
}

.permit-line {
  fill: none;
  stroke: var(--wall-dark);
  stroke-dasharray: 0.18 0.14;
  stroke-width: 0.035;
}

.villa-wall-shell {
  fill: var(--wall);
}

.villa-interior-fill {
  fill: var(--cream);
}

.villa-outline {
  fill: none;
  stroke: rgba(29, 53, 50, 0.55);
  stroke-width: 0.018;
  stroke-linejoin: round;
}

.villa-wall-inner {
  fill: none;
  stroke: var(--green-2);
  stroke-width: 0.022;
}

.module-divider {
  stroke: var(--green-2);
  stroke-width: 0.022;
}

.module-panel {
  fill: rgba(117, 128, 113, 0.25);
  stroke: rgba(70, 83, 75, 0.65);
  stroke-width: 0.012;
}

.headwall-panel {
  fill: rgba(23, 92, 83, 0.14);
  stroke: rgba(29, 53, 50, 0.6);
  stroke-width: 0.012;
}

.load-bearing-wall {
  stroke: var(--green-2);
  stroke-width: 0.052;
  stroke-dasharray: 0.18 0.08;
}

.load-bearing-label {
  fill: var(--green-2);
  font-weight: 700;
}

.interior-wall {
  fill: var(--wall-dark);
  stroke: var(--green-2);
  stroke-width: 0.018;
}

.fixture {
  fill: var(--cream);
  stroke: var(--ink-soft);
  stroke-width: 0.025;
}

.fixture-soft {
  fill: var(--paper);
  stroke: var(--muted);
  stroke-width: 0.02;
}

.fixture-line {
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 0.022;
}

.opening-window {
  fill: var(--surface);
  stroke: var(--green);
  stroke-width: 0.026;
}

.opening-door {
  fill: var(--accent-soft);
  stroke: #806332;
  stroke-width: 0.026;
}

.opening-line {
  fill: none;
  stroke: var(--green);
  stroke-width: 0.018;
}

.wet-core-fill {
  fill: var(--surface-2);
  stroke: none;
}

.wet-core-wall {
  fill: none;
  stroke: var(--green-2);
  stroke-width: 0.055;
}

.wet-core-divider {
  stroke: var(--green-2);
  stroke-width: 0.035;
}

.wet-core-text {
  fill: var(--green-2);
  font-weight: 600;
  pointer-events: none;
}

.item-group {
  cursor: grab;
}

.item-group:active {
  cursor: grabbing;
}

.item-group.is-selected .select-outline {
  display: block;
}

.select-outline {
  display: none;
  fill: none;
  stroke: var(--accent);
  stroke-dasharray: 0.08 0.07;
  stroke-width: 0.035;
}

.item-label {
  fill: var(--ink-soft);
  font-weight: 700;
  pointer-events: none;
}

.measure-line {
  stroke: var(--green-2);
  stroke-width: 0.018;
  marker-start: url(#arrow);
  marker-end: url(#arrow);
}

.measure-tick {
  stroke: var(--green-2);
  stroke-width: 0.018;
}

.measure-text {
  fill: var(--green-2);
  font-weight: 700;
}

.room-label {
  fill: rgba(29, 53, 50, 0.36);
  font-family: var(--font-display);
  font-weight: 400;
}

.no-grid .svg-grid,
.no-measures .measures {
  display: none;
}

.print-summary {
  display: none;
}

@media (max-width: 1320px) {
  :root {
    --panel-width: 330px;
    --right-width: 320px;
  }

  .brand-block {
    min-width: 310px;
  }

  .brand-logo {
    width: 142px;
  }

  .action-button {
    padding: 0 10px;
  }
}

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

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

  .topbar,
  .statusbar {
    flex-wrap: wrap;
    height: auto;
    padding: 12px;
  }

  .workspace {
    grid-template-columns: var(--rail-width) minmax(0, 1fr);
    overflow: visible;
    grid-template-areas:
      "rail canvas"
      "rail left"
      "rail right";
  }

  .side-rail {
    grid-area: rail;
  }

  .left-panel {
    grid-area: left;
    border-top: 1px solid var(--line);
  }

  .right-panel {
    grid-area: right;
  }

  .control-panel {
    overflow: visible;
  }

  .canvas-area {
    grid-area: canvas;
    min-height: 660px;
  }
}

@media (max-width: 760px) {
  body {
    overflow-x: hidden;
  }

  .topbar {
    max-width: 100vw;
    overflow: hidden;
  }

  .workspace {
    width: 100vw;
    max-width: 100vw;
    grid-template-columns: 1fr;
    grid-template-areas:
      "canvas"
      "left"
      "right";
  }

  .side-rail {
    display: none;
  }

  .brand-block,
  .project-title,
  .top-actions {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
  }

  .top-actions {
    overflow: visible;
    max-width: 100%;
    flex-wrap: wrap;
    padding-bottom: 3px;
  }

  .action-button,
  .icon-button {
    flex: 0 0 auto;
  }

  .control-panel,
  .canvas-area,
  .left-panel,
  .right-panel {
    width: 100%;
    max-width: 100vw;
    min-width: 0;
  }

  .panel-section {
    padding-left: 12px;
    padding-right: 12px;
  }

  .number-grid,
  .palette-grid,
  .project-actions {
    grid-template-columns: 1fr 1fr;
  }

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

  .module-cards {
    grid-template-columns: 1fr;
  }

  .canvas-area {
    padding: 10px;
    min-height: 560px;
  }

  .canvas-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

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

  .app-shell,
  .toast {
    display: none !important;
  }

  .print-summary {
    display: block;
    padding: 24px;
    color: #111;
    font-family: Arial, sans-serif;
  }

  .print-summary h1 {
    margin: 0 0 18px;
    font-size: 24px;
  }

  .print-grid {
    display: grid;
    grid-template-columns: 0.8fr 1.4fr;
    gap: 24px;
    align-items: start;
  }

  .print-grid svg {
    width: 100%;
    height: auto;
    border: 1px solid #bbb;
  }
}
