.login-body,
.product-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 14% 8%, rgba(235, 107, 23, 0.12), transparent 24%),
    radial-gradient(circle at 88% 18%, rgba(23, 59, 67, 0.14), transparent 26%),
    linear-gradient(180deg, #fbf7f0 0%, #f3eadf 100%);
}

.login-shell {
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(360px, 0.82fr) minmax(420px, 1fr);
  align-items: center;
  gap: 28px;
  padding: 36px 0;
}

.login-panel,
.login-aside,
.product-panel,
.estimate-modal {
  border: 1px solid rgba(24, 56, 66, 0.11);
  background: rgba(255, 252, 247, 0.9);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
}

.login-panel {
  display: grid;
  gap: 28px;
  padding: 34px;
  border-radius: 28px;
}

.login-brand {
  width: max-content;
}

.login-panel h1 {
  margin: 0;
  font-family: var(--headline);
  font-size: 4.6rem;
  line-height: 0.95;
}

.login-panel p {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 1.12rem;
  line-height: 1.55;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  border-radius: 16px;
  background: rgba(23, 59, 67, 0.07);
}

.auth-tabs button,
.filter-bar button,
.row-actions button,
.text-button,
.sidebar-signout {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.auth-tabs button {
  min-height: 44px;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.98rem;
  font-weight: 800;
}

.auth-tabs button.is-active {
  background: #fffaf4;
  color: var(--ink);
  box-shadow: 0 10px 20px rgba(42, 42, 30, 0.08);
}

.oauth-button {
  min-height: 48px;
  border: 1px solid rgba(24, 56, 66, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font: 900 1rem/1 var(--body);
  box-shadow: 0 12px 24px rgba(42, 42, 30, 0.07);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.oauth-button:hover,
.oauth-button:focus-visible {
  border-color: rgba(235, 107, 23, 0.32);
  box-shadow: 0 16px 30px rgba(42, 42, 30, 0.1);
  transform: translateY(-1px);
}

.oauth-button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.oauth-button span {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  color: #1f1f1f;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(24, 56, 66, 0.12);
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  background: rgba(24, 56, 66, 0.12);
}

.auth-form,
.template-form,
.settings-form,
.note-form {
  display: grid;
  gap: 16px;
}

.auth-form label,
.template-form label,
.settings-form label,
.note-form label,
.modal-grid label,
.detail-grid label,
.search-box {
  display: grid;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 800;
}

.auth-form input,
.template-form input,
.template-form textarea,
.settings-form input,
.settings-form select,
.note-form textarea,
.modal-grid input,
.detail-grid input,
.detail-grid select,
.search-box input {
  width: 100%;
  border: 1px solid rgba(24, 56, 66, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font: 1rem/1.4 var(--body);
  padding: 13px 14px;
  outline: none;
}

.auth-form input:focus,
.template-form input:focus,
.template-form textarea:focus,
.settings-form input:focus,
.settings-form select:focus,
.note-form textarea:focus,
.modal-grid input:focus,
.detail-grid input:focus,
.detail-grid select:focus,
.search-box input:focus {
  border-color: rgba(235, 107, 23, 0.72);
  box-shadow: 0 0 0 4px rgba(235, 107, 23, 0.12);
}

.auth-message {
  min-height: 24px;
  color: var(--accent-deep);
  font-size: 0.94rem;
}

.login-aside {
  min-height: 610px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 34px;
  border-radius: 32px;
  background:
    linear-gradient(160deg, rgba(23, 59, 67, 0.98), rgba(18, 46, 53, 0.98)),
    var(--teal);
  color: white;
}

.login-aside-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}

.login-aside-top span,
.login-followup-list span {
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.92rem;
}

.login-aside-top strong {
  font-family: var(--headline);
  font-size: 4.4rem;
  line-height: 0.9;
}

.login-followup-list {
  display: grid;
  gap: 14px;
  margin: 44px 0;
}

.login-followup-list div {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}

.login-followup-list p,
.login-aside-note {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.55;
}

.login-aside-note {
  max-width: 26rem;
  color: rgba(255, 255, 255, 0.78);
}

.product-body {
  overflow: hidden;
}

.product-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.product-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 18px;
  background: linear-gradient(180deg, #173943 0%, #112c34 100%);
  color: white;
}

.product-wordmark {
  font-family: var(--headline);
  font-size: 3.1rem;
  line-height: 0.94;
}

.workspace-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
}

.workspace-avatar {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 24%, rgba(255, 255, 255, 0.46), transparent 24%),
    linear-gradient(135deg, #f6b66f 0%, #eb6b17 50%, #f1dcc3 100%);
  color: #281b12;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.workspace-copy {
  min-width: 0;
}

.workspace-card span,
.workspace-card small {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.86rem;
}

.workspace-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1.05rem;
}

.workspace-card small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-nav {
  display: grid;
  gap: 8px;
}

.product-nav-button {
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  font: 800 0.98rem/1 var(--body);
  text-align: left;
}

.product-nav-button:hover,
.product-nav-button:focus-visible,
.product-nav-button.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.sidebar-signout {
  margin-top: auto;
  min-height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  font-weight: 800;
}

.product-main {
  min-width: 0;
  height: 100vh;
  overflow: auto;
  padding: 26px;
}

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.workspace-header h1 {
  margin: 0;
  font-family: var(--headline);
  font-size: 4.2rem;
  line-height: 0.92;
}

.workspace-header p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 1.04rem;
}

