:root {
  color-scheme: light;

  --shell: #111719;
  --shell-raised: #192124;
  --shell-hover: #252f34;
  --shell-line: #344047;
  --canvas: #e7ecee;
  --panel: #f7f9f8;
  --panel-raised: #fcfdfc;
  --panel-subtle: #edf1f1;
  --field: #fbfcfb;

  --ink: #192227;
  --muted: #617078;
  --muted-strong: #4a5960;
  --quiet: #859198;
  --inverse: #f5f7f6;
  --line-subtle: #e0e6e8;
  --line: #cbd5d9;
  --line-strong: #9eabb1;

  --nico-yellow: #d2a225;
  --accent: #d2a225;
  --accent-hover: #b98917;
  --accent-soft: #fff5d9;
  --accent-ring: rgba(210, 162, 37, 0.24);
  --accent-2: var(--shell);

  --warn: #8a5b07;
  --warn-soft: #fff3d4;
  --danger: #a13d45;
  --danger-soft: #fff0f1;
  --ok: #21704e;
  --ok-soft: #eaf6ef;
  --success: #286f63;

  --space-1: 4px;
  --space-2: 6px;
  --space-3: 8px;
  --space-4: 12px;
  --space-5: 16px;
  --space-6: 20px;
  --space-7: 24px;
  --space-8: 32px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --shadow-low: 0 1px 2px rgba(11, 19, 23, 0.07);
  --shadow: 0 10px 28px rgba(11, 19, 23, 0.1);
  --shadow-modal: 0 28px 70px rgba(5, 11, 14, 0.34);

  --bg: var(--canvas);
  --text: var(--ink);
  --surface: var(--panel);
  --soft: var(--panel-subtle);
  --dark: var(--shell);
  --dark-2: var(--shell-raised);
  --dark-3: var(--shell-hover);
}

/* Professional audit consolidation: shared feedback and core budget flow. */
.section-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--accent-hover);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
}

.app-dialog-backdrop {
  z-index: 70;
}

.app-dialog {
  width: min(460px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  background: var(--panel-raised);
  box-shadow: var(--shadow-modal);
}

.app-dialog-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 22px 22px 18px;
}

.app-dialog-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid #e4c66f;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.app-dialog--danger .app-dialog-icon {
  border-color: #e3b8bc;
  background: var(--danger-soft);
  color: var(--danger);
}

.app-dialog-icon svg {
  width: 19px;
  height: 19px;
}

.app-dialog h3 {
  margin: 1px 0 6px;
  font-size: 19px;
  font-weight: 650;
}

.app-dialog p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.app-dialog-field {
  margin: 0 22px 20px;
}

.app-dialog-field > span {
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 600;
}

.app-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 22px;
  border-top: 1px solid var(--line-subtle);
  background: var(--panel-subtle);
}

.quick-price-add-backdrop {
  z-index: 65;
}

.quick-price-add-modal {
  width: min(680px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  background: var(--panel-raised);
  box-shadow: var(--shadow-modal);
}

.quick-price-add-head {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line-subtle);
}

.quick-price-add-head h3 {
  margin: 2px 0 5px;
  color: var(--ink);
  font-size: 22px;
}

.quick-price-add-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

#quick-price-add-form {
  display: grid;
}

.quick-price-add-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 20px 24px 22px;
}

.quick-price-add-description {
  grid-column: 1 / -1;
}

.quick-price-add-fields .field {
  min-width: 0;
}

.quick-price-add-fields .field > span:first-child {
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 650;
}

.quick-price-add-fields input,
.quick-price-add-fields select,
.quick-price-add-fields .money-input-cell {
  width: 100%;
  min-height: 44px;
}

.quick-price-add-fields .money-input-cell input {
  min-height: 40px;
}

.quick-price-add-error {
  margin: -6px 24px 18px;
  padding: 10px 12px;
  border-left: 3px solid var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
}

.quick-price-add-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 24px;
  border-top: 1px solid var(--line-subtle);
  background: var(--panel-subtle);
}

.app-toast {
  position: fixed;
  z-index: 80;
  top: 18px;
  right: 20px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  width: min(360px, calc(100vw - 40px));
  min-height: 50px;
  padding: 12px 15px;
  border: 1px solid #88bea4;
  border-radius: var(--radius-md);
  background: #f2faf6;
  color: #175b3d;
  box-shadow: var(--shadow);
}

.app-toast--error {
  border-color: #d7a2a7;
  background: var(--danger-soft);
  color: var(--danger);
}

.app-toast--info {
  border-color: #dec16b;
  background: var(--accent-soft);
  color: #6f5200;
}

.app-toast svg {
  width: 18px;
  height: 18px;
}

.app-toast strong {
  font-size: 13px;
  font-weight: 650;
}

.sidebar-user-action {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}

.sidebar-user-action svg {
  width: 16px;
  height: 16px;
}

.construction-workbench {
  overflow: hidden;
  padding: 0;
}

.construction-head {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  gap: 18px;
  align-items: center;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line-subtle);
}

.construction-head h3,
.review-head h3,
.pricing-head h3,
.proposal-head h3,
.budget-list-head h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 650;
}

.construction-head p,
.review-head p,
.pricing-head p,
.proposal-head p,
.budget-list-head p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.construction-client,
.pricing-client-context,
.review-head-context,
.proposal-client-context {
  display: grid;
  gap: 3px;
  min-width: 190px;
  padding-left: 17px;
  border-left: 2px solid var(--accent);
}

.construction-client span,
.pricing-client-context span,
.review-head-context span,
.proposal-client-context span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.construction-client strong,
.pricing-client-context strong,
.review-head-context strong,
.proposal-client-context strong {
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 650;
}

.construction-head .panel-actions {
  flex-wrap: nowrap;
}

.construction-start-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 20px 22px 22px;
  background: var(--panel-subtle);
}

.construction-start-option {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 24px;
  gap: 13px;
  align-items: center;
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-raised);
  color: var(--ink);
  text-align: left;
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.construction-start-option:hover {
  border-color: var(--line-strong);
  background: #fff;
  box-shadow: var(--shadow-low);
}

.construction-start-option--accent {
  border-color: #dfbf5b;
  background: var(--accent-soft);
}

.construction-start-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--shell);
  color: var(--accent);
}

.construction-start-icon svg,
.construction-start-arrow svg {
  width: 19px;
  height: 19px;
}

.construction-start-option > span:nth-child(2) {
  display: grid;
  gap: 5px;
}

.construction-start-option strong {
  font-size: 15px;
  font-weight: 650;
}

.construction-start-option small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.construction-start-option--pending {
  grid-template-columns: 44px minmax(0, 1fr) auto;
  background: #e9eeef;
  cursor: not-allowed;
  opacity: 0.78;
}

.construction-start-option--pending:hover {
  border-color: var(--line);
  background: #e9eeef;
  box-shadow: none;
}

.pilot-inline-badge,
.new-model-type-status,
.loose-type-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid #d8c680;
  border-radius: 11px;
  background: #fff8df;
  color: #775a0c;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.pilot-coming-soon-action:disabled {
  opacity: 0.72;
}

.pilot-coming-soon-action small {
  padding-left: 7px;
  border-left: 1px solid var(--line);
  color: var(--accent-hover);
  font-size: 10px;
  font-weight: 700;
}

.construction-start-arrow {
  color: var(--muted);
}

.construction-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 0.7fr)) minmax(180px, 1.2fr);
  border-top: 1px solid var(--line-subtle);
  background: var(--panel-subtle);
}

.construction-overview > div {
  display: grid;
  gap: 3px;
  align-content: center;
  min-height: 70px;
  padding: 12px 18px;
  border-left: 1px solid var(--line-subtle);
}

.construction-overview > div:first-child {
  border-left: 0;
}

.construction-overview span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.construction-overview strong {
  font-size: 18px;
  font-weight: 650;
}

.construction-overview-total {
  background: #202a2f;
  color: var(--inverse);
}

.construction-overview-total span {
  color: #b9c4c9;
}

.file-import-modal {
  width: min(880px, 100%);
  max-height: min(740px, calc(100vh - 56px));
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.file-import-header {
  padding: 16px 20px;
}

.file-import-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.file-import-body {
  display: grid;
  gap: 18px;
  padding: 20px;
  background: var(--panel);
}

.file-import-methods {
  display: grid;
  gap: 12px;
}

.file-import-modal .template-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 118px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-raised);
}

.file-import-modal .template-icon,
.drop-line-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--shell);
  color: var(--accent);
}

.file-import-modal .template-icon svg,
.drop-line-icon svg {
  width: 19px;
  height: 19px;
}

.template-content {
  min-width: 0;
}

.template-content > strong {
  display: block;
  font-size: 15px;
  font-weight: 650;
}

.template-content > p {
  margin: 4px 0 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.file-import-modal .template-flow {
  gap: 5px 12px;
}

.file-import-modal .template-flow span {
  gap: 5px;
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 600;
}

.file-import-modal .template-flow span::after {
  display: none;
}

.file-import-modal .template-flow b {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--panel-subtle);
  color: var(--accent-hover);
  font-size: 10px;
}

.file-import-modal .drop-line {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 15px 16px;
  border-color: var(--line-strong);
  background: #e8edef;
}

.drop-line > div {
  display: grid;
  gap: 3px;
}

.drop-line > div > span {
  color: var(--muted);
  font-size: 12px;
}

.selected-files {
  display: grid;
  gap: 8px;
}

.selected-files-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.selected-files-head strong {
  color: var(--ink);
  font-size: 13px;
}

.file-import-modal .file-list {
  gap: 7px;
}

.file-import-modal .file-row {
  min-height: 52px;
  padding: 9px 11px;
  box-shadow: none;
}

.file-import-modal .file-row > svg {
  width: 18px;
  color: var(--muted);
}

.file-empty-state {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  min-height: 70px;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  color: var(--muted);
}

.file-empty-state > svg {
  width: 24px;
  height: 24px;
}

.file-empty-state strong {
  color: var(--ink);
  font-size: 13px;
}

.file-empty-state p {
  margin: 3px 0 0;
  font-size: 12px;
}

.file-import-actions {
  justify-content: space-between;
  align-items: center;
  padding: 13px 20px;
}

.file-import-actions > span {
  color: var(--muted);
  font-size: 12px;
}

/* Itens avulsos */
.loose-type-selector {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.loose-type-option {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
  min-height: 88px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.loose-type-option:hover {
  border-color: var(--line-strong);
  background: var(--panel-subtle);
}

.loose-type-option.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px var(--accent-ring);
}

.loose-type-option > span:last-child {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.loose-type-option strong,
.loose-type-option small {
  overflow-wrap: anywhere;
}

.loose-type-option strong {
  font-size: 14px;
  line-height: 1.25;
}

.loose-type-option small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.loose-type-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-subtle);
  color: var(--muted-strong);
}

.loose-type-option.is-active .loose-type-icon {
  border-color: var(--accent);
  background: var(--shell);
  color: var(--accent);
}

.loose-type-option--coming-soon {
  position: relative;
  padding-right: 68px;
  background: var(--panel-subtle);
  cursor: not-allowed;
  opacity: 0.74;
}

.loose-type-option--coming-soon:hover {
  border-color: var(--line);
  background: var(--panel-subtle);
}

.loose-type-option--coming-soon .loose-type-status {
  position: absolute;
  top: 10px;
  right: 10px;
}

.loose-type-icon svg,
.preset-loose-launcher-preview svg,
.loose-preview-object > svg {
  width: 19px;
  height: 19px;
}

.loose-build-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.loose-preview {
  display: grid;
  grid-template-rows: 180px auto;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-subtle);
}

.loose-preview-stage {
  display: grid;
  place-items: center;
  padding: 22px;
  background: #e7ecee;
}

.loose-preview-object {
  position: relative;
  display: grid;
  place-items: center;
  width: min(130px, 80%);
  height: 104px;
  border: 3px solid var(--shell-raised);
  background: #f8faf9;
  color: var(--shell-raised);
  box-shadow: 8px 8px 0 #b7c1c5;
}

.loose-preview--peca .loose-preview-object {
  height: 76px;
}

.loose-preview--gaveta .loose-preview-object {
  transform: skewY(-2deg);
}

.loose-preview-drawer-front {
  position: absolute;
  left: -9px;
  right: -9px;
  bottom: -3px;
  height: 38%;
  border: 3px solid var(--shell-raised);
  background: #fff;
}

.loose-preview-door-line {
  position: absolute;
  inset: 8px;
  border: 1px solid var(--line-strong);
}

.loose-preview-handle {
  position: absolute;
  top: 42%;
  right: 15px;
  width: 4px;
  height: 25px;
  background: var(--accent);
}

.loose-preview--linear .loose-preview-object {
  width: 85%;
  height: 38px;
  box-shadow: 6px 6px 0 #b7c1c5;
}

.loose-preview-linear-line {
  width: 75%;
  height: 3px;
  background: var(--accent);
}

.loose-preview--ferragem .loose-preview-object,
.loose-preview--valor .loose-preview-object {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border-width: 2px;
  box-shadow: none;
  background: var(--shell);
  color: var(--accent);
}

.loose-preview--ferragem .loose-preview-object svg,
.loose-preview--valor .loose-preview-object svg {
  width: 32px;
  height: 32px;
}

.loose-preview-caption {
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.loose-preview-caption span {
  color: var(--muted);
  font-size: 12px;
}

.loose-preview-caption strong {
  font-size: 13px;
}

.loose-config-stack {
  display: grid;
  min-width: 0;
  gap: 14px;
}

.loose-config-stack > .tech-grid:first-child {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.tech-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.loose-component-band {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  padding: 0;
  border-top: 0;
}

.loose-component-band--split {
  grid-template-columns: minmax(220px, 1fr) minmax(190px, 0.8fr);
  align-items: start;
}

.loose-component-band--split > .loose-edge-field,
.loose-component-band--shelf > .loose-edge-field {
  width: 128px;
  max-width: 100%;
  justify-self: center;
}

.loose-component-band--shelf {
  grid-template-columns: minmax(320px, 1.2fr) minmax(240px, 0.9fr) minmax(190px, 0.55fr);
  align-items: start;
}

.loose-component-band--top {
  align-items: start;
}

.loose-component-band--four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
}

.loose-component-band--direct {
  grid-template-columns: minmax(240px, 1.6fr) minmax(130px, 0.6fr) minmax(170px, 0.8fr);
}

.loose-component-band--drawer-main {
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1fr) max-content;
  align-items: end;
}

.loose-component-band--drawer-main .loose-inline-check {
  white-space: nowrap;
}

.loose-component-band--lift-door {
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 170px) minmax(220px, 1fr) minmax(220px, 1fr);
  align-items: end;
}

.loose-component-band--swing-door {
  grid-template-columns: minmax(280px, 1fr) minmax(150px, 170px) minmax(280px, 1fr);
  align-items: end;
}

.loose-component-band--sliding-door {
  grid-template-columns: minmax(280px, 1fr) minmax(150px, 170px) minmax(280px, 1fr);
  align-items: end;
}

.loose-inline-check {
  align-self: end;
  min-height: 42px;
}

.loose-calculated-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: var(--panel-subtle);
  color: var(--muted);
}

.loose-calculated-note strong {
  color: var(--ink);
  white-space: nowrap;
}

.loose-description-input {
  grid-column: auto;
}

.loose-edge-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.loose-edge-field legend {
  width: 100%;
  margin-bottom: 7px;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 800;
}

.loose-edge-selector {
  position: relative;
  display: grid;
  place-items: center;
  width: 128px;
  max-width: 100%;
  height: 48px;
  margin: 3px auto 0;
  border: 1px solid var(--line);
  background: #fff;
}

.loose-edge-selector > span {
  max-width: 92px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loose-edge-side {
  position: absolute;
  z-index: 1;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--line-strong);
}

.loose-edge-side.is-active {
  background: var(--accent);
}

.loose-edge-side--top,
.loose-edge-side--bottom {
  left: -2px;
  right: -2px;
  height: 7px;
}

.loose-edge-side--top {
  top: -4px;
}

.loose-edge-side--bottom {
  bottom: -4px;
}

.loose-edge-side--left,
.loose-edge-side--right {
  top: -2px;
  bottom: -2px;
  width: 7px;
}

.loose-edge-side--left {
  left: -4px;
}

.loose-edge-side--right {
  right: -4px;
}

.loose-direct-summary {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: var(--panel-subtle);
}

.loose-direct-summary span,
.loose-direct-summary small {
  color: var(--muted);
}

.preset-launcher-description {
  align-self: end;
  min-width: 0;
  min-height: 34px;
  display: flex;
  align-items: center;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preset-configured-loose-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 14px;
  align-items: center;
  padding: 2px 14px 8px;
}

.preset-configured-loose-fields--ferragem {
  grid-template-columns: minmax(360px, 1.6fr) minmax(190px, 0.7fr);
}

.preset-configured-loose-fields--ferragem-linear,
.preset-configured-loose-fields--metal,
.preset-configured-loose-fields--servico,
.preset-configured-loose-fields--valor {
  grid-template-columns: minmax(360px, 1.6fr) minmax(190px, 0.7fr) minmax(220px, 0.9fr);
}

.preset-configured-loose-fields .preset-loose-number-field {
  display: grid;
  grid-template-columns: auto minmax(100px, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.preset-configured-loose-fields .preset-loose-number-field > span,
.preset-configured-loose-fields .preset-loose-number-field small {
  white-space: nowrap;
}

.preset-configured-loose-fields .preset-loose-number-field input {
  width: 100%;
  min-width: 0;
}

.preset-configured-loose-fields .preset-loose-description-field,
.preset-configured-loose-fields .preset-loose-hardware-field,
.preset-configured-loose-fields .preset-loose-value-field {
  min-width: 0;
}

.preset-configured-loose-fields
  .preset-loose-value-field--prefix
  .tech-input-line {
  grid-template-columns: auto minmax(100px, 1fr);
}

.preset-configured-loose-fields
  .preset-loose-value-field--suffix
  .tech-input-line {
  grid-template-columns: minmax(100px, 1fr) auto;
}

.preset-configured-loose-fields
  .preset-loose-value-field
  .tech-input-line
  small {
  min-width: 0;
}

.preset-quick-form.preset-configured-loose-launcher--inline {
  grid-template-areas: "context fields add";
  grid-template-columns:
    minmax(112px, 0.38fr)
    minmax(0, 1fr)
    var(--preset-editor-action-width, 190px);
  gap: 10px;
  align-items: end;
}

.preset-configured-loose-launcher--inline .preset-editor-context {
  grid-area: context;
  align-self: start;
  min-width: 0;
  padding-top: 1px;
}

.preset-configured-loose-launcher--inline .preset-configured-loose-fields {
  grid-area: fields;
  padding: 0;
}

.preset-configured-loose-launcher--inline .preset-inline-add {
  align-self: start;
  margin-top: 20px;
}

.preset-configured-loose-launcher--inline .preset-inline-add {
  grid-area: add;
}

.preset-configured-loose-launcher--inline
  .preset-configured-loose-fields--ferragem {
  grid-template-columns: minmax(170px, 1.55fr) minmax(96px, 0.65fr);
  gap: 10px;
}

.preset-configured-loose-launcher--inline
  .preset-configured-loose-fields--ferragem-linear,
.preset-configured-loose-launcher--inline
  .preset-configured-loose-fields--metal,
.preset-configured-loose-launcher--inline
  .preset-configured-loose-fields--servico,
.preset-configured-loose-launcher--inline
  .preset-configured-loose-fields--valor {
  grid-template-columns: minmax(140px, 1.5fr) minmax(78px, 0.58fr) minmax(86px, 0.65fr);
  gap: 10px;
}

.preset-configured-loose-launcher--inline
  .preset-loose-number-field {
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  align-items: end;
}

.preset-configured-loose-launcher--inline
  .preset-loose-value-field
  .tech-input-line {
  grid-template-columns: auto minmax(52px, 1fr);
}

.preset-loose-piece-material-layout {
  display: grid;
  grid-template-columns: minmax(197px, 1fr) 120px 64px;
  gap: 6px;
  align-items: start;
  min-width: 0;
}

.preset-loose-piece-material-heading {
  display: grid;
  grid-template-columns: minmax(197px, 1fr) 120px 64px;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.preset-loose-piece-material-title {
  grid-column: 1 / 3;
  color: #8d6508;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.preset-loose-piece-edge-title {
  grid-column: 3;
  justify-self: end;
  color: #8d6508;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.preset-loose-piece-columns {
  padding-top: 8px;
}

.preset-loose-piece-material-layout .field {
  min-width: 0;
}

.preset-loose-piece-material-layout select {
  width: 100%;
  font-size: 13px;
}

.preset-loose-piece-material-control,
.preset-loose-piece-quantity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 36px;
}

.preset-loose-piece-material-control > span,
.preset-loose-piece-quantity > span {
  white-space: nowrap;
}

.preset-loose-piece-quantity input {
  width: 100%;
  min-width: 0;
}

.preset-loose-piece-quantity small {
  color: var(--muted);
  min-width: 0;
  white-space: nowrap;
}

.preset-quantity-mark {
  color: var(--muted-strong);
  font-size: 16px;
  font-weight: 800;
}

.preset-loose-piece-edge {
  align-self: start;
}

.preset-loose-piece-edge .loose-edge-selector {
  width: 64px;
  height: 64px;
  margin: 0 auto 3px;
}

.preset-loose-launcher-preview {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--shell);
  color: var(--accent);
}

@media (max-width: 1180px) {
  .loose-type-selector {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .loose-build-layout {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .loose-component-band--four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .loose-component-band--direct {
    grid-template-columns: minmax(220px, 1fr) minmax(130px, 0.55fr);
  }

  .loose-component-band--direct > :last-child:nth-child(3) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .loose-type-selector,
  .loose-build-layout,
  .loose-component-band,
  .loose-component-band--split,
  .loose-component-band--direct,
  .loose-component-band--four,
  .tech-grid.four {
    grid-template-columns: 1fr;
  }

  .loose-preview {
    grid-template-rows: 150px auto;
  }

  .preset-loose-launcher-head {
    grid-template-columns: 1fr;
  }

  .preset-loose-launcher-preview {
    display: none;
  }
}

.work-settings-page {
  width: min(1240px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.work-settings-nav {
  position: sticky;
  top: 0;
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  background: #172024;
  box-shadow: var(--shadow);
}

.work-settings-nav-head {
  display: grid;
  gap: 2px;
  padding: 5px 8px 12px;
  margin-bottom: 3px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  color: #f6f7f4;
}

.work-settings-nav-head strong {
  font-size: 14px;
}

.work-settings-nav-head span {
  color: #aeb9be;
  font-size: 12px;
}

.work-settings-nav button {
  min-width: 0;
  min-height: 40px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 9px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: #c8d1d5;
  text-align: left;
}

.work-settings-nav button:hover {
  background: rgba(255, 255, 255, 0.055);
  color: #fff;
}

.work-settings-nav button.active {
  background: #29343a;
  color: #fff;
  box-shadow: inset 3px 0 0 var(--accent);
  font-weight: 650;
}

.work-settings-nav button small {
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 11px;
}

.work-settings-content,
.work-settings-sections {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.work-settings-content-head {
  min-height: 52px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 0 4px;
  color: #f6f7f4;
}

.work-settings-content-head > div:first-child {
  display: grid;
  gap: 1px;
}

.work-settings-content-head > div:first-child > span {
  color: #bcc7cc;
  font-size: 12px;
}

.work-settings-content-head h3 {
  margin: 0;
  font-size: 20px;
}

.work-settings-save-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #dbe5df;
  font-size: 12px;
}

.work-settings-save-state svg {
  width: 15px;
  color: #6fc49b;
}

.work-settings-section {
  min-width: 0;
}

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

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

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

.work-settings-footer {
  min-width: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-md);
  background: rgba(17, 23, 25, 0.8);
  color: #c6d0d4;
  font-size: 12px;
}

.data-backup-settings {
  min-width: 0;
}

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

.data-backup-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-raised);
}

.data-backup-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-subtle);
  color: var(--accent-hover);
}

.data-backup-icon svg {
  width: 19px;
  height: 19px;
}

.data-backup-copy {
  min-width: 0;
}

.data-backup-copy strong {
  font-size: 15px;
  font-weight: 650;
}

