.estimate-launch-strip {
  align-items: center;
  background: linear-gradient(120deg, #17252a, #0f625d);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  color: #fff;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 12px 16px;
}

.estimate-launch-strip span {
  display: grid;
  gap: 2px;
}

.estimate-launch-strip strong {
  color: #ffffff;
  font-size: 1rem;
}

.estimate-launch-strip small {
  color: #d9f0ee;
}

html body#strongholdApp.command-map-theme:not(.login-active) #homeView .estimate-launch-strip strong,
html body#strongholdApp.command-map-theme:not(.login-active) #homeView .estimate-launch-strip small {
  color: #ffffff !important;
  opacity: 1;
}

html body#strongholdApp.command-map-theme:not(.login-active) #homeView .estimate-launch-strip small {
  color: #d9f0ee !important;
}

.estimate-launch-strip button {
  background: #f07b16;
  color: #fff;
  white-space: nowrap;
}

html body#strongholdApp.command-map-theme:not(.login-active) #homeView .command-estimate-list > button {
  align-items: start !important;
  min-height: 64px !important;
}

html body#strongholdApp.command-map-theme:not(.login-active) #homeView .command-estimate-list > button > i.estimate {
  background: var(--cm-blue);
  margin-top: 5px;
}

html body#strongholdApp.command-map-theme:not(.login-active) #homeView .command-estimate-list > button > span {
  min-width: 0;
}

html body#strongholdApp.command-map-theme:not(.login-active) #homeView .command-estimate-list strong,
html body#strongholdApp.command-map-theme:not(.login-active) #homeView .command-estimate-list small {
  line-height: 1.3;
  overflow-wrap: anywhere;
  white-space: normal;
}

html body#strongholdApp.command-map-theme:not(.login-active) #homeView .command-estimate-list small + small {
  color: #6d7b80;
}

html body#strongholdApp.command-map-theme:not(.login-active) #homeView .command-estimate-view-all {
  background: transparent !important;
  border: 0 !important;
  color: var(--cm-blue) !important;
  font-size: .68rem;
  min-height: 30px !important;
  padding: 7px 2px 0 !important;
  text-align: left;
}

@media (max-width: 1180px) and (min-width: 761px) {
  html body#strongholdApp.command-map-theme:not(.login-active) #homeView .command-intelligence-rail > .command-estimate-section {
    grid-column: 3;
  }
}

.estimate-shell {
  display: grid;
  gap: 14px;
  grid-template-columns: 260px minmax(0, 1fr);
}

.estimate-sidebar,
.estimate-editor,
.estimate-summary-card {
  background: #fff;
  border: 1px solid #cbd6d8;
  border-radius: 10px;
  box-shadow: 0 5px 18px rgba(25, 45, 50, 0.07);
}

.estimate-sidebar {
  align-self: start;
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 150px);
  overflow: auto;
  padding: 12px;
  position: sticky;
  top: 96px;
}

