:root {
  color-scheme: light;
  --ink: #18211f;
  --muted: #66716d;
  --line: #d8dfdc;
  --surface: #ffffff;
  --page: #f5f7f4;
  --evergreen: #1e5b4f;
  --red: #a73535;
  --gold: #bd8b2f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  max-width: 760px;
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 16px;
  font-size: 1.05rem;
}

h3 {
  margin-bottom: 4px;
  font-size: 1rem;
}

.summary {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
}

.active-address {
  margin-bottom: 12px;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
}

.status {
  min-width: 220px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--evergreen);
  background: var(--surface);
  font-weight: 700;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 22px;
}

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

.active-poc-panel {
  margin-top: 22px;
  border-color: var(--evergreen);
  border-top: 5px solid var(--evergreen);
}

.active-poc-panel .source-preview img {
  width: min(100%, 1100px);
  max-height: 720px;
}

.visual-editor-panel {
  margin-top: 22px;
  border-color: #0f766e;
}

.editor-shell {
  width: min(1380px, calc(100% - 24px));
  padding-top: 18px;
}

.operator-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: start;
  padding: 14px 0 18px;
  border-bottom: 1px solid var(--line);
}

.operator-header h1 {
  margin-bottom: 6px;
  font-size: clamp(1.8rem, 4vw, 3.4rem);
}

