/* Estimates uses the shell's light/dark tokens throughout. */
.estimates-room {
  --wash: color-mix(in srgb, var(--cyan) 8%, transparent);
  min-width: 0;
  max-width: 100%;
}
.estimates-room .atlas-widgets {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  align-items: start;
}
.estimates-room .atlas-widgets-toolbar,
.estimates-room [data-atlas-widget='status'],
.estimates-room [data-atlas-widget='follow-up'] {
  grid-column: 1 / -1;
}
.estimates-room .atlas-widget {
  width: 100%;
  min-width: 0;
}
.est-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.estimates-room .est-chip {
  display: grid;
  gap: 5px;
  min-width: 125px;
  flex: 1;
  text-align: left;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface);
}
.est-chip strong {
  font-size: var(--type-xl);
  font-variant-numeric: tabular-nums;
}
.est-chip small {
  color: var(--gold);
}
.estimates-room .est-chip[aria-pressed='true'] {
  border-color: var(--cyan);
  background: var(--wash);
}
.est-list,
.est-editor {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  min-width: 0;
}
.est-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}
.est-table th {
  color: var(--muted);
  text-align: left;
  font-weight: 500;
}
.est-table th,
.est-table td {
  padding: 10px 6px;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
  vertical-align: top;
}
.est-table th:first-child {
  width: 27%;
}
.est-table tr[aria-selected='true'] {
  background: var(--wash);
}
.est-table tbody tr {
  cursor: pointer;
}
.est-table td small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}
.est-table .est-customer button {
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  color: var(--text);
  font-weight: 650;
  overflow-wrap: anywhere;
}
.est-value {
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.est-editor {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 140px);
  position: sticky;
  top: 16px;
}
.est-editor-head {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin: 12px 0;
}
.est-editor-head h3 {
  margin: 0;
  flex: 1 1 180px;
  overflow-wrap: anywhere;
}
.est-editor-head small {
  color: var(--muted);
}
.est-tabs {
  display: flex;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.est-tabs [aria-selected='true'] {
  color: var(--cyan);
  border-color: var(--cyan);
}
.est-editor-content {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0;
}
.est-editor-content > div {
  min-width: 0;
}
.est-option {
  padding: 12px;
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.est-option h4 {
  margin: 8px 0;
}
.est-option strong {
  color: var(--gold);
}
.est-option button {
  margin-right: 8px;
  margin-bottom: 6px;
}
.est-recommended {
  background: var(--wash);
  color: var(--cyan);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  font-size: 12px;
}
.est-terms,
.est-evidence {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.est-evidence {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.est-evidence a {
  color: var(--cyan);
}
.est-evidence-chip {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--wash);
  font-size: 12px;
}
.est-editor .est-totals {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  margin: 16px 0;
}
.est-editor .est-totals dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.est-approval-footer {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  max-height: 50dvh;
  overflow: auto;
}
.est-approval-footer .atlas-approval-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  background: var(--surface2);
}
.est-approval-footer .atlas-approval-card h3 {
  font-size: 15px;
  margin: 6px 0;
}
.atlas-approval-who {
  color: var(--muted);
  font-size: 12px;
}
.est-approval-footer .est-send {
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
}
.est-approval-footer .est-send h4 {
  margin: 6px 0;
}
.est-editor input,
.est-editor textarea,
.est-editor select {
  max-width: 100%;
}
.est-customer-preview {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface2);
  min-width: 0;
}
.est-customer-preview table {
  width: 100%;
  table-layout: fixed;
}
.est-customer-preview td,
.est-customer-preview th {
  overflow-wrap: anywhere;
}
.est-customer-preview .cd-totals {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}
.est-customer-preview a[aria-disabled='true'] {
  color: var(--muted);
  cursor: default;
}
.est-editor-empty {
  padding: 32px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
}
.est-editor {
  scroll-margin-top: 80px;
}
@media (max-width: 1200px) {
  .estimates-room .atlas-widgets {
    grid-template-columns: minmax(0, 1fr);
  }
  .est-editor {
    position: relative;
    top: auto;
    max-height: 85dvh;
  }
}
@media (max-width: 600px) {
  .est-list,
  .est-editor {
    padding: 12px;
  }
  .est-chips {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .estimates-room .est-chip {
    min-width: 0;
  }
  .est-table,
  .est-table tbody {
    display: block;
    width: 100%;
  }
  .est-table thead {
    display: none;
  }
  .est-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
  }
  .est-table td {
    display: block;
    border: 0;
    padding: 2px;
  }
  .est-table td:nth-child(n + 3) {
    grid-column: 1 / -1;
  }
  .est-table td:last-child::before {
    content: 'David’s next step: ';
    color: var(--muted);
  }
  .est-table td:last-child:empty {
    display: none;
  }
  .est-editor-content .room-table-wrap {
    overflow-x: auto;
  }
  .est-editor {
    max-height: 90dvh;
  }
  .est-approval-footer {
    max-height: 45dvh;
  }
  .est-approval-footer button {
    min-height: 44px;
  }
}

.est-tabs button,
.est-option button {
  font: inherit;
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
}
.est-tabs button:focus-visible,
.est-option button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.estimates-room .ur-primary {
  background: var(--cyan);
  color: var(--ink);
  border-color: var(--cyan);
}