.estimate-sidebar-head {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.estimate-sidebar-head h3 {
  margin: 0;
}

.estimate-list {
  display: grid;
  gap: 7px;
}

.estimate-list-item {
  background: #f3f7f7;
  border: 1px solid transparent;
  color: #263334;
  display: grid;
  gap: 3px;
  padding: 10px;
  text-align: left;
}

.estimate-list-item.active {
  background: #e2f2ef;
  border-color: #0f7f76;
}

.estimate-list-item small {
  color: #657374;
}

.estimate-editor {
  min-width: 0;
  padding: 16px;
}

.estimate-editor-head {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.estimate-editor-head h2,
.estimate-editor-head p {
  margin: 0;
}

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

.estimate-workspace {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) 290px;
}

.estimate-form {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.estimate-section {
  background: #f8faf9;
  border: 1px solid #d8e1e2;
  border-radius: 8px;
  padding: 14px;
}

.estimate-section > h3 {
  color: #203133;
  font-size: 1rem;
  margin: 0 0 10px;
}

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

.estimate-field-grid.system {
  grid-template-columns: repeat(3, minmax(150px, 1fr));
}

.estimate-field-grid.costs {
  grid-template-columns: repeat(3, minmax(135px, 1fr));
}

.estimate-section label {
  color: #465657;
  display: grid;
  font-size: 0.78rem;
  gap: 4px;
}

.estimate-section input,
.estimate-section select,
.estimate-section textarea {
  background: #fff;
  border: 1px solid #bdc9cb;
  border-radius: 6px;
  box-sizing: border-box;
  min-height: 38px;
  width: 100%;
}

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

.estimate-notes-grid textarea {
  min-height: 130px;
  resize: vertical;
}

.estimate-material-picker {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(220px, 1fr) auto;
  margin-bottom: 10px;
  position: relative;
}

.estimate-catalog-results {
  background: #fff;
  border: 1px solid #bcc9ca;
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(20, 40, 44, 0.14);
  display: grid;
  left: 0;
  max-height: 280px;
  overflow: auto;
  position: absolute;
  right: 90px;
  top: 64px;
  z-index: 15;
}

.estimate-catalog-results[hidden] {
  display: none;
}

.estimate-catalog-results button {
  background: #fff;
  border: 0;
  border-bottom: 1px solid #edf1f1;
  border-radius: 0;
  color: #263334;
  display: grid;
  gap: 2px;
  padding: 9px 11px;
  text-align: left;
}

.estimate-catalog-results button:hover {
  background: #edf7f5;
}

.estimate-material-table {
  min-width: 760px;
}

.estimate-material-table input {
  min-width: 78px;
}

.estimate-material-table .material-description {
  min-width: 240px;
}

.estimate-summary-card {
  align-self: start;
  display: grid;
  gap: 10px;
  padding: 14px;
  position: sticky;
  top: 96px;
}

.estimate-summary-card h3 {
  margin: 0;
}

.estimate-summary-list {
  display: grid;
  gap: 7px;
  margin: 0;
}

.estimate-summary-list div {
  align-items: center;
  border-bottom: 1px solid #e1e7e7;
  display: flex;
  justify-content: space-between;
  padding-bottom: 7px;
}

.estimate-summary-list dt {
  color: #5a6869;
}

.estimate-summary-list dd {
  font-weight: 700;
  margin: 0;
}

.estimate-summary-list .estimate-total {
  border: 0;
  color: #0f6b64;
  font-size: 1.05rem;
  padding-top: 4px;
}

.estimate-summary-list .estimate-margin-low dd {
  color: #bd3f33;
}

.estimate-access-denied {
  margin: 24px auto;
  max-width: 620px;
  padding: 28px;
  text-align: center;
}

@media (max-width: 1180px) {
  .estimate-shell,
  .estimate-workspace {
    grid-template-columns: 1fr;
  }

  .estimate-sidebar,
  .estimate-summary-card {
    max-height: none;
    position: static;
  }

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

@media (max-width: 760px) {
  .estimate-launch-strip,
  .estimate-editor-head {
    align-items: stretch;
    flex-direction: column;
  }

  .estimate-field-grid,
  .estimate-field-grid.system,
  .estimate-field-grid.costs,
  .estimate-notes-grid,
  .estimate-list {
    grid-template-columns: 1fr;
  }

  .estimate-material-picker {
    grid-template-columns: 1fr;
  }

  .estimate-catalog-results {
    right: 0;
    top: 66px;
  }
}

/* Workbook-native estimator */
.estimate-workbook-heading {
  align-items: end;
  margin-bottom: 14px;
}

.estimate-workbook-heading h2 {
  margin-bottom: 3px;
}

.estimate-workbook-heading p:last-child {
  color: #5a6869;
  margin: 0;
}

.estimate-workbook-shell {
  grid-template-columns: 255px minmax(0, 1fr);
  min-height: calc(100vh - 235px);
}

.estimate-workbook-editor {
  min-width: 0;
  overflow: hidden;
  padding: 0;
}

.estimate-workbook-toolbar {
  align-items: end;
  background: #fff;
  border-bottom: 1px solid #d8e1e1;
  display: grid;
  gap: 10px 14px;
  grid-template-columns: minmax(220px, 1fr) minmax(240px, 1.1fr) auto;
  padding: 13px 15px 11px;
}

.estimate-workbook-toolbar label {
  color: #536263;
  display: grid;
  font-size: .76rem;
  font-weight: 700;
  gap: 5px;
  letter-spacing: .025em;
  margin: 0;
  text-transform: uppercase;
}

.estimate-workbook-toolbar input,
.estimate-workbook-toolbar select {
  margin: 0;
  min-height: 40px;
}

.estimate-workbook-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.estimate-workbook-actions button {
  min-height: 40px;
  white-space: nowrap;
}

.estimate-workbook-save-state {
  align-items: center;
  color: #536263;
  display: flex;
  font-size: .78rem;
  gap: 7px;
  grid-column: 1 / -1;
}

.estimate-workbook-save-state strong {
  color: inherit;
  font-size: inherit;
  font-weight: 700;
}

.estimate-workbook-save-state span {
  background: #20a076;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(32, 160, 118, .14);
  height: 7px;
  width: 7px;
}

.estimate-workbook-save-state.saving span {
  animation: estimate-save-pulse 1s ease-in-out infinite;
  background: #2376cf;
}

.estimate-workbook-save-state.warning {
  color: #8a5500;
}

.estimate-workbook-save-state.warning span {
  background: #f0a11d;
  box-shadow: 0 0 0 3px rgba(240, 161, 29, .16);
}

.estimate-workbook-save-state.error {
  color: #9b2f28;
}

.estimate-workbook-save-state.error span {
  background: #c94137;
  box-shadow: 0 0 0 3px rgba(201, 65, 55, .15);
}

.estimate-session-warning {
  align-items: center;
  background: #fff5dc;
  border-bottom: 1px solid #e4bd5e;
  color: #704600;
  display: flex;
  flex: 0 0 auto;
  gap: 14px;
  justify-content: space-between;
  padding: 9px 12px;
  position: relative;
  z-index: 2;
}

.estimate-session-warning[hidden] {
  display: none;
}

.estimate-session-warning > span {
  display: grid;
  gap: 2px;
}

.estimate-session-warning strong {
  color: #704600;
  font-size: .82rem;
}

.estimate-session-warning small {
  color: #815814;
  line-height: 1.35;
}

.estimate-session-warning button {
  background: #8a5a05 !important;
  border-color: #8a5a05 !important;
  color: #fff !important;
  flex: 0 0 auto;
  min-height: 34px !important;
  white-space: nowrap;
}

@keyframes estimate-save-pulse {
  50% {
    opacity: .42;
    transform: scale(.78);
  }
}

.estimate-workbook-host {
  background: #e8eeee;
  height: calc(100vh - 375px);
  min-height: 680px;
  position: relative;
}

.estimate-workbook-frame {
  background: #fff;
  border: 0;
  display: block;
  height: 100%;
  width: 100%;
}

.estimate-workbook-loading,
.estimate-workbook-error,
.estimate-workbook-empty,
.estimate-workbook-starting {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 420px;
  padding: 32px;
  text-align: center;
}

.estimate-workbook-loading small,
.estimate-workbook-error p,
.estimate-workbook-empty p {
  color: #5a6869;
  max-width: 640px;
}

.estimate-workbook-loading .spinner {
  animation: estimate-workbook-spin .8s linear infinite;
  border: 3px solid #cbd6d6;
  border-radius: 50%;
  border-top-color: #0f6b64;
  height: 30px;
  margin-bottom: 15px;
  width: 30px;
}

.estimate-workbook-empty h2 {
  margin: 4px 0 8px;
}

.estimate-workbook-empty button,
.estimate-workbook-error button {
  margin-top: 10px;
}

/* Dedicated workbook tab */
html:has(body.estimate-fullscreen-mode:not(.login-active)),
html body#strongholdApp#strongholdApp.estimate-fullscreen-mode:not(.login-active) {
  height: 100%;
  max-height: 100%;
  overflow: hidden !important;
  overscroll-behavior: none;
}

html body#strongholdApp#strongholdApp.estimate-fullscreen-mode:not(.login-active) > .app-header,
html body#strongholdApp#strongholdApp.estimate-fullscreen-mode:not(.login-active) .app-shell > .sidebar,
html body#strongholdApp#strongholdApp.estimate-fullscreen-mode:not(.login-active) .workspace-topbar,
html body#strongholdApp#strongholdApp.estimate-fullscreen-mode:not(.login-active) #chatLauncherRoot {
  display: none !important;
}

html body#strongholdApp#strongholdApp.estimate-fullscreen-mode:not(.login-active) .app-shell {
  display: block !important;
  height: 100vh !important;
  height: 100dvh !important;
  inset: 0;
  min-height: 0 !important;
  overflow: hidden !important;
  position: fixed;
  width: 100vw;
}