.workspace-actions {
  display: flex;
  align-items: end;
  gap: 12px;
}

.search-box {
  width: 280px;
}

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

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

.product-metric {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(24, 56, 66, 0.09);
  background: rgba(255, 252, 247, 0.86);
}

.product-metric span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.product-metric strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 2.1rem;
  line-height: 1;
}

.overview-grid,
.estimate-workspace,
.templates-grid,
.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.72fr);
  gap: 18px;
}

.product-panel {
  min-width: 0;
  border-radius: 22px;
  padding: 20px;
}

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

.panel-head h2 {
  margin: 0;
  font-size: 1.22rem;
}

.panel-note {
  color: var(--muted);
  font-size: 0.92rem;
}

.text-button {
  padding: 0;
  background: transparent;
  color: var(--accent-deep);
  font-weight: 900;
  font-size: 0.94rem;
}

.queue-list,
.activity-list,
.template-list,
.followup-list,
.estimate-records,
.notes-list {
  display: grid;
  gap: 10px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.queue-row,
.estimate-record,
.template-row {
  width: 100%;
  border: 0;
  cursor: pointer;
  color: var(--ink);
  font: inherit;
  text-align: left;
}

.queue-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 80px 110px;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid rgba(24, 56, 66, 0.09);
  background: transparent;
}

.queue-row strong,
.queue-row small,
.template-row strong,
.template-row span,
.followup-row strong,
.followup-row small {
  display: block;
}

.queue-row small,
.template-row span,
.followup-row small,
.activity-row span,
.note-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.activity-row,
.note-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 13px 0;
  border-bottom: 1px solid rgba(24, 56, 66, 0.09);
}

.activity-row p,
.note-row p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.45;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.filter-bar button,
.row-actions button {
  min-height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  background: rgba(23, 59, 67, 0.08);
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 900;
}

.filter-bar button.is-active,
.row-actions button:hover,
.row-actions button:focus-visible {
  background: var(--teal);
  color: white;
}

.bulk-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 14px 0 12px;
  padding: 12px 14px;
  border: 1px solid rgba(23, 59, 67, 0.1);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(244, 138, 88, 0.1), rgba(89, 176, 125, 0.1)),
    rgba(255, 252, 247, 0.78);
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.bulk-action-bar[hidden] {
  display: none;
}

.bulk-action-bar strong {
  color: var(--ink);
}