.operator-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.view-tabs button {
  min-width: 82px;
  min-height: 34px;
  border: 1px solid #aeb8b4;
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.view-tabs button.active {
  border-color: #0f766e;
  background: #dff6f1;
}

.editor-header,
.editor-layout {
  display: grid;
  gap: 16px;
}

.editor-header {
  grid-template-columns: 1fr auto;
  align-items: start;
}

.editor-timer {
  display: none;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8faf9;
  font: 700 1rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.editor-layout {
  grid-template-columns: minmax(220px, 280px) 1fr;
  align-items: start;
}

.editor-sidebar {
  display: grid;
  gap: 14px;
}

.inventory-panel {
  border: 1px solid #93a39d;
  background: #fbfefd;
}

.inventory-panel h2 {
  color: var(--ink);
}

.inventory-panel .project-scope {
  font-size: 0.95rem;
}

.tool-palette {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.component-palette {
  display: grid;
  gap: 10px;
}

.component-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.component-group strong {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.component-group button,
.tool-palette button {
  min-height: 38px;
  border: 1px solid #aeb8b4;
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.component-group button {
  min-height: 32px;
  padding: 6px 8px;
  font-size: 0.78rem;
}

.component-group button.active,
.tool-palette button.active {
  border-color: #0f766e;
  background: #dff6f1;
}

#path-c9-drawing-mode {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding-top: 2px;
}

#path-c9-drawing-mode span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

#path-c9-drawing-mode button {
  min-height: 28px;
  font-size: 0.68rem;
}

.link-row {
  display: grid;
  grid-template-columns: 1fr 64px;
  gap: 6px;
}

.link-row[hidden] {
  display: none;
}

.photo-actions {
  display: grid;
  gap: 6px;
}

.photo-actions button {
  min-height: 34px;
  border: 1px solid #aeb8b4;
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.photo-actions button[hidden] {
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.secondary-link,
.header-actions button,
.package-builder-actions button {
  min-height: 36px;
  border: 1px solid #aeb8b4;
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
  padding: 8px 10px;
  cursor: pointer;
}

.package-builder-layout {
  display: grid;
  gap: 16px;
}

.package-builder-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.commercial-status-view { min-height: 100vh; background: var(--page); }
.commercial-shell { max-width: 1180px; }
.commercial-status-view .app-header { height: 72px; grid-template-columns: auto auto minmax(220px, 1fr) auto auto auto auto auto; gap: 18px; }
.commercial-status-view .app-brand { font-size: 1.05rem; line-height: 1.05; letter-spacing: -.01em; }
.commercial-status-view .my-designs-link { font-size: .75rem; font-weight: 760; }
.commercial-status-view .property-heading strong { font-size: 1rem; letter-spacing: -.015em; }
.commercial-status-view .property-heading span { font-size: .78rem; }
.commercial-status-view .app-nav { gap: 2px; }
.commercial-status-view .app-nav a { padding: 0 14px; font-size: .76rem; font-weight: 820; letter-spacing: .015em; }
.commercial-shell > .commercial-kicker, .commercial-shell > h1, .commercial-shell > .commercial-subtitle, .commercial-shell > .commercial-hero, .commercial-shell > .commercial-revision, .commercial-shell > .commercial-summary, .commercial-shell > .commercial-activity-section, .commercial-shell > .commercial-details, .commercial-shell > .editor-message { width: min(780px, 100%); margin-left: auto; margin-right: auto; }
.accepted-design-lock { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 8px 24px; align-items: center; margin: 12px 18px; padding: 14px 18px; border: 1px solid #b98a39; border-radius: 10px; background: #fff8e8; color: #493713; }
.accepted-design-lock[hidden] { display: none; }
.accepted-design-lock > div { display: grid; gap: 3px; }
.accepted-design-lock > div > strong { letter-spacing: .08em; }
.accepted-design-lock > div > span, .accepted-design-lock p { font-size: 12px; margin: 0; }
.accepted-design-lock dl { display: flex; gap: 20px; margin: 0; }
.accepted-design-lock dl div { display: grid; gap: 2px; }
.accepted-design-lock dt { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.accepted-design-lock dd { margin: 0; font-size: 12px; font-weight: 750; }
.accepted-design-lock p { grid-column: 1 / -1; }
.commercial-shell > .commercial-kicker { margin-top: 32px; color: #ad322d; }
.commercial-shell h1 { font-size: 27px; letter-spacing: -.035em; margin: 6px auto 4px; }
.commercial-subtitle { color: var(--muted); font-size: 13px; margin-top: 0; margin-bottom: 21px; }
.commercial-status-panel, .commercial-section, .commercial-details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 24px rgba(25,49,42,.045); padding: 20px; margin-top: 14px; }
.commercial-hero { padding: 22px 23px; }
.commercial-hero-head { display: flex; justify-content: space-between; gap: 18px; }
.commercial-status-panel h2 { font-size: 24px; font-weight: 790; letter-spacing: -.025em; margin: 7px 0 0; }
.commercial-muted { color: var(--muted); }
.commercial-status-pill { background: #e9f2ee; color: #0e4d42; border-radius: 999px; padding: 7px 10px; font-size: 11px; font-weight: 800; height: max-content; white-space: nowrap; }
.commercial-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 19px; }
.commercial-actions button, .commercial-property-row { border: 1px solid #bec9c4; background: var(--surface); color: #0e4d42; border-radius: 8px; padding: 9px 12px; cursor: pointer; font: inherit; font-size: 12px; font-weight: 760; }
.commercial-actions .primary-action { background: var(--evergreen); color: #fff; border-color: var(--evergreen); }
.commercial-actions button:disabled { opacity: .65; cursor: not-allowed; color: #9aa39f; background: #f7f8f7; border-color: #dfe4e1; }
.commercial-action-hint { color: var(--muted); font-size: 10px; margin: 8px 0 0; }
.commercial-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.commercial-summary[hidden] { display: none; }
.commercial-summary.is-single-column { grid-template-columns: 1fr; }
.commercial-summary .commercial-section { margin-top: 14px; }
.commercial-update-reason { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 13px; }
.commercial-update-reason[hidden] { display: none; }
.commercial-update-reason span { color: var(--muted); font-size: 11px; font-weight: 760; }
.commercial-update-reason p { margin: 5px 0 0; font-size: 13px; }
.commercial-engagement-main { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-top: 13px; }
.commercial-label { display: block; color: var(--muted); font-size: 11px; }
.commercial-engagement-main > div:first-child strong { display: block; font-size: 18px; font-weight: 780; margin-top: 5px; }
.commercial-view-total { text-align: right; }
.commercial-view-total strong { display: block; font-size: 23px; font-weight: 790; }
.commercial-first-viewed { border-top: 1px solid var(--line); margin: 14px 0 0; padding-top: 11px; font-size: 12px; color: var(--muted); }
.commercial-empty { margin: 14px 0 0; font-size: 12px; color: var(--muted); line-height: 1.45; }
.commercial-empty span { font-size: 11px; }
.commercial-decision h2 { font-size: 18px; font-weight: 770; margin: 12px 0 6px; }
.commercial-decision .commercial-muted { font-size: 12px; line-height: 1.45; }
.commercial-decision #commercial-selected-package { color: var(--evergreen); margin-bottom: 2px; }
.commercial-decision #commercial-selected-price { font-size: 18px; }
.commercial-decision #commercial-create-revision { margin-top: 15px; }
.commercial-next-step { display: flex; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 14px; padding-top: 11px; font-size: 12px; }
.commercial-next-step strong { color: var(--evergreen); }
.commercial-activity-section { align-self: start; height: auto; min-height: 0; padding: 19px 20px; }
.commercial-activity-heading { font-size: 14px; margin: 5px 0 4px; }
.commercial-activity { display: grid; align-content: start; gap: 0; min-height: 0; height: auto; }
.commercial-activity-day { font-size: 10px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 18px 0 5px; }
.commercial-activity-row { display: grid; grid-template-columns: 70px 14px 1fr; gap: 10px; padding: 9px 0; }
.commercial-activity-row time { color: var(--muted); font-size: 11px; text-align: right; }
.commercial-activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--evergreen); margin-top: 3px; }
.commercial-activity-row strong { font-size: 12px; }
.commercial-activity-row p { font-size: 11px; color: var(--muted); margin: 3px 0 0; }
.commercial-details { overflow: hidden; }
.commercial-details summary { display: flex; justify-content: space-between; cursor: pointer; font-weight: 700; padding: 0; }
.commercial-details:not([open]) > div { display: none; }
.commercial-details[open] > div { display: grid; gap: 8px; margin-top: 14px; }
.commercial-property-row { display: flex; justify-content: space-between; text-align: left; width: 100%; }
.commercial-detail-value { color: var(--muted); overflow-wrap: anywhere; padding: 0 4px 8px; }
@media (max-width: 820px) { .commercial-summary { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .commercial-hero-head { gap: 10px; } .commercial-status-pill { font-size: 10px; } .commercial-activity-row { grid-template-columns: 58px 14px 1fr; } }
.header-action-button.is-success { background: var(--evergreen); }
.header-action-button.is-failure { border-color: #a64132; background: #a64132; }

.package-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.package-summary {
  display: grid;
  gap: 10px;
}

.package-inventory,
.package-review-reasons {
  display: grid;
  gap: 6px;
}

.package-inventory h3,
.package-review-reasons h3 {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
}

.package-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 800;
}

.package-check.inherited {
  color: var(--muted);
}

.package-selection-table th:nth-child(n+4),
.package-selection-table td:nth-child(n+4) {
  text-align: center;
}

.presentation-package-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.presentation-package-tabs button {
  min-height: 44px;
  border: 1px solid #aeb8b4;
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.presentation-package-tabs button.active {
  border-color: #0f766e;
  background: #dff6f1;
}

.package-presentation-layout { display: block; margin-top: 18px; }

.presentation-stage-wrap { display: grid; gap: 8px; }

.presentation-stage {
  width: 100%;
  max-height: calc(100vh - 220px);
}

body.presentation-embed {
  margin: 0;
  min-width: 0;
  background: #f4f6f3;
}

body.presentation-embed .app-header,
body.presentation-embed .presentation-package-tabs,
body.presentation-embed .presentation-customer-heading,
body.presentation-embed .presentation-info-band {
  display: none;
}

body.presentation-embed .shell,
body.presentation-embed .package-presentation-layout,
body.presentation-embed .presentation-stage-wrap {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

body.presentation-embed .presentation-stage {
  width: 100%;
  min-height: 0;
  max-height: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body.presentation-viewer-embed {
  height: 100%;
  overflow: hidden;
  background: #0d1714;
}

body.presentation-viewer-embed .shell,
body.presentation-viewer-embed .package-presentation-layout,
body.presentation-viewer-embed .presentation-stage-wrap {
  height: 100%;
}

body.presentation-viewer-embed .package-presentation-layout,
body.presentation-viewer-embed .presentation-stage-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

body.presentation-viewer-embed .presentation-stage {
  width: 100%;
  height: auto;
  max-height: 100%;
  aspect-ratio: var(--editor-image-aspect-ratio, 632 / 317);
  background: #0d1714;
}

.proposal-intro { display: grid; min-width: 0; max-width: 960px; margin: 38px auto 26px; padding: 0 32px; text-align: center; }
.proposal-brand { margin: 0; color: var(--evergreen); font-family: inherit; font-size: 11px; font-weight: 600; letter-spacing: .18em; line-height: 14px; text-transform: uppercase; }
.proposal-intro h1 { width: 100%; min-width: 0; max-width: 660px; margin: 16px auto 0; color: var(--evergreen); font-family: Georgia, serif; font-size: 48px; font-weight: 500; letter-spacing: -.025em; line-height: 1; }
.proposal-address { margin: 13px 0 0; color: var(--ink); font-family: inherit; font-size: 15px; font-weight: 500; line-height: 1.35; }
.proposal-intro-copy { width: 100%; min-width: 0; max-width: 560px; margin: 15px auto 0; color: var(--muted); font-family: inherit; font-size: 16px; font-weight: 400; line-height: 1.4; }
.proposal-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.proposal-card { display: grid; grid-template-rows: auto 180px 1fr; overflow: hidden; border: 1px solid #d4ddd8; border-radius: 8px; background: #fff; box-shadow: 0 12px 28px rgba(18, 49, 38, .08); }
.proposal-acceptance-recovery { grid-column: 1 / -1; grid-template-rows: auto 1fr; width: min(100%, 620px); margin: 0 auto; }
.proposal-card.featured { border-color: #9e7a3c; box-shadow: 0 16px 32px rgba(18, 49, 38, .14); transform: translateY(-8px); }
.proposal-card header { padding: 22px 22px 16px; }
.proposal-card-kicker, .proposal-card-descriptor { margin: 0; color: var(--muted); font-size: .76rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.proposal-card h2 { margin: 7px 0 8px; color: var(--evergreen); font-family: Georgia, serif; font-size: 1.35rem; font-weight: 500; letter-spacing: 0; }
.proposal-card-descriptor { color: #8b6a37; letter-spacing: 0; text-transform: none; font-size: .95rem; }
.proposal-visual-frame { position: relative; overflow: hidden; background: #edf1ed; }
.proposal-card-visual, .proposal-viewer-stage { touch-action: none; }
.proposal-card-visual { width: 100%; height: 180px; }
.proposal-visual-loading { position: absolute; inset: 0; background: #edf1ed; }
.proposal-visual-frame iframe { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; opacity: 0; visibility: hidden; }
.proposal-visual-frame.is-ready iframe { opacity: 1; visibility: visible; }
.proposal-card-visual iframe { pointer-events: none; }
.proposal-card-body { display: grid; grid-template-rows: auto auto 1fr auto; padding: 18px 22px 22px; }
.proposal-investment { margin-bottom: 14px; }
.proposal-investment span, .proposal-scope-heading { display: block; margin: 0 0 4px; color: var(--muted); font-size: .68rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.proposal-price { display: block; color: var(--evergreen); font-size: 1.45rem; }
.proposal-scope-heading { margin-top: 0; margin-bottom: 8px; }
.proposal-scope { display: grid; gap: 6px; min-height: 96px; color: var(--muted); font-size: .9rem; }
.proposal-scope span { display: block; }
.proposal-more-scope { width: max-content; padding: 0; border: 0; background: transparent; color: var(--evergreen); font: inherit; font-size: .88rem; font-weight: 800; cursor: pointer; text-decoration: underline; }
.proposal-card-actions { display: grid; gap: 8px; margin-top: 16px; }
.proposal-card-actions button, .proposal-select-dialog button { min-height: 42px; border: 1px solid #aeb8b4; border-radius: 5px; background: #fff; color: var(--evergreen); font-weight: 800; cursor: pointer; }
.proposal-card-actions .proposal-select-button { border-color: var(--evergreen); background: var(--evergreen); color: #fff; }
.proposal-dialog { width: min(92vw, 1400px); max-width: 92vw; max-height: 92vh; padding: 0; border: 0; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.proposal-dialog::backdrop { background: rgba(12, 30, 22, .68); }
.proposal-dialog-content { position: relative; max-height: 92vh; overflow-y: auto; padding: 28px; background: #fff; }
.dialog-close { position: absolute; top: 12px; right: 14px; width: 34px; height: 34px; border: 0; background: transparent; color: var(--muted); font-size: 1.7rem; cursor: pointer; }
.proposal-detail-frame { margin: 18px 0; width: 100%; aspect-ratio: 587 / 248; border-radius: 6px; }
.proposal-detail-info-band { display: grid; grid-template-columns: minmax(190px, 28%) minmax(0, 1fr); gap: 28px; align-items: start; }
.proposal-detail-scope .proposal-scope { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 20px; min-height: 0; }
.proposal-detail-scope .proposal-scope-heading { margin-bottom: 10px; }
.proposal-viewer-open { overflow: hidden; }
.proposal-viewer-dialog { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: 100vw; max-height: 100dvh; margin: 0; padding: 0; border: 0; border-radius: 0; overflow: hidden; background: #12231e; color: #fff; }
.proposal-viewer-dialog .proposal-dialog-content { display: block; width: 100%; height: 100%; max-height: none; padding: 0; overflow: hidden; background: #12231e; }
.proposal-viewer-dialog > .proposal-dialog-content > .dialog-close { display: none; }
.proposal-viewer-dialog #proposal-detail-content { width: 100%; height: 100%; min-height: 0; }
.proposal-viewer { display: grid; grid-template-rows: auto minmax(0, 1fr); width: 100%; height: 100%; min-height: 0; }
.proposal-viewer-header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); background: #12231e; }
.proposal-viewer-close, .proposal-viewer-nav { border: 0; color: #fff; cursor: pointer; }
.proposal-viewer-close { width: 38px; height: 38px; padding: 0; border-radius: 50%; background: rgba(255,255,255,.12); font-size: 1.8rem; line-height: 1; }
.proposal-viewer-identification { display: grid; gap: 2px; min-width: 0; }
.proposal-viewer-identification strong { overflow: hidden; color: #fff; font-size: .96rem; text-overflow: ellipsis; white-space: nowrap; }
.proposal-viewer-identification span, .proposal-viewer-position { color: rgba(255,255,255,.72); font-size: .76rem; }
.proposal-viewer-position { white-space: nowrap; }
.proposal-viewer-stage { min-width: 0; min-height: 0; border-radius: 0; background: #0d1714; }
.proposal-viewer-stage .proposal-visual-loading { background: #0d1714; }
.proposal-viewer-pan-layer { position: absolute; top: 0; left: 0; display: block; transform-origin: 0 0; will-change: transform; }
.proposal-viewer-pan-layer iframe { display: block; width: 100%; height: 100%; border: 0; opacity: 0; visibility: hidden; pointer-events: none; }
.proposal-viewer-stage.is-ready .proposal-viewer-pan-layer iframe { opacity: 1; visibility: visible; }
.proposal-viewer-nav { position: absolute; top: 50%; z-index: 2; width: 42px; height: 64px; margin-top: -32px; border-radius: 4px; background: rgba(0,0,0,.35); font-size: 2.4rem; line-height: 1; }
.proposal-viewer-nav:hover, .proposal-viewer-close:hover { background: rgba(255,255,255,.22); }
.proposal-viewer-prev { left: 12px; }
.proposal-viewer-next { right: 12px; }
.proposal-viewer-dialog.proposal-viewer-landscape-viewport { position: fixed; top: var(--proposal-viewer-visible-top, 0px); left: var(--proposal-viewer-visible-left, 0px); width: var(--proposal-viewer-visible-width, 100vw); height: var(--proposal-viewer-visible-height, 100dvh); max-width: var(--proposal-viewer-visible-width, 100vw); max-height: var(--proposal-viewer-visible-height, 100dvh); margin: 0; }
.proposal-select-dialog { max-width: 480px; }
.proposal-select-dialog p:not(.eyebrow) { color: var(--muted); line-height: 1.5; }
.proposal-agreement-status { display: grid; gap: 8px; margin-top: 14px; }
.proposal-select-dialog button:disabled { width: 100%; cursor: not-allowed; opacity: .6; }
@media (max-width: 900px) {
  .proposal-cards { grid-template-columns: 1fr; max-width: 620px; margin: 0 auto; }
  .proposal-card { display: block; }
  .proposal-card.featured { transform: none; }
  .proposal-card-visual { height: auto; aspect-ratio: 587 / 248; min-height: 0; }
  .proposal-card-body { display: grid; }
  .proposal-card .proposal-scope { min-height: 0; }
  .proposal-detail-scope .proposal-scope { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .proposal-intro { margin: 24px auto 20px; padding: 0 20px; }
  .proposal-brand { font-size: 10px; letter-spacing: .16em; line-height: 13px; }
  .proposal-intro h1 { max-width: 340px; margin-top: 14px; font-size: 34px; line-height: 1.04; letter-spacing: -.02em; }
  .proposal-address { margin-top: 10px; font-size: 14px; line-height: 1.35; }
  .proposal-intro-copy { max-width: 320px; margin-top: 11px; font-size: 15px; line-height: 1.35; }
  .proposal-card header { padding: 16px 16px 12px; }
  .proposal-card-body { padding: 14px 16px 16px; }
  .proposal-card .proposal-investment { margin-bottom: 12px; }
  .proposal-card .proposal-scope { gap: 5px; }
  .proposal-card .proposal-scope-heading { margin-bottom: 6px; }
  .proposal-card .proposal-card-actions { gap: 6px; margin-top: 12px; }
  .proposal-detail-info-band { grid-template-columns: 1fr; gap: 16px; }
  .proposal-detail-scope .proposal-scope { grid-template-columns: 1fr; }
  .proposal-viewer-header { gap: 9px; padding-left: 12px; padding-right: 12px; }
  .proposal-viewer-stage { min-height: 0; }
  .proposal-viewer-nav { width: 36px; height: 54px; margin-top: -27px; }
  .proposal-viewer-prev { left: 8px; }
  .proposal-viewer-next { right: 8px; }
}

.presentation-stage img {
  z-index: 0;
}

body.presentation-embed .presentation-stage[data-presentation-framing="card"] img {
  object-fit: cover;
  object-position: var(--presentation-object-position, 50% 62%);
}

.presentation-stage svg {
  cursor: default;
  pointer-events: none;
  z-index: 2;
}

.presentation-customer-heading { padding: 20px 0 4px; }
.presentation-summary-eyebrow { margin: 0 0 4px; color: var(--red); font-size: .72rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.presentation-customer-heading h2 { margin: 0; font-size: 1.35rem; }
.presentation-summary-description { margin: 5px 0 12px; color: var(--muted); }
.presentation-info-band { display: grid; grid-template-columns: minmax(190px, 28%) minmax(0, 1fr); gap: 28px; align-items: start; padding: 18px 0 10px; border-top: 1px solid var(--line); }
.presentation-investment strong { display: block; color: var(--ink); font-size: clamp(1.5rem, 2.3vw, 2rem); line-height: 1.1; }
.presentation-scope > .presentation-summary-eyebrow { margin-bottom: 10px; }
.presentation-customer-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 20px; }
.presentation-feature-chip { padding: 6px 9px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--ink); font-size: .78rem; font-weight: 800; }

@media (max-width: 900px) {
  .presentation-customer-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .presentation-info-band { grid-template-columns: 1fr; gap: 16px; }
  .presentation-customer-features { grid-template-columns: 1fr; }
}

.presentation-decoration {
  pointer-events: none;
}

.presentation-review-required {
  opacity: 0.72;
}

@media (max-width: 900px) {
  .package-summary-grid,
  .presentation-package-tabs {
    grid-template-columns: 1fr;
  }
}

.benchmark-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.benchmark-controls label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.benchmark-controls select {
  min-width: 230px;
  min-height: 36px;
  border: 1px solid #aeb8b4;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.benchmark-render {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #e5e7eb;
}

.stack {
  display: grid;
  gap: 8px;
}

.kv {
  display: grid;
  grid-template-columns: minmax(130px, 0.42fr) 1fr;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eef2f0;
}

.kv strong {
  color: var(--muted);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

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

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

.data-table th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.compact-field {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.compact-field select,
.compact-field input {
  min-height: 34px;
  width: 100%;
  border: 1px solid #aeb8b4;
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.scale-status,
.measurement-panel {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.84rem;
}
.measurement-primary-value { display: block; }
.inspector-root #inspector-controls .measurement-primary-value strong { color: var(--ink); font-size: 24px; font-weight: 650; line-height: 1.1; letter-spacing: 0; text-transform: none; white-space: nowrap; }
.inspector-root #inspector-controls .measurement-source strong { color: var(--muted); font-size: 13px; font-weight: 500; line-height: 1.2; letter-spacing: 0; text-transform: none; }
.inspector-root #inspector-controls .measurement-warning strong { color: #9a6a16; font-size: 12px; font-weight: 500; line-height: 1.2; letter-spacing: 0; text-transform: none; }
.inspector-root #inspector-controls .measurement-material strong,
.inspector-root #inspector-controls .measurement-material span { color: var(--muted); font-size: 13px; font-weight: 500; line-height: 1.2; letter-spacing: 0; text-transform: none; }
.light-swatch { display: inline-block; width: 11px; height: 11px; border-radius: 50%; border: 1px solid #c9a94b; background: #fff4b0; box-shadow: 0 0 0 2px rgba(255, 244, 176, .3); vertical-align: -.05em; }
.light-swatch[data-light-color="red"] { background: #df5b55; border-color: #a33e39; }
.light-swatch[data-light-color="green"] { background: #4f9a69; border-color: #2f6e48; }
.light-swatch[data-light-color="blue"] { background: #5e85c4; border-color: #3b5d96; }
.inspector-disclosure { display: flex; width: 100%; justify-content: space-between; align-items: center; min-height: 36px; margin-top: 10px; padding: 7px 0; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--ink); font: inherit; font-weight: 800; text-align: left; cursor: pointer; }
.inspector-disclosure-panel { display: grid; gap: 8px; padding: 8px 0 4px; }
.inspector-disclosure-panel[hidden] { display: none; }
.inspector-disclosure:hover, .inspector-disclosure:focus-visible, .inspector-row-action:hover, .inspector-row-action:focus-visible { background: #f4f8f6; outline: none; }
.inspector-row-action { display: flex; width: 100%; justify-content: space-between; align-items: center; min-height: 36px; padding: 7px 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-weight: 800; text-align: left; cursor: pointer; }
.inspector-installation-options { margin-top: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.review-eyebrow { display: block; margin-top: 10px; color: var(--muted); font-size: .68rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.review-option { display: grid; gap: 2px; padding: 6px 0 8px; border-bottom: 1px solid var(--line); }
.review-option > span { color: var(--muted); font-size: .78rem; line-height: 1.35; }
.review-option-action { display: flex; width: 100%; justify-content: space-between; align-items: center; min-height: 34px; padding: 4px 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: .84rem; font-weight: 750; text-align: left; cursor: pointer; }
.review-option-action:hover, .review-option-action:focus-visible { background: #f4f8f6; outline: none; }
.review-advanced-panel { display: grid; gap: 6px; padding-top: 2px; }
.review-advanced-panel[hidden] { display: none; }
.review-status-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; color: var(--muted); font-size: .78rem; }
.inspector-root #inspector-controls .review-status-row strong { color: var(--ink); font-size: .78rem; font-weight: 600; letter-spacing: 0; text-transform: none; }
.measurement-details { display: grid; gap: 6px; color: var(--muted); font-size: .76rem; }
.inspector-delete { width: 100%; min-height: 36px; border: 1px solid #b14a45; border-radius: 5px; background: #fff; color: #a02e2e; font: inherit; font-weight: 800; cursor: pointer; }

.operator-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.measurement-actions {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.measurement-actions button {
  min-height: 34px;
  border: 1px solid #aeb8b4;
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.measurement-actions button:disabled {
  color: #9aa5a1;
  cursor: not-allowed;
}

.perspective-panel {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #aeb8b4;
  border-radius: 6px;
  background: #fbfcfb;
  color: var(--muted);
  font-size: 0.82rem;
}

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

.perspective-panel p {
  margin: 0;
}

.perspective-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.perspective-actions button {
  min-height: 32px;
  border: 1px solid #aeb8b4;
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.perspective-actions button:disabled {
  color: #9aa5a1;
  cursor: not-allowed;
}

.link-row select,
.link-row button {
  min-height: 34px;
  border: 1px solid #aeb8b4;
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
}

.link-row button:disabled,
.link-row select:disabled {
  color: #9aa5a1;
  cursor: not-allowed;
}

.project-scope {
  display: grid;
  gap: 5px;
  font-size: 0.84rem;
}

.scope-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.scope-line strong {
  text-align: right;
}

.editor-state {
  max-height: 260px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfb;
}

.editor-stage-wrap {
  display: grid;
  gap: 8px;
}

.editor-stage {
  position: relative;
  width: min(100%, 920px);
  aspect-ratio: var(--editor-image-aspect-ratio, 632 / 317);
  border: 1px solid var(--line);
  background: #111827;
  overflow: hidden;
  touch-action: none;
}

.operator-stage {
  width: 100%;
  max-height: calc(100vh - 168px);
}

.operator-sidebar {
  padding: 0;
}

.operator-sidebar h2 {
  margin: 14px 0 8px;
  font-size: 0.92rem;
}

.editor-stage img,
.editor-stage svg {
  position: absolute;
  left: 0;
  top: 0;
  right: auto;
  bottom: auto;
  display: block;
  width: 100%;
  height: 100%;
}

.editor-stage img[hidden] { display: none; }

.editor-stage svg {
  cursor: default;
}

.editor-stage.is-placement-mode svg,
.editor-stage.is-drawing-mode svg {
  cursor: crosshair;
}

.editor-stage.is-delete-mode svg {
  cursor: pointer;
}

.editor-stage.is-dragging svg {
  cursor: grabbing;
}

.editor-empty-view {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  gap: 12px;
  align-content: center;
  place-items: center;
  background: #f8faf9;
  color: var(--muted);
  font-weight: 800;
}

.editor-empty-view button {
  min-height: 38px;
  padding: 8px 14px;
  border: 0;
  border-radius: 5px;
  background: var(--evergreen);
  color: #fff;
  font: inherit;
  font-size: .8rem;
  cursor: pointer;
}

.editor-empty-view button:hover { background: #164d40; }

.empty-view-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #d8e6e0;
  border-top-color: var(--evergreen);
  border-radius: 50%;
  animation: empty-view-spin .8s linear infinite;
}

.empty-view-spinner[hidden] { display: none; }

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

.empty-view-heading {
  font-size: 1rem;
  color: var(--ink);
}

.empty-view-heading[hidden] { display: none; }

.editor-empty-view[hidden] {
  display: none;
}

.editor-message {
  min-height: 26px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.editor-line {
  fill: none;
  stroke: #15b8ff;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.editor-line.selected {
  stroke: #ff2d55;
}

.editor-roofline-guide {
  stroke: rgba(21, 184, 255, 0.28);
  stroke-width: 1.15;
}

.editor-roofline-guide.selected {
  stroke: rgba(21, 184, 255, 0.95);
  stroke-width: 2.2;
}

.roofline-status-dot { pointer-events: none; }
.roofline-status-dot-ring { fill: none; stroke: rgba(255, 255, 255, 0.92); stroke-width: 2.2; }
.roofline-status-dot-fill { stroke: #10151a; stroke-width: 1.4; }

.editor-rough-stroke {
  fill: none;
  stroke: #f97316;
  stroke-width: 3;
  stroke-dasharray: 7 6;
  stroke-linecap: round;
}

.editor-control {
  fill: #ffffff;
  stroke: #111827;
  stroke-width: 2;
}

.editor-control.window-close-target {
  fill: #fff7d2;
  stroke: #ff2d55;
  stroke-width: 2.5;
}

.window-close-snap {
  stroke: #ff2d55;
  stroke-dasharray: 4 4;
}

.editor-scale-line {
  fill: none;
  stroke: #fde047;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 8 5;
}

.editor-scale-point {
  fill: #fde047;
  stroke: #111827;
  stroke-width: 2;
}

.editor-perspective-reference {
  fill: none;
  stroke: #10b981;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.editor-perspective-reference.draft {
  stroke-dasharray: 6 5;
}

.editor-perspective-marker {
  fill: #065f46;
  stroke: #ffffff;
  stroke-width: 3;
  paint-order: stroke;
  font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

[data-editor-workspace="design"] [data-measurement-only],
[data-editor-workspace="measurement"] [data-design-only],
[data-editor-workspace="measurement"] #selection-micro-summary,
[data-editor-workspace="measurement"] #twilight-recovery-state {
  display: none !important;
}

.compact-measurement-status {
  padding: 5px 8px;
  min-height: 28px;
  font-size: .7rem;
  font-weight: 800;
}

.measurement-setup {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.measurement-setup-heading,
.measurement-setup-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.measurement-setup-heading { justify-content: space-between; }
.measurement-setup-steps span { color: var(--muted); font-size: .7rem; font-weight: 800; }
.measurement-setup-prompt { color: var(--ink); font-size: .7rem; font-weight: 700; }
.measurement-setup-steps button { min-height: 28px; padding: 5px 8px; font-size: .68rem; }
.compact-measurement-status { min-height: 28px; padding: 5px 8px; font-size: .7rem; font-weight: 800; }
[data-editor-workspace="design"] [data-measurement-only],
[data-editor-workspace="measurement"] [data-design-only],
[data-editor-workspace="measurement"] #selection-micro-summary {
  display: none !important;
}
[data-editor-workspace="measurement"] .operator-editor {
  grid-template-columns: minmax(0, 1fr);
}
.measurement-reference-line {
  fill: none;
  stroke: #f59e0b;
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
  stroke-linecap: round;
}
.measurement-reference-line.draft { stroke: #f97316; stroke-width: 2; }
.measurement-reference-label {
  fill: #92400e;
  font: 800 10px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  paint-order: stroke;
  stroke: #fff7ed;
  stroke-width: 3px;
}

.editor-warning {
  fill: #b45309;
  stroke: #ffffff;
  stroke-width: 3;
  paint-order: stroke;
  font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.c9-light {
  pointer-events: none;
}

.c9-bloom {
  fill: #ffd992;
  opacity: 0.08;
}

.c9-halo {
  fill: #ffe8b9;
  opacity: 0.18;
}

.wreath-light {
  fill: #ffdca8;
  opacity: 0.24;
}

.wreath-v3-light {
  fill: #fff9df;
  stroke: none;
  filter: drop-shadow(0 0 0.35px rgba(255, 236, 175, 0.25));
}

.c9-bulb {
  fill: #fff1bd;
  stroke: #e0b969;
  stroke-width: 0.22;
}

.c9-core {
  fill: #fffdf4;
  opacity: 1;
}

.c9-spark {
  fill: #ffffff;
  opacity: 0.88;
}

.c9-socket {
  fill: #102a1f;
  opacity: 0.72;
}

.wreath-foliage {
  fill: #215c3d;
  stroke: #123826;
  stroke-width: 3;
  opacity: 0.94;
}

.wreath-foliage-asset {
  pointer-events: none;
}

.wreath-contact-shadow {
  fill: rgba(5, 18, 10, 0.22);
  filter: blur(1.2px);
  pointer-events: none;
}

.wreath-hole {
  fill: rgba(255, 255, 255, 0.05);
  stroke: #143c2a;
  stroke-width: 2;
}

.editor-wreath.selected .wreath-foliage {
  stroke: #ff2d55;
}

.tree-wrap-trunk,
.garland-line,
.garland-shadow,
.garland-foliage-main,
.garland-foliage-sheen,
.walkway-line,
.spritzer-spoke {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tree-wrap-trunk {
  stroke: #6b3f24;
  stroke-width: 5;
}

.tree-wrap-light,
.garland-light,
.walkway-light,
.spritzer-core {
  fill: #fff3c4;
  stroke: #f5b94c;
  stroke-width: 0.55;
  filter: drop-shadow(0 0 3px rgba(255, 220, 168, 0.7));
}

.tree-wrap-light {
  fill: none;
  stroke: #fff3c4;
  stroke-width: 2;
}

.tree-mini-coil-path {
  fill: none;
  stroke: rgba(255, 239, 194, 0.34);
  stroke-width: 0.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.tree-mini-light {
  pointer-events: none;
}

.tree-mini-bloom {
  fill: #ffd992;
  opacity: 0.13;
}

.tree-mini-halo {
  fill: #ffe8b9;
  opacity: 0.29;
}

.tree-mini-core {
  fill: #fffdf4;
  stroke: #f5c86a;
  stroke-width: 0.18;
}

.tree-treatment-envelope {
  fill: rgba(20, 184, 166, 0.05);
  stroke: rgba(20, 184, 166, 0.78);
  stroke-width: 1.2;
  stroke-dasharray: 6 5;
}

.tree-treatment-axis {
  stroke: rgba(20, 184, 166, 0.82);
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-dasharray: 5 4;
}

.tree-treatment-axis.draft {
  stroke: rgba(249, 115, 22, 0.88);
}

.tree-trunk-helix-wire {
  stroke: rgba(34, 52, 41, 0.36);
  stroke-width: 0.55;
  stroke-linecap: round;
  pointer-events: none;
}

.tree-trunk-helix-wire.back {
  opacity: 0.5;
}

.tree-mini-light.back {
  opacity: 0.68;
}

.tree-trunk-centerline {
  fill: none;
  stroke: rgba(20, 184, 166, 0.82);
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 5 4;
}

.tree-trunk-centerline.draft {
  stroke: rgba(249, 115, 22, 0.88);
}

.tree-trunk-width-guide {
  stroke: rgba(20, 184, 166, 0.74);
  stroke-width: 1.15;
  stroke-linecap: round;
  stroke-dasharray: 4 4;
}

.tree-treatment-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 6px 0;
}

.tree-treatment-control button.active {
  background: #123826;
  color: #ffffff;
  border-color: #123826;
}

.tree-branch-wrap-actions {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 5px;
  margin: 6px 0 8px;
}

.tree-branch-wrap-actions button {
  font-size: 0.72rem;
  padding: 6px 7px;
}

.tree-branch-wrap-actions button:nth-of-type(n + 3) {
  grid-column: 1 / -1;
}

.tree-branch-wrap-actions button:disabled {
  opacity: 0.45;
}

.tree-branch-wrap-actions span {
  align-self: center;
  color: #365344;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
}

.tree-branch-mini-light.mid {
  opacity: 0.82;
}

.tree-trunk-branch-wrap-mask {
  fill: none;
  stroke: rgba(20, 184, 166, 0.13);
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.tree-trunk-branch-wrap-mask.draft {
  stroke: rgba(249, 115, 22, 0.18);
}

.tree-trunk-branch-wrap-stroke {
  fill: none;
  stroke: rgba(20, 184, 166, 0.72);
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 4 4;
  pointer-events: none;
}

.tree-trunk-branch-wrap-stroke.draft {
  stroke: rgba(249, 115, 22, 0.92);
}

.tree-branch-wrap-path {
  fill: none;
  stroke: rgba(20, 184, 166, 0.7);
  stroke-width: 1.15;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 4 4;
  pointer-events: none;
}

.tree-branch-wrap-path.branch {
  stroke: rgba(16, 185, 129, 0.64);
}

.tree-branch-wrap-path.selected-branch {
  stroke: rgba(249, 115, 22, 0.92);
  stroke-width: 1.45;
}

.tree-branch-wrap-path.draft {
  stroke: rgba(249, 115, 22, 0.88);
}

.tree-branch-wrap-width-guide {
  stroke: rgba(20, 184, 166, 0.62);
  stroke-width: 1;
  stroke-linecap: round;
  stroke-dasharray: 3 4;
}

.tree-branch-wrap-width-guide.branch {
  stroke: rgba(16, 185, 129, 0.54);
}

.garland-line {
  stroke: #215c3d;
  stroke-width: 7;
}

.garland-shadow {
  stroke: rgba(5, 24, 15, 0.42);
}

.garland-foliage-main {
  stroke: #194f31;
  opacity: 0.86;
}

.garland-sprig {
  fill: none;
  stroke: #2a633a;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.92;
}

.garland-sprig-needle {
  fill: none;
  stroke: #67915a;
  stroke-width: 0.8;
  stroke-linecap: round;
  opacity: 0.78;
}

.garland-mini-light {
  fill: #fff9df;
  stroke: none;
  filter: drop-shadow(0 0 1.4px rgba(255, 236, 175, 0.6));
}

.garland-door-light {
  filter: drop-shadow(0 0 0.45px rgba(255, 236, 175, 0.31));
}

.garland-linear-light {
  filter: drop-shadow(0 0 0.45px rgba(255, 236, 175, 0.31));
}

.garland-foliage-asset {
  pointer-events: none;
}

.garland-foliage-macro {
  pointer-events: none;
}

.garland-foliage-macro-body {
  fill: #356f3f;
  stroke: #163b22;
  stroke-width: 0.1;
  stroke-linejoin: round;
}

.garland-foliage-macro-accent {
  fill: none;
  stroke: #8eaf70;
  stroke-width: 0.14;
  stroke-linecap: round;
  opacity: 0.72;
}

.presentation-stage[data-presentation-mode="day"] .garland-mini-light {
  filter: none;
}

.presentation-stage[data-presentation-mode="twilight"] .garland-mini-light {
  filter: drop-shadow(0 0 2.2px rgba(255, 226, 151, 0.72));
}

.garland-centerline-construction {
  fill: none;
  stroke: #ff2d55;
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.walkway-line {
  stroke: rgba(255, 243, 196, 0.55);
  stroke-width: 2;
  stroke-dasharray: 5 6;
}

.walkway-light {
  r: 3;
}

.spritzer-spoke {
  stroke: #294b38;
  stroke-width: 1.15;
  opacity: 0.84;
}

.spritzer-led {
  fill: #fff8df;
  stroke: #fff1b8;
  stroke-width: 0.32;
  filter: drop-shadow(0 0 1.3px rgba(255, 230, 174, 0.46));
}

.spritzer-hub {
  fill: #173525;
  opacity: 0.82;
}

.spritzer-v2-foliage,
.spritzer-foliage-core,
.spritzer-foliage-branch,
.spritzer-foliage-cluster {
  pointer-events: none;
}

.spritzer-foliage-core {
  fill: #102d1c;
  opacity: 0.88;
}

.spritzer-foliage-branch {
  fill: none;
  stroke: #1c492b;
  stroke-linecap: round;
}

.spritzer-foliage-cluster {
  fill: #3f7544;
  stroke: #183b22;
  stroke-width: 0.08;
  stroke-linejoin: round;
}

.editor-tree-wrap.selected .tree-wrap-trunk,
.editor-walkway.selected .walkway-line {
  stroke: #ff2d55;
}

[data-presentation-mode="twilight"] .spritzer-led {
  filter: drop-shadow(0 0 2.4px rgba(255, 230, 174, 0.72));
}

.editor-rotate-control {
  fill: #ffffff;
  stroke: #0f766e;
  stroke-width: 2;
}

.legacy-reference {
  margin-top: 22px;
  padding: 18px;
  border: 2px dashed #8d9692;
  border-radius: 8px;
  background: #eef2ef;
}

.legacy-reference > .panel {
  margin-top: 18px;
}

.legacy-note {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 700;
}

.stack {
  display: grid;
  gap: 10px;
}

.row,
.manifest {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.price {
  color: var(--evergreen);
  font-size: 1.2rem;
  font-weight: 800;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f8eed9;
  color: #6f4811;
  font-size: 0.78rem;
  font-weight: 800;
}

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

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

.workflow-tile {
  display: grid;
  gap: 12px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.debug-detail {
  display: grid;
  gap: 12px;
}

.debug-record-list {
  display: grid;
  gap: 12px;
}

.debug-record {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfb;
}

.field-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.32fr) 1fr;
  gap: 8px 12px;
  margin: 0;
}

.field-grid div {
  display: contents;
}

.field-grid dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.field-grid dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.field-grid ul {
  margin: 0;
  padding-left: 18px;
}

.workflow-tile h4 {
  margin: 4px 0 0;
  font-size: 0.9rem;
}

pre {
  max-width: 100%;
  margin: 0;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 0.82rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

.source-preview {
  margin: 12px 0 0;
}

.source-preview img {
  display: block;
  width: min(100%, 720px);
  max-height: 420px;
  object-fit: contain;
  border: 1px solid var(--line);
  background: #fff;
}

.source-preview figcaption {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.manifest ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

@media (max-width: 760px) {
  .hero,
  .grid,
  .manifest-grid,
  .workflow-grid,
  .editor-header,
  .editor-layout,
  .operator-header,
  .operator-editor {
    grid-template-columns: 1fr;
  }

  .status {
    min-width: 0;
  }

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

/* Application workspace shell */
[hidden] { display: none !important; }
body:has(.editor-shell) { overflow: hidden; }
.editor-shell {
  width: 100%;
  max-width: none;
  height: 100vh;
  min-height: 620px;
  padding: 0 18px 12px;
  overflow: hidden;
}

.app-header {
  height: 58px;
  display: grid;
  grid-template-columns: auto auto minmax(160px, 1fr) auto auto auto auto auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  border-bottom: 1px solid var(--line);
}

.app-brand { color: var(--evergreen); font-size: 1.05rem; font-weight: 900; text-decoration: none; letter-spacing: .02em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.app-brand span { color: var(--ink); font-weight: 600; }
.property-heading { display: grid; gap: 1px; min-width: 0; }
.property-heading strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.property-heading span { color: var(--muted); font-size: .78rem; }
.my-designs-link { color: var(--muted); font-size: .74rem; font-weight: 800; text-decoration: none; white-space: nowrap; }
.my-designs-link:hover { color: var(--evergreen); }
.save-status { color: var(--muted); font-size: .7rem; white-space: nowrap; }
.editor-global-toolbar { display: inline-flex; align-items: center; gap: 5px; min-width: max-content; white-space: nowrap; }
.workspace-toolbar-button, .workspace-menu summary { min-height: 30px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--ink); font-size: .72rem; font-weight: 850; cursor: pointer; }
.workspace-toolbar-button:hover, .workspace-menu summary:hover, .workspace-menu[open] summary { border-color: var(--evergreen); background: #edf6f3; color: var(--evergreen); }
.workspace-menu { position: relative; }
.workspace-menu summary { list-style: none; }
.workspace-menu summary::-webkit-details-marker { display: none; }
.workspace-menu-panel { position: absolute; top: 36px; right: 0; z-index: 12; display: grid; min-width: 190px; gap: 2px; padding: 6px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); box-shadow: 0 10px 28px rgba(24, 33, 31, .16); }
.workspace-menu-panel button { padding: 8px 9px; border: 0; border-radius: 4px; background: transparent; color: var(--ink); font: inherit; font-size: .76rem; text-align: left; cursor: pointer; }
.workspace-menu-panel button:hover { background: #edf6f3; color: var(--evergreen); }
.workspace-menu-label { padding: 5px 9px 4px; color: var(--muted); font-size: .64rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.app-nav { display: flex; gap: 4px; height: 100%; min-width: max-content; align-items: stretch; }
.app-nav a { display: grid; place-items: center; padding: 0 12px; color: var(--muted); font-size: .78rem; font-weight: 900; text-decoration: none; text-transform: uppercase; border-bottom: 3px solid transparent; }
.app-nav a:hover, .app-nav a.active { color: var(--evergreen); border-bottom-color: var(--evergreen); }
.header-action-button { min-height: 32px; padding: 6px 10px; border: 1px solid var(--evergreen); border-radius: 5px; background: var(--evergreen); color: #fff; font-size: .72rem; font-weight: 850; cursor: pointer; }
.operator-editor { height: calc(100vh - 70px); min-height: 0; grid-template-columns: minmax(210px, 240px) minmax(0, 1fr); gap: 14px; margin-top: 12px; align-items: stretch; }
.operator-editor.has-workspace-drawer { grid-template-columns: minmax(210px, 240px) minmax(0, 1fr) minmax(250px, 300px); }
.editor-add-sidebar, .editor-context-sidebar { min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.editor-add-sidebar { padding: 4px 2px 12px 0; border-right: 1px solid var(--line); padding-right: 14px; }
.editor-context-sidebar { padding: 0 0 12px 14px; border-left: 1px solid var(--line); }
.editor-context-sidebar[hidden] { display: none; }
.editor-add-sidebar[hidden] { display: none; }
.panel-heading { margin-bottom: 12px; }
.panel-heading h2 { margin: 0; font-size: 1rem; }
.active-tool-summary { margin: 0 0 14px; padding: 9px 10px; border-left: 3px solid var(--evergreen); background: #edf6f3; color: var(--ink); font-size: .8rem; font-weight: 700; }
.family-nav { display: grid; gap: 6px; }
.family-nav button { min-height: 42px; padding: 9px 10px; border: 1px solid #b4c0bb; border-radius: 5px; background: var(--surface); color: var(--ink); font-size: .82rem; font-weight: 850; text-align: left; cursor: pointer; }
.family-nav button:hover, .family-nav button.active { border-color: var(--evergreen); background: #edf6f3; }
.component-family-panel { padding-top: 8px; }
.component-family-panel h3 { margin: 8px 0 10px; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; }
.family-back { border: 0; padding: 0; background: transparent; color: var(--muted); font-size: .75rem; font-weight: 800; cursor: pointer; }
.component-subfamily-panel { padding-top: 8px; }
.component-subfamily-panel h3 { margin: 8px 0 10px; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; }
.component-subfamily-panel > [data-product-component] { width: 100%; min-height: 34px; padding: 7px 9px; border: 1px solid #b4c0bb; border-radius: 5px; background: var(--surface); color: var(--ink); font-size: .77rem; font-weight: 750; text-align: left; cursor: pointer; }
.creation-controls { display: grid; gap: 7px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.creation-controls .eyebrow { color: var(--muted); font-size: .66rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.creation-controls button { min-height: 32px; padding: 7px 9px; border: 1px solid #b4c0bb; border-radius: 5px; background: var(--surface); color: var(--ink); font-size: .75rem; font-weight: 750; text-align: left; cursor: pointer; }
.creation-controls button:hover, .creation-controls button.active { border-color: var(--evergreen); background: #edf6f3; }
.creation-controls .tree-treatment-control { display: grid; gap: 5px; }
.creation-controls .tree-branch-wrap-actions { display: grid; grid-template-columns: auto 1fr auto; gap: 5px; align-items: center; }
.creation-controls .tree-branch-wrap-actions button:nth-last-child(-n+3) { grid-column: 1 / -1; }
.creation-controls .tree-branch-wrap-actions span { color: var(--muted); font-size: .72rem; text-align: center; }
.component-family { border-bottom: 1px solid var(--line); }
.component-family summary { padding: 11px 2px; cursor: pointer; color: var(--ink); font-size: .78rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.component-family-options { display: grid; gap: 5px; padding: 0 0 12px; }
.component-family-options > button { min-height: 34px; padding: 7px 9px; border: 1px solid #b4c0bb; border-radius: 5px; background: var(--surface); color: var(--ink); font-size: .77rem; font-weight: 750; text-align: left; cursor: pointer; }
.component-family-options > button:hover, .component-family-options > button.active { border-color: var(--evergreen); background: #edf6f3; }
.universal-actions { display: grid; gap: 5px; margin-top: 16px; }
.universal-actions button { min-height: 32px; border: 1px solid #b4c0bb; border-radius: 5px; background: var(--surface); color: var(--ink); font-size: .76rem; font-weight: 800; text-align: left; cursor: pointer; }
.universal-actions button:hover, .universal-actions button.active { border-color: var(--evergreen); background: #edf6f3; }
.canvas-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "status views photo"
    "actions actions actions";
  align-items: center;
  gap: 8px;
  min-height: 38px;
  min-width: 0;
}
.canvas-toolbar > .compact-measurement-status { grid-area: status; white-space: nowrap; }
.canvas-toolbar > .view-tabs { grid-area: views; min-width: 0; }
.canvas-toolbar > .view-photo-menu { grid-area: photo; }
.canvas-actions { display: inline-flex; align-items: center; gap: 10px; }
.canvas-toolbar > .canvas-actions { grid-area: actions; min-width: 0; justify-content: flex-start; flex-wrap: nowrap; }
.measure-toolbar-controls { display: grid; grid-template-columns: auto minmax(120px, 1fr) auto auto; align-items: center; gap: 6px; min-width: 0; color: var(--muted); font-size: .72rem; }
.measure-toolbar-controls strong { color: var(--ink); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }
.measure-toolbar-controls .compact-field { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.measure-toolbar-controls select, .measure-toolbar-controls input { box-sizing: border-box; min-height: 28px; max-width: 190px; padding: 4px 6px; border: 1px solid #b4c0bb; border-radius: 4px; background: var(--surface); color: var(--ink); font: inherit; }
.measure-toolbar-controls .operator-note { max-width: 220px; margin: 0; }
.canvas-actions > button { min-height: 28px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--ink); font-size: .72rem; font-weight: 850; cursor: pointer; }
.viewport-controls { display: inline-flex; align-items: center; gap: 3px; }
.viewport-controls button { min-width: 28px; min-height: 28px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--ink); font-size: .72rem; font-weight: 850; cursor: pointer; }
.viewport-controls button:hover { border-color: var(--evergreen); color: var(--evergreen); background: #edf6f3; }
.viewport-controls span { min-width: 42px; color: var(--muted); font-size: .68rem; font-weight: 850; text-align: center; }
.canvas-edit-toolbar { display: flex; gap: 5px; align-items: center; padding-top: 5px; }
.canvas-edit-toolbar button { min-height: 30px; padding: 4px 10px; border: 1px solid #b4c0bb; border-radius: 5px; background: var(--surface); color: var(--ink); font-size: .76rem; font-weight: 800; cursor: pointer; }
.canvas-edit-toolbar button:hover, .canvas-edit-toolbar button.active { border-color: var(--evergreen); background: #edf6f3; }
.canvas-edit-toolbar button:disabled { opacity: .45; cursor: not-allowed; }
.app-overflow { position: relative; }
.app-overflow summary { list-style: none; cursor: pointer; color: var(--muted); font-size: 1.1rem; letter-spacing: .1em; }
.app-overflow summary::-webkit-details-marker { display: none; }
.app-overflow button { position: absolute; right: 0; top: 25px; z-index: 4; min-width: 120px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--ink); font-size: .75rem; font-weight: 800; text-align: left; box-shadow: 0 6px 18px rgba(24, 33, 31, .12); cursor: pointer; }
.design-summary-drawer { position: relative; min-width: 108px; color: var(--ink); font-size: .72rem; }
.design-summary-drawer summary { list-style: none; cursor: pointer; white-space: nowrap; }
.design-summary-drawer summary::-webkit-details-marker { display: none; }
.design-summary-drawer summary::after { content: "⌄"; margin-left: 5px; color: var(--muted); }
.design-summary-drawer[open] summary::after { content: "⌃"; }
.design-summary-drawer summary strong { color: var(--muted); font-weight: 700; }
.design-summary-drawer .project-scope { position: absolute; top: 28px; right: 0; z-index: 4; width: 250px; max-height: 60vh; overflow: auto; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: 0 8px 20px rgba(24, 33, 31, .14); }
.canvas-toolbar .view-tabs { margin: 0; }
.view-photo-menu { position: relative; margin-left: auto; }
.view-photo-menu summary { min-height: 28px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: .72rem; font-weight: 800; cursor: pointer; list-style: none; }
.view-photo-menu summary::-webkit-details-marker { display: none; }
.view-photo-menu[open] summary { border-color: var(--evergreen); color: var(--evergreen); background: #edf6f3; }
.view-photo-actions { position: absolute; top: 34px; right: 0; z-index: 4; display: grid; min-width: 138px; padding: 5px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); box-shadow: 0 6px 18px rgba(24, 33, 31, .14); }
.view-photo-actions button { padding: 7px 8px; border: 0; background: transparent; color: var(--ink); font-size: .72rem; font-weight: 750; text-align: left; cursor: pointer; }
.view-photo-actions button:hover { background: #edf6f3; }
.display-mode { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: .72rem; font-weight: 800; }
.display-mode button { min-height: 28px; padding: 4px 8px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: .7rem; font-weight: 800; }
.display-mode button.active { border-color: var(--evergreen); color: var(--evergreen); background: #edf6f3; }
.twilight-enhancement-status { min-width: 0; color: var(--muted); font-size: .68rem; font-weight: 800; }
.enhance-twilight-button { min-height: 28px; padding: 4px 8px; border: 1px solid var(--evergreen); background: var(--surface); color: var(--evergreen); font-size: .68rem; font-weight: 800; }
.editor-stage-wrap { width: 100%; min-width: 0; min-height: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; }
.editor-stage-wrap { position: relative; }
.operator-stage { width: 100%; max-width: none; max-height: none; height: 100%; aspect-ratio: auto; }
.operator-stage {
  min-height: 650px;
  height: clamp(650px, 72vh, 900px);
  max-height: 900px;
}
.operator-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.calibration-workflow { position: absolute; top: 14px; right: 14px; z-index: 10; display: grid; gap: 12px; width: min(360px, calc(100% - 28px)); padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 255, 255, .97); box-shadow: 0 10px 28px rgba(24, 33, 31, .16); }
/* The editor shell cannot scroll; keep the four-corner workflow inside it. */
.calibration-workflow { max-height: calc(100dvh - 98px); overflow-y: auto; overscroll-behavior-y: contain; }
.calibration-workflow-header h2 { margin: 3px 0 4px; font-size: 1rem; }
.calibration-workflow-header p { margin: 0; color: var(--muted); font-size: .76rem; line-height: 1.4; }
.calibration-current-status { color: var(--muted); font-size: .72rem; font-weight: 750; }
.calibration-reference { display: grid; gap: 7px; padding-top: 10px; border-top: 1px solid var(--line); }
.calibration-reference .compact-field { display: grid; gap: 5px; color: var(--muted); font-size: .68rem; font-weight: 850; }
.calibration-reference select, .calibration-reference input { box-sizing: border-box; min-height: 32px; padding: 6px 8px; border: 1px solid #b4c0bb; border-radius: 5px; background: var(--surface); color: var(--ink); font: inherit; font-size: .78rem; }
.calibration-reference-value { color: var(--ink); font-size: .78rem; font-weight: 850; }
.calibration-inline-error { min-height: 15px; margin: 0; color: #a33a2b; font-size: .7rem; font-weight: 750; }
.calibration-steps { display: grid; gap: 6px; margin: 0; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); list-style: none; }
.calibration-steps li { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 7px; color: var(--muted); font-size: .74rem; }
.calibration-steps li > span { display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid var(--line); border-radius: 50%; font-size: .68rem; font-weight: 850; }
.calibration-steps li.current { color: var(--evergreen); }
.calibration-steps li.current > span, .calibration-steps li.complete > span { border-color: var(--evergreen); background: #edf6f3; color: var(--evergreen); }
.calibration-steps strong { font-weight: 850; }
.calibration-steps em { font-style: normal; font-size: .66rem; font-weight: 750; }
.calibration-instruction { margin: 0; color: var(--ink); font-size: .78rem; font-weight: 750; line-height: 1.4; }
.calibration-result { display: grid; gap: 4px; padding: 10px; border: 1px solid var(--evergreen); border-radius: 6px; background: #edf6f3; color: var(--ink); font-size: .74rem; }
.calibration-result strong { font-size: .82rem; }
.calibration-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.calibration-workflow .calibration-actions { position: sticky; bottom: 0; z-index: 1; padding-top: 8px; background: #fff; }
.calibration-actions button { min-height: 32px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--ink); font: inherit; font-size: .72rem; font-weight: 800; cursor: pointer; }
.calibration-actions .primary-action { border-color: var(--evergreen); }
.calibration-actions button:disabled { opacity: .45; cursor: not-allowed; }
.view-scale-status { margin-top: 5px; padding: 7px 9px; border-top: 1px solid var(--line); color: var(--muted); font-size: .7rem; line-height: 1.35; }
.selection-micro-summary { position: absolute; top: 12px; left: 12px; z-index: 3; display: inline-flex; align-items: center; max-width: min(280px, calc(100% - 24px)); padding: 6px 8px; border: 1px solid rgba(255, 255, 255, .7); border-radius: 5px; background: rgba(20, 31, 28, .72); color: #fff; font-size: .72rem; font-weight: 750; pointer-events: none; }
.app-selected-panel { padding: 4px 0 14px; border-bottom: 1px solid var(--line); }
.app-selected-panel h2 { margin: 3px 0 4px; font-size: 1rem; }
.app-selected-panel p { margin: 0; color: var(--muted); font-size: .78rem; }
.inspector-root { min-height: 120px; }
.inspector-root { position: relative; }
.drawer-close { position: absolute; top: 0; right: 0; width: 28px; height: 28px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 1.25rem; line-height: 1; cursor: pointer; }
.drawer-close:hover { background: #edf6f3; color: var(--ink); }
.inspector-root #inspector-controls { display: grid; gap: 14px; padding-top: 14px; }
.inspector-root #inspector-controls > section,
.inspector-root #inspector-controls > .component-group,
.inspector-root #inspector-controls > .contextual-control { padding-top: 12px; border-top: 1px solid var(--line); }
.inspector-root #inspector-controls h2,
.inspector-root #inspector-controls strong { display: block; margin: 0 0 8px; color: var(--muted); font-size: .68rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.inspector-root #inspector-controls button,
.inspector-root #inspector-controls select,
.inspector-root #inspector-controls input { max-width: 100%; }
.inspector-root #inspector-controls .component-group > strong { color: var(--ink); font-size: .74rem; letter-spacing: .04em; }
.inspector-root #inspector-controls .contextual-control { display: grid; gap: 6px; }
.inspector-root #inspector-controls .contextual-control > span { color: var(--muted); font-size: .68rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.inspector-root #inspector-controls .component-group button { width: 100%; margin-top: 5px; }
.editor-context-sidebar > section { padding-top: 4px; }
.context-bar { position: absolute; left: 50%; bottom: 20px; z-index: 6; display: inline-flex; align-items: center; gap: 10px; transform: translateX(-50%); padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255, 255, 255, .96); box-shadow: 0 8px 22px rgba(24, 33, 31, .14); color: var(--ink); font-size: .76rem; font-weight: 800; }
.context-bar button { min-height: 28px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--ink); font: inherit; font-size: .72rem; cursor: pointer; }
.context-bar button:disabled { opacity: .45; cursor: not-allowed; }
.context-bar-transition { display: inline-flex; align-items: center; gap: 5px; }
.context-bar.tree-context-bar { top: 14px; right: 14px; bottom: auto; left: auto; display: grid; grid-template-columns: 1fr auto; width: min(292px, calc(100% - 28px)); align-items: start; gap: 9px; transform: none; padding: 12px; background: rgba(255, 255, 255, .98); }
.tree-context-bar #context-bar-label { grid-column: 1 / -1; color: var(--ink); font-size: .82rem; font-weight: 850; }
.tree-context-bar #tree-creation-controls { grid-column: 1 / -1; display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.tree-context-bar #tree-creation-controls .eyebrow { color: var(--muted); }
.tree-context-bar .tree-treatment-control button { min-height: 34px; color: var(--ink); font-weight: 800; }
.tree-context-bar .tree-treatment-control button.active { background: #123826; color: #fff; border-color: #123826; }
.tree-context-bar .tree-branch-wrap-actions { margin: 0; }
.tree-context-bar #context-bar-done { grid-column: 1; grid-row: 4; min-height: 34px; background: var(--evergreen); color: #fff; border-color: var(--evergreen); }
.tree-context-bar #context-bar-cancel { grid-column: 2; grid-row: 4; }
.roofline-curve-overlay { fill: none; stroke: #f6c945; stroke-width: 3; pointer-events: none; }
.roofline-handle-arm { stroke: #f6c945; stroke-width: 2; stroke-dasharray: 4 3; pointer-events: none; }
.roofline-handle-knob { fill: #fff; stroke: #b7791f; stroke-width: 2; cursor: grab; }
.roofline-handle-knob:active { cursor: grabbing; }
.roofline-segment-hit { fill: none; stroke: transparent; stroke-width: 18; pointer-events: stroke; }

@media (max-width: 1280px) {
  .editor-shell { padding-left: 10px; padding-right: 10px; }
  .operator-editor { grid-template-columns: 205px minmax(0, 1fr); gap: 10px; }
  .operator-editor.has-workspace-drawer { grid-template-columns: 205px minmax(0, 1fr) 250px; }
  .app-header { gap: 10px; }
  .app-nav a { padding-left: 8px; padding-right: 8px; }
}

@media (max-width: 1100px) {
  .app-header {
    height: auto;
    min-height: 58px;
    padding: 8px 0;
    grid-template-columns: auto auto minmax(0, 1fr) auto auto;
    grid-template-areas:
      "brand back title save tools"
      "nav nav nav nav nav";
  }
  .app-brand { grid-area: brand; }
  .my-designs-link { grid-area: back; }
  .property-heading { grid-area: title; }
  .app-nav { grid-area: nav; width: 100%; height: 34px; overflow-x: auto; }
  .save-status { grid-area: save; }
  .editor-global-toolbar { grid-area: tools; }
  .design-summary-drawer,
  .app-overflow { display: none; }
}

@media (max-width: 900px) {
  .app-header { display: flex; gap: 10px; flex-wrap: wrap; height: auto; min-height: 58px; padding: 8px 0; }
  .property-heading { order: 3; flex: 1 1 100%; }
  .app-nav { order: 4; width: 100%; height: 34px; overflow-x: auto; }
  .editor-global-toolbar { margin-left: auto; }
}

/* Project library */
.library-shell { max-width: 1100px; }
.library-header { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 34px 0 20px; }
.library-header h1 { margin: 4px 0 0; font-size: clamp(1.8rem, 4vw, 2.5rem); }
.library-header p { margin: 8px 0 0; color: var(--muted); }
.library-search { display: block; width: min(560px, 100%); margin: 0 0 18px; }
.library-search input { box-sizing: border-box; width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid #b4c0bb; border-radius: 5px; font: inherit; }
.clear-search-button { margin-left: 8px; padding: 0; border: 0; background: transparent; color: var(--evergreen); font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; }
.primary-action { min-height: 40px; padding: 9px 14px; border: 0; border-radius: 6px; background: var(--evergreen); color: #fff; font-weight: 850; cursor: pointer; }
.primary-action:hover { background: #164d40; }
.design-list { display: grid; gap: 8px; }
.design-row { display: grid; grid-template-columns: 168px minmax(0, 1fr) auto; align-items: center; gap: 16px; min-height: 120px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: inherit; text-decoration: none; }
.design-row:hover, .design-row:focus-visible { border-color: var(--evergreen); background: #f5faf8; outline: none; }
.design-thumbnail { position: relative; display: grid; place-items: center; width: 168px; height: 100px; overflow: hidden; border-radius: 4px; background: #e8eeeb; color: var(--muted); font-size: .7rem; font-weight: 800; }
.design-thumbnail-image { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.design-thumbnail:not(.no-photo) { color: transparent; }
.design-row-copy { min-width: 0; }
.design-row-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 850; }
.design-row-revision { color: var(--evergreen); font-weight: 800; }
.commercial-revision textarea { display: block; width: 100%; min-height: 72px; margin-top: 6px; }
.property-revision-context { color: var(--evergreen) !important; font-weight: 760; }
.revision-context { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin: 8px 18px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: #f7faf8; }
.revision-context[hidden] { display: none; }
.revision-context > div { display: grid; gap: 2px; }
.revision-context strong { font-size: 11px; letter-spacing: .08em; }
.revision-context span, .revision-context a { font-size: 12px; }
.design-row-meta { margin-top: 5px; color: var(--muted); font-size: .78rem; }
.design-row-date { display: block; margin-top: 6px; color: var(--muted); font-size: .75rem; white-space: nowrap; }
.library-message { padding: 34px 0; color: var(--muted); }
.new-design-dialog { width: min(420px, calc(100vw - 32px)); padding: 22px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface); box-shadow: 0 18px 50px rgba(24, 33, 31, .22); }
.new-design-dialog::backdrop { background: rgba(22, 29, 27, .36); }
.new-design-dialog h2 { margin: 0 0 18px; font-size: 1.15rem; }
.new-design-dialog label { display: grid; gap: 7px; color: var(--muted); font-size: .78rem; font-weight: 800; }
.new-design-dialog input { min-height: 38px; padding: 8px 10px; border: 1px solid #b4c0bb; border-radius: 5px; font: inherit; }
.new-design-dialog { width: min(560px, calc(100vw - 32px)); }
.compact-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.light-pattern-presets { flex-wrap: wrap; }
.light-pattern-presets button.active { border-color: var(--evergreen); background: #edf6f3; }
.unshown-roofline-list { display: grid; gap: 8px; margin-top: 18px; }
.unshown-roofline-list h3 { margin: 0; font-size: .9rem; }
.unshown-roofline-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 5px; font-size: .82rem; }
.unshown-roofline-row button { padding: 4px 7px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); cursor: pointer; }
.contact-results, .existing-designs { display: grid; gap: 8px; margin-top: 14px; }
.contact-result, .existing-design-row { display: grid; gap: 3px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: inherit; text-align: left; text-decoration: none; font: inherit; cursor: pointer; }
.contact-result:hover, .contact-result:focus-visible, .existing-design-row:hover, .existing-design-row:focus-visible { border-color: var(--evergreen); background: #f5faf8; outline: none; }
.contact-result small, .selected-contact-summary small { color: var(--muted); }
.selected-contact-summary { display: grid; gap: 3px; margin-bottom: 12px; }
.existing-designs p { margin: 0; color: var(--muted); font-size: .88rem; }
.new-design-dialog form { display: grid; gap: 12px; margin-top: 18px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.dialog-actions button { min-height: 36px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--ink); font-weight: 800; cursor: pointer; }
.dialog-actions .primary-action { border-color: var(--evergreen); }

@media (max-width: 720px) {
  .canvas-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "status photo"
      "views views"
      "actions actions";
    align-items: start;
    gap: 6px;
  }
  .measure-toolbar-controls { width: 100%; grid-template-columns: auto minmax(0, 1fr); }
  .measure-toolbar-controls .compact-field { justify-content: space-between; }
  .measure-toolbar-controls .compact-field select, .measure-toolbar-controls .compact-field input { max-width: none; }
  .measure-toolbar-controls .operator-note { grid-column: 1 / -1; max-width: none; }
  .library-header { align-items: start; flex-direction: column; }
  .library-search { width: 100%; }
  .design-row { grid-template-columns: 120px minmax(0, 1fr); }
  .design-thumbnail { width: 120px; height: 76px; }
  .design-row-date { grid-column: 2; }
}

/* ========================================================================== */
/* SFE Designer — premium editor workspace                                    */
/* ========================================================================== */
:root {
  --sfe-green: #1d6a5b;
  --sfe-green-strong: #145347;
  --sfe-green-soft: #eaf4f1;
  --sfe-bg: #f4f6f4;
  --sfe-card: rgba(255, 255, 255, .96);
  --sfe-border: #d9e0dc;
  --sfe-border-strong: #c8d1cc;
  --sfe-text: #18201e;
  --sfe-subtle: #66706d;
  --sfe-warning: #9b5b16;
  --sfe-warning-bg: #fff6e8;
  --sfe-shadow: 0 14px 38px rgba(28, 42, 37, .08);
}

body:has(.editor-shell) {
  overflow: hidden;
  background: var(--sfe-bg);
}

.editor-shell {
  width: 100%;
  max-width: none;
  height: 100vh;
  min-height: 680px;
  padding: 0 24px 18px;
  overflow: hidden;
}

/* --- Header -------------------------------------------------------------- */
.app-header {
  height: 72px;
  display: grid;
  grid-template-columns: auto auto minmax(220px, 1fr) auto auto auto auto auto;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--sfe-border);
  background: transparent;
}
.app-brand {
  display: grid;
  gap: 0;
  color: var(--sfe-green);
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -.01em;
}
.app-brand span { color: var(--sfe-text); font-weight: 760; }
.my-designs-link { color: var(--sfe-subtle); font-size: .75rem; font-weight: 760; }
.property-heading { gap: 2px; }
.property-heading strong { color: var(--sfe-text); font-size: 1rem; letter-spacing: -.015em; }
.property-heading span { color: var(--sfe-subtle); font-size: .78rem; }
.app-nav { height: 100%; gap: 2px; }
.app-nav a {
  padding: 0 14px;
  color: #68726f;
  font-size: .76rem;
  font-weight: 820;
  letter-spacing: .015em;
  text-transform: uppercase;
  border-bottom-width: 3px;
}
.app-nav a:hover,
.app-nav a.active { color: var(--sfe-green-strong); border-bottom-color: var(--sfe-green); }
.save-status { color: var(--sfe-subtle); font-size: .7rem; }
.editor-global-toolbar { gap: 7px; }
.workspace-toolbar-button,
.workspace-menu summary {
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid var(--sfe-border-strong);
  border-radius: 8px;
  background: rgba(255,255,255,.88);
  color: var(--sfe-text);
  box-shadow: 0 1px 1px rgba(28,42,37,.02);
  font-size: .74rem;
  font-weight: 780;
}
.workspace-toolbar-button:hover,
.workspace-menu summary:hover,
.workspace-menu[open] summary {
  border-color: #9ebbb3;
  background: #fff;
  color: var(--sfe-green-strong);
}
.workspace-menu-panel {
  top: 40px;
  min-width: 210px;
  padding: 7px;
  border: 1px solid var(--sfe-border);
  border-radius: 12px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 18px 45px rgba(24,33,31,.16);
  backdrop-filter: blur(16px);
}
.workspace-menu-panel button { border-radius: 7px; padding: 9px 10px; }
.workspace-menu-panel button:hover { background: var(--sfe-green-soft); }

/* --- Layout: never reserve hidden sidebars ------------------------------- */
.operator-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  height: calc(100vh - 90px);
  min-height: 0;
  gap: 14px;
  margin-top: 14px;
  align-items: stretch;
}
.operator-editor:has(.editor-add-sidebar:not([hidden])) {
  grid-template-columns: minmax(220px, 250px) minmax(0, 1fr);
}
.operator-editor.has-workspace-drawer:not(:has(.editor-add-sidebar:not([hidden]))) {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 310px);
}
.operator-editor.has-workspace-drawer:has(.editor-add-sidebar:not([hidden])) {
  grid-template-columns: minmax(220px, 250px) minmax(0, 1fr) minmax(260px, 310px);
}
[data-editor-workspace="measurement"] .operator-editor {
  display: block !important;
  height: calc(100vh - 90px);
}
[data-editor-workspace="measurement"] .editor-stage-wrap {
  width: 100% !important;
  max-width: none !important;
  height: 100%;
}

.editor-stage-wrap {
  width: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 12px;
  position: relative;
}

/* --- Measurement setup --------------------------------------------------- */
.measurement-setup-premium {
  display: grid;
  grid-template-columns: minmax(280px, 1.25fr) minmax(520px, 2.1fr) minmax(220px, .8fr);
  gap: 24px;
  align-items: center;
  margin: 0;
  padding: 18px 20px;
  border: 1px solid var(--sfe-border);
  border-radius: 16px;
  background: var(--sfe-card);
  box-shadow: var(--sfe-shadow);
}
.measurement-intro { min-width: 0; }
.measurement-intro .eyebrow {
  margin: 0 0 5px;
  color: var(--sfe-green-strong);
  font-size: .68rem;
  font-weight: 880;
  letter-spacing: .07em;
}
.measurement-intro h1 {
  max-width: none;
  margin: 0 0 6px;
  color: var(--sfe-text);
  font-size: clamp(1.05rem, 1.55vw, 1.42rem);
  line-height: 1.15;
  letter-spacing: -.025em;
}
.measurement-intro p {
  max-width: 490px;
  margin: 0;
  color: var(--sfe-subtle);
  font-size: .78rem;
  line-height: 1.5;
}
.measurement-setup-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}
.measurement-step {
  min-width: 0;
  display: grid;
  grid-template-columns: 30px minmax(0,1fr);
  grid-template-rows: auto auto;
  gap: 8px 10px;
  align-items: start;
}
.measurement-step-number {
  grid-row: 1;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--sfe-border-strong);
  border-radius: 50%;
  background: #f7f9f8;
  color: var(--sfe-text) !important;
  font-size: .76rem !important;
  font-weight: 900 !important;
  box-shadow: inset 0 0 0 3px #fff;
}
.measurement-step:first-child .measurement-step-number {
  border-color: #7ea99d;
  background: var(--sfe-green);
  color: white !important;
}
.measurement-step-copy { min-width: 0; display: grid; gap: 2px; }
.measurement-step-copy strong { color: var(--sfe-text); font-size: .78rem; }
.measurement-step-copy span {
  overflow: hidden;
  color: var(--sfe-subtle) !important;
  font-size: .64rem !important;
  font-weight: 760 !important;
  line-height: 1.35;
  text-overflow: ellipsis;
}
.measurement-step > button {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--sfe-border-strong);
  border-radius: 9px;
  background: #f7f9f8;
  color: #4e5855;
  font-size: .71rem;
  font-weight: 790;
  cursor: pointer;
}
.measurement-step > button:not(:disabled):hover { border-color: #9ab8b0; background: #fff; }
.measurement-step > button:disabled { opacity: .48; cursor: not-allowed; }
.measurement-step > .measurement-primary-action {
  border-color: var(--sfe-green);
  background: var(--sfe-green);
  color: #fff;
  box-shadow: 0 5px 12px rgba(29,106,91,.16);
}
.measurement-step > .measurement-primary-action:hover { background: var(--sfe-green-strong); }
.measurement-setup-status-card {
  display: grid;
  gap: 5px;
  align-self: stretch;
  align-content: center;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid #f0dfc8;
  border-radius: 12px;
  background: var(--sfe-warning-bg);
}
.measurement-setup-status-card strong { color: var(--sfe-warning); font-size: .72rem; line-height: 1.35; }
.measurement-setup-status-card .view-scale-status,
.measurement-setup-status-card .operator-note {
  margin: 0;
  padding: 0;
  border: 0;
  color: #7b674f;
  font-size: .68rem;
  line-height: 1.35;
}
.measurement-relationship-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--sfe-border);
}
.measurement-start-designing {
  justify-self: end;
  min-height: 36px;
  padding: 7px 13px;
  border: 1px solid var(--sfe-green);
  border-radius: 9px;
  background: var(--sfe-green);
  color: white;
  font-weight: 800;
}

/* --- Canvas toolbar ------------------------------------------------------ */
.canvas-toolbar {
  display: block;
  min-width: 0;
  padding: 0;
  border: 1px solid var(--sfe-border);
  border-radius: 14px 14px 0 0;
  background: rgba(255,255,255,.94);
  box-shadow: 0 8px 22px rgba(28,42,37,.045);
  overflow: visible;
}
.canvas-toolbar > .view-tabs { display: none !important; }
.canvas-toolbar > .compact-measurement-status {
  margin: 10px 12px;
}
.canvas-toolbar > .view-photo-menu {
  position: absolute;
  right: 12px;
  margin-top: 8px;
}
.canvas-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 9px 12px;
}
.display-mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.display-mode > span:first-child {
  margin-right: 4px;
  color: var(--sfe-subtle);
  font-size: .7rem;
  font-weight: 800;
}
.display-mode button,
.viewport-controls button,
.view-photo-menu summary {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--sfe-border-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--sfe-text);
  font-size: .72rem;
  font-weight: 780;
}
.display-mode button.active { border-color: #76a398; background: var(--sfe-green-soft); color: var(--sfe-green-strong); }
.viewport-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
#viewport-zoom-label { min-width: 44px; color: var(--sfe-text); font-size: .8rem; font-weight: 850; text-align: center; }
.twilight-enhancement-status { color: var(--sfe-subtle); font-size: .68rem; }

/* --- Canvas -------------------------------------------------------------- */
.editor-stage.operator-stage {
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  border: 1px solid var(--sfe-border);
  border-top: 0;
  border-radius: 0 0 16px 16px;
  background: #0d1826;
  overflow: hidden;
  box-shadow: var(--sfe-shadow);
}
.editor-stage img { max-width: none; }
.canvas-edit-toolbar {
  left: 16px;
  bottom: 16px;
  gap: 7px;
}
.canvas-edit-toolbar button {
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,.42);
  background: rgba(255,255,255,.88);
  color: var(--sfe-text);
  backdrop-filter: blur(14px);
}
.editor-message { display: none; }

/* --- Calibration sheet --------------------------------------------------- */
.calibration-workflow {
  position: absolute;
  top: 86px;
  right: 18px;
  z-index: 20;
  width: min(390px, calc(100% - 36px));
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--sfe-border);
  border-radius: 14px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 24px 64px rgba(24,33,31,.2);
  backdrop-filter: blur(18px);
}
.calibration-workflow-header h2 { font-size: 1.05rem; letter-spacing: -.015em; }
.calibration-reference select,
.calibration-reference input {
  min-height: 36px;
  border-radius: 8px;
  border-color: var(--sfe-border-strong);
}
.calibration-steps li { border-radius: 9px; }
.calibration-actions button { border-radius: 8px; }

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 1240px) {
  .measurement-setup-premium {
    grid-template-columns: minmax(260px, 1fr) minmax(520px, 2fr);
  }
  .measurement-setup-status-card { grid-column: 1 / -1; grid-template-columns: auto 1fr 1fr; align-items: center; }
}
@media (max-width: 980px) {
  .editor-shell { padding-inline: 14px; }
  .measurement-setup-premium { grid-template-columns: 1fr; gap: 18px; }
  .measurement-setup-steps { grid-template-columns: repeat(3, minmax(180px,1fr)); overflow-x: auto; padding-bottom: 3px; }
  .measurement-setup-status-card { grid-template-columns: 1fr; }
  .canvas-actions { flex-wrap: wrap; }
  .viewport-controls { margin-left: 0; }
}
@media (max-width: 720px) {
  body:has(.editor-shell) { overflow: auto; }
  .editor-shell { height: auto; min-height: 100vh; overflow: visible; padding: 0 10px 16px; }
  .operator-editor,
  [data-editor-workspace="measurement"] .operator-editor { height: auto; min-height: 700px; }
  .measurement-setup-steps { grid-template-columns: 1fr; overflow: visible; }
  .canvas-actions { align-items: stretch; }
  .display-mode,
  .viewport-controls { width: 100%; flex-wrap: wrap; }
  .calibration-workflow { position: fixed; top: 12px; left: 12px; right: 12px; width: auto; max-height: calc(100vh - 24px); overflow-y: auto; }
}


/* Workspace transition hardening: Design must retain a real canvas row. */
[data-editor-workspace="design"] .editor-stage-wrap {
  height: 100%;
  min-height: 0;
}
[data-editor-workspace="design"] .editor-stage.operator-stage {
  display: block;
  width: 100%;
  min-height: 620px;
}
.measurement-reference-label {
  paint-order: stroke fill;
  stroke: rgba(255,255,255,.96);
  stroke-width: 3px;
  stroke-linejoin: round;
}


/* =======================================================================
   SFE Designer — progressive Add Components navigator (Apple-style v1.2)
   One decision level at a time; minimal chrome; large touch targets.
   ======================================================================= */
.editor-add-sidebar {
  width: 100%;
  padding: 18px 14px 18px 16px;
  border-right: 1px solid rgba(31, 52, 47, .09);
  background: linear-gradient(180deg, rgba(252,253,252,.98), rgba(247,249,248,.98));
  color: var(--ink);
}
.add-browser-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.add-browser-header .eyebrow {
  display: none;
}
.add-browser-header h2 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.2;
  letter-spacing: -.015em;
}
.add-browser-lede {
  margin: 0 0 18px;
  color: #6a7470;
  font-size: .76rem;
  line-height: 1.45;
}
.add-browser-close {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #68736f;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}
.add-browser-close:hover { background: rgba(24,33,31,.06); color: var(--ink); }

.family-nav,
.component-family-options {
  display: grid;
  gap: 8px;
  padding: 0;
}
.family-nav[hidden], .family-level[hidden] { display: none !important; }
.component-family-panel,
.component-subfamily-panel {
  padding: 0;
}
.sidebar-back {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin: 0 0 9px;
  padding: 0 3px;
  border: 0;
  background: transparent;
  color: #5f6b67;
  font: inherit;
  font-size: .74rem;
  font-weight: 700;
  cursor: pointer;
}
.sidebar-back:hover { color: var(--evergreen); }
.sidebar-section-heading { margin: 0 0 12px; }
.sidebar-section-heading h3 {
  margin: 0 0 3px;
  color: var(--ink);
  font-size: .98rem;
  line-height: 1.25;
  letter-spacing: -.01em;
  text-transform: none;
}
.sidebar-section-heading p {
  margin: 0;
  color: #6a7470;
  font-size: .73rem;
  line-height: 1.4;
}

.family-nav button.component-nav-row,
.component-family-options > button.component-nav-row,
.sidebar-secondary-actions button.component-nav-row {
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: 30px minmax(0,1fr) auto;
  align-items: center;
  column-gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(28, 51, 45, .10);
  border-radius: 12px;
  background: rgba(255,255,255,.72);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(24,33,31,.025);
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.family-nav button.component-nav-row:hover,
.component-family-options > button.component-nav-row:hover,
.sidebar-secondary-actions button.component-nav-row:hover {
  border-color: rgba(30,91,79,.25);
  background: rgba(239,247,244,.96);
  box-shadow: 0 5px 16px rgba(30,91,79,.07);
  transform: translateY(-1px);
}
.family-nav button.component-nav-row.active,
.component-family-options > button.component-nav-row.active {
  border-color: rgba(30,91,79,.30);
  background: linear-gradient(90deg, rgba(225,242,236,.95), rgba(241,248,245,.95));
  box-shadow: inset 0 0 0 1px rgba(30,91,79,.05);
}
.component-nav-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(30,91,79,.065);
  color: #254a41;
  font-size: 1rem;
  font-weight: 800;
}
.component-nav-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.component-nav-copy strong {
  display: block;
  min-width: 0;
  color: #1d2724;
  font-size: .79rem;
  font-weight: 760;
  line-height: 1.2;
}
.component-nav-copy small {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #74807b;
  font-size: .66rem;
  font-weight: 520;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.component-nav-chevron {
  color: #7a8581;
  font-size: 1.15rem;
  font-weight: 500;
}

.component-subfamily-panel .component-family-options > .component-nav-row:not(:has(.component-nav-icon)) {
  grid-template-columns: minmax(0,1fr) auto;
}
.sidebar-secondary-actions {
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid rgba(31,52,47,.08);
}
.sidebar-secondary-actions .component-nav-row.secondary {
  background: rgba(255,255,255,.42);
}
.sidebar-secondary-actions .component-nav-row.secondary .component-nav-icon {
  background: transparent;
  border: 1px solid rgba(31,52,47,.10);
}

.editor-add-sidebar .creation-controls,
.editor-add-sidebar .contextual-control {
  margin-top: 14px;
  padding: 13px;
  border: 1px solid rgba(31,52,47,.09);
  border-radius: 12px;
  background: rgba(255,255,255,.76);
}
.editor-add-sidebar .creation-controls button,
.editor-add-sidebar .contextual-control button {
  border-radius: 9px;
}

/* Give the Add navigator enough room for readable labels without stealing the canvas. */
.operator-editor:has(.editor-add-sidebar:not([hidden])) {
  grid-template-columns: minmax(272px, 292px) minmax(0, 1fr);
}
.operator-editor.has-workspace-drawer:has(.editor-add-sidebar:not([hidden])) {
  grid-template-columns: minmax(272px, 292px) minmax(0, 1fr) minmax(260px, 310px);
}

@media (max-width: 980px) {
  .operator-editor:has(.editor-add-sidebar:not([hidden])) {
    grid-template-columns: minmax(246px, 270px) minmax(0, 1fr);
  }
  .component-nav-copy small { white-space: normal; }
}

/* =======================================================================
   SFE Designer — Apple-style interaction cleanup v1.3
   Progressive navigation header, active-tool guidance, contextual actions.
   ======================================================================= */
.add-browser-title-stack {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.add-browser-back {
  width: fit-content;
  min-height: 28px;
  margin: -3px 0 1px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--sfe-green-strong, #1e5b4f);
  font: inherit;
  font-size: .73rem;
  font-weight: 760;
  cursor: pointer;
}
.add-browser-back:hover { text-decoration: underline; }
/* Navigation is owned by the fixed panel header now. */
.editor-add-sidebar .sidebar-back { display: none !important; }

.add-tool-state {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  padding-top: 8px;
}
.add-tool-state[hidden] { display: none !important; }
.add-tool-state-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--sfe-green-soft, #e9f4f0);
  color: var(--sfe-green-strong, #1e5b4f);
  font-size: 1.2rem;
  font-weight: 850;
}
.add-tool-state-copy { min-width: 0; }
.add-tool-state-copy > span {
  display: block;
  margin-bottom: 1px;
  color: var(--sfe-subtle, #6d7773);
  font-size: .69rem;
  font-weight: 720;
}
.add-tool-state-copy > strong {
  display: block;
  color: var(--sfe-text, #18211f);
  font-size: 1.08rem;
  line-height: 1.2;
  letter-spacing: -.015em;
}
.add-tool-state-copy > p {
  grid-column: 1 / -1;
  margin: 8px 0 0;
  color: #5e6965;
  font-size: .76rem;
  line-height: 1.45;
}
.add-tool-state-help {
  grid-column: 1 / -1;
  display: grid;
  gap: 5px;
  margin-top: 4px;
  padding: 12px 13px;
  border: 1px solid rgba(30, 91, 79, .10);
  border-radius: 12px;
  background: rgba(233, 244, 240, .72);
  color: #53605b;
  font-size: .72rem;
  line-height: 1.35;
}
.add-tool-state-help span::before { content: "•"; margin-right: 7px; color: var(--sfe-green-strong, #1e5b4f); }
.add-tool-cancel {
  grid-column: 1 / -1;
  min-height: 40px;
  margin-top: 5px;
  border: 1px solid var(--sfe-border-strong, #cdd6d2);
  border-radius: 10px;
  background: #fff;
  color: var(--sfe-text, #18211f);
  font-size: .78rem;
  font-weight: 800;
  cursor: pointer;
}
.add-tool-cancel:hover { background: #f7f9f8; border-color: #aebbb6; }

/* One calm toolbar row on Design: status, display, zoom/photo. */
body[data-editor-workspace="design"] .canvas-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 14px 14px 0 0;
}
body[data-editor-workspace="design"] .canvas-toolbar > .compact-measurement-status {
  margin: 0;
  grid-column: 1;
}
body[data-editor-workspace="design"] .canvas-toolbar > .canvas-actions {
  grid-column: 2;
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  padding: 0;
}
body[data-editor-workspace="design"] .canvas-toolbar > .view-photo-menu {
  grid-column: 3;
  position: static;
  right: auto;
  margin: 0;
}
body[data-editor-workspace="design"] .twilight-enhancement-status {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Selected-object controls are contextual, not a permanent legacy toolbar. */
.selection-micro-summary {
  top: auto !important;
  left: auto !important;
  right: 16px;
  bottom: 16px;
  z-index: 8;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  gap: 12px;
  align-items: center;
  max-width: min(430px, calc(100% - 32px));
  padding: 10px 11px 10px 13px;
  border: 1px solid rgba(255,255,255,.58);
  border-radius: 13px;
  background: rgba(250,252,251,.94);
  color: var(--sfe-text, #18211f);
  box-shadow: 0 14px 34px rgba(10,24,19,.18);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  pointer-events: auto;
}
.selection-context-copy { display: grid; gap: 1px; min-width: 0; }
.selection-context-copy > span { color: #73807b; font-size: .64rem; font-weight: 720; }
.selection-context-copy > strong { overflow: hidden; color: #17211e; font-size: .78rem; font-weight: 820; text-overflow: ellipsis; white-space: nowrap; }
.selection-context-copy > small { color: #67726e; font-size: .65rem; }
.selection-context-actions { display: inline-flex; gap: 6px; }
.selection-context-actions button {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--sfe-border-strong, #cdd6d2);
  border-radius: 9px;
  background: rgba(255,255,255,.9);
  color: #27322e;
  font-size: .7rem;
  font-weight: 780;
  cursor: pointer;
}
.selection-context-actions button:hover { background: #f4f7f6; }
.selection-context-actions button.danger {
  border-color: rgba(173,52,52,.16);
  background: #fff2f2;
  color: #a42f2f;
}
.selection-context-actions button.danger:hover { background: #ffe8e8; }

/* Roofline click-select status popover -- the primary path for fixing a
   flagged measurement (see conversation record: replaces the old Properties
   -> Review Measurement -> Measure on Roof Map hunt). Additive alongside the
   .selection-micro-summary stub above until verified end-to-end. Anchored by
   JS-set left/top (the exact click point, or the run's midpoint as a
   fallback), never the CSS positioning .selection-micro-summary uses. */
.roofline-status-popover { position: absolute; z-index: 9; transform: translate(-50%, 12px); pointer-events: none; }
.roofline-status-popover-card {
  width: 260px;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid;
  border-radius: 12px;
  background: #16213b;
  box-shadow: 0 14px 34px rgba(10, 24, 19, .35);
  color: #e7ebf5;
  font-size: .78rem;
}
.roofline-status-popover-headline-row { display: flex; align-items: center; gap: 7px; }
.roofline-status-popover-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.roofline-status-popover-headline-row strong { font-size: .85rem; font-weight: 800; }
.roofline-status-popover-body { margin: 0; color: #9aa6c7; font-size: .72rem; line-height: 1.35; }
.roofline-status-popover-fix-actions { display: flex; flex-direction: column; gap: 6px; }
.roofline-status-popover-primary { min-height: 36px; border: none; border-radius: 8px; padding: 8px 10px; color: #1c1300; font-size: .76rem; font-weight: 750; cursor: pointer; }
.roofline-status-popover-secondary { min-height: 28px; border: none; border-radius: 6px; padding: 6px 8px; background: #1c2947; color: #9aa6c7; font-size: .7rem; font-weight: 650; cursor: pointer; }
.roofline-status-popover-secondary:hover { background: #22315a; }
.roofline-status-popover-footer { margin: 0; color: #6b7796; font-size: .66rem; }
.roofline-status-popover-bottom-row { display: flex; gap: 6px; }
.roofline-status-popover-bottom-row button { flex-grow: 1; min-height: 30px; border: none; border-radius: 6px; padding: 6px 8px; background: #1c2947; color: #9aa6c7; font-size: .7rem; font-weight: 700; cursor: pointer; }
.roofline-status-popover-bottom-row button:hover { background: #22315a; }
.roofline-status-popover-bottom-row button.danger { background: rgba(240, 82, 82, .16); color: #ff9b9b; }
.roofline-status-popover-bottom-row button.danger:hover { background: rgba(240, 82, 82, .26); }

/* Legacy canvas command row intentionally retired. */
.canvas-edit-toolbar { display: none !important; }

@media (max-width: 1120px) {
  body[data-editor-workspace="design"] .canvas-toolbar {
    grid-template-columns: auto minmax(0,1fr);
  }
  body[data-editor-workspace="design"] .canvas-toolbar > .view-photo-menu { grid-column: 2; justify-self: end; }
  body[data-editor-workspace="design"] .canvas-toolbar > .canvas-actions { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; }
}
@media (max-width: 760px) {
  .selection-micro-summary { left: 10px !important; right: 10px; bottom: 10px; grid-template-columns: 1fr; }
  .selection-context-actions { justify-content: stretch; }
  .selection-context-actions button { flex: 1; }
}

/* ==========================================================================\n   Canvas toolbar polish v1.4 — compact, grouped, contextual\n   ========================================================================== */
body[data-editor-workspace="design"] .canvas-toolbar,
body[data-editor-workspace="measurement"] .canvas-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 58px;
  padding: 9px 12px;
  border: 1px solid var(--sfe-border, #d8dfdc);
  border-radius: 14px 14px 0 0;
  background: rgba(255,255,255,.96);
  box-shadow: 0 6px 18px rgba(28,42,37,.035);
}

body[data-editor-workspace="design"] .canvas-toolbar > .compact-measurement-status,
body[data-editor-workspace="measurement"] .canvas-toolbar > .compact-measurement-status {
  grid-column: 1;
  margin: 0;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid #a9c5bd;
  border-radius: 999px;
  background: #f2f8f6;
  color: #184f44;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

body[data-editor-workspace="design"] .canvas-toolbar > .canvas-actions,
body[data-editor-workspace="measurement"] .canvas-toolbar > .canvas-actions {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
  padding: 0;
}

.display-mode {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.display-mode-label {
  color: var(--sfe-subtle, #68736f);
  font-size: .72rem;
  font-weight: 750;
}
.display-segmented-control {
  display: inline-flex;
  align-items: stretch;
  padding: 2px;
  border: 1px solid var(--sfe-border, #d8dfdc);
  border-radius: 10px;
  background: #f4f6f5;
}
.display-segmented-control button {
  min-height: 30px;
  padding: 5px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #4f5b57;
  font-size: .72rem;
  font-weight: 760;
  box-shadow: none;
}
.display-segmented-control button.active {
  background: #fff;
  color: #174f43;
  box-shadow: 0 1px 3px rgba(24,33,31,.12), inset 0 0 0 1px rgba(28,92,78,.18);
}
.display-segmented-control button:disabled {
  opacity: 1;
  cursor: default;
}
.display-segmented-control .enhanced-display-indicator {
  color: #7a8480;
}
.display-segmented-control .enhanced-display-indicator.is-ready {
  color: #17604f;
  background: #eaf6f2;
}
.display-segmented-control .enhanced-display-indicator.is-generating {
  color: #59645f;
}

.enhancement-status-menu {
  position: relative;
}
.enhancement-status-menu > summary {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: #fff2df;
  color: #a45b00;
  font-size: .76rem;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}
.enhancement-status-menu > summary::-webkit-details-marker { display: none; }
.enhancement-status-popover {
  position: absolute;
  top: 34px;
  left: 50%;
  z-index: 30;
  display: grid;
  gap: 7px;
  width: 250px;
  padding: 12px;
  transform: translateX(-50%);
  border: 1px solid #ead9bc;
  border-radius: 12px;
  background: rgba(255,252,247,.98);
  box-shadow: 0 14px 36px rgba(42,35,25,.16);
}
.enhancement-status-popover strong {
  color: #6d430c;
  font-size: .78rem;
}
.twilight-enhancement-status {
  color: #745d3d !important;
  font-size: .72rem !important;
  font-weight: 600 !important;
  line-height: 1.35;
}
.enhance-twilight-button {
  justify-self: start;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid #d7b77d;
  border-radius: 8px;
  background: #fff;
  color: #74470c;
  font-size: .72rem;
  font-weight: 800;
}

.canvas-view-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.viewport-controls {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin-left: 0;
  overflow: hidden;
  border: 1px solid var(--sfe-border, #d8dfdc);
  border-radius: 10px;
  background: #fff;
}
.viewport-controls button {
  min-width: 34px;
  min-height: 32px;
  padding: 5px 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--sfe-text, #18211f);
}
.viewport-controls button + #viewport-zoom-label,
#viewport-zoom-label + button {
  border-left: 1px solid #edf0ee;
}
#viewport-zoom-label {
  min-width: 54px;
  padding: 0 8px;
  color: var(--sfe-text, #18211f);
  font-size: .78rem;
  font-weight: 820;
  text-align: center;
}
.fit-view-button,
.view-photo-menu > summary {
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid var(--sfe-border, #d8dfdc);
  border-radius: 10px;
  background: #fff;
  color: var(--sfe-text, #18211f);
  font-size: .72rem;
  font-weight: 760;
  cursor: pointer;
}
.view-photo-menu {
  position: relative !important;
  right: auto !important;
  margin: 0 !important;
}
.view-photo-menu > summary { list-style: none; white-space: nowrap; }
.view-photo-menu > summary::-webkit-details-marker { display: none; }
.view-photo-actions {
  top: 40px;
  min-width: 170px;
  padding: 6px;
  border-radius: 10px;
}
.view-photo-actions button {
  min-height: 34px;
  border-radius: 7px;
}

@media (max-width: 900px) {
  body[data-editor-workspace="design"] .canvas-toolbar,
  body[data-editor-workspace="measurement"] .canvas-toolbar {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  body[data-editor-workspace="design"] .canvas-toolbar > .compact-measurement-status,
  body[data-editor-workspace="measurement"] .canvas-toolbar > .compact-measurement-status,
  body[data-editor-workspace="design"] .canvas-toolbar > .canvas-actions,
  body[data-editor-workspace="measurement"] .canvas-toolbar > .canvas-actions {
    grid-column: 1;
  }
  body[data-editor-workspace="design"] .canvas-toolbar > .canvas-actions,
  body[data-editor-workspace="measurement"] .canvas-toolbar > .canvas-actions {
    flex-wrap: wrap;
  }
  .canvas-view-controls { margin-left: 0; }
}

/* ==========================================================================
   Canvas toolbar polish v1.5 — single-row, canvas-first utility bar
   ========================================================================== */
body[data-editor-workspace="design"] .canvas-toolbar,
body[data-editor-workspace="measurement"] .canvas-toolbar {
  display: flex !important;
  align-items: center;
  gap: 18px;
  min-height: 50px !important;
  padding: 7px 10px !important;
  border-radius: 12px 12px 0 0 !important;
  box-shadow: none !important;
}

body[data-editor-workspace="design"] .canvas-toolbar > .compact-measurement-status,
body[data-editor-workspace="measurement"] .canvas-toolbar > .compact-measurement-status {
  flex: 0 0 auto;
  min-height: 30px !important;
  padding: 5px 9px !important;
  border: 0 !important;
  background: transparent !important;
  color: #275e52 !important;
  font-size: .7rem !important;
  font-weight: 760 !important;
}
body[data-editor-workspace="design"] .canvas-toolbar > .compact-measurement-status::before,
body[data-editor-workspace="measurement"] .canvas-toolbar > .compact-measurement-status::before {
  content: "✓";
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  border-radius: 999px;
  background: #dff2ec;
  color: #17604f;
  font-size: .68rem;
  font-weight: 900;
  vertical-align: -1px;
}

body[data-editor-workspace="design"] .canvas-toolbar > .canvas-actions,
body[data-editor-workspace="measurement"] .canvas-toolbar > .canvas-actions {
  flex: 1 1 auto;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
}

.display-mode {
  display: inline-flex !important;
  align-items: center;
  gap: 9px !important;
  min-width: 0;
}
.display-mode-label {
  font-size: .69rem !important;
  font-weight: 720 !important;
  color: #69736f !important;
}
.display-segmented-control {
  padding: 2px !important;
  border: 1px solid #d9dfdc !important;
  border-radius: 9px !important;
  background: #f3f5f4 !important;
}
.display-segmented-control button {
  min-height: 28px !important;
  padding: 4px 10px !important;
  border: 0 !important;
  border-radius: 7px !important;
}

.enhanced-preview-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 3px 7px;
  border-radius: 7px;
  color: #52605b;
  font-size: .7rem;
  font-weight: 720;
  cursor: pointer;
  user-select: none;
}
.enhanced-preview-toggle:hover { background: #f2f5f3; }
.enhanced-preview-toggle input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #1e6a59;
}
.enhanced-preview-toggle:has(input:disabled) { opacity: .5; cursor: default; }
.twilight-enhancement-status {
  margin-left: -4px;
  color: #7a6548 !important;
  font-size: .66rem !important;
  font-weight: 650 !important;
  white-space: nowrap;
}
.enhance-twilight-button {
  min-height: 26px !important;
  padding: 3px 7px !important;
  border: 0 !important;
  background: transparent !important;
  color: #8b5a18 !important;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.canvas-view-controls {
  gap: 7px !important;
  margin-left: auto !important;
}
.viewport-controls,
.fit-view-button,
.view-photo-menu > summary {
  min-height: 30px !important;
}
.viewport-controls button { min-height: 30px !important; min-width: 32px !important; }
#viewport-zoom-label { min-width: 50px !important; font-size: .74rem !important; }
.fit-view-button,
.view-photo-menu > summary { padding: 5px 10px !important; }

@media (max-width: 900px) {
  body[data-editor-workspace="design"] .canvas-toolbar,
  body[data-editor-workspace="measurement"] .canvas-toolbar {
    flex-wrap: wrap !important;
  }
  body[data-editor-workspace="design"] .canvas-toolbar > .canvas-actions,
  body[data-editor-workspace="measurement"] .canvas-toolbar > .canvas-actions {
    flex-basis: 100%;
    flex-wrap: wrap;
  }
  .canvas-view-controls { margin-left: 0 !important; }
}


/* =======================================================================
   SFE Designer — Tree active-tool workspace v1.6
   Restores the existing tree construction controls inside the progressive
   Add workflow instead of leaving them in a hidden legacy subpanel.
   ======================================================================= */
.tree-tool-controls {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  margin-top: 4px;
  padding: 14px;
  border: 1px solid rgba(31, 52, 47, .10);
  border-radius: 14px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 8px 24px rgba(24,33,31,.045);
}
.tree-tool-controls[hidden],
.tree-wrap-editor[hidden],
.tree-canopy-guidance[hidden] { display: none !important; }
.tree-tool-section { display: grid; gap: 8px; }
.tree-tool-label {
  color: #596560;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .02em;
}
.tree-treatment-segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(31,52,47,.09);
  border-radius: 11px;
  background: #f2f5f3;
}
.tree-treatment-segmented button {
  min-height: 38px;
  padding: 7px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #596560;
  font: inherit;
  font-size: .72rem;
  font-weight: 780;
  cursor: pointer;
}
.tree-treatment-segmented button:hover { background: rgba(255,255,255,.7); }
.tree-treatment-segmented button.active {
  background: #fff;
  color: var(--evergreen);
  box-shadow: 0 1px 4px rgba(24,33,31,.10), inset 0 0 0 1px rgba(30,91,79,.10);
}
.tree-tool-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 12px;
  align-items: center;
}
.tree-tool-row small {
  display: block;
  margin-top: 2px;
  color: #7a8581;
  font-size: .65rem;
  line-height: 1.3;
}
.tree-brush-stepper {
  display: inline-grid;
  grid-template-columns: 32px minmax(58px,auto) 32px;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(31,52,47,.12);
  border-radius: 10px;
  background: #fff;
}
.tree-brush-stepper button {
  width: 32px;
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1rem;
  cursor: pointer;
}
.tree-brush-stepper button:hover:not(:disabled) { background: #f2f6f4; }
.tree-brush-stepper button:disabled { opacity: .32; cursor: default; }
.tree-brush-stepper span {
  padding: 0 7px;
  color: #4f5b57;
  font-size: .7rem;
  font-weight: 760;
  text-align: center;
  white-space: nowrap;
}
.tree-tool-actions { display: grid; gap: 7px; }
.tree-tool-actions button {
  width: 100%;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid rgba(31,52,47,.12);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: .74rem;
  font-weight: 780;
  text-align: center;
  cursor: pointer;
}
.tree-tool-actions button:hover:not(:disabled) { border-color: rgba(30,91,79,.28); background: #f6faf8; }
.tree-tool-actions button:disabled { opacity: .38; cursor: default; }
.tree-tool-actions .tree-tool-primary {
  border-color: var(--evergreen);
  background: var(--evergreen);
  color: #fff;
}
.tree-tool-actions .tree-tool-primary:hover:not(:disabled) { background: #174e43; }
.tree-tool-actions .tree-tool-secondary { color: #5f6b67; }
.tree-canopy-guidance {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 11px;
  background: rgba(233,244,240,.72);
  color: #55615d;
  font-size: .72rem;
}
.tree-canopy-guidance strong { color: var(--ink); font-size: .76rem; }

/* The active tree editor replaces legacy tree controls; never show a second
   nested creation panel in the browsing hierarchy. */
.component-subfamily-panel[data-component-subfamily-panel="DECOR_TREES"] > .creation-controls { display: none !important; }


/* =======================================================================
   SFE Designer — Shared path drawing control v1.7
   Apple-style contextual control for straight vs curved installation paths.
   ======================================================================= */
.path-tool-controls {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding: 13px;
  border: 1px solid rgba(31,52,47,.10);
  border-radius: 14px;
  background: rgba(255,255,255,.84);
  box-shadow: 0 8px 24px rgba(24,33,31,.04);
}
.path-tool-controls[hidden] { display: none !important; }
.path-tool-heading { display: grid; gap: 2px; }
.path-tool-label {
  color: #596560;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.path-tool-heading small {
  color: #7a8581;
  font-size: .68rem;
  line-height: 1.35;
}
.path-style-segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(31,52,47,.09);
  border-radius: 11px;
  background: #f2f5f3;
}
.path-style-segmented button {
  min-height: 38px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #596560;
  font: inherit;
  font-size: .74rem;
  font-weight: 780;
  cursor: pointer;
}
.path-style-segmented button:hover { background: rgba(255,255,255,.72); }
.path-style-segmented button.active {
  background: #fff;
  color: var(--evergreen);
  box-shadow: 0 1px 4px rgba(24,33,31,.10), inset 0 0 0 1px rgba(30,91,79,.10);
}
.path-style-guidance {
  margin: 0;
  color: #5f6b66;
  font-size: .72rem;
  line-height: 1.4;
}
.legacy-path-mode { display: none !important; }


/* =======================================================================
   SFE Designer — Apple UI v1.8
   Local Add launcher + quieter progressive hierarchy + consistent path mode.
   ======================================================================= */
.operator-editor {
  position: relative;
}

.editor-add-launcher {
  position: absolute;
  z-index: 18;
  left: 10px;
  top: 10px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 9px;
  border: 1px solid rgba(29, 63, 54, .14);
  border-radius: 12px;
  background: rgba(250, 252, 251, .94);
  color: #214c42;
  font: inherit;
  font-size: .76rem;
  font-weight: 760;
  letter-spacing: -.005em;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(24, 33, 31, .08), inset 0 1px 0 rgba(255,255,255,.78);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.editor-add-launcher:hover {
  background: rgba(245, 250, 248, .98);
  border-color: rgba(30, 91, 79, .28);
  box-shadow: 0 9px 26px rgba(24, 33, 31, .10), inset 0 1px 0 rgba(255,255,255,.9);
  transform: translateY(-1px);
}
.editor-add-launcher:active { transform: translateY(0); }
.editor-add-launcher:focus-visible {
  outline: 3px solid rgba(55, 145, 122, .20);
  outline-offset: 2px;
}
.editor-add-launcher[hidden] { display: none !important; }
.editor-add-launcher-icon {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: #e4f2ed;
  color: #1e5b4f;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

/* The sidebar header is the single hierarchy owner. Repeated headings inside
   menu levels create visual noise and extra scanning cost. */
.editor-add-sidebar .sidebar-section-heading { display: none !important; }
.editor-add-sidebar .family-level,
.editor-add-sidebar .component-subfamily-panel { padding-top: 2px; }
.editor-add-sidebar .component-family-options { gap: 9px; }

.add-browser-header {
  position: sticky;
  top: 0;
  z-index: 4;
  margin: -4px -2px 10px;
  padding: 4px 2px 10px;
  background: linear-gradient(180deg, rgba(252,253,252,.985) 72%, rgba(252,253,252,0));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.add-browser-header h2 {
  font-size: 1.02rem;
  font-weight: 740;
  letter-spacing: -.018em;
}
.add-browser-lede { margin-bottom: 14px; }

.path-tool-controls {
  padding: 12px;
  border-radius: 13px;
  box-shadow: none;
  background: rgba(249,251,250,.86);
}
.path-style-segmented {
  gap: 2px;
  padding: 2px;
  border-radius: 10px;
}
.path-style-segmented button {
  min-height: 36px;
  border-radius: 8px;
  font-size: .73rem;
  font-weight: 740;
}
.path-style-segmented button:disabled {
  opacity: .38;
  cursor: not-allowed;
}
.path-tool-controls.straight-only .path-style-guidance {
  color: #77827d;
}

@media (max-width: 980px) {
  .editor-add-launcher { left: 8px; top: 8px; }
}


/* =======================================================================
   SFE Designer — Apple UI v1.9
   Quiet, grouped canvas utility bar. Add is part of the local toolbar rather
   than floating over measurement state. One visual hierarchy, no overlap.
   ======================================================================= */
body[data-editor-workspace="design"] .canvas-toolbar,
body[data-editor-workspace="measurement"] .canvas-toolbar {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  min-height: 48px !important;
  padding: 6px 9px !important;
  border: 1px solid rgba(31, 52, 47, .10) !important;
  border-radius: 12px !important;
  background: rgba(252, 253, 252, .96) !important;
  box-shadow: 0 1px 2px rgba(24, 33, 31, .025) !important;
  overflow: visible !important;
}

.canvas-primary-actions {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.editor-add-launcher {
  position: static !important;
  z-index: auto !important;
  min-height: 34px !important;
  padding: 5px 11px 5px 7px !important;
  gap: 7px !important;
  border: 1px solid rgba(30, 91, 79, .14) !important;
  border-radius: 10px !important;
  background: #eef7f4 !important;
  color: #194f43 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  font-size: .74rem !important;
  font-weight: 760 !important;
  transform: none !important;
}
.editor-add-launcher:hover {
  background: #e5f3ee !important;
  border-color: rgba(30, 91, 79, .24) !important;
  box-shadow: none !important;
  transform: none !important;
}
.editor-add-launcher-icon {
  width: 22px !important;
  height: 22px !important;
  border-radius: 7px !important;
  background: rgba(30, 106, 89, .10) !important;
  color: #1e6a59 !important;
  font-size: .95rem !important;
}

body[data-editor-workspace="design"] .canvas-toolbar .compact-measurement-status,
body[data-editor-workspace="measurement"] .canvas-toolbar .compact-measurement-status {
  min-height: 30px !important;
  padding: 4px 2px !important;
  border: 0 !important;
  background: transparent !important;
  color: #51625d !important;
  font-size: .68rem !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  white-space: nowrap;
}
body[data-editor-workspace="design"] .canvas-toolbar .compact-measurement-status::before,
body[data-editor-workspace="measurement"] .canvas-toolbar .compact-measurement-status::before {
  content: "✓" !important;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  border-radius: 999px;
  background: #dff2ec;
  color: #17604f;
  font-size: .65rem;
  font-weight: 900;
  vertical-align: -1px;
}

body[data-editor-workspace="design"] .canvas-toolbar > .canvas-actions,
body[data-editor-workspace="measurement"] .canvas-toolbar > .canvas-actions {
  flex: 1 1 auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px !important;
  min-width: 0;
}

.display-mode {
  gap: 8px !important;
  margin-left: 4px;
}
.display-mode-label {
  color: #7a8581 !important;
  font-size: .66rem !important;
  font-weight: 680 !important;
}
.display-segmented-control {
  padding: 2px !important;
  border-radius: 9px !important;
  background: #f1f4f2 !important;
}
.display-segmented-control button {
  min-height: 27px !important;
  padding: 3px 10px !important;
}
.enhanced-preview-toggle {
  min-height: 27px !important;
  padding: 2px 4px !important;
  color: #66736e !important;
}

.canvas-view-controls {
  gap: 6px !important;
  margin-left: auto !important;
}
.viewport-controls,
.fit-view-button,
.view-photo-menu > summary {
  min-height: 29px !important;
}
.viewport-controls button { min-height: 29px !important; min-width: 30px !important; }
#viewport-zoom-label { min-width: 48px !important; }
.fit-view-button,
.view-photo-menu > summary { padding: 4px 10px !important; }

@media (max-width: 1080px) {
  body[data-editor-workspace="design"] .canvas-toolbar,
  body[data-editor-workspace="measurement"] .canvas-toolbar {
    flex-wrap: wrap !important;
  }
  body[data-editor-workspace="design"] .canvas-toolbar > .canvas-actions,
  body[data-editor-workspace="measurement"] .canvas-toolbar > .canvas-actions {
    flex-basis: 100%;
  }
}
/* Precision controls are display-only and never receive placement clicks. */
#precision-loupe { position: fixed; z-index: 40; pointer-events: none; width: 182px; border: 1px solid #fff; border-radius: 5px; background: #10201c; color: #fff; box-shadow: 0 3px 12px #0006; }
#precision-loupe canvas { display: block; width: 180px; height: 180px; }
#precision-loupe output { display: block; padding: 5px; font: 11px ui-monospace, monospace; }
.precision-viewport-help { font-size: .66rem; color: var(--muted); }
.operator-stage.is-viewport-pan, .operator-stage.is-viewport-pan #editor-overlay { cursor: grab; }

/* Compact orchestration guidance; original stage and measurement controls are retained. */
.new-project-status { display:flex; flex-wrap:wrap; gap:16px; padding:8px 12px; font-size:12px; color:#52645f; }
#new-project-guidance { padding:12px; background:#f1f7f4; border:1px solid #d6e4dd; border-radius:8px; }
#new-project-guidance p { margin:6px 0; }
#new-project-guidance button { margin-right:8px; }
#twilight-work-status, #twilight-work-help { font-size:12px; }
/* Reserve content-sized rows for guidance; keep the image in the flexible canvas row. */
.editor-stage-wrap { grid-template-rows:auto auto auto minmax(0,1fr) auto; }
.new-project-status { grid-row:1; }
#new-project-guidance, #measurement-setup-section { grid-row:2; }
#measurement-setup-section[hidden] { display:none !important; }
.canvas-toolbar { grid-row:3; }
.editor-stage.operator-stage { grid-row:4; }

/* KINEVAS Design V1 — approved V9 application shell. */
.kinevas-app-header {
  height: 60px;
  min-height: 60px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(28, 34, 30, .12);
  background: rgba(247, 248, 246, .92);
  backdrop-filter: saturate(160%) blur(24px);
  -webkit-backdrop-filter: saturate(160%) blur(24px);
}

.kinevas-shell-identity,
.kinevas-shell-center,
.kinevas-app-header .editor-global-toolbar {
  display: flex;
  align-items: center;
}

.kinevas-shell-identity { min-width: 0; gap: 10px; }
.kinevas-shell-center { justify-self: center; gap: 8px; }
.kinevas-app-header .editor-global-toolbar { justify-self: end; gap: 7px; }

.kinevas-app-header .my-designs-link,
.kinevas-app-header .workspace-toolbar-button,
.kinevas-app-header .workspace-menu > summary,
.kinevas-shell-center .editor-add-launcher {
  min-height: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 10px;
  border: 1px solid rgba(28, 34, 30, .12);
  border-radius: 9px;
  background: rgba(255, 255, 255, .7);
  color: #1d211f;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  text-transform: none;
  box-shadow: none;
}

.kinevas-app-header .my-designs-link:hover,
.kinevas-app-header .workspace-toolbar-button:hover,
.kinevas-app-header .workspace-menu > summary:hover,
.kinevas-shell-center .editor-add-launcher:hover {
  border-color: rgba(28, 34, 30, .2);
  background: #fff;
  color: #1d211f;
}

.kinevas-shell-center .editor-add-launcher {
  position: static;
  inset: auto;
  transform: none;
  width: auto;
  margin: 0;
  font-weight: 700;
}

.kinevas-shell-center .editor-add-launcher-icon { font-size: 15px; line-height: 1; }
.kinevas-shell-separator { width: 1px; height: 22px; background: rgba(28, 34, 30, .12); }

.kinevas-app-header .property-heading { display: grid; flex: 0 1 auto; gap: 1px; min-width: 0; }
.kinevas-app-header .property-heading strong { color: #1d211f; font-size: 13px; font-weight: 680; letter-spacing: -.01em; }
.kinevas-app-header .property-heading span { color: #6c726e; font-size: 10.5px; margin-top: 1px; }

.kinevas-app-header .app-nav {
  height: auto;
  align-items: center;
  gap: 0;
  padding: 3px;
  border-radius: 10px;
  background: rgba(30, 37, 33, .055);
}

.kinevas-app-header .app-nav a {
  min-height: 28px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  color: #4f5551;
  font-size: 12px;
  font-weight: 650;
  text-transform: none;
}

.kinevas-app-header .app-nav a:hover,
.kinevas-app-header .app-nav a.active {
  border: 0;
  background: #fff;
  color: #1d211f;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
}

.kinevas-app-header .workspace-menu-panel {
  top: 39px;
  min-width: 190px;
  gap: 2px;
  padding: 6px;
  border: 1px solid rgba(28, 34, 30, .12);
  border-radius: 11px;
  background: rgba(250, 251, 249, .97);
  box-shadow: 0 14px 36px rgba(0, 0, 0, .18);
  backdrop-filter: saturate(150%) blur(24px);
  -webkit-backdrop-filter: saturate(150%) blur(24px);
}

.kinevas-app-header .workspace-menu-panel button {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 9px;
  border-radius: 7px;
  color: #1d211f;
  font-size: 12px;
  font-weight: 500;
}

.kinevas-app-header .workspace-menu-panel button:hover { background: rgba(30, 37, 33, .055); color: #1d211f; }
.kinevas-app-header .workspace-menu-label { padding: 5px 9px 4px; color: #6c726e; font-size: 9.5px; letter-spacing: .07em; }
.workspace-menu-divider { height: 1px; margin: 4px 3px; background: rgba(28, 34, 30, .12); }
.kinevas-app-header .workspace-menu-danger { color: #a13b35; }

.kinevas-app-header .display-mode { display: grid; gap: 7px; margin: 0; padding: 0 3px 5px; }
.kinevas-app-header .display-segmented-control { display: flex; width: 100%; }
.kinevas-app-header .display-segmented-control button { flex: 1; justify-content: center; }
.kinevas-app-header #twilight-work-status,
.kinevas-app-header #twilight-work-help { padding: 0 6px; color: #6c726e; font-size: 10px; line-height: 1.35; }

.operator-editor { height: calc(100vh - 74px); }

.property-setup-list { display: grid; }
.property-setup-list button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px;
  border: 0;
  border-bottom: 1px solid rgba(28, 34, 30, .12);
  background: transparent;
  color: #1d211f;
  text-align: left;
}
.property-setup-list button:hover { background: rgba(30, 37, 33, .035); }
.property-setup-list button span:first-child { display: grid; gap: 2px; }
.property-setup-list strong { font-size: 13px; }
.property-setup-list small { color: #6c726e; font-size: 11px; }
.property-information-list { display: grid; gap: 0; margin: 0; }
.property-information-list div { padding: 12px 2px; border-bottom: 1px solid rgba(28, 34, 30, .12); }
.property-information-list dt { color: #6c726e; font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.property-information-list dd { margin: 5px 0 0; color: #1d211f; font-size: 13px; line-height: 1.4; }

@media (max-width: 900px) {
  .kinevas-app-header .property-heading span { display: none; }
  .kinevas-app-header .app-nav a { padding: 0 10px; }
}


/* KINEVAS Design V1 — neutral Design workspace cleanup.
   Successful infrastructure and precision utilities stay functional but do
   not occupy persistent canvas chrome. Measurement workspace is unchanged. */
body[data-editor-workspace="design"] .new-project-status,
body[data-editor-workspace="design"] .canvas-toolbar {
  display: none !important;
}

body[data-editor-workspace="design"] .operator-editor {
  height: calc(100vh - 60px);
  margin-top: 0;
  gap: 0;
}

body[data-editor-workspace="design"] .editor-stage-wrap {
  height: 100%;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0;
}

body[data-editor-workspace="design"] #new-project-guidance,
body[data-editor-workspace="design"] #measurement-setup-section {
  display: none !important;
}

body[data-editor-workspace="design"] .editor-stage.operator-stage {
  grid-row: 1;
  min-height: 0;
  height: 100%;
  max-height: none;
  border: 0;
}

body[data-editor-workspace="design"] .editor-message {
  grid-row: 2;
}

body[data-editor-workspace="design"] .editor-add-sidebar,
body[data-editor-workspace="design"] .editor-context-sidebar {
  margin-top: 14px;
  margin-bottom: 14px;
}


/* KINEVAS Design V1 — Add to Design surface. */
body[data-editor-workspace="design"] .operator-editor:has(.editor-add-sidebar:not([hidden])),
body[data-editor-workspace="design"] .operator-editor.has-workspace-drawer:has(.editor-add-sidebar:not([hidden])) {
  grid-template-columns: minmax(0, 1fr);
}

body[data-editor-workspace="design"] .editor-add-sidebar {
  position: absolute;
  z-index: 24;
  top: 14px;
  bottom: 14px;
  left: 14px;
  width: 300px;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,.58);
  border-radius: 14px;
  background: rgba(249,250,248,.94);
  box-shadow: 0 18px 52px rgba(11,17,13,.22);
  backdrop-filter: saturate(150%) blur(26px);
  -webkit-backdrop-filter: saturate(150%) blur(26px);
}

body[data-editor-workspace="design"] .editor-add-sidebar:has(.family-nav:not([hidden])) {
  bottom: auto;
  height: auto;
  max-height: calc(100% - 28px);
}

body[data-editor-workspace="design"] .add-browser-header {
  position: sticky;
  top: 0;
  z-index: 4;
  min-height: 52px;
  margin: 0;
  padding: 0 12px;
  align-items: center;
  border-bottom: 1px solid rgba(28,34,30,.12);
  background: rgba(249,250,248,.96);
}

body[data-editor-workspace="design"] .add-browser-title-stack { gap: 0; }
body[data-editor-workspace="design"] .add-browser-header h2 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -.01em;
}
body[data-editor-workspace="design"] .add-browser-back {
  min-height: 24px;
  margin: 0 0 1px;
  font-size: 11px;
  color: #4f5551;
}
body[data-editor-workspace="design"] .add-browser-lede {
  margin: 0;
  padding: 10px 14px 5px;
  color: #6c726e;
  font-size: 10.5px;
  line-height: 1.35;
}
body[data-editor-workspace="design"] .family-nav,
body[data-editor-workspace="design"] .component-family-panel {
  padding: 5px 10px 10px;
}
body[data-editor-workspace="design"] .family-nav,
body[data-editor-workspace="design"] .component-family-options { gap: 2px; }

body[data-editor-workspace="design"] .family-nav button.component-nav-row,
body[data-editor-workspace="design"] .component-family-options > button.component-nav-row,
body[data-editor-workspace="design"] .sidebar-secondary-actions button.component-nav-row {
  min-height: 48px;
  margin: 0;
  padding: 8px 6px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  box-shadow: none;
  transform: none;
}
body[data-editor-workspace="design"] .family-nav button.component-nav-row:hover,
body[data-editor-workspace="design"] .component-family-options > button.component-nav-row:hover,
body[data-editor-workspace="design"] .sidebar-secondary-actions button.component-nav-row:hover {
  border-color: rgba(28,34,30,.12);
  background: #fff;
  box-shadow: none;
  transform: none;
}
body[data-editor-workspace="design"] .component-nav-icon {
  width: 29px;
  height: 29px;
  border-radius: 8px;
  background: rgba(30,37,33,.055);
  font-size: 15px;
}
body[data-editor-workspace="design"] .component-nav-copy strong {
  font-size: 12.5px;
  font-weight: 680;
}
body[data-editor-workspace="design"] .component-nav-copy small {
  color: #737875;
  font-size: 10px;
  white-space: normal;
}
body[data-editor-workspace="design"] .component-nav-chevron { font-size: 13px; }

body[data-editor-workspace="design"] .add-tool-state {
  display: block;
  padding: 10px 12px 12px;
}
body[data-editor-workspace="design"] .add-tool-state[hidden] { display: none !important; }
body[data-editor-workspace="design"] .add-tool-state-icon { display: none; }
body[data-editor-workspace="design"] .add-tool-state-copy { display: grid; gap: 2px; }
body[data-editor-workspace="design"] .add-tool-state-copy > span { display: none; }
body[data-editor-workspace="design"] .add-tool-state-copy strong {
  font-size: 16px;
  font-weight: 720;
  letter-spacing: -.02em;
}
body[data-editor-workspace="design"] .add-tool-state-copy p {
  margin: 0;
  color: #6c726e;
  font-size: 10.5px;
  line-height: 1.35;
}
body[data-editor-workspace="design"] .add-tool-state-help {
  margin: 10px 0 0;
  padding: 10px 0 0;
  border-top: 1px solid rgba(28,34,30,.12);
  color: #343936;
  font-size: 11.5px;
  line-height: 1.4;
}
body[data-editor-workspace="design"] .path-tool-controls {
  margin-top: 12px;
  padding: 12px 0 0;
  border-top: 1px solid rgba(28,34,30,.12);
  border-radius: 0;
  background: transparent;
}
body[data-editor-workspace="design"] .path-tool-heading small { display: none; }
body[data-editor-workspace="design"] .path-tool-label,
body[data-editor-workspace="design"] .tree-tool-label {
  color: #737875;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}
body[data-editor-workspace="design"] .path-style-segmented,
body[data-editor-workspace="design"] .tree-treatment-segmented {
  margin-top: 7px;
  padding: 3px;
  border-radius: 8px;
  background: rgba(30,37,33,.055);
}
body[data-editor-workspace="design"] .path-style-segmented button,
body[data-editor-workspace="design"] .tree-treatment-segmented button {
  min-height: 28px;
  border: 0;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 650;
}
body[data-editor-workspace="design"] .path-style-segmented button.active,
body[data-editor-workspace="design"] .tree-treatment-segmented button.active {
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}
body[data-editor-workspace="design"] .path-style-guidance { margin: 8px 2px 0; font-size: 10.5px; color: #6c726e; }

body[data-editor-workspace="design"] .tree-tool-controls {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(28,34,30,.12);
}
body[data-editor-workspace="design"] .tree-tool-section { padding: 0 0 12px; }
body[data-editor-workspace="design"] .tree-brush-stepper { border-radius: 9px; }
body[data-editor-workspace="design"] .tree-tool-actions { gap: 6px; }
body[data-editor-workspace="design"] .tree-canopy-guidance {
  gap: 8px;
  padding: 10px 11px;
  border-radius: 10px;
  background: #edf5f2;
  font-size: 11px;
}
body[data-editor-workspace="design"] .add-tool-cancel {
  width: 100%;
  min-height: 34px;
  margin-top: 10px;
  border: 1px solid rgba(28,34,30,.12);
  border-radius: 9px;
  background: #fff;
  font-size: 12px;
}

@media (max-width: 900px) {
  body[data-editor-workspace="design"] .editor-add-sidebar {
    width: min(280px, calc(100% - 28px));
  }
}


/* KINEVAS Design V1 — creation ownership correction.
   Add to Design is the sole normal creation surface; legacy context bar is
   reserved for guarded transition decisions only. */
body[data-editor-workspace="design"] .context-bar:not(:has(#context-bar-transition:not([hidden]))) {
  display: none !important;
}
body[data-editor-workspace="design"] .legacy-path-mode {
  display: none !important;
}
body[data-editor-workspace="design"] .add-tool-state-help:empty {
  display: none;
}
body[data-editor-workspace="design"] .add-tool-operation-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
  margin-top: 12px;
}
body[data-editor-workspace="design"] .add-tool-operation-actions:has(> button[hidden] + button[hidden]) {
  display: none;
}
body[data-editor-workspace="design"] .add-tool-operation-actions button {
  min-height: 34px;
  border: 1px solid rgba(28,34,30,.12);
  border-radius: 9px;
  background: #fff;
  color: #1d211f;
  font-size: 12px;
  font-weight: 650;
}
body[data-editor-workspace="design"] .add-tool-operation-actions .primary-action {
  background: #175f4b;
  color: #fff;
  border-color: #175f4b;
}
body[data-editor-workspace="design"] .tree-tool-controls {
  display: grid;
  gap: 0;
}
body[data-editor-workspace="design"] .tree-tool-section {
  padding: 12px 0;
  border-bottom: 1px solid rgba(28,34,30,.12);
}
body[data-editor-workspace="design"] .tree-tool-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
}
body[data-editor-workspace="design"] .tree-tool-row small {
  display: block;
  margin-top: 2px;
  color: #777c79;
  font-size: 10px;
}
body[data-editor-workspace="design"] .tree-brush-stepper {
  display: grid;
  grid-template-columns: 32px 54px 32px;
  overflow: hidden;
  border: 1px solid rgba(28,34,30,.12);
  background: #fff;
}
body[data-editor-workspace="design"] .tree-brush-stepper button {
  border: 0;
  background: #fff;
  font-size: 16px;
  font-weight: 800;
}
body[data-editor-workspace="design"] .tree-brush-stepper span {
  display: grid;
  place-items: center;
  border-left: 1px solid rgba(28,34,30,.12);
  border-right: 1px solid rgba(28,34,30,.12);
  font-size: 11px;
  font-weight: 700;
}
body[data-editor-workspace="design"] .tree-tool-actions {
  display: grid;
  gap: 6px;
  padding-top: 10px;
}
body[data-editor-workspace="design"] .tree-tool-actions button {
  min-height: 34px;
  margin: 0;
  border-radius: 9px;
}
body[data-editor-workspace="design"] #tree-wrap-finish {
  background: #175f4b;
  color: #fff;
  border-color: #175f4b;
}
body[data-editor-workspace="design"] .tree-canopy-guidance {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 11px;
  border-radius: 10px;
  background: #edf5f2;
  color: #343936;
  font-size: 11px;
  line-height: 1.35;
}
body[data-editor-workspace="design"] .tree-canopy-guidance[hidden] { display: none !important; }


/* KINEVAS Design V1 — header menus must render above the canvas.
   The app header previously established no stacking context, allowing the
   following workspace/overlay to paint over View and More dropdowns. */
.kinevas-app-header {
  position: relative;
  z-index: 100;
  overflow: visible;
}

.kinevas-app-header .editor-global-toolbar,
.kinevas-app-header .workspace-menu {
  position: relative;
  z-index: 101;
  overflow: visible;
}

.kinevas-app-header .workspace-menu[open] {
  z-index: 120;
}

.kinevas-app-header .workspace-menu-panel {
  z-index: 121;
}

body[data-editor-workspace="design"] .operator-editor {
  position: relative;
  z-index: 1;
}

/* KINEVAS Packages V1 — approved application shell. */
.packages-v1 {
  background: #ecefeb;
  color: #171b19;
}

.packages-v1 .package-builder-shell {
  width: 100%;
  max-width: none;
  padding: 0 0 60px;
}

.packages-v1 .packages-app-header {
  position: sticky;
  top: 0;
  padding: 0 24px;
  border-bottom-color: #cfd5d1;
  background: rgba(250, 251, 249, .97);
}

.packages-v1 .packages-shell-end {
  min-width: 1px;
}

.packages-v1 .packages-workspace {
  width: min(1320px, calc(100% - 56px));
  margin: 0 auto;
  padding-top: 22px;
}

.packages-v1 .packages-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
  margin-bottom: 16px;
}

.packages-v1 .packages-hero .eyebrow {
  display: block;
  margin: 0;
  color: #78807c;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
}

.packages-v1 .packages-hero h1 {
  margin: 5px 0;
  color: #151917;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -.035em;
}

.packages-v1 .packages-hero p {
  margin: 0;
  color: #59615d;
  font-size: 12.5px;
}

.packages-legend {
  display: flex;
  gap: 14px;
  color: #58615c;
  font-size: 10.5px;
  font-weight: 650;
}

.packages-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
}

.packages-dot-direct { background: #175f4b; }
.packages-dot-inherited { background: #aeb7b2; }

.packages-review-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 10px;
  padding: 11px 14px;
  border: 1px solid #cdd4d0;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(20, 30, 25, .035);
}

.packages-review-banner div { display: grid; }
.packages-review-banner strong { color: #1b211d; font-size: 12px; }
.packages-review-banner span { color: #6f7572; font-size: 10.5px; }

.packages-message {
  min-height: 0;
  margin: 0 0 10px;
  color: #675329;
  font-size: 11px;
}

.packages-message:empty { display: none; }

.packages-matrix-card {
  overflow: hidden;
  border: 1px solid #c9d0cc;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 14px 38px rgba(17, 28, 22, .09);
}

.packages-matrix-scroll { overflow-x: auto; }

.packages-v1 .package-selection-table {
  width: 100%;
  min-width: 950px;
  border-spacing: 0;
  border-collapse: separate;
  table-layout: fixed;
}

.packages-v1 .package-selection-table th:first-child,
.packages-v1 .package-selection-table td:first-child { width: 30%; }
.packages-v1 .package-selection-table th:nth-child(2),
.packages-v1 .package-selection-table td:nth-child(2) { width: 130px; }

.packages-v1 .package-selection-table thead { background: #f8faf8; }

.packages-v1 .package-selection-table th {
  height: 92px;
  padding: 14px 10px;
  border-bottom: 1px solid #cbd2ce;
  color: #616a65;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-align: left;
  text-transform: uppercase;
  vertical-align: bottom;
}

.packages-v1 .package-selection-table th:nth-child(n+3) {
  border-left: 1px solid #d4dbd7;
  background: #f3f7f4;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
  vertical-align: top;
}

.packages-v1 .package-selection-table th:nth-last-child(2) { background: #edf5f1; }
.packages-v1 .package-selection-table th small { display: block; color: #68726d; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.packages-v1 .package-selection-table th strong { display: block; min-height: 32px; margin-top: 2px; color: #202522; font-size: 13px; line-height: 1.25; }
.packages-v1 .package-selection-table th b { display: block; margin-top: 5px; color: #123f33; font-size: 23px; letter-spacing: -.02em; }

.package-pricing-disclosure,
.package-readiness-disclosure {
  margin-top: 5px;
  color: #675329;
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.package-pricing-disclosure summary,
.package-readiness-disclosure summary { cursor: pointer; }
.package-pricing-disclosure ul,
.package-readiness-disclosure ul { margin: 6px 0 0; padding-left: 16px; font-weight: 500; }
.package-pricing-disclosure li,
.package-readiness-disclosure li { margin-top: 3px; }

.packages-v1 .package-selection-table tbody tr {
  min-height: 66px;
  transition: background .12s ease, box-shadow .12s ease;
}

.packages-v1 .package-selection-table tbody tr:hover {
  background: #f2f6f3;
  box-shadow: inset 3px 0 0 #27745f;
}

.packages-v1 .package-selection-table td {
  height: 66px;
  padding: 10px;
  border-bottom: 1px solid #dfe4e1;
  vertical-align: middle;
}

.package-component-name { display: block; color: #181d1a; font-size: 13px; font-weight: 760; }
.package-component-meta { display: block; margin-top: 2px; color: #707975; font-size: 10px; }
.package-quantity { color: #252b27; font-size: 12px; font-weight: 760; }

.packages-v1 .package-selection-table td.package-choice {
  border-left: 1px solid #e0e5e2;
  text-align: left;
}

.package-choice.direct { background: #f1f8f4; }
.package-choice.direct .package-check { color: #145b47; }
.package-choice.inherited { background: #f3f5f3; }
.package-choice.inherited .package-check { color: #68716c; }
.package-choice.inherited input { opacity: .72; }

.packages-v1 .package-check {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #38413c;
  font-size: 11px;
  font-weight: 720;
  cursor: pointer;
}

.packages-v1 .package-check input { width: 15px; height: 15px; accent-color: #175f4b; }
.packages-v1 .package-check:has(input:disabled) { cursor: default; }

.packages-v1 .package-selection-table tfoot { background: #f5f7f5; }
.packages-v1 .package-selection-table tfoot td { height: auto; padding: 13px 10px; border-bottom: 0; border-top: 1px solid #cfd5d1; }
.packages-v1 .package-selection-table tfoot td:nth-child(n+2) { border-left: 1px solid #edf0ee; }
.packages-v1 .package-selection-table tfoot strong { display: block; font-size: 11.5px; }
.packages-v1 .package-selection-table tfoot span { color: #626b66; font-size: 9.5px; }
.packages-v1 .package-selection-table .ready { color: #175f4b; font-weight: 800; }
.packages-v1 .package-selection-table .review { color: #9b691d; font-weight: 800; }

.packages-note { margin: 14px 0 0; color: #59625d; font-size: 10.5px; }

.packages-matrix-card.locked { opacity: .86; }
.packages-v1 #package-design-lock:not([hidden]) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.packages-matrix-card.locked::before {
  content: "CUSTOMER-SELECTED DESIGN · Package membership is locked";
  display: block;
  padding: 10px 18px;
  border-bottom: 1px solid #ead9b5;
  background: #fff7e7;
  color: #6d5523;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
}

@media (max-width: 900px) {
  .packages-v1 .packages-workspace { width: min(100% - 32px, 1320px); }
  .packages-v1 .packages-hero { display: block; }
  .packages-v1 .packages-legend { margin-top: 12px; }
}

/* KINEVAS Proposal Workspace V1 — approved information hierarchy. */
.proposal-workspace-v1 {
  background: #ecefeb;
  color: #171b19;
}

.proposal-workspace-v1 .commercial-shell {
  width: 100%;
  max-width: none;
  padding: 0 0 60px;
}

.proposal-workspace-v1 .proposal-app-header {
  position: sticky;
  top: 0;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 16px;
  padding: 0 24px;
  border-bottom-color: #cfd5d1;
  background: rgba(250, 251, 249, .97);
}

.proposal-workspace-v1 .proposal-shell-end { min-width: 1px; }

.proposal-workspace-v1 .proposal-workspace {
  width: min(1080px, calc(100% - 56px));
  margin: 0 auto;
  padding-top: 30px;
}

.proposal-workspace-v1 .commercial-kicker {
  margin: 0;
  color: #77807b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
}

.proposal-workspace-v1 #commercial-status-title {
  margin: 5px 0 4px;
  color: #171b19;
  font-size: 29px;
  line-height: 1.1;
  letter-spacing: -.035em;
}

.proposal-workspace-v1 .commercial-subtitle {
  margin: 0 0 22px;
  color: #68706c;
  font-size: 12px;
}

.proposal-workspace-v1 .commercial-status-panel,
.proposal-workspace-v1 .commercial-section,
.proposal-workspace-v1 .commercial-details {
  border: 1px solid #d4dad6;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 7px 20px rgba(20, 30, 25, .035);
}

.proposal-workspace-v1 .commercial-hero {
  padding: 22px 24px;
  border-color: #cbd2ce;
  border-radius: 16px;
  box-shadow: 0 14px 38px rgba(17, 28, 22, .08);
}

.proposal-workspace-v1 .commercial-hero-head { gap: 30px; }
.proposal-workspace-v1 .commercial-status-panel h2 { margin: 5px 0; font-size: 25px; }
.proposal-workspace-v1 .commercial-status-pill { padding: 7px 10px; font-size: 10px; letter-spacing: .03em; }

.proposal-workspace-v1 .commercial-actions { gap: 9px; margin-top: 20px; }
.proposal-workspace-v1 .commercial-actions button,
.proposal-workspace-v1 .commercial-actions a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border: 1px solid #c8cfcb;
  border-radius: 9px;
  background: #fff;
  color: #365046;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.proposal-workspace-v1 .commercial-actions .primary-action {
  border-color: #175f4b;
  background: #175f4b;
  color: #fff;
  font-size: 12px;
  font-weight: 760;
}

.proposal-workspace-v1 .proposal-intelligence-grid {
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, .65fr);
  gap: 14px;
  margin-top: 14px;
}

.proposal-workspace-v1 .commercial-summary .commercial-section { margin-top: 0; }
.proposal-workspace-v1 .commercial-customer-activity {
  border-color: #c6d4ce;
  background: linear-gradient(180deg, #fff, #fbfdfc);
}

.proposal-workspace-v1 .commercial-section h2 { margin: 5px 0 3px; font-size: 16px; letter-spacing: -.02em; }
.proposal-workspace-v1 .commercial-live-state { margin: 5px 0 0; color: #15523f; font-size: 10.5px; font-weight: 780; }
.proposal-workspace-v1 .commercial-metric-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.proposal-workspace-v1 .commercial-metric { padding: 12px; border: 1px solid #e1e5e2; border-radius: 10px; background: #fafbfa; }
.proposal-workspace-v1 .commercial-metric span,
.proposal-workspace-v1 .commercial-decision-facts span { display: block; color: #777f7b; font-size: 9.5px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.proposal-workspace-v1 .commercial-metric strong { display: block; margin-top: 4px; font-size: 17px; }
.proposal-workspace-v1 .commercial-signal-list { display: grid; gap: 7px; margin-top: 13px; padding-top: 13px; border-top: 1px solid #e3e8e5; }
.proposal-workspace-v1 .commercial-signal-list > div { display: flex; justify-content: space-between; gap: 16px; font-size: 11px; }
.proposal-workspace-v1 .commercial-signal-list span { color: #68706c; }
.proposal-workspace-v1 .commercial-signal-list strong { color: #27302b; text-align: right; }

.proposal-workspace-v1 .commercial-decision-facts { display: grid; gap: 12px; margin-top: 15px; padding-top: 14px; border-top: 1px solid #e4e8e5; }
.proposal-workspace-v1 .commercial-decision-facts strong { display: block; margin-top: 3px; color: #154f3e; font-size: 15px; }
.proposal-workspace-v1 .commercial-revision { margin-top: 14px; }
.proposal-workspace-v1 .commercial-activity-section { margin-top: 14px; }
.proposal-workspace-v1 .commercial-activity-row { border-bottom: 1px solid #edf0ee; }
.proposal-workspace-v1 .commercial-activity-row:last-child { border-bottom: 0; }
.proposal-workspace-v1 .commercial-activity-row.proposal-link-activity .commercial-activity-dot { background: #2f8a6c; box-shadow: 0 0 0 3px #e7f3ee; }
.proposal-workspace-v1 .commercial-activity-row.system-activity .commercial-activity-dot { background: #7c8781; }
.proposal-workspace-v1 .commercial-details { margin-top: 14px; border-radius: 12px; }

@media (max-width: 760px) {
  .proposal-workspace-v1 .proposal-workspace { width: min(100% - 32px, 1080px); }
  .proposal-workspace-v1 .proposal-intelligence-grid { grid-template-columns: 1fr; }
  .proposal-workspace-v1 .commercial-hero-head { display: block; }
  .proposal-workspace-v1 .commercial-status-pill { display: inline-block; margin-top: 12px; }
}


/* KINEVAS Design V1 — contextual Inspector overlays the stable canvas.
   Opening Properties must never resize/reflow the property image. */
body[data-editor-workspace="design"] .operator-editor.has-workspace-drawer,
body[data-editor-workspace="design"] .operator-editor.has-workspace-drawer:not(:has(.editor-add-sidebar:not([hidden]))),
body[data-editor-workspace="design"] .operator-editor.has-workspace-drawer:has(.editor-add-sidebar:not([hidden])) {
  grid-template-columns: minmax(0, 1fr);
}

body[data-editor-workspace="design"] .editor-context-sidebar {
  position: absolute;
  z-index: 23;
  top: 14px;
  right: 14px;
  bottom: 14px;
  width: 294px;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,.58);
  border-radius: 14px;
  background: rgba(249,250,248,.96);
  box-shadow: 0 18px 52px rgba(11,17,13,.22);
  backdrop-filter: saturate(150%) blur(26px);
  -webkit-backdrop-filter: saturate(150%) blur(26px);
}

body[data-editor-workspace="design"] .editor-context-sidebar > section {
  padding: 14px;
}

@media (max-width: 900px) {
  body[data-editor-workspace="design"] .editor-context-sidebar {
    width: min(280px, calc(100% - 28px));
  }
}

/* KINEVAS Designer — core interaction architecture V1.
   Task mode: once a tool is active, Add to Design collapses to a compact,
   auto-height task strip (component, instruction, tool controls, Done, Cancel)
   so the property stays visible and spatially stable. Browse mode is unchanged. */
body[data-editor-workspace="design"] .editor-add-sidebar[data-add-mode="task"] {
  bottom: auto;
  height: auto;
  max-height: calc(100% - 28px);
  width: 260px;
}
body[data-editor-workspace="design"] .editor-add-sidebar[data-add-mode="task"] .add-browser-header,
body[data-editor-workspace="design"] .editor-add-sidebar[data-add-mode="task"] .add-browser-lede {
  display: none;
}
body[data-editor-workspace="design"] .editor-add-sidebar[data-add-mode="task"] .add-tool-state {
  padding: 10px 12px;
}
body[data-editor-workspace="design"] .editor-add-sidebar[data-add-mode="task"] .add-tool-state-copy > span {
  display: block;
  color: #737875;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}
body[data-editor-workspace="design"] .editor-add-sidebar[data-add-mode="task"] .add-tool-state-copy strong {
  font-size: 14px;
}
body[data-editor-workspace="design"] .editor-add-sidebar[data-add-mode="task"] .add-tool-operation-actions,
body[data-editor-workspace="design"] .editor-add-sidebar[data-add-mode="task"] .path-tool-controls,
body[data-editor-workspace="design"] .editor-add-sidebar[data-add-mode="task"] .tree-tool-controls {
  margin-top: 9px;
  padding-top: 9px;
}
body[data-editor-workspace="design"] .editor-add-sidebar[data-add-mode="task"] .add-tool-cancel {
  margin-top: 7px;
  min-height: 30px;
}

/* Edit handles keep a constant on-screen size (radii are set in screen space);
   keep their outlines constant too instead of scaling with zoom. */
.editor-control,
.editor-rotate-control,
.roofline-handle-knob {
  vector-effect: non-scaling-stroke;
}
.wreath-selection-ring {
  fill: none;
  stroke: #ff2d55;
  stroke-width: 2;
  stroke-dasharray: 5 4;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