.data-backup-copy p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.data-backup-card > .primary-btn,
.data-backup-card > .data-backup-file-picker {
  grid-column: 2;
  justify-self: start;
  margin-top: 2px;
}

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

.data-backup-note {
  margin-top: 12px;
}

.work-setting-primary-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.work-setting-primary-row .panel-title {
  margin-bottom: 0;
}

.work-switch {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.work-switch input,
.work-limit-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.work-switch > span,
.work-limit-toggle > span {
  position: relative;
  width: 38px;
  height: 22px;
  display: block;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--panel-subtle);
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.work-switch > span::after,
.work-limit-toggle > span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--line-strong);
  transition: transform 0.16s ease, background-color 0.16s ease;
}

.work-switch input:checked + span,
.work-limit-toggle input:checked + span {
  border-color: var(--accent-hover);
  background: var(--accent-soft);
}

.work-switch input:checked + span::after,
.work-limit-toggle input:checked + span::after {
  transform: translateX(16px);
  background: var(--accent-hover);
}

.work-switch input:focus-visible + span,
.work-limit-toggle input:focus-visible + span {
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.work-rule-body {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-subtle);
}

.work-slide-mode {
  display: grid;
  gap: 8px;
}

.work-slide-mode > span {
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 700;
}

.work-slide-mode-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-subtle);
}

.work-slide-mode-picker button {
  min-width: 0;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted-strong);
  font-weight: 650;
}

.work-slide-mode-picker button.active {
  border-color: var(--line);
  background: var(--field);
  color: var(--ink);
  box-shadow: inset 0 -3px 0 var(--accent);
}

.work-slide-mode-picker button:focus-visible {
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.work-rule-body--standard {
  grid-template-columns: minmax(0, 520px);
}

.work-rule-formula {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: var(--panel-subtle);
  color: var(--muted-strong);
  font-size: 13px;
}

.work-rule-formula svg {
  color: var(--accent-hover);
}

.work-rule-controls {
  display: grid;
  grid-template-columns: minmax(220px, 0.65fr) minmax(280px, 1.35fr);
  gap: 14px;
  align-items: start;
}

.work-rule-fallback {
  display: grid;
  gap: 12px;
}

.work-rule-control-with-help {
  display: grid;
  grid-template-columns: minmax(200px, 0.68fr) minmax(140px, 0.32fr);
  gap: 14px;
  align-items: center;
}

.work-rule-control-with-help select {
  min-width: 0;
}

.work-rule-field-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.work-rule-table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.work-rule-table-head,
.work-rule-table-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(260px, 1.3fr) 38px;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
}

.work-rule-table-head {
  background: var(--panel-subtle);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 700;
}

.work-rule-table-row + .work-rule-table-row {
  border-top: 1px solid var(--line-subtle);
}

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

.work-rule-table-row input,
.work-rule-table-row select,
.work-limit-row input,
.work-limit-row select {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--field);
  color: var(--ink);
  padding: 7px 9px;
}

.work-rule-table-row small,
.work-limit-value small {
  color: var(--muted);
  font-size: 12px;
}

.work-rule-add {
  justify-self: start;
}

.work-rule-warnings {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid #ead39d;
  border-radius: var(--radius-md);
  background: var(--warn-soft);
  color: var(--warn);
}

.work-rule-warnings p,
.work-rule-inactive {
  margin: 0;
  font-size: 12px;
}

.work-rule-inactive {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-subtle);
  color: var(--muted);
}

.work-limit-list,
.work-display-list {
  display: grid;
}

.work-limit-row {
  display: grid;
  grid-template-columns: 42px minmax(240px, 1fr) 150px 160px;
  gap: 12px;
  align-items: center;
  padding: 13px 0;
  border-top: 1px solid var(--line-subtle);
}

.work-limit-row:first-child {
  border-top: 0;
}

.work-limit-toggle {
  cursor: pointer;
}

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

.work-setting-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.work-setting-copy strong {
  color: var(--ink);
  font-size: 14px;
}

.work-setting-copy small {
  color: var(--muted);
  line-height: 1.35;
}

.work-display-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line-subtle);
  cursor: pointer;
}

.work-display-row:first-child {
  border-top: 0;
}

.mody-system-note {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  background: var(--shell);
  color: #e5ebed;
}

.mody-system-note svg {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: var(--accent);
}

.mody-system-note div {
  display: grid;
  gap: 3px;
}

.mody-system-note p {
  margin: 0;
  color: #b9c5ca;
  font-size: 12px;
}

.work-choice-origin {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 6px 8px;
  align-items: center;
  margin-top: 7px;
  padding: 7px 8px;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-sm);
  background: var(--panel-subtle);
}

.work-choice-origin > span {
  padding: 2px 6px;
  border-radius: 3px;
  background: #dfe7e9;
  color: var(--muted-strong);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.work-choice-origin small {
  min-width: 0;
  color: var(--muted);
  line-height: 1.3;
}

.work-choice-origin--automatic > span,
.work-choice-origin--default > span {
  background: var(--accent-soft);
  color: var(--warn);
}

.work-choice-origin--manual > span {
  background: #e7eef0;
  color: #35515d;
}

.work-choice-origin--unresolved {
  border-color: #ead39d;
  background: var(--warn-soft);
}

.work-choice-origin--unresolved > span {
  background: #f2d994;
  color: #6d4807;
}

.work-choice-reset {
  min-height: 28px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--field);
  color: var(--muted-strong);
  font-size: 11px;
}

.work-visibility-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 12px;
  padding: 8px 10px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  color: var(--warn);
  font-size: 12px;
}

.work-visibility-notice svg {
  flex: 0 0 auto;
  width: 15px;
}

.review-alert.info {
  border-color: #b9d3dd;
  background: #edf6f8;
  color: #315d6c;
}

@media (max-width: 1180px) {
  .work-settings-page {
    grid-template-columns: 200px minmax(0, 1fr);
  }

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

  .work-limit-row {
    grid-template-columns: 42px minmax(180px, 1fr) 130px 140px;
  }
}

@media (max-width: 980px) {
  .work-settings-page {
    grid-template-columns: 1fr;
  }

  .work-settings-nav {
    position: static;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(150px, 1fr);
    overflow-x: auto;
  }

  .work-settings-nav-head {
    display: none;
  }

  .work-settings-nav button {
    grid-template-columns: 20px minmax(0, 1fr) auto;
  }

  .work-limit-row {
    grid-template-columns: 42px minmax(0, 1fr) 130px;
  }

  .work-limit-row > select {
    grid-column: 2 / -1;
  }
}

@media (max-width: 760px) {
  .work-settings-content-head,
  .work-settings-footer,
  .work-setting-primary-row {
    align-items: stretch;
    flex-direction: column;
  }

  .work-settings-grid,
  .work-settings-grid--materials,
  .work-rule-controls,
  .data-backup-grid {
    grid-template-columns: 1fr;
  }

  .data-backup-card {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .data-backup-icon {
    width: 38px;
    height: 38px;
  }

  .work-rule-control-with-help {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .work-rule-table {
    overflow-x: auto;
  }

  .work-rule-table-head,
  .work-rule-table-row {
    min-width: 590px;
  }

  .work-limit-row {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .work-limit-value,
  .work-limit-row > select {
    grid-column: 2;
  }

  .work-choice-origin {
    grid-template-columns: 1fr;
  }

  .work-choice-reset {
    justify-self: start;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow: hidden;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI Variable Text", "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
  letter-spacing: 0;
  transition:
    color 0.16s ease,
    background-color 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

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

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

::selection {
  background: rgba(210, 162, 37, 0.28);
  color: var(--ink);
}

* {
  scrollbar-color: #849198 transparent;
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: #849198;
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: #68767d;
  background-clip: padding-box;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--shell);
  color: #fff;
  padding: 18px 16px 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2px;
  min-height: 66px;
  margin-bottom: 2px;
}

.brand-logo {
  width: min(42px, 100%);
  height: auto;
  display: block;
  object-fit: contain;
}

.brand-creator {
  color: rgba(235, 241, 243, 0.62);
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.brand-name {
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--nico-yellow);
  color: var(--dark);
  font-weight: 800;
}

.brand h1 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0;
}

.brand p {
  margin: 4px 0 0;
  color: #aebdc6;
  font-size: 13px;
}

.main-nav {
  display: grid;
  gap: 5px;
  margin-top: 18px;
}

.nav-group {
  display: grid;
  gap: 4px;
}

.nav-parent {
  font-weight: 650;
}

.nav-chevron {
  margin-left: auto;
  display: grid;
  place-items: center;
  transition: transform 0.18s ease;
}

.nav-group:not(.open) .nav-chevron {
  transform: rotate(-90deg);
}

.nav-submenu {
  display: none;
  gap: 5px;
  padding-left: 16px;
}

.nav-group.open .nav-submenu {
  display: grid;
}

.nav-subitem {
  min-height: 34px;
  font-size: 13px;
  padding-left: 8px;
  color: #b7c1c6;
}

.nav-subitem svg {
  width: 16px;
  height: 16px;
}

.sidebar-mascot {
  margin-top: auto;
  padding-top: 22px;
  display: grid;
  gap: 10px;
  flex-shrink: 0;
}

.sidebar-mascot img {
  width: 100%;
  max-height: min(230px, 28vh);
  object-fit: contain;
  object-position: center bottom;
  border-radius: 8px;
}

.sidebar-mascot strong {
  display: block;
  font-size: 16px;
}

.sidebar-mascot span {
  display: block;
  color: #aebdc6;
  font-size: 13px;
  margin-top: 3px;
}

.sidebar-mody-footer {
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user-shell {
  position: relative;
  margin-top: auto;
}

.sidebar-user-menu {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 18px;
  gap: 11px;
  align-items: center;
  width: 100%;
  min-height: 70px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.025);
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.sidebar-user-menu:hover {
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(255, 255, 255, 0.16);
}

.sidebar-user-shell.open .sidebar-user-menu {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
}

.footer-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #2a3439;
  color: var(--nico-yellow);
  font-weight: 700;
  letter-spacing: 0;
}

.sidebar-user-text {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.sidebar-user-text strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-text span {
  overflow: hidden;
  color: #aebdc6;
  font-size: 12px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-chevron {
  color: #aebdc6;
  transition: transform 0.18s ease;
}

.sidebar-user-chevron svg {
  width: 16px;
  height: 16px;
}

.sidebar-user-shell.open .sidebar-user-chevron {
  transform: rotate(180deg);
}

.sidebar-user-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 10px);
  display: grid;
  gap: 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  background: #0d1315;
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.36);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
  z-index: 20;
}

.sidebar-user-shell.open .sidebar-user-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.sidebar-user-dropdown-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
}

.sidebar-user-dropdown-text {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.sidebar-user-dropdown-text strong {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.1;
  color: #fff;
}

.sidebar-user-dropdown-text span {
  font-size: 12px;
  line-height: 1.2;
  color: #aebdc6;
  word-break: break-word;
}

.sidebar-user-divider {
  height: 1px;
  margin: 12px 0;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-user-action {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #eef4f7;
  text-align: left;
  font-size: 14px;
}

.sidebar-user-action:hover {
  color: #fff;
}

.sidebar-user-action.danger {
  color: #d7e1e7;
}

.sidebar-user-action.danger:hover {
  color: #fff;
}

.nav-btn,
.ghost-btn,
.primary-btn,
.tool-btn,
.danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  min-height: 38px;
  padding: 0 12px;
}

.nav-btn {
  justify-content: flex-start;
  color: #c7d0d4;
  background: transparent;
  padding: 0 10px;
  font-weight: 500;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.055);
  color: #fff;
}

.nav-btn.active {
  background: #29343a;
  color: #fff;
  box-shadow: inset 3px 0 0 var(--accent);
  font-weight: 650;
}

.workspace {
  height: 100vh;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  min-height: 76px;
  padding: 13px 24px;
  background: #172024;
  color: #f6f7f4;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--accent);
  font-weight: 650;
  font-size: 12px;
}

.topbar h2 {
  margin: 0;
  color: #f6f7f4;
  font-size: 21px;
  font-weight: 650;
  letter-spacing: 0;
}

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

.last-saved-label {
  color: #aeb9be;
  font-size: 12px;
  white-space: nowrap;
}

.topbar .ghost-btn,
.topbar .tool-btn,
.topbar .tech-secondary-btn {
  background: var(--dark-2);
  color: #f6f7f4;
  border-color: var(--dark-3);
}

.topbar .ghost-btn:hover,
.topbar .tool-btn:hover,
.topbar .tech-secondary-btn:hover {
  background: var(--dark-3);
  color: #fff;
  border-color: #68777f;
}

.topbar .danger-btn {
  background: var(--dark-2);
  color: #e66b6b;
  border-color: #744247;
}

.topbar .danger-btn:hover {
  background: #3a2529;
  border-color: #b6535b;
}

.primary-btn {
  background: var(--nico-yellow);
  color: var(--dark);
  border-color: var(--nico-yellow);
  font-weight: 650;
  box-shadow: var(--shadow-low);
}

.primary-btn:hover {
  background: var(--accent-hover);
  color: #111719;
  border-color: var(--accent-hover);
}

.ghost-btn,
.tool-btn {
  background: var(--field);
  color: var(--ink);
  border-color: var(--line);
  font-weight: 550;
}

.ghost-btn:hover,
.tool-btn:hover {
  border-color: var(--line-strong);
  background: var(--panel-subtle);
}

.danger-btn {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: #ecc9cc;
  font-weight: 600;
}

.primary-btn:disabled,
.ghost-btn:disabled,
.tool-btn:disabled,
.danger-btn:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

.content {
  min-width: 0;
  padding: 18px 20px 30px;
  overflow: auto;
  scrollbar-gutter: stable;
  min-height: 0;
}

body:not(.home-view) .content {
  background:
    linear-gradient(135deg, rgba(10, 15, 18, 0.62), rgba(13, 19, 22, 0.3)),
    url("./assets/mody/mody_home_wallpaper_clean_1920x1080.png") center / cover fixed no-repeat,
    #0f1518;
}

body:not(.home-view) .review-alert-panel > .panel-title h3 {
  color: #f6f7f4;
}

body:not(.home-view) .review-alert-panel > .panel-title p {
  color: #c4cdd1;
}

body:not(.home-view) .review-alert {
  color: var(--ink);
}

body.home-view .workspace {
  grid-template-rows: 1fr;
}

body.home-view .topbar {
  display: none;
}

body.home-view .content {
  padding: 0;
  overflow: hidden;
  background: #0f1518;
}

.home-screen {
  position: relative;
  min-height: 100%;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: #f6f7f4;
  background:
    radial-gradient(circle at 50% 26%, rgba(212, 167, 44, 0.08), transparent 28%),
    linear-gradient(135deg, rgba(10, 15, 18, 0.5), rgba(13, 19, 22, 0.1)),
    url("./assets/mody/mody_home_wallpaper_clean_1920x1080.png") center / cover no-repeat,
    #0f1518;
}

.home-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 14, 17, 0.8), transparent 24%, transparent 76%, rgba(10, 14, 17, 0.78)),
    radial-gradient(circle at 50% 40%, transparent 0, rgba(0, 0, 0, 0.2) 52%, rgba(0, 0, 0, 0.5) 100%);
  pointer-events: none;
}

.home-center {
  position: relative;
  z-index: 1;
  width: min(620px, 64vw);
  text-align: center;
  display: grid;
  justify-items: center;
  margin-top: -86px;
}

.home-nico {
  position: absolute;
  z-index: 1;
  right: clamp(28px, 6vw, 112px);
  bottom: 142px;
  height: min(58vh, 560px);
  max-width: 32vw;
  object-fit: contain;
  object-position: bottom right;
  filter: drop-shadow(0 24px 34px rgba(0, 0, 0, 0.42));
  pointer-events: none;
}

.home-wordmark {
  width: min(148px, 29.4vw);
  height: auto;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.45));
}

.home-kicker {
  margin: 10px 0 24px;
  color: #d9dde0;
  font-weight: 650;
  letter-spacing: 0;
  font-size: 13px;
}

.home-kicker span {
  color: var(--nico-yellow);
}

.home-title {
  margin: 0;
  font-size: clamp(30px, 4vw, 42px);
  letter-spacing: 0;
}

.home-title span {
  color: #f0bd2c;
}

.home-copy {
  margin: 10px 0 0;
  max-width: 520px;
  color: rgba(246, 247, 244, 0.72);
  line-height: 1.55;
  font-size: 17px;
}

.home-divider {
  width: 72px;
  height: 2px;
  background: var(--nico-yellow);
  border-radius: 999px;
  margin: 20px 0 14px;
}

.home-note {
  margin: 0;
  max-width: 470px;
  color: rgba(246, 247, 244, 0.55);
  line-height: 1.55;
}

.home-cta {
  margin-top: 22px;
  min-width: 220px;
  min-height: 48px;
  font-size: 16px;
  box-shadow: 0 16px 34px rgba(212, 167, 44, 0.18);
}

.home-feedback-card {
  position: absolute;
  z-index: 2;
  right: clamp(18px, 2vw, 34px);
  bottom: calc(min(58vh, 560px) + 150px);
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 5px 11px;
  width: min(270px, calc(100% - 36px));
  padding: 12px 13px;
  border: 1px solid rgba(210, 162, 37, 0.28);
  border-radius: 8px;
  background: rgba(18, 25, 28, 0.92);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
}

.home-feedback-card::after {
  content: "";
  position: absolute;
  right: 84px;
  bottom: -7px;
  width: 13px;
  height: 13px;
  border-right: 1px solid rgba(210, 162, 37, 0.28);
  border-bottom: 1px solid rgba(210, 162, 37, 0.28);
  background: rgba(18, 25, 28, 0.92);
  transform: rotate(45deg);
}

.home-feedback-icon {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--nico-yellow);
}

.home-feedback-icon svg {
  width: 25px;
  height: 25px;
}

.home-feedback-card strong {
  display: block;
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
}

.home-feedback-card p {
  margin: 3px 0 0;
  color: rgba(235, 241, 243, 0.66);
  font-size: 12px;
  line-height: 1.3;
}

.home-feedback-action {
  grid-column: 2;
  justify-self: start;
  min-height: 28px;
  margin-top: 3px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid rgba(210, 162, 37, 0.56);
  background: transparent;
  color: #f0c24a;
  font-size: 12px;
  font-weight: 650;
}

.home-feedback-action:hover {
  color: #fff;
  border-color: #fff;
}

.home-benefits {
  position: absolute;
  z-index: 1;
  left: 44px;
  right: 44px;
  bottom: 22px;
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  pointer-events: none;
}

.home-benefit {
  min-height: 76px;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(22, 30, 34, 0.76);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
}

.home-benefit span[data-icon] {
  color: var(--nico-yellow);
}

.home-benefit svg {
  width: 34px;
  height: 34px;
}

.home-benefit strong {
  display: block;
  margin-bottom: 5px;
  color: #fff;
  font-size: 14px;
  font-weight: 650;
}

.home-benefit p {
  margin: 0;
  color: rgba(246, 247, 244, 0.66);
  font-size: 13px;
  line-height: 1.35;
}

.about-page {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.about-surface {
  min-height: calc(100vh - 124px);
  padding: clamp(26px, 4vw, 54px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: var(--panel-raised);
  box-shadow: var(--shadow);
}

.about-intro,
.about-tabs,
.about-panel {
  width: min(820px, 100%);
  margin-right: auto;
  margin-left: auto;
}

.about-intro h3 {
  margin: 5px 0 0;
  color: var(--ink);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 650;
}

.about-kicker {
  color: #a6780d;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.about-signature {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.about-tabs {
  display: flex;
  gap: 3px;
  margin-top: 26px;
  padding-bottom: 1px;
  border-bottom: 1px solid var(--line-subtle);
}

.about-tabs button {
  min-height: 40px;
  padding: 0 15px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
}

.about-tabs button:hover {
  color: var(--ink);
}

.about-tabs button.active {
  border-bottom-color: var(--accent);
  color: var(--ink);
  font-weight: 650;
}

.about-panel {
  padding-top: 28px;
  color: var(--muted-strong);
}

.about-panel > p {
  max-width: 720px;
  margin: 0 0 15px;
  line-height: 1.7;
}

.about-panel .about-lead {
  max-width: 780px;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.65;
}

.about-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 29px 0 30px;
  padding: 14px 0;
  border-top: 1px solid var(--line-subtle);
  border-bottom: 1px solid var(--line-subtle);
}

.about-flow span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
}

.about-flow i {
  color: var(--accent);
  font-style: normal;
}

.about-principles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}

.about-principles section {
  min-width: 0;
  padding-top: 16px;
  border-top: 2px solid var(--line);
}

.about-principles section > span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-bottom: 12px;
  color: #9a700d;
}

.about-principles strong,
.about-mission > span,
.about-vision > span {
  display: block;
  color: #9a700d;
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.about-principles p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.about-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 38px;
  padding-top: 16px;
  border-top: 1px solid var(--line-subtle);
  color: var(--quiet);
  font-size: 12px;
}

.about-team-panel {
  max-width: 820px;
}

.about-mission {
  margin: 28px 0 24px;
  padding: 22px 24px;
  border-left: 3px solid var(--accent);
  background: var(--shell-raised);
  color: #eef3f4;
}

.about-mission strong {
  display: block;
  margin: 7px 0 9px;
  color: #fff;
  font-size: 20px;
  font-weight: 600;
}

.about-mission p {
  margin: 0;
  color: #bfc9cd;
  line-height: 1.6;
}

.about-vision {
  margin: 0 0 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line-subtle);
}

.about-vision p {
  margin: 7px 0 0;
  line-height: 1.65;
}

.about-team-panel blockquote {
  margin: 24px 0;
  padding: 0 0 0 18px;
  border-left: 2px solid var(--accent);
  color: var(--ink);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.5;
}

.about-closing {
  color: var(--ink);
  font-weight: 550;
}

.feedback-modal-backdrop {
  z-index: 60;
}

.feedback-modal {
  width: min(620px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: var(--panel-raised);
  box-shadow: var(--shadow-modal);
}

.feedback-modal-head {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line-subtle);
}

.feedback-modal-head h3 {
  margin: 5px 0 5px;
  color: var(--ink);
  font-size: 22px;
}

.feedback-modal-head p {
  max-width: 500px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

#feedback-form {
  display: grid;
  gap: 18px;
  padding: 20px 24px 24px;
}

.feedback-category-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.feedback-category-fieldset legend,
.feedback-message-field > span {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.feedback-categories {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-subtle);
}

.feedback-categories button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-strong);
  font-size: 13px;
}

.feedback-categories button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-low);
  font-weight: 650;
}

.feedback-message-field {
  display: grid;
}

.feedback-message-field textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
}

.feedback-channel-note {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.feedback-channel-note span {
  display: inline-grid;
  color: #9a700d;
}

.feedback-channel-note svg {
  width: 16px;
  height: 16px;
}

.feedback-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 3px;
}

.placeholder-panel {
  min-height: 360px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 30px;
}

.placeholder-panel h3 {
  margin: 0 0 8px;
  font-size: 24px;
}

.placeholder-panel p {
  margin: 0;
  color: var(--muted);
  max-width: 460px;
  line-height: 1.5;
}

.wizard {
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.panel,
.list-panel,
.chat-panel,
.proposal-preview {
  background: var(--panel);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.steps {
  background: #172024;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.steps {
  padding: 12px;
  align-self: start;
  position: sticky;
  top: 0;
}

.step {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: var(--radius-md);
  color: #bcc7cc;
  cursor: pointer;
  user-select: none;
}

.step-number {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid #617078;
  background: var(--dark-2);
  color: #fff;
  font-size: 12px;
  font-weight: 650;
}

.step.active {
  background: rgba(210, 162, 37, 0.14);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--accent);
  font-weight: 650;
}

.step.active .step-number {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--shell);
}

.step.done {
  color: #fff;
}

.step.done .step-number {
  border-color: var(--nico-yellow);
  color: var(--nico-yellow);
}

.panel {
  padding: 20px;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.sort-control {
  display: grid;
  gap: 5px;
  min-width: 210px;
}

.sort-control span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.sort-control select {
  min-height: 38px;
  padding: 7px 10px;
}

.panel-title h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 650;
}

.panel-title p {
  margin: 6px 0 0;
  color: var(--muted);
}

.panel-title p strong {
  color: var(--accent);
}

.client-context {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-subtle);
}

.client-context span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.client-context strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
  line-height: 1;
}