.bulk-action-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.estimate-record-head,
.estimate-record {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.estimate-record-head {
  grid-template-columns: 34px minmax(180px, 1.35fr) minmax(150px, 1fr) 100px 108px 118px;
}

.estimate-record-head,
.followup-head {
  padding: 0 8px 10px;
  border-bottom: 1px solid rgba(24, 56, 66, 0.1);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.estimate-record {
  min-height: 66px;
  padding: 11px 8px;
  border-radius: 14px;
  background: transparent;
}

.estimate-record-open {
  display: grid;
  grid-template-columns: minmax(180px, 1.35fr) minmax(150px, 1fr) 100px 108px 118px;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.estimate-row-select,
.estimate-select-head {
  display: inline-grid;
  place-items: center;
  min-height: 34px;
}

.estimate-row-select {
  cursor: pointer;
}

.estimate-row-select input,
.estimate-select-head input {
  width: 17px;
  height: 17px;
  accent-color: var(--teal);
  cursor: pointer;
}

.estimate-record:hover,
.estimate-record:focus-visible,
.estimate-record:focus-within,
.estimate-record.is-active,
.estimate-record.is-selected,
.template-row:hover,
.template-row:focus-visible,
.template-row.is-active {
  background: rgba(23, 59, 67, 0.06);
}

.estimate-record.is-selected {
  box-shadow: inset 3px 0 0 var(--teal);
}

.estimate-record strong,
.estimate-record small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.estimate-record small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
}

.product-status {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 900;
}

.product-status-sent {
  color: #815a17;
  background: rgba(239, 186, 71, 0.18);
}

.product-status-opened {
  color: #3574a7;
  background: rgba(77, 148, 210, 0.14);
}

.product-status-idle {
  color: #6d5f49;
  background: rgba(147, 127, 92, 0.15);
}

.product-status-replied,
.product-status-booked {
  color: #2c7851;
  background: rgba(89, 176, 125, 0.16);
}

.product-status-paused,
.product-status-lost {
  color: #9a4423;
  background: rgba(217, 94, 53, 0.13);
}

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

.detail-head h3 {
  margin: 4px 0 0;
  font-size: 1.8rem;
}

.detail-label {
  color: var(--accent-deep);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

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

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

.estimate-facts div {
  padding-top: 12px;
  border-top: 1px solid rgba(24, 56, 66, 0.1);
}

.estimate-facts dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.estimate-facts dd {
  margin: 5px 0 0;
  color: var(--ink);
  font-weight: 800;
}

.message-preview {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  padding: 16px;
  border-radius: 16px;
  background: rgba(23, 59, 67, 0.06);
}

.message-preview p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.5;
  white-space: pre-wrap;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.button-danger {
  border-color: rgba(217, 94, 53, 0.34);
  background: rgba(217, 94, 53, 0.1);
  color: #9a4423;
}

.button-stop {
  border-color: rgba(154, 68, 35, 0.28);
  background: rgba(217, 94, 53, 0.08);
  color: #8b3f20;
}

.button-stop:hover,
.button-stop:focus-visible {
  background: rgba(217, 94, 53, 0.14);
}

.button-danger:hover,
.button-danger:focus-visible {
  background: rgba(217, 94, 53, 0.16);
}

.followup-head,
.followup-row {
  display: grid;
  grid-template-columns: 120px minmax(190px, 1.2fr) minmax(150px, 0.8fr) 105px minmax(210px, 0.8fr);
  gap: 12px;
  align-items: center;
}

.followup-row {
  padding: 14px 8px;
  border-bottom: 1px solid rgba(24, 56, 66, 0.09);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.template-row {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 14px;
  background: transparent;
}

.status-chart {
  min-height: 260px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 18px;
  align-items: end;
  padding-top: 18px;
}

.chart-column {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.chart-column span {
  width: 100%;
  max-width: 58px;
  border-radius: 12px 12px 4px 4px;
  background: linear-gradient(180deg, #ef7a22 0%, #173b43 100%);
}

.chart-column strong {
  font-size: 1.1rem;
}

.chart-column small {
  color: var(--muted);
  text-align: center;
}

.reports-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
}

.aging-breakdown,
.priority-list {
  display: grid;
  gap: 10px;
}

.aging-row,
.priority-row {
  border: 1px solid rgba(24, 56, 66, 0.1);
  border-radius: 14px;
  background: rgba(255, 252, 247, 0.72);
}

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

.aging-row span,
.priority-row small {
  color: var(--muted);
  font-weight: 800;
}

.aging-row strong,
.priority-row strong {
  color: var(--ink);
}

.aging-row em,
.priority-row em {
  color: var(--accent-deep);
  font-style: normal;
  font-weight: 900;
}

.priority-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.priority-row:hover {
  border-color: rgba(235, 107, 23, 0.28);
  background: #fffaf4;
}

.priority-row span:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.priority-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.priority-row > span:nth-child(2) {
  color: var(--ink);
  font-weight: 900;
}

.priority-row em.is-overdue {
  color: #b94725;
}

.settings-panel {
  max-width: 720px;
}

.settings-layout .settings-panel {
  max-width: none;
}

.setup-panel {
  margin-bottom: 18px;
}

.setup-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.setup-step {
  display: grid;
  gap: 7px;
  min-height: 112px;
  padding: 14px;
  border: 1px solid rgba(24, 56, 66, 0.1);
  border-radius: 16px;
  background: rgba(23, 59, 67, 0.05);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.setup-step span {
  width: max-content;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(235, 107, 23, 0.13);
  color: var(--accent-deep);
  font-size: 0.78rem;
  font-weight: 900;
}

.setup-step strong,
.setup-step small {
  display: block;
}

.setup-step small {
  color: var(--muted);
  font-size: 0.84rem;
}

.setup-step.is-complete {
  background: rgba(89, 176, 125, 0.12);
}

.setup-step.is-complete span {
  background: rgba(89, 176, 125, 0.18);
  color: #2c7851;
}

/* C-4: 100%-complete celebration. Lightweight CSS-only confetti — 18 colored
   squares with a staggered fall animation. No JS animation loop, no library.
   The is-celebrating class keeps the steps row from shifting; the confetti
   sits absolutely positioned over the panel and is purely decorative. */
.setup-panel {
  position: relative;
  overflow: hidden;
}

.setup-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.setup-confetti span {
  position: absolute;
  top: -16px;
  left: calc((var(--i) * 5.55%) + 1%);
  width: 8px;
  height: 14px;
  background: var(--c, #2E75B6);
  opacity: 0;
  transform: translateY(0) rotate(0deg);
  animation: bidback-confetti-fall 2.4s cubic-bezier(0.42, 0, 0.58, 1) forwards;
  animation-delay: calc(var(--i) * 60ms);
  border-radius: 1px;
}

@keyframes bidback-confetti-fall {
  0% {
    opacity: 0;
    transform: translateY(0) rotate(0deg);
  }
  10% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(220px) rotate(540deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .setup-confetti span {
    animation: none;
    opacity: 0;
  }
}

/* C-4: high-leverage onboarding empty-state used when the Estimates pipeline
   is completely empty. Strong CTA, contractor language, paired buttons.
   Sits inside .estimate-records so it scrolls with the rest of the panel
   if the viewport is small. */
.empty-cta {
  display: grid;
  gap: 12px;
  padding: 28px 24px;
  border-radius: 18px;
  background: rgba(46, 117, 182, 0.06);
  border: 1px dashed rgba(46, 117, 182, 0.25);
  text-align: left;
}

.empty-cta h3 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--ink);
}

.empty-cta p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

.empty-cta-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.empty-cta-hint {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.empty-cta-hint strong {
  color: var(--ink);
}

.form-helper {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.config-status-list,
.automation-status-list {
  display: grid;
  gap: 10px;
}

.config-banner,
.config-row {
  border: 1px solid rgba(24, 56, 66, 0.1);
  border-radius: 14px;
  background: rgba(217, 94, 53, 0.1);
}

.config-banner {
  display: grid;
  gap: 5px;
  padding: 14px;
}

.config-banner.is-ready {
  background: rgba(89, 176, 125, 0.13);
}

.config-banner.is-staged {
  background: rgba(242, 201, 76, 0.16);
}

.config-banner strong {
  font-size: 1rem;
}

.config-banner span {
  color: var(--ink-soft);
  line-height: 1.45;
}

.config-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 252, 247, 0.72);
}

.config-row span {
  color: var(--muted);
  font-weight: 800;
}

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

.automation-note {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(17, 44, 52, 0.06);
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.45;
}

.automation-control-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(24, 56, 66, 0.12);
  border-radius: 16px;
  background: rgba(250, 246, 235, 0.76);
}

.automation-control-card span {
  display: grid;
  gap: 4px;
}

.automation-control-card strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.automation-control-card small {
  color: var(--muted);
  line-height: 1.45;
}

.billing-panel {
  display: grid;
  gap: 14px;
}

.billing-state {
  display: grid;
  gap: 10px;
}

.billing-banner {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(24, 56, 66, 0.1);
  background: rgba(217, 94, 53, 0.1);
}

.billing-banner.is-trial {
  background: rgba(46, 117, 182, 0.1);
}

.billing-banner.is-active {
  background: rgba(89, 176, 125, 0.13);
}

.billing-banner.is-canceling {
  background: rgba(226, 151, 63, 0.16);
}

.billing-banner.is-pastdue {
  background: rgba(217, 94, 53, 0.16);
}

.billing-banner.is-canceled {
  background: rgba(217, 94, 53, 0.2);
}

.billing-banner strong {
  font-size: 1rem;
}

.billing-banner span {
  color: var(--ink-soft);
  line-height: 1.45;
}

.billing-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.billing-missing-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.billing-missing-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 252, 247, 0.72);
  font-size: 0.9rem;
  color: var(--muted);
}

.billing-missing-list li strong {
  color: var(--ink);
}

.billing-actions button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Stripe gating banner. Persistent across all views, sits below the
   workspace-header and above the active product-view. Three tones map to
   the three gate levels. The banner is hidden when level === "ok" (active
   subscription) and when level === "trial" with several days still left
   (the UI decides). */
.billing-gate-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  margin: 0 0 12px;
  border-radius: 14px;
  border: 1px solid rgba(46, 117, 182, 0.25);
  background: rgba(46, 117, 182, 0.1);
}

.billing-gate-banner[hidden] {
  display: none;
}

.billing-gate-banner.is-warn {
  border-color: rgba(217, 94, 53, 0.35);
  background: rgba(217, 94, 53, 0.12);
}

.billing-gate-banner.is-locked {
  border-color: rgba(217, 94, 53, 0.5);
  background: rgba(217, 94, 53, 0.18);
}

.billing-gate-text {
  display: grid;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.billing-gate-text strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.billing-gate-text span {
  color: var(--ink-soft);
  line-height: 1.4;
  font-size: 0.9rem;
}

/* Stripe Access Control hard gate. Replaces the Estimates/Follow-Ups/
   Templates view content entirely when billingGate.lockSends is true (i.e.
   past_due, canceled, or trial_expired). The soft banner above stays as
   the in-context cue; this panel makes it impossible to keep using the
   gated views without resolving billing. Overview, Reports, and Settings
   remain reachable via the sidebar. */
.hard-gate {
  display: grid;
  place-items: center;
  min-height: 60vh;
  padding: 28px;
  border-radius: 22px;
  border: 1px solid rgba(217, 94, 53, 0.32);
  background: rgba(217, 94, 53, 0.08);
}

.hard-gate[hidden] {
  display: none;
}

.hard-gate-content {
  max-width: 540px;
  display: grid;
  gap: 14px;
  text-align: center;
}

.hard-gate-content strong {
  font-size: 1.4rem;
  color: var(--ink);
}

.hard-gate-content p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.5;
}

.hard-gate-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 4px;
}

.hard-gate-foot {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
  margin-top: 6px;
}

/* C-7: Settings -> Integrations panel. Same visual language as the Billing
   panel: state banners + a list of meta rows + an actions row. */
.integrations-panel {
  display: grid;
  gap: 14px;
}

.integrations-state {
  display: grid;
  gap: 12px;
}

.integrations-banner {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(24, 56, 66, 0.1);
  background: rgba(46, 117, 182, 0.08);
}

.integrations-banner.is-active {
  background: rgba(89, 176, 125, 0.13);
}

.integrations-banner.is-warn {
  background: rgba(217, 94, 53, 0.12);
}

.integrations-banner strong {
  font-size: 1rem;
}

.integrations-banner span {
  color: var(--ink-soft);
  line-height: 1.45;
}

.integrations-banner small {
  color: var(--ink-soft);
  line-height: 1.45;
}

.integrations-url-row {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(17, 44, 52, 0.04);
}

.integrations-url-row label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 800;
}

