:root {
  --bg: #f5f6f7;
  --surface: #ffffff;
  --surface-soft: #f0f2f4;
  --ink: #15191d;
  --muted: #69737d;
  --line: #d9dee3;
  --blue: #0a84ff;
  --red: #b42318;
  --green: #248a3d;
  --shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

[hidden] {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(100%, 420px);
  display: grid;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.login-copy {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

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

.app-header,
.workspace-heading,
.records-heading,
.record-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.app-header {
  margin-bottom: 18px;
}

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

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.25rem, 2.5vw, 1.8rem);
}

h3 {
  margin: 0;
  font-size: 1rem;
}

.header-meta,
.quick-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.header-meta span,
.quick-stats span {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.header-meta .connected {
  color: var(--green);
}

.header-icon-btn {
  width: 34px;
  min-height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 1rem;
}

.tab-bar {
  width: fit-content;
  max-width: 100%;
  display: grid;
  grid-template-columns: repeat(8, max-content);
  gap: 4px;
  overflow-x: auto;
  margin-bottom: 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.quote-builder {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(120px, 160px) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.pricing-settings-panel {
  margin-bottom: 16px;
}

.pricing-settings-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

.quote-workspace {
  align-items: start;
}

.schedule-filter-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
  padding: 14px;
}

.schedule-workspace {
  grid-template-columns: minmax(320px, 0.62fr) minmax(0, 1fr);
}

.deposit-status {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-soft);
}

.deposit-status[data-state="ready"] {
  border-color: rgba(36, 138, 61, 0.35);
  background: #f1f9f3;
}

.deposit-status[data-state="blocked"] {
  border-color: rgba(180, 35, 24, 0.35);
  background: #fff4f2;
}

.deposit-status strong,
.deposit-status span {
  display: block;
}

.deposit-status span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.4;
}

.deposit-override {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border: 1px solid rgba(180, 35, 24, 0.35);
  border-radius: 8px;
  padding: 12px;
  background: #fff4f2;
}

.deposit-override[hidden] {
  display: none;
}

.deposit-override-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.deposit-override-heading span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

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

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  font-size: 0.86rem;
}

.schedule-table th,
.schedule-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

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

.schedule-table small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.35;
}

.completion-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.completion-queue {
  min-height: 240px;
}

.completion-card label {
  display: block;
  margin-top: 10px;
}

.completion-financials {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.completion-financials span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.35;
}

.final-invoice-workspace {
  grid-template-columns: minmax(280px, 0.7fr) minmax(0, 1.3fr);
}

.draft-final-form {
  min-height: 420px;
}

.invoice-detail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.invoice-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.invoice-summary-grid span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.4;
}

.invoice-lines {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.invoice-lines th,
.invoice-lines td {
  border-bottom: 1px solid var(--line);
  padding: 8px 6px;
  text-align: left;
}

.invoice-lines th {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.invoice-history {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.invoice-history-list {
  display: grid;
  gap: 6px;
}

.invoice-history-list span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.quote-detail-panel {
  min-height: 320px;
}

.quote-total-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
}

.quote-total-grid span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-soft);
  font-weight: 800;
}

.quote-line-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.quote-line-table th,
.quote-line-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 6px;
  text-align: left;
  vertical-align: top;
}

.quote-line-table th {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

@media print {
  .tab-bar,
  .branch-filter,
  .quick-stats,
  .quote-builder,
  .row-actions,
  #customers,
  #jobs,
  #measurements {
    display: none !important;
  }

  .app-shell {
    width: 100%;
    padding: 0;
  }

  #quotes,
  .workspace-section.active {
    display: block !important;
  }
}

.tab-button {
  border: 0;
  border-radius: 8px;
  padding: 9px 16px;
  min-height: 38px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.tab-button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 5px rgba(15, 23, 42, 0.12);
}

.quick-stats {
  justify-content: flex-start;
  margin-bottom: 20px;
}

body[data-active-tab="architect"] .branch-filter,
body[data-active-tab="architect"] .quick-stats {
  display: none;
}

.architect-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
}