.clients-page {
  display: grid;
  gap: 14px;
}

.clients-header-card {
  padding: 20px 22px;
}

.clients-title {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(380px, 590px);
  gap: 18px;
  align-items: center;
}

.clients-title-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.client-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--field);
}

.client-search svg {
  color: var(--muted);
}

.client-search input {
  border: 0;
  min-width: 0;
  padding: 8px 0;
  background: transparent;
}

.client-search input:focus {
  outline: none;
  box-shadow: none;
}

.client-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  margin-top: 18px;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-md);
  background: var(--panel-subtle);
}

.client-metrics .metric {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.client-metrics .metric + .metric {
  border-left: 1px solid var(--line-subtle);
}

.client-list-surface {
  overflow: visible;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-lg);
  background: var(--panel-raised);
  box-shadow: var(--shadow-low);
}

.client-list-columns {
  display: grid;
  grid-template-columns:
    minmax(300px, 47fr)
    minmax(310px, 47fr)
    54px;
  gap: 16px;
  min-height: 38px;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--line-subtle);
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.client-list-metric-columns {
  display: grid;
  grid-template-columns: 10fr 14fr 14fr;
  gap: 12px;
}

.client-list {
  display: grid;
  gap: 0;
  align-content: start;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: var(--panel-raised);
  box-shadow: none;
}

.client-entry {
  display: grid;
  position: relative;
  border: 0;
  border-bottom: 1px solid var(--line-subtle);
  border-radius: 0;
  background: var(--panel-raised);
  box-shadow: none;
  transition: background-color 0.16s ease;
}

.client-entry:first-child {
  border-radius: 0;
}

.client-entry:last-child {
  border-bottom: 0;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.client-entry:hover {
  background: #fbfcfc;
}

.client-entry.active {
  z-index: 1;
  background: #fffaf0;
  box-shadow:
    inset 0 1px 0 #e4bf55,
    inset 0 -1px 0 #e4bf55;
}

.client-entry.active:hover {
  background: #fffaf0;
}

.client-entry.active::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 2;
  width: 4px;
  background: var(--nico-yellow);
  pointer-events: none;
}

.client-row {
  display: grid;
  grid-template-columns:
    minmax(300px, 47fr)
    minmax(310px, 47fr)
    54px;
  gap: 16px;
  align-items: center;
  min-height: 74px;
  padding: 11px 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}

.client-row.active {
  background: #fffdf7;
  box-shadow: none;
}

.client-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -3px;
}

.client-identity {
  display: grid;
  grid-template-columns: 24px 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.client-chevron {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transform: rotate(-90deg);
  transition:
    color 0.16s ease,
    transform 0.16s ease;
}

.client-chevron.open {
  color: var(--accent);
  transform: rotate(0);
}

.client-chevron svg {
  width: 15px;
  height: 15px;
}

.client-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--dark);
  color: var(--nico-yellow);
  font-size: 12px;
  font-weight: 650;
}

.client-info {
  min-width: 0;
}

.client-info strong {
  display: block;
  overflow: hidden;
  font-size: 15px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-info span,
.client-info small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-info span {
  margin-top: 2px;
  font-size: 12px;
}

.client-info small {
  margin-top: 3px;
  font-size: 11px;
}

.client-kpis {
  display: grid;
  grid-template-columns: 10fr 14fr 14fr;
  gap: 12px;
  min-width: 0;
}

.client-kpi {
  display: grid;
  gap: 3px;
  min-width: 0;
  align-content: center;
  padding: 0;
  border: 0;
  background: transparent;
}

.client-kpis strong {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
}

.client-kpis small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
}

.client-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.client-action-menu-wrap {
  position: relative;
  flex: 0 0 auto;
}

.client-action-menu-toggle {
  width: 36px;
  min-width: 36px;
  height: 36px;
}

.client-action-menu-toggle[aria-expanded="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.client-action-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  width: 178px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-raised);
  box-shadow: var(--shadow);
}

.client-action-menu button {
  display: flex;
  width: 100%;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.client-action-menu button:hover,
.client-action-menu button:focus-visible {
  background: var(--panel-subtle);
  outline: none;
}

.client-action-menu svg {
  width: 15px;
  height: 15px;
}

.client-history-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.full-width {
  width: 100%;
  justify-content: center;
}

.client-history-inline {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 11px 16px 14px 88px;
  border: 0;
  border-top: 1px solid #ead796;
  border-radius: 0;
  background: #fff7df;
}

.client-history-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 24px;
  padding: 0;
}

.client-history-title strong {
  font-size: 13px;
  font-weight: 650;
}

.client-budget-list {
  display: grid;
  overflow: visible;
  border: 0;
  border-top: 1px solid var(--line-subtle);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.client-budget-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  min-height: 50px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-subtle);
}

.client-budget-row:last-child {
  border-bottom: 0;
}

.client-budget-row strong,
.client-budget-row small {
  display: block;
}

.client-budget-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.client-budget-row > span {
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.client-budget-row .tool-btn {
  min-height: 34px;
  padding: 0 11px;
}

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

.choice {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel-raised);
  padding: 18px;
  min-height: 142px;
  text-align: left;
}

.choice strong {
  display: block;
  margin-bottom: 8px;
  font-size: 17px;
}

.choice span {
  color: var(--muted);
  line-height: 1.4;
}

.choice.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px var(--accent-ring);
}

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

.client-form-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.client-work-panel {
  padding: 0;
  overflow: hidden;
}

.client-work-title {
  margin: 0;
  padding: 20px 22px 17px;
  border-bottom: 1px solid var(--line-subtle);
}

.client-work-section {
  padding: 18px 22px 20px;
}

.client-work-section + .client-work-section {
  border-top: 1px solid var(--line-subtle);
}

.client-work-section-heading {
  min-height: 38px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 13px;
}

.client-work-section-heading > div {
  display: grid;
  gap: 2px;
}

.client-work-section-heading > div > span,
.client-form-subheading span {
  color: var(--accent-hover);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.client-work-section-heading h4 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.client-form-grid .span-2,
.project-form-grid .span-2 {
  grid-column: span 2;
}

.client-form-grid .span-3 {
  grid-column: span 3;
}

.client-form-subheading {
  grid-column: 1 / -1;
  padding-top: 3px;
}

.field-label {
  color: #3d4a51;
  font-size: 13px;
  font-weight: 600;
}

.client-person-type {
  height: 38px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-subtle);
}

.client-person-type button {
  min-width: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.client-person-type button.active {
  background: var(--panel-raised);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.client-address-copy {
  min-height: 36px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-subtle);
  color: var(--muted-strong);
  white-space: nowrap;
}

.client-address-copy input {
  width: 16px;
  min-height: 16px;
  margin: 0;
  accent-color: var(--accent-hover);
}

.project-form-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.field-project-enderecoInstalacao input[readonly] {
  background: var(--panel-subtle);
  color: var(--muted-strong);
}

.field-observacoes textarea {
  min-height: 62px;
  resize: vertical;
}

@media (max-width: 980px) {
  .client-form-grid,
  .project-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .client-form-grid .span-3 {
    grid-column: span 2;
  }
}

@media (max-width: 760px) {
  .client-work-title,
  .client-work-section {
    padding-right: 16px;
    padding-left: 16px;
  }

  .client-work-section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .client-address-copy {
    width: 100%;
    white-space: normal;
  }

  .client-form-grid,
  .project-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .client-form-grid .span-2,
  .client-form-grid .span-3,
  .project-form-grid .span-2 {
    grid-column: auto;
  }
}

.field {
  display: grid;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

label {
  color: #3d4a51;
  font-size: 13px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--field);
  color: var(--ink);
  padding: 8px 10px;
  min-height: 38px;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

input:hover:not(:disabled),
select:hover:not(:disabled),
textarea:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--panel-raised);
}

input::placeholder,
textarea::placeholder {
  color: #929da2;
}

input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  accent-color: var(--dark);
}

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

.file-zone {
  display: grid;
  gap: 14px;
}

.template-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 3px solid var(--nico-yellow);
  background: var(--panel-raised);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.template-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--nico-yellow);
  color: var(--dark);
}

.template-card strong {
  display: block;
  font-size: 16px;
}

.template-card p {
  margin: 5px 0 10px;
  color: var(--muted);
}

.template-card .template-tip {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: -3px;
  font-size: 13px;
  color: var(--dark);
}

.template-tip svg {
  width: 15px;
  height: 15px;
  color: var(--nico-yellow);
  flex: 0 0 auto;
}

.template-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.template-flow span {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  color: var(--dark-2);
  font-size: 12px;
  font-weight: 700;
}

.template-flow span:not(:last-child)::after {
  content: "->";
  margin-left: 8px;
  color: #a58a46;
  font-weight: 700;
}

.drop-line {
  border: 1px dashed #9cb1ba;
  background: var(--soft);
  border-radius: 8px;
  padding: 18px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

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

.file-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  background: var(--panel-raised);
  box-shadow: var(--shadow-low);
}

.budget-row.sold {
  border-color: #2f8f62;
  background: var(--ok-soft);
  box-shadow: inset 4px 0 0 #2f8f62;
}

.budget-row.sold .budget-row-icon {
  color: #19704a;
  font-weight: 900;
}

.mark-sold-budget.active {
  border-color: #2f8f62;
  background: #2f8f62;
  color: #fff;
  font-weight: 800;
}

.file-row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

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

.budget-list-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.update-button {
  margin-top: 18px;
}

.manage-modal {
  width: min(720px, 100%);
  max-height: min(720px, calc(100vh - 56px));
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--panel);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
}

.manage-list {
  display: grid;
  gap: 8px;
  overflow: auto;
  padding: 16px 18px;
  background: var(--panel-subtle);
}

.manage-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.manage-row span {
  display: grid;
  gap: 3px;
}

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

.manage-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.mini-grid,
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric {
  background: var(--panel-subtle);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.metric small {
  color: var(--muted);
  display: block;
  margin-bottom: 8px;
}

.metric strong {
  font-size: 19px;
  font-weight: 650;
}

.analysis-stack {
  display: grid;
  gap: 14px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-lg);
}

.environment-groups {
  display: grid;
  gap: 14px;
}

.environment-group {
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-lg);
  background: var(--panel-subtle);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.environment-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line-subtle);
}

.environment-heading {
  display: grid;
  grid-template-columns: auto auto;
  gap: 2px 12px;
  align-items: center;
}

.environment-name-line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
}

.environment-name-line .rename-environment {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  color: var(--muted-strong);
}

.environment-name-line .rename-environment svg {
  width: 15px;
  height: 15px;
}

.environment-header h4 {
  margin: 0;
  font-size: 18px;
}

.environment-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  grid-column: 1;
}

.environment-total {
  grid-row: 1 / span 2;
  grid-column: 2;
  min-width: 138px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--nico-yellow);
  border-radius: var(--radius-md);
  background: var(--panel-raised);
  text-align: left;
}

.environment-total span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.environment-total strong {
  display: block;
  margin-top: 2px;
  color: var(--dark);
  font-size: 17px;
  font-weight: 650;
}

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

.environment-actions .tool-btn,
.environment-actions .danger-btn {
  min-height: 36px;
  padding: 0 12px;
}

.environment-group .table-wrap {
  border: 0;
  border-radius: 0;
}

.environment-group table {
  min-width: 780px;
  table-layout: fixed;
}

.icon-only {
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
}

.col-modules-list {
  min-width: 360px;
}

.col-row-actions {
  width: 48px;
  min-width: 48px;
  text-align: center;
}

.col-row-actions .icon-only {
  width: 30px;
  min-width: 30px;
  height: 30px;
  color: #b24141;
}

.col-row-actions .icon-only svg {
  width: 15px;
  height: 15px;
}

.modules-cell {
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
}

.module-chips {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-height: 36px;
  padding: 5px;
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  background: #f6f9fa;
}

.module-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 100%;
  padding: 0 8px;
  border: 1px solid #cbd7dd;
  border-radius: 6px;
  background: #e7eef1;
  color: #26323a;
  font-size: 12px;
  font-weight: 700;
}

.modules-empty-text {
  padding: 0 4px;
  color: #73818a;
  font-size: 13px;
  font-weight: 600;
}

.modules-cell .icon-only {
  border-radius: 0 8px 8px 0;
  height: auto;
  min-height: 36px;
  align-self: stretch;
  border-color: var(--line);
}

.modules-cell .icon-only svg {
  width: 17px;
  height: 17px;
}

.modules-cell > span {
  align-items: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(0, 0, 0, 0.78);
}

.preset-modal {
  position: relative;
  width: min(1360px, 100%);
  height: min(780px, calc(100vh - 56px));
  max-height: min(780px, calc(100vh - 56px));
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(10, 20, 28, 0.28);
}

.file-import-modal {
  width: min(900px, 100%);
  height: auto;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.file-import-body {
  min-height: 0;
  overflow: auto;
  padding: 16px 18px 8px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--line);
  background: #fbfbf8;
}

.preset-modal-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfbf8;
}

.preset-modal-header h3 {
  margin: 0;
  font-size: 19px;
}

.preset-modal-title {
  display: grid;
  grid-template-columns: minmax(0, auto) auto;
  align-items: stretch;
  gap: 18px;
  min-width: 0;
}

.preset-modal-context {
  min-width: 0;
}

.preset-modal-total {
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 132px;
  padding-left: 18px;
  border-left: 2px solid var(--accent);
  white-space: nowrap;
}

.preset-modal-total span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.1;
}

.preset-modal-total strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
}

.preset-modal-header p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.preset-modal-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.preset-budget-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(132px, 1fr));
  gap: 3px;
  padding: 3px;
  border: 1px solid #cbd7dd;
  border-radius: 999px;
  background: #edf3f5;
}

.preset-budget-toggle button {
  min-height: 32px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted-strong);
  cursor: pointer;
  font-weight: 400;
}

.preset-budget-toggle button.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 4px rgba(18, 28, 34, 0.16);
  font-weight: 900;
}

.preset-modal-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(500px, 0.95fr) minmax(560px, 1.05fr);
  gap: 0;
}

.preset-modal-body--wall {
  grid-template-columns: minmax(400px, 440px) minmax(0, 1fr);
}

.preset-library {
  container-type: inline-size;
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-content: start;
  gap: 10px;
  padding: 14px;
  background: #e9eef0;
  border-right: 1px solid var(--line);
}

.preset-library-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) 46px 46px;
  gap: 8px;
  align-items: stretch;
}

.preset-view-toggle {
  width: 46px;
  height: 46px;
  min-height: 46px;
  min-width: 46px;
  padding: 0;
  justify-content: center;
}

.preset-view-toggle svg {
  width: 19px;
  height: 19px;
}

.preset-definition-action {
  min-width: 0;
  min-height: 46px;
  padding: 0 10px;
  gap: 7px;
  white-space: nowrap;
  font-weight: 900;
}

.preset-definition-action strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preset-definition-action svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.preset-definition-edit {
  border-color: var(--dark-3);
  background: var(--dark-2);
  color: #fff;
}

.preset-definition-edit:hover:not(:disabled) {
  border-color: var(--nico-yellow);
  background: var(--dark-3);
  color: #fff;
}

.preset-organizer-toggle {
  width: 46px;
  min-width: 46px;
  min-height: 46px;
  align-self: stretch;
}

.preset-organizer-toggle.active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--dark);
}

.preset-organizer-bar {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 3px 2px 3px 4px;
}

.preset-organizer-bar > strong {
  font-size: 13px;
}

.preset-organizer-bar .tool-btn,
.preset-division-header .tool-btn,
.preset-division-create .tool-btn {
  width: 32px;
  min-width: 32px;
  height: 32px;
}

.preset-division-create {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px 32px;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.preset-division-create input,
.preset-division-name {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.preset-divisions {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.preset-division {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.preset-division-header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 24px;
}

.preset-division-header > strong {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preset-division-line {
  flex: 1 1 auto;
  min-width: 16px;
  border-top: 1px solid #aebdc4;
}

.preset-division-grip {
  display: inline-flex;
  width: 20px;
  height: 28px;
  flex: 0 0 20px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: grab;
  touch-action: none;
}

.preset-division-grip svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  stroke: none;
}

.preset-division--organizing .preset-division-header {
  cursor: grab;
}

.preset-division-name {
  max-width: 180px;
}

.preset-division-cards {
  display: grid;
  gap: 10px;
  min-width: 0;
  min-height: 20px;
}

.preset-division-cards--grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@container (min-width: 580px) {
  .preset-modal-body--items .preset-division-cards--grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.preset-division-cards--list {
  grid-template-columns: 1fr;
}

.preset-division-empty {
  grid-column: 1 / -1;
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border: 1px dashed #b9c7cd;
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
}

.preset-library:not(.preset-library--organizing) .preset-division-empty {
  display: none;
}

.preset-card--organizing {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.preset-card--organizing .preset-card-drag-handle {
  cursor: grab;
}

.preset-card--organizing .preset-card-drag-handle svg {
  fill: currentColor;
  stroke: none;
}

.preset-card.is-dragging,
.preset-division.is-dragging {
  opacity: 0.45;
}

.preset-card.drop-before {
  box-shadow: inset 4px 0 0 var(--accent);
}

.preset-card.drop-after {
  box-shadow: inset -4px 0 0 var(--accent);
}

.preset-division.drop-before > .preset-division-header {
  box-shadow: 0 -3px 0 var(--accent);
}

.preset-division.drop-after > .preset-division-header {
  box-shadow: 0 3px 0 var(--accent);
}

.preset-division-cards.is-drop-target {
  border-radius: 8px;
  outline: 2px dashed var(--accent);
  outline-offset: 3px;
}

.add-preset-card,
.add-square-meter-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  border: 1px dashed var(--nico-yellow);
  border-radius: 8px;
  background: var(--dark-2);
  color: #fff;
  font-weight: 900;
}

.add-preset-card:hover,
.add-square-meter-card:hover {
  background: var(--dark-3);
  border-style: solid;
}

.add-square-meter-card {
  border-color: #c4d0d6;
  background: #fff;
  color: var(--text);
}

.add-square-meter-card:hover {
  border-color: var(--accent);
  background: #fff9e8;
}

.add-preset-card strong,
.add-square-meter-card strong {
  line-height: 1.05;
  white-space: nowrap;
}

.square-meter-label-break {
  display: none;
}

.new-model-type-list {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--dark-3);
  border-radius: 8px;
  background: var(--dark);
}

.new-model-type-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: stretch;
}

.new-model-type {
  min-height: 42px;
  padding: 6px 12px;
  border: 1px solid var(--dark-3);
  border-radius: 8px;
  background: var(--dark-2);
  color: #fff;
  text-align: left;
  font-weight: 800;
  display: flex;
  align-items: center;
}

.new-model-type strong {
  display: block;
  font-size: 0.98rem;
  line-height: 1.1;
}

.new-model-type:hover {
  border-color: var(--nico-yellow);
  color: var(--nico-yellow);
}

.new-model-type-preset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-height: 42px;
  border: 1px solid var(--dark-3);
  border-radius: 8px;
  background: var(--dark-2);
  color: #fff;
}

.new-model-type-preset:hover {
  border-color: var(--nico-yellow);
  color: var(--nico-yellow);
}

.new-model-type-preset span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.new-model-type-row--coming-soon {
  opacity: 0.72;
}

.new-model-type-row--coming-soon .new-model-type,
.new-model-type-row--coming-soon .new-model-type-preset {
  cursor: not-allowed;
}

.new-model-type-row--coming-soon .new-model-type:hover,
.new-model-type-row--coming-soon .new-model-type-preset:hover {
  border-color: var(--dark-3);
  color: #fff;
}

.new-model-type-status {
  margin-left: auto;
}

.preset-card {
  position: relative;
  display: block;
  container-type: inline-size;
  border: 1px solid #cbd7dd;
  border-radius: 8px;
  background: #fff;
  padding: 13px;
}

.preset-card-select {
  display: grid;
  align-content: start;
  gap: 6px;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.preset-card-drag-handle {
  position: absolute;
  top: 7px;
  right: 7px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  color: #60727b;
  background: #fff;
  border: 1px solid #d5e0e5;
}

.preset-card-drag-handle svg {
  width: 10px;
  height: 10px;
}

.preset-card .preset-card-drag-handle,
.preset-card .preset-card-drag-handle span {
  color: inherit;
}

.preset-card.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  background: #fbfbf8;
}

.preset-card--organizing.is-management-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px var(--accent-ring);
}

.preset-card span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 400;
}

.preset-card strong {
  font-size: 16px;
}

.preset-card small {
  color: var(--muted);
  line-height: 1.35;
}

.preset-card--coming-soon {
  background: #eef2f2;
  border-color: #d3dcdf;
}

.preset-card--coming-soon .preset-card-select {
  cursor: not-allowed;
  opacity: 0.72;
}

.preset-card--coming-soon .preset-category-label {
  padding-right: 54px;
}

.preset-card-status {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  padding: 2px 6px;
  border: 1px solid #d8c680;
  border-radius: 10px;
  background: #fff8df;
  color: #775a0c !important;
  font-size: 9px !important;
  font-weight: 700 !important;
  line-height: 1;
  white-space: nowrap;
}

.preset-card--organizing .preset-card-status {
  right: 31px;
}

.preset-library--grid .preset-card {
  min-height: 68px;
  padding: 9px 9px 8px;
}

.preset-library--grid .preset-card-select {
  gap: 3px;
}

.preset-library--grid .preset-card-select > span:first-child {
  font-size: 10px;
  line-height: 1.15;
}

.preset-library--grid .preset-category-label > span {
  font-size: inherit;
  line-height: inherit;
}

.preset-library--grid .preset-card--organizing .preset-category-label {
  padding-right: 20px;
}

.preset-category-label {
  display: block;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.preset-category-label-compact {
  display: none;
}

@container (max-width: 145px) {
  .preset-category-label-full {
    display: none;
  }

  .preset-category-label-compact {
    display: inline;
  }
}

.preset-library--grid .preset-card strong {
  font-size: 14px;
  line-height: 1.2;
}

.preset-library--grid .preset-card small {
  display: none;
}

.preset-form {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
  min-width: 0;
}

.preset-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 0;
}

.preset-quick-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 10px 14px;
  padding: 12px;
  border: 1px solid #cbd7dd;
  border-radius: 8px;
  background: #f6f9fa;
}

.preset-editor-head,
.preset-name-field {
  grid-column: 1 / -1;
}

.preset-editor-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.preset-module-editor {
  gap: 8px 12px;
  padding: 10px 12px;
}

.preset-module-editor-head,
.square-meter-editor-head.preset-square-meter-editor-head {
  display: grid;
  grid-template-columns:
    minmax(132px, 0.55fr)
    minmax(180px, 1fr)
    var(--preset-editor-action-width, 190px);
  align-items: end;
  gap: 12px;
  min-height: 58px;
  height: 58px;
}

.preset-module-editor-head {
  align-items: start;
}

.preset-module-editor-head .preset-name-field-inline,
.preset-square-meter-editor-head .preset-name-field-inline {
  grid-column: auto;
  grid-area: auto;
  gap: 3px;
}

.preset-module-editor-head .preset-actions {
  gap: 8px;
  align-self: end;
}

.preset-editor-action-slot {
  width: var(--preset-editor-action-width, 190px);
  min-width: var(--preset-editor-action-width, 190px);
  justify-self: end;
  align-self: end;
}

.preset-editor-action-slot .preset-editor-primary-action,
.preset-editor-action-slot.preset-editor-primary-action {
  width: 100%;
  min-height: 38px;
  height: 38px;
  justify-content: center;
  padding: 0 12px;
  white-space: nowrap;
}

.preset-module-editor-head .ghost-btn,
.preset-module-editor-head .primary-btn,
.preset-square-meter-editor-head .primary-btn {
  min-height: 34px;
  padding: 0 10px;
}