.integrations-url-row code {
  display: block;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.88rem;
  color: var(--ink);
  word-break: break-all;
}

.integrations-setup-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(24, 56, 66, 0.1);
  background: rgba(255, 252, 247, 0.72);
}

.integrations-setup-card div:first-child {
  display: grid;
  gap: 4px;
}

.integrations-setup-card strong {
  color: var(--ink);
}

.integrations-setup-card span {
  color: var(--ink-soft);
  line-height: 1.45;
}

.integrations-setup-card small {
  color: var(--muted);
  line-height: 1.4;
}

.integrations-setup-card label {
  margin-top: 4px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 800;
}

.integrations-setup-card code,
.integrations-setup-card pre {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(17, 44, 52, 0.06);
  color: var(--ink);
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.86rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.integrations-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.integrations-meta div {
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 252, 247, 0.72);
}

.integrations-meta dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 800;
}

.integrations-meta dd {
  margin: 0;
  font-weight: 700;
  color: var(--ink);
  word-break: break-word;
}

.integrations-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.integrations-actions button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.integrations-reveal {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 14px;
  border: 1px dashed rgba(217, 94, 53, 0.45);
  background: rgba(255, 244, 233, 0.85);
}

.integrations-reveal strong {
  color: var(--accent-deep);
}

.integrations-reveal code {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(17, 44, 52, 0.07);
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.92rem;
  word-break: break-all;
  color: var(--ink);
}