html body#strongholdApp#strongholdApp.estimate-fullscreen-mode:not(.login-active) .app-shell .workspace {
  height: 100% !important;
  margin: 0 !important;
  max-width: none !important;
  min-height: 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
  width: 100% !important;
}

html body#strongholdApp#strongholdApp.estimate-fullscreen-mode:not(.login-active) .workspace > .view {
  display: none !important;
}

html body#strongholdApp#strongholdApp.estimate-fullscreen-mode:not(.login-active) .workspace > #estimateBuilderView.active {
  display: block !important;
  height: 100% !important;
  margin: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
  transform: none !important;
}

html body#strongholdApp#strongholdApp.estimate-fullscreen-mode:not(.login-active) #estimateBuilderContent,
.estimate-fullscreen-workspace {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.estimate-fullscreen-workspace {
  background: #e8eeee;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.estimate-fullscreen-toolbar {
  align-items: end;
  background: #fff;
  border-bottom: 1px solid #cbd6d8;
  box-shadow: 0 2px 8px rgba(20, 42, 46, .09);
  display: grid;
  flex: 0 0 auto;
  gap: 7px 10px;
  grid-template-columns: auto minmax(170px, .65fr) minmax(220px, .9fr) auto auto;
  padding: 8px 10px;
  position: relative;
  z-index: 2;
}

.estimate-mobile-toolbar-toggle {
  display: none;
}

.estimate-fullscreen-toolbar label {
  color: #536263;
  display: grid;
  font-size: .68rem;
  font-weight: 700;
  gap: 3px;
  letter-spacing: .025em;
  margin: 0;
  text-transform: uppercase;
}

.estimate-fullscreen-toolbar input,
.estimate-fullscreen-toolbar select,
.estimate-fullscreen-toolbar button {
  margin: 0;
  min-height: 34px !important;
}

.estimate-fullscreen-toolbar .estimate-workbook-actions {
  flex-wrap: nowrap;
}

.estimate-fullscreen-toolbar .estimate-workbook-actions button {
  min-height: 34px;
  padding: 7px 10px;
}

.estimate-fullscreen-toolbar .estimate-workbook-save-state {
  grid-column: auto;
  white-space: nowrap;
}

.estimate-fullscreen-close {
  align-self: end;
  white-space: nowrap;
}

.estimate-fullscreen-host {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  overflow: hidden;
}

.estimate-fullscreen-host .estimate-workbook-loading,
.estimate-fullscreen-host .estimate-workbook-error {
  height: 100%;
  min-height: 0;
}

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

@media (max-width: 1420px) {
  .estimate-workbook-toolbar {
    grid-template-columns: minmax(200px, 1fr) minmax(220px, 1fr);
  }

  .estimate-workbook-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .estimate-fullscreen-toolbar {
    grid-template-columns: auto minmax(170px, .65fr) minmax(200px, .9fr);
  }

  .estimate-fullscreen-toolbar .estimate-workbook-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .estimate-fullscreen-toolbar .estimate-workbook-save-state {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }
}

@media (max-width: 1100px) {
  .estimate-fullscreen-toolbar {
    grid-template-columns: auto minmax(170px, .7fr) minmax(220px, 1fr);
  }

  .estimate-fullscreen-toolbar .estimate-workbook-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .estimate-fullscreen-toolbar .estimate-workbook-save-state {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }
}

@media (max-width: 1180px) {
  .estimate-workbook-shell {
    grid-template-columns: 1fr;
  }

  .estimate-workbook-shell .estimate-sidebar {
    max-height: 240px;
  }

  .estimate-workbook-host {
    height: 76vh;
    min-height: 620px;
  }

  .estimate-fullscreen-host {
    height: auto;
    min-height: 0;
  }
}

@media (max-width: 760px) {
  .estimate-workbook-toolbar {
    grid-template-columns: 1fr;
  }

  .estimate-workbook-actions,
  .estimate-workbook-save-state {
    grid-column: 1;
  }

  .estimate-workbook-actions {
    align-items: stretch;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .estimate-workbook-actions button {
    white-space: normal;
  }

  .estimate-workbook-host {
    height: 72vh;
    min-height: 520px;
  }

  .estimate-fullscreen-toolbar {
    align-items: stretch;
    grid-template-columns: 1fr;
    max-height: 42vh;
    overflow: auto;
  }

  .estimate-mobile-toolbar-toggle {
    align-items: center;
    background: #eef5f4;
    border: 1px solid #afc5c2;
    color: #154f4a;
    display: flex;
    font-weight: 800;
    grid-column: 1;
    justify-content: space-between;
    min-height: 38px !important;
    padding: 7px 11px;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 3;
  }

  .estimate-mobile-toolbar-chevron {
    align-items: center;
    display: inline-flex;
    font-size: 1rem;
    height: 20px;
    justify-content: center;
    width: 20px;
  }

  .estimate-fullscreen-toolbar.mobile-collapsed {
    align-items: stretch;
    display: flex;
    max-height: none;
    overflow: visible;
    padding: 6px 8px;
  }

  .estimate-fullscreen-toolbar.mobile-collapsed > :not(.estimate-mobile-toolbar-toggle) {
    display: none !important;
  }

  .estimate-fullscreen-toolbar .estimate-workbook-actions,
  .estimate-fullscreen-toolbar .estimate-workbook-save-state {
    grid-column: 1;
    grid-row: auto;
    justify-self: stretch;
  }

  .estimate-fullscreen-toolbar .estimate-workbook-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .estimate-fullscreen-host {
    height: auto;
    min-height: 0;
  }

  .estimate-session-warning {
    align-items: stretch;
    flex-direction: column;
  }

  .estimate-session-warning button {
    width: 100%;
  }
}

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

.estimate-type-dialog-panel {
  width: 100%;
  max-width: none;
}

.estimate-type-dialog-panel h2 {
  margin: 0.25rem 0 0.5rem;
}

.estimate-type-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.estimate-type-option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-height: 150px;
  padding: 22px;
  border: 1px solid #c8d7dd;
  border-radius: 16px;
  background: #f7fafb;
  color: #173136;
  text-align: left;
  box-shadow: none;
}

.estimate-type-option:hover,
.estimate-type-option:focus-visible {
  border-color: #087e8b;
  background: #eef8f8;
  transform: translateY(-1px);
}

.estimate-type-option:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none;
}