.preset-editor-context {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.preset-editor-context strong {
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preset-editor-context small {
  color: var(--muted);
  font-size: 12px;
}

.preset-square-meter-editor-head .preset-editor-context small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preset-editor-head .preset-actions {
  flex-shrink: 0;
}

.preset-editor-head .ghost-btn,
.preset-editor-head .primary-btn {
  min-height: 34px;
  padding: 0 10px;
}

.preset-name-field {
  display: grid;
  gap: 5px;
  color: #38444d;
  font-size: 13px;
  font-weight: 700;
}

.preset-name-field input {
  min-height: 36px;
  padding: 6px 10px;
}

.preset-name-field-inline input {
  min-height: 34px;
}

.preset-form-columns {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(204px, 216px) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  padding-top: 8px;
}

.preset-configured-loose-options {
  display: grid;
  grid-template-columns: minmax(130px, 220px);
  gap: 12px;
  align-items: start;
  min-width: 0;
}

.preset-configured-loose-options--prateleira {
  grid-template-columns: repeat(2, minmax(130px, 220px));
}

.preset-configured-loose-options .field {
  min-width: 0;
  gap: 5px;
}

.preset-configured-loose-options .tech-input-line {
  grid-template-columns: minmax(86px, 1fr) auto;
}

.preset-configured-loose-options input {
  min-width: 0;
  min-height: 36px;
}

.preset-configured-loose-options .tech-input-line small {
  min-width: 0;
  white-space: nowrap;
}

.preset-field-group {
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  min-width: 0;
}

.preset-field-group:first-child {
  grid-template-columns: 1fr;
  align-items: start;
}

.preset-field-group:first-child .preset-group-label {
  grid-column: 1 / -1;
}

.preset-field-group:nth-child(2) {
  grid-template-columns: 1fr;
}

.preset-field-group:nth-child(2) .preset-group-label {
  grid-column: 1 / -1;
}

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

.preset-field-group .field {
  gap: 5px;
  min-width: 0;
}

.preset-field-group select {
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  min-width: 0;
}

.preset-material-fields .field.is-disabled {
  opacity: 0.58;
}

.preset-material-fields .field.is-disabled select {
  color: var(--muted);
  background: #f1f4f5;
  cursor: not-allowed;
}

.preset-group-label {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.compact-field {
  display: grid;
  grid-template-columns: 24px minmax(0, 66px) 78px 22px;
  gap: 4px;
  align-items: center;
  min-width: 0;
}

.compact-field label {
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

.preset-dimension-lock {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--muted);
}

.preset-dimension-lock svg {
  width: 16px;
  height: 16px;
}

.compact-field.is-locked .preset-dimension-lock {
  color: var(--text);
}

.compact-field input {
  width: 78px;
  min-width: 78px;
  min-height: 34px;
  padding: 6px 10px;
}

.compact-field input:disabled {
  color: var(--muted-strong);
  background: #f2f7fb;
  opacity: 1;
  cursor: not-allowed;
}

.compact-field small {
  color: var(--muted);
  min-width: 22px;
  line-height: 1;
}

.preset-corner-summary {
  display: flex;
  align-items: baseline;
  gap: 18px;
  min-height: 0;
  margin-top: 4px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.preset-corner-summary strong {
  color: var(--text);
  font-weight: 700;
}

.module-stack-panel {
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.module-stack-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.module-stack-title strong {
  font-size: 15px;
}

.module-stack-heading {
  display: grid;
  gap: 2px;
}

.module-stack-heading small,
.module-stack-count {
  color: var(--muted);
  font-size: 13px;
}

.module-stack-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  min-height: 180px;
  padding: 10px;
  border: 1px solid #cbd7dd;
  border-radius: 8px;
  background: #f6f9fa;
}

.stack-chip {
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  max-width: 100%;
  min-height: 42px;
  border: 1px solid #c5d3d9;
  border-radius: 8px;
  background: #e7eef1;
  padding: 7px 8px 7px 10px;
  text-align: left;
}

.stack-chip-copy {
  min-width: 0;
}

.stack-chip-topline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stack-chip.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  background: #fbfbf8;
}

.stack-chip strong {
  display: block;
  font-size: 13px;
}

.stack-chip small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.stack-chip-topline em {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: #8a6a00;
  background: #fff3c2;
  border: 1px solid #f0d36b;
  border-radius: 999px;
  padding: 2px 7px;
}

.stack-chip-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.module-stack-empty {
  color: var(--muted);
  align-self: center;
  font-size: 13px;
}

.square-meter-stage {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(170px, auto) auto;
  gap: 12px;
  padding: 12px;
  border: 1px solid #cbd7dd;
  border-radius: 8px;
  background: #f6f9fa;
}

.square-meter-editor-stage {
  min-height: 0;
  grid-template-rows: auto;
}

.preset-wall-form {
  gap: 12px;
}

.wall-workspace {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #cbd7dd;
  border-radius: 8px;
  background: #f6f9fa;
}

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

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

.wall-selection-zone {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
}

.wall-static-controls {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.wall-add-geometry {
  flex: 0 0 auto;
}

.wall-size-trigger.active {
  border-color: #7e929c;
  background: #edf3f5;
}

.wall-zoom-controls {
  display: grid;
  grid-template-columns: 30px 46px 30px;
  align-items: center;
  flex-shrink: 0;
  padding: 2px;
  border: 1px solid #cbd7dd;
  border-radius: 6px;
  background: #fff;
}

.wall-zoom-controls .tool-btn {
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border: 0;
}

.wall-zoom-controls .tool-btn svg {
  width: 15px;
  height: 15px;
}

.wall-zoom-controls output {
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.wall-workspace-title,
.wall-selection-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.wall-workspace-title strong,
.wall-selection-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.wall-selection-copy small,
.wall-selection-empty {
  color: var(--muted);
  font-size: 12px;
}

.wall-selection-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.wall-selection-copy {
  max-width: 210px;
  margin-right: 2px;
  text-align: right;
}

.wall-selection-tools .tool-btn {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
}

.wall-selection-tools .tool-btn svg {
  width: 17px;
  height: 17px;
}

.wall-collision-toggle.active {
  border-color: var(--nico-yellow);
  background: var(--nico-yellow);
  color: var(--dark);
}

.wall-notice {
  padding: 7px 9px;
  border: 1px solid #e3bd53;
  border-radius: 6px;
  background: #fff8df;
  color: #6b5200;
  font-size: 12px;
  font-weight: 700;
}

.wall-canvas-frame {
  position: relative;
  width: 100%;
  min-width: 0;
  height: 330px;
}

.wall-canvas-viewport {
  height: 100%;
  overflow: auto;
  border: 1px solid #c5d3d9;
  border-radius: 6px;
  background: #fff;
}

.wall-canvas {
  position: relative;
  min-width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}

.wall-surface {
  position: absolute;
  bottom: var(--wall-ruler-size);
  left: var(--wall-ruler-size);
  z-index: 0;
  border-top: 1px solid #d4dde1;
  border-right: 1px solid #d4dde1;
  background: #fff;
  pointer-events: none;
}

.wall-floor {
  position: absolute;
  bottom: var(--wall-ruler-size);
  left: var(--wall-ruler-size);
  z-index: 2;
  height: 0;
  border-top: 2px solid #7d8b92;
  pointer-events: none;
}

.wall-ruler {
  position: absolute;
  z-index: 8;
  color: #718089;
  background: #f4f7f8;
  pointer-events: none;
  user-select: none;
}

.wall-ruler-horizontal {
  bottom: 0;
  left: var(--wall-ruler-size);
  height: var(--wall-ruler-size);
  overflow: hidden;
  border-top: 1px solid #aebbc1;
}

.wall-ruler-vertical {
  top: 0;
  bottom: var(--wall-ruler-size);
  left: 0;
  width: var(--wall-ruler-size);
  overflow: hidden;
  border-right: 1px solid #aebbc1;
}

.wall-ruler-origin {
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: 9;
  display: grid;
  width: var(--wall-ruler-size);
  height: var(--wall-ruler-size);
  place-items: center;
  border-top: 1px solid #aebbc1;
  border-right: 1px solid #aebbc1;
  background: #edf2f4;
  color: #718089;
  font-size: 8px;
  pointer-events: none;
}

.wall-ruler-tick {
  position: absolute;
  color: #718089;
}

.wall-ruler-horizontal .wall-ruler-tick {
  top: 0;
  width: 1px;
  height: 5px;
  border-left: 1px solid currentColor;
}

.wall-ruler-horizontal .wall-ruler-tick.major {
  height: 9px;
}

.wall-ruler-horizontal .wall-ruler-tick small {
  position: absolute;
  top: 9px;
  left: 3px;
  font-size: 8px;
  line-height: 1;
  white-space: nowrap;
}

.wall-ruler-vertical .wall-ruler-tick {
  right: 0;
  width: 5px;
  height: 1px;
  border-top: 1px solid currentColor;
}

.wall-ruler-vertical .wall-ruler-tick.major {
  width: 9px;
}

.wall-ruler-vertical .wall-ruler-tick small {
  position: absolute;
  right: 9px;
  bottom: 2px;
  font-size: 8px;
  line-height: 1;
  white-space: nowrap;
}

.wall-ruler-unit {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 8px;
  font-weight: 700;
}

.wall-canvas-empty {
  position: absolute;
  inset: 0 0 var(--wall-ruler-size) var(--wall-ruler-size);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

.wall-item {
  position: absolute;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  margin: 0;
  padding: 5px;
  overflow: hidden;
  border: 1px solid #5d87a0;
  border-radius: 4px;
  background: #edf4f7;
  color: var(--text);
  cursor: grab;
  touch-action: none;
  user-select: none;
  text-align: center;
}

.wall-item:hover {
  filter: brightness(0.97);
}

.wall-item-module {
  border-color: #5d87a0;
  background: #edf4f7;
}

.wall-item-square-meter {
  border-color: #55956c;
  background: #eef7f1;
}

.wall-item-geometry {
  border-color: #87959b;
  background: #f1f3f4;
  color: #52636b;
}

.wall-item.collision-off {
  border-style: dashed;
  background: #f8fafb;
}

.wall-item.selected {
  border-width: 2px;
  border-color: var(--accent);
  background: #fff8e5;
  box-shadow: 0 0 0 2px rgba(224, 168, 0, 0.18);
}

.wall-item-geometry.selected {
  background: #fff8e5;
}

.wall-item.wall-limit-conflict {
  border-color: #b83a3a;
  box-shadow: 0 0 0 3px rgba(184, 58, 58, 0.25);
}

.wall-item.dragging {
  cursor: grabbing;
  opacity: 0.86;
  box-shadow: 0 6px 16px rgba(25, 38, 45, 0.18);
}

.wall-item strong,
.wall-item span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.15;
}

.wall-item strong {
  display: -webkit-box;
  overflow-wrap: anywhere;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.wall-item span {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.wall-size-dialog-backdrop {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(18, 28, 34, 0.32);
}

.wall-size-dialog {
  width: min(440px, 100%);
  padding: 18px;
  border: 1px solid #c4d0d6;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(18, 28, 34, 0.24);
}

.wall-size-dialog header,
.wall-size-dialog footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wall-size-dialog h4 {
  margin: 3px 0 0;
  font-size: 18px;
}

.wall-size-dialog header .icon-only {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  font-size: 24px;
  font-weight: 400;
}

.wall-size-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.wall-size-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid #c4d0d6;
  border-radius: 6px;
  background: #fff;
}

.wall-size-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(224, 168, 0, 0.14);
}

.wall-size-input input {
  min-width: 0;
  border: 0;
  box-shadow: none;
}

.wall-size-input > span {
  padding-right: 11px;
  color: var(--muted);
  font-size: 12px;
}

.wall-size-occupied {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.wall-size-error {
  display: grid;
  gap: 3px;
  margin-top: 12px;
  padding: 9px 10px;
  border-left: 3px solid #b83a3a;
  background: #fff2f2;
  color: #7d2525;
  font-size: 12px;
}

.wall-size-dialog footer {
  justify-content: flex-end;
  margin-top: 18px;
}

.wall-size-reset {
  margin-right: auto;
}

.wall-item.compact span {
  display: none;
}

.wall-item.compact strong {
  font-size: 10px;
}

.wall-item-editor {
  display: grid;
  gap: 10px;
  padding-top: 2px;
}

.wall-geometry-editor {
  padding: 10px 12px;
}

.wall-geometry-editor-head {
  display: grid;
  grid-template-columns: minmax(120px, 0.65fr) minmax(180px, 1fr) minmax(210px, 0.8fr) auto;
  align-items: end;
  gap: 10px;
}

.wall-geometry-editor-head .preset-name-field {
  grid-column: auto;
}

.geometry-dimension-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(90px, 1fr));
  gap: 8px;
}

.geometry-dimension-fields .field {
  gap: 3px;
}

.geometry-dimension-fields input,
.wall-geometry-editor-head .primary-btn {
  min-height: 34px;
}

.wall-delete-item:hover {
  border-color: #d9a9a9;
  color: #9b3535;
  background: #fff3f3;
}

.furniture-item-stack .module-stack-list {
  min-height: 120px;
  max-height: none;
  overflow-y: visible;
}

.preset-items-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.preset-items-form .furniture-item-stack {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.preset-form .furniture-item-stack .module-stack-list {
  flex: 0 0 auto;
  align-content: flex-start;
  max-height: none;
  overflow-y: visible;
}

.configure-added-item,
.remove-added-item {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid #d5dfe4;
  border-radius: 50%;
  background: #fff;
  line-height: 1;
}

.configure-added-item {
  color: #4f6472;
}

.configure-added-item svg {
  width: 12px;
  height: 12px;
}

.remove-added-item {
  border-color: #e0c8c8;
  color: #8a3d3d;
  font-weight: 900;
}

.square-meter-editor {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) minmax(120px, 0.5fr) minmax(120px, 0.5fr);
  grid-template-areas:
    "head head head"
    "composition dimensions dimensions";
  gap: 12px;
  align-items: end;
}

.square-meter-editor-head {
  grid-area: head;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.square-meter-editor-head .primary-btn {
  min-height: 34px;
  padding: 0 12px;
}

.square-meter-name-field,
.square-meter-composition-field,
.square-meter-fields {
  min-width: 0;
}

.square-meter-name-field {
  grid-area: name;
}

.square-meter-composition-field {
  grid-area: composition;
}

.square-meter-fields {
  grid-area: dimensions;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.square-meter-fields .field {
  display: grid;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
  background: var(--panel-raised);
}

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

th {
  background: var(--panel-subtle);
  color: #46535a;
  font-size: 12px;
  font-weight: 650;
}

.environment-group tbody tr {
  background: #f8fafb;
}

.environment-group tbody tr:nth-child(even) {
  background: #eef3f5;
}

.environment-group td {
  border-bottom-color: #cfd9de;
}

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

.table-textarea {
  min-height: 44px;
  height: 100%;
  max-height: none;
  padding: 8px;
  line-height: 1.25;
  resize: none;
  overflow: hidden;
}

.environment-group .col-module input {
  width: 100%;
  max-width: none;
  white-space: normal;
  text-overflow: clip;
}

.environment-group td.col-module {
  white-space: normal;
}

.col-finish {
  min-width: 280px;
}

.material-summary {
  display: block;
  color: var(--ink);
  line-height: 1.3;
}

.review-layout .col-finish {
  width: auto;
  min-width: 0;
}

.review-layout table {
  min-width: 0;
  table-layout: fixed;
}

.review-layout .table-wrap {
  overflow-x: hidden;
}

.review-layout th,
.review-layout td {
  padding: 6px 5px;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.review-layout .col-environment {
  width: 82px;
}

.review-layout .col-module {
  width: 116px;
}

.review-layout .col-qty {
  width: 48px;
  min-width: 0;
}

.review-layout .col-value {
  width: 92px;
  min-width: 0;
}

.review-layout .col-module input,
.review-layout .col-finish input,
.review-layout .money-input-cell {
  width: 100%;
  max-width: none;
}

.review-env-tone-0 td {
  background: #fbfcfd;
}

.review-env-tone-1 td {
  background: #eef4f6;
}

.review-env-tone-2 td {
  background: #f6f2e7;
}

.review-env-tone-3 td {
  background: #eef1ed;
}

.review-jump-row {
  cursor: pointer;
}

.review-jump-row:hover td {
  background: #fff9df;
}

.row-focus td {
  background: #fff1b8 !important;
  transition: background 0.3s ease;
}

.col-measure {
  width: 150px;
  min-width: 150px;
}

.environment-group .col-module {
  width: 210px;
  min-width: 210px;
}

.environment-group .col-modules-list {
  width: auto;
}

.environment-group .col-qty {
  width: 62px;
  min-width: 62px;
}

.environment-group .col-value {
  width: 118px;
  min-width: 118px;
}

.environment-group .col-status {
  width: 126px;
  min-width: 126px;
}

.col-measure input {
  max-width: 136px;
}

.col-qty {
  width: 68px;
  min-width: 68px;
  text-align: center;
}

.col-qty input {
  max-width: 54px;
  text-align: center;
}

.col-value {
  width: 118px;
  min-width: 118px;
}

.col-value input {
  max-width: 104px;
}

.money-input-cell {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.money-input-cell span {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.money-input-cell input {
  min-width: 0;
  border: 0;
  padding: 4px 0;
}

.money-input-cell input:focus {
  outline: none;
  box-shadow: none;
}

.col-status {
  width: 128px;
  min-width: 128px;
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status.incluir {
  color: #0f6842;
  background: #dff2e9;
}

.status.revisar {
  color: #8a5900;
  background: #fff1cf;
}

.status.excluir {
  color: #737d86;
  background: #edf0f2;
}

.status-select {
  border: 0;
  border-radius: 999px;
  min-height: 32px;
  padding: 0 30px 0 12px;
  font-weight: 800;
}

.status-select.incluir {
  color: #0f6842;
  background: #dff2e9;
}

.status-select.revisar {
  color: #8a5900;
  background: #fff1cf;
}

.status-select.excluir {
  color: #737d86;
  background: #edf0f2;
}

.review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 238px;
  gap: 16px;
}

.review-main-column {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.list-panel,
.chat-panel,
.review-alert-panel {
  padding: 18px;
}

.review-alert-panel {
  align-self: start;
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow: auto;
}

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

.tab {
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--muted);
  border-radius: var(--radius-md);
  height: 36px;
  padding: 0 12px;
  font-weight: 550;
}

.tab.active {
  color: var(--dark);
  background: var(--accent-soft);
  border-color: var(--nico-yellow);
  font-weight: 650;
}

.review-environment-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--nico-yellow);
  border-radius: var(--radius-md);
  background: var(--panel-raised);
}

.review-environment-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.review-environment-summary strong {
  display: block;
  margin-top: 2px;
  font-size: 18px;
}

.review-environment-summary div:last-child {
  min-width: 128px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.review-environment-summary div:last-child strong {
  color: var(--dark);
}

.chat-log {
  display: grid;
  gap: 10px;
  max-height: 470px;
  overflow: auto;
  padding-right: 4px;
}

.bubble {
  border-radius: 8px;
  padding: 10px 12px;
  line-height: 1.4;
  font-size: 13px;
}

.bubble.agent {
  background: #fff;
  border: 1px solid var(--line);
}

.bubble.user {
  background: var(--dark);
  border: 1px solid var(--dark);
  color: #fff;
}

.chat-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 12px;
}

.review-alert-list {
  display: grid;
  gap: 8px;
}

.review-alert {
  border: 1px solid var(--line-subtle);
  border-left-width: 4px;
  border-radius: var(--radius-md);
  padding: 9px 10px;
  background: var(--panel-raised);
}

.review-alert strong {
  display: block;
  font-size: 13px;
  margin-bottom: 5px;
}

.review-alert p {
  margin: 0;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.4;
}

.review-alert.info {
  border-left-color: var(--danger);
  background: #fff;
}

.review-alert.warning {
  border-left-color: var(--danger);
  background: #fff;
}

.review-alert.danger {
  border-left-color: var(--danger);
  background: #fff;
}

.review-alert.ok {
  border-left-color: var(--success);
  background: #f2faf6;
}

.review-alert.ok p {
  color: var(--muted);
}

.review-insights {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin-top: 0;
}

.review-insights .material-card:nth-child(2) {
  order: -1;
}

.review-chart-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafb;
}

.review-chart-card h4 {
  margin: 0 0 12px;
  font-size: 14px;
}

.bar-list,
.finish-list {
  display: grid;
  gap: 10px;
}

.bar-row-label,
.finish-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.bar-row-label span,
.finish-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-row-label strong,
.finish-row strong {
  white-space: nowrap;
}

.bar-track {
  height: 8px;
  margin-top: 5px;
  border-radius: 999px;
  background: #e1e9ed;
  overflow: hidden;
}

.bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--dark);
}

.finish-row {
  padding: 8px 10px;
  border: 1px solid #d5e0e5;
  border-radius: 8px;
  background: #fff;
}

.material-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel);
  box-shadow: 0 10px 22px rgba(20, 27, 31, 0.08);
}

.material-card-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #d9e2e6;
}

.material-card h4,
.material-card-title h4 {
  margin: 0;
  font-size: 16px;
}

.material-card-title span,
.hardware-row span {
  color: var(--muted);
  font-size: 12px;
}

.material-table {
  display: grid;
  border: 1px solid #d5e0e5;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.material-table-head,
.material-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 95px 92px 78px;
  gap: 10px;
  align-items: center;
  padding: 8px 9px;
}

.material-table-head {
  background: #eef3f5;
  color: #2d3a42;
  font-size: 12px;
  font-weight: 900;
}

.material-row {
  border-top: 1px solid #e1e9ed;
  font-size: 13px;
}

.material-row-total {
  background: #f6f9fa;
  font-weight: 900;
}

.material-row strong {
  min-width: 0;
  white-space: normal;
  line-height: 1.25;
}

.material-row:not(.material-row-total) strong,
.hardware-row strong {
  font-weight: 400;
}

.material-row span,
.material-table-head span:nth-child(n + 2) {
  text-align: right;
  white-space: nowrap;
}

.hardware-list {
  display: grid;
  border: 1px solid #d5e0e5;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.hardware-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px 64px;
  gap: 6px;
  align-items: center;
  padding: 8px 10px;
  border-top: 1px solid #e1e9ed;
  font-size: 13px;
}

.hardware-row:first-child {
  border-top: 0;
}

.hardware-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  line-height: 1.25;
}

.hardware-row span {
  color: var(--success);
  font-weight: 900;
  white-space: nowrap;
  text-align: left;
}

.hardware-row .hardware-qty {
  text-align: left;
}

.hardware-row .hardware-unit {
  text-align: left;
}

.pricing-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 258px;
  gap: 16px;
}

.pricing-main-panel {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.pricing-entry-card,
.pricing-summary-card {
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-md);
  background: var(--panel-subtle);
  padding: 14px;
}

.pricing-entry-card {
  display: grid;
  gap: 4px;
  border-left: 3px solid var(--accent);
}

.pricing-entry-card span,
.pricing-summary-card span {
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}

.pricing-entry-card strong {
  font-size: 28px;
  font-weight: 650;
  line-height: 1.1;
}

.pricing-entry-card small {
  color: var(--muted);
  font-size: 13px;
}

.pricing-mode-toggle {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pricing-mode-toggle button {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--field);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  padding: 10px 14px;
}

.pricing-mode-toggle button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #12191d;
}

.pricing-form-grid {
  margin-top: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  column-gap: 14px;
}

.pricing-lock-input {
  position: relative;
}

.pricing-lock-input input {
  width: 100%;
  padding-right: 48px;
}

.pricing-lock-btn {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  min-height: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--dark);
  cursor: pointer;
}

.pricing-lock-btn.locked {
  background: var(--dark);
  color: #fff;
}

.pricing-lock-btn svg {
  width: 16px;
  height: 16px;
}

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

.pricing-advanced-section {
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-md);
  background: var(--panel-subtle);
  overflow: hidden;
}

.pricing-advanced-section summary {
  cursor: pointer;
  font-weight: 650;
  padding: 13px 14px;
}