.integrations-reveal small {
  color: var(--ink-soft);
  line-height: 1.45;
}

.integrations-test-result {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(89, 176, 125, 0.28);
  background: rgba(89, 176, 125, 0.1);
}

.integrations-test-result strong {
  color: #2c7851;
}

.integrations-test-result span {
  color: var(--ink-soft);
  line-height: 1.45;
}

.integrations-test-result .text-button {
  justify-self: start;
}

/* Settings -> Automation panel banner. Codex's renderAutomationStatus emits
   `.config-banner.automation-banner` with state classes `.is-ready` (green —
   automation actively allowed to send), `.is-staged` (yellow/orange — secret
   set but safety switch off, OR delivery prereqs not yet ready), or no state
   (info blue — endpoint deployed but secret missing). Layout / typography
   inherits from the base `.config-banner`; we only override colors here. */
.automation-panel {
  display: grid;
  gap: 14px;
}

.automation-banner.is-ready {
  background: rgba(89, 176, 125, 0.13);
  border-color: rgba(89, 176, 125, 0.32);
}

.automation-banner.is-staged {
  background: rgba(235, 178, 23, 0.15);
  border-color: rgba(235, 178, 23, 0.35);
}

/* G-5: First-template-edit coaching prompt. Shown above the Edit Template
   form when the currently-selected template is unmodified from its seed
   defaults. Disappears the moment the user makes any edit. Same blue-tinted
   dashed-border vocabulary as the empty-cta on Estimates. */