.architect-band {
  min-width: 0;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.architect-band-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.architect-band-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.architect-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.architect-metric {
  min-width: 0;
  padding: 12px;
  border-right: 1px solid var(--line);
}

.architect-metric:last-child {
  border-right: 0;
}

.architect-metric span,
.architect-metric strong {
  display: block;
  overflow-wrap: anywhere;
}

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

.architect-signal-grid > div {
  min-width: 0;
  border-left: 3px solid var(--blue);
  padding: 8px 10px;
  background: var(--surface);
}

.architect-signal-grid span,
.architect-signal-grid strong,
.architect-signal-grid small {
  display: block;
  overflow-wrap: anywhere;
}

.architect-signal-grid span,
.architect-review-grid > div > span,
.architect-timeline-item > div > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.architect-signal-grid strong {
  margin: 4px 0;
  font-size: 0.9rem;
}

.architect-signal-grid small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
}

.architect-metric span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.architect-metric strong {
  font-size: 0.9rem;
  line-height: 1.35;
}

.architect-gate {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
  gap: 18px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface);
}

.architect-gate-status strong,
.architect-gate-status span {
  display: block;
}

.architect-gate-status strong {
  font-size: 1.15rem;
}

.architect-gate-status span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.architect-progress {
  height: 8px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.architect-progress span {
  height: 100%;
  display: block;
  margin: 0;
  background: var(--green);
}

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

.architect-checklist label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  color: var(--ink);
}

.architect-checklist input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

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

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

.architect-column {
  min-width: 0;
}

.architect-column h3 {
  margin-bottom: 9px;
}

.architect-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.architect-list li {
  border-bottom: 1px solid var(--line);
  padding: 0 0 7px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.architect-list li strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
}

.architect-list li:last-child {
  border-bottom: 0;
}

.architect-list.compact {
  gap: 4px;
  margin-top: 7px;
}

.architect-list.compact li {
  padding-bottom: 4px;
  font-size: 0.78rem;
}