.pricing-advanced-section .form-grid {
  padding: 0 14px 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.pricing-alert {
  border: 1px solid var(--line-subtle);
  border-left: 4px solid #d49a00;
  border-radius: var(--radius-md);
  background: var(--panel-raised);
  color: var(--ink);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.pricing-alert.warning {
  border-left-color: #d49a00;
  color: var(--ink);
}

.pricing-alert.critical {
  border-left-color: #bb3f3f;
  color: #b42323;
}

.pricing-alert.info {
  border-left-color: #2f7f73;
  color: var(--ink);
}

.pricing-alert.muted {
  border-left-color: #8da0aa;
  color: var(--ink);
}

.pricing-summary-card h4 {
  margin: 0 0 12px;
  font-size: 18px;
}

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

.pricing-summary-grid > .pricing-summary-tile {
  min-width: 0;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-md);
  background: var(--panel-raised);
  display: grid;
  gap: 4px;
  padding: 10px 34px 10px 12px;
  position: relative;
}

.pricing-summary-grid .pricing-sale-card {
  border: 2px solid #2f9e62;
}

.pricing-summary-grid strong {
  font-size: 16px;
  font-weight: 650;
}

.summary-info {
  align-items: center;
  background: #eef4f6;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  cursor: help;
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  height: 20px;
  justify-content: center;
  padding: 0;
  position: absolute;
  right: 10px;
  top: 10px;
  width: 20px;
}

.summary-info::after {
  background: #121b20;
  border-radius: 6px;
  bottom: calc(100% + 8px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  color: #fff;
  content: attr(data-summary-tooltip);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  opacity: 0;
  padding: 8px 10px;
  pointer-events: none;
  position: absolute;
  right: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  visibility: hidden;
  width: 230px;
  z-index: 20;
}

.summary-info:hover,
.summary-info:focus-visible {
  background: #fff8df;
  border-color: var(--accent);
  color: var(--ink);
}

.summary-info:hover::after,
.summary-info:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.pricing-output-panel {
  align-self: start;
  background: var(--panel);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 16px;
}

.pricing-output-heading {
  padding: 0;
}

.pricing-output-heading h3 {
  margin: 0;
  color: #f6f7f4;
  font-size: 22px;
}

.pricing-output-heading p {
  margin: 6px 0 0;
  color: #c4cdd1;
  line-height: 1.35;
}

.pricing-side-column {
  align-self: start;
  display: grid;
  gap: 12px;
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 16px 4px 16px 0;
}

.pricing-output-panel .totals {
  background: transparent;
  color: var(--ink);
  padding: 0;
  gap: 0;
}

.pricing-output-panel .total-line {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.pricing-output-panel .total-line:first-child {
  padding-top: 0;
}

.pricing-output-panel .total-line.final {
  border-top: 0;
  border-bottom: 0;
  margin-top: 4px;
  padding-top: 14px;
  color: var(--dark);
}

.pricing-visuals {
  display: grid;
}

.pricing-breakdown-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  padding: 0;
}

.pricing-breakdown-card summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
  list-style-position: inside;
  padding: 12px 14px;
}

.pricing-breakdown-card[open] {
  padding-bottom: 14px;
}

.pricing-breakdown-row {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 0 14px;
}

.pricing-breakdown-row > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-size: 13px;
}

.pricing-breakdown-row strong {
  white-space: nowrap;
}

.price-book-page {
  display: grid;
  gap: 16px;
}

.price-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.price-tab {
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.055);
  color: #d6dde0;
  font-weight: 600;
}

.price-tab.active {
  background: var(--panel);
  border-color: var(--panel);
  color: var(--ink);
  box-shadow: inset 0 -3px 0 var(--accent);
}

.price-book-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
}

.price-book-grid--with-loss-guide {
  grid-template-areas:
    "price-card price-help"
    "loss-guide price-help";
  align-items: start;
}

.price-book-grid--with-loss-guide > .price-card {
  grid-area: price-card;
}

.price-book-grid--with-loss-guide > .loss-guide {
  grid-area: loss-guide;
}

.price-book-grid--with-loss-guide > .price-help-card {
  grid-area: price-help;
}

.price-card,
.price-help-card {
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-lg);
  background: var(--panel);
  padding: 18px;
  box-shadow: var(--shadow);
}

.price-card-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.price-card-title h3,
.price-help-card h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 650;
}

.price-card-title p,
.price-help-card p {
  margin: 5px 0 0;
  color: var(--muted);
}

.price-table {
  display: grid;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.price-table-head,
.price-table-row {
  display: grid;
  gap: 8px;
  align-items: center;
  padding: 8px;
}

.sheet-table .price-table-head,
.sheet-table .price-table-row {
  grid-template-columns: minmax(150px, 1fr) 102px 188px 120px 84px 34px;
}

.sheet-table:not(.sheet-table--composicoes) .price-table-head span:nth-child(4) {
  text-align: center;
}

.sheet-table--composicoes .price-table-head,
.sheet-table--composicoes .price-table-row {
  grid-template-columns: minmax(150px, 1fr) 102px 104px 34px;
}

.sheet-table--composicoes .price-table-head span:nth-child(3) {
  text-align: center;
}

.sheet-table--composicoes .sheet-dimension-fixed {
  justify-content: center;
  padding-inline: 0;
}

.price-rate {
  white-space: nowrap;
  font-weight: 400;
}

.sheet-table:not(.sheet-table--composicoes) .price-rate {
  width: 100%;
  text-align: center;
}

.direct-table.with-loss .price-table-head,
.direct-table.with-loss .price-table-row {
  grid-template-columns: minmax(230px, 1fr) 128px 130px 112px 34px;
}

.direct-table.with-loss .readonly-price-cell {
  justify-content: center;
  text-align: center;
}

.direct-table.with-loss .price-table-head span:nth-child(2) {
  text-align: center;
}

.direct-table.no-loss .price-table-head,
.direct-table.no-loss .price-table-row {
  grid-template-columns: minmax(230px, 1fr) 128px 130px 34px;
}

.direct-table.hardware-table .price-table-head,
.direct-table.hardware-table .price-table-row {
  grid-template-columns: minmax(220px, 1fr) 168px 116px 130px 34px;
}

.readonly-price-cell {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 4px;
  font-weight: 400;
}

.sheet-dimension-fixed {
  justify-content: flex-start;
  padding-inline: 4px;
  white-space: nowrap;
}

.price-table-head {
  background: var(--panel-subtle);
  color: #46535a;
  font-size: 12px;
  font-weight: 650;
}

.price-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.price-sort-button strong {
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}

.price-sort-button.active strong {
  color: var(--nico-yellow);
}

.price-table-row {
  border-top: 1px solid var(--line-subtle);
  background: var(--panel-raised);
}

.price-table-row:nth-child(odd) {
  background: #f2f5f4;
}

.price-table-warning {
  margin: 10px 0;
  padding: 9px 11px;
  border: 1px solid #e4bf55;
  border-radius: 6px;
  background: #fff8df;
  color: #6d5500;
  font-size: 12px;
}

.price-table-row input {
  width: 100%;
  min-width: 0;
}

.price-row-action {
  justify-self: end;
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border-color: #d8e1e5;
  color: var(--danger);
}

.dimension-pair {
  display: grid;
  grid-template-columns: 82px auto 82px;
  gap: 7px;
  align-items: center;
}

.dimension-pair input {
  padding-left: 10px;
  padding-right: 8px;
}

.dimension-pair span {
  color: var(--muted);
  font-weight: 600;
}

.percent-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px;
  align-items: center;
}

.percent-input span {
  color: var(--muted);
  font-weight: 600;
}

.loss-guide {
  align-self: start;
}

.loss-guide-values {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 18px;
}

.price-help-card {
  align-self: start;
  display: grid;
  gap: 12px;
}

.price-help-list {
  display: grid;
  gap: 12px;
}

.price-note {
  display: grid;
  gap: 5px;
  padding: 0 0 12px;
  border: 0;
  border-bottom: 1px solid var(--line-subtle);
  border-radius: 0;
  background: transparent;
}

.price-note:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.price-note span {
  color: var(--muted);
  line-height: 1.35;
}

.totals {
  display: grid;
  gap: 10px;
  background: #182229;
  color: #fff;
  border-radius: 8px;
  padding: 18px;
}

.total-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.total-line.final {
  border-top: 1px solid rgba(255,255,255,0.2);
  padding-top: 12px;
  margin-top: 4px;
  font-size: 22px;
  font-weight: 800;
}

.proposal-preview {
  padding: 28px;
  max-width: 820px;
  border: 1px solid var(--line);
  box-shadow: none;
  overflow: hidden;
}

.proposal-preview h3 {
  margin: 0 0 10px;
  font-size: 24px;
}

.proposal-document-header {
  display: grid;
  gap: 14px;
}

.proposal-company-identity {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.proposal-company-identity img {
  display: block;
  width: auto;
  max-width: 150px;
  height: 48px;
  object-fit: contain;
  object-position: left center;
}

.proposal-company-identity strong {
  font-size: 20px;
}

.proposal-company-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.proposal-company-subtitle {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.proposal-preview table {
  min-width: 0;
  table-layout: fixed;
}

.proposal-preview th,
.proposal-preview td {
  overflow-wrap: anywhere;
}

.proposal-preview--client th:nth-child(1) { width: 16%; }
.proposal-preview--client th:nth-child(2) { width: 28%; }
.proposal-preview--client th:nth-child(3) { width: 40%; }
.proposal-preview--client th:nth-child(4) { width: 16%; }

.proposal-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
  color: var(--muted);
  margin-bottom: 22px;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 28px;
  background: var(--soft);
  color: var(--muted);
}

.display-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.display-stage {
  display: grid;
  gap: 16px;
}

.technical-display {
  display: grid;
  place-items: center;
  min-height: 560px;
  border: 1px solid #c7d4da;
  border-radius: 8px;
  background:
    linear-gradient(#dce5e9 1px, transparent 1px),
    linear-gradient(90deg, #dce5e9 1px, transparent 1px),
    #f6f9fa;
  background-size: 34px 34px;
  overflow: hidden;
}

.cabinet-preview {
  width: min(820px, 100%);
  height: auto;
}

.display-grid-lines path {
  stroke: #9dadb5;
  stroke-width: 1;
  stroke-dasharray: 8 8;
  opacity: 0.55;
}

.cabinet-shell polygon {
  fill: url(#display-face);
  stroke: var(--dark);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.cabinet-shell .cabinet-back {
  fill: rgba(238, 243, 245, 0.38);
}

.cabinet-shell .cabinet-top,
.cabinet-shell .cabinet-bottom {
  fill: rgba(212, 167, 44, 0.18);
}

.cabinet-pieces polygon {
  stroke: var(--dark);
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
}

.piece-line {
  fill: rgba(22, 28, 31, 0.12);
}

.shelf-line {
  fill: rgba(212, 167, 44, 0.28);
}

.front-panel {
  fill: rgba(238, 243, 245, 0.54);
}

.front-panel.secondary {
  fill: rgba(212, 167, 44, 0.24);
}

.display-handles path {
  fill: none;
  stroke: #fff;
  stroke-width: 8;
  stroke-linecap: round;
  paint-order: stroke;
}

.display-handles path:last-child {
  stroke: var(--dark);
  stroke-width: 4;
}

.display-dimensions path {
  stroke: var(--nico-yellow);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.display-dimensions text {
  fill: var(--dark);
  font-size: 18px;
  font-weight: 800;
}

.display-notes {
  display: grid;
  gap: 14px;
}

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

.display-note-list div {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 5px 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.display-note-list span {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 2px;
  background: var(--nico-yellow);
}

.display-note-list strong,
.display-note-list p {
  grid-column: 2;
}

.display-note-list strong {
  font-size: 14px;
}

.display-note-list p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.proposal-stage {
  display: grid;
  gap: 18px;
}

.proposal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.proposal-total {
  margin-top: 18px;
  max-width: 460px;
}

.company-settings-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(360px, 1.2fr);
  gap: 28px;
  align-items: start;
}

.company-identity-fields {
  display: grid;
  gap: 14px;
}

.company-logo-setting {
  display: grid;
  gap: 8px;
}

.company-logo-setting > span {
  font-weight: 600;
}

.company-logo-setting > small {
  color: var(--muted);
}

.company-logo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.company-logo-preview {
  width: 180px;
  height: 96px;
  flex: 0 0 180px;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-subtle);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.company-logo-preview img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  object-position: center;
}

.company-logo-upload {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.company-logo-upload input {
  display: none;
}

.tech-layout {
  display: grid;
  gap: 18px;
}

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

.panel-editor-progress {
  position: sticky;
  top: 0;
}

.panel-editor-progress h3 {
  margin: 0 0 10px;
}

.panel-editor-progress p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.panel-type-config {
  display: grid;
  grid-template-columns: 320px minmax(250px, 1fr);
  gap: 18px;
  align-items: stretch;
}

.panel-type-select {
  width: 100%;
  max-width: 100%;
  align-self: start;
  align-content: start;
}

.panel-type-select > select,
.panel-type-select .panel-material-option select {
  height: 38px;
  min-height: 38px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.panel-type-select small {
  color: var(--muted);
  line-height: 1.35;
}

.panel-material-option {
  gap: 4px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.panel-material-option select {
  min-height: 38px;
}

.panel-ripa-material-option {
  margin-top: 8px;
  padding-top: 0;
  border-top: 0;
}

.panel-led-sides {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 12px;
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel-led-sides legend {
  padding: 0 5px;
  color: #38444d;
  font-size: 12px;
  font-weight: 800;
}

.panel-led-sides label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #38444d;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.panel-led-hardware {
  gap: 4px;
  margin-top: 10px;
}

.panel-led-hardware select {
  min-height: 38px;
}

.panel-ripado-options {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.panel-ripado-options .tech-field {
  gap: 4px;
}

.panel-ripado-options select,
.panel-ripado-options input {
  min-height: 38px;
}

@media (max-width: 1160px) and (min-width: 761px) {
  .preset-modal-body {
    grid-template-columns: minmax(350px, 0.8fr) minmax(0, 1.2fr);
  }

  .preset-modal-body--wall {
    grid-template-columns: minmax(380px, 420px) minmax(0, 1fr);
  }

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

@media (max-width: 760px) {
  .panel-ripado-options {
    grid-template-columns: 1fr;
  }

  .panel-type-preview,
  .panel-type-preview.is-ripado {
    height: 220px;
    min-height: 220px;
  }
}

.panel-type-preview {
  width: 100%;
  height: auto;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.panel-type-preview.is-ripado {
  height: auto;
  min-height: 0;
  align-self: stretch;
}

.panel-type-preview svg {
  display: block;
  width: 100%;
  height: 100%;
}

.panel-preview-surface {
  fill: #faf8ef;
  stroke: #4f5a60;
  stroke-width: 2;
}

.panel-preview-slats rect {
  fill: #d4a72c;
  stroke: #8b6b12;
  stroke-width: 1;
}

.panel-preview-grooves path {
  fill: none;
  stroke: #59656b;
  stroke-width: 2;
}

.panel-preview-moulding rect {
  fill: none;
  stroke: #59656b;
  stroke-width: 3;
}

.panel-preview-moulding .moulding-inner {
  stroke-width: 1.5;
}

.panel-type-preview pattern path,
.panel-type-preview pattern circle {
  fill: none;
  stroke: #59656b;
  stroke-width: 1.5;
}

.panel-preview-divisions path {
  fill: none;
  stroke: #141b1f;
  stroke-width: 3;
}

.panel-preview-led {
  pointer-events: none;
  mix-blend-mode: multiply;
  stroke: none;
}

.panel-division-status {
  margin-top: 12px;
  padding: 9px 12px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  border-left: 4px solid var(--success);
  border-radius: 6px;
  background: #f4faf7;
}

.panel-division-status.is-divided {
  border-left-color: var(--nico-yellow);
  background: #fff9e7;
}

.panel-division-status span {
  color: var(--muted);
  font-size: 13px;
}

.module-type-scaffold {
  display: grid;
  gap: 22px;
  max-width: 1080px;
}

.module-type-scaffold-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.module-type-scaffold-head h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

.module-type-scaffold-head p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.module-type-scaffold--coming-soon {
  position: relative;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 5px 14px;
  align-items: center;
  max-width: 760px;
}

.module-type-coming-soon-icon {
  grid-row: 1 / span 3;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid #dfc66f;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.module-type-coming-soon-icon svg {
  width: 21px;
  height: 21px;
}

.module-type-scaffold--coming-soon .module-type-status {
  grid-column: 3;
  grid-row: 1 / span 2;
}

.module-type-scaffold--coming-soon h2 {
  grid-column: 2;
  margin: 0;
  font-size: 20px;
}

.module-type-scaffold--coming-soon p,
.module-type-scaffold--coming-soon small {
  grid-column: 2;
  margin: 0;
  color: var(--muted);
}

.module-type-scaffold--coming-soon small {
  font-size: 12px;
}

.module-type-status {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid var(--nico-yellow);
  border-radius: 8px;
  color: #715400;
  background: #fff9e7;
  font-weight: 700;
  font-size: 13px;
}

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

.module-type-scope-section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.module-type-scope-section h3 {
  margin: 0 0 12px;
  font-size: 17px;
}

.module-type-scope-section ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.4;
}

.module-type-next-step {
  margin: 0;
  padding: 13px 15px;
  border-left: 4px solid var(--dark);
  border-radius: 6px;
  background: #f6f8f8;
  color: var(--muted);
}

.tech-config-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.tech-panel {
  display: grid;
  gap: 14px;
  position: relative;
}

.tech-memory {
  margin-top: 18px;
}

.tech-module-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px 18px;
  align-items: start;
  padding: 14px;
  border: 1px solid #b8c3c9;
  background: #fbfbf8;
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tech-module-head .tech-identification-title {
  grid-column: 1 / -1;
  grid-row: 1;
  margin: -14px -14px 4px;
}

.tech-module-head .tech-identification-title h3 {
  margin: 0;
  font-size: 17px;
}

.tech-module-head,
.tech-module-head label,
.tech-module-head input {
  color: var(--ink);
}

.tech-module-head input {
  border-color: var(--line);
}

.tech-module-head strong {
  color: var(--nico-yellow);
}

.technical-topbar-actions {
  display: none;
  align-items: center;
  gap: 8px;
}

.technical-topbar-actions .primary-btn,
.technical-topbar-actions .tech-secondary-btn {
  min-height: 38px;
  padding: 0 16px;
}

.tech-secondary-btn {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.tech-secondary-btn:hover {
  background: var(--soft);
  border-color: var(--dark-3);
  color: var(--ink);
}

.tech-name-label {
  display: block;
  margin-bottom: 6px;
}

.tech-name-field,
.tech-description-field {
  display: block;
  min-width: 0;
}

.tech-name-field {
  grid-column: 1;
  grid-row: 2;
}

.tech-description-field {
  grid-column: 2;
  grid-row: 2;
}

.tech-module-head input.tech-module-name {
  font-size: 20px;
  font-weight: 800;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px 10px;
}

.tech-module-description {
  width: 100%;
  min-height: 56px;
  resize: vertical;
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.tech-module-head strong {
  font-size: 24px;
}

.tech-section {
  display: grid;
  gap: 0;
  padding: 0;
  border: 1px solid #b8c3c9;
  border-radius: 8px;
  background: #fbfbf8;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tech-section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 14px 16px;
  border-bottom: 1px solid #b8c3c9;
  background: #fbfbf8;
}

.tech-section > :not(.tech-section-title) {
  margin: 14px;
}

.tech-section-title span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--nico-yellow);
  color: var(--dark);
  font-size: 12px;
  font-weight: 900;
}

.tech-section-heading {
  display: grid;
  gap: 2px;
}

.tech-section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}

.tech-section h3,
.tech-summary h3,
.tech-memory h3 {
  margin: 0;
  font-size: 17px;
}

.tech-grid {
  display: grid;
  gap: 12px;
}

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

.tech-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.corner-measures-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.corner-measures-type {
  display: grid;
  gap: 12px;
  align-content: start;
}

.corner-measures-divider {
  background: #c7d1d6;
}

.corner-measures-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 18px;
  row-gap: 12px;
  align-content: start;
}

.corner-derived-summary {
  display: flex;
  gap: 18px;
  align-items: baseline;
  align-self: end;
  min-height: 0;
  padding: 0 0 5px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 400;
}

.corner-derived-summary strong {
  color: var(--ink);
  font-weight: 500;
}

.corner-type-preview {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 176px;
  border: 1px solid #c7d1d6;
  border-radius: 8px;
  background: #fffef4;
  padding: 8px;
}

.corner-type-preview svg {
  width: 100%;
  max-width: 300px;
  height: 148px;
}

.corner-type-preview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.corner-preview-fill {
  fill: #ffffb8;
}

.corner-preview-line {
  fill: none;
  stroke: #111;
  stroke-width: 1.25;
  stroke-linecap: square;
  stroke-linejoin: round;
}

.corner-preview-line.strong {
  stroke: #111;
  stroke-width: 1.4;
}

.corner-preview-accent {
  fill: #b88300;
  stroke: #111;
  stroke-width: 1;
  stroke-linejoin: round;
}

.corner-preview-label {
  fill: #4f5a60;
  font-family: Arial, sans-serif;
  font-size: 11px;
  font-weight: 300 !important;
  paint-order: normal !important;
  stroke: transparent !important;
  stroke-width: 0 !important;
}

.tech-grid-annexes {
  column-gap: 88px;
  row-gap: 8px;
  align-items: start;
}

.tech-section-annexes-wrap > :not(.tech-section-title) {
  margin: 12px 14px;
}

.tech-section-annexes-wrap .tech-field-group {
  gap: 10px;
}

.tech-annex-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(148px, 168px);
  gap: 12px;
  align-items: end;
}

.tech-section-annexes-wrap .tech-field {
  gap: 5px;
}

.tech-section-annexes-wrap .tech-field input,
.tech-section-annexes-wrap .tech-field select {
  min-height: 34px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.tech-section-annexes-wrap .tech-input-line {
  gap: 6px;
}

.tech-section-annexes-wrap .tech-check {
  min-height: 36px;
  padding: 8px 12px;
  gap: 10px;
}

.tech-section-annexes-wrap .tech-check input {
  width: 18px;
  height: 18px;
  min-height: 18px;
}

.tech-section-annexes-wrap .annex-hardware-list {
  margin-top: 2px;
  padding-top: 8px;
}

.tech-section-annexes-wrap .annex-hardware-list .add-annex-hardware {
  min-height: 32px;
}

.tech-field-group {
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
}

.cabinet-config-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.68fr) minmax(0, 1.32fr);
  gap: 16px;
  align-items: stretch;
  min-height: 188px;
}

.cabinet-material-column {
  display: grid;
  gap: 12px;
  align-content: start;
}

.cabinet-closure-column {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 7px;
  align-self: stretch;
  height: 100%;
}

.cabinet-choice-title {
  color: #38444d;
  font-size: 13px;
  font-weight: 800;
}

.cabinet-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
  min-height: 165px;
}

.cabinet-choice {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 4px;
  align-content: start;
  min-height: 165px;
  padding: 6px;
  border: 1px solid #c7d4da;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.cabinet-choice.active {
  border-color: var(--nico-yellow);
  box-shadow: inset 0 0 0 2px var(--nico-yellow);
  background: #fbfbf8;
}

.cabinet-choice img {
  width: 100%;
  height: 106px;
  object-fit: contain;
  border: 1px solid #d7e0e4;
  border-radius: 6px;
  background: #fff;
}

.cabinet-choice strong {
  font-size: 14px;
  line-height: 1.1;
}

.cabinet-choice small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.12;
}

.tech-field,
.tech-check,
.tech-readout {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.tech-field span,
.tech-readout span {
  color: #38444d;
  font-size: 13px;
  font-weight: 700;
}

.tech-input-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.measure-lock-line {
  grid-template-columns: 38px minmax(118px, 132px) auto;
  justify-content: start;
  align-items: end;
}

.measure-lock-line input {
  width: 100%;
  max-width: 132px;
}

.measure-config-field {
  position: relative;
}

.measure-field-caption {
  position: absolute;
  top: calc(100% + 6px);
  left: 46px;
  width: max-content;
  max-width: calc(100% - 46px);
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  line-height: 1.3;
  cursor: pointer;
}

.measure-field-caption input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--accent);
}

.measure-field-caption span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.measure-input-stack {
  display: grid;
  gap: 7px;
}

.measure-input-stack span {
  color: #38444d;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.measure-lock-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--dark);
}

.measure-lock-btn.locked {
  background: #eef2f3;
  border-color: var(--dark-3);
  color: var(--dark);
}

.measure-lock-btn svg {
  width: 17px;
  height: 17px;
}

.tech-input-line small {
  color: var(--muted);
  min-width: 38px;
}

.tamponamento-field {
  gap: 6px;
}

.tamponamento-config-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.3fr);
  gap: 26px;
  align-items: stretch;
}

.tamponamento-grid {
  align-items: end;
  column-gap: 46px;
  justify-content: start;
}

.tamponamento-split {
  display: grid;
  grid-template-columns: minmax(148px, 168px) minmax(82px, 92px);
  gap: 8px;
  align-items: end;
  justify-content: start;
}

.tamponamento-split label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.tamponamento-split small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.tamponamento-split select:disabled {
  color: #7a858b;
  background: #edf2f4;
}

.regua-width-field {
  width: 168px;
}

.regua-width-field .tech-input-line {
  grid-template-columns: 168px auto;
  justify-content: start;
}

.tamponamento-preview-card {
  display: grid;
  align-items: stretch;
  min-width: 0;
}

.tamponamento-preview {
  width: 100%;
  min-height: 238px;
  border: 1px solid #cbd7dd;
  border-radius: 8px;
  background: #fff;
}

.internal-builder {
  display: grid;
  gap: 12px;
}

.internal-toolbar {
  display: grid;
  grid-template-columns: minmax(190px, 0.55fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid #cbd7dd;
  border-radius: 8px;
  background: #f8fafb;
}

.internal-toolbar strong,
.internal-toolbar span {
  display: block;
}

.internal-toolbar strong {
  color: var(--dark);
}

.internal-toolbar span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

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

.internal-actions .ghost-btn {
  min-height: 32px;
  padding: 0 10px;
}

.internal-layout-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 8px;
  align-items: stretch;
  min-height: 300px;
}

.internal-layout-stage {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 18px;
  border: 1px solid #cbd7dd;
  border-radius: 8px;
  background: #fff;
}

.internal-layout-preview .internal-detail-panel {
  align-self: stretch;
  min-height: 0;
}

.internal-canvas-stage {
  padding: 14px;
}

.internal-layout-frame {
  max-width: 100%;
  max-height: 100%;
}

.internal-space {
  position: relative;
  display: grid;
  gap: 6px;
  width: 100%;
  height: 100%;
  min-height: 46px;
  padding: 8px;
  border: 2px solid #6b7477;
  background: #fffef2;
  color: var(--dark);
  cursor: pointer;
  overflow: hidden;
}

.internal-space.branch:not(.root) {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

.internal-space.branch:not(.root):hover {
  background: transparent;
}

.internal-space.branch:not(.root).active {
  box-shadow: none;
}

.internal-space:hover {
  background: #fff9d9;
}

.internal-space.active {
  border-color: var(--nico-yellow);
  box-shadow: inset 0 0 0 2px var(--nico-yellow);
}

.front-material-field {
  margin-bottom: 8px;
}

.front-note {
  margin: 0;
  padding: 8px;
  border: 1px solid #e1cf83;
  border-radius: 8px;
  background: #fff8dd;
  color: var(--dark);
  font-size: 12px;
  line-height: 1.3;
}

.front-note.danger {
  border-color: #d7a0a0;
  background: #fff0f0;
  color: #7f2323;
}

.front-builder {
  display: grid;
  gap: 12px;
}

.front-toolbar {
  grid-template-columns: minmax(190px, 0.44fr) minmax(0, 1fr);
}

.front-toolbar .internal-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  justify-content: stretch;
}

.front-toolbar .internal-actions .ghost-btn {
  width: 100%;
  justify-content: center;
  white-space: nowrap;
}

.front-layout-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 10px;
  align-items: stretch;
  min-height: 300px;
}