.template-coaching {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: 12px;
  border: 1px dashed rgba(46, 117, 182, 0.4);
  background: rgba(46, 117, 182, 0.07);
}

.template-coaching[hidden] {
  display: none;
}

.template-coaching strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.template-coaching span {
  color: var(--ink-soft);
  line-height: 1.45;
  font-size: 0.9rem;
}

.delivery-test {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}

.delivery-test small {
  color: var(--ink-soft);
  line-height: 1.45;
}

.delivery-test button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.send-confirm-modal {
  width: min(560px, 100%);
  background: #fffcf7;
  box-shadow: var(--shadow-md);
}

/* CRIT-5: Resume sequence confirmation modal. Reuses the .estimate-modal
   shell (border-radius, spacing) but is sized smaller than import preview
   because it's a quick decision, not a data review. */
.resume-confirm-modal {
  width: min(560px, 100%);
  background: #fffcf7;
  box-shadow: var(--shadow-md);
  display: grid;
  gap: 14px;
}

.resume-confirm-lead {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.5;
}

.resume-warning-banner {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(217, 94, 53, 0.4);
  background: rgba(217, 94, 53, 0.12);
}

.resume-warning-banner[hidden] {
  display: none;
}

.resume-warning-banner strong {
  color: var(--accent-deep);
}

.resume-warning-banner span {
  color: var(--ink-soft);
  line-height: 1.45;
}

.resume-confirm-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.resume-confirm-grid > div {
  display: grid;
  gap: 2px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(17, 44, 52, 0.05);
}

.resume-confirm-grid dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 800;
}

.resume-confirm-grid dd {
  margin: 0;
  font-weight: 700;
  color: var(--ink);
  word-break: break-word;
}

.resume-confirm-date-label {
  display: grid;
  gap: 6px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 800;
}