.estimate-type-option > span:last-child {
  display: grid;
  gap: 8px;
}

.estimate-type-option strong {
  font-size: 1.05rem;
  color: #173136;
}

.estimate-type-option small {
  color: #526b70;
  font-size: 0.9rem;
  line-height: 1.45;
}

.estimate-type-icon {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  background: #0b6670;
  color: #fff;
  font-weight: 800;
}

.estimate-type-option.service .estimate-type-icon {
  background: #176b45;
}

.estimate-type-dialog .dialog-panel .estimate-type-option {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: auto;
  min-height: 150px;
  padding: 22px;
  white-space: normal;
  overflow: hidden;
}

.estimate-type-dialog .estimate-type-option > span:last-child {
  min-width: 0;
}

.estimate-type-dialog .estimate-type-option strong,
.estimate-type-dialog .estimate-type-option small {
  display: block;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 620px) {
  .estimate-type-options {
    grid-template-columns: 1fr;
  }

  .estimate-type-dialog .dialog-panel .estimate-type-option {
    min-height: 0;
  }
}

@media (max-width: 1100px), (pointer: coarse) {
  .estimate-fullscreen-workspace .estimate-fullscreen-toolbar {
    align-items: stretch;
    grid-template-columns: 1fr;
    max-height: min(42dvh, 360px);
    overflow: auto;
  }

  .estimate-fullscreen-workspace .estimate-mobile-toolbar-toggle {
    align-items: center;
    background: #eef5f4;
    border: 1px solid #afc5c2;
    color: #154f4a;
    display: flex !important;
    font-weight: 800;
    grid-column: 1;
    justify-content: space-between;
    min-height: 40px !important;
    padding: 8px 12px;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 50;
  }

  .estimate-fullscreen-workspace .estimate-fullscreen-toolbar.mobile-collapsed {
    align-items: stretch;
    display: flex;
    max-height: none;
    overflow: visible;
    padding: 6px 8px;
  }

  .estimate-fullscreen-workspace .estimate-fullscreen-toolbar.mobile-collapsed > :not(.estimate-mobile-toolbar-toggle) {
    display: none !important;
  }

  .estimate-fullscreen-workspace .estimate-fullscreen-toolbar .estimate-workbook-actions,
  .estimate-fullscreen-workspace .estimate-fullscreen-toolbar .estimate-workbook-save-state {
    grid-column: 1;
    grid-row: auto;
    justify-self: stretch;
  }

  .estimate-fullscreen-workspace .estimate-fullscreen-toolbar .estimate-workbook-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Native service estimating */
.service-estimate-fullscreen {
  overflow: auto;
  background: #e8edef;
}

.service-estimate-fullscreen .estimate-fullscreen-toolbar {
  position: sticky;
  top: 0;
  z-index: 40;
}

.service-estimator {
  display: grid;
  gap: 18px;
  width: min(1560px, calc(100% - 32px));
  margin: 16px auto 28px;
  color: #17282a;
}

.service-estimator-title,
.service-estimator-job-grid,
.service-estimator-sheet,
.service-estimator-labor,
.service-estimator-pricing {
  border: 1px solid #c8d2d4;
  background: #fff;
  box-shadow: 0 10px 26px rgba(31, 48, 51, 0.08);
}

.service-estimator-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  border-top: 6px solid #0c6b47;
}