.front-canvas-stage {
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 14px;
  border: 1px solid #cbd7dd;
  border-radius: 8px;
  background: #fff;
}

.front-layout-preview .internal-detail-panel {
  align-self: stretch;
  min-height: 0;
}

.front-microgrid {
  display: block;
  width: 100%;
  max-width: 760px;
  height: auto;
  max-height: 420px;
  cursor: pointer;
}

.internal-space.split-vertical {
  grid-auto-flow: column;
}

.internal-space.split-horizontal {
  grid-auto-flow: row;
}

.internal-space span {
  position: relative;
  z-index: 2;
  place-self: center;
  color: var(--dark);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.internal-drawer-guides {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.internal-drawer-guide-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(74, 81, 80, 0.5);
  transform: translateY(-50%);
}

.internal-shoe-guides {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.internal-shoe-guide-band {
  position: absolute;
  left: 0;
  right: 0;
  height: 10px;
  border: 1px solid rgba(74, 81, 80, 0.52);
  background:
    repeating-linear-gradient(
      135deg,
      rgba(74, 81, 80, 0.28) 0,
      rgba(74, 81, 80, 0.28) 2px,
      transparent 2px,
      transparent 5px
    ),
    rgba(255, 255, 255, 0.28);
  transform: translateY(50%);
  transform-origin: center;
}

.internal-space span.empty-space-label {
  color: #59656b;
  font-weight: 400;
}

.internal-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.internal-detail-panel {
  display: grid;
  grid-template-rows: auto auto;
  align-self: start;
  align-content: start;
  gap: 10px;
  min-width: 0;
  width: 100%;
  min-height: 320px;
  padding: 12px;
  border: 1px solid #cbd7dd;
  border-radius: 8px;
  background: #f8fafb;
}

.internal-detail-panel h4 {
  margin: 0;
  font-size: 14px;
}

.internal-detail-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
}

.internal-detail-list div {
  display: grid;
  gap: 2px;
  padding-bottom: 8px;
  border-bottom: 1px solid #dde6ea;
}

.internal-detail-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.internal-detail-list strong {
  font-size: 13px;
}

.internal-detail-field {
  display: grid;
  gap: 4px;
  padding-bottom: 6px;
  border-bottom: 1px solid #dde6ea;
}

.front-hinge-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.front-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.internal-detail-field .front-hinge-heading input {
  width: 58px;
  min-height: 26px;
  padding: 0 4px 0 8px;
  flex: 0 0 58px;
  text-align: left;
  appearance: auto;
  -moz-appearance: auto;
}

.internal-detail-field .front-hinge-heading input::-webkit-outer-spin-button,
.internal-detail-field .front-hinge-heading input::-webkit-inner-spin-button {
  margin: 0;
  opacity: 1;
  -webkit-appearance: auto;
}

.internal-detail-field .front-inline-check input {
  width: 18px;
  min-height: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  flex: 0 0 auto;
  accent-color: var(--ink);
  appearance: auto;
  -moz-appearance: auto;
}

.internal-detail-pull-field.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

.internal-detail-field span,
.internal-detail-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.internal-detail-field input,
.internal-detail-field select,
.internal-hardware-row select {
  width: 100%;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.internal-detail-check {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #dde6ea;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.internal-detail-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--ink);
}

.internal-hardware-list {
  display: grid;
  gap: 7px;
}

.internal-hardware-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 6px;
  align-items: center;
}

.front-extra-hardware-entry {
  min-width: 0;
}

.internal-hardware-row .tool-btn {
  min-height: 34px;
  height: 34px;
  color: var(--danger);
}

.internal-empty-detail {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.add-internal-hardware {
  min-height: 32px;
  margin-top: 2px;
}

.annex-hardware-list {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid #d5dee2;
}

.annex-hardware-list .add-annex-hardware {
  min-height: 34px;
  justify-content: center;
}

.tech-check {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  align-self: end;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #cbd7dd;
  border-radius: 8px;
  background: #dde6ea;
}

.tech-check input {
  width: 20px;
  height: 20px;
  min-height: 20px;
}

.tech-readout {
  justify-content: center;
  padding: 10px 12px;
  border: 1px solid #cbd7dd;
  border-radius: 8px;
  background: #d4e0e5;
}

.tech-summary {
  display: grid;
  gap: 18px;
  position: sticky;
  top: 0;
}

.tech-result-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbf8;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.tech-result-total {
  display: block;
  font-size: 34px;
  line-height: 1;
}

.tech-result-lines {
  display: grid;
}

.tech-result-lines div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.tech-result-lines span {
  color: var(--muted);
}

.parts-set-list,
.parts-set-hardware-list {
  display: grid;
  gap: 14px;
}

.tech-section:has(.parts-set-list) {
  background: #e7eef1;
}

.parts-set-row {
  display: grid;
  grid-template-columns:
    minmax(132px, 1fr)
    minmax(170px, 1.1fr)
    68px
    10px
    68px
    72px
    82px
    42px
    42px;
  column-gap: 6px;
  row-gap: 10px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.04);
}

.parts-set-row:last-child {
  border-bottom: 1px solid var(--line);
}

.parts-set-hardware-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 92px 42px;
  gap: 10px;
  align-items: end;
}

.parts-set-cell {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.parts-set-cell span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.parts-set-cell input,
.parts-set-cell select {
  width: 100%;
  min-height: 38px;
}

.parts-set-dimension-separator {
  align-self: end;
  justify-self: center;
  padding-bottom: 9px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}

.parts-dynamic-summary {
  grid-column: span 3;
  display: grid;
  gap: 6px;
  min-width: 0;
}

.parts-dynamic-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.parts-dynamic-summary strong {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff9e8;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.parts-set-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 12px 14px 14px;
}

.parts-set-note,
.parts-set-remove {
  width: 42px;
  height: 38px;
}

.parts-set-dynamic-toggle {
  min-width: 82px;
  height: 38px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.parts-set-dynamic-toggle.active {
  border-color: var(--accent);
  background: rgba(221, 176, 37, 0.16);
  color: #9a7210;
}

.parts-set-note.has-note {
  border-color: var(--accent);
  background: rgba(221, 176, 37, 0.12);
  color: #9a7210;
}

.parts-dynamic-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(180px, 0.75fr) repeat(2, minmax(220px, 1fr));
  gap: 10px;
  align-items: end;
  margin-top: 2px;
  padding: 2px 0 0;
  background: transparent;
}

.parts-dynamic-rule {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(96px, 0.7fr);
  gap: 8px;
  align-items: end;
}

.parts-dynamic-value {
  position: relative;
}

.parts-dynamic-value input {
  padding-right: 34px;
}

.parts-dynamic-value small {
  position: absolute;
  right: 10px;
  bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.parts-dynamic-empty {
  min-height: 38px;
}

.parts-note-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(6, 13, 17, 0.64);
}

.parts-note-modal {
  width: min(460px, calc(100vw - 40px));
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
}

.parts-note-modal h3,
.parts-note-modal p {
  margin: 0;
}

.parts-note-modal p {
  color: var(--muted);
}

.parts-note-modal textarea {
  width: 100%;
  min-height: 132px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  resize: vertical;
}

.parts-note-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.muted-copy {
  margin: 0;
  color: var(--muted);
}

.tech-config-alerts {
  display: grid;
  gap: 12px;
}

.tech-config-alerts .panel-title {
  margin-bottom: 0;
}

.tech-config-alerts .panel-title h3 {
  color: #f6f7f4;
  font-size: 22px;
}

.tech-config-alerts .panel-title p {
  color: #c4cdd1;
  font-size: 14px;
  line-height: 1.35;
}

.tech-total {
  margin: 14px 0;
  font-size: 34px;
  font-weight: 900;
}

.tech-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tech-result-head h3 {
  margin: 0;
}

.panel-adjustment-control {
  display: grid;
  gap: 4px;
  width: 118px;
  color: var(--muted);
  font-size: 11px;
}

.panel-adjustment-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
}

.panel-adjustment-input input {
  min-height: 34px;
  padding: 5px 8px;
  text-align: right;
}

.panel-adjustment-input small {
  color: var(--muted);
  font-size: 14px;
}

.tech-inflation-toggle {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
}

.tech-inflation-toggle.active {
  border-color: var(--nico-yellow);
  background: #fbfbf8;
  color: var(--dark);
}

.tech-inflation-control {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid #d6c17a;
  border-radius: 8px;
  background: #fff9df;
}

.tech-inflation-control span {
  color: var(--dark);
  font-size: 13px;
}

.tech-inflation-control input {
  min-height: 0;
  padding: 0;
  accent-color: var(--nico-yellow);
}

.tech-inflation-badge {
  display: inline-flex;
  width: fit-content;
  margin-top: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--dark);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.tech-subtotals {
  display: grid;
  gap: 10px;
}

.tech-subtotals div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.tech-subtotals span {
  color: var(--muted);
}

.tech-memory table {
  min-width: 860px;
}

.tech-memory.collapsed .tech-memory-head {
  margin-bottom: 0;
}

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

.tech-memory-actions .ghost-btn {
  min-height: 34px;
  padding: 0 11px;
}

.tech-memory-actions .ghost-btn.active {
  border-color: var(--nico-yellow);
  background: var(--dark);
  color: #fff;
}

.tech-memory-badge {
  display: inline-flex;
  margin-top: 8px;
  padding: 4px 7px;
  border: 1px solid #d4a72c;
  border-radius: 6px;
  color: #725600;
  font-size: 11px;
  font-weight: 700;
}

.tech-memory td {
  vertical-align: middle;
}

.memory-material-input {
  min-width: 190px;
  min-height: 32px;
  padding: 5px 8px;
}

.memory-dimension-inputs {
  display: grid;
  grid-template-columns: 72px auto 72px;
  gap: 5px;
  align-items: center;
  min-width: 166px;
}

.memory-dimension-inputs input {
  min-width: 0;
  min-height: 32px;
  padding: 5px 7px;
}

.memory-dimension-inputs span {
  color: var(--muted);
  text-align: center;
}

.memory-qty-input {
  width: 68px;
  min-width: 0;
  min-height: 32px;
  padding: 5px 7px;
}

.edge-banding-control {
  position: relative;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid #d3dde1;
  border-radius: 6px;
  background: #f8faf9;
}

.edge-banding-control::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid #e3e9eb;
  border-radius: 2px;
  background: #fff;
  pointer-events: none;
}

.edge-band-side {
  position: absolute;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}

.edge-band-side::after {
  content: "";
  position: absolute;
  border-radius: 1px;
  background: #d1dadd;
  transition: background-color 120ms ease, box-shadow 120ms ease;
}

.edge-band-side:hover::after {
  background: var(--nico-yellow);
}

.edge-band-side:focus-visible {
  z-index: 2;
  outline: 2px solid #d99d08;
  outline-offset: 0;
}

.edge-band-side.is-active::after {
  background: #20282b;
}

.edge-band-side.is-active:hover::after {
  background: #11181b;
  box-shadow: 0 0 0 1px var(--nico-yellow);
}

.edge-band-side--top {
  top: 3px;
  left: 8px;
}

.edge-band-side--bottom {
  bottom: 3px;
  left: 8px;
}

.edge-band-side--top,
.edge-band-side--bottom {
  width: 18px;
  height: 7px;
}

.edge-band-side--top::after,
.edge-band-side--bottom::after {
  top: 2px;
  right: 0;
  left: 0;
  height: 3px;
}

.edge-band-side--left {
  left: 3px;
  top: 8px;
}

.edge-band-side--right {
  right: 3px;
  top: 8px;
}

.edge-band-side--left,
.edge-band-side--right {
  width: 7px;
  height: 18px;
}

.edge-band-side--left::after,
.edge-band-side--right::after {
  top: 0;
  bottom: 0;
  left: 2px;
  width: 3px;
}

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

.memory-row-adjusted td:first-child {
  box-shadow: inset 4px 0 0 var(--nico-yellow);
}

.memory-row-adjusted {
  background: #fff9e8;
}

/* Premium consolidation for the modal and technical workspaces. */
.modal-backdrop {
  background: rgba(5, 10, 13, 0.76);
}

.preset-modal {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--panel);
  box-shadow: var(--shadow-modal);
}

.preset-modal-header,
.modal-actions {
  border-color: var(--line-subtle);
  background: var(--panel-raised);
}

.preset-modal-header h3 {
  font-weight: 650;
}

.preset-budget-toggle {
  border-color: var(--line);
  background: var(--panel-subtle);
}

.preset-budget-toggle button {
  color: var(--muted);
  font-weight: 400;
}

.preset-budget-toggle button.active {
  background: var(--panel-raised);
  color: var(--ink);
  box-shadow: var(--shadow-low);
  font-weight: 650;
}

.preset-library {
  border-color: var(--line-subtle);
  background: #e5ebed;
}

.preset-view-toggle,
.add-preset-card,
.add-square-meter-card,
.new-model-type,
.new-model-type-preset {
  font-weight: 650;
}

.add-preset-card,
.add-square-meter-card,
.new-model-type-list,
.new-model-type,
.new-model-type-preset {
  border-radius: var(--radius-md);
}

.add-square-meter-card {
  border-color: var(--line-strong);
  background: var(--panel-raised);
}

.add-square-meter-card:hover {
  background: var(--accent-soft);
}

.preset-card {
  border-color: var(--line-subtle);
  border-radius: var(--radius-md);
  background: var(--panel-raised);
  box-shadow: var(--shadow-low);
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.preset-card:hover {
  border-color: var(--line-strong);
  background: #fff;
}

.preset-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px var(--accent-ring);
}

.preset-card-drag-handle {
  border-color: var(--line-subtle);
  background: var(--panel-raised);
}

.preset-form {
  background: var(--panel);
}

.preset-quick-form,
.square-meter-stage,
.wall-workspace {
  border-color: var(--line-subtle);
  border-radius: var(--radius-md);
  background: var(--panel-subtle);
}

.preset-name-field,
.preset-group-label {
  font-weight: 600;
}

.preset-group-label {
  color: #8d6508;
}

.compact-field input:disabled {
  color: var(--muted-strong);
  background: #e9eeef;
}

.preset-corner-summary {
  background: transparent;
}

.module-stack-panel {
  border-color: var(--line-subtle);
}

.module-stack-list {
  border-color: var(--line-subtle);
  border-radius: var(--radius-md);
  background: var(--panel-subtle);
}

.stack-chip {
  border-color: var(--line);
  border-radius: var(--radius-md);
  background: #e7edef;
}

.stack-chip.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px var(--accent-ring);
}

.stack-chip-topline em {
  border-color: #e7cd72;
  background: #fff4ca;
  font-weight: 600;
}

.wall-size-trigger.active,
.wall-collision-toggle.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
}

.wall-zoom-controls {
  border-color: var(--line);
  background: var(--panel-raised);
}

.wall-notice {
  border-color: #e7ca70;
  background: var(--accent-soft);
  font-weight: 600;
}

.wall-canvas-viewport {
  border-color: var(--line);
  background: var(--panel-raised);
}

.wall-surface {
  border-color: var(--line-subtle);
  background: var(--panel-raised);
}

.wall-ruler,
.wall-ruler-origin {
  background: #eef2f2;
}

.wall-size-dialog {
  border-color: var(--line-subtle);
  background: var(--panel-raised);
  box-shadow: var(--shadow-modal);
}

.wall-size-input {
  border-color: var(--line);
  background: var(--field);
}

.wall-size-error {
  background: var(--danger-soft);
}

/* The preset modal is a Mody workbench: catalog, construction and result. */
.preset-modal:not(.file-import-modal) {
  --preset-header-bg: #172024;
  --preset-library-bg: #e2e8ea;
  --preset-workspace-bg: #202a2e;
  --preset-workspace-line: #3e4b51;
  --preset-workspace-muted: #b6c1c6;
  --preset-editor-bg: #f5f7f6;
  --preset-editor-raised: #fcfdfc;
  --preset-editor-subtle: #edf1f1;
  --preset-editor-action-width: 190px;
  border-color: #46535a;
  background: var(--preset-workspace-bg);
}

.preset-modal:not(.file-import-modal) > .preset-modal-header {
  min-height: 68px;
  border-color: rgba(255, 255, 255, 0.1);
  background: var(--preset-header-bg);
  color: var(--inverse);
  box-shadow: 0 8px 20px rgba(5, 11, 14, 0.16);
}

.preset-modal:not(.file-import-modal) .preset-modal-header h3,
.preset-modal:not(.file-import-modal) .preset-modal-total strong {
  color: var(--inverse);
}

.preset-modal:not(.file-import-modal) .preset-modal-header p,
.preset-modal:not(.file-import-modal) .preset-modal-total span {
  color: var(--preset-workspace-muted);
}

.preset-modal:not(.file-import-modal) .preset-modal-total {
  border-color: var(--accent);
}

.preset-modal:not(.file-import-modal) .preset-budget-toggle {
  border-color: var(--shell-line);
  background: #0f1517;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.preset-modal:not(.file-import-modal) .preset-budget-toggle button {
  color: #b8c3c8;
}

.preset-modal:not(.file-import-modal) .preset-budget-toggle button:hover:not(.active) {
  color: #fff;
  background: var(--shell-raised);
}

.preset-modal:not(.file-import-modal) .preset-budget-toggle button.active {
  background: var(--panel-raised);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(5, 11, 14, 0.22);
}

.preset-modal:not(.file-import-modal) .close-preset-modal {
  border-color: #dfe5e7;
  background: var(--panel-raised);
  color: var(--ink);
  font-weight: 650;
}

.preset-modal:not(.file-import-modal) .close-preset-modal:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.preset-modal:not(.file-import-modal) .preset-modal-body {
  background: var(--preset-workspace-bg);
}

.preset-modal:not(.file-import-modal) .preset-library {
  border-color: var(--preset-workspace-line);
  background: var(--preset-library-bg);
  box-shadow: 8px 0 22px rgba(5, 11, 14, 0.1);
}

.preset-modal:not(.file-import-modal) .preset-library .tool-btn,
.preset-modal:not(.file-import-modal) .preset-library .add-square-meter-card {
  border-color: #c8d3d7;
  background: var(--preset-editor-raised);
  box-shadow: var(--shadow-low);
}

.preset-modal:not(.file-import-modal) .preset-library .tool-btn:hover,
.preset-modal:not(.file-import-modal) .preset-library .add-square-meter-card:hover {
  border-color: var(--line-strong);
  background: #fff;
}

.preset-modal:not(.file-import-modal) .preset-library .preset-definition-edit {
  border-color: var(--shell-line);
  background: var(--shell-raised);
  color: #fff;
}

.preset-modal:not(.file-import-modal)
  .preset-library
  .preset-definition-edit:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--shell-hover);
  color: #fff;
}

.preset-modal:not(.file-import-modal) .preset-library .preset-organizer-toggle.active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--shell);
}

.preset-modal:not(.file-import-modal) .preset-division-header > strong,
.preset-modal:not(.file-import-modal) .preset-organizer-bar > strong {
  color: #273238;
}

.preset-modal:not(.file-import-modal) .preset-division-line {
  border-color: #a9b7bd;
}

.preset-modal:not(.file-import-modal) .preset-card {
  border-color: #d3dde0;
  background: var(--preset-editor-raised);
  box-shadow: 0 1px 3px rgba(15, 26, 31, 0.08);
}

.preset-modal:not(.file-import-modal) .preset-card span {
  color: #8d6508;
}

.preset-modal:not(.file-import-modal) .preset-card:hover {
  border-color: #9eabb1;
  background: #fff;
  box-shadow: 0 3px 9px rgba(15, 26, 31, 0.1);
}

.preset-modal:not(.file-import-modal) .preset-card.active,
.preset-modal:not(.file-import-modal) .preset-card--organizing.is-management-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow:
    inset 3px 0 0 var(--accent),
    0 0 0 1px var(--accent-ring);
}

.preset-modal:not(.file-import-modal) .preset-card-drag-handle {
  border-color: #d7e0e3;
  background: rgba(255, 255, 255, 0.76);
}

.preset-modal:not(.file-import-modal) .preset-card .preset-card-drag-handle,
.preset-modal:not(.file-import-modal)
  .preset-card
  .preset-card-drag-handle
  span {
  color: #60727b;
}

.preset-modal:not(.file-import-modal) .preset-form {
  background: var(--preset-workspace-bg);
  padding: 16px 20px 20px 16px;
  scrollbar-color: #74838a transparent;
}

.preset-modal:not(.file-import-modal) .preset-module-editor,
.preset-modal:not(.file-import-modal) .square-meter-editor-stage,
.preset-modal:not(.file-import-modal)
  .preset-configured-loose-launcher--inline {
  padding: 12px 18px 14px 14px;
}

.preset-modal:not(.file-import-modal) .preset-quick-form,
.preset-modal:not(.file-import-modal) .square-meter-stage,
.preset-modal:not(.file-import-modal) .wall-workspace {
  border-color: #d4dde0;
  background: var(--preset-editor-bg);
  box-shadow: 0 7px 20px rgba(5, 11, 14, 0.18);
}

.preset-modal:not(.file-import-modal) .module-stack-panel {
  border-color: var(--preset-workspace-line);
}

.preset-modal:not(.file-import-modal) .module-stack-title strong {
  color: var(--inverse);
}