.resume-confirm-date-label input[type="date"] {
  font-family: inherit;
  font-size: 1rem;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(24, 56, 66, 0.18);
  background: white;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
}

.resume-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.resume-confirm-actions button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* C-5: import preview modal. Reuses the .estimate-modal shell so spacing,
   border-radius, and header conventions stay consistent. */
.import-preview-modal {
  width: min(720px, 100%);
  background: #fffcf7;
  box-shadow: var(--shadow-md);
  max-height: 86vh;
  overflow-y: auto;
}

.import-preview-lead {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.5;
}

.import-preview-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 14px;
  border-radius: 14px;
  background: rgba(46, 117, 182, 0.06);
  border: 1px solid rgba(46, 117, 182, 0.15);
}

.import-preview-stats > div {
  display: grid;
  gap: 2px;
}

.import-preview-stats dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 800;
}

.import-preview-stats dd {
  margin: 0;
  font-weight: 800;
  color: var(--ink);
  word-break: break-word;
}

.import-preview-stats dd.ok {
  color: #2c7851;
}

.import-preview-stats dd.warn {
  color: var(--accent-deep);
}

.import-preview-stats code {
  display: inline-block;
  margin: 2px 4px 2px 0;
  padding: 1px 7px;
  border-radius: 6px;
  background: rgba(17, 44, 52, 0.06);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
}

.import-preview-section {
  display: grid;
  gap: 8px;
}

.import-preview-section h3 {
  margin: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 800;
}

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

.import-preview-table th,
.import-preview-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(24, 56, 66, 0.08);
}

.import-preview-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 800;
  background: rgba(17, 44, 52, 0.04);
}

.import-preview-table td {
  color: var(--ink);
}

.import-preview-more,
.import-preview-skipped small {
  color: var(--muted);
  font-size: 0.85rem;
}

.import-preview-skip-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
}

.import-preview-skip-list li {
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(217, 94, 53, 0.08);
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.82rem;
  color: var(--ink);
}

.import-preview-help {
  border-radius: 12px;
  background: rgba(17, 44, 52, 0.04);
  padding: 10px 14px;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.import-preview-help summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--ink);
}

.import-preview-help ul {
  margin: 8px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.import-preview-help code {
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  background: rgba(17, 44, 52, 0.06);
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 0.82rem;
  color: var(--ink);
}

.import-preview-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.import-preview-actions button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.send-confirm-lead {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.5;
}

.send-confirm-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.send-confirm-grid dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 800;
  margin-bottom: 2px;
}

.send-confirm-grid dd {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
  word-break: break-word;
}

.send-confirm-template-label,
.send-confirm-subject-label,
.send-confirm-message-label {
  display: grid;
  gap: 6px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 800;
}

.send-confirm-template-label select,
.send-confirm-subject-label input {
  appearance: none;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(17, 44, 52, 0.16);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.4;
}

.send-confirm-template-label select:focus-visible,
.send-confirm-subject-label input:focus-visible,
.send-confirm-message-label textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.send-confirm-hint {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.4;
}

.send-confirm-message {
  margin: 0;
  padding: 14px;
  border-radius: 14px;
  background: rgba(17, 44, 52, 0.06);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  white-space: pre-wrap;
  max-height: 240px;
  overflow: auto;
  line-height: 1.5;
}

textarea.send-confirm-message {
  resize: vertical;
  min-height: 180px;
  border: 1px solid rgba(17, 44, 52, 0.16);
  background: rgba(255, 255, 255, 0.92);
}

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

.template-delete {
  color: #b53a25;
  border-color: rgba(181, 58, 37, 0.28);
}

.template-delete:hover:not(:disabled),
.template-delete:focus-visible:not(:disabled) {
  background: rgba(181, 58, 37, 0.08);
  border-color: rgba(181, 58, 37, 0.45);
}

.template-delete:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.send-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.reply-routing-card {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid rgba(17, 44, 52, 0.1);
  border-radius: 16px;
  background: rgba(89, 176, 125, 0.1);
  color: var(--ink-soft);
  line-height: 1.45;
}

.reply-routing-card strong {
  color: var(--ink);
}

.reply-routing-card b {
  color: var(--ink);
}

.detail-actions button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

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

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

.estimate-modal {
  width: min(720px, 100%);
  display: grid;
  gap: 18px;
  padding: 22px;
  border-radius: 24px;
}