.service-estimator-title h1,
.service-estimator-sheet h2,
.service-estimator-labor h2,
.service-estimator-pricing h2 {
  margin: 2px 0 0;
  color: #17282a;
}

.service-estimator input,
.service-estimator textarea {
  width: 100%;
  border: 1px solid #b9c5c7;
  border-radius: 5px;
  background: #fff;
  color: #182729;
  font: inherit;
}

.service-estimator-job-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
}

.service-estimator-job-grid label {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border-right: 1px solid #d4dddf;
  border-bottom: 1px solid #d4dddf;
  color: #536467;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.service-estimator-job-grid input,
.service-estimator-job-grid textarea {
  min-height: 38px;
  padding: 7px 9px;
  text-transform: none;
  letter-spacing: normal;
}

.service-estimator-job-grid .service-estimator-notes {
  grid-column: span 3;
}

.service-estimator-sheet,
.service-estimator-labor,
.service-estimator-pricing {
  padding: 18px;
}

.service-estimator-sheet > header,
.service-estimator-labor > header,
.service-estimator-pricing > header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.service-estimator-sheet > header small {
  display: block;
  margin-top: 4px;
  color: #637376;
}

.service-estimate-material-head,
.service-estimate-material-row {
  display: grid;
  grid-template-columns: 76px minmax(260px, 2fr) 132px 90px 122px 118px 40px;
  gap: 0;
  align-items: stretch;
}

.service-estimate-material-head {
  background: #0b6946;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.service-estimate-material-head span {
  padding: 9px 8px;
  border-right: 1px solid rgba(255, 255, 255, 0.22);
}

.service-estimate-material-row {
  border-right: 1px solid #b9c5c7;
  border-bottom: 1px solid #b9c5c7;
  border-left: 1px solid #b9c5c7;
  background: #fdfcf3;
}

.service-material-field {
  min-width: 0;
}

.service-material-field-label,
.service-material-remove-label {
  display: none;
}

.service-material-field > input,
.service-material-combobox > input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 7px 8px;
  border: 0;
  border-right: 1px solid #c8d1d3;
  border-radius: 0;
  background: transparent;
}