.preset-modal:not(.file-import-modal) .module-stack-heading small,
.preset-modal:not(.file-import-modal) .module-stack-count {
  color: var(--preset-workspace-muted);
}

.preset-modal:not(.file-import-modal) .module-stack-list {
  border-color: #d2dcdf;
  background: var(--preset-editor-subtle);
  box-shadow: 0 5px 16px rgba(5, 11, 14, 0.14);
}

.preset-modal:not(.file-import-modal) .stack-chip {
  border-color: #d1dcdf;
  background: var(--preset-editor-raised);
}

.preset-modal:not(.file-import-modal) .stack-chip:hover {
  border-color: var(--line-strong);
  background: #fff;
}

.preset-modal:not(.file-import-modal) .stack-chip.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px var(--accent-ring);
}

.tech-config-area {
  gap: 16px;
}

.tech-module-head,
.tech-section {
  border-color: var(--line-subtle);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-low);
}

.tech-section-title {
  border-color: var(--line-subtle);
  background: var(--panel-subtle);
}

.tech-section-title span {
  width: 27px;
  height: 27px;
  border-radius: var(--radius-md);
  background: #273238;
  color: #f0bd35;
  font-weight: 650;
}

.tech-section h3,
.tech-summary h3,
.tech-memory h3,
.tech-module-head .tech-identification-title h3 {
  font-weight: 650;
}

.tech-module-head input.tech-module-name {
  border-color: var(--line);
  border-radius: var(--radius-md);
  background: var(--field);
  font-size: 18px;
  font-weight: 650;
}

.tech-module-description,
.tech-secondary-btn {
  background: var(--field);
}

.cabinet-choice,
.corner-type-preview,
.tamponamento-preview,
.internal-layout-stage,
.front-canvas-stage {
  border-color: var(--line-subtle);
  border-radius: var(--radius-md);
  background: var(--panel-raised);
}

.cabinet-choice.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px var(--accent-ring);
}

.cabinet-choice-title,
.tech-field span,
.tech-readout span,
.measure-input-stack span {
  color: #46545b;
  font-weight: 600;
}

.measure-lock-btn {
  border-color: var(--line);
  border-radius: var(--radius-md);
  background: var(--field);
}

.internal-toolbar,
.internal-detail-panel,
.tech-check,
.tech-readout {
  border-color: var(--line-subtle);
  border-radius: var(--radius-md);
  background: var(--panel-subtle);
}

.tech-result-card {
  border-color: var(--line-subtle);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-low);
}

.tech-result-total,
.tech-total {
  font-weight: 650;
}

.parts-set-row,
.parts-note-modal {
  border-color: var(--line-subtle);
  border-radius: var(--radius-md);
  background: var(--panel-raised);
  box-shadow: var(--shadow-low);
}

@media (max-width: 1180px) {
  .client-list-columns {
    display: none;
  }

  .client-entry:first-child {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .client-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "identity actions"
      "metrics metrics";
    gap: 9px 12px;
    min-height: 0;
    padding: 11px 14px;
  }

  .client-identity {
    grid-area: identity;
  }

  .client-kpis {
    grid-area: metrics;
    width: min(590px, calc(100% - 72px));
    margin-left: 72px;
  }

  .client-row-actions {
    grid-area: actions;
  }

  .client-history-inline {
    padding-left: 76px;
  }
}

@media (max-width: 1450px) and (min-width: 761px) {
  .price-book-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .price-book-grid--with-loss-guide {
    grid-template-areas:
      "price-card"
      "loss-guide"
      "price-help";
  }

  .price-card {
    overflow-x: auto;
  }

  .price-help-card {
    grid-template-columns: minmax(190px, 0.55fr) minmax(0, 1.45fr);
    align-items: start;
  }

  .price-help-card h3,
  .price-help-card > p {
    grid-column: 1;
  }

  .price-help-card .price-help-list {
    grid-column: 2;
    grid-row: 1 / span 2;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (max-width: 1160px) and (min-width: 761px) {
  .wizard {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .review-layout,
  .pricing-layout,
  .tech-config-area {
    grid-template-columns: minmax(0, 1fr);
  }

  .review-alert-panel,
  .pricing-side-column,
  .tech-summary {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .pricing-side-column {
    padding: 0;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 18mm;
  }

  html,
  body {
    width: 100%;
    height: auto;
    min-height: 0;
    overflow: visible;
    background: #fff;
  }

  .sidebar,
  .topbar,
  .steps,
  .proposal-audience-bar,
  .proposal-actions {
    display: none;
  }

  .app-shell,
  .workspace,
  .content {
    display: block;
    width: 100%;
    height: auto;
    padding: 0;
    overflow: visible;
    background: #fff;
  }

  .wizard {
    display: block;
    width: 100%;
  }

  .proposal-stage {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .proposal-preview {
    width: 100%;
    max-width: none;
    padding: 0;
    border: 0;
    box-shadow: none;
    overflow: visible;
  }

  .proposal-preview table {
    width: 100%;
    min-width: 0;
    font-size: 10pt;
  }

  .proposal-preview tr,
  .proposal-total,
  .proposal-document-header {
    break-inside: avoid;
  }
}

@media (max-width: 1200px) {
  .home-feedback-card {
    width: 238px;
    padding: 9px 11px;
  }

  .home-feedback-card strong {
    font-size: 12px;
  }

  .home-feedback-card p,
  .home-feedback-action {
    font-size: 11px;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .sidebar {
    padding: 16px;
  }

  .brand h1 {
    font-size: 14px;
  }

  .nav-btn {
    padding: 0 10px;
  }

  .wall-workspace {
    min-width: 0;
  }

  .wall-workspace-head {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
    min-width: 0;
  }

  .wall-workspace-controls {
    flex-wrap: wrap;
    justify-content: space-between;
    width: 100%;
    min-width: 0;
  }

  .wall-selection-tools {
    flex: 1 1 190px;
  }

  .wall-selection-copy {
    max-width: 110px;
  }

  .preset-module-editor-head,
  .square-meter-editor-head.preset-square-meter-editor-head,
  .wall-geometry-editor-head {
    grid-template-columns: 1fr;
  }

  .preset-module-editor-head,
  .square-meter-editor-head.preset-square-meter-editor-head {
    min-height: 0;
    height: auto;
  }

  .preset-editor-action-slot {
    width: 100%;
    min-width: 0;
    justify-self: stretch;
  }

  .preset-quick-form.preset-configured-loose-launcher--inline {
    grid-template-areas:
      "context"
      "fields"
      "add";
    grid-template-columns: minmax(0, 1fr);
  }

  .preset-configured-loose-launcher--inline .preset-inline-add {
    margin-top: 0;
  }

  .preset-editor-head .preset-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .preset-editor-head .preset-actions--single {
    grid-template-columns: minmax(0, 1fr);
  }

  .preset-editor-head .preset-actions button,
  .preset-square-meter-editor-head > .primary-btn {
    width: 100%;
  }

  .about-surface {
    padding: 28px;
  }

  .about-principles {
    gap: 18px;
  }
}

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

  .topbar:has(.technical-topbar-actions[style*="display: flex"]) {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 12px 16px;
  }

  .topbar-actions:has(.technical-topbar-actions[style*="display: flex"]),
  .technical-topbar-actions[style*="display: flex"] {
    width: 100%;
    min-width: 0;
  }

  .technical-topbar-actions[style*="display: flex"] {
    gap: 6px;
  }

  .technical-topbar-actions[style*="display: flex"] .primary-btn,
  .technical-topbar-actions[style*="display: flex"] .tech-secondary-btn {
    min-width: 0;
    padding: 0 9px;
  }

  .price-book-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .price-book-grid--with-loss-guide {
    grid-template-areas:
      "price-card"
      "loss-guide"
      "price-help";
  }

  .price-card {
    min-width: 0;
    overflow-x: auto;
  }

  .price-help-card {
    min-width: 0;
  }

  .company-settings-grid {
    grid-template-columns: 1fr;
  }

  .clients-title {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .clients-title-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .about-principles {
    grid-template-columns: 1fr;
  }

  .about-flow {
    gap: 6px;
  }

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

  .client-search {
    width: 100%;
  }

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

  .client-metrics .metric:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--line-subtle);
  }

  .client-metrics .metric:nth-child(4) {
    border-top: 1px solid var(--line-subtle);
  }

  .client-row {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "identity"
      "metrics"
      "actions";
    gap: 10px;
  }

  .client-identity {
    grid-template-columns: 22px 36px minmax(0, 1fr);
    gap: 8px;
  }

  .client-avatar {
    width: 36px;
    height: 36px;
  }

  .client-kpis {
    width: 100%;
    margin-left: 0;
  }

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

  .client-history-inline {
    padding: 10px 14px 13px;
  }

  .client-budget-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 10px;
  }

  .client-budget-row > div {
    grid-row: 1 / span 2;
  }

  .client-budget-row > span,
  .client-budget-row > button {
    grid-column: 2;
    justify-self: end;
  }

  .steps {
    position: static;
    top: auto;
  }

  .app-shell,
  .wizard,
  .review-layout,
  .review-insights,
  .review-environment-summary,
  .pricing-layout,
  .display-page,
  .cabinet-config-grid,
  .tamponamento-config-grid,
  .preset-modal-body,
  .preset-form-columns,
  .module-type-scope-grid,
  .panel-type-config,
  .tech-layout,
  .corner-measures-layout,
  .tech-config-area {
    grid-template-columns: 1fr;
  }

  .corner-measures-divider {
    width: 100%;
    height: 1px;
  }

  .corner-measures-fields {
    grid-template-columns: 1fr;
  }

  .preset-modal-header {
    align-items: stretch;
    flex-direction: column;
  }

  .preset-modal-header-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    justify-content: space-between;
  }

  .preset-budget-toggle {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .preset-budget-toggle button {
    padding: 0 8px;
    font-size: 11px;
  }

  .modal-backdrop {
    padding: 8px;
  }

  .preset-modal {
    height: calc(100vh - 16px);
    max-height: calc(100vh - 16px);
  }

  .preset-modal-body {
    grid-template-rows: minmax(180px, 38%) minmax(0, 62%);
    overflow: hidden;
  }

  .preset-library {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .preset-library-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto 46px;
  }

  .wall-canvas-viewport {
    height: 100%;
  }

  .wall-canvas-frame {
    height: 260px;
  }

  .preset-editor-head,
  .wall-workspace-head {
    align-items: stretch;
    flex-direction: column;
  }

  .preset-module-editor-head,
  .square-meter-editor-head.preset-square-meter-editor-head,
  .wall-geometry-editor-head {
    grid-template-columns: 1fr;
  }

  .preset-module-editor-head,
  .square-meter-editor-head.preset-square-meter-editor-head {
    min-height: 0;
    height: auto;
  }

  .preset-editor-action-slot {
    width: 100%;
    min-width: 0;
    justify-self: stretch;
  }

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

  .preset-editor-head .preset-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .preset-editor-head .preset-actions--single {
    grid-template-columns: minmax(0, 1fr);
  }

  .preset-editor-head .preset-actions button {
    width: 100%;
  }

  .preset-square-meter-editor-head > .primary-btn {
    width: 100%;
  }

  .preset-material-fields {
    grid-template-columns: 1fr;
  }

  .wall-workspace-controls {
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .wall-selection-tools {
    flex: 1 1 190px;
  }

  .wall-selection-copy {
    max-width: 110px;
  }

  .square-meter-editor {
    grid-template-columns: 1fr;
    grid-template-areas:
      "head"
      "composition"
      "dimensions";
  }

  .cabinet-choice-grid {
    grid-template-columns: 1fr;
  }

  .review-environment-summary div:last-child {
    min-width: 0;
    padding-left: 0;
    padding-top: 10px;
    border-left: 0;
    border-top: 1px solid #cbd7dd;
  }

  .app-shell,
  .workspace {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .tech-summary {
    position: static;
  }

  .review-alert-panel,
  .pricing-side-column {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 0;
  }

  .sidebar {
    position: static;
    height: auto;
    min-height: auto;
    overflow: visible;
  }

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

  .option-grid,
  .form-grid,
  .metric-grid,
  .mini-grid,
  .template-card,
  .tech-grid.two,
  .tech-grid.three {
    grid-template-columns: 1fr;
  }
}

/* Professional audit consolidation: review, pricing, proposal and records. */
.sidebar-user-action {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 9px;
}

.file-import-modal {
  width: min(880px, 100%);
  max-height: min(740px, calc(100vh - 56px));
}

.file-import-body {
  padding: 20px;
}

.file-import-actions {
  justify-content: space-between;
  align-items: center;
  padding: 13px 20px;
  background: var(--panel-raised);
}

.review-layout,
.pricing-layout {
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: 16px;
  align-items: start;
}

.review-workspace {
  min-width: 0;
  overflow: hidden;
  padding: 0;
}

.review-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 19px 20px 16px;
}

.review-tabs {
  margin: 0;
  padding: 0 20px 14px;
  border-bottom: 1px solid var(--line-subtle);
}

.review-tabs .tab {
  height: 34px;
  border-radius: var(--radius-md);
  font-size: 12px;
}

.review-environment-summary {
  grid-template-columns: minmax(160px, 1fr) minmax(110px, 0.45fr) minmax(150px, 0.6fr);
  gap: 0;
  margin: 16px 20px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-subtle);
  border-left: 3px solid var(--accent);
  background: var(--panel-subtle);
}

.review-environment-summary > div {
  min-height: 60px;
  display: grid;
  align-content: center;
  padding: 10px 14px;
  border-left: 1px solid var(--line-subtle);
}

.review-environment-summary > div:first-child {
  border-left: 0;
}

.review-environment-summary div:last-child {
  min-width: 0;
  padding-left: 14px;
  border-left: 1px solid var(--line-subtle);
}

.review-environment-summary strong {
  font-size: 16px;
  font-weight: 650;
}

.review-workspace > .table-wrap {
  margin: 0 20px 18px;
  border-radius: var(--radius-md);
}

.review-empty-state {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 0 20px 20px;
  min-height: 82px;
  padding: 14px 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-subtle);
}

.review-empty-state > svg {
  width: 26px;
  color: var(--muted);
}

.review-empty-state strong {
  font-size: 14px;
}

.review-empty-state p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.review-materials-block {
  display: grid;
  gap: 14px;
  padding: 18px 20px 20px;
  border-top: 1px solid var(--line-subtle);
  background: #f1f4f4;
  container-name: review-materials;
  container-type: inline-size;
}

.review-section-title {
  display: grid;
  gap: 2px;
}

.review-section-title span {
  color: var(--muted);
  font-size: 11px;
}

.review-section-title strong {
  font-size: 15px;
  font-weight: 650;
}

.review-materials-block .review-insights {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.48fr);
  gap: 18px;
}

.review-materials-block .material-card {
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.review-materials-block .material-card:nth-child(2) {
  order: -1;
}

.review-materials-block .material-card + .material-card {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.review-materials-block .material-card-title {
  margin-bottom: 9px;
  padding-bottom: 8px;
}

.review-materials-block .material-table-head,
.review-materials-block .material-row {
  grid-template-columns: minmax(0, 1fr) 64px 72px 56px;
  gap: 8px;
}

.review-materials-block .hardware-row {
  grid-template-columns: minmax(0, 1fr) 52px 68px;
  gap: 8px;
}

@container review-materials (max-width: 820px) {
  .review-materials-block .review-insights {
    grid-template-columns: minmax(0, 1fr);
  }

  .review-materials-block .material-card + .material-card {
    padding-left: 0;
    padding-top: 14px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

.review-alert-panel {
  align-self: start;
  position: sticky;
  top: 18px;
  display: grid;
  gap: 15px;
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-lg);
  background: #182125;
  color: var(--inverse);
  box-shadow: var(--shadow);
}

.review-check-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
}

.review-check-head p {
  margin: 5px 0 0;
  color: #b8c3c8;
  font-size: 12px;
  line-height: 1.45;
}

.review-alert-list {
  gap: 7px;
}

.review-alert {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 9px;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-left-width: 1px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--inverse);
}

.review-alert.info,
.review-alert.warning,
.review-alert.danger,
.review-alert.ok {
  border-left-color: rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.055);
}

.review-alert-mark {
  width: 7px;
  height: 7px;
  margin-top: 5px;
  border-radius: 50%;
  background: #d3a735;
}

.review-alert.danger .review-alert-mark {
  background: #e17b82;
}

.review-alert.info .review-alert-mark {
  background: #79b9ae;
}

.review-alert.ok .review-alert-mark {
  background: #74c49a;
}

.review-alert strong {
  color: #f7f8f6;
  font-size: 12px;
  font-weight: 650;
}

.review-alert p,
.review-alert.ok p {
  margin-top: 4px;
  color: #bdc7cb;
  font-size: 11px;
}

.review-alert button {
  grid-column: 2;
  justify-self: start;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #e1b94e;
  font-size: 11px;
  font-weight: 650;
}

.pricing-main-panel {
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  min-width: 0;
  padding: 20px;
}

.pricing-main-panel > *,
.pricing-side-column {
  min-width: 0;
}

.pricing-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line-subtle);
}

.pricing-base-strip {
  display: grid;
  grid-template-columns: minmax(180px, 0.45fr) minmax(260px, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 78px;
  padding: 14px 16px;
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  background: #202a2f;
  color: var(--inverse);
}

.pricing-base-strip > div {
  display: grid;
  gap: 3px;
}

.pricing-base-strip span {
  color: #b8c3c8;
  font-size: 11px;
}

.pricing-base-strip strong {
  font-size: 23px;
  font-weight: 650;
}

.pricing-base-strip p {
  margin: 0;
  color: #c8d0d4;
  font-size: 12px;
  line-height: 1.45;
}

.pricing-base-strip .ghost-btn {
  border-color: #69777e;
  background: transparent;
  color: #f5f7f6;
}

.pricing-base-strip.is-empty {
  border-left-color: var(--line-strong);
}

.pricing-controls-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.pricing-controls-head > div:first-child {
  display: grid;
  gap: 3px;
}

.pricing-controls-head strong {
  font-size: 14px;
  font-weight: 650;
}

.pricing-controls-head span {
  color: var(--muted);
  font-size: 12px;
}

.pricing-mode-toggle {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(96px, 1fr));
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-subtle);
}

.pricing-mode-toggle button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.pricing-mode-toggle button.active {
  border: 0;
  background: var(--panel-raised);
  color: var(--ink);
  box-shadow: var(--shadow-low);
}

.pricing-form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 14px;
  padding: 16px;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-md);
  background: var(--panel-subtle);
}

.pricing-readonly-field output {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid #d6dee1;
  border-radius: var(--radius-md);
  background: #e2e7e8;
  color: var(--muted-strong);
  font-weight: 650;
}

.advanced-pricing {
  gap: 7px;
}

.pricing-advanced-section {
  background: var(--panel-raised);
}

.pricing-advanced-section summary {
  font-size: 13px;
}

.pricing-breakdown-card {
  background: var(--panel-raised);
}

.pricing-side-column {
  top: 18px;
  gap: 12px;
  padding: 0;
  overflow: visible;
}

.pricing-output-heading {
  padding: 1px 2px 3px;
}

.pricing-output-heading h3 {
  margin: 0;
  color: var(--inverse);
  font-size: 20px;
  font-weight: 650;
}

.pricing-output-heading p {
  margin: 5px 0 0;
  color: #b8c3c8;
  font-size: 12px;
}

.pricing-output-panel {
  overflow: hidden;
  padding: 0;
}

.pricing-sale-total {
  display: grid;
  gap: 4px;
  padding: 18px;
  background: #202a2f;
  color: var(--inverse);
}

.pricing-sale-total span,
.pricing-sale-total small {
  color: #b8c3c8;
  font-size: 11px;
}

.pricing-sale-total strong {
  color: #f2c54e;
  font-size: 25px;
  font-weight: 650;
}

.pricing-output-lines {
  display: grid;
  padding: 7px 16px 10px;
}

.pricing-output-lines > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-subtle);
  font-size: 12px;
}

.pricing-output-lines > div:last-child {
  border-bottom: 0;
}

.pricing-output-lines span {
  color: var(--muted);
}

.pricing-output-lines strong {
  white-space: nowrap;
  font-weight: 650;
}

.pricing-alerts {
  gap: 6px;
}

.pricing-alert {
  padding: 9px 10px;
  background: #f7f9f8;
  font-size: 11px;
  font-weight: 600;
}

.pricing-empty-note {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  color: #c3cdd1;
}

@media (max-width: 1320px) and (min-width: 1081px) {
  .pricing-base-strip {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 14px;
  }

  .pricing-base-strip p {
    grid-column: 1 / -1;
  }

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

.pricing-empty-note svg {
  width: 20px;
  color: var(--accent);
}

.pricing-empty-note p {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
}

.proposal-stage {
  overflow: visible;
  gap: 0;
  padding: 0;
}

.proposal-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 19px 20px 16px;
  border-bottom: 1px solid var(--line-subtle);
}

.proposal-audience-bar {
  min-height: 54px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 7px 20px;
  border-bottom: 1px solid var(--line-subtle);
  background: var(--panel-subtle);
}

.proposal-audience-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(128px, 1fr));
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #dfe5e6;
}

.proposal-audience-tabs button {
  position: relative;
  min-height: 38px;
  display: inline-flex;
  justify-content: center;
  gap: 8px;
  align-items: center;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted-strong);
  font-weight: 700;
}

.proposal-audience-tabs button svg {
  width: 16px;
  height: 16px;
}

.proposal-audience-tabs button.active {
  background: var(--panel-raised);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.proposal-audience-tabs button.active::after {
  content: "";
  position: absolute;
  align-self: end;
  width: 28px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.proposal-command-bar {
  min-height: 62px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 9px 20px;
  border-bottom: 1px solid var(--line-subtle);
  background: var(--panel-raised);
}

.proposal-actions {
  width: 100%;
  min-width: 0;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 8px;
}

.proposal-actions button {
  gap: 7px;
  padding-right: 10px;
  padding-left: 10px;
  white-space: nowrap;
  font-size: 14px;
}

.proposal-whatsapp-btn {
  border-color: #a7d3b9;
  background: #edf8f1;
  color: #1f6d42;
}

.proposal-whatsapp-btn:hover:not(:disabled) {
  border-color: #74b58f;
  background: #e2f4e9;
  color: #155c35;
}

.proposal-pending-note {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 10px 20px;
  border-bottom: 1px solid #e1c26a;
  background: var(--warn-soft);
  color: #6d5205;
}

.proposal-pending-note svg {
  width: 17px;
  height: 17px;
}

.proposal-pending-note p {
  margin: 0;
  font-size: 12px;
}

.proposal-preview {
  width: min(820px, calc(100% - 40px));
  margin: 24px auto;
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-low);
}

.proposal-preview--company {
  width: min(1040px, calc(100% - 40px));
  max-width: 1040px;
}

.proposal-meta-wide {
  grid-column: 1 / -1;
}

.proposal-company-header .proposal-company-identity span {
  color: var(--accent-hover);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.company-proposal-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 24px 0;
  border-top: 1px solid #334147;
  border-bottom: 1px solid #334147;
  background: #202a2f;
  color: #fff;
}

.company-proposal-summary > div {
  min-width: 0;
  display: grid;
  gap: 5px;
  align-content: center;
  min-height: 92px;
  padding: 14px 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.13);
}

.company-proposal-summary > div:last-child {
  border-right: 0;
}

.company-proposal-summary span,
.company-proposal-summary small {
  color: #c7d1d5;
  font-size: 11px;
}

.company-proposal-summary strong {
  color: #fff;
  font-size: 19px;
}

.company-proposal-summary > div:first-child strong {
  color: #f3c535;
  font-size: 22px;
}

.company-proposal-ledger {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
}

.company-proposal-ledger section {
  min-width: 0;
}

.company-proposal-ledger h4,
.company-proposal-section-title h4 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
}

.company-proposal-ledger h4 {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.company-proposal-lines {
  display: grid;
}

.company-proposal-line {
  min-height: 48px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line-subtle);
}

.company-proposal-line > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.company-proposal-line strong {
  font-size: 12px;
}

.company-proposal-line small {
  color: var(--muted);
  font-size: 10px;
}

.company-proposal-line b {
  flex: 0 0 auto;
  font-size: 13px;
}

.company-proposal-line.is-total {
  margin-top: 3px;
  border-bottom: 0;
  background: var(--panel-subtle);
}