.estimate-modal h2 {
  margin: 0;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  max-width: 340px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #173b43;
  color: white;
  box-shadow: var(--shadow-md);
  font-weight: 900;
}

.empty-state {
  margin: 0;
  padding: 18px;
  border-radius: 16px;
  background: rgba(23, 59, 67, 0.06);
  color: var(--ink-soft);
  line-height: 1.5;
}

.fatal-error {
  width: min(640px, calc(100% - 32px));
  margin: 80px auto;
  padding: 30px;
  border-radius: 24px;
  background: rgba(255, 252, 247, 0.92);
}

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

.legal-panel {
  margin-top: 24px;
  padding: 34px;
  border: 1px solid rgba(24, 56, 66, 0.11);
  border-radius: 26px;
  background: rgba(255, 252, 247, 0.92);
  box-shadow: var(--shadow-md);
}

.legal-kicker {
  margin-bottom: 14px;
  color: var(--accent-deep);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.legal-panel h1 {
  margin: 0 0 18px;
  font-family: var(--headline);
  font-size: 4rem;
  line-height: 0.95;
}

.legal-panel h2 {
  margin: 30px 0 10px;
  color: var(--ink);
  font-size: 1.26rem;
}

.legal-panel p {
  margin: 0 0 16px;
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.65;
}

.legal-panel a {
  color: var(--accent-deep);
  font-weight: 900;
}

.legal-note {
  margin-top: 28px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(239, 186, 71, 0.16);
  color: var(--ink-soft);
  line-height: 1.55;
}

.support-card-app {
  display: grid;
  gap: 14px;
}

.support-card-app p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

.support-link-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

@media (max-width: 1120px) {
  .login-shell,
  .product-shell,
  .overview-grid,
  .estimate-workspace,
  .templates-grid,
  .reports-grid,
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .product-body {
    overflow: auto;
  }

  .product-sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: auto minmax(160px, 1fr) auto;
    align-items: center;
  }

  .product-nav {
    grid-column: 1 / -1;
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .product-main {
    height: auto;
  }

  .login-aside {
    min-height: auto;
  }
}

@media (max-width: 820px) {
  .workspace-header,
  .workspace-actions,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace-header h1 {
    font-size: 3.3rem;
  }

  .search-box {
    width: 100%;
  }

  .metric-strip,
  .setup-steps,
  .detail-grid,
  .estimate-facts,
  .modal-grid {
    grid-template-columns: 1fr;
  }

  .estimate-list-panel,
  .product-panel {
    overflow-x: auto;
  }

  .estimate-record-head,
  .followup-head {
    display: none;
  }

  .estimate-record,
  .followup-row {
    min-width: 0;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
    border: 1px solid rgba(24, 56, 66, 0.1);
    border-radius: 16px;
    background: rgba(255, 252, 247, 0.72);
  }

  .estimate-record {
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: start;
  }

  .estimate-record-open {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .estimate-record > span,
  .estimate-record-open > span,
  .followup-row > span {
    display: grid;
    gap: 4px;
  }

  .estimate-record > span::before,
  .estimate-record-open > span::before,
  .followup-row > span::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .estimate-record .product-status {
    justify-self: start;
  }

  .bulk-action-bar,
  .bulk-action-buttons {
    align-items: stretch;
    flex-direction: column;
  }

  .followup-row {
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(24, 56, 66, 0.1);
  }

  .row-actions {
    justify-content: flex-start;
  }

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

  .product-main {
    padding: 18px;
  }

  .automation-control-card {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .login-shell {
    width: min(100% - 24px, 1120px);
  }

  .login-panel,
  .login-aside,
  .product-panel,
  .estimate-modal {
    padding: 18px;
    border-radius: 20px;
  }

  .login-panel h1 {
    font-size: 3.4rem;
  }

  .login-followup-list div,
  .activity-row,
  .note-row,
  .queue-row {
    grid-template-columns: 1fr;
  }

  .send-confirm-grid {
    grid-template-columns: 1fr;
  }

  .aging-row,
  .priority-row {
    grid-template-columns: 1fr;
  }

  .priority-row small {
    white-space: normal;
  }

  .product-sidebar {
    grid-template-columns: 1fr;
  }
}