.service-material-field > input:focus,
.service-material-combobox > input:focus {
  position: relative;
  z-index: 2;
  outline: 2px solid #168a92;
  outline-offset: -2px;
  background: #fff;
}

.service-estimate-material-row output {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 7px 10px;
  border-right: 1px solid #c8d1d3;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

.service-material-combobox {
  display: grid;
  position: relative;
  min-width: 0;
}

.service-material-combobox > input {
  height: 100%;
}

.service-material-total-field {
  display: flex;
  min-width: 0;
}

.service-material-suggestions {
  position: absolute;
  top: calc(100% + 3px);
  right: -300px;
  left: 0;
  z-index: 70;
  max-height: min(430px, 58vh);
  overflow: auto;
  border: 1px solid #aebdc0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(19, 38, 41, 0.22);
}

.service-material-suggestions[hidden] {
  display: none;
}

.service-material-suggestions button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #e1e7e8;
  border-radius: 0;
  background: #fff;
  color: #1e3134;
  text-align: left;
}

.service-material-suggestions button:hover,
.service-material-suggestions button:focus-visible {
  background: #eaf6f4;
  color: #143235;
}

.service-material-suggestions button span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.service-material-suggestions button span:last-child {
  justify-items: end;
}

.service-material-suggestions small {
  overflow: hidden;
  color: #657578;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-material-no-match {
  padding: 14px;
  color: #647477;
  line-height: 1.45;
}

.service-material-remove {
  width: 100%;
  min-height: 42px;
  padding: 0;
  border: 0;
  border-radius: 0;
  font-size: 1.25rem;
}

html body:not(.login-active) .service-estimate-material-row .service-material-save,
html body:not(.login-active) .service-estimate-material-row .service-material-condensed {
  display: none !important;
}

.service-estimator-subtotal,
.service-estimator-total {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 28px;
  min-height: 45px;
  padding: 9px 14px;
  border: 1px solid #b9c5c7;
  border-top: 0;
  background: #f1e5a4;
  font-variant-numeric: tabular-nums;
}

.service-estimator-subtotal strong,
.service-estimator-total strong {
  min-width: 120px;
  text-align: right;
}

.service-estimator-bottom {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(440px, 1.1fr);
  gap: 18px;
  align-items: start;
}

.service-labor-head,
.service-labor-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 110px 130px 130px;
  align-items: center;
}

.service-labor-head {
  background: #0b6946;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.service-labor-head span,
.service-labor-row > * {
  min-height: 42px;
  padding: 9px 10px;
  border-right: 1px solid #c8d1d3;
  border-bottom: 1px solid #c8d1d3;
}

.service-labor-row {
  border-left: 1px solid #c8d1d3;
  background: #fdfcf3;
}

.service-labor-row input {
  border: 0;
  border-radius: 0;
}

.service-labor-row b {
  text-align: right;
}

.service-estimator-total {
  margin-top: 10px;
  border: 0;
  background: #0b6946;
  color: #fff;
  font-size: 1.08rem;
}

.service-sell-options {
  display: grid;
  gap: 8px;
}

.service-sell-option {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid #c7d1d3;
  border-radius: 7px;
  background: #fafbf8;
  cursor: pointer;
}

.service-sell-option.selected {
  border-color: #0b6946;
  background: #e7f3ec;
  box-shadow: inset 4px 0 #0b6946;
}

.service-sell-option span {
  display: grid;
  gap: 3px;
}

.service-sell-option small {
  color: #667679;
}

.service-sell-option b {
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.service-custom-gpm-control {
  display: flex !important;
  align-items: center;
  gap: 5px;
}

.service-custom-gpm-control input {
  width: 82px;
  min-height: 32px;
  padding: 4px 7px;
  border: 1px solid #9fb4ae;
  background: #fff;
  font-weight: 800;
}

.service-custom-gpm-control b {
  color: #385b4e;
  font-size: 0.82rem;
}

.service-selected-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 12px;
  padding: 16px;
  border-radius: 8px;
  background: #0b6946;
  color: #fff;
}

.service-selected-price strong {
  font-size: 1.4rem;
  font-variant-numeric: tabular-nums;
}

.service-proposal-dialog {
  width: min(620px, calc(100vw - 28px));
}

.service-proposal-dialog-panel {
  display: grid;
  gap: 14px;
}

.service-proposal-dialog-panel h2,
.service-proposal-dialog-panel p {
  margin: 0;
}

.service-proposal-option-list {
  display: grid;
  gap: 10px;
}

.service-proposal-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid #c6d5d1;
  border-radius: 8px;
  background: #f7faf8;
  cursor: pointer;
}

.service-proposal-option:has(input:checked) {
  border-color: #0b6946;
  background: #e7f3ec;
  box-shadow: inset 4px 0 #0b6946;
}