.architect-empty {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.architect-document-path {
  display: block;
  margin-top: 2px;
  color: var(--blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.74rem;
  overflow-wrap: anywhere;
}

.architect-recommendation {
  border-left: 4px solid var(--blue);
  padding: 4px 0 4px 14px;
}

.architect-recommendation strong {
  display: block;
  margin-bottom: 4px;
}

.architect-recommendation p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.45;
}

.architect-recommendation span {
  display: block;
  margin-top: 7px;
  color: var(--blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.76rem;
  font-weight: 800;
}

.architect-timeline {
  display: grid;
  border-top: 1px solid var(--line);
}

.architect-timeline-item {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.architect-timeline-title {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 4px;
}

.architect-timeline-title > span:first-child {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.architect-timeline-title small {
  color: var(--blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 800;
}

.architect-state {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  white-space: nowrap;
}

.architect-state.complete {
  background: #e8f6eb;
  color: var(--green);
}

.architect-state.proposed {
  background: #e8f4ff;
  color: #075db3;
}

.architect-state.approved,
.architect-state.in-progress {
  background: #fff3d6;
  color: #805500;
}

.architect-state.deferred {
  background: #f0f2f4;
  color: var(--muted);
}

.architect-roadmap-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
}

.architect-roadmap-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.architect-roadmap-table th,
.architect-roadmap-table td {
  border-bottom: 1px solid var(--line);
  padding: 9px 8px;
  text-align: left;
  vertical-align: top;
}

.architect-roadmap-table th {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.architect-roadmap-table small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.architect-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
}

.architect-review-grid > div {
  min-width: 0;
}

.architect-review-grid p {
  margin: 6px 0 0;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.45;
}

.branch-filter {
  max-width: 320px;
  margin: 0 0 14px;
}

.branch-filter label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.branch-filter select {
  margin-top: 6px;
}

.file-warning {
  margin-bottom: 18px;
  border: 1px solid #ffd59e;
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff8eb;
  color: #7a4a00;
  font-weight: 800;
}

.workspace-section {
  display: none;
}

.workspace-section.active {
  display: block;
}

.workspace-heading {
  margin-bottom: 14px;
}

.search-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 14px;
}

.search-strip input {
  margin-top: 0;
  min-height: 52px;
  border-radius: 14px;
  font-size: 1rem;
}

.lookup-panel {
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.lookup-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.lookup-heading span {
  min-width: 30px;
  min-height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 900;
}

.lookup-results {
  display: grid;
  gap: 8px;
}

.match-card,
.no-match-card {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.match-card {
  min-height: 76px;
}

.match-card:hover,
.match-card:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(10, 132, 255, 0.12);
}

.match-card small,
.no-match-card p {
  display: block;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.35;
}

.match-history {
  justify-self: end;
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.no-match-card {
  grid-template-columns: minmax(0, 1fr) auto;
}

.split-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.78fr);
  gap: 18px;
  align-items: start;
}

.panel,
.records-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.required-note {
  color: var(--red);
  font-size: 0.72rem;
}

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

input,
select,
textarea {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  min-height: 44px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(10, 132, 255, 0.16);
}

textarea {
  resize: vertical;
}

button {
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  min-height: 44px;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.secondary-btn {
  background: var(--surface-soft);
  color: var(--ink);
}

.danger-btn {
  background: #fff1f0;
  color: var(--red);
}

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

.form-message {
  white-space: pre-line;
  min-height: 20px;
  color: var(--muted);
  font-weight: 800;
}

.form-message.success {
  color: var(--green);
}

.form-message.error,
.error-text {
  color: var(--red);
}

.records-panel {
  padding: 14px;
}

.records-heading {
  margin-bottom: 10px;
}

.records-heading span {
  min-width: 30px;
  min-height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 900;
}

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

.record-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface);
}

.record-card strong {
  font-size: 1rem;
}

.record-card p {
  margin: 8px 0 4px;
  color: var(--ink);
}

.record-card small,
.record-main span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.record-card .row-actions {
  margin-top: 10px;
}

.history-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.history-line span {
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.table-action-btn {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.84rem;
}

.status-pill {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 8px;
  background: #e8f4ff;
  color: #075db3;
  font-weight: 900;
  white-space: nowrap;
}

.measurement-job-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(220px, 0.8fr);
  gap: 12px;
  align-items: end;
  padding: 14px;
  margin-bottom: 18px;
}

.measurement-workspace {
  display: grid;
  gap: 18px;
}

.measurement-summary {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.measurement-totals {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.measurement-totals span,
.measurement-live-total {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
}

.measurement-opening-form,
.measurement-openings-panel {
  margin-top: 0;
}

.flag-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
}

.flag-grid legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.flag-grid label {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 36px;
}

.flag-grid input {
  width: auto;
  min-height: auto;
  margin: 0;
}

.measurement-opening-card .history-line {
  margin-top: 8px;
}

.empty-state {
  padding: 14px;
  color: var(--muted);
  border-radius: 12px;
  background: var(--surface-soft);
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .app-header,
  .workspace-heading {
    display: block;
  }

  .header-meta {
    justify-content: flex-start;
    margin-top: 12px;
  }

  .tab-bar {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .search-strip {
    grid-template-columns: 1fr;
  }

  .match-card,
  .no-match-card {
    grid-template-columns: 1fr;
  }

  .match-history {
    justify-self: start;
  }

  .split-workspace,
  .form-panel,
  .measurement-job-panel,
  .schedule-filter-panel,
  .schedule-workspace,
  .deposit-override,
  .completion-review-grid,
  .completion-financials,
  .final-invoice-workspace,
  .invoice-summary-grid,
  .architect-metrics,
  .architect-gate,
  .architect-checklist,
  .architect-columns,
  .architect-columns.two,
  .architect-signal-grid,
  .architect-timeline-item,
  .architect-review-grid,
  .quote-builder,
  .pricing-settings-form,
  .quote-total-grid,
  .flag-grid {
    grid-template-columns: 1fr;
  }

  .architect-metric {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .architect-timeline-item {
    grid-template-columns: minmax(0, 1fr);
  }

  .architect-timeline-item > div {
    min-width: 0;
  }

  .architect-metric:last-child {
    border-bottom: 0;
  }

  .measurement-summary {
    display: block;
  }

  .measurement-totals {
    justify-content: flex-start;
    margin-top: 10px;
  }

  .form-actions button,
  .row-actions button {
    flex: 1 1 120px;
  }
}