.company-proposal-line.is-total strong,
.company-proposal-line.is-total b {
  font-size: 14px;
}

.company-proposal-line.is-deduction b {
  color: #a23d3d;
}

.company-proposal-items {
  margin-top: 28px;
}

.company-proposal-section-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 10px;
}

.company-proposal-section-title > div {
  display: grid;
  gap: 2px;
}

.company-proposal-section-title span {
  color: var(--accent-hover);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.company-proposal-section-title > strong {
  color: var(--muted-strong);
  font-size: 12px;
}

.proposal-preview--company th:nth-child(1) { width: 14%; }
.proposal-preview--company th:nth-child(2) { width: 23%; }
.proposal-preview--company th:nth-child(3) { width: 31%; }
.proposal-preview--company th:nth-child(4) { width: 16%; }
.proposal-preview--company th:nth-child(5) { width: 16%; }

@media (max-width: 900px) {
  .proposal-audience-tabs {
    width: 100%;
  }

  .proposal-command-bar {
    align-items: stretch;
  }

  .proposal-actions {
    flex-wrap: wrap;
  }

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

  .company-proposal-summary > div:nth-child(2) {
    border-right: 0;
  }

  .company-proposal-summary > div:nth-child(-n + 2) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  }

  .company-proposal-ledger {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 620px) {
  .company-proposal-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .company-proposal-summary > div,
  .company-proposal-summary > div:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  }

  .company-proposal-summary > div:last-child {
    border-bottom: 0;
  }
}

.proposal-total {
  margin-left: auto;
  background: #202a2f;
}

.proposal-empty-row {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.budget-list-page {
  overflow: hidden;
  padding: 0;
}

.budget-list-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-subtle);
}

.budget-list-tools {
  display: flex;
  gap: 10px;
  align-items: end;
}

.budget-list-tools .sort-control {
  min-width: 190px;
}

.budget-list {
  display: grid;
  gap: 9px;
  padding: 14px;
  background: #e1e7e9;
}

.budget-card {
  display: grid;
  grid-template-columns: minmax(250px, 0.9fr) minmax(420px, 1.35fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 86px;
  padding: 12px 14px;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-md);
  background: var(--panel-raised);
  box-shadow: var(--shadow-low);
}

.budget-card.sold {
  border-color: #a9cfba;
  box-shadow: inset 3px 0 0 var(--ok);
}

.budget-card-identity {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  min-width: 0;
}

.budget-card-identity .budget-row-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--shell);
  color: var(--accent);
}

.budget-card-identity .budget-row-icon svg {
  width: 17px;
  height: 17px;
}

.budget-card-identity > div {
  min-width: 0;
}

.budget-card-identity strong,
.budget-card-identity small,
.budget-card-status {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.budget-card-identity strong {
  margin-top: 2px;
  font-size: 15px;
  font-weight: 650;
}

.budget-card-identity small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.budget-card-status {
  color: var(--accent-hover);
  font-size: 10px;
  font-weight: 650;
}

.budget-card.sold .budget-card-status {
  color: var(--ok);
}

.budget-card-metrics {
  display: grid;
  grid-template-columns: 0.7fr 0.9fr 1.25fr 1fr;
  gap: 12px;
  min-width: 0;
}

.budget-card-metrics > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.budget-card-metrics span {
  color: var(--muted);
  font-size: 10px;
}

.budget-card-metrics strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 650;
}

.budget-card-actions {
  display: flex;
  gap: 7px;
  justify-content: flex-end;
}

.budget-card-actions button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.budget-empty-state,
.clients-empty-state,
.price-empty-state {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 92px;
  padding: 16px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--panel-raised);
}

.budget-empty-state > svg,
.clients-empty-state > svg,
.price-empty-state > svg {
  width: 27px;
  height: 27px;
  color: var(--muted);
}

.budget-empty-state strong,
.clients-empty-state strong,
.price-empty-state strong {
  font-size: 14px;
}

.budget-empty-state p,
.clients-empty-state p,
.price-empty-state p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.client-list-columns,
.client-row {
  grid-template-columns: minmax(300px, 45fr) minmax(310px, 43fr) 150px;
}

.client-row-actions .new-budget-client {
  min-height: 34px;
  padding: 0 10px;
  white-space: nowrap;
  font-size: 12px;
}

.client-row-actions .new-budget-client svg {
  width: 15px;
  height: 15px;
}

.clients-empty-state {
  margin: 14px;
  grid-template-columns: 38px minmax(0, 1fr);
}

.price-book-grid {
  grid-template-columns: minmax(0, 1fr) 258px;
  gap: 16px;
}

.price-card {
  min-width: 0;
  padding: 18px;
}

.price-card-title {
  margin-bottom: 16px;
}

.price-card-title h3 {
  font-size: 20px;
}

.price-card-title p {
  max-width: 680px;
  font-size: 13px;
}

.price-empty-state {
  grid-template-columns: 38px minmax(0, 1fr);
  min-height: 112px;
  background: var(--panel-subtle);
}

.price-help-card {
  align-self: start;
  display: block;
  padding: 0;
  overflow: hidden;
}

.price-help-card > summary {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 18px;
  gap: 9px;
  align-items: center;
  min-height: 64px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

.price-help-card > summary::-webkit-details-marker {
  display: none;
}

.price-help-card > summary > svg:first-child {
  width: 19px;
  color: var(--accent-hover);
}

.price-help-card > summary > svg:last-child {
  width: 16px;
  color: var(--muted);
  transition: transform 0.16s ease;
}

.price-help-card[open] > summary > svg:last-child {
  transform: rotate(180deg);
}

.price-help-card > summary span {
  display: grid;
  gap: 2px;
}

.price-help-card > summary strong {
  font-size: 13px;
  font-weight: 650;
}

.price-help-card > summary small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.price-help-body {
  padding: 0 14px 14px;
  border-top: 1px solid var(--line-subtle);
}

.price-help-body > p {
  margin: 12px 0;
  font-size: 12px;
  line-height: 1.45;
}

.price-help-list {
  gap: 9px;
}

.price-note {
  padding-bottom: 9px;
}

.price-note strong,
.price-note span {
  font-size: 11px;
}

.price-sort-icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
  color: var(--muted);
  opacity: 0.6;
}

.price-sort-icon svg {
  width: 14px;
  height: 14px;
}

.price-sort-icon.is-asc {
  transform: rotate(180deg);
  opacity: 1;
}

.price-sort-icon.is-desc {
  opacity: 1;
}

.direct-table select,
.price-table-row select {
  min-width: 0;
  padding-right: 30px;
}

.company-settings-grid {
  grid-template-columns: minmax(260px, 0.9fr) minmax(360px, 1.1fr);
  gap: 22px;
}

.company-settings .field > small {
  color: var(--muted);
  font-size: 11px;
}

.company-logo-preview {
  width: 132px;
  height: 68px;
  flex-basis: 132px;
}

.environment-group table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.environment-group .table-wrap {
  overflow-x: hidden;
}

.environment-group th,
.environment-group td {
  padding: 8px 7px;
}

.environment-group .col-module {
  width: 26%;
  min-width: 0;
}

.environment-group .col-modules-list {
  width: auto;
  min-width: 0;
}

.environment-group .col-qty {
  width: 54px;
  min-width: 0;
}

.environment-group .col-value {
  width: 88px;
  min-width: 0;
}

.environment-group .col-status {
  width: 112px;
  min-width: 0;
}

.environment-group .col-row-actions {
  width: 44px;
  min-width: 0;
}

.construction-head .panel-actions button {
  white-space: nowrap;
}

@media (max-width: 1450px) and (min-width: 761px) {
  .price-book-grid,
  .price-book-grid--with-loss-guide {
    grid-template-columns: minmax(0, 1fr);
  }

  .price-book-grid--with-loss-guide {
    grid-template-areas:
      "price-card"
      "loss-guide"
      "price-help";
  }
}

@media (max-width: 1320px) {
  .construction-head {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .construction-head .panel-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .budget-card {
    grid-template-columns: minmax(230px, 0.8fr) minmax(360px, 1.2fr);
  }

  .budget-card-actions {
    grid-column: 1 / -1;
    padding-top: 9px;
    border-top: 1px solid var(--line-subtle);
  }
}

@media (max-width: 1080px) {
  .construction-head {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .construction-head .panel-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .review-layout,
  .pricing-layout,
  .price-book-grid,
  .price-book-grid--with-loss-guide {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: none;
  }

  .price-book-grid--with-loss-guide > .price-card,
  .price-book-grid--with-loss-guide > .loss-guide,
  .price-book-grid--with-loss-guide > .price-help-card {
    grid-area: auto;
  }

  .review-alert-panel,
  .pricing-side-column {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .pricing-output-heading h3,
  .pricing-output-heading p {
    color: var(--ink);
  }

  .price-help-card {
    width: 100%;
  }

  .client-list-columns,
  .client-row {
    grid-template-columns: minmax(260px, 1fr) minmax(280px, 0.9fr) 140px;
  }
}

@media (max-width: 760px) {
  .construction-head,
  .review-head,
  .pricing-head,
  .proposal-head,
  .budget-list-head {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .budget-list-head {
    display: grid;
  }

  .construction-client,
  .pricing-client-context,
  .review-head-context,
  .proposal-client-context {
    min-width: 0;
  }

  .construction-start-options,
  .construction-overview,
  .pricing-form-grid,
  .review-environment-summary,
  .company-settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .construction-overview > div,
  .review-environment-summary > div,
  .review-environment-summary div:last-child {
    border-left: 0;
    border-top: 1px solid var(--line-subtle);
  }

  .construction-overview > div:first-child,
  .review-environment-summary > div:first-child {
    border-top: 0;
  }

  .file-import-modal .template-card,
  .file-import-modal .drop-line,
  .review-empty-state,
  .budget-empty-state {
    grid-template-columns: minmax(0, 1fr);
  }

  .file-import-modal .template-icon,
  .drop-line-icon {
    display: none;
  }

  .file-import-actions {
    align-items: stretch;
  }

  .file-import-actions > span {
    display: none;
  }

  .budget-list-tools,
  .proposal-actions,
  .pricing-controls-head {
    align-items: stretch;
    flex-direction: column;
  }

  .budget-card {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .budget-card-actions {
    grid-column: auto;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .client-list-columns {
    display: none;
  }

  .client-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .client-kpis {
    padding-left: 72px;
  }

  .client-row-actions {
    justify-content: flex-start;
    padding-left: 72px;
  }

  .app-dialog-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-dialog-icon {
    display: none;
  }
}

@media print {
  .proposal-head,
  .proposal-audience-bar,
  .proposal-command-bar,
  .proposal-pending-note {
    display: none;
  }

  .proposal-preview {
    width: 100%;
    max-width: none;
    margin: 0;
    border: 0;
    box-shadow: none;
  }

  .company-proposal-summary,
  .company-proposal-line,
  .company-proposal-section-title {
    break-inside: avoid;
  }

  .company-proposal-summary {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

.work-settings-save-state.is-pending,
.work-settings-save-state.is-pending svg {
  color: #f2c54e;
}

.contract-settings {
  min-width: 0;
  padding: 0;
  overflow: visible;
}

.contract-settings-title {
  margin: 0;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line-subtle);
}

.contract-settings-title > .ghost-btn {
  min-width: 190px;
  flex: 0 0 auto;
  justify-content: center;
  white-space: nowrap;
}

.document-library-title {
  align-items: center;
  margin: 0;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line-subtle);
}

.document-template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 18px 22px 22px;
}

.document-template-card {
  min-width: 0;
  min-height: 108px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-raised);
  box-shadow: var(--shadow-soft);
}

.document-template-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: #202a2f;
  color: var(--accent);
}

.document-template-icon svg {
  width: 20px;
  height: 20px;
}

.document-template-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.document-template-copy span {
  color: var(--accent-hover);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.document-template-copy strong,
.document-template-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-template-copy strong {
  color: var(--ink);
  font-size: 14px;
}

.document-template-copy small {
  color: var(--muted);
  font-size: 11px;
}

.document-template-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.document-template-actions .ghost-btn {
  min-height: 36px;
  padding: 0 10px;
}

.document-template-actions .tool-btn {
  color: var(--danger);
}

.document-library-empty {
  min-height: 160px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  align-content: center;
  margin: 18px 22px 22px;
  padding: 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--panel-subtle);
  color: var(--muted);
}

.document-library-empty > svg {
  width: 24px;
  color: var(--accent-hover);
}

.document-library-empty div {
  display: grid;
  gap: 4px;
}

.document-library-empty strong {
  color: var(--ink);
}

.document-library-empty p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.document-template-name {
  display: grid;
  gap: 6px;
  margin: 16px 22px 0;
}

.document-template-name span {
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 650;
}

.document-template-name input {
  min-height: 44px;
  font-size: 14px;
  font-weight: 650;
}

.contract-first-access,
.contract-copy-note {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.contract-first-access {
  margin: 16px 22px 0;
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  color: var(--muted-strong);
}

.contract-first-access svg,
.contract-copy-note svg {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: var(--accent-hover);
}

.contract-first-access div {
  display: grid;
  gap: 3px;
}

.contract-first-access strong {
  color: var(--ink);
  font-size: 13px;
}

.contract-first-access p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.contract-editor-frame {
  min-width: 0;
  margin: 16px 22px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: visible;
  background: var(--panel-subtle);
}

.contract-editor-toolbar {
  position: relative;
  z-index: 3;
  min-height: 50px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: #f8faf9;
}

.contract-toolbar-group {
  display: inline-flex;
  gap: 2px;
  padding-right: 7px;
  border-right: 1px solid var(--line-subtle);
}

.contract-toolbar-group button,
.contract-block-format select {
  min-width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted-strong);
}

.contract-toolbar-group button:hover,
.contract-toolbar-group button:focus-visible {
  border-color: var(--line);
  background: var(--panel-raised);
  color: var(--ink);
}

.contract-toolbar-group button svg {
  width: 17px;
  height: 17px;
}

.contract-toolbar-format button {
  font-family: Georgia, serif;
  font-size: 15px;
}

.contract-block-format select {
  width: 136px;
  border-color: var(--line);
  background: var(--field);
  font-size: 12px;
}

.contract-numbered-list {
  font-size: 12px;
  font-weight: 750;
}

.contract-toolbar-label {
  margin-left: 6px;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 650;
}

.contract-field-picker {
  position: relative;
  margin-left: auto;
}

.contract-field-toggle {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.contract-field-toggle svg {
  width: 15px;
  height: 15px;
}

.contract-field-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 7px);
  right: 0;
  width: min(700px, calc(100vw - 72px));
  max-height: 420px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-raised);
  box-shadow: var(--shadow-modal);
}

.contract-field-menu[hidden] {
  display: none;
}

.contract-field-menu section {
  min-width: 0;
  padding: 6px;
}

.contract-field-menu section + section {
  border-left: 1px solid var(--line-subtle);
}

.contract-field-menu strong {
  display: block;
  padding: 4px 7px 7px;
  color: var(--accent-hover);
  font-size: 11px;
  text-transform: uppercase;
}

.contract-field-menu button {
  width: 100%;
  min-height: 32px;
  display: block;
  padding: 6px 7px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-size: 12px;
}

.contract-field-menu button:hover,
.contract-field-menu button:focus-visible {
  background: var(--accent-soft);
}

.contract-field-example-tooltip {
  position: fixed;
  z-index: 80;
  width: min(284px, calc(100vw - 24px));
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  border: 1px solid #3c4a50;
  border-radius: var(--radius-sm);
  background: #172126;
  color: #f5f7f7;
  box-shadow: 0 10px 28px rgba(7, 14, 18, 0.28);
  pointer-events: none;
}

.contract-field-example-tooltip[hidden] {
  display: none;
}

.contract-field-example-tooltip span {
  color: #f2c54e;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.contract-field-example-tooltip strong {
  padding: 0;
  color: #f5f7f7;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  text-transform: none;
}

.contract-editor-paper {
  padding: 24px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  background: #dfe5e6;
}

.contract-rich-editor {
  width: 210mm;
  max-width: 100%;
  min-height: auto;
  aspect-ratio: 210 / 297;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 18mm;
  outline: 0;
  background: #fff;
  color: #1c2529;
  box-shadow: 0 2px 9px rgba(10, 18, 22, 0.12);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  line-height: 1.65;
}

.contract-rich-editor:focus {
  box-shadow: 0 0 0 3px var(--accent-ring), 0 2px 9px rgba(10, 18, 22, 0.12);
}

.contract-rich-editor h1,
.contract-rich-editor h2,
.contract-rich-editor h3 {
  margin: 1.2em 0 0.55em;
  color: #11181b;
  font-family: Inter, Arial, sans-serif;
  line-height: 1.25;
}

.contract-rich-editor h1 {
  font-size: 24px;
}

.contract-rich-editor h2 {
  font-size: 19px;
}

.contract-rich-editor h3 {
  font-size: 16px;
}

.contract-rich-editor p {
  margin: 0 0 0.9em;
  orphans: 3;
  widows: 3;
}

.contract-rich-editor ul,
.contract-rich-editor ol {
  margin: 0 0 1em 24px;
  padding: 0;
}

.contract-rich-editor h1,
.contract-rich-editor h2,
.contract-rich-editor h3 {
  break-after: avoid-page;
  page-break-after: avoid;
}

.contract-field-token,
.contract-missing-field {
  display: inline;
  padding: 2px 4px;
  border-radius: 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  font-family: Inter, Arial, sans-serif;
  font-size: 0.86em;
  font-weight: 650;
}

.contract-field-token {
  border: 1px solid #d7b24a;
  background: #fff4cf;
  color: #765600;
  cursor: default;
  user-select: all;
}

.contract-missing-field {
  border: 1px solid #d78c76;
  background: #fff0ea;
  color: #8c351e;
}

.contract-page-break {
  position: relative;
  height: 28px;
  margin: 24px -36px;
  border-top: 1px dashed #8e9ba1;
  color: #687980;
  text-align: center;
  font-family: Inter, Arial, sans-serif;
  font-size: 10px;
  line-height: 1;
}

.contract-page-break span {
  position: relative;
  top: -7px;
  padding: 0 8px;
  background: #fff;
}

.contract-editor-footer,
.contract-budget-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.contract-editor-footer {
  padding: 16px 22px 20px;
}

.contract-editor-save-state {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.contract-editor-save-state i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
}

.contract-editor-save-state.is-pending {
  color: #765600;
}

.contract-editor-save-state.is-pending i {
  background: var(--accent-hover);
}

.proposal-document-picker {
  position: relative;
}

.proposal-document-picker > .ghost-btn > svg:last-child {
  width: 15px;
  height: 15px;
}

.proposal-document-picker > .ghost-btn {
  min-width: 176px;
  justify-content: center;
  white-space: nowrap;
}

.proposal-document-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  right: auto;
  left: 0;
  width: 320px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-raised);
  box-shadow: var(--shadow-modal);
}

.proposal-document-menu[hidden] {
  display: none;
}

.proposal-document-menu-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 8px 9px;
  border-bottom: 1px solid var(--line-subtle);
}

.proposal-document-menu-head strong {
  font-size: 12px;
}

.proposal-document-menu-head span {
  color: var(--muted);
  font-size: 10px;
}

.proposal-document-menu > button {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 16px;
  gap: 9px;
  align-items: center;
  padding: 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-size: 12px;
  font-weight: 650;
}

.proposal-document-menu > button:hover,
.proposal-document-menu > button:focus-visible {
  background: var(--accent-soft);
}

.proposal-document-menu > button svg {
  width: 16px;
  color: var(--accent-hover);
}

.proposal-document-menu > button svg:last-child {
  color: var(--muted);
}

.proposal-document-menu-empty {
  display: grid;
  gap: 10px;
  padding: 12px 8px 6px;
}

.proposal-document-menu-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.proposal-document-menu-empty .ghost-btn {
  width: 100%;
  justify-content: center;
}

.contract-budget-workspace {
  min-width: 0;
  padding-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel-raised);
  box-shadow: var(--shadow);
  overflow: visible;
}

.contract-budget-head {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-subtle);
}

.contract-budget-head h3 {
  margin: 3px 0 3px;
  font-size: 20px;
}

.contract-budget-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.contract-budget-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.contract-copy-note {
  margin: 14px 20px 0;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: #202a2f;
  color: #dbe4e7;
  font-size: 12px;
  line-height: 1.4;
}

.contract-copy-note svg {
  color: #f2c54e;
}

.contract-pending-note {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin: 10px 20px 0;
  padding: 10px 12px;
  border: 1px solid #b8d9c7;
  border-radius: var(--radius-sm);
  background: #eff8f3;
  color: #24583d;
}

.contract-pending-note.has-pending {
  border-color: #ead39d;
  background: var(--warn-soft);
  color: #765600;
}

.contract-pending-note > svg {
  width: 17px;
  height: 17px;
}

.contract-pending-note div {
  display: grid;
  gap: 2px;
}

.contract-pending-note strong {
  font-size: 12px;
}

.contract-pending-note p {
  margin: 0;
  font-size: 11px;
}

.contract-budget-workspace .contract-editor-frame {
  margin-top: 12px;
}

.contract-budget-footer {
  margin: 12px 22px 0;
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 1180px) {
  .contract-budget-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .contract-budget-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 980px) {
  .work-settings-nav {
    grid-template-columns: repeat(6, minmax(126px, 1fr));
  }

  .contract-editor-paper {
    padding: 14px;
  }

  .contract-rich-editor {
    padding: 14mm;
  }

  .contract-field-picker {
    width: 100%;
    margin-left: 0;
  }

  .contract-field-menu {
    right: auto;
    left: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contract-field-menu section + section {
    border-left: 0;
  }

  .contract-field-menu section:nth-child(even) {
    border-left: 1px solid var(--line-subtle);
  }

  .contract-field-menu section:nth-child(n + 3) {
    border-top: 1px solid var(--line-subtle);
  }

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

@media (max-width: 760px) {
  .contract-settings-title,
  .document-library-title,
  .contract-editor-footer,
  .contract-budget-head,
  .contract-budget-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .contract-settings-title > .ghost-btn {
    width: 100%;
    min-width: 0;
  }

  .contract-first-access,
  .contract-copy-note,
  .contract-pending-note {
    margin-right: 14px;
    margin-left: 14px;
  }

  .contract-editor-frame {
    margin-right: 14px;
    margin-left: 14px;
  }

  .contract-editor-toolbar {
    align-items: stretch;
  }

  .contract-block-format,
  .contract-block-format select,
  .contract-field-toggle {
    width: 100%;
  }

  .contract-field-menu {
    width: calc(100vw - 64px);
    grid-template-columns: minmax(0, 1fr);
  }

  .contract-field-menu section + section {
    border-top: 1px solid var(--line-subtle);
    border-left: 0;
  }

  .contract-field-menu section:nth-child(even) {
    border-left: 0;
  }

  .contract-editor-paper {
    padding: 8px;
  }

  .contract-rich-editor {
    padding: 10mm;
    font-size: 13px;
  }

  .contract-budget-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .document-template-grid {
    padding-right: 14px;
    padding-left: 14px;
  }

  .document-template-card {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .document-template-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .document-library-empty,
  .document-template-name {
    margin-right: 14px;
    margin-left: 14px;
  }

  .proposal-document-picker,
  .proposal-document-picker > .ghost-btn {
    width: 100%;
    min-width: 0;
  }

  .proposal-document-menu {
    right: auto;
    left: 0;
    width: min(320px, calc(100vw - 56px));
  }
}

@media print {
  .contract-budget-head,
  .contract-copy-note,
  .contract-pending-note,
  .contract-editor-toolbar,
  .contract-budget-footer {
    display: none !important;
  }

  .contract-budget-workspace,
  .contract-editor-frame,
  .contract-editor-paper,
  .contract-rich-editor {
    display: block;
    width: 100%;
    max-width: none;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    overflow: visible;
    background: #fff;
    box-shadow: none;
  }

  .contract-rich-editor {
    aspect-ratio: auto;
    color: #000;
    caret-color: transparent;
    font-size: 11pt;
    line-height: 1.55;
  }

  .contract-rich-editor:focus {
    box-shadow: none;
  }

  .contract-page-break {
    height: 0;
    margin: 0;
    border: 0;
    break-after: page;
    page-break-after: always;
  }

  .contract-page-break span {
    display: none;
  }
}