.service-proposal-option input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
}

.service-proposal-option span {
  display: grid;
  gap: 4px;
}

.service-proposal-option strong {
  color: #173d31;
}

.service-proposal-option small,
.service-proposal-total-note {
  color: #5f706c;
  line-height: 1.45;
}

.service-proposal-total-note {
  padding: 10px 12px;
  border-left: 4px solid #0b6946;
  background: #edf5f1;
  font-size: 0.84rem;
}

@media (max-width: 1050px) {
  .service-estimator {
    width: min(100% - 20px, 900px);
  }

  .service-estimator-title {
    align-items: stretch;
    flex-direction: column;
  }

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

  .service-estimator-job-grid .service-estimator-notes {
    grid-column: span 2;
  }

  .service-estimator-bottom {
    grid-template-columns: 1fr;
  }

  .service-estimate-material-head {
    display: none;
  }

  .service-estimate-material-lines {
    display: grid;
    gap: 12px;
  }

  .service-estimate-material-row {
    grid-template-columns: 90px minmax(0, 1fr) 110px 42px;
    border-top: 5px solid #0b6946;
  }

  .service-material-quantity {
    grid-column: 1;
  }

  .service-material-combobox {
    grid-column: 2 / 4;
  }

  .service-material-number {
    grid-column: 1 / 2;
  }

  .service-material-unit {
    grid-column: 2 / 3;
  }

  .service-material-price {
    grid-column: 3 / 4;
  }

  .service-material-total-field {
    grid-column: 1 / 4;
  }

  .service-estimate-material-row output {
    justify-content: flex-end;
    min-height: 42px;
  }

  .service-material-remove {
    grid-column: 4;
    grid-row: 1 / 4;
  }

  .service-material-suggestions {
    right: 0;
  }
}

@media (max-width: 620px) {
  .service-estimator {
    width: calc(100% - 12px);
    margin-top: 6px;
  }

  .service-estimator-title,
  .service-estimator-sheet,
  .service-estimator-labor,
  .service-estimator-pricing {
    padding: 13px;
  }

  .service-estimator-job-grid {
    grid-template-columns: 1fr;
  }

  .service-estimator-job-grid .service-estimator-notes {
    grid-column: 1;
  }

  .service-estimator-sheet > header {
    align-items: stretch;
    flex-direction: column;
  }

  .service-estimator-sheet > header button {
    width: 100%;
  }

  .service-estimate-material-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
    gap: 9px;
    padding: 11px;
    border: 1px solid #afbec0;
    border-top: 5px solid #0b6946;
    border-radius: 9px;
    background: #f8fbfa;
    box-shadow: 0 5px 14px rgba(19, 44, 47, 0.08);
  }

  .service-material-field {
    align-content: start;
    display: grid;
    gap: 4px;
  }

  .service-material-field-label {
    display: block;
    color: #536467;
    font-size: 0.67rem;
    font-weight: 800;
    letter-spacing: 0.045em;
    line-height: 1.2;
    text-transform: uppercase;
  }

  .service-material-field > input,
  .service-material-combobox > input {
    min-height: 44px;
    padding: 8px 9px;
    border: 1px solid #b8c6c8;
    border-radius: 7px;
    background: #fff;
  }

  .service-material-description {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .service-material-quantity {
    grid-column: 1;
    grid-row: 2;
  }

  .service-material-unit {
    grid-column: 2;
    grid-row: 2;
  }

  .service-material-number {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .service-material-price {
    grid-column: 1;
    grid-row: 4;
  }

  .service-material-total-field {
    grid-column: 2;
    grid-row: 4;
  }

  .service-material-total-field output {
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid #b8c6c8;
    border-radius: 7px;
    background: #edf5f1;
  }

  .service-material-remove {
    grid-column: 1;
    grid-row: 5;
    gap: 7px;
    width: 100%;
    min-height: 40px;
    border: 1px solid #d9a7a0;
    border-radius: 7px;
  }

  html body:not(.login-active) .service-estimate-material-row .service-material-save {
    display: inline-flex !important;
    grid-column: 2;
    grid-row: 5;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 0 10px;
    border: 1px solid #176b4c;
    border-radius: 7px;
    background: #176b4c;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
  }

  .service-material-condensed {
    width: 100%;
    min-width: 0;
    min-height: 74px;
    padding: 10px 12px;
    border: 0;
    border-radius: 7px;
    background: #f8fbfa;
    box-shadow: none;
    color: #193337;
    text-align: left;
  }

  html body:not(.login-active) .service-estimate-material-row:not(.is-collapsed) .service-material-condensed {
    display: none !important;
  }

  .service-estimate-material-row.is-collapsed {
    display: block;
    padding: 0;
    overflow: hidden;
    border-top-width: 5px;
    background: #f8fbfa;
  }

  .service-estimate-material-row.is-collapsed > :not(.service-material-condensed) {
    display: none !important;
  }

  html body:not(.login-active) .service-estimate-material-row.is-collapsed .service-material-save {
    display: none !important;
  }

  html body:not(.login-active) .service-estimate-material-row.is-collapsed .service-material-condensed {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 11px;
  }

  .service-material-condensed-copy,
  .service-material-condensed-total {
    display: grid;
    gap: 2px;
    min-width: 0;
  }

  .service-material-condensed-copy strong {
    overflow: hidden;
    color: #173438;
    font-size: 0.9rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .service-material-condensed-copy small {
    color: #5d6e71;
    font-size: 0.73rem;
    font-weight: 750;
    text-transform: uppercase;
  }

  .service-material-condensed-total {
    justify-items: end;
  }

  .service-material-condensed-total small {
    color: #657679;
    font-size: 0.61rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
  }

  .service-material-condensed-total strong {
    color: #0c6547;
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
  }

  .service-material-condensed-edit {
    padding: 5px 7px;
    border: 1px solid #a9babc;
    border-radius: 999px;
    background: #fff;
    color: #355054;
    font-size: 0.65rem;
    font-weight: 850;
    text-transform: uppercase;
  }

  .service-material-remove-label {
    display: inline;
    font-size: 0.78rem;
    font-weight: 800;
  }

  .service-material-suggestions {
    top: calc(100% + 5px);
    right: 0;
    left: 0;
    width: 100%;
    max-height: min(360px, 48dvh);
  }

  .service-material-suggestions button {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
    min-height: 56px;
  }

  .service-material-suggestions button span:last-child {
    grid-auto-flow: column;
    justify-content: space-between;
    justify-items: start;
  }

  .service-material-suggestions small {
    white-space: normal;
  }

  .service-labor-head,
  .service-labor-row {
    grid-template-columns: 1fr 88px 112px;
  }

  .service-labor-head span:nth-child(3),
  .service-labor-row > :nth-child(3) {
    display: none;
  }
}

.service-estimator-repair-scope {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin: 12px 0 0;
  padding: 12px 16px;
  border: 1px solid #aad2d5;
  border-left: 6px solid #168c94;
  border-radius: 9px;
  background: #edf7f7;
}

.service-estimator-repair-scope span,
.service-estimator-repair-scope strong,
.service-estimator-repair-scope small {
  display: block;
}

.service-estimator-repair-pricing {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid #b7c9cd;
  border-radius: 9px;
  background: #f6f8f8;
}

.service-estimator-repair-pricing > header { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 13px; }
.service-estimator-repair-pricing h2 { margin: 2px 0; color: #17383f; font-size: 1.18rem; }
.service-estimator-repair-pricing header small { color: #61767d; }
.service-repair-adjustment-list { display: grid; gap: 11px; }
.service-repair-adjustment { padding: 14px; border: 1px solid #c5d2d5; border-left: 4px solid #257b82; border-radius: 7px; background: #fff; }
.service-repair-adjustment > header { display: flex; justify-content: space-between; gap: 18px; align-items: start; margin-bottom: 13px; }
.service-repair-adjustment > header span, .service-repair-adjustment > header strong, .service-repair-adjustment > header small { display: block; }
.service-repair-adjustment > header span { color: #60777e; font-size: 0.68rem; font-weight: 850; letter-spacing: 0.05em; text-transform: uppercase; }
.service-repair-adjustment > header strong { margin-top: 2px; color: #18383f; }
.service-repair-adjustment > header small { margin-top: 3px; color: #64787e; }
.service-repair-adjusted-price { min-width: 130px; text-align: right; }
.service-repair-adjusted-price strong { color: #126b52 !important; font-size: 1.18rem; }
.service-repair-modifier-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.service-repair-modifier-grid label { display: grid; gap: 7px; min-width: 0; }
.service-repair-modifier-grid label > span { display: flex; justify-content: space-between; gap: 12px; color: #29464d; font-size: 0.78rem; }
.service-repair-modifier-grid output { color: #126b52; font-weight: 800; text-align: right; }
.service-repair-modifier-grid input[type="range"] { width: 100%; min-height: 24px; padding: 0; accent-color: #227980; }
.service-repair-modifier-grid small { color: #718288; font-size: 0.72rem; }
.service-estimator-repair-pricing > .service-estimator-subtotal { margin-top: 13px; }

.service-estimator-repair-scope span {
  color: #4b6f76;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.service-estimator-repair-scope strong {
  margin-top: 3px;
  color: #123940;
}

.service-estimator-repair-scope small {
  margin-top: 2px;
  color: #5d747b;
}

@media (max-width: 720px) {
  .service-estimator-repair-scope {
    align-items: stretch;
    flex-direction: column;
  }

  .service-estimator-repair-pricing { padding: 12px; }
  .service-repair-adjustment > header { flex-direction: column; }
  .service-repair-adjusted-price { text-align: left; }
  .service-repair-modifier-grid { grid-template-columns: 1fr; }
}
