:root {
  color-scheme: light;
  --bg: #f3f5f2;
  --surface: #ffffff;
  --surface-soft: #f8f9f6;
  --surface-muted: #edf2ef;
  --surface-strong: #20282b;
  --text: #1d2528;
  --muted: #667178;
  --border: #dce1dc;
  --border-strong: #bfc8c0;
  --accent: #167a65;
  --accent-strong: #0f5f4d;
  --accent-soft: #dff1eb;
  --manual-marker: #b06b22;
  --danger: #b34b4b;
  --warning: #b06b22;
  --blue: #335f8f;
  --shadow: 0 14px 38px rgba(22, 32, 34, 0.08);
  --radius: 8px;
  --radius-sm: 6px;
  --gap-1: 4px;
  --gap-2: 8px;
  --gap-3: 12px;
  --gap-4: 16px;
  --gap-5: 20px;
  --gap-6: 28px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--text);
  background: var(--bg);
}

.project-summary-actions {
  display: flex;
  gap: var(--gap-2);
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.staff-database-panel .panel-header {
  align-items: flex-start;
}

.database-save-note {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.staff-db-stack {
  display: grid;
  gap: var(--gap-3);
}

.staff-card {
  display: grid;
  gap: var(--gap-3);
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.staff-card.is-archived {
  opacity: 0.72;
}

.staff-card-head,
.staff-editor-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--gap-3);
}

.staff-name-field {
  flex: 1 1 260px;
}

.staff-card-actions {
  display: flex;
  gap: var(--gap-2);
  flex-wrap: wrap;
}

.staff-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: var(--gap-3);
}

.staff-editor-section {
  display: grid;
  gap: var(--gap-2);
}

.staff-editor-section-head span,
.payouts-section-head span,
.payout-shift-head {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.staff-position-stack,
.staff-card-stack {
  display: grid;
  gap: var(--gap-2);
}

.staff-position-row,
.staff-payment-card-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.9fr) repeat(3, minmax(120px, 1fr)) 40px;
  gap: var(--gap-2);
  align-items: end;
}

.staff-payment-card-row {
  grid-template-columns: 120px minmax(140px, 1fr) minmax(190px, 1.4fr) 40px;
}

.staff-archive {
  margin-top: var(--gap-4);
}

.staff-archive summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 800;
  padding: 10px 0;
}

.empty-state.is-compact {
  padding: 10px;
  font-size: 13px;
}

.payouts-modal {
  gap: var(--gap-3);
}

.payouts-summary-strip {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) repeat(3, minmax(120px, 1fr)) minmax(110px, 0.8fr);
  gap: var(--gap-2);
  align-items: stretch;
}

.payouts-summary-strip > div,
.payout-rate-field {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.payouts-summary-strip span,
.payout-rate-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.payouts-summary-strip strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 18px;
}

.payouts-summary-strip .is-warning {
  border-color: var(--yellow-line, #f0e3a8);
  background: var(--yellow-panel, #fff9e3);
}

.payout-rate-field .input {
  min-height: 30px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 18px;
  font-weight: 800;
}

.payouts-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  gap: var(--gap-3);
  min-height: 0;
}

.payouts-workbench,
.payouts-preview,
.payouts-section {
  display: grid;
  gap: var(--gap-3);
  align-content: start;
}

.payouts-preview {
  position: sticky;
  top: 0;
  align-self: start;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.payouts-preview-head,
.payouts-section-head,
.payout-slot-main,
.payout-rental-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--gap-3);
}

.payouts-section-head h3 {
  margin: 0;
  font-size: 16px;
}

.payouts-preview-head span {
  font-weight: 800;
}

.payouts-preview-text {
  width: 100%;
  min-height: 420px;
  resize: vertical;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
}

.payout-shift-group {
  display: grid;
  gap: var(--gap-2);
}

.payout-slot-stack,
.payout-rental-stack {
  display: grid;
  gap: var(--gap-2);
}

.payout-slot-card,
.payout-rental-row {
  display: grid;
  gap: var(--gap-2);
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.payout-slot-card.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.payout-slot-eyebrow,
.payout-slot-main small,
.payout-rental-row span,
.payout-rental-row small,
.payout-selected-position {
  color: var(--muted);
  font-size: 12px;
}

.payout-slot-main strong,
.payout-rental-row strong {
  display: block;
  font-size: 15px;
}

.payout-slot-total,
.payout-rental-row > div:last-child {
  min-width: 110px;
  text-align: right;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.payout-candidate-grid {
  display: flex;
  gap: var(--gap-2);
  flex-wrap: wrap;
}

.payout-candidate {
  min-height: 42px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  text-align: left;
}

.payout-candidate.is-selected {
  border-color: var(--surface-strong);
  background: var(--surface-strong);
  color: #fff;
}

.payout-candidate span,
.payout-empty-candidates {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.payout-candidate.is-selected span {
  color: rgba(255, 255, 255, 0.72);
}

.payout-slot-edit {
  display: grid;
  grid-template-columns: auto auto minmax(90px, 0.7fr) minmax(150px, 1fr) minmax(90px, 0.7fr) minmax(180px, 1.2fr);
  gap: var(--gap-2);
  align-items: end;
}

.payout-check {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-2);
  min-height: 40px;
  color: var(--text);
  font-weight: 800;
}

.payout-check input {
  width: 20px;
  height: 20px;
}

@media (max-width: 980px) {
  .staff-editor-grid,
  .payouts-layout {
    grid-template-columns: 1fr;
  }

  .payouts-preview {
    position: static;
  }

  .payouts-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .staff-position-row,
  .staff-payment-card-row,
  .payout-slot-edit {
    grid-template-columns: 1fr;
  }

  .payout-slot-main,
  .payout-rental-row {
    display: grid;
  }

  .payout-slot-total,
  .payout-rental-row > div:last-child {
    text-align: left;
  }
}

@media (max-width: 620px) {
  .project-summary-actions,
  .staff-card-head,
  .staff-editor-section-head,
  .payouts-preview-head,
  .payouts-section-head {
    align-items: stretch;
    flex-direction: column;
  }

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

  .payouts-preview-text {
    min-height: 300px;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-4);
  min-height: 72px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(243, 245, 242, 0.92);
  backdrop-filter: blur(14px);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: var(--gap-3);
  min-width: 220px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: white;
  background: var(--surface-strong);
  font-weight: 750;
  letter-spacing: 0;
}

.brand-title {
  font-size: 17px;
  font-weight: 760;
  letter-spacing: 0;
}

.brand-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.operator-greeting {
  margin-left: auto;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 4px 18px rgba(22, 32, 34, 0.04);
  font-size: 14px;
  font-weight: 740;
  line-height: 1.2;
  white-space: nowrap;
}

.operator-greeting[hidden] {
  display: none;
}

.view-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 4px 18px rgba(22, 32, 34, 0.04);
}

.tab-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 650;
  text-decoration: none;
}

.tab-button.is-active {
  color: white;
  background: var(--surface-strong);
}

.workspace {
  width: min(1640px, 100%);
  margin: 0 auto;
  padding: 22px 24px 72px;
}

.access-screen {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 140px);
}

.access-panel {
  display: grid;
  gap: var(--gap-4);
  width: min(420px, 100%);
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.access-panel h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.access-panel p {
  margin: -8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.access-error {
  display: none;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.access-panel.has-error .access-error {
  display: block;
}

.estimate-grid {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: var(--gap-5);
  align-items: start;
  min-width: 0;
}

.left-rail,
.main-flow,
.database-flow,
.partners-flow {
  display: grid;
  gap: var(--gap-4);
  min-width: 0;
  max-width: 100%;
}

.main-flow > * {
  min-width: 0;
  max-width: 100%;
}

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

.estimate-meta-panel {
  overflow: hidden;
  border-color: rgba(32, 40, 43, 0.72);
  background: #20282b;
  box-shadow: 0 18px 46px rgba(18, 25, 27, 0.18);
}

.estimate-meta-panel > .panel-header {
  color: white;
  border-bottom-color: rgba(255, 255, 255, 0.12);
  background: #20282b;
}

.estimate-meta-panel .panel-title {
  color: white;
}

.estimate-meta-panel > .panel-body {
  color: white;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)),
    #20282b;
}

.estimate-meta-panel .field > span {
  color: rgba(255, 255, 255, 0.68);
}

.estimate-meta-panel .input,
.estimate-meta-panel .select,
.estimate-meta-panel .textarea {
  color: white;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color-scheme: dark;
}

.estimate-meta-panel .input::placeholder,
.estimate-meta-panel .textarea::placeholder {
  color: rgba(255, 255, 255, 0.44);
}

.estimate-meta-panel .input:focus,
.estimate-meta-panel .select:focus,
.estimate-meta-panel .textarea:focus {
  border-color: rgba(104, 211, 180, 0.9);
  box-shadow: 0 0 0 3px rgba(104, 211, 180, 0.18);
  background: rgba(255, 255, 255, 0.11);
}

.estimate-meta-panel .panel-header .button {
  border-color: rgba(255, 255, 255, 0.42);
  color: white;
  background: rgba(255, 255, 255, 0.08);
}

.estimate-meta-panel .panel-header .button:hover,
.estimate-meta-panel .panel-header .button:focus-visible {
  border-color: rgba(255, 255, 255, 0.7);
  color: white;
  background: rgba(255, 255, 255, 0.16);
}

.estimate-meta-panel .panel-header .button.primary {
  border-color: var(--accent);
  color: white;
  background: var(--accent);
}

.estimate-meta-panel .panel-header .button.primary:hover,
.estimate-meta-panel .panel-header .button.primary:focus-visible {
  background: var(--accent-strong);
}

.estimate-meta-panel .panel-header .button.danger {
  border-color: rgba(255, 180, 180, 0.42);
  color: #ffe3e3;
  background: rgba(179, 75, 75, 0.18);
}

.rental-panel {
  overflow: hidden;
}

.rental-panel-cinegear {
  border-color: rgba(31, 155, 157, 0.58);
  box-shadow: 0 18px 42px rgba(31, 155, 157, 0.12);
}

.rental-panel-cinegear > .panel-header {
  color: white;
  border-bottom-color: rgba(12, 92, 94, 0.36);
  background: #1f9b9d;
}

.rental-panel-cinegear .panel-title {
  color: white;
}

.rental-panel-cinegear .panel-header .button {
  border-color: rgba(255, 255, 255, 0.55);
  color: white;
  background: rgba(255, 255, 255, 0.14);
}

.rental-panel-cinegear .panel-header .button:hover {
  background: rgba(255, 255, 255, 0.22);
}

.cinegear-title {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 18px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-3);
  min-height: 56px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.panel-title {
  margin: 0;
  font-size: 16px;
  font-weight: 760;
  letter-spacing: 0;
}

.panel-subtitle {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.panel-body {
  padding: 16px;
}

.estimate-readiness-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-3);
  padding: 13px 16px;
  border: 1px solid #b42318;
  border-radius: var(--radius);
  color: #ffffff;
  background: #b42318;
  box-shadow: 0 14px 32px rgba(180, 35, 24, 0.22);
}

.estimate-readiness-warning div {
  display: grid;
  gap: 3px;
}

.estimate-readiness-warning strong {
  font-size: 14px;
  font-weight: 820;
}

.estimate-readiness-warning span {
  color: #ffe0dc;
  font-size: 13px;
  font-weight: 650;
}

.catalog-panel {
  overflow: hidden;
}

.catalog-panel.is-collapsed .panel-body {
  display: none;
}

.catalog-heading {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.catalog-heading .panel-title {
  white-space: nowrap;
}

.catalog-toggle {
  flex: 0 0 auto;
  min-width: 78px;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-2);
  align-items: center;
  justify-content: flex-end;
  margin-top: var(--gap-3);
  padding-top: var(--gap-3);
  border-top: 1px solid var(--border);
}

.cinegear-actions {
  border-top-color: rgba(31, 155, 157, 0.22);
}

.estimate-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap-3);
}

.client-request-details {
  margin-top: var(--gap-3);
  padding-top: var(--gap-3);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.client-request-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-3);
  min-height: 42px;
  padding: 0 9px 0 13px;
  list-style: none;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm);
  color: white;
  background: rgba(255, 255, 255, 0.07);
}

.client-request-details summary::-webkit-details-marker {
  display: none;
}

.client-request-details summary::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-right: 2px solid rgba(255, 255, 255, 0.72);
  border-bottom: 2px solid rgba(255, 255, 255, 0.72);
  transform: rotate(-45deg);
  transition: transform 0.18s ease;
}

.client-request-details[open] summary::before {
  transform: rotate(45deg);
}

.client-request-details summary span {
  flex: 1;
  font-weight: 800;
}

.client-request-details summary strong {
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
  font-weight: 750;
}

.client-request-remove {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.78);
  background: rgba(179, 75, 75, 0.16);
  font-size: 19px;
  font-weight: 800;
  line-height: 1;
}

.client-request-remove:hover,
.client-request-remove:focus-visible {
  color: white;
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(179, 75, 75, 0.44);
}

.client-request-body {
  display: grid;
  gap: var(--gap-3);
  padding: var(--gap-3) 2px 0;
}

.client-request-comment,
.client-request-service,
.client-request-meta {
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
}

.client-request-comment span,
.client-request-service span,
.client-request-meta dt {
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  font-weight: 800;
}

.client-request-comment p {
  margin: 6px 0 0;
  color: white;
  line-height: 1.45;
}

.client-request-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap-2);
}

.client-request-meta div {
  min-width: 0;
}

.client-request-meta dd {
  margin: 4px 0 0;
  color: white;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.client-request-service ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.45;
}

.shift-panel {
  overflow: hidden;
  border-color: rgba(32, 40, 43, 0.72);
  background: #20282b;
  box-shadow: 0 18px 46px rgba(18, 25, 27, 0.16);
}

.shift-panel > .panel-header {
  color: white;
  border-bottom-color: rgba(255, 255, 255, 0.12);
  background: #20282b;
}

.shift-panel .panel-title {
  color: white;
}

.shift-panel > .panel-body {
  color: white;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)),
    #20282b;
}

.shift-panel .field > span {
  color: rgba(255, 255, 255, 0.68);
}

.shift-panel .input,
.shift-panel .select,
.shift-panel .textarea {
  color: white;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color-scheme: dark;
}

.shift-panel .input::placeholder,
.shift-panel .textarea::placeholder {
  color: rgba(255, 255, 255, 0.44);
}

.shift-panel .input:focus,
.shift-panel .select:focus,
.shift-panel .textarea:focus {
  border-color: rgba(104, 211, 180, 0.9);
  box-shadow: 0 0 0 3px rgba(104, 211, 180, 0.18);
  background: rgba(255, 255, 255, 0.11);
}

.shift-panel .panel-header .button {
  border-color: rgba(255, 255, 255, 0.42);
  color: white;
  background: rgba(255, 255, 255, 0.08);
}

.shift-panel .panel-header .button:hover,
.shift-panel .panel-header .button:focus-visible {
  border-color: rgba(255, 255, 255, 0.7);
  color: white;
  background: rgba(255, 255, 255, 0.16);
}

.shift-panel .panel-header .button.primary {
  border-color: var(--accent);
  color: white;
  background: var(--accent);
}

.shift-panel .panel-header .button.primary:hover,
.shift-panel .panel-header .button.primary:focus-visible {
  background: var(--accent-strong);
}

.shift-panel .panel-header .button.danger {
  border-color: rgba(255, 180, 180, 0.42);
  color: #ffe3e3;
  background: rgba(179, 75, 75, 0.18);
}

.shift-body {
  display: grid;
  gap: var(--gap-3);
}

.shift-tabs {
  display: flex;
  gap: var(--gap-2);
  overflow-x: auto;
  padding-bottom: 2px;
}

.shift-tab {
  display: grid;
  gap: 2px;
  min-width: 132px;
  min-height: 52px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-sm);
  color: white;
  background: rgba(255, 255, 255, 0.08);
  text-align: left;
  cursor: grab;
}

.shift-tab:active {
  cursor: grabbing;
}

.shift-tab span {
  overflow: hidden;
  font-size: 13px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shift-tab small {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 720;
}

.shift-tab.is-active {
  border-color: var(--accent);
  color: white;
  background: var(--accent);
}

.shift-tab.is-active small {
  color: rgba(255, 255, 255, 0.82);
}

.shift-tab.is-dragging {
  opacity: 0.55;
  transform: scale(0.98);
}

.shift-tab.is-drop-target {
  border-color: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.22);
}

.active-shift-fields {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(180px, 260px) minmax(240px, 1fr) max-content;
  gap: var(--gap-3);
  align-items: end;
}

.shift-mini-fields {
  display: grid;
  grid-template-columns: repeat(2, 72px);
  gap: var(--gap-2);
  justify-self: end;
  align-items: end;
}

.shift-mini-fields .field {
  min-width: 0;
}

.shift-mini-fields .field > span {
  white-space: nowrap;
}

.shift-mini-fields .input {
  min-height: 40px;
  padding-inline: 8px;
  text-align: center;
}

.date-text-field {
  position: relative;
  display: grid;
}

.date-text-field .input {
  padding-right: 44px;
}

.date-picker-button {
  position: absolute;
  top: 50%;
  right: 10px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
  transform: translateY(-50%);
  cursor: pointer;
}

.date-picker-button:hover,
.date-picker-button:focus-visible {
  color: white;
}

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

.field.is-wide {
  grid-column: span 2;
}

.field > span,
.compact-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text);
  background: var(--surface);
  outline: none;
}

.textarea {
  min-height: 76px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-2);
  align-items: center;
}

.mobile-label {
  display: none;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--surface);
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.button:hover,
.button:focus-visible {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.button.primary {
  border-color: var(--accent);
  color: white;
  background: var(--accent);
}

.button.primary:hover,
.button.primary:focus-visible {
  color: white;
  background: var(--accent-strong);
}

.button.dark {
  border-color: var(--surface-strong);
  color: white;
  background: var(--surface-strong);
}

.button.danger {
  border-color: rgba(179, 75, 75, 0.35);
  color: var(--danger);
  background: #fff7f7;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.button.small {
  min-height: 32px;
  padding: 0 9px;
  font-size: 12px;
}

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

.button.session-button {
  width: 42px;
  min-width: 42px;
  padding: 0;
}

.button.history-button {
  width: 38px;
  min-width: 38px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.estimate-meta-panel .panel-header .history-button,
.estimate-meta-panel .panel-header .session-button {
  border-color: rgba(255, 255, 255, 0.42);
  color: white;
  background: rgba(255, 255, 255, 0.08);
}

.estimate-meta-panel .panel-header .history-button:hover,
.estimate-meta-panel .panel-header .history-button:focus-visible,
.estimate-meta-panel .panel-header .session-button:hover,
.estimate-meta-panel .panel-header .session-button:focus-visible {
  border-color: rgba(255, 255, 255, 0.7);
  color: white;
  background: rgba(255, 255, 255, 0.16);
}

.session-button svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.session-button-fallback {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.search-row {
  display: grid;
  gap: var(--gap-2);
}

.category-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--gap-2);
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 2px;
}

.chip {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.chip.is-active {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.catalog-list {
  display: grid;
  gap: var(--gap-2);
  max-height: calc(100vh - 300px);
  min-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.estimate-add-panel {
  position: relative;
}

.estimate-catalog-popover {
  position: absolute;
  top: calc(100% + 4px);
  left: 14px;
  z-index: 32;
  display: grid;
  gap: 10px;
  width: min(660px, calc(100vw - 96px));
  max-height: 520px;
  overflow: hidden;
  padding: 12px;
  border: 1px solid var(--cg-line);
  border-radius: 12px;
  background: var(--cg-surface);
  box-shadow: 0 20px 60px rgba(9, 28, 37, 0.28);
}

.estimate-catalog-popover-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 28px;
  gap: 10px;
  align-items: center;
}

.estimate-catalog-popover-head strong {
  color: var(--cg-ink);
  font-size: 14px;
}

.estimate-catalog-popover-head span {
  color: var(--cg-mute);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
}

.catalog-close-button {
  display: grid;
  place-items: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  border: 1px solid var(--cg-line-2);
  border-radius: 7px;
  color: var(--cg-ink-4);
  background: var(--cg-surface);
  font-size: 13px;
  line-height: 1;
}

.catalog-popover-list,
.catalog-modal-list {
  min-height: 0;
}

.product-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  min-height: 124px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.catalog-picker-modal .product-card,
.estimate-catalog-popover .product-card {
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  min-height: 44px;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--cg-surface);
}

.catalog-picker-modal .product-image,
.estimate-catalog-popover .product-image {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.catalog-picker-modal .product-card > div:nth-child(2),
.estimate-catalog-popover .product-card > div:nth-child(2) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px 92px 90px;
  gap: 8px;
  align-items: center;
}

.catalog-picker-modal .product-name,
.estimate-catalog-popover .product-name,
.catalog-picker-modal .product-footer,
.estimate-catalog-popover .product-footer {
  display: contents;
}

.catalog-picker-modal .product-name > span:first-child,
.estimate-catalog-popover .product-name > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-picker-modal .product-note,
.estimate-catalog-popover .product-note {
  display: none;
}

.product-card.is-keyboard-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29, 157, 160, 0.16);
  background: #f3fbfa;
}

.product-mobile-meta {
  display: none;
}

.product-image {
  width: 58px;
  height: 58px;
  overflow: hidden;
  border-radius: 7px;
  background: #e7ebe7;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-card > div:nth-child(2) {
  min-width: 0;
}

.product-name {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--gap-2);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.25;
}

.product-name > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.product-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-2);
  margin-top: 8px;
}

.product-footer .button {
  flex: 0 0 auto;
  min-width: 78px;
}

.catalog-stepper {
  display: grid;
  grid-template-columns: 32px 34px 32px;
  align-items: center;
  flex: 0 0 auto;
  min-height: 38px;
  overflow: hidden;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.stepper-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 38px;
  border: 0;
  color: var(--accent-strong);
  background: transparent;
  font-size: 18px;
  font-weight: 850;
  line-height: 1;
}

.stepper-button:hover,
.stepper-button:focus-visible {
  color: white;
  background: var(--accent);
  outline: none;
}

.stepper-button.is-plus {
  color: white;
  background: var(--accent);
}

.stepper-button.is-plus:hover,
.stepper-button.is-plus:focus-visible {
  background: var(--accent-strong);
}

.stepper-count {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 38px;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.price-pill,
.owner-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.price-pill {
  color: var(--surface-strong);
  background: #e9ece8;
  flex: 0 0 auto;
}

.owner-pill {
  color: var(--blue);
  background: #e8f0f8;
  max-width: min(170px, calc(100% - 92px));
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-pill {
  border: 1px solid var(--cg-line-2);
  color: var(--cg-ink-4);
  background: transparent;
  min-width: 0;
  max-width: calc(100% - 112px);
  overflow: hidden;
  text-overflow: ellipsis;
}

.partner-rule-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  white-space: nowrap;
}

.partner-rule-badge.is-custom {
  border-color: #d0dfdc;
  background: #edf5f2;
  color: #24574f;
}

.partner-rule-badge.is-expense {
  border-color: #ead6b7;
  background: #fff5e6;
  color: #855a18;
}

.db-owner-stack {
  display: grid;
  gap: 4px;
  justify-items: start;
}

.catalog-picker-modal .price-pill,
.estimate-catalog-popover .price-pill {
  justify-content: flex-end;
  min-width: 0;
  padding-inline: 0;
  color: var(--cg-ink);
  background: transparent;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
}

.catalog-picker-modal .status-pill,
.estimate-catalog-popover .status-pill {
  justify-content: center;
  max-width: none;
  font-size: 11px;
}

.catalog-picker-modal .product-footer .button,
.estimate-catalog-popover .product-footer .button,
.catalog-picker-modal .catalog-stepper,
.estimate-catalog-popover .catalog-stepper {
  justify-self: end;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap-3);
}

.summary-strip.is-single-total {
  grid-template-columns: minmax(0, 1fr);
}

.metric {
  min-height: 84px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric-value {
  margin-top: 8px;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: 0;
}

.metric.is-primary-total .metric-value {
  color: var(--accent-strong);
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1;
}

.metric-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

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

.data-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: separate;
  border-spacing: 0;
}

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

.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 11px;
  font-weight: 780;
  text-transform: uppercase;
  letter-spacing: 0;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table .number-cell {
  text-align: right;
  white-space: nowrap;
}

.row-input,
.row-select {
  width: 100%;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 6px 7px;
  background: transparent;
  color: var(--text);
}

.row-input:hover,
.row-input:focus,
.row-select:hover,
.row-select:focus {
  border-color: var(--border-strong);
  background: white;
  outline: none;
}

.row-input.number {
  text-align: right;
}

.row-input.is-price-overridden {
  border-color: rgba(227, 167, 53, 0.48);
  background: #fff8ea;
  color: #8a4f00;
  font-weight: 760;
}

.row-input.is-price-overridden:hover,
.row-input.is-price-overridden:focus {
  border-color: #e3a735;
  background: #fff4d8;
  box-shadow: 0 0 0 2px rgba(227, 167, 53, 0.14);
}

.line-full-input,
.line-full-output {
  font-weight: 720;
}

.line-full-output {
  display: block;
  width: 100%;
  min-height: 28px;
  padding: 5px 0;
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.line-full-output.is-price-overridden {
  color: #8a4f00;
  font-weight: 760;
}

.line-qty-stepper {
  display: grid;
  grid-template-columns: 28px minmax(34px, 1fr) 28px;
  align-items: center;
  min-width: 92px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.line-stepper-button {
  width: 28px;
  height: 34px;
  font-size: 16px;
}

.line-qty-input {
  min-height: 34px;
  border-radius: 0;
  border-top: 0;
  border-bottom: 0;
  border-color: var(--border);
  text-align: center;
  font-weight: 760;
  background: white;
}

.line-qty-input:hover,
.line-qty-input:focus {
  border-color: var(--border-strong);
}

.line-name-cell {
  min-width: 260px;
}

.line-name-editor-wrap {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: start;
}

tr.is-manual-line .line-name-editor-wrap {
  padding-left: 10px;
}

tr.is-manual-line .line-name-editor-wrap::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 3px;
  height: 22px;
  border-radius: 999px;
  background: var(--manual-marker);
}

.line-name-editor {
  min-height: 36px;
  max-height: 38px;
  resize: none;
  overflow: hidden;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

.line-name-editor:hover,
.line-name-editor:focus {
  min-height: 88px;
  max-height: 160px;
  overflow: auto;
  white-space: pre-wrap;
}

.line-mod-button {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid #9bc9c0;
  border-radius: var(--radius-sm);
  color: var(--accent-strong);
  background: #eefaf7;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.line-mod-button:hover,
.line-mod-button:focus-visible {
  border-color: var(--accent);
  color: white;
  background: var(--accent);
  outline: none;
}

.line-db-button {
  border-color: rgba(20, 132, 108, 0.32);
  color: var(--accent-strong);
  background: #eefaf7;
}

.line-db-button:hover,
.line-db-button:focus-visible {
  border-color: var(--accent);
  color: white;
  background: var(--accent);
  outline: none;
}

.line-replace-button {
  border-color: rgba(63, 112, 168, 0.34);
  color: #3f70a8;
  background: #eef5ff;
  font-size: 16px;
  font-weight: 900;
}

.line-replace-button:hover,
.line-replace-button:focus-visible {
  border-color: #3f70a8;
  color: white;
  background: #3f70a8;
  outline: none;
}

.line-ext-button {
  border-color: rgba(154, 78, 45, 0.34);
  color: #9a4e2d;
  background: #fff3e8;
}

.line-ext-button:hover,
.line-ext-button:focus-visible {
  border-color: #9a4e2d;
  color: white;
  background: #9a4e2d;
  outline: none;
}

.line-return-button {
  border-color: rgba(20, 132, 108, 0.32);
  color: var(--accent-strong);
  background: #eefaf7;
}

.line-return-button:hover,
.line-return-button:focus-visible {
  border-color: var(--accent);
  color: white;
  background: var(--accent);
  outline: none;
}

.row-textarea {
  display: block;
  min-height: 42px;
  max-height: 220px;
  resize: vertical;
  line-height: 1.25;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.row-textarea.compact {
  min-height: 34px;
  resize: none;
}

.line-comment-editor {
  min-height: 42px;
  max-height: 62px;
}

.auto-grow-textarea {
  overflow-y: hidden;
  resize: none;
}

.line-comment-editor.is-comment-expanded {
  min-height: 108px;
  max-height: 360px;
}

.line-comment-stack {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.line-comment-display {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 128px;
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 4px 7px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: text;
}

.line-comment-display:hover,
.line-comment-display:focus-visible {
  border-color: var(--border);
  color: var(--text);
  background: var(--surface-soft);
  outline: none;
}

.line-comment-display span {
  display: block;
  min-width: 0;
  overflow: hidden;
  font-size: 11.5px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-comment-display.is-empty {
  color: var(--muted);
  opacity: 0.72;
}

.line-kind-select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 5px 7px;
  color: var(--muted);
  background: white;
  font-size: 12px;
  font-weight: 720;
}

.line-kind-select:hover,
.line-kind-select:focus {
  border-color: var(--border-strong);
  color: var(--text);
  outline: none;
}

.line-scout-toggle {
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 2px 7px;
  width: fit-content;
  max-width: 100%;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.05;
}

.line-scout-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.line-scout-toggle span,
.line-scout-toggle small {
  white-space: nowrap;
}

.line-scout-toggle small {
  grid-column: 2;
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
}

.line-scout-toggle.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.line-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-start;
}

.line-status-button {
  min-height: 34px;
  padding-inline: 10px;
  white-space: nowrap;
}

.summary-label-input {
  min-height: 48px;
  resize: none;
  overflow: hidden;
  font-weight: 760;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.row-actions .line-status-actions {
  display: contents;
}

.mobile-line-card-cell {
  display: none;
}

.line-thumb {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 11px;
  font-weight: 800;
}

.line-thumb-button {
  cursor: pointer;
  padding: 0;
  font: inherit;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.line-thumb-button:hover,
.line-thumb-button:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
  transform: translateY(-1px);
}

.line-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mobile-line-editor-backdrop {
  place-items: center;
}

.mobile-line-editor-modal {
  width: min(344px, 100%);
  gap: 13px;
  border-radius: 18px;
  padding: 16px;
}

.mobile-line-editor-head {
  display: grid;
  gap: 3px;
}

.mobile-line-editor-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  line-height: 1;
  text-transform: uppercase;
}

.mobile-line-editor-head strong {
  overflow-wrap: anywhere;
  font-size: 20px;
  line-height: 1.15;
}

.mobile-line-editor-input {
  width: 100%;
  min-height: 48px;
  border-color: var(--border-strong);
  background: var(--surface-soft);
  font-size: 18px;
}

textarea.mobile-line-editor-input {
  min-height: 96px;
  resize: vertical;
}

.mobile-line-qty-editor {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 56px;
  align-items: center;
  min-height: 54px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #f2f4f1;
}

.mobile-line-qty-editor button {
  display: grid;
  place-items: center;
  height: 54px;
  border: 0;
  color: var(--text);
  background: transparent;
  font-size: 24px;
  font-weight: 850;
}

.mobile-line-qty-editor span {
  display: grid;
  place-items: center;
  height: 54px;
  border-inline: 1px solid rgba(20, 120, 100, 0.52);
  color: var(--text);
  font-size: 22px;
  font-weight: 520;
}

.mobile-line-editor-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mobile-line-editor-actions .button {
  min-height: 44px;
}

.mobile-line-bulk-modal {
  width: min(372px, 100%);
}

.mobile-line-bulk-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.mobile-line-bulk-field {
  display: grid;
  gap: 6px;
}

.mobile-line-bulk-field > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  line-height: 1;
  text-transform: uppercase;
}

.mobile-line-bulk-qty {
  min-height: 50px;
}

.mobile-line-bulk-qty button,
.mobile-line-bulk-qty span {
  height: 50px;
}

.mobile-line-quick-discounts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.mobile-line-quick-discounts .button {
  min-width: 0;
  min-height: 44px;
  padding-inline: 4px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
}

.mobile-line-bulk-preview {
  min-height: 38px;
  padding: 10px 12px;
  border: 1px solid var(--cg-yellow-line);
  border-radius: 9px;
  color: var(--cg-yellow-ink);
  background: var(--cg-yellow-bg);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
}

.line-settings-card {
  display: grid;
  gap: var(--gap-3);
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.setting-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  cursor: pointer;
}

.setting-toggle input {
  width: 20px;
  height: 20px;
  margin: 0;
}

.setting-toggle span {
  display: grid;
  gap: 3px;
}

.setting-toggle small,
.settings-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.modifier-picker-list {
  display: grid;
  gap: var(--gap-2);
  max-height: min(60vh, 620px);
  overflow: auto;
  padding-right: 6px;
}

.drag-handle {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--muted);
  background: var(--surface);
  cursor: grab;
  user-select: none;
}

tr.is-dragging {
  opacity: 0.45;
}

tr.is-drop-target td {
  box-shadow: inset 0 2px 0 var(--accent);
}

.section-title-row td {
  padding-top: 16px;
  color: var(--surface-strong);
  background: #f0f3ef;
  font-weight: 800;
}

.total-row td {
  color: var(--surface-strong);
  background: #f8faf7;
  font-weight: 780;
}

.discount-summary-row td {
  padding-top: 8px;
  color: var(--muted);
  background: #f8faf7;
  font-size: 13px;
  font-weight: 760;
}

.discount-summary-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 850;
  white-space: nowrap;
}

.rental-card {
  --rental-tone: var(--border-strong);
  --rental-tone-soft: var(--surface-soft);
  --rental-tone-ink: var(--muted);
  --rental-border: var(--border);
  overflow: hidden;
  border: 1px solid var(--rental-border);
  border-left: 6px solid var(--rental-tone);
  border-radius: var(--radius);
  background: var(--surface);
}

.rental-card.is-tone-yellow {
  --rental-tone: #e5b821;
  --rental-tone-soft: #fff6d8;
  --rental-tone-ink: #8a5a05;
  --rental-border: #ead37b;
}

.rental-card.is-tone-coral {
  --rental-tone: #d77d5f;
  --rental-tone-soft: #fff0e9;
  --rental-tone-ink: #96492f;
  --rental-border: #edc5b6;
}

.rental-card.is-tone-blue {
  --rental-tone: #5f8fc7;
  --rental-tone-soft: #eef6ff;
  --rental-tone-ink: #335f8f;
  --rental-border: #b9d1ec;
}

.rental-card.is-tone-green {
  --rental-tone: #7ca96c;
  --rental-tone-soft: #f0f8ec;
  --rental-tone-ink: #4f7c3f;
  --rental-border: #c2dcb8;
}

.rental-card.is-tone-lavender {
  --rental-tone: #9b86b8;
  --rental-tone-soft: #f5f0fb;
  --rental-tone-ink: #6a538a;
  --rental-border: #d3c7e4;
}

.rental-card + .rental-card {
  margin-top: var(--gap-3);
}

.rental-head {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: var(--gap-3);
  align-items: end;
  padding: 12px;
  border-bottom: 1px solid var(--rental-border);
  background: var(--rental-tone-soft);
}

.rental-actions {
  justify-content: flex-end;
  align-self: end;
}

.rental-name-control {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}

.rental-color-bullet {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--rental-tone);
  box-shadow: inset 0 0 0 1px rgba(31, 42, 47, 0.12);
}

.total-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.total-table .summary-col-position {
  width: 26%;
}

.total-table .summary-col-people,
.total-table .summary-col-hours {
  width: 6%;
}

.total-table .summary-col-rate {
  width: 7%;
}

.total-table .summary-col-money {
  width: 10%;
}

.total-table .summary-col-comment {
  width: 27%;
}

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

.total-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0;
}

.total-table-head-groups th[rowspan] {
  vertical-align: bottom;
}

.total-table .summary-overtime-head {
  border-right: 1px solid var(--border);
  border-bottom: 0;
  border-left: 1px solid var(--border);
  color: var(--surface-strong);
  background: var(--surface-soft);
  text-align: center;
}

.total-table-head-sub th {
  padding-top: 5px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 10px;
}

.total-table-head-sub th:first-child {
  border-left: 1px solid var(--border);
}

.total-table-head-sub th:last-child {
  border-right: 1px solid var(--border);
}

.total-table .money {
  text-align: right;
  white-space: nowrap;
}

.total-table .number-cell {
  text-align: right;
  white-space: nowrap;
}

.total-table th:nth-child(1),
.total-table td:nth-child(1) {
  width: 26%;
}

.total-table th:nth-child(1) {
  font-weight: 650;
}

.total-table tr.is-tone-yellow {
  --summary-rental-tone: #e5b821;
}

.total-table tr.is-tone-coral {
  --summary-rental-tone: #d77d5f;
}

.total-table tr.is-tone-blue {
  --summary-rental-tone: #5f8fc7;
}

.total-table tr.is-tone-green {
  --summary-rental-tone: #7ca96c;
}

.total-table tr.is-tone-lavender {
  --summary-rental-tone: #9b86b8;
}

.total-table th:nth-child(2),
.total-table td:nth-child(2),
.total-table th:nth-child(4),
.total-table td:nth-child(4) {
  width: 6%;
}

.total-table th:nth-child(3),
.total-table td:nth-child(3) {
  width: 7%;
}

.total-table th:nth-child(5),
.total-table td:nth-child(5),
.total-table th:nth-child(6),
.total-table td:nth-child(6) {
  width: 10%;
}

.total-table th:nth-child(7),
.total-table td:nth-child(7) {
  width: 27%;
}

.total-table .row-input {
  min-height: 32px;
  font-weight: 400;
}

.total-table .summary-label-input {
  font-weight: 400;
}

.summary-label-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  min-width: 0;
}

.summary-label-cell.has-rental-bullet .summary-label-wrap {
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 8px;
}

.summary-rental-bullet {
  width: 9px;
  height: 9px;
  margin-top: 11px;
  border-radius: 50%;
  background: var(--summary-rental-tone, var(--border-strong));
  box-shadow: inset 0 0 0 1px rgba(31, 42, 47, 0.12);
}

.total-table .row-input[readonly],
.total-table .row-input.is-readonly {
  color: var(--muted);
  background: var(--surface-soft);
}

.summary-empty {
  display: inline-flex;
  justify-content: flex-end;
  width: 100%;
  color: var(--muted);
}

.summary-static-number {
  display: inline-flex;
  justify-content: flex-end;
  width: 100%;
  font-weight: 500;
}

.summary-static-text {
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 7px 8px;
  color: var(--surface-strong);
  line-height: 1.2;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  white-space: pre-wrap;
}

.summary-note-static {
  color: var(--muted);
}

.summary-comment-list {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 42px;
  margin: 0;
  padding: 7px 8px 7px 22px;
  color: var(--muted);
  line-height: 1.25;
}

.summary-comment-list li {
  padding-left: 2px;
}

.total-panel .total-table .summary-note-input {
  min-height: 44px;
  max-height: none;
  overflow-y: hidden;
  resize: none;
}

.summary-not-applicable {
  display: inline-flex;
  justify-content: flex-end;
  width: 100%;
  color: var(--muted);
}

.total-table .summary-client-cell.is-not-applicable {
  text-align: right;
}

.total-table tr.is-overridden .row-input {
  border-color: rgba(18, 120, 96, 0.2);
  background: #f4fbf8;
}

.total-panel .total-table .summary-group-row td {
  padding: 22px 8px 8px;
  border-bottom: 0;
  background: var(--surface);
}

.total-panel .total-table .summary-group-row:first-child td {
  padding-top: 4px;
}

.summary-group-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 24px;
  padding: 0;
  color: var(--surface-strong);
  background: transparent;
}

.summary-group-label span {
  font-size: 12px;
  font-weight: 650;
  line-height: 1.1;
  text-transform: uppercase;
}

.summary-group-label small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.1;
  white-space: nowrap;
}

.total-panel .total-table tr.is-crew-summary-row td:first-child,
.total-panel .total-table tr.is-overtime-summary-row td:first-child {
  padding-left: 28px;
}

.total-panel .total-table tr.is-crew-summary-row .summary-label-input,
.total-panel .total-table tr.is-overtime-summary-row .summary-label-input {
  font-weight: 400;
}

.total-panel .total-table tr.is-overtime-summary-row .summary-label-input {
  color: var(--text);
}

.total-panel .total-table tr.is-summary-aggregate-row td:first-child {
  padding-left: 8px;
}

.total-panel .total-table tr.is-summary-aggregate-row .summary-label-input {
  min-height: 34px;
  font-weight: 720;
}

.total-panel .total-table tr.is-crew-summary-row.is-summary-aggregate-row .summary-label-input,
.total-panel .total-table tr.is-overtime-summary-row.is-summary-aggregate-row .summary-label-input,
.total-panel .total-table tr.is-crew-summary-row.is-summary-aggregate-row .summary-static-number,
.total-panel .total-table tr.is-overtime-summary-row.is-summary-aggregate-row .summary-static-number {
  font-weight: 400;
}

.total-panel .total-table tr.is-summary-aggregate-row .summary-note-static {
  max-height: none;
  overflow: visible;
}

.total-panel .total-table tr.is-summary-aggregate-row .summary-note-input {
  min-height: 68px;
}

.total-panel .total-table tr.is-readonly-summary-row td {
  background: #fbfcfb;
}

.total-panel .total-table tr.is-crew-summary-row.is-summary-aggregate-row td,
.total-panel .total-table tr.is-overtime-summary-row.is-summary-aggregate-row td {
  background: transparent;
}

.total-panel .total-table tr.is-total-summary-row td {
  border-top: 2px solid var(--surface-strong);
  background: #f0f5f1;
}

.total-panel .total-table tr.is-total-summary-row .row-input {
  font-weight: 700;
}

.readonly-total-table td {
  font-weight: 650;
}

.all-shifts-total-panel {
  box-shadow: 0 12px 30px rgba(22, 32, 34, 0.05);
}

.all-shifts-total-panel .panel-header {
  min-height: 52px;
  padding: 14px 18px;
  background: var(--surface);
}

.all-shifts-total-panel .panel-body {
  padding: 14px 18px 18px;
}

.all-shifts-total-panel .table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.all-shifts-summary-table {
  min-width: 780px;
}

.all-shifts-summary-table .all-shifts-col-date {
  width: 36%;
}

.all-shifts-summary-table .all-shifts-col-full,
.all-shifts-summary-table .all-shifts-col-client {
  width: 16%;
}

.all-shifts-summary-table .all-shifts-col-note {
  width: 32%;
}

.all-shifts-total-panel .all-shifts-summary-table th,
.all-shifts-total-panel .all-shifts-summary-table td {
  padding: 11px 14px;
}

.all-shifts-total-panel .all-shifts-summary-table th {
  color: #6d787e;
  background: #f7f9f7;
  font-size: 11px;
  font-weight: 760;
}

.readonly-total-table .all-shifts-main-row td {
  color: var(--surface-strong);
  border-top: 1px solid #e2e8e4;
  border-bottom: 1px solid #e2e8e4;
  background: #fbfcfb;
  font-size: 14px;
  font-weight: 720;
}

.readonly-total-table .all-shifts-main-row td:first-child {
  padding-left: 16px;
  box-shadow: inset 3px 0 0 var(--accent);
  font-size: 15px;
  font-weight: 820;
}

.readonly-total-table .all-shifts-main-row .money {
  color: var(--surface-strong);
  font-size: 15px;
  font-weight: 820;
}

.all-shifts-row-note {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 560;
  line-height: 1.35;
}

.readonly-total-table .all-shifts-overtime-row td {
  color: var(--muted);
  background: #ffffff;
  font-size: 12px;
  font-weight: 560;
}

.readonly-total-table .all-shifts-overtime-row td:first-child {
  padding-left: 32px;
}

.readonly-total-table .all-shifts-overtime-row .money {
  color: var(--surface-strong);
  font-weight: 700;
}

.all-shifts-total-panel .readonly-total-table .total-row td {
  padding-top: 12px;
  padding-bottom: 12px;
  border-top: 2px solid var(--surface-strong);
  color: var(--surface-strong);
  background: #f2f6f3;
  font-size: 15px;
  font-weight: 850;
}

.total-table tbody tr:last-child .row-input {
  font-weight: 650;
}

.discounted {
  color: var(--accent-strong);
  font-weight: 800;
}

.old-price {
  color: var(--muted);
  text-decoration: line-through;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 140px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface-soft);
  text-align: center;
}

.rental-empty-state {
  justify-content: flex-start;
  min-height: 0;
  border: 0;
  background: transparent;
  gap: var(--gap-2);
  padding: 0;
}

.text-import-form {
  display: grid;
  gap: var(--gap-3);
}

.external-import-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap-3);
}

.text-import-input {
  min-height: 180px;
  resize: vertical;
}

.import-suggestions {
  display: grid;
  gap: var(--gap-2);
}

.import-meta-review {
  display: grid;
  gap: var(--gap-3);
  padding: 12px;
  border: 1px solid rgba(18, 120, 96, 0.18);
  border-radius: var(--radius-sm);
  background: #f3fbf8;
}

.import-meta-title {
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 820;
  text-transform: uppercase;
}

.import-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap-3);
}

.import-meta-field {
  display: grid;
  gap: var(--gap-1);
}

.import-meta-field.is-empty {
  opacity: 0.72;
}

.import-meta-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.import-meta-source,
.import-meta-empty {
  color: var(--muted);
  font-size: 12px;
}

.import-apply-panel {
  display: grid;
  gap: var(--gap-3);
  padding: 12px;
  border: 1px solid rgba(33, 39, 42, 0.08);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.import-apply-panel strong {
  display: block;
  color: var(--text);
  font-size: 0.95rem;
}

.import-apply-panel span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.import-apply-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--gap-2);
}

.import-apply-grid .export-button {
  min-width: 0;
  min-height: 52px;
  padding: 10px 12px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.project-hub-modal {
  width: min(440px, 100%);
  gap: 0;
  padding: 20px;
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(16, 49, 47, 0.16);
}

.project-hub-modal .modal-head {
  margin-bottom: 16px;
}

.project-hub-modal .modal-head h2 {
  font-size: 16px;
  font-weight: 600;
}

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

.reset-choice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap-2);
}

.project-action-card,
.reset-choice-card {
  min-height: 78px;
  padding: 12px 16px;
}

.reset-choice-card {
  min-height: 66px;
  justify-items: start;
  text-align: left;
}

.project-action-card {
  appearance: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 118px;
  padding: 16px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  background: var(--surface);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.12s ease,
    background 0.12s ease;
}

.project-action-card:hover,
.project-action-card:focus-visible {
  border-color: var(--surface-strong);
  background: #f7faf9;
  outline: none;
}

.project-action-card.is-fired {
  border-color: var(--accent-strong);
  background: #f7faf9;
}

.project-action-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-action-icon {
  display: block;
  width: 20px;
  height: 20px;
  color: var(--accent-strong);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.project-action-key {
  min-width: 20px;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--muted);
  background: var(--surface-muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

.project-action-label,
.reset-choice-card strong {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.12;
}

.project-action-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.reset-choice-card span {
  max-width: 340px;
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.25;
}

.reset-choice-card.primary span {
  color: rgba(255, 255, 255, 0.78);
}

.reset-choice-card.danger span {
  color: #9b5c55;
}

.project-open-drop-zone {
  min-height: 78px;
  padding: 12px 16px;
  border-style: dashed;
  background: var(--surface-soft);
}

.cloud-open-button {
  position: relative;
  display: grid;
  grid-template-columns: auto auto;
  gap: 2px 8px;
  align-items: center;
  min-height: 42px;
  padding: 6px 10px;
  border-color: #e9d97a;
  color: #13394a;
  background: #fcee8d;
  box-shadow: none;
}

.cloud-open-button.has-unread {
  box-shadow: 0 0 0 4px rgba(252, 238, 141, 0.35);
}

.cloud-open-main {
  font-weight: 800;
}

.cloud-open-save {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.cloud-open-status,
.cloud-open-save {
  color: #7a5d00;
  font-size: 10px;
  line-height: 1;
}

.cloud-open-count {
  position: absolute;
  top: -7px;
  right: -7px;
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  padding: 0 5px;
  border-radius: 5px;
  color: #fff;
  background: #13394a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 800;
}

.cloud-admin-mode-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 7px 14px;
  border-bottom: 1px solid #f0e3a8;
  background: #fff9e3;
}

.cloud-admin-mode-strip span {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 5px;
  color: #13394a;
  background: #fcee8d;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.cloud-admin-mode-strip strong {
  min-width: 0;
  flex: 1;
  color: #7a5d00;
  font-size: 12px;
}

.cloud-modal {
  width: min(1180px, 96vw);
  max-height: calc(100vh - 52px);
  overflow: auto;
  gap: 0;
  padding: 0;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(9, 28, 37, 0.2);
}

.cloud-modal-head {
  position: sticky;
  top: 0;
  z-index: 3;
  align-items: flex-start;
  margin: 0;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #e7ecec;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
}

.cloud-modal-kicker {
  display: block;
  margin-bottom: 5px;
  color: #677579;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.cloud-modal-head h2 {
  font-size: 24px;
  line-height: 1.1;
}

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

.cloud-create-button {
  border-color: #e9d97a;
  color: #13394a;
  background: #fcee8d;
}

.cloud-tabs {
  display: flex;
  gap: 20px;
  padding: 0 20px;
  border-bottom: 1px solid #e7ecec;
  background: #fff;
}

.cloud-tab {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-bottom: 2px solid transparent;
  color: #677579;
  background: transparent;
  font: inherit;
  font-weight: 700;
}

.cloud-tab.is-active {
  border-bottom-color: #13394a;
  color: #101f24;
  font-weight: 800;
}

.cloud-tab b {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  padding: 0 6px;
  border-radius: 5px;
  color: #13394a;
  background: #f7f9f9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.cloud-tab:nth-child(2) b {
  background: #fff9e3;
}

.cloud-toolbar,
.cloud-legacy-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid #f1f4f5;
  background: #fff;
}

.cloud-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  overflow: visible;
}

.cloud-filter-chip {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #dae2e3;
  border-radius: 6px;
  color: #324348;
  background: #fff;
  font-size: 12px;
  font-weight: 750;
}

.cloud-filter-chip.is-active {
  border-color: #13394a;
  color: #fff;
  background: #13394a;
}

.cloud-autosave-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #2f6b52;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.cloud-autosave-state span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.cloud-autosave-state.is-saving {
  color: #95a1a5;
}

.cloud-autosave-state.is-failed {
  color: #b04a3a;
}

.cloud-projects-list,
.cloud-inbox-list,
.cloud-admin-list {
  display: grid;
  min-height: 280px;
  align-content: start;
  padding: 8px 20px 18px;
  background: #fff;
}

.cloud-project-row,
.cloud-admin-row {
  border-bottom: 1px solid #f1f4f5;
}

.cloud-project-row.is-unread,
.cloud-admin-row.is-your-move {
  background: #fffcef;
}

.cloud-project-open {
  appearance: none;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 148px 118px 196px;
  gap: 14px;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 5px 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
}

.cloud-project-row.is-unread .cloud-project-open::before,
.cloud-admin-row.is-your-move .cloud-project-open::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d9a400;
}

.cloud-project-row.is-unread .cloud-project-open,
.cloud-admin-row.is-your-move .cloud-project-open {
  grid-template-columns: 12px minmax(220px, 1fr) 148px 118px 196px;
}

.cloud-project-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.cloud-project-main strong,
.cloud-project-main small,
.cloud-project-event em,
.cloud-project-event small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cloud-project-main strong {
  color: #132628;
  font-size: 13.5px;
  font-weight: 800;
}

.cloud-project-main small,
.cloud-project-event {
  color: #677579;
  font-size: 11px;
}

.cloud-project-main code {
  color: #13394a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 800;
}

.cloud-status-chip {
  justify-self: start;
  padding: 3px 8px;
  border: 1px solid #e7ecec;
  border-radius: 6px;
  color: #324348;
  background: #f7f9f9;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.cloud-status-chip.is-waiting {
  border-color: #d3e5e9;
  color: #13394a;
  background: #e3edf1;
}

.cloud-status-chip.is-revision {
  border-color: #ebd2cc;
  color: #b04a3a;
  background: #fbedea;
}

.cloud-status-chip.is-action {
  border-color: #f0e3a8;
  color: #7a5d00;
  background: #fff9e3;
}

.cloud-status-chip.is-approved {
  border-color: #cfe2d8;
  color: #2f6b52;
  background: #e7f1ec;
}

.cloud-status-chip.is-closed {
  border-color: #13394a;
  color: #fff;
  background: #13394a;
}

.cloud-status-chip.is-archive {
  border-style: dashed;
  color: #677579;
  background: #fff;
}

.cloud-project-money {
  display: grid;
  justify-items: end;
  gap: 1px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.cloud-project-money s {
  color: #95a1a5;
  font-size: 10.5px;
}

.cloud-project-money b {
  color: #101f24;
  font-size: 13.5px;
  font-weight: 900;
}

.cloud-project-event {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.cloud-project-event em {
  color: #5e6d72;
  font-style: normal;
}

.cloud-project-event small {
  color: #7a5d00;
  font-weight: 750;
}

.cloud-inbox-list {
  gap: 10px;
}

.cloud-inbox-card {
  overflow: hidden;
  border: 1px solid #e7ecec;
  border-radius: 8px;
  background: #fff;
}

.cloud-inbox-card.is-discount {
  border-color: #f0e3a8;
}

.cloud-inbox-type {
  padding: 8px 12px;
  color: #7a5d00;
  background: #fff9e3;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cloud-inbox-card:not(.is-discount) .cloud-inbox-type {
  color: #324348;
  background: #f7f9f9;
}

.cloud-inbox-body {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 120px;
  gap: 12px;
  align-items: start;
  padding: 12px;
}

.cloud-inbox-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 6px;
  color: #13394a;
  background: #e3edf1;
  font-weight: 900;
}

.cloud-inbox-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.cloud-inbox-main strong,
.cloud-inbox-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cloud-inbox-main blockquote {
  margin: 7px 0 0;
  padding: 6px 0 6px 10px;
  border-left: 3px solid #13394a;
  color: #324348;
  font-size: 12px;
  line-height: 1.45;
}

.cloud-inbox-money {
  display: grid;
  justify-items: end;
  gap: 3px;
  color: #7a5d00;
}

.cloud-inbox-money span {
  font-size: 11px;
  font-weight: 800;
}

.cloud-inbox-money b {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 18px;
}

.cloud-inbox-actions,
.cloud-legacy-actions {
  justify-content: flex-end;
}

.cloud-inbox-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 12px;
}

.cloud-reject-button {
  margin-left: auto;
  border-color: transparent;
  color: #b04a3a;
  background: transparent;
}

.cloud-admin-overview {
  display: grid;
  gap: 10px;
  padding: 8px 20px 18px;
  background: #fff;
}

.cloud-admin-owner-tabs {
  display: flex;
  align-items: end;
  gap: 20px;
  min-height: 42px;
  overflow-x: auto;
  border-bottom: 1px solid #e7ecec;
  scrollbar-width: none;
}

.cloud-admin-owner-tabs::-webkit-scrollbar {
  display: none;
}

.cloud-admin-owner-tab {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 2px;
  border: 0;
  color: #677579;
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  font-weight: 650;
}

.cloud-admin-owner-tab b {
  min-width: 20px;
  padding: 3px 5px;
  border-radius: 5px;
  color: #4c5d62;
  background: #f1f4f5;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 600;
  text-align: center;
}

.cloud-admin-owner-tab.is-active {
  color: #101f24;
}

.cloud-admin-owner-tab.is-active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: #13394a;
}

.cloud-admin-owner-tab:hover,
.cloud-admin-owner-tab:focus-visible {
  color: #101f24;
  outline: none;
}

.cloud-admin-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.cloud-admin-metric {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid #e7ecec;
  border-radius: 8px;
  background: #f7f9f9;
}

.cloud-admin-metric span {
  color: #677579;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cloud-admin-metric strong {
  color: #101f24;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 18px;
}

.cloud-admin-metric.is-action {
  border-color: #f0e3a8;
  background: #fff9e3;
}

.cloud-admin-metric.is-danger strong {
  color: #b04a3a;
}

.cloud-empty {
  margin: 0;
  border: 1px dashed #dae2e3;
  box-shadow: none;
}

.discount-request-body {
  display: grid;
  gap: 12px;
}

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

.discount-goal-button {
  min-height: 40px;
  border: 1px solid #dae2e3;
  border-radius: 6px;
  color: #324348;
  background: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 900;
}

.discount-goal-button.is-active {
  border-color: #f0e3a8;
  color: #7a5d00;
  background: #fff9e3;
}

@media (max-width: 720px) {
  .project-action-grid {
    grid-template-columns: 1fr;
  }

  .project-action-card {
    min-height: 110px;
  }

  .cloud-open-button {
    grid-template-columns: 1fr auto;
    min-height: 40px;
    padding: 5px 8px;
  }

  .cloud-open-status,
  .cloud-open-save {
    display: none;
  }

  .cloud-admin-mode-strip {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .cloud-admin-mode-strip .button {
    width: 100%;
  }

  .cloud-modal {
    width: min(100vw - 16px, 100%);
    max-height: calc(100vh - 20px);
  }

  .cloud-modal-head {
    padding: 14px;
  }

  .cloud-modal-head h2 {
    font-size: 20px;
  }

  .cloud-modal-actions {
    align-items: flex-end;
    flex-direction: column-reverse;
  }

  .cloud-tabs,
  .cloud-toolbar,
  .cloud-legacy-actions {
    padding-inline: 14px;
  }

  .cloud-tabs,
  .cloud-filter-chips,
  .cloud-legacy-actions {
    flex-wrap: wrap;
    overflow: visible;
  }

  .cloud-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .cloud-projects-list,
  .cloud-inbox-list,
  .cloud-admin-list,
  .cloud-admin-overview {
    padding-inline: 14px;
  }

  .cloud-project-open,
  .cloud-project-row.is-unread .cloud-project-open,
  .cloud-admin-row.is-your-move .cloud-project-open {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 10px;
    min-height: 86px;
    padding: 9px 0;
  }

  .cloud-project-row.is-unread .cloud-project-open::before,
  .cloud-admin-row.is-your-move .cloud-project-open::before {
    display: none;
  }

  .cloud-status-chip {
    justify-self: end;
  }

  .cloud-project-money {
    justify-items: start;
  }

  .cloud-project-event {
    justify-items: end;
    text-align: right;
  }

  .cloud-inbox-body {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .cloud-inbox-money {
    grid-column: 2;
    justify-items: start;
  }

  .cloud-inbox-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .cloud-reject-button {
    margin-left: 0;
  }

  .cloud-admin-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .discount-goal-grid {
    grid-template-columns: 1fr;
  }
}

.project-menu-button,
.cloud-open-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 10px;
  border-color: var(--cg-line-2, #dae2e3);
  color: var(--cg-ink-3, #324348);
  background: var(--cg-surface, #fff);
  box-shadow: none;
}

.project-menu-button {
  justify-content: center;
  min-width: 86px;
}

.project-menu-button.has-unread,
.cloud-open-button.has-unread {
  border-color: #e9d97a;
  background: #fff9e3;
  box-shadow: 0 0 0 3px rgba(252, 238, 141, 0.28);
}

.project-menu-main {
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
}

.modal-panel.cloud-modal {
  width: min(1180px, calc(100vw - 32px));
  overflow-x: hidden;
}

.cloud-modal-head {
  align-items: flex-start;
  gap: 16px;
  padding: 16px 18px 12px;
}

.cloud-modal-head h2 {
  font-size: 20px;
  font-weight: 650;
}

.cloud-modal-actions {
  flex: 0 0 auto;
}

.cloud-modal-kicker {
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
}

.project-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 18px;
  border-bottom: 1px solid #f1f4f5;
  background: #fff;
}

.project-quick-action {
  appearance: none;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #dae2e3;
  border-radius: 6px;
  color: #324348;
  background: #fff;
  font: inherit;
  text-align: left;
  white-space: nowrap;
}

.project-quick-action:hover,
.project-quick-action:focus-visible {
  border-color: #13394a;
  background: #f2f7f8;
  outline: none;
}

.project-quick-action .project-action-icon {
  width: 18px;
  height: 18px;
  color: #13394a;
}

.project-quick-action span {
  color: #101f24;
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.15;
}

.project-quick-action small {
  display: none;
}

.project-quick-action[data-action="send-estimate-to-crm"] {
  border-color: #13394a;
  color: #fff;
  background: #13394a;
}

.project-quick-action[data-action="send-estimate-to-crm"] .project-action-icon,
.project-quick-action[data-action="send-estimate-to-crm"] span {
  color: inherit;
}

.project-quick-action[data-action="send-estimate-to-crm"]:hover,
.project-quick-action[data-action="send-estimate-to-crm"]:focus-visible {
  border-color: #0c2c3a;
  background: #0c2c3a;
}

.cloud-tabs {
  flex-wrap: wrap;
  gap: 18px;
}

.cloud-tab {
  font-size: 12.5px;
  font-weight: 600;
}

.cloud-tab.is-active {
  font-weight: 650;
}

.cloud-toolbar {
  align-items: flex-start;
  flex-wrap: wrap;
  padding: 10px 18px;
}

.cloud-filter-chips {
  flex-wrap: wrap;
  overflow: visible;
}

.cloud-filter-chip {
  flex: 0 0 auto;
  font-weight: 600;
}

.cloud-autosave-state {
  display: none;
}

.shift-strip-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.desk-shift-strip .shift-body {
  display: grid;
  grid-template-columns: 1fr;
}

.project-save-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: min(430px, 42vw);
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid #e7ecec;
  border-radius: 6px;
  color: #2f6b52;
  background: #fff;
  white-space: nowrap;
}

.project-save-inline.is-saving {
  color: #95a1a5;
}

.project-save-inline.is-failed {
  border-color: #ebd2cc;
  color: #b04a3a;
  background: #fbedea;
}

.project-save-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.project-save-inline strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #13394a;
  font-family: "IBM Plex Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 600;
}

.project-save-status {
  flex: 0 0 auto;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid #d8e8e3;
  border-radius: 999px;
  padding: 3px 7px;
  color: #135d4c;
  background: #eef8f5;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.project-save-inline em {
  flex: 0 0 auto;
  color: currentColor;
  font-size: 11px;
  font-style: normal;
  font-weight: 500;
}

.cloud-project-row,
.cloud-admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 68px;
}

.cloud-project-open,
.cloud-project-row.is-unread .cloud-project-open,
.cloud-admin-row.is-your-move .cloud-project-open {
  grid-template-columns: minmax(240px, 1fr) auto minmax(78px, auto) minmax(118px, 150px);
  gap: 16px;
  min-height: 68px;
  padding: 8px 0;
}

.cloud-project-row.is-unread .cloud-project-open::before,
.cloud-admin-row.is-your-move .cloud-project-open::before {
  display: none;
}

.cloud-project-main strong,
.cloud-project-money b,
.cloud-status-chip,
.cloud-project-event small,
.cloud-inbox-avatar,
.cloud-inbox-money b,
.cloud-admin-metric strong {
  font-weight: 650;
}

.cloud-project-delete {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #b04a3a;
  background: transparent;
  font-size: 18px;
  line-height: 1;
}

.cloud-project-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cloud-project-send {
  min-width: 92px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #13394a;
  border-radius: 6px;
  color: #fff;
  background: #13394a;
  font: inherit;
  font-size: 12.5px;
  font-weight: 650;
}

.cloud-project-send:hover,
.cloud-project-send:focus-visible {
  border-color: #0c2c3a;
  background: #0c2c3a;
  outline: none;
}

.cloud-project-delete:hover,
.cloud-project-delete:focus-visible {
  border-color: #ebd2cc;
  background: #fbedea;
  outline: none;
}

.new-project-choice-grid {
  display: grid;
  gap: 8px;
}

.new-project-choice-grid .export-button {
  justify-items: start;
  min-height: 64px;
  text-align: left;
}

.new-project-choice-grid .export-button span {
  color: inherit;
  opacity: 0.72;
  font-size: 12px;
  font-weight: 450;
}

.new-project-confirm-modal .modal-copy {
  max-width: 48ch;
}

.new-project-confirm-modal .modal-actions {
  justify-content: flex-end;
}

.new-project-save-error {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #ebd2cc;
  border-radius: 6px;
  color: #9f3f32;
  background: #fbedea;
  font-size: 12px;
}

@media (max-width: 1180px) {
  .project-quick-actions {
    gap: 6px;
  }

  .cloud-project-open,
  .cloud-project-row.is-unread .cloud-project-open,
  .cloud-admin-row.is-your-move .cloud-project-open {
    grid-template-columns: minmax(220px, 1fr) auto minmax(72px, auto) minmax(105px, 130px);
    gap: 12px;
  }

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

  .project-save-inline {
    width: fit-content;
    max-width: 100%;
  }
}

@media (max-width: 720px) {
  .cloud-modal {
    width: min(100vw - 12px, 100%);
  }

  .cloud-modal-actions {
    align-items: center;
    flex-direction: row;
  }

  .project-quick-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px 14px;
  }

  .project-quick-action {
    width: 100%;
  }

  .cloud-tabs,
  .cloud-filter-chips,
  .cloud-legacy-actions {
    overflow: visible;
  }

  .cloud-project-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 10px 0;
  }

  .cloud-admin-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 10px 0;
  }

  .cloud-project-open,
  .cloud-project-row.is-unread .cloud-project-open,
  .cloud-admin-row.is-your-move .cloud-project-open {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 0;
    padding: 0;
  }

  .cloud-project-actions {
    justify-content: flex-end;
    margin-top: 8px;
  }
}

/* Cloud projects handoff, round 3. */
.modal-panel.cloud-modal {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: min(1180px, calc(100vw - 32px));
  max-height: 86vh;
  gap: 0;
  padding: 0;
  overflow: visible;
}

.cloud-modal-head {
  position: static;
  align-items: center;
  padding: 16px 18px 14px;
  background: #fff;
  backdrop-filter: none;
}

.cloud-modal-head h2 {
  margin-top: 3px;
  font-size: 20px;
  font-weight: 650;
}

.cloud-modal-kicker {
  margin: 0;
  color: #677579;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

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

.cloud-close-button {
  width: 32px;
  height: 32px;
  min-height: 32px;
  border-color: #dae2e3;
  border-radius: 6px;
  color: #677579;
  font-size: 12px;
}

.cloud-header-save {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #d3e5d9;
  border-radius: 6px;
  color: #2f6b52;
  background: #eff6f3;
  font-size: 11.5px;
}

.cloud-header-save > span {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
}

.cloud-header-save strong {
  font-weight: 600;
}

.cloud-header-save button {
  min-height: 24px;
  padding: 0 7px;
  border: 1px solid currentColor;
  border-radius: 5px;
  color: inherit;
  background: transparent;
  font: inherit;
  font-weight: 600;
}

.cloud-header-save.is-saving {
  border-color: #e7ecec;
  color: #677579;
  background: #f7f9f9;
}

.cloud-header-save.is-failed {
  border-color: #ebd2cc;
  color: #b04a3a;
  background: #fbedea;
}

.cloud-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 22px;
  min-height: 44px;
  padding: 0 18px;
  overflow-x: auto;
  border-bottom: 1px solid #e7ecec;
  scrollbar-width: none;
}

.cloud-tabs::-webkit-scrollbar,
.cloud-filter-chips::-webkit-scrollbar {
  display: none;
}

.cloud-tab {
  flex: 0 0 auto;
  min-height: 44px;
  gap: 6px;
  white-space: nowrap;
}

.cloud-tab b {
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  font-weight: 600;
}

.cloud-tab b.is-unread {
  color: #7a5d00;
  background: #fff6ce;
}

.cloud-files-panel {
  display: grid;
  gap: 10px;
  padding: 18px;
  overflow-y: auto;
  background: #fff;
}

.cloud-primary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.cloud-primary-actions .project-quick-action {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  grid-template-rows: auto auto;
  width: 100%;
  min-height: 52px;
  column-gap: 10px;
  row-gap: 2px;
  padding: 7px 11px;
  white-space: normal;
}

.cloud-primary-actions .project-action-icon {
  grid-row: 1 / span 2;
}

.cloud-primary-actions .project-quick-action span,
.cloud-primary-actions .project-quick-action small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cloud-primary-actions .project-quick-action.is-primary {
  border-color: #9fb5bd;
  color: #324348;
  background: #fff;
}

.cloud-primary-actions .project-quick-action.is-primary:hover,
.cloud-primary-actions .project-quick-action.is-primary:focus-visible {
  border-color: #13394a;
  color: #324348;
  background: #f2f7f8;
}

.cloud-primary-actions .project-quick-action.is-primary span {
  color: inherit;
}

.cloud-primary-actions .project-quick-action.is-primary .project-action-icon {
  color: #13394a;
}

.cloud-primary-actions .project-quick-action.is-primary small {
  display: block;
  color: #677579;
}

.cloud-primary-actions .project-quick-action.is-recognize {
  border-color: #9fb5bd;
  background: #f7fafb;
}

.cloud-primary-actions .project-quick-action.is-keyboard-active {
  border-color: #13394a;
  color: #fff;
  background: #13394a;
  box-shadow: none;
  outline: none;
}

.cloud-primary-actions .project-quick-action.is-keyboard-active .project-action-icon,
.cloud-primary-actions .project-quick-action.is-keyboard-active span {
  color: inherit;
}

.cloud-primary-actions .project-quick-action.is-keyboard-active small {
  display: block;
  color: rgba(255, 255, 255, 0.72);
}

.cloud-modal [data-cloud-keyboard-nav].is-keyboard-active:not(.cloud-primary-actions .project-quick-action) {
  outline: 2px solid #13394a;
  outline-offset: 2px;
}

.cloud-project-menu-button.is-keyboard-active {
  opacity: 1;
  border-color: #13394a;
  background: #f2f7f8;
}

.cloud-files-panel > .project-quick-action.is-primary {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  width: 100%;
  min-height: 58px;
  padding: 9px 14px;
  border-color: #13394a;
  color: #fff;
  background: #13394a;
}

.cloud-files-panel > .project-quick-action.is-primary:hover,
.cloud-files-panel > .project-quick-action.is-primary:focus-visible {
  border-color: #0c2c3a;
  background: #0c2c3a;
}

.cloud-files-panel > .project-quick-action.is-primary .project-action-icon {
  grid-row: 1 / span 2;
  color: inherit;
}

.cloud-files-panel > .project-quick-action.is-primary span {
  color: inherit;
  font-size: 13px;
}

.cloud-files-panel > .project-quick-action.is-primary small {
  display: block;
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  font-weight: 450;
}

.cloud-files-panel .project-quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  border: 0;
}

.cloud-files-panel .project-quick-action:not(.is-primary),
.cloud-files-panel .project-quick-action[data-action="send-estimate-to-crm"] {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  width: 100%;
  min-height: 56px;
  padding: 8px 11px;
  border-color: #dae2e3;
  color: #324348;
  background: #fff;
  white-space: normal;
}

.cloud-files-panel .project-quick-action:not(.is-primary):hover,
.cloud-files-panel .project-quick-action:not(.is-primary):focus-visible,
.cloud-files-panel .project-quick-action[data-action="send-estimate-to-crm"]:hover,
.cloud-files-panel .project-quick-action[data-action="send-estimate-to-crm"]:focus-visible {
  border-color: #13394a;
  color: #324348;
  background: #f2f7f8;
}

.cloud-files-panel .project-quick-action:not(.is-primary) .project-action-icon {
  grid-row: 1 / span 2;
  color: #13394a;
}

.cloud-files-panel .project-quick-action:not(.is-primary) span {
  overflow: hidden;
  color: #101f24;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cloud-files-panel .project-quick-action:not(.is-primary) small {
  display: block;
  overflow: hidden;
  color: #677579;
  font-size: 10.5px;
  font-weight: 450;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cloud-files-panel .cloud-primary-actions .project-quick-action.is-keyboard-active {
  border-color: #13394a;
  color: #fff;
  background: #13394a;
  outline: none;
}

.cloud-files-panel .cloud-primary-actions .project-quick-action.is-keyboard-active .project-action-icon,
.cloud-files-panel .cloud-primary-actions .project-quick-action.is-keyboard-active span {
  color: inherit;
}

.cloud-files-panel .cloud-primary-actions .project-quick-action.is-keyboard-active small {
  display: block;
  color: rgba(255, 255, 255, 0.72);
}

.cloud-last-project {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 0 0 0 2px;
  border-top: 1px solid #f1f4f5;
  color: #677579;
  font-size: 11.5px;
}

.cloud-last-project strong {
  overflow: hidden;
  color: #324348;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cloud-project-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: 100%;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  padding-bottom: 62px;
  overflow: hidden;
  background: #fff;
}

.cloud-project-panel .cloud-toolbar {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 10px 18px;
  border-bottom-color: #f1f4f5;
}

.cloud-filter-chips {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.cloud-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 9px;
}

.cloud-filter-chip b {
  min-width: 18px;
  color: inherit;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 600;
  text-align: center;
}

.cloud-project-table-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 120px 120px 190px 32px;
  gap: 14px;
  padding: 8px 18px 6px;
  border-bottom: 1px solid #e7ecec;
  color: #677579;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.cloud-project-table-head span:nth-child(3) {
  text-align: right;
}

.cloud-projects-list {
  width: 100%;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  max-height: calc(86vh - 260px);
  padding: 0 18px;
  overflow-y: auto;
  overflow-x: hidden;
}

.cloud-project-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  gap: 6px;
  min-height: 62px;
  border-bottom: 1px solid #f1f4f5;
}

.cloud-project-row.is-unread {
  background: #fffcef;
}

.cloud-project-row .cloud-project-open,
.cloud-project-row.is-unread .cloud-project-open {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 120px 120px 190px;
  gap: 14px;
  min-width: 0;
  min-height: 62px;
  padding: 7px 0;
}

.cloud-project-main strong {
  font-size: 13px;
}

.cloud-project-main small {
  font-size: 10.5px;
}

.cloud-project-money {
  font-variant-numeric: tabular-nums;
}

.cloud-project-money b {
  font-size: 14px;
}

.cloud-project-date {
  overflow: hidden;
  color: #324348;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cloud-project-event em {
  color: #324348;
  font-size: 11px;
}

.cloud-project-event small {
  color: #677579;
  font-weight: 500;
}

.cloud-project-menu-button {
  align-self: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  opacity: 0;
  color: #5e6d72;
  background: transparent;
  font: inherit;
  font-size: 18px;
  line-height: 1;
  transition: opacity 120ms ease, border-color 120ms ease, background 120ms ease;
}

.cloud-project-row:hover .cloud-project-menu-button,
.cloud-project-row:focus-within .cloud-project-menu-button,
.cloud-project-row.has-open-menu .cloud-project-menu-button {
  opacity: 1;
}

.cloud-project-menu-button:hover,
.cloud-project-menu-button:focus-visible {
  border-color: #dae2e3;
  background: #f7f9f9;
  outline: none;
}

.cloud-row-menu-dismiss {
  display: none;
}

.cloud-row-menu {
  position: absolute;
  z-index: 8;
  top: 48px;
  right: 0;
  display: grid;
  width: 224px;
  padding: 6px;
  border: 1px solid #dae2e3;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(9, 28, 37, 0.16);
}

.cloud-row-menu.is-context {
  position: fixed;
  top: min(var(--cloud-menu-y), calc(100vh - 340px));
  right: auto;
  left: min(var(--cloud-menu-x), calc(100vw - 240px));
}

.cloud-row-menu-title {
  overflow: hidden;
  padding: 6px 8px 8px;
  color: #677579;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.cloud-row-menu button {
  min-height: 38px;
  padding: 0 9px;
  border: 0;
  border-radius: 5px;
  color: #324348;
  background: transparent;
  font: inherit;
  font-size: 12px;
  text-align: left;
}

.cloud-row-menu button:hover,
.cloud-row-menu button:focus-visible {
  color: #101f24;
  background: #f1f4f5;
  outline: none;
}

.cloud-row-menu button.is-danger {
  color: #b04a3a;
}

.cloud-row-menu-rule {
  height: 1px;
  margin: 5px 8px;
  background: #e7ecec;
}

.cloud-project-summary {
  min-height: 38px;
  padding: 10px 160px 9px 18px;
  border-top: 1px solid #e7ecec;
  color: #677579;
  font-size: 11.5px;
}

.cloud-create-fab {
  position: absolute;
  right: 18px;
  bottom: 14px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #13394a;
  border-radius: 6px;
  color: #fff;
  background: #13394a;
  font: inherit;
  font-size: 12.5px;
  font-weight: 650;
}

.cloud-create-fab:hover,
.cloud-create-fab:focus-visible {
  border-color: #0c2c3a;
  background: #0c2c3a;
  outline: none;
}

.cloud-empty {
  min-height: 120px;
  margin: 12px 0;
}

@media (max-width: 1000px) and (min-width: 721px) {
  .cloud-project-table-head {
    grid-template-columns: minmax(0, 1fr) 118px 92px 100px 144px 32px;
    gap: 10px;
  }

  .cloud-project-row .cloud-project-open,
  .cloud-project-row.is-unread .cloud-project-open {
    grid-template-columns: minmax(0, 1fr) 118px 92px 100px 144px;
    gap: 10px;
  }
}

@media (max-width: 720px) {
  .modal-backdrop {
    padding: 6px;
  }

  .modal-panel.cloud-modal {
    width: calc(100vw - 12px);
    max-height: calc(100vh - 12px);
    border-radius: 12px;
    overflow: hidden;
  }

  .cloud-modal-head {
    gap: 10px;
    padding: 12px;
  }

  .cloud-modal-head h2 {
    font-size: 17px;
  }

  .cloud-modal-actions {
    align-items: center;
    flex-direction: row;
  }

  .cloud-header-save {
    max-width: 118px;
    padding: 0 8px;
  }

  .cloud-header-save strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .cloud-header-save.is-failed strong {
    display: none;
  }

  .cloud-close-button {
    width: 44px;
    height: 44px;
    min-height: 44px;
  }

  .cloud-tabs {
    min-height: 42px;
    gap: 18px;
    padding: 0 12px;
    -webkit-overflow-scrolling: touch;
  }

  .cloud-tab {
    min-height: 42px;
  }

  .cloud-files-panel {
    gap: 8px;
    padding: 12px;
  }

  .cloud-primary-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .cloud-primary-actions .project-quick-action {
    min-height: 52px;
  }

  .cloud-files-panel .project-quick-action:not(.is-primary),
  .cloud-files-panel .project-quick-action[data-action="send-estimate-to-crm"] {
    min-height: 56px;
  }

  .cloud-files-panel .project-quick-actions {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .cloud-admin-owner-tabs {
    gap: 18px;
    -webkit-overflow-scrolling: touch;
  }

  .cloud-last-project {
    grid-template-columns: minmax(0, 1fr) auto;
    padding-top: 8px;
  }

  .cloud-last-project span {
    grid-column: 1;
    font-size: 10px;
  }

  .cloud-last-project strong {
    grid-column: 1;
  }

  .cloud-last-project .button {
    grid-column: 2;
    grid-row: 1 / span 2;
    min-height: 44px;
  }

  .cloud-project-panel {
    padding-bottom: 72px;
  }

  .cloud-project-panel .cloud-toolbar {
    padding: 9px 12px;
  }

  .cloud-filter-chips {
    flex-wrap: nowrap;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .cloud-filter-chip {
    min-height: 36px;
  }

  .cloud-project-table-head {
    display: none;
  }

  .cloud-projects-list {
    max-height: calc(100vh - 270px);
    padding: 0 12px;
  }

  .cloud-project-row {
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 8px;
    min-height: 118px;
    padding: 12px 0;
  }

  .cloud-project-row .cloud-project-open,
  .cloud-project-row.is-unread .cloud-project-open {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "main money"
      "status date"
      "event event";
    gap: 7px 10px;
    min-height: 0;
    padding: 0;
  }

  .cloud-project-main {
    grid-area: main;
  }

  .cloud-project-main strong {
    display: -webkit-box;
    overflow: hidden;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .cloud-project-row .cloud-status-chip {
    grid-area: status;
    justify-self: start;
  }

  .cloud-project-money {
    grid-area: money;
    align-self: start;
  }

  .cloud-project-date {
    grid-area: date;
    justify-self: end;
    text-align: right;
  }

  .cloud-project-event {
    grid-area: event;
    justify-items: start;
    padding-top: 4px;
    border-top: 1px solid #f1f4f5;
    text-align: left;
  }

  .cloud-project-menu-button {
    align-self: end;
    width: 44px;
    height: 44px;
    opacity: 1;
    border-color: #dae2e3;
    font-size: 20px;
  }

  .cloud-row-menu-dismiss {
    position: fixed;
    z-index: 59;
    inset: 0;
    display: block;
    border: 0;
    background: transparent;
  }

  .cloud-row-menu,
  .cloud-row-menu.is-context {
    position: fixed;
    z-index: 60;
    inset: auto 0 0;
    width: auto;
    padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
    border: 0;
    border-radius: 12px 12px 0 0;
    color: #fff;
    background: #13394a;
    box-shadow: 0 -10px 28px rgba(9, 28, 37, 0.24);
  }

  .cloud-row-menu::before {
    content: "";
    width: 42px;
    height: 4px;
    justify-self: center;
    margin: 0 0 7px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.32);
  }

  .cloud-row-menu-title {
    color: #9dbdc8;
    font-size: 11px;
  }

  .cloud-row-menu button {
    min-height: 48px;
    padding: 0 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 0;
    color: #dce7ea;
    font-size: 13px;
  }

  .cloud-row-menu button:hover,
  .cloud-row-menu button:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
  }

  .cloud-row-menu button.is-danger {
    color: #f0a79a;
  }

  .cloud-row-menu-rule {
    display: none;
  }

  .cloud-menu-desktop-only {
    display: none;
  }

  .cloud-project-summary {
    padding: 10px 12px;
    font-size: 10.5px;
  }

  .cloud-create-fab {
    right: 16px;
    bottom: 16px;
    min-height: 44px;
  }
}

.project-settings-modal {
  width: min(860px, 100%);
}

.project-settings-modal .modal-head {
  margin-bottom: 0;
}

.project-settings-modal .estimate-form {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.project-modal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0 calc(-1 * var(--gap-4)) var(--gap-4);
  padding: 10px var(--gap-4) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
}

.project-modal-tab {
  position: relative;
  min-height: 44px;
  margin-bottom: -1px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: 0 18px;
  color: #6e7b81;
  background: transparent;
  font-size: 13px;
  font-weight: 750;
}

.project-modal-tab:hover,
.project-modal-tab:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.62);
  outline: none;
}

.project-modal-tab:focus-visible {
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 2px rgba(23, 75, 91, 0.18);
}

.project-modal-tab.is-active {
  border-color: var(--border);
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 -1px 0 var(--surface), 0 1px 0 var(--surface);
}

.project-modal-pane {
  display: grid;
  gap: var(--gap-4);
  padding-top: 2px;
}

.project-profile-badge {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--surface-muted);
}

.project-profile-badge span,
.project-profile-badge small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.project-profile-badge strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.project-info-title {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.project-info-grid > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.project-info-grid dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.project-info-grid dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-info-check {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: var(--surface-soft);
}

.project-info-check span {
  font-size: 13px;
  font-weight: 600;
}

.project-info-check ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
}

.project-info-check.is-ok {
  border-color: #b9d8cb;
  color: #0f5f4d;
  background: #eef8f4;
}

.project-info-check.is-warning {
  border-color: #e4c7a1;
  color: #8a541d;
  background: #fff8ea;
}

.project-info-check.is-muted {
  border-color: var(--border);
  color: var(--muted);
}

@media (max-width: 720px) {
  .project-info-grid {
    grid-template-columns: 1fr;
  }
}

.import-apply-grid.has-all-reset {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.import-total-check {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid rgba(33, 39, 42, 0.08);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 720;
}

.import-total-check strong {
  margin-left: auto;
  font-weight: 840;
}

.import-total-check.is-match strong {
  color: var(--accent-strong);
}

.import-total-check.is-mismatch {
  border-color: rgba(227, 167, 53, 0.32);
  background: #fff8ea;
}

.import-total-check.is-mismatch strong {
  color: #8a4f00;
}

.import-suggestion-list {
  display: grid;
  gap: var(--gap-2);
}

.import-suggestion-group {
  display: grid;
  gap: var(--gap-2);
}

.import-suggestion-heading {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 760;
  text-transform: uppercase;
}

.import-suggestion-card {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) 68px 76px 96px auto;
  gap: var(--gap-3);
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.priced-suggestion-card,
.external-suggestion-card {
  grid-template-columns: auto minmax(220px, 1fr) 68px 76px 96px auto;
}

.import-suggestion-card.has-price-diff {
  border-color: #e3a735;
  background: #fff8ea;
}

.unmatched-suggestion-card {
  grid-template-columns: auto minmax(220px, 1fr) 68px 76px 96px auto;
  border-color: #e5c767;
  background: #fffaf0;
}

.import-suggestion-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.import-suggestion-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.import-suggestion-main strong,
.import-suggestion-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-suggestion-main small {
  color: var(--muted);
}

.import-edit-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.import-edit-field > span {
  display: none;
  color: #8a4f00;
  font-size: 10px;
  font-weight: 820;
  line-height: 1;
  text-transform: uppercase;
}

.import-qty-field > span,
.import-price-field > span,
.import-discount-field > span {
  display: block;
  color: var(--muted);
}

.import-suggestion-card.has-price-diff .import-edit-field > span {
  display: block;
}

.import-name-input {
  min-width: 0;
  width: 100%;
  height: 34px;
  padding: 6px 8px;
  font-size: 0.92rem;
  font-weight: 760;
  line-height: 1.15;
  background: var(--surface);
}

.import-suggestion-card.has-price-diff .import-name-input,
.import-suggestion-card.has-price-diff .import-price,
.import-suggestion-card.has-price-diff .import-discount {
  border-color: #e3a735;
  box-shadow: 0 0 0 2px rgba(227, 167, 53, 0.12);
}

.import-qty,
.import-price,
.import-discount {
  min-width: 0;
  width: 100%;
  height: 34px;
  padding: 6px 7px;
  text-align: center;
}

.import-qty-stepper {
  display: grid;
  grid-template-columns: 26px minmax(28px, 1fr) 26px;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.import-qty-stepper .import-qty {
  height: 32px;
  border: 0;
  border-inline: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}

.import-qty-stepper-button {
  display: grid;
  min-width: 0;
  min-height: 32px;
  place-items: center;
  border: 0;
  color: var(--text);
  background: var(--surface-soft);
  font-size: 16px;
  font-weight: 850;
}

.import-qty-stepper-button.is-plus {
  color: white;
  background: var(--accent);
}

.import-discount:disabled {
  color: #0b6b58;
  background: rgba(20, 132, 108, 0.08);
  opacity: 1;
}

.price-diff-badge,
.price-source-badge {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 760;
  white-space: normal;
}

.price-diff-badge {
  color: #8a4f00;
  background: #ffe3a6;
}

.price-source-badge {
  color: var(--muted);
  background: rgba(33, 39, 42, 0.06);
}

.import-bonus-toggle {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #0b6b58;
  background: rgba(20, 132, 108, 0.1);
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
}

.import-apply-panel .export-button.danger {
  border-color: var(--danger);
  color: white;
  background: var(--danger);
}

.import-apply-panel .export-button.danger:hover,
.import-apply-panel .export-button.danger:focus-visible {
  color: white;
  background: #943b3b;
}

.import-bonus-toggle input[type="checkbox"] {
  width: 14px;
  height: 14px;
}

.replacement-options {
  grid-column: 2 / -1;
  display: grid;
  gap: 6px;
  padding-top: 2px;
}

.replacement-title {
  color: #8a4f00;
  font-size: 10px;
  font-weight: 820;
  line-height: 1;
  text-transform: uppercase;
}

.replacement-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}

.replacement-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid rgba(138, 79, 0, 0.22);
  border-radius: 6px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  line-height: 1.1;
  text-align: left;
}

.replacement-option:hover,
.replacement-option:focus-visible {
  border-color: #e3a735;
  outline: none;
  background: #fff;
}

.replacement-option span,
.replacement-option small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.replacement-option span {
  font-weight: 760;
}

.replacement-option small {
  color: var(--muted);
}

.replacement-picker-button {
  width: 100%;
}

.import-replacement-picker {
  display: grid;
  gap: var(--gap-2);
  margin-top: var(--gap-3);
  padding: 12px;
  border: 1px solid rgba(20, 132, 108, 0.28);
  border-radius: var(--radius-sm);
  background: #f3fbf8;
}

.import-replacement-head {
  display: flex;
  gap: var(--gap-2);
  align-items: flex-start;
  justify-content: space-between;
}

.import-replacement-head > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.import-replacement-head strong {
  font-size: 1rem;
}

.import-replacement-head span {
  color: var(--muted);
  font-size: 0.84rem;
}

.import-replacement-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.import-replacement-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  align-items: center;
  min-height: 46px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  background: var(--surface);
  text-align: left;
}

.import-replacement-card:hover,
.import-replacement-card:focus-visible {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 2px rgba(20, 132, 108, 0.12);
}

.import-replacement-card span,
.import-replacement-card small {
  grid-column: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-replacement-card span {
  grid-row: 1;
  font-weight: 700;
}

.import-replacement-card small {
  grid-row: 2;
  color: var(--muted);
  font-size: 0.78rem;
}

.import-replacement-card strong {
  grid-column: 2;
  grid-row: 1 / span 2;
  justify-self: end;
  color: #0b6b58;
  font-size: 0.84rem;
  text-align: right;
  white-space: nowrap;
}

.import-qty {
  text-align: center;
}

.import-price {
  text-align: center;
}

.import-qty-field {
  width: 80px;
}

.import-price-field {
  width: 96px;
}

.database-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--gap-4);
}

.db-controls-row {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(180px, 240px) minmax(190px, 260px);
  gap: var(--gap-2);
  align-items: end;
}

.db-sort-field {
  display: grid;
  gap: 6px;
}

.db-sort-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.database-table {
  min-width: 1200px;
}

.database-table td {
  vertical-align: top;
}

.database-table .desc-input {
  min-width: 260px;
}

.db-thumb-button,
.db-title-button {
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.db-thumb-button {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-soft);
}

.db-thumb-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.db-thumb-button span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.db-title-button {
  display: grid;
  gap: 4px;
  width: 100%;
}

.db-title-button strong {
  font-size: 13px;
  line-height: 1.25;
}

.db-title-button span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.db-thumb-button:hover,
.db-thumb-button:focus-visible,
.db-title-button:hover,
.db-title-button:focus-visible {
  color: var(--accent-strong);
  outline: none;
}

.db-image-field {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.db-image-preview {
  width: 38px;
  height: 38px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-soft);
}

.db-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.partners-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap-3);
}

.partner-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.partner-card h3 {
  margin: 0;
  font-size: 15px;
}

.partner-sum {
  margin-top: 12px;
  font-size: 24px;
  font-weight: 800;
}

.partner-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(18, 24, 26, 0.42);
}

.modal-panel {
  display: grid;
  gap: var(--gap-4);
  width: min(760px, 100%);
  max-height: calc(100vh - 44px);
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(10, 16, 18, 0.32);
}

.modal-panel-sm {
  width: min(420px, 100%);
}

.modal-panel-wide {
  width: min(980px, 100%);
}

.catalog-picker-modal {
  width: min(660px, 100%);
  max-height: 520px;
  overflow: hidden;
}

.modal-panel-xl {
  width: min(1180px, 100%);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--gap-4);
}

.modal-head-actions {
  display: flex;
  align-items: center;
  gap: var(--gap-2);
}

.modal-back-button {
  min-height: 36px;
  padding: 0 12px;
}

.modal-head h2 {
  margin: 0;
  font-size: 20px;
}

.modal-copy {
  margin: 6px 0 0;
  color: var(--muted);
}

.export-download-ready {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.export-download-ready span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.export-preparing-box,
.export-download-error {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.export-preparing-box div,
.export-download-error {
  min-width: 0;
}

.export-preparing-box strong,
.export-download-error strong {
  display: block;
}

.export-preparing-box span:last-child,
.export-download-error span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.export-spinner {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: export-spin 0.8s linear infinite;
}

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

.manual-to-db-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--gap-3);
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.manual-to-db-preview span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 760;
}

.manual-to-db-preview strong {
  color: var(--accent-strong);
  white-space: nowrap;
}

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

.external-move-quantity {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.external-move-quantity-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.external-move-quantity-head span,
.external-move-quantity small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.external-move-quantity-head strong {
  color: var(--text);
  font-size: 18px;
  font-weight: 820;
  white-space: nowrap;
}

.external-move-stepper {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  min-height: 46px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.external-move-stepper button,
.external-move-stepper input {
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
}

.external-move-stepper button {
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 850;
  cursor: pointer;
}

.external-move-stepper button:hover,
.external-move-stepper button:focus-visible {
  background: #fff7ef;
  outline: none;
}

.external-move-stepper input {
  border-inline: 1px solid var(--border);
  text-align: center;
  font-size: 20px;
  font-weight: 760;
}

.external-move-option {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.external-move-option span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 780;
}

.external-move-option small {
  color: var(--muted);
  font-weight: 650;
}

.external-move-option:hover,
.external-move-option:focus-visible {
  border-color: #9a4e2d;
  background: #fff7ef;
  outline: none;
}

.external-category-bulk-modal {
  width: min(860px, 100%);
}

.external-category-bulk-modal .modal-head h2 {
  font-size: 18px;
  font-weight: 600;
}

.external-category-bulk-modal .field > span {
  font-weight: 600;
  text-transform: none;
}

.external-category-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: var(--gap-3);
  align-items: end;
}

.external-category-counter {
  display: grid;
  gap: 3px;
  min-width: 130px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.external-category-counter span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.external-category-counter strong {
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
  font-size: 15px;
  font-weight: 600;
}

.external-category-counter small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.external-category-quick-actions {
  justify-content: flex-end;
  align-self: stretch;
  flex-wrap: nowrap;
}

.external-category-quick-actions .button {
  min-height: 40px;
}

.external-category-filter-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.external-category-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.external-category-filter-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.external-category-filter-head strong {
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 600;
}

.external-category-filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.external-category-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
  font-weight: 500;
}

.external-category-filter-chip input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--accent);
}

.external-category-filter-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.external-category-filter-chip small {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-soft);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 600;
}

.external-category-filter-chip.is-active {
  border-color: rgba(20, 132, 108, 0.34);
  color: var(--text);
  background: #f2faf6;
}

.external-category-filter-chip.is-active small {
  color: var(--accent-strong);
  background: rgba(20, 132, 108, 0.12);
}

.external-category-line-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  max-height: min(48vh, 440px);
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.external-category-line-button {
  display: grid;
  gap: 5px;
  align-content: center;
  min-width: 0;
  min-height: 66px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  background: var(--surface-soft);
  text-align: left;
  cursor: pointer;
}

.external-category-line-button span,
.external-category-line-button small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.external-category-line-button span {
  font-size: 13px;
  font-weight: 600;
}

.external-category-line-button small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.external-category-line-button.is-target-category {
  border-color: rgba(20, 132, 108, 0.34);
  background: #f2faf6;
}

.external-category-line-button.is-selected {
  border-color: var(--accent);
  color: #ffffff;
  background: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.external-category-line-button.is-selected small {
  color: rgba(255, 255, 255, 0.78);
}

.external-category-line-button:hover,
.external-category-line-button:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.external-category-empty {
  min-height: 96px;
}

@media (max-width: 720px) {
  .external-category-controls {
    grid-template-columns: 1fr;
  }

  .external-category-counter {
    min-width: 0;
  }

  .external-category-quick-actions {
    justify-content: stretch;
  }

  .external-category-quick-actions .button {
    flex: 1 1 0;
  }

  .external-category-line-grid {
    grid-template-columns: 1fr;
    max-height: min(52vh, 430px);
  }

  .external-category-filter-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .external-category-filter-chip {
    width: 100%;
  }

  .external-category-line-button {
    min-height: 58px;
  }
}

.catalog-picker-body {
  display: grid;
  gap: var(--gap-3);
  min-height: 0;
}

.catalog-modal-list {
  max-height: 360px;
  min-height: 0;
  padding-right: 6px;
}

.db-modal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: var(--gap-4);
  align-items: start;
}

.db-form-stack {
  display: grid;
  gap: var(--gap-3);
}

.db-form-section {
  display: grid;
  gap: var(--gap-3);
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.db-form-section h3 {
  margin: 0;
  font-size: 14px;
}

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

.partner-rule-panel {
  display: grid;
  gap: 10px;
  min-height: 40px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.partner-rule-panel-head,
.partner-rule-presets {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.partner-rule-panel-head {
  justify-content: space-between;
  color: var(--text);
  font-size: 13px;
  font-weight: 780;
}

.partner-rule-presets {
  gap: 6px;
}

.partner-rule-preset {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}

.partner-rule-preset:hover,
.partner-rule-preset:focus-visible,
.partner-rule-preset.is-active {
  border-color: var(--blue);
  background: #e8f0f8;
  color: var(--blue);
}

.compact-textarea {
  min-height: 56px;
}

.checkbox-field {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-height: 40px;
  padding-top: 20px;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
}

.db-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-2);
}

.db-section-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.db-upload-button {
  position: relative;
  overflow: hidden;
}

.db-upload-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.db-media-section {
  position: sticky;
  top: 0;
}

.db-media-empty {
  min-height: 180px;
}

.db-media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap-3);
}

.db-media-card {
  display: grid;
  gap: var(--gap-2);
  margin: 0;
  min-width: 0;
}

.db-media-preview {
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #e7ebe7;
}

.db-media-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.db-media-card figcaption {
  display: grid;
  gap: 2px;
}

.db-media-card figcaption span {
  font-size: 12px;
  font-weight: 800;
}

.db-media-card figcaption small {
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.db-media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.db-path-fields {
  display: grid;
  gap: var(--gap-3);
}

.export-choice-grid,
.export-format-grid,
.partner-target-grid,
.partner-scope-grid {
  display: grid;
  gap: var(--gap-2);
}

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

.export-format-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

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

.partner-scope-block {
  display: grid;
  gap: var(--gap-2);
}

.export-settings-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.export-settings-panel.is-active {
  border-color: var(--cg-teal-200);
  background: var(--cg-panel);
}

.export-settings-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.export-settings-head span {
  color: var(--cg-mute);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.export-settings-head small {
  color: var(--cg-mute);
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.25;
  text-align: right;
}

.export-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--gap-2);
}

.project-total-sidebar .export-settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-total-sidebar .export-setting-toggle:last-child {
  grid-column: 1 / -1;
}

.export-setting-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 36px;
  border: 1px solid var(--cg-line-2);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--cg-teal-900);
  background: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.export-setting-toggle:hover,
.export-setting-toggle:focus-visible {
  border-color: var(--cg-teal-700);
  outline: none;
}

.export-setting-toggle.is-active {
  border-color: var(--cg-teal-900);
  color: #fff;
  background: var(--cg-teal-900);
}

.export-setting-toggle:not(.is-active) {
  color: var(--cg-teal-900);
  background: #fff;
}

.export-setting-toggle-mark {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.export-setting-toggle.is-active .export-setting-toggle-mark {
  background: transparent;
}

.export-setting-toggle.is-active .export-setting-toggle-mark::after {
  content: "×";
  position: absolute;
  top: 50%;
  left: 50%;
  color: currentColor;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  transform: translate(-50%, -56%);
}

.scope-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.partner-scope-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.session-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap-2);
}

.session-choice-grid.has-telegram {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.session-back-link {
  appearance: none;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 760;
  line-height: 1;
}

.session-back-link:hover,
.session-back-link:focus-visible {
  color: var(--accent-strong);
  outline: none;
}

.session-import-panel {
  display: grid;
  gap: var(--gap-2);
}

.session-drop-zone {
  appearance: none;
  display: grid;
  gap: 5px;
  align-content: center;
  min-height: 148px;
  width: 100%;
  padding: 18px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0)),
    var(--surface-soft);
  text-align: center;
  white-space: normal;
  cursor: pointer;
}

.session-drop-zone strong {
  font-size: 15px;
  font-weight: 820;
  line-height: 1.2;
}

.session-drop-zone span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

.session-drop-zone:hover,
.session-drop-zone:focus-visible,
.session-drop-zone.is-drag-over {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-soft);
  outline: none;
}

.session-drop-zone:hover span,
.session-drop-zone:focus-visible span,
.session-drop-zone.is-drag-over span {
  color: var(--accent-strong);
}

.telegram-export-list {
  display: grid;
  gap: var(--gap-2);
}

.export-telegram-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 1fr);
  align-items: center;
  gap: var(--gap-2);
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.export-delivery-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-2);
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: var(--surface-muted);
  font-size: 0.88rem;
}

.export-delivery-note strong {
  color: var(--text);
}

.export-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--surface);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  white-space: normal;
}

.export-button:hover,
.export-button:focus-visible {
  border-color: var(--accent);
  color: var(--accent-strong);
  outline: none;
}

.export-button.primary {
  border-color: var(--accent);
  color: white;
  background: var(--accent);
}

.export-button.primary:hover,
.export-button.primary:focus-visible {
  color: white;
  background: var(--accent-strong);
}

.export-button-subtle {
  min-height: 44px;
  border-color: var(--border);
  color: var(--muted);
  background: var(--surface-muted);
  font-size: 14px;
  font-weight: 800;
}

.export-button-subtle:hover,
.export-button-subtle:focus-visible {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--surface);
}

.export-button-telegram {
  min-height: 48px;
  border-color: rgba(42, 91, 140, 0.28);
  color: #214a75;
  background: #f4f8fb;
}

.export-button-telegram:hover,
.export-button-telegram:focus-visible {
  border-color: #2a6fa8;
  color: #17456d;
  background: #eef6fb;
}

.export-button.danger {
  border-color: rgba(179, 75, 75, 0.35);
  color: var(--danger);
  background: #fff7f7;
}

.export-button.danger:hover,
.export-button.danger:focus-visible {
  border-color: var(--danger);
  color: var(--danger);
  background: #fff1f1;
}

.export-button.reset-choice-card {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 5px;
  text-align: left;
}

.export-readiness-note {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid #b42318;
  border-radius: var(--radius-sm);
  background: #b42318;
}

.export-readiness-note strong {
  color: #ffe0dc;
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

.export-readiness-note span {
  color: #ffffff;
  font-weight: 760;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-soft);
  font-weight: 800;
}

.partner-export-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap-3);
}

.partner-export-card {
  display: grid;
  gap: 8px;
  min-height: 110px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface-soft);
  text-align: left;
}

.partner-export-card:hover,
.partner-export-card:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.partner-export-card span {
  color: var(--muted);
  font-weight: 700;
}

.partner-export-card strong {
  font-size: 24px;
}

.partner-export-card small {
  color: var(--muted);
  font-size: 12px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--gap-2);
}

.quantity-discount-modal {
  gap: 14px;
}

.quantity-discount-summary {
  display: grid;
  gap: 8px;
}

.quantity-discount-summary > div {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.quantity-discount-summary span,
.quantity-discount-summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.quantity-discount-summary strong {
  color: var(--text);
  font-size: 18px;
  font-weight: 760;
}

.quantity-discount-actions .button.primary {
  min-width: 164px;
}

.summary-overtime-editor-modal {
  gap: 16px;
}

.summary-overtime-editor-table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.summary-overtime-editor-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  table-layout: fixed;
}

.summary-overtime-editor-table th,
.summary-overtime-editor-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.summary-overtime-editor-table tbody tr:last-child td {
  border-bottom: 0;
}

.summary-overtime-editor-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0;
}

.summary-overtime-editor-table th:nth-child(1),
.summary-overtime-editor-table td:nth-child(1) {
  width: 36%;
}

.summary-overtime-editor-table th:nth-child(2),
.summary-overtime-editor-table td:nth-child(2),
.summary-overtime-editor-table th:nth-child(4),
.summary-overtime-editor-table td:nth-child(4) {
  width: 12%;
}

.summary-overtime-editor-table th:nth-child(3),
.summary-overtime-editor-table td:nth-child(3),
.summary-overtime-editor-table th:nth-child(5),
.summary-overtime-editor-table td:nth-child(5) {
  width: 20%;
}

.summary-overtime-editor-table .number-cell,
.summary-overtime-editor-table .money {
  text-align: right;
}

.summary-overtime-editor-table .row-input {
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--surface-soft);
  text-align: right;
}

.summary-overtime-editor-table .row-input:not(.is-readonly):not([readonly]) {
  border-color: rgba(18, 120, 96, 0.22);
  background: #f4fbf8;
  font-weight: 650;
}

.summary-overtime-role {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.summary-overtime-role strong {
  color: var(--surface-strong);
  font-size: 14px;
  line-height: 1.2;
}

.summary-overtime-role small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-overtime-editor-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--surface-strong);
  background: #f2faf7;
}

.summary-overtime-editor-total span,
.summary-overtime-editor-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.summary-overtime-editor-total strong {
  font-size: 20px;
  white-space: nowrap;
}

.summary-overtime-editor-note {
  margin: -6px 0 0;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 40px));
  padding: 12px 14px;
  border-radius: 8px;
  color: white;
  background: var(--surface-strong);
  box-shadow: 0 18px 48px rgba(22, 32, 34, 0.28);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.print-sheet {
  display: none;
}

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

  .left-rail {
    gap: 0;
  }

  .catalog-panel {
    position: sticky;
    top: 12px;
    z-index: 10;
  }

  .catalog-panel.is-collapsed {
    box-shadow: 0 10px 24px rgba(20, 29, 31, 0.08);
  }

  .catalog-panel .panel-header {
    flex-direction: row;
    align-items: center;
    min-height: 52px;
  }

  .catalog-panel.is-collapsed .panel-header {
    border-bottom: 0;
  }

  .catalog-list {
    max-height: 460px;
  }

  .summary-strip,
  .partners-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .db-modal-layout {
    grid-template-columns: 1fr;
  }

  .db-media-section {
    position: static;
  }

  .db-controls-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .import-suggestion-card {
    grid-template-columns: auto minmax(0, 1fr) repeat(3, minmax(72px, 1fr));
  }

  .priced-suggestion-card,
  .external-suggestion-card,
  .unmatched-suggestion-card {
    grid-template-columns: auto minmax(0, 1fr) repeat(3, minmax(72px, 1fr));
  }

  .import-suggestion-card .price-pill {
    grid-column: 2 / -1;
    justify-self: start;
  }

  .priced-suggestion-card .price-pill,
  .external-suggestion-card .price-pill,
  .unmatched-suggestion-card .price-pill {
    grid-column: 2 / -1;
    justify-self: start;
  }

  .import-qty-field,
  .import-price-field,
  .import-discount-field {
    width: auto;
  }
}

@media (min-width: 761px) and (max-width: 1366px) {
  .estimate-desk,
  .estimate-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .desk-rail,
  .desk-sidebar,
  .left-rail {
    display: none;
  }

  .desk-shell,
  .desk-content,
  .desk-list,
  .desk-project-area,
  .main-flow {
    min-width: 0;
    max-width: 100%;
    width: 100%;
  }

  .desk-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1180px) {
  html,
  body,
  .app-shell {
    max-width: 100%;
    overflow-x: visible;
  }

  .topbar {
    position: static;
    align-items: stretch;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    padding: 14px;
  }

  .brand-block,
  .brand-block > div,
  .workspace,
  .estimate-grid,
  .left-rail,
  .main-flow,
  .panel,
  .panel-header,
  .panel-body {
    min-width: 0;
    max-width: 100%;
  }

  .brand-title,
  .brand-meta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .operator-greeting {
    align-self: stretch;
    margin-left: 0;
    text-align: center;
    white-space: normal;
  }

  .view-tabs {
    width: 100%;
    min-width: 0;
  }

  .tab-button {
    min-width: 0;
    flex: 1;
  }

  .workspace {
    padding: 14px 14px 64px;
  }

  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .desktop-label {
    display: none;
  }

  .mobile-label {
    display: inline;
  }

  .catalog-panel .panel-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(112px, auto);
    align-items: center;
    flex-direction: row;
    gap: 8px;
  }

  .catalog-heading {
    flex-wrap: wrap;
    gap: 4px 8px;
  }

  .catalog-heading .panel-title,
  .catalog-heading .panel-subtitle {
    min-width: 0;
  }

  .catalog-toggle {
    flex: 0 0 auto;
    width: auto;
    min-width: 112px;
    min-height: 40px;
    padding-inline: 10px;
  }

  .panel-header .toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    min-width: 0;
  }

  .panel-header .button {
    width: 100%;
    min-width: 0;
    padding-inline: 8px;
    flex: none;
    white-space: normal;
  }

  .panel-header .icon-button {
    width: 100%;
  }

  .estimate-meta-panel .panel-header .toolbar {
    grid-template-columns: minmax(0, 1.18fr) 40px 40px 42px minmax(0, 0.86fr) minmax(0, 0.96fr) minmax(0, 0.82fr);
    gap: 6px;
  }

  .estimate-meta-panel .panel-header .toolbar .button:first-child {
    grid-column: auto;
  }

  .shift-panel .panel-header .toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .shift-panel .panel-header .button {
    min-height: 34px;
    font-size: 11px;
  }

  .estimate-meta-panel,
  .shift-panel {
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(18, 25, 27, 0.12);
  }

  .estimate-meta-panel > .panel-header,
  .shift-panel > .panel-header {
    min-height: 0;
    padding: 12px 14px 10px;
    gap: 9px;
  }

  .estimate-meta-panel > .panel-body,
  .shift-panel > .panel-body {
    padding: 12px 14px 14px;
  }

  .estimate-meta-panel .panel-header .button,
  .shift-panel .panel-header .button {
    min-height: 40px;
    padding-inline: 7px;
    border-radius: 7px;
    white-space: nowrap;
  }

  .estimate-meta-panel .panel-header .session-button {
    width: 42px;
    min-height: 40px;
    min-width: 0;
    padding: 0;
  }

  .estimate-meta-panel .panel-header .history-button {
    width: 40px;
    min-height: 40px;
    min-width: 0;
    padding: 0;
    font-size: 18px;
  }

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

  .estimate-form .field:nth-child(1),
  .estimate-form .field:nth-child(2),
  .estimate-form .field.is-wide {
    grid-column: 1 / -1;
  }

  .project-profile-badge {
    grid-template-columns: 1fr;
  }

  .estimate-meta-panel .field > span,
  .shift-panel .field > span {
    font-size: 11px;
  }

  .catalog-panel .chip,
  .catalog-panel .button {
    min-height: 40px;
  }

  .catalog-panel .catalog-stepper {
    grid-template-columns: 40px 38px 40px;
    min-height: 40px;
  }

  .catalog-panel .stepper-button {
    width: 40px;
    height: 40px;
  }

  .estimate-form > .field,
  .active-shift-fields > .field,
  .date-text-field,
  .estimate-meta-panel .input,
  .estimate-meta-panel .select,
  .shift-panel .input,
  .shift-panel .select {
    min-width: 0;
    max-width: 100%;
  }

  .estimate-meta-panel .input,
  .estimate-meta-panel .select,
  .shift-panel .input,
  .shift-panel .select {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 16px;
  }

  .client-request-details summary {
    align-items: flex-start;
    min-height: 40px;
    padding: 10px 9px 10px 12px;
  }

  .client-request-details summary strong {
    max-width: 48%;
    text-align: right;
  }

  .client-request-meta {
    grid-template-columns: 1fr;
  }

  .active-shift-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 8px;
  }

  .active-shift-fields .field:nth-child(2),
  .active-shift-fields .field:nth-child(3),
  .shift-mini-fields {
    grid-column: 1 / -1;
  }

  .shift-mini-fields {
    justify-self: end;
  }

  .estimate-form,
  .active-shift-fields,
  .external-import-meta-grid,
  .import-meta-grid,
  .summary-strip,
  .partners-grid,
  .db-form-grid,
  .db-media-grid,
  .export-choice-grid,
  .export-format-grid,
  .export-settings-grid,
  .partner-target-grid,
  .partner-scope-grid,
  .import-apply-grid,
  .import-apply-grid.has-all-reset,
  .reset-choice-grid {
    grid-template-columns: 1fr;
  }

  .export-telegram-panel {
    grid-template-columns: 1fr;
  }

  .export-settings-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .export-settings-head small {
    text-align: left;
  }

  .field.is-wide {
    grid-column: auto;
  }

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

  .estimate-form .field:nth-child(1),
  .estimate-form .field:nth-child(2),
  .estimate-form .field:nth-child(3),
  .estimate-form .field:nth-child(4),
  .estimate-form .field.is-wide {
    grid-column: 1 / -1;
  }

  .active-shift-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 8px;
  }

  .active-shift-fields .field:nth-child(2),
  .active-shift-fields .field:nth-child(3),
  .shift-mini-fields {
    grid-column: 1 / -1;
  }

  .shift-mini-fields {
    justify-self: end;
  }

  .rental-head {
    grid-template-columns: 1fr;
  }

  .line-table-wrap {
    overflow: visible;
  }

  .line-table {
    display: block;
    min-width: 0;
  }

  .line-table thead {
    display: none;
  }

  .line-table tbody {
    display: grid;
    gap: 10px;
  }

  .line-table tr[data-line-row] {
    display: grid;
    grid-template-columns: 34px 34px 46px minmax(52px, auto);
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
  }

  .line-table tr[data-line-row] td {
    display: grid;
    grid-template-columns: minmax(82px, 0.45fr) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 0;
    border: 0;
  }

  .line-table tr[data-line-row] td:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
    display: grid;
    place-items: center;
  }

  .line-table tr[data-line-row] td:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
    display: grid;
    grid-template-columns: 1fr;
    place-items: center;
  }

  .line-table tr[data-line-row] td:nth-child(3) {
    grid-column: 3;
    grid-row: 1;
    display: grid;
    place-items: center;
  }

  .line-table tr[data-line-row] td:nth-child(4) {
    grid-column: 1 / -1;
    grid-row: 2;
    align-self: center;
  }

  .line-table tr[data-line-row] td:nth-child(10) {
    grid-column: 4;
    grid-row: 1;
    display: grid;
    justify-self: end;
  }

  .line-table tr[data-line-row] td:nth-child(n + 5):nth-child(-n + 9) {
    grid-column: 1 / -1;
  }

  .line-table tr[data-line-row] td:nth-child(5),
  .line-table tr[data-line-row] td:nth-child(6),
  .line-table tr[data-line-row] td:nth-child(7),
  .line-table tr[data-line-row] td:nth-child(8) {
    min-height: 34px;
    padding: 6px 0;
    border-top: 1px solid rgba(221, 229, 222, 0.72);
  }

  .line-table tr[data-line-row] td:nth-child(5) > *,
  .line-table tr[data-line-row] td:nth-child(6) > *,
  .line-table tr[data-line-row] td:nth-child(7) > *,
  .line-table tr[data-line-row] td:nth-child(8) > * {
    justify-self: end;
    text-align: right;
  }

  .line-table tr[data-line-row] td:nth-child(9) {
    grid-template-columns: 1fr;
    align-items: stretch;
    padding-top: 4px;
  }

  .line-table .line-name-cell {
    min-width: 0;
  }

  .line-table .line-name-editor-wrap {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 8px;
  }

  .line-table .line-name-editor {
    min-height: 44px;
    max-height: 68px;
    white-space: normal;
    overflow: hidden;
    overflow-wrap: anywhere;
    font-size: 18px;
    line-height: 1.2;
    padding: 9px 10px;
  }

  .line-table .line-name-editor:hover,
  .line-table .line-name-editor:focus {
    min-height: 76px;
    max-height: 140px;
    overflow: auto;
  }

  .line-table .line-mod-button {
    min-width: 44px;
    height: 44px;
    padding: 0 7px;
  }

  .line-table .line-comment-editor {
    min-height: 38px;
    max-height: 58px;
    resize: none;
    font-size: 15px;
    overflow-y: hidden;
  }

  .line-table .line-comment-editor:hover,
  .line-table .line-comment-editor:focus,
  .line-table .line-comment-editor.is-comment-expanded {
    min-height: 96px;
    max-height: 280px;
  }

  .line-table .line-thumb {
    width: 44px;
    height: 44px;
  }

  .line-table .line-qty-stepper {
    width: 100%;
    min-width: 0;
  }

  .line-table .row-actions {
    display: inline-flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
  }

  .line-table .row-actions .button {
    min-height: 36px;
    min-width: 48px;
    padding-inline: 9px;
  }

  .line-table tr[data-list-id="top"] {
    grid-template-columns: 34px 34px minmax(0, 1fr) auto;
  }

  .line-table tr[data-list-id="top"] td:nth-child(3) {
    grid-column: 1 / -1;
    grid-row: 2;
    display: block;
  }

  .line-table tr[data-list-id="top"] td:nth-child(4) {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .line-table tr[data-list-id="top"] td:nth-child(9) {
    padding-top: 4px;
  }

  .line-table tr[data-list-id="top"] td:nth-child(10) {
    grid-column: 4;
    grid-row: 1;
  }

  .line-table .section-title-row {
    display: block;
    border: 0;
  }

  .line-table .section-title-row td {
    display: block;
    padding: 8px 10px;
    border: 0;
  }

  .line-table .total-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) repeat(3, auto);
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
  }

  .line-table .total-row td {
    display: none;
    padding: 0;
    border: 0;
  }

  .line-table .total-row td:nth-child(2),
  .line-table .total-row td:nth-child(3),
  .line-table .total-row td:nth-child(4),
  .line-table .total-row td:nth-child(5) {
    display: block;
  }

  .line-table .total-row td:nth-child(2) {
    font-weight: 850;
  }

  .line-table .discount-summary-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    padding: 0 10px 10px;
    background: var(--surface-soft);
  }

  .line-table .discount-summary-row td {
    display: none;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .line-table .discount-summary-row td:nth-child(3) {
    display: block;
  }

  .total-table {
    display: block;
    min-width: 0;
    table-layout: auto;
  }

  .total-table thead {
    display: none;
  }

  .total-table tbody {
    display: grid;
    gap: 8px;
  }

  .total-table tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 9px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
  }

  .total-table td {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 0;
    border: 0;
  }

  .total-table td:nth-child(n) {
    width: auto;
  }

  .total-table td::before {
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
    text-transform: uppercase;
  }

  .total-table td:nth-child(1) {
    grid-column: 1 / -1;
  }

  .total-table td:nth-child(1) .row-input,
  .total-table td:nth-child(1) .summary-label-input {
    min-height: 40px;
    font-size: 16px;
    font-weight: 400;
  }

  .total-table td:nth-child(1)::before {
    content: "Позиция";
  }

  .total-table td:nth-child(2)::before {
    content: "Состав";
  }

  .total-table td:nth-child(3)::before {
    content: "Ставка/ч";
  }

  .total-table td:nth-child(4)::before {
    content: "Часы перераб.";
  }

  .total-table td:nth-child(5),
  .total-table td:nth-child(6) {
    grid-column: span 1;
  }

  .total-table td:nth-child(5)::before {
    content: "Полная";
  }

  .total-table td:nth-child(6)::before {
    content: "Цена со скидкой";
  }

  .total-table td:nth-child(7) {
    grid-column: 1 / -1;
  }

  .total-table td:nth-child(7)::before {
    content: "Комментарий";
  }

  .total-table .row-input {
    min-height: 36px;
    padding: 7px 8px;
    background: var(--surface-soft);
  }

  .total-table .summary-label-input {
    min-height: 40px;
    max-height: 80px;
    resize: vertical;
    overflow: auto;
    white-space: pre-wrap;
  }

  .total-table td:nth-child(7) .row-textarea {
    min-height: 38px;
    max-height: 52px;
    overflow: auto;
  }

  .total-table td:nth-child(7) .row-textarea:hover,
  .total-table td:nth-child(7) .row-textarea:focus {
    min-height: 72px;
    max-height: 180px;
  }

  .total-table td:nth-child(7) .row-textarea.summary-note-input {
    min-height: 48px;
    max-height: none;
    overflow-y: hidden;
    resize: none;
  }

  .total-table tbody tr:last-child {
    background: #f8faf7;
  }

  .total-panel .panel-header {
    min-height: 0;
    padding: 12px 14px;
  }

  .total-panel .panel-body {
    padding: 0;
  }

  .total-panel .table-wrap {
    overflow: visible;
  }

  .total-panel .total-table tbody {
    gap: 0;
  }

  .total-panel .total-table tr {
    grid-template-columns: minmax(0, 1fr) minmax(72px, 0.42fr) minmax(88px, 0.5fr);
    gap: 6px 8px;
    padding: 11px 14px;
    border: 0;
    border-bottom: 1px solid rgba(220, 225, 220, 0.86);
    border-radius: 0;
    background: transparent;
  }

  .total-panel .total-table tr.summary-group-row {
    display: block;
    padding: 18px 14px 6px;
    border-bottom: 0;
    background: transparent;
  }

  .total-panel .total-table tr.summary-group-row td {
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .total-panel .total-table tr.summary-group-row td::before {
    display: none;
    content: "";
  }

  .total-panel .summary-group-label {
    min-height: 22px;
    padding: 0;
  }

  .total-panel .summary-group-label span,
  .total-panel .summary-group-label small {
    font-size: 11px;
  }

  .total-panel .total-table tr.is-total-summary-row {
    background: #f2faf7;
  }

  .total-panel .total-table td {
    gap: 3px;
  }

  .total-panel .total-table td::before {
    font-size: 9px;
    line-height: 1;
    letter-spacing: 0;
  }

  .total-panel .total-table td:nth-child(1) {
    grid-column: 1 / -1;
  }

  .total-panel .total-table td:nth-child(1)::before {
    display: none;
  }

  .total-panel .total-table td:nth-child(2),
  .total-panel .total-table td:nth-child(3),
  .total-panel .total-table td:nth-child(4) {
    grid-column: span 1;
    display: flex;
    align-items: center;
    gap: 5px;
    min-height: 18px;
  }

  .total-panel .total-table tr.has-no-time-details td:nth-child(2),
  .total-panel .total-table tr.has-no-time-details td:nth-child(3),
  .total-panel .total-table tr.has-no-time-details td:nth-child(4),
  .total-panel .total-table tr.has-no-client-discount td:nth-child(6),
  .total-panel .total-table tr.has-empty-summary-note td:nth-child(7) {
    display: none;
  }

  .total-panel .total-table td:nth-child(5) {
    grid-column: 1 / 2;
  }

  .total-panel .total-table tr.has-no-client-discount td:nth-child(5) {
    grid-column: 1 / -1;
  }

  .total-panel .total-table td:nth-child(6) {
    grid-column: 2 / 4;
  }

  .total-panel .total-table td:nth-child(7) {
    grid-column: 1 / -1;
  }

  .total-panel .total-table .row-input {
    min-height: 30px;
    padding: 5px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-size: 15px;
  }

  .total-panel .total-table .summary-label-input {
    min-height: 26px;
    max-height: 44px;
    padding: 0;
    overflow: hidden;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.2;
    resize: none;
  }

  .total-panel .total-table td:nth-child(5) .row-input,
  .total-panel .total-table td:nth-child(6) .row-input {
    min-height: 32px;
    padding: 6px 8px;
    border-radius: 6px;
    background: var(--surface-soft);
    text-align: right;
    font-size: 16px;
  }

  .total-panel .total-table td:nth-child(7) .row-textarea {
    min-height: 30px;
    max-height: 34px;
    padding: 6px 8px;
    border-radius: 6px;
    background: var(--surface-soft);
    overflow: hidden;
    resize: none;
  }

  .total-panel .total-table td:nth-child(7) .row-textarea:hover,
  .total-panel .total-table td:nth-child(7) .row-textarea:focus {
    min-height: 72px;
    max-height: 160px;
    overflow: auto;
  }

  .total-panel .total-table td:nth-child(7) .row-textarea.summary-note-input,
  .total-panel .total-table td:nth-child(7) .row-textarea.summary-note-input:hover,
  .total-panel .total-table td:nth-child(7) .row-textarea.summary-note-input:focus {
    min-height: 48px;
    max-height: none;
    overflow-y: hidden;
    resize: none;
  }

  .total-panel .total-table tr.is-summary-aggregate-row td:nth-child(7) .row-textarea.summary-note-input {
    min-height: 76px;
  }

  .total-panel .summary-empty,
  .total-panel .summary-static-number,
  .total-panel .summary-static-text,
  .total-panel .summary-comment-list {
    justify-content: flex-start;
    width: auto;
    font-size: 13px;
  }

  .line-table tr[data-line-row] {
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 10px 12px;
    padding: 12px;
  }

  .line-table tr[data-line-row] td {
    grid-template-columns: minmax(108px, 0.9fr) minmax(0, 1fr);
    gap: 8px 10px;
  }

  .line-table tr[data-line-row] td:nth-child(1),
  .line-table tr[data-line-row] td:nth-child(2) {
    display: none;
  }

  .line-table tr[data-line-row] td:nth-child(3) {
    grid-column: 1;
    grid-row: 1;
  }

  .line-table tr[data-line-row] td:nth-child(4) {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .line-table tr[data-line-row] td:nth-child(5) {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .line-table tr[data-line-row] td:nth-child(6) {
    grid-column: 1 / -1;
    grid-row: 4;
  }

  .line-table tr[data-line-row] td:nth-child(7) {
    grid-column: 1 / -1;
    grid-row: 5;
  }

  .line-table tr[data-line-row] td:nth-child(8) {
    grid-column: 1 / -1;
    grid-row: 6;
  }

  .line-table tr[data-line-row] td:nth-child(9) {
    display: none;
    grid-column: 1 / -1;
    grid-row: 7;
  }

  .line-table tr[data-line-row] td:nth-child(10) {
    grid-column: 3;
    grid-row: 1;
    align-self: start;
  }

  .line-table .line-name-editor-wrap {
    grid-template-columns: minmax(0, 1fr);
  }

  .line-table .line-name-editor {
    min-height: 48px;
    max-height: none;
    font-size: 18px;
    line-height: 1.2;
  }

  .line-table .line-mod-button {
    display: none;
    width: fit-content;
    min-width: 68px;
    height: 40px;
  }

  .line-table .line-thumb {
    width: 52px;
    height: 52px;
  }

  .line-table .line-qty-stepper {
    justify-self: end;
    width: min(168px, 100%);
    grid-template-columns: 44px minmax(46px, 1fr) 44px;
  }

  .line-table .line-qty-stepper .row-input {
    min-width: 0;
    padding-inline: 6px;
  }

  .line-table .row-actions {
    align-items: flex-end;
    flex-direction: column;
    gap: 6px;
  }

  .line-table .row-actions .button,
  .line-table .line-status-actions {
    display: none;
  }

  .line-table tr[data-list-id="top"] {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .line-table tr[data-list-id="top"] td:nth-child(3) {
    grid-column: 1;
    grid-row: 1;
  }

  .line-table tr[data-list-id="top"] td:nth-child(4) {
    display: none;
    grid-column: 1 / -1;
    grid-row: 7;
  }

  .line-table tr[data-list-id="top"] td:nth-child(10) {
    grid-column: 2;
    grid-row: 1;
  }

  .line-table tr[data-line-row],
  .line-table tr[data-list-id="top"] {
    display: block;
    width: 100%;
    height: auto !important;
    min-height: 0 !important;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .line-table tr[data-line-row] > td:not(.mobile-line-card-cell) {
    display: none !important;
  }

  .line-table tr[data-line-row] > .mobile-line-card-cell {
    display: block !important;
    width: 100%;
    height: auto !important;
    min-height: 0 !important;
    padding: 0;
    border: 0;
  }

  .mobile-line-card {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 10px;
    width: 100%;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: 0 10px 28px rgba(22, 32, 34, 0.07);
  }

  .mobile-line-card.is-disabled {
    opacity: 0.58;
  }

  .mobile-line-top {
    grid-column: 1;
    grid-row: 1;
  }

  .mobile-line-thumb {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--muted);
    background: var(--surface-soft);
    font-size: 12px;
    font-weight: 850;
  }

  .mobile-line-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .mobile-line-title {
    position: relative;
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    min-width: 0;
    border: 0;
    border-radius: var(--radius-sm);
    padding: 0;
    color: var(--text);
    background: transparent;
    text-align: left;
    overflow-wrap: anywhere;
    font-size: 20px;
    font-weight: 760;
    line-height: 1.14;
  }

  .mobile-line-card.is-manual-line .mobile-line-title {
    padding-left: 10px;
  }

  .mobile-line-card.is-manual-line .mobile-line-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 2px;
    width: 3px;
    height: 20px;
    border-radius: 999px;
    background: var(--manual-marker);
  }

  .mobile-line-title:focus-visible,
  .mobile-line-metric:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }

  .mobile-line-metrics {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding-top: 9px;
    border-top: 1px solid rgba(220, 225, 220, 0.86);
  }

  .mobile-line-metric {
    display: grid;
    gap: 5px;
    min-width: 0;
    min-height: 50px;
    border: 0;
    border-radius: var(--radius-sm);
    padding: 0;
    color: var(--text);
    background: transparent;
    text-align: left;
  }

  .mobile-line-metric small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 820;
    line-height: 1;
    text-transform: uppercase;
  }

  .mobile-line-metric span {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.2;
  }

  .mobile-line-metric.is-total span {
    color: var(--accent-strong);
    font-weight: 650;
  }

  .mobile-line-metric.is-wide {
    grid-column: 1 / -1;
    min-height: 44px;
  }

  .mobile-line-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
    justify-content: center;
    padding-top: 8px;
    border-top: 1px solid rgba(220, 225, 220, 0.86);
  }

  .mobile-line-actions .line-mod-button,
  .mobile-line-actions .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    width: auto;
    min-width: 52px;
    padding: 0 11px;
    font-size: 12px;
  }

  .mobile-line-actions .mobile-edit-line-button {
    min-width: 82px;
  }

  .mobile-line-actions .line-status-actions {
    display: contents;
  }

  .line-table tfoot {
    display: block;
    width: 100%;
  }

  .line-table .total-row.is-rental-total {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 10px;
    width: 100%;
    margin-top: 2px;
    padding: 10px 12px;
    border: 1px solid var(--rental-border);
    border-radius: var(--radius-sm);
    background: var(--rental-tone-soft);
  }

  .line-table .total-row.is-rental-total td {
    display: none;
    min-width: 0;
    padding: 0;
    border: 0;
    color: var(--text);
    background: transparent;
  }

  .line-table .total-row.is-rental-total td:nth-child(2) {
    display: block;
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    color: var(--rental-tone-ink);
    font-size: 11px;
    font-weight: 820;
    line-height: 1.1;
    text-transform: uppercase;
  }

  .line-table .total-row.is-rental-total td:nth-child(3) {
    display: block;
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    color: var(--accent-strong);
    font-size: 16px;
    font-weight: 650;
    text-align: right;
    white-space: nowrap;
  }

  .line-table .total-row.is-rental-total td:nth-child(4) {
    display: grid;
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: minmax(0, 1fr) minmax(116px, 44%);
    align-items: center;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(221, 229, 222, 0.8);
  }

  .line-table .total-row.is-rental-total td:nth-child(4)::before {
    content: "Цена со скидкой";
    color: var(--muted);
    font-size: 10px;
    font-weight: 820;
    line-height: 1;
    text-transform: uppercase;
  }

  .line-table .total-row.is-rental-total .rental-total-discount-input {
    width: 100%;
    min-height: 34px;
    padding: 6px 8px;
    text-align: right;
  }

  .partner-export-grid {
    grid-template-columns: 1fr;
  }

  .import-suggestion-card,
  .unmatched-suggestion-card {
    grid-template-columns: 28px minmax(0, 1fr) minmax(0, 1fr);
    gap: 9px 8px;
    align-items: start;
    padding: 10px;
  }

  .import-suggestion-card > input[type="checkbox"] {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    margin-top: 8px;
  }

  .import-suggestion-main {
    grid-column: 2 / -1;
  }

  .import-name-input {
    height: 38px;
    font-size: 16px;
  }

  .import-suggestion-main small {
    white-space: normal;
    line-height: 1.25;
  }

  .import-bonus-toggle {
    width: fit-content;
  }

  .import-qty-field {
    grid-column: 2;
    justify-self: stretch;
  }

  .import-price-field {
    grid-column: 3;
    justify-self: stretch;
  }

  .import-discount-field,
  .import-suggestion-card .price-pill {
    grid-column: 2 / -1;
    justify-self: stretch;
  }

  .import-qty-field,
  .import-price-field,
  .import-discount-field {
    width: 100%;
  }

  .import-qty-stepper {
    grid-template-columns: 34px minmax(36px, 1fr) 34px;
  }

  .import-qty-stepper .import-qty,
  .import-qty-stepper-button,
  .import-price,
  .import-discount {
    height: 38px;
    min-height: 38px;
  }

  .import-total-pill {
    justify-content: center;
  }

  .modal-backdrop {
    align-items: start;
    padding: 14px;
  }

  .summary-overtime-editor-table-wrap {
    border: 0;
    overflow: visible;
  }

  .summary-overtime-editor-table {
    display: block;
    min-width: 0;
  }

  .summary-overtime-editor-table thead {
    display: none;
  }

  .summary-overtime-editor-table tbody {
    display: grid;
    gap: 8px;
  }

  .summary-overtime-editor-table tr {
    display: grid;
    grid-template-columns: minmax(58px, 0.75fr) minmax(96px, 1.2fr) minmax(76px, 1fr);
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
  }

  .summary-overtime-editor-table td {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 0;
    border: 0;
  }

  .summary-overtime-editor-table td:nth-child(n) {
    width: auto;
    justify-self: stretch;
  }

  .summary-overtime-editor-table td::before {
    color: var(--muted);
    font-size: 9px;
    font-weight: 650;
    line-height: 1;
    text-transform: uppercase;
  }

  .summary-overtime-editor-table td:nth-child(1) {
    grid-column: 1 / -1;
  }

  .summary-overtime-editor-table td:nth-child(5) {
    grid-column: 1 / -1;
  }

  .summary-overtime-editor-table td:nth-child(2)::before {
    content: "Состав";
  }

  .summary-overtime-editor-table td:nth-child(3)::before {
    content: "Ставка/ч";
  }

  .summary-overtime-editor-table td:nth-child(4)::before {
    content: "Часы перераб.";
  }

  .summary-overtime-editor-table td:nth-child(5)::before {
    content: "Итого";
  }

  .summary-overtime-editor-table .row-input {
    width: 100%;
    min-width: 0;
    min-height: 34px;
    padding: 6px 8px;
    border-radius: 6px;
    background: var(--surface-soft);
  }

  .summary-overtime-editor-total {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .mobile-line-editor-backdrop {
    align-items: center;
    padding: 14px;
  }
}

/* CINEGEAR Estimate Desk redesign handoff, 2026-07-31. */
:root {
  --cg-teal-900: #13394A;
  --cg-teal-700: #2E4C74;
  --cg-teal-200: #D5E8F2;
  --cg-teal-100: #E3EDF1;
  --cg-teal-050: #F1F7F8;
  --cg-yellow: #fcee8d;
  --cg-yellow-bg: #fff6ce;
  --cg-yellow-panel: #fff9e3;
  --cg-yellow-line: #f0e3a8;
  --cg-yellow-ink: #7a5d00;
  --cg-clay: #b04a3a;
  --cg-gold: #e8b931;
  --cg-terracotta: #d2694a;
  --cg-ink: #101F24;
  --cg-ink-2: #132628;
  --cg-ink-3: #324348;
  --cg-ink-4: #5E6D72;
  --cg-mute: #677579;
  --cg-mute-2: #95A1A5;
  --cg-mute-3: #C2CCCE;
  --cg-line: #E7ECEC;
  --cg-line-2: #DAE2E3;
  --cg-line-3: #F1F4F5;
  --cg-card-line: #E3E9EA;
  --cg-bg: #E8EDED;
  --cg-panel: #F7F9F9;
  --cg-panel-2: #F4F6F6;
  --cg-surface: #ffffff;
  --cg-dark-gray: #2A3334;
  --cg-dark-gray-2: #384244;
  --bg: var(--cg-bg);
  --surface: var(--cg-surface);
  --surface-soft: var(--cg-panel);
  --surface-strong: var(--cg-teal-900);
  --text: var(--cg-ink);
  --muted: var(--cg-mute);
  --border: var(--cg-line);
  --border-strong: var(--cg-line-2);
  --accent: var(--cg-teal-900);
  --accent-strong: var(--cg-teal-900);
  --accent-soft: var(--cg-teal-100);
  --manual-marker: var(--cg-yellow-ink);
  --danger: var(--cg-clay);
  --warning: var(--cg-yellow-ink);
  --shadow: 0 16px 40px rgba(19, 57, 74, 0.1);
  --radius: 10px;
  --radius-sm: 6px;
  font-family: "IBM Plex Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body[data-view="estimate"] {
  color: var(--cg-ink);
  background: var(--cg-bg);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
}

body[data-view="estimate"] .topbar {
  display: none;
}

body[data-view="estimate"] .workspace {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

body[data-view="estimate"] .button {
  min-height: 31px;
  border-color: var(--cg-line-2);
  border-radius: 7px;
  color: var(--cg-ink-3);
  background: var(--cg-surface);
  font-size: 12px;
  font-weight: 600;
}

body[data-view="estimate"] .button:hover,
body[data-view="estimate"] .button:focus-visible {
  border-color: var(--cg-teal-900);
  color: var(--cg-teal-900);
  outline: none;
}

body[data-view="estimate"] .button.primary {
  border-color: var(--cg-teal-900);
  color: #fff;
  background: var(--cg-teal-900);
}

body[data-view="estimate"] .button.primary:hover,
body[data-view="estimate"] .button.primary:focus-visible {
  color: #fff;
  background: var(--cg-teal-700);
}

body[data-view="estimate"] .button.danger {
  border-color: rgba(176, 74, 58, 0.28);
  color: var(--cg-clay);
  background: #fff9f7;
}

body[data-view="estimate"] .icon-button {
  width: 31px;
  min-width: 31px;
  height: 31px;
  color: var(--cg-mute);
  background: var(--cg-surface);
}

body[data-view="estimate"] .input,
body[data-view="estimate"] .select,
body[data-view="estimate"] .textarea,
body[data-view="estimate"] .row-input,
body[data-view="estimate"] .row-select {
  border-color: var(--cg-line-2);
  border-radius: 6px;
  color: var(--cg-ink);
  background: var(--cg-surface);
  font-size: 12.5px;
}

body[data-view="estimate"] .input:focus,
body[data-view="estimate"] .select:focus,
body[data-view="estimate"] .textarea:focus,
body[data-view="estimate"] .row-input:focus,
body[data-view="estimate"] .row-select:focus {
  border-color: var(--cg-teal-900);
  box-shadow: 0 0 0 3px rgba(19, 57, 74, 0.08);
  outline: none;
}

.estimate-desk {
  display: flex;
  min-height: 100vh;
  overflow: hidden;
  background: var(--cg-surface);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
}

@media (min-width: 1181px) {
  body[data-view="estimate"] .workspace {
    width: 100%;
    max-width: none;
    padding: 0;
  }

  .estimate-desk {
    height: 100vh;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
}

.desk-rail {
  display: flex;
  flex: 0 0 56px;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
  background: var(--cg-teal-900);
}

.desk-rail-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: var(--cg-teal-900);
  background: var(--cg-yellow);
  font-size: 10px;
  font-weight: 700;
}

.desk-rail-item,
.desk-rail-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 9px;
  color: #9BD3E2;
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
}

.desk-rail-item.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.desk-rail-spacer {
  flex: 1;
}

.desk-rail-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--cg-teal-900);
  background: var(--cg-teal-100);
}

.desk-shell {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--cg-surface);
}

.desk-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 16px;
  border-bottom: 1px solid var(--cg-line);
  background: var(--cg-surface);
}

.desk-project-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.desk-project-title span {
  flex: 0 0 auto;
  color: var(--cg-mute);
  font-size: 12.5px;
}

.desk-project-title strong {
  min-width: 0;
  overflow: hidden;
  color: var(--cg-ink);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desk-project-meta {
  flex: 0 1 auto;
  overflow: hidden;
  border: 0;
  border-radius: 5px;
  padding: 2px 8px;
  color: var(--cg-mute);
  background: var(--cg-panel-2);
  font: inherit;
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.desk-project-meta:hover,
.desk-project-meta:focus-visible {
  color: var(--cg-ink);
  background: var(--cg-panel);
  outline: 1px solid var(--cg-line-2);
}

.desk-compact-total {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid var(--cg-line-2);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--cg-ink);
  background: var(--cg-panel);
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.desk-compact-total:hover,
.desk-compact-total:focus-visible {
  border-color: #13394A;
  outline: none;
}

.desk-compact-total span,
.desk-compact-total small {
  color: var(--cg-mute);
  font-size: 11px;
  font-weight: 700;
}

.desk-compact-total strong {
  color: var(--cg-teal-900);
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  font-weight: 800;
}

.desk-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.mobile-toolbar-add-button,
.mobile-actions-menu {
  display: none;
}

.mobile-actions-menu summary {
  list-style: none;
}

.mobile-actions-menu summary::-webkit-details-marker {
  display: none;
}

.desk-build-meta {
  border-top: 1px solid var(--cg-line);
  padding: 7px 16px 8px;
  color: var(--cg-mute);
  background: var(--cg-surface);
  font-size: 10.5px;
  line-height: 1.2;
  text-align: right;
}

.database-desk {
  display: flex;
  min-height: 100vh;
  overflow: hidden;
  background: var(--cg-bg);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
}

.database-shell {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  background: var(--cg-bg);
}

.database-topbar {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 0 16px;
  border-bottom: 1px solid var(--cg-line);
  background: var(--cg-surface);
}

.database-topbar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.database-topbar-title span,
.database-topbar-title small {
  flex: 0 0 auto;
  color: var(--cg-mute);
  font-size: 12.5px;
}

.database-topbar-title strong {
  min-width: 0;
  overflow: hidden;
  color: var(--cg-ink);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-view="database"] .database-flow {
  flex: 1;
  padding: 14px 16px 64px;
  overflow: auto;
}

@media (min-width: 1181px) {
  body[data-view="database"] .topbar {
    display: none;
  }

  body[data-view="database"] .workspace {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
  }
}

.desk-shift-strip {
  border: 0;
  border-bottom: 1px solid var(--cg-line);
  border-radius: 0;
  background: var(--cg-panel);
  box-shadow: none;
}

.desk-shift-strip .shift-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 16px;
}

.desk-shift-strip .shift-tabs {
  align-items: center;
  gap: 8px;
  padding: 0;
}

.desk-shift-strip .shift-tab {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid var(--cg-line-2);
  border-radius: 9px;
  color: var(--cg-ink-3);
  background: var(--cg-surface);
  box-shadow: none;
}

.desk-shift-strip .shift-tab span {
  max-width: 180px;
  color: inherit;
  font-size: 12.5px;
  font-weight: 600;
}

.desk-shift-strip .shift-tab small {
  color: var(--cg-mute-2);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  font-weight: 500;
}

.desk-shift-strip .shift-tab.is-active {
  border-color: var(--cg-teal-900);
  color: #fff;
  background: var(--cg-teal-900);
  box-shadow: 0 3px 8px rgba(19, 57, 74, 0.25);
}

.desk-shift-strip .shift-tab.is-active small {
  color: #9BD3E2;
}

.shift-add-tab {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border: 1.5px dashed var(--cg-mute-3);
  border-radius: 9px;
  color: var(--cg-mute);
  background: var(--cg-surface);
  font-size: 15px;
}

.shift-total-tab {
  min-height: 34px;
  margin-left: 8px;
  padding: 0 14px;
  border: 1px solid var(--cg-yellow-line);
  border-radius: 9px;
  color: var(--cg-yellow-ink);
  background: var(--cg-yellow-bg);
  font-size: 12.5px;
  font-weight: 700;
}

.shift-context {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  color: var(--cg-mute);
  font-size: 11.5px;
}

.shift-hours-meta {
  color: var(--cg-mute);
  font-weight: 400;
}

.desk-shift-strip .active-shift-fields {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(122px, 170px) minmax(150px, 220px) minmax(180px, 1fr) max-content;
  gap: 8px;
  align-items: end;
}

.desk-shift-strip .field > span {
  color: var(--cg-mute);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.desk-shift-strip .input {
  min-height: 31px;
  padding: 4px 9px;
}

.desk-shift-strip .shift-mini-fields {
  grid-template-columns: repeat(2, 68px);
}

.desk-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  min-height: 0;
  flex: 1;
}

.desk-list {
  min-width: 0;
  border-right: 1px solid var(--cg-line);
  background: var(--cg-surface);
}

.estimate-add-panel {
  border-bottom: 1px solid var(--cg-line);
  background: var(--cg-surface);
}

.estimate-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  padding: 4px 14px;
}

.estimate-add-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 26px;
  border: 1px solid var(--cg-line-2);
  border-radius: 6px;
  padding: 0 9px;
  color: var(--cg-mute-2);
  background: #fafbfb;
  font-size: 12px;
}

.estimate-add-search span {
  color: var(--cg-ink-4);
  font-weight: 600;
}

.estimate-add-search .input {
  min-height: 24px;
  border: 0;
  padding: 0;
  background: transparent;
}

.estimate-add-search kbd {
  color: var(--cg-mute-2);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 600;
}

.rental-panel,
.external-rentals-section {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.rental-panel-cinegear {
  border: 0;
  box-shadow: none;
}

.rental-section-head {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
}

.cinegear-section-head {
  border-bottom: 0;
  background: var(--cg-teal-900);
}

.cinegear-section-head .cinegear-title {
  color: #ffffff;
}

.cinegear-title,
.external-section-bar .panel-title {
  color: var(--cg-teal-900);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.rental-panel-cinegear > .panel-body,
.external-rental-stack {
  padding: 0;
}

.external-section-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  margin-top: 18px;
  padding: 0 14px;
  background: var(--cg-teal-900);
}

.external-section-toggle {
  display: inline-flex;
  align-items: center;
  flex: 1 1 auto;
  gap: 8px;
  min-width: 0;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.external-section-toggle:disabled {
  cursor: default;
}

.external-section-toggle:hover .external-section-title,
.external-section-toggle:focus-visible .external-section-title {
  color: #fff3a8;
}

.external-section-toggle:focus-visible {
  outline: 2px solid rgba(255, 234, 121, 0.65);
  outline-offset: 3px;
}

.external-section-sign {
  flex: 0 0 auto;
  color: var(--cg-yellow);
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.external-section-bar .panel-title,
.external-section-title {
  color: var(--cg-yellow);
}

.external-section-note {
  color: #9BD3E2;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
}

.external-section-summary {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--cg-teal-900);
  background: #fff6c8;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.external-section-bar .button {
  margin-left: auto;
  border: 1.5px dashed var(--cg-yellow);
  color: var(--cg-yellow);
  background: transparent;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 700;
}

.external-rental-stack {
  display: grid;
  gap: 12px;
  padding: 12px 14px 20px;
}

body[data-view="estimate"] .line-table-wrap,
body[data-view="estimate"] .table-wrap {
  overflow-x: auto;
}

body[data-view="estimate"] .data-table {
  min-width: 850px;
  border-collapse: collapse;
  font-size: 12.5px;
}

body[data-view="estimate"] .data-table th {
  height: 28px;
  padding: 0 8px;
  color: var(--cg-mute-2);
  background: var(--cg-panel);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
}

body[data-view="estimate"] .data-table td {
  height: 36px;
  padding: 3px 8px;
  border-bottom: 1px solid var(--cg-line-3);
}

body[data-view="estimate"] .line-table .section-title-row td {
  height: 28px;
  padding: 6px 14px 2px;
  color: var(--cg-mute);
  background: var(--cg-surface);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body[data-view="estimate"] .line-table .section-title-row.is-spaced-group td {
  padding-top: 18px;
  border-top: 10px solid var(--cg-panel);
}

body[data-view="estimate"] .line-table tbody > .section-title-row.is-spaced-group:first-child td {
  padding-top: 6px;
  border-top: 0;
}

body[data-view="estimate"] .line-thumb {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  color: var(--cg-ink-4);
  background: var(--cg-line-3);
  font-size: 7.5px;
  font-weight: 700;
}

body[data-view="estimate"] .drag-handle {
  width: 20px;
  height: 20px;
  border: 0;
  color: var(--cg-mute-3);
  background: transparent;
  font-family: "IBM Plex Mono", monospace;
}

body[data-view="estimate"] input[type="checkbox"] {
  accent-color: var(--cg-teal-900);
}

body[data-view="estimate"] .line-name-cell {
  min-width: 220px;
}

body[data-view="estimate"] .line-name-editor {
  min-height: 28px;
  max-height: 32px;
  padding: 5px 0;
  border-color: transparent;
  color: var(--cg-ink-2);
  background: transparent;
  font-size: 12.5px;
  font-weight: 500;
}

body[data-view="estimate"] .line-name-editor:hover,
body[data-view="estimate"] .line-name-editor:focus {
  min-height: 56px;
  max-height: 130px;
  padding: 6px 7px;
  background: #fff;
}

body[data-view="estimate"] .row-input.number,
body[data-view="estimate"] .row-select,
body[data-view="estimate"] .summary-static-number,
body[data-view="estimate"] .money,
body[data-view="estimate"] .number-cell,
body[data-view="estimate"] .metric-value {
  font-family: "IBM Plex Mono", monospace;
  font-variant-numeric: tabular-nums;
}

body[data-view="estimate"] .row-input.number {
  min-height: 28px;
  padding: 4px 6px;
  border-color: transparent;
  background: transparent;
  color: var(--cg-ink-3);
}

body[data-view="estimate"] .row-input.number:hover,
body[data-view="estimate"] .row-input.number:focus {
  border-color: var(--cg-line-2);
  background: #fff;
}

body[data-view="estimate"] .row-input.is-price-overridden {
  border-color: var(--cg-yellow-line);
  background: var(--cg-yellow-bg);
  color: var(--cg-yellow-ink);
  font-weight: 700;
}

body[data-view="estimate"] .row-input.is-bonus-discount {
  border-color: var(--cg-yellow-line);
  background: var(--cg-yellow-bg);
  color: var(--cg-yellow-ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

body[data-view="estimate"] .line-full-input {
  color: var(--cg-ink);
  font-weight: 600;
}

body[data-view="estimate"] .line-qty-stepper {
  grid-template-columns: 24px minmax(28px, 1fr) 24px;
  min-width: 76px;
  border-color: transparent;
  background: transparent;
}

body[data-view="estimate"] .line-stepper-button {
  width: 24px;
  height: 28px;
  border-radius: 5px;
}

body[data-view="estimate"] .line-qty-input {
  min-height: 28px;
  border: 1px solid var(--cg-line-2);
  border-radius: 6px;
  color: var(--cg-ink-3);
  background: #fff;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 600;
}

body[data-view="estimate"] .line-comment-editor {
  min-height: 34px;
  max-height: 96px;
  padding: 5px 7px;
  color: var(--cg-ink);
  font-size: 11.5px;
}

body[data-view="estimate"] .line-comment-display {
  max-width: 116px;
  min-height: 28px;
  border-color: transparent;
  padding: 3px 6px;
  color: var(--cg-mute);
  background: transparent;
}

body[data-view="estimate"] .line-comment-display:hover,
body[data-view="estimate"] .line-comment-display:focus-visible {
  border-color: var(--cg-line-2);
  color: var(--cg-ink-3);
  background: var(--cg-panel);
}

body[data-view="estimate"] .line-comment-display span {
  font-size: 11px;
}

body[data-view="estimate"] .line-table th:nth-child(9),
body[data-view="estimate"] .line-table td:nth-child(9) {
  width: 112px;
  max-width: 128px;
}

body[data-view="estimate"] .line-table th:nth-child(10),
body[data-view="estimate"] .line-table td:nth-child(10) {
  width: 168px;
  min-width: 150px;
}

body[data-view="estimate"] .line-kind-select {
  min-height: 28px;
  padding-block: 3px;
  font-size: 11px;
}

body[data-view="estimate"] .row-actions {
  gap: 4px;
  align-items: center;
  flex-wrap: nowrap;
}

body[data-view="estimate"] .row-actions .button {
  min-width: 28px;
  min-height: 22px;
  padding: 0 6px;
  border-radius: 5px;
  color: var(--cg-mute);
  background: #fff;
  font-size: 11px;
}

body[data-view="estimate"] .row-actions .line-status-actions {
  display: contents;
}

body[data-view="estimate"] .row-actions .button.danger {
  color: var(--cg-clay);
  background: #fff;
}

body[data-view="estimate"] .total-row td {
  height: 30px;
  color: var(--cg-ink-3);
  background: var(--cg-panel);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  font-weight: 700;
}

body[data-view="estimate"] .discount-summary-row td {
  background: var(--cg-panel);
}

.bonus-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border: 1px solid var(--cg-yellow-line);
  border-radius: 5px;
  color: var(--cg-yellow-ink);
  background: var(--cg-yellow-bg);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

body[data-view="estimate"] .old-price {
  color: var(--cg-mute-2);
}

body[data-view="estimate"] .discounted,
body[data-view="estimate"] .discount-summary-pill {
  color: var(--cg-teal-900);
}

body[data-view="estimate"] .rental-card {
  overflow: hidden;
  border: 1px solid var(--cg-card-line);
  border-left: 0;
  border-radius: 10px;
  background: var(--cg-surface);
  box-shadow: none;
}

body[data-view="estimate"] .rental-card + .rental-card {
  margin-top: 0;
}

body[data-view="estimate"] .rental-head {
  grid-template-columns: minmax(180px, 1fr) minmax(96px, 148px) auto;
  gap: 8px;
  align-items: center;
  padding: 9px 12px;
  border-bottom: 1px solid var(--cg-line-3);
  background: var(--cg-surface);
}

body[data-view="estimate"] .rental-head .field > span {
  display: none;
}

body[data-view="estimate"] .rental-name-control {
  grid-template-columns: auto 8px minmax(0, 1fr);
  gap: 8px;
}

body[data-view="estimate"] .rental-inline-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  min-width: 18px;
  height: 22px;
  border: 0;
  border-radius: 4px;
  padding: 0;
  color: var(--rental-tone-ink);
  background: transparent;
  font-family: "IBM Plex Mono", monospace;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}

body[data-view="estimate"] button.rental-inline-toggle {
  cursor: pointer;
}

body[data-view="estimate"] button.rental-inline-toggle:hover,
body[data-view="estimate"] button.rental-inline-toggle:focus-visible {
  background: var(--rental-tone-soft);
  outline: none;
}

body[data-view="estimate"] .rental-color-bullet {
  width: 8px;
  height: 8px;
  box-shadow: none;
}

body[data-view="estimate"] .rental-head-collapsed {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 54px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--rental-border);
  color: var(--cg-ink);
  background: var(--rental-tone-soft);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

body[data-view="estimate"] .rental-head-collapsed:hover,
body[data-view="estimate"] .rental-head-collapsed:focus-visible {
  background: color-mix(in srgb, var(--rental-tone-soft) 78%, #ffffff);
  outline: none;
}

body[data-view="estimate"] .rental-collapsed-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

body[data-view="estimate"] .rental-collapsed-title strong {
  min-width: 0;
  overflow: hidden;
  color: var(--cg-ink);
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-view="estimate"] .rental-head-total {
  display: inline-flex;
  align-items: baseline;
  flex: 0 0 auto;
  gap: 7px;
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--rental-tone-ink);
  background: #ffffff;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

body[data-view="estimate"] .rental-head-total s {
  color: var(--cg-mute);
  font-weight: 500;
}

body[data-view="estimate"] .rental-head-total.is-empty {
  color: var(--cg-mute);
}

body[data-view="estimate"] .rental-collapsed-meta {
  color: var(--cg-mute);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

body[data-view="estimate"] .rental-name-control .input {
  min-height: 28px;
  border-color: transparent;
  background: transparent;
  font-size: 12.5px;
  font-weight: 700;
}

body[data-view="estimate"] .rental-actions {
  gap: 4px;
}

body[data-view="estimate"] .rental-actions .button {
  min-height: 24px;
  padding: 2px 8px;
  font-size: 11px;
}

body[data-view="estimate"] .rental-actions .button.primary {
  color: #fff;
  background: var(--cg-teal-900);
}

.desk-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  background: var(--cg-panel);
}

.desk-total-card,
.desk-check-card,
.desk-project-total {
  border-radius: 14px;
  padding: 14px 16px;
}

.desk-total-card {
  color: #cfe5de;
  background: var(--cg-teal-900);
}

.desk-card-label {
  margin-bottom: 8px;
  color: #9BD3E2;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.desk-total-line,
.desk-pay-row,
.desk-project-total > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.desk-total-line {
  padding: 3px 0;
  font-size: 12px;
}

.desk-total-line span,
.desk-pay-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desk-total-line b,
.desk-pay-row strong,
.desk-project-total strong {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: #fff;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
  white-space: nowrap;
}

.desk-total-line s,
.desk-project-total s {
  color: #6E99A7;
  font-style: normal;
  font-weight: 500;
}

.desk-total-line em {
  font-style: normal;
}

.desk-total-divider {
  height: 1px;
  margin: 8px 0;
  background: rgba(255, 255, 255, 0.15);
}

.desk-pay-row strong {
  font-size: 19px;
}

.desk-discount-pill {
  display: inline-flex;
  margin-top: 6px;
  border-radius: 999px;
  padding: 3px 9px;
  color: var(--cg-yellow);
  background: rgba(252, 238, 141, 0.15);
  font-size: 11px;
  font-weight: 600;
}

.mobile-total-jump-button {
  display: none;
}

.desk-check-card {
  border: 1px solid var(--cg-yellow-line);
  color: #6b5a10;
  background: var(--cg-yellow-panel);
}

.desk-check-card .desk-card-label {
  color: var(--cg-yellow-ink);
}

.desk-check-card p {
  margin: 0;
  padding: 3px 0;
  font-size: 12px;
}

.desk-check-card.is-ok {
  border-color: var(--cg-line);
  color: var(--cg-ink-4);
  background: var(--cg-surface);
}

.desk-project-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  color: #fff;
  background: var(--cg-teal-900);
}

.desk-project-total > div {
  display: grid;
  gap: 3px;
}

.desk-project-total span {
  color: #9BD3E2;
  font-size: 10.5px;
}

.desk-project-total strong {
  font-size: 16px;
}

.desk-project-total .project-total-button {
  border: 0;
  color: var(--cg-teal-900);
  background: var(--cg-yellow);
  font-weight: 700;
}

.desk-project-area {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-top: 1px solid var(--cg-line);
  background: var(--cg-bg);
}

.project-fields-panel {
  border-color: var(--cg-line);
  border-radius: 10px;
  box-shadow: none;
}

.project-fields-panel .panel-header {
  min-height: 42px;
  padding: 10px 14px;
}

.project-fields-panel .panel-body {
  padding: 14px;
}

.project-fields-panel .estimate-form {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.project-fields-panel .field,
.project-fields-panel .field.is-wide {
  min-width: 0;
}

.project-fields-panel .client-request-details {
  border-top-color: var(--cg-line);
}

.project-fields-panel .client-request-details summary {
  border-color: var(--cg-line-2);
  color: var(--cg-ink);
  background: var(--cg-panel);
}

.project-fields-panel .client-request-details summary strong,
.project-fields-panel .client-request-details summary::before {
  color: var(--cg-mute);
}

body[data-view="estimate"] .total-panel,
body[data-view="estimate"] .all-shifts-total-panel {
  border-radius: 10px;
  box-shadow: none;
}

body[data-view="estimate"] .total-panel .panel-header,
body[data-view="estimate"] .all-shifts-total-panel .panel-header {
  min-height: 42px;
  padding: 10px 14px;
  background: var(--cg-surface);
}

body[data-view="estimate"] .total-table th,
body[data-view="estimate"] .total-table td {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 12px;
}

body[data-view="estimate"] .total-table .money,
body[data-view="estimate"] .total-table .number-cell,
body[data-view="estimate"] .total-table .row-input.number,
body[data-view="estimate"] .summary-static-number {
  font-family: "IBM Plex Mono", monospace;
  text-align: right;
}

body[data-view="estimate"] .modal-panel {
  border-color: var(--cg-line);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(9, 28, 37, 0.2);
}

body[data-view="estimate"] .modal-head h2 {
  font-family: "Schibsted Grotesk", "IBM Plex Sans", system-ui, sans-serif;
  font-size: 18px;
  font-weight: 700;
}

body[data-view="estimate"] .estimate-readiness-warning {
  margin: 12px 14px;
  border-color: var(--cg-yellow-line);
  color: var(--cg-yellow-ink);
  background: var(--cg-yellow-panel);
  box-shadow: none;
}

body[data-view="estimate"] .estimate-readiness-warning span {
  color: #6b5a10;
}

.project-total-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  flex: 1;
  gap: 14px;
  align-items: stretch;
  align-content: stretch;
  min-height: 0;
  padding: 14px;
  overflow: hidden;
  background: var(--cg-bg);
}

.project-total-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.project-total-sidebar {
  display: grid;
  align-self: start;
  gap: 14px;
  min-width: 0;
}

.project-total-sidebar {
  position: sticky;
  top: 14px;
}

.project-header-card {
  display: grid;
  gap: 14px;
  border-radius: 10px;
  padding: 16px;
  color: #fff;
  background: var(--cg-teal-900);
}

.project-header-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.project-header-card-head > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.project-header-card-head span {
  color: #9BD3E2;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.project-header-card-head strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.12;
}

.project-header-card-head .button {
  border-color: rgba(255, 255, 255, 0.34);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.project-header-card-list {
  display: grid;
  gap: 9px;
  margin: 0;
}

.project-header-card-list div {
  display: grid;
  gap: 3px;
  min-width: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 9px;
}

.project-header-card-list dt {
  color: #9BD3E2;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.project-header-card-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: #fff;
  font-size: 13px;
  font-weight: 650;
}

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

.project-total-sidebar .cleanup-preview-panel {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.cleanup-preview-panel.is-active {
  border-color: var(--cg-teal-200);
  background: var(--cg-panel);
}

.cleanup-preview-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.cleanup-preview-copy span {
  color: var(--cg-mute);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.cleanup-preview-copy small {
  color: var(--cg-mute);
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.25;
}

.cleanup-preview-copy strong {
  color: var(--cg-text);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
}

.cleanup-preview-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.project-total-sidebar .cleanup-preview-controls {
  display: grid;
  grid-template-columns: 1fr;
  justify-content: stretch;
}

.project-total-sidebar .cleanup-preview-toggle {
  justify-content: flex-start;
  width: 100%;
}

.project-workflow-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--cg-line);
  border-radius: 10px;
  padding: 14px;
  background: #fff;
}

.project-workflow-card.is-action {
  border-color: var(--cg-yellow-line);
  background: #fffdf4;
}

.project-workflow-card.is-approved {
  border-color: var(--cg-teal-200);
  background: #f5fbf9;
}

.project-workflow-head,
.project-workflow-next {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.project-workflow-head > div,
.project-workflow-next > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.project-workflow-head span,
.project-workflow-next span {
  color: var(--cg-mute);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-workflow-head h2,
.project-workflow-next strong {
  margin: 0;
  color: var(--cg-ink);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.project-workflow-next strong {
  font-size: 17px;
}

.project-workflow-head p,
.project-workflow-next p {
  margin: 0;
  max-width: 760px;
  color: var(--cg-mute);
  font-size: 13px;
  line-height: 1.42;
}

.project-workflow-steps {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
}

.project-workflow-step {
  display: grid;
  gap: 5px;
  align-content: start;
  min-width: 0;
  min-height: 58px;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  padding: 8px;
  color: var(--cg-mute);
  background: var(--cg-panel);
  text-align: left;
  font: inherit;
}

.project-workflow-step:hover,
.project-workflow-step:focus-visible {
  border-color: var(--cg-teal-700);
  outline: none;
}

.project-workflow-step span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: #fff;
  background: #a9b9ba;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 800;
}

.project-workflow-step strong {
  min-width: 0;
  color: inherit;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.16;
  overflow-wrap: anywhere;
}

.project-workflow-step.is-done {
  color: var(--cg-teal-900);
  background: #f1f7f5;
}

.project-workflow-step.is-done span {
  background: var(--cg-teal-700);
}

.project-workflow-step.is-current {
  border-color: var(--cg-teal-900);
  color: var(--cg-teal-900);
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--cg-teal-900);
}

.project-workflow-step.is-current span {
  background: var(--cg-teal-900);
}

.project-workflow-next {
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  padding: 12px;
  background: var(--cg-panel);
}

.project-workflow-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 440px;
}

.project-workflow-actions .button {
  min-height: 40px;
}

.project-workflow-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-workflow-notes span {
  border: 1px solid var(--cg-line);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--cg-mute);
  background: #fff;
  font-size: 11.5px;
  font-weight: 650;
}

.cleanup-preview-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid var(--cg-line-2);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--cg-teal-900);
  background: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.cleanup-preview-toggle:hover,
.cleanup-preview-toggle:focus-visible {
  border-color: var(--cg-teal-700);
  outline: none;
}

.cleanup-preview-toggle.is-active {
  border-color: var(--cg-teal-900);
  color: #fff;
  background: var(--cg-teal-900);
}

.cleanup-preview-toggle-mark {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.cleanup-preview-toggle.is-active .cleanup-preview-toggle-mark {
  background: transparent;
}

.cleanup-preview-toggle.is-active .cleanup-preview-toggle-mark::after {
  content: "×";
  position: absolute;
  top: 50%;
  left: 50%;
  color: currentColor;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  transform: translate(-50%, -56%);
}

.project-shifts-panel {
  display: flex;
  flex: 1 1 220px;
  flex-direction: column;
  min-height: 136px;
  border-color: var(--cg-line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: none;
}

.project-shifts-panel .panel-header {
  min-height: 42px;
  padding: 10px 14px;
}

.project-shifts-panel .panel-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0;
}

.project-summary-shifts {
  display: grid;
  align-content: start;
}

.project-shift-card {
  display: grid;
  grid-template-columns: minmax(96px, auto) minmax(0, 1fr);
  gap: 8px 16px;
  align-items: center;
  width: 100%;
  min-height: 72px;
  border: 0;
  border-bottom: 1px solid var(--cg-line);
  padding: 12px 14px;
  color: var(--cg-ink);
  background: var(--cg-surface);
  text-align: left;
}

.project-shift-card:hover,
.project-shift-card.is-current {
  background: var(--cg-panel);
}

.project-shift-card.is-export-disabled {
  color: var(--cg-mute);
  background: #f7f9f8;
}

.project-shift-open {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, auto);
  gap: 8px 16px;
  align-items: center;
  width: 100%;
  min-width: 0;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  font: inherit;
}

.project-shift-open:focus-visible,
.project-shift-export-mark:focus-visible {
  border-radius: 6px;
  outline: 2px solid var(--cg-teal-900);
  outline-offset: 2px;
}

.project-shift-card.is-export-disabled .project-shift-open {
  opacity: 0.76;
}

.project-shift-card.is-export-disabled .project-shift-money b {
  color: var(--cg-mute);
}

.project-shift-card.is-export-disabled .project-shift-money s,
.project-shift-card.is-export-disabled .project-shift-money small {
  opacity: 0.62;
}

.project-shift-card.is-export-disabled .project-shift-checks em {
  color: var(--cg-mute);
  background: #eef2f1;
}

.project-shift-card.is-export-disabled .project-shift-checks em:first-child {
  color: var(--cg-mute);
  background: #eef2f1;
}

.project-shift-card.is-current {
  outline: none;
}

.project-shift-export-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border: 1px solid var(--cg-line-2);
  border-radius: 6px;
  padding: 0 9px;
  color: var(--cg-teal-900);
  background: #fff;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.project-shift-export-mark:not(.is-active) {
  color: var(--cg-mute);
  background: var(--cg-panel);
}

.project-shift-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.project-shift-main small {
  color: var(--cg-mute);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
}

.project-shift-main strong {
  overflow-wrap: anywhere;
  font-size: 16px;
  font-weight: 650;
}

.project-shift-money {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-end;
  gap: 8px;
  color: var(--cg-teal-900);
  font-family: "IBM Plex Mono", monospace;
  white-space: nowrap;
}

.project-shift-money s {
  color: var(--cg-mute-2);
  font-size: 12px;
}

.project-shift-money b {
  font-size: 16px;
  font-weight: 700;
}

.project-shift-money small {
  color: var(--cg-yellow-ink);
  font-size: 11px;
  font-weight: 700;
}

.project-shift-checks {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.project-shift-checks em {
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--cg-yellow-ink);
  background: var(--cg-yellow-panel);
  font-style: normal;
  font-size: 11px;
  font-weight: 650;
}

.project-shift-card.is-current .project-shift-checks em:first-child {
  color: var(--cg-teal-900);
  background: var(--cg-teal-100);
}

.project-shift-card.is-export-disabled.is-current .project-shift-checks em:first-child {
  color: var(--cg-mute);
  background: #eef2f1;
}

.admin-project-summary-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--cg-line);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.admin-project-summary-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.admin-project-summary-head span {
  color: var(--cg-ink);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-project-summary-head small {
  color: var(--cg-mute);
  font-size: 11px;
  font-weight: 500;
}

.admin-project-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.admin-project-summary-item {
  display: grid;
  gap: 3px;
  min-height: 56px;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  padding: 7px 9px;
  background: var(--cg-panel);
}

.admin-project-summary-item span {
  color: var(--cg-mute);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.admin-project-summary-item strong {
  color: var(--cg-teal-900);
  font-family: "IBM Plex Mono", monospace;
  font-size: 18px;
  font-weight: 700;
}

.admin-project-summary-item small {
  color: var(--cg-mute);
  font-size: 11px;
  font-weight: 500;
}

.project-summary-total-card {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 86px;
  border-radius: 10px;
  padding: 14px 20px;
  color: #fff;
  background: var(--cg-teal-900);
}

.project-summary-total-card .project-summary-actions {
  align-items: stretch;
}

.project-total-view.is-cleanup-active .project-summary-total-card {
  background: #0b4050;
}

.project-summary-total-card > div {
  display: grid;
  gap: 5px;
}

.project-summary-total-card span,
.project-summary-total-card small {
  color: #9BD3E2;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.project-summary-total-card strong {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 26px;
  font-weight: 700;
}

.project-summary-total-card s {
  color: #6E99A7;
  font-size: 16px;
  font-weight: 500;
}

.project-summary-total-card .button.primary {
  min-width: 168px;
  min-height: 52px;
  border-color: #fff;
  border-radius: 10px;
  padding: 0 28px;
  color: var(--cg-teal-900);
  background: #fff;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
}

@media (max-width: 1180px) {
  body[data-view="estimate"] .workspace {
    width: 100%;
  }

  .desk-content {
    grid-template-columns: 1fr;
  }

  .desk-list {
    border-right: 0;
  }

  .desk-sidebar {
    border-top: 1px solid var(--cg-line);
  }

  .desk-topbar {
    flex-wrap: wrap;
    min-height: 0;
    padding: 10px 14px;
  }

  .desk-toolbar {
    flex-wrap: wrap;
  }

  .project-fields-panel .estimate-form {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .project-fields-panel .field,
  .project-fields-panel .field.is-wide {
    grid-column: auto;
    min-width: 0;
  }
}

@media (min-width: 761px) and (max-width: 1366px) {
  body[data-view="estimate"] .workspace {
    width: 100%;
  }

  .desk-rail,
  .desk-sidebar {
    display: none;
  }

  .desk-shell,
  .desk-content,
  .desk-list,
  .desk-project-area {
    min-width: 0;
    max-width: 100%;
    width: 100%;
  }

  .desk-content {
    grid-template-columns: minmax(0, 1fr);
  }

  .desk-list {
    border-right: 0;
  }

  body[data-view="estimate"] .desk-compact-total {
    display: inline-flex;
  }
}

@media (min-width: 1181px) {
  body[data-view="database"] .desk-rail {
    display: flex;
  }
}

@media (max-width: 1180px) {
  body[data-view="estimate"] {
    background: var(--cg-panel-2);
  }

  body[data-view="estimate"] .workspace {
    padding: 0 0 92px;
  }

  .estimate-desk {
    display: block;
    min-height: 100vh;
    overflow: visible;
    background: var(--cg-panel-2);
  }

  .desk-rail {
    display: none;
  }

  .desk-shell {
    display: block;
    background: var(--cg-panel-2);
  }

  .database-desk,
  .database-shell {
    display: block;
    min-height: 0;
    overflow: visible;
  }

  .database-topbar {
    display: none;
  }

  body[data-view="database"] .database-flow {
    padding: 0;
    overflow: visible;
  }

  .desk-topbar {
    position: sticky;
    top: 0;
    z-index: 18;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 54px;
    padding: 9px 16px 10px;
    background: var(--cg-surface);
  }

  .desk-project-title {
    display: grid;
    gap: 1px;
  }

  .desk-project-title span {
    display: none;
  }

  .desk-project-title strong {
    font-size: 15px;
  }

  .desk-project-meta {
    padding: 0;
    background: transparent;
    font-size: 11px;
  }

  .desk-toolbar {
    display: grid;
    grid-template-columns: repeat(3, 40px);
    gap: 6px;
  }

  .desk-toolbar .button {
    min-width: 40px;
    width: 40px;
    min-height: 34px;
    padding: 0;
    font-size: 11px;
  }

  .desk-toolbar .button:first-child,
  .desk-toolbar .button.danger {
    display: none;
  }

  .desk-toolbar .button.primary {
    width: auto;
    min-width: 74px;
    padding: 0 10px;
  }

  .desk-shift-strip .shift-body {
    display: grid;
    grid-template-columns: 1fr;
    padding: 10px 16px;
    background: var(--cg-surface);
  }

  .desk-shift-strip .shift-tabs {
    overflow-x: auto;
  }

  .desk-shift-strip .shift-tab {
    flex: 0 0 auto;
    min-height: 45px;
    padding: 7px 11px;
  }

  .desk-shift-strip .shift-tab span {
    max-width: 116px;
    font-size: 11.5px;
  }

  .desk-shift-strip .shift-tab small {
    font-size: 10.5px;
  }

  .shift-add-tab {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
  }

  .shift-total-tab {
    min-height: 44px;
    margin-left: 0;
    flex: 0 0 auto;
  }

  .shift-context {
    display: none;
  }

  .shift-context .button {
    display: none;
  }

  .desk-shift-strip .active-shift-fields {
    grid-template-columns: 1fr;
  }

  .desk-shift-strip .active-shift-fields .field:nth-child(2),
  .desk-shift-strip .active-shift-fields .field:nth-child(3),
  .desk-shift-strip .shift-mini-fields {
    grid-column: auto;
  }

  .desk-shift-strip .shift-mini-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-self: stretch;
  }

  .estimate-add-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 10px 16px;
    background: var(--cg-panel);
  }

  .estimate-add-row .button:nth-of-type(1),
  .estimate-add-row .button:nth-of-type(2) {
    display: none;
  }

  .estimate-add-search {
    height: 40px;
    font-size: 12.5px;
  }

  .estimate-catalog-popover {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    max-height: 72vh;
    border-radius: 18px 18px 0 0;
    padding: 12px 16px max(16px, env(safe-area-inset-bottom));
  }

  .modal-backdrop:has(.catalog-picker-modal) {
    align-items: end;
    padding: 0;
  }

  .catalog-picker-modal {
    width: 100%;
    max-height: 72vh;
    border-radius: 18px 18px 0 0;
    padding: 16px;
  }

  .catalog-picker-body {
    min-height: 0;
  }

  .catalog-modal-list {
    max-height: calc(72vh - 178px);
  }

  .estimate-catalog-popover-head {
    grid-template-columns: minmax(0, 1fr) auto 44px;
  }

  .catalog-close-button {
    width: 44px;
    min-width: 44px;
    height: 44px;
  }

  .rental-section-head,
  .external-section-bar {
    min-height: 36px;
    padding: 0 16px;
  }

  .external-section-toggle {
    flex: 1 1 auto;
    gap: 6px;
  }

  .cinegear-title,
  .external-section-bar .panel-title {
    font-size: 10.5px;
  }

  .external-section-note {
    display: none;
  }

  .external-section-summary {
    min-width: 0;
    overflow: hidden;
    padding: 3px 7px;
    font-size: 10px;
    text-overflow: ellipsis;
  }

  .external-section-bar .button {
    min-height: 28px;
    padding: 0 10px;
    font-size: 10.5px;
  }

  .external-rental-stack {
    padding: 12px 16px 16px;
  }

  body[data-view="estimate"] .line-table tbody {
    display: block;
    gap: 0;
  }

  body[data-view="estimate"] .line-table tr[data-line-row],
  body[data-view="estimate"] .line-table tr[data-list-id="top"] {
    display: block !important;
    width: 100%;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    border-bottom: 1px solid var(--cg-line-3);
    background: var(--cg-surface);
  }

  body[data-view="estimate"] .line-table tr[data-line-row] > td:not(.mobile-line-card-cell) {
    display: none !important;
  }

  body[data-view="estimate"] .line-table tr[data-line-row] > .mobile-line-card-cell {
    display: block !important;
    width: 100%;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0;
  }

  body[data-view="estimate"] .mobile-line-card {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 8px 10px;
    margin: 0;
    padding: 9px 16px;
    border: 0;
    border-radius: 0;
    background: var(--cg-surface);
    box-shadow: none;
  }

  body[data-view="estimate"] .mobile-line-thumb {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 7px;
    background: var(--cg-line-3);
    font-size: 8px;
  }

  body[data-view="estimate"] .mobile-line-title {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
  }

  body[data-view="estimate"] .mobile-line-metrics {
    grid-column: 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 0;
    border: 0;
  }

  body[data-view="estimate"] .mobile-line-metric {
    display: grid;
    gap: 3px;
    align-items: center;
    min-width: 0;
    min-height: 44px;
    width: 100%;
    border: 1px solid var(--cg-line-2);
    border-radius: 7px;
    padding: 6px 8px;
    color: var(--cg-ink-4);
    background: var(--cg-panel);
    font-family: "IBM Plex Mono", monospace;
    text-align: left;
  }

  body[data-view="estimate"] .mobile-line-metric small {
    display: block;
    color: var(--cg-mute);
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
  }

  body[data-view="estimate"] .mobile-line-metric span {
    font-size: 11px;
    font-weight: 500;
  }

  body[data-view="estimate"] .mobile-line-metric.is-total span,
  body[data-view="estimate"] .mobile-line-metric.is-wide span {
    color: var(--cg-teal-900);
    font-size: 13px;
    font-weight: 700;
  }

  body[data-view="estimate"] .mobile-line-metric.is-wide {
    grid-column: 1 / -1;
  }

  body[data-view="estimate"] .mobile-line-actions {
    display: none;
  }

  body[data-view="estimate"] .line-table .section-title-row td {
    padding: 7px 16px 4px;
  }

  body[data-view="estimate"] .rental-head {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 10px 12px;
  }

  body[data-view="estimate"] .rental-actions {
    grid-column: 1 / -1;
    display: flex;
    max-width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  body[data-view="estimate"] .rental-head-collapsed {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 10px;
  }

  body[data-view="estimate"] .rental-collapsed-title {
    gap: 8px;
  }

  body[data-view="estimate"] .rental-collapsed-title strong {
    font-size: 13px;
  }

  body[data-view="estimate"] .rental-head-total {
    padding: 3px 7px;
    font-size: 11px;
  }

  body[data-view="estimate"] .rental-collapsed-meta {
    grid-column: 1 / -1;
  }

  body[data-view="estimate"] .rental-actions .button {
    flex: 0 0 auto;
  }

  .desk-sidebar {
    display: block;
    padding: 0;
    background: transparent;
  }

  .desk-total-card {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 24;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 76px;
    border-radius: 0;
    padding: 12px 16px 20px;
    box-shadow: 0 -12px 40px rgba(9, 28, 37, 0.25);
  }

  .desk-total-card .desk-card-label,
  .desk-total-card .desk-total-line,
  .desk-total-card .desk-total-divider {
    display: none;
  }

  .desk-pay-row {
    display: grid;
    flex: 1;
    gap: 2px;
  }

  .desk-pay-row span {
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
  }

  .desk-pay-row strong {
    font-size: 19px;
  }

  .desk-discount-pill {
    margin: 0;
    align-self: center;
  }

  .desk-check-card,
  .desk-project-total {
    display: none;
  }

  .desk-project-area {
    padding: 12px 16px 24px;
  }

  .project-fields-panel .estimate-form {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .project-total-view {
    grid-template-columns: 1fr;
    padding: 12px 16px 24px;
    overflow: visible;
  }

  .project-total-main {
    height: auto;
    overflow: visible;
  }

  .project-total-sidebar {
    position: static;
    order: 1;
  }

  .project-workflow-head,
  .project-workflow-next {
    grid-template-columns: 1fr;
  }

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

  .project-workflow-actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
    max-width: none;
  }

  .project-workflow-actions .button {
    width: 100%;
    min-height: 44px;
  }

  .cleanup-preview-panel {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }

  .cleanup-preview-controls {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .cleanup-preview-toggle {
    justify-content: flex-start;
    width: 100%;
    min-height: 44px;
  }

  .export-setting-toggle {
    min-height: 44px;
  }

  .project-shift-card {
    grid-template-columns: 1fr;
    gap: 8px;
    min-height: 0;
    padding: 12px;
  }

  .project-shift-open {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .project-shift-export-mark {
    justify-self: start;
    min-height: 32px;
  }

  .project-shift-money {
    justify-content: flex-start;
  }

  .project-shift-checks {
    grid-column: auto;
  }

  .project-shifts-panel {
    flex: none;
    min-height: 0;
    overflow: visible;
  }

  .project-shifts-panel .panel-body {
    overflow: visible;
  }

  .project-summary-total-card {
    display: grid;
    gap: 14px;
    margin-top: 28px;
    min-height: 0;
    padding: 16px;
  }

  .project-summary-total-card .button.primary {
    width: 100%;
    min-height: 56px;
  }

  .project-summary-total-card strong {
    font-size: 22px;
  }
}

@media (max-width: 1180px) {
  body[data-view="estimate"],
  body[data-view="estimate"] .app-shell,
  body[data-view="estimate"] .workspace,
  body[data-view="estimate"] .estimate-desk,
  body[data-view="estimate"] .desk-shell,
  body[data-view="estimate"] .desk-content,
  body[data-view="estimate"] .desk-list,
  body[data-view="estimate"] .desk-sidebar,
  body[data-view="estimate"] .line-table-wrap,
  body[data-view="estimate"] .line-table,
  body[data-view="estimate"] .data-table {
    width: 100%;
    min-width: 0 !important;
    max-width: 100%;
  }

  body[data-view="estimate"] .desk-content,
  body[data-view="estimate"] .desk-list,
  body[data-view="estimate"] .desk-project-area,
  body[data-view="estimate"] .project-total-view {
    overflow: visible;
  }

  body[data-view="estimate"] .data-table {
    table-layout: auto;
  }

  body[data-view="estimate"] .desk-topbar {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 7px;
    overflow: visible;
  }

  body[data-view="estimate"] .desk-project-title,
  body[data-view="estimate"] .desk-project-title strong,
  body[data-view="estimate"] .desk-project-meta {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-view="estimate"] .desk-toolbar {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    min-width: 0;
    width: 100%;
    overflow: visible;
  }

  body[data-view="estimate"] .desk-toolbar .history-button,
  body[data-view="estimate"] .desk-toolbar .session-button,
  body[data-view="estimate"] .desk-toolbar > .button.danger {
    display: none;
  }

  body[data-view="estimate"] .desk-toolbar .button {
    width: auto;
    min-width: 0;
    min-height: 40px;
    padding: 0 10px;
    white-space: nowrap;
  }

  body[data-view="estimate"] .desk-toolbar > .button:not(.primary) {
    border-color: var(--cg-line-2);
    color: var(--cg-ink-3);
    background: var(--cg-surface);
  }

  body[data-view="estimate"] .desk-toolbar > .button.primary {
    min-width: 76px;
  }

  body[data-view="estimate"] .desk-compact-total {
    display: flex;
    justify-content: space-between;
    width: 100%;
    min-height: 34px;
    padding: 6px 10px;
    white-space: normal;
  }

  body[data-view="estimate"] .desk-compact-total strong {
    margin-left: auto;
  }

  body[data-view="estimate"] .mobile-actions-menu {
    position: relative;
    display: block;
    flex: 0 0 auto;
  }

  body[data-view="estimate"] .mobile-actions-menu summary {
    display: grid;
    place-items: center;
    width: 44px;
    min-width: 44px;
    min-height: 40px;
    border: 1px solid var(--cg-line-2);
    border-radius: 9px;
    color: var(--cg-ink-3);
    background: var(--cg-surface);
    font-family: "IBM Plex Mono", monospace;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
  }

  body[data-view="estimate"] .mobile-actions-menu[open] summary {
    color: #fff;
    border-color: #13394A;
    background: #13394A;
  }

  body[data-view="estimate"] .mobile-actions-menu-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 40;
    display: grid;
    gap: 6px;
    width: min(260px, calc(100vw - 32px));
    padding: 8px;
    border: 1px solid var(--cg-line);
    border-radius: 12px;
    background: var(--cg-surface);
    box-shadow: 0 20px 54px rgba(9, 28, 37, 0.22);
  }

  body[data-view="estimate"] .mobile-actions-menu-panel .button,
  body[data-view="estimate"] .mobile-actions-menu-panel .button.danger {
    display: inline-flex;
    justify-content: flex-start;
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    font-size: 13px;
  }

  body[data-view="estimate"] .mobile-actions-menu-panel .button.danger {
    color: #B04A3A;
    border-color: #F0C7BD;
    background: #FFF7F4;
  }

  body[data-view="estimate"] .mobile-actions-menu-panel .button:disabled {
    opacity: 0.45;
  }

  body[data-view="estimate"] .desk-shift-strip .shift-tabs,
  body[data-view="estimate"] .category-chips {
    display: flex;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  body[data-view="estimate"] .desk-shift-strip .shift-tabs {
    gap: 8px;
    padding-bottom: 4px;
    scroll-padding-inline: 16px;
  }

  body[data-view="estimate"] .desk-shift-strip .shift-tab {
    min-width: 148px;
    max-width: 172px;
  }

  body[data-view="estimate"] .desk-shift-strip .shift-tab,
  body[data-view="estimate"] .shift-add-tab,
  body[data-view="estimate"] .shift-total-tab,
  body[data-view="estimate"] .category-chips .chip {
    flex: 0 0 auto;
    scroll-snap-align: start;
    white-space: nowrap;
  }

  body[data-view="estimate"] .shift-total-tab {
    position: static;
    right: auto;
    z-index: auto;
    min-width: 108px;
    margin-left: 0;
    background: var(--cg-yellow-panel);
    box-shadow: none;
  }

  body[data-view="estimate"] .category-chips .chip {
    min-height: 40px;
    padding-inline: 13px;
  }

  body[data-view="estimate"] .active-shift-fields .input,
  body[data-view="estimate"] .estimate-add-search,
  body[data-view="estimate"] .estimate-add-row .button,
  body[data-view="estimate"] .date-picker-button {
    min-height: 44px;
  }

  body[data-view="estimate"] .date-text-field .input {
    padding-right: 48px;
  }

  body[data-view="estimate"] .date-picker-button {
    right: 0;
    width: 44px;
    height: 44px;
    color: #324348;
  }

  body[data-view="estimate"] .estimate-readiness-warning {
    margin: 10px 16px;
    padding: 13px 14px;
  }

  body[data-view="estimate"] .estimate-readiness-warning strong,
  body[data-view="estimate"] .estimate-readiness-warning span {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  body[data-view="estimate"] .cinegear-title,
  body[data-view="estimate"] .external-section-bar .panel-title {
    color: #13394A;
  }

  body[data-view="estimate"] .catalog-picker-modal,
  body[data-view="estimate"] .estimate-catalog-popover {
    max-height: 72vh;
    border-radius: 22px 22px 0 0;
  }

  body[data-view="estimate"] .catalog-picker-modal {
    padding: 10px 16px max(18px, env(safe-area-inset-bottom));
  }

  body[data-view="estimate"] .catalog-picker-modal::before,
  body[data-view="estimate"] .estimate-catalog-popover::before {
    content: "";
    display: block;
    width: 38px;
    height: 4px;
    margin: 0 auto 12px;
    border-radius: 999px;
    background: var(--cg-line-2);
  }

  body[data-view="estimate"] .catalog-picker-modal .modal-head {
    align-items: center;
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  body[data-view="estimate"] .catalog-picker-modal .modal-copy {
    margin-top: 2px;
    font-size: 13px;
  }

  body[data-view="estimate"] .catalog-picker-body {
    gap: 11px;
  }

  body[data-view="estimate"] .catalog-picker-body > .input,
  body[data-view="estimate"] .estimate-catalog-popover .input {
    min-height: 44px;
    font-size: 16px;
  }

  body[data-view="estimate"] .catalog-popover-list,
  body[data-view="estimate"] .catalog-modal-list {
    display: grid;
    gap: 0;
    max-height: calc(72vh - 194px);
    padding-right: 0;
    overflow: auto;
  }

  body[data-view="estimate"] .catalog-picker-modal .product-card,
  body[data-view="estimate"] .estimate-catalog-popover .product-card {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 11px;
    min-height: 56px;
    padding: 8px 0;
    border: 0;
    border-bottom: 1px solid var(--cg-line-3);
    border-radius: 0;
    background: var(--cg-surface);
  }

  body[data-view="estimate"] .catalog-picker-modal .product-card.is-keyboard-active,
  body[data-view="estimate"] .estimate-catalog-popover .product-card.is-keyboard-active {
    border-left: 2px solid #13394A;
    padding-left: 8px;
    background: #F7FAFB;
    box-shadow: none;
  }

  body[data-view="estimate"] .catalog-picker-modal .product-image,
  body[data-view="estimate"] .estimate-catalog-popover .product-image {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  body[data-view="estimate"] .catalog-picker-modal .product-card > div:nth-child(2),
  body[data-view="estimate"] .estimate-catalog-popover .product-card > div:nth-child(2) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 2px 10px;
    align-items: center;
    min-width: 0;
  }

  body[data-view="estimate"] .catalog-picker-modal .product-name,
  body[data-view="estimate"] .estimate-catalog-popover .product-name {
    display: contents;
  }

  body[data-view="estimate"] .catalog-picker-modal .product-name > span:first-child,
  body[data-view="estimate"] .estimate-catalog-popover .product-name > span:first-child {
    grid-column: 1;
    grid-row: 1;
    display: -webkit-box;
    min-width: 0;
    overflow: hidden;
    color: #132628;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.18;
    white-space: normal;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  body[data-view="estimate"] .catalog-picker-modal .price-pill,
  body[data-view="estimate"] .estimate-catalog-popover .price-pill,
  body[data-view="estimate"] .catalog-picker-modal .status-pill,
  body[data-view="estimate"] .estimate-catalog-popover .status-pill,
  body[data-view="estimate"] .catalog-picker-modal .product-note,
  body[data-view="estimate"] .estimate-catalog-popover .product-note {
    display: none;
  }

  body[data-view="estimate"] .catalog-picker-modal .product-mobile-meta,
  body[data-view="estimate"] .estimate-catalog-popover .product-mobile-meta {
    display: block;
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    overflow: hidden;
    color: #7B8A8F;
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-view="estimate"] .catalog-picker-modal .product-footer,
  body[data-view="estimate"] .estimate-catalog-popover .product-footer {
    display: contents;
  }

  body[data-view="estimate"] .catalog-picker-modal .product-add-button,
  body[data-view="estimate"] .estimate-catalog-popover .product-add-button {
    grid-column: 2;
    grid-row: 1 / 3;
    justify-self: end;
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 11px;
    font-size: 0;
  }

  body[data-view="estimate"] .catalog-picker-modal .product-add-button::after,
  body[data-view="estimate"] .estimate-catalog-popover .product-add-button::after {
    content: "+";
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
  }

  body[data-view="estimate"] .catalog-picker-modal .catalog-stepper,
  body[data-view="estimate"] .estimate-catalog-popover .catalog-stepper {
    grid-column: 2;
    grid-row: 1 / 3;
    justify-self: end;
    grid-template-columns: 44px 36px 44px;
    min-height: 44px;
    border-radius: 11px;
  }

  body[data-view="estimate"] .catalog-picker-modal .stepper-button,
  body[data-view="estimate"] .estimate-catalog-popover .stepper-button,
  body[data-view="estimate"] .catalog-picker-modal .stepper-count,
  body[data-view="estimate"] .estimate-catalog-popover .stepper-count {
    height: 44px;
  }

  body[data-view="estimate"] .catalog-picker-modal .stepper-button,
  body[data-view="estimate"] .estimate-catalog-popover .stepper-button {
    width: 44px;
  }

  body[data-view="estimate"] .line-table-wrap {
    overflow: visible;
  }

  body[data-view="estimate"] .line-table thead {
    display: none;
  }

  body[data-view="estimate"] .line-table tbody {
    display: block;
  }

  body[data-view="estimate"] .line-table tr[data-line-row],
  body[data-view="estimate"] .line-table tr[data-list-id="top"] {
    display: block !important;
    width: 100%;
    min-width: 0;
    padding: 0 !important;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  body[data-view="estimate"] .line-table tr[data-line-row] > td:not(.mobile-line-card-cell),
  body[data-view="estimate"] .line-table tr[data-list-id="top"] > td:not(.mobile-line-card-cell) {
    display: none !important;
  }

  body[data-view="estimate"] .line-table tr[data-line-row] > .mobile-line-card-cell,
  body[data-view="estimate"] .line-table tr[data-list-id="top"] > .mobile-line-card-cell {
    display: block !important;
    width: 100%;
    min-width: 0;
    padding: 0 !important;
    border: 0;
  }

  body[data-view="estimate"] .mobile-line-card {
    display: grid;
    grid-template-columns: 18px 56px minmax(0, 1fr) auto;
    align-items: center;
    gap: 3px 10px;
    min-height: 78px;
    width: 100%;
    margin: 0;
    padding: 6px 16px;
    border: 0;
    border-bottom: 1px solid #F1F4F5;
    border-radius: 0;
    background: var(--cg-surface);
    box-shadow: none;
  }

  body[data-view="estimate"] .mobile-line-card.is-disabled {
    opacity: 0.56;
  }

  body[data-view="estimate"] .mobile-line-include {
    position: relative;
    display: grid;
    grid-column: 1;
    place-items: center;
    width: 18px;
    height: 44px;
  }

  body[data-view="estimate"] .mobile-line-include input {
    position: absolute;
    inset: 0;
    opacity: 0;
  }

  body[data-view="estimate"] .mobile-line-include span {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 5px;
    color: #fff;
    background: #13394A;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
  }

  body[data-view="estimate"] .mobile-line-include input:not(:checked) + span {
    color: transparent;
    background: transparent;
    box-shadow: inset 0 0 0 2px #95A1A5;
  }

  body[data-view="estimate"] .mobile-line-thumb {
    grid-column: 2;
    grid-row: 1 / 4;
    align-self: stretch;
    width: 56px;
    height: auto;
    min-height: 66px;
    border: 0;
    border-radius: 10px;
    background: #F1F4F5;
    color: #5E6D72;
    font-size: 11px;
    font-weight: 700;
  }

  body[data-view="estimate"] .mobile-line-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  body[data-view="estimate"] .mobile-line-main {
    display: grid;
    grid-column: 3;
    grid-row: 1;
    justify-self: stretch;
    justify-items: start;
    align-content: center;
    gap: 2px;
    width: 100%;
    min-width: 0;
    min-height: 30px;
    padding: 0;
    border: 0;
    color: inherit;
    background: transparent;
    text-align: left;
  }

  body[data-view="estimate"] .mobile-line-title {
    display: -webkit-box;
    position: relative;
    justify-self: stretch;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    color: #132628;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.18;
    text-align: left;
    overflow-wrap: anywhere;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  body[data-view="estimate"] .mobile-line-card.is-manual-line .mobile-line-title {
    padding-left: 0;
  }

  body[data-view="estimate"] .mobile-line-card.is-manual-line .mobile-line-title::before {
    display: none;
  }

  body[data-view="estimate"] .mobile-line-meta {
    display: inline-flex;
    grid-column: 3;
    grid-row: 2;
    align-items: center;
    justify-self: start;
    gap: 5px;
    min-width: 0;
    color: #7B8A8F;
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    line-height: 1.2;
  }

  body[data-view="estimate"] .mobile-line-meta > span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-view="estimate"] .mobile-line-price-text,
  body[data-view="estimate"] .mobile-line-qty-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    border: 0;
    padding: 0;
    color: #7B8A8F;
    background: transparent;
    font: inherit;
    line-height: 1.2;
    text-align: left;
  }

  body[data-view="estimate"] .mobile-line-price-text {
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-view="estimate"] .mobile-line-qty-pill {
    flex: 0 0 auto;
    color: #324348;
    font-weight: 600;
  }

  body[data-view="estimate"] .mobile-line-qty-pill.is-edited {
    color: #13394A;
    font-weight: 700;
  }

  body[data-view="estimate"] .mobile-line-amount {
    display: inline-flex;
    grid-column: 4;
    grid-row: 1 / 3;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    min-width: 56px;
    min-height: 44px;
    padding: 0;
    border: 0;
    color: #101F24;
    background: transparent;
    font-family: "IBM Plex Mono", monospace;
    line-height: 1.1;
    text-align: right;
    white-space: nowrap;
  }

  body[data-view="estimate"] .mobile-line-amount-old {
    color: #95A1A5;
    font-size: 11px;
    font-weight: 500;
    text-decoration: line-through;
  }

  body[data-view="estimate"] .mobile-line-amount-current {
    color: #13394A;
    font-size: 14px;
    font-weight: 700;
  }

  body[data-view="estimate"] .mobile-line-bonus {
    margin-top: 2px;
    font-size: 10px;
  }

  body[data-view="estimate"] .mobile-line-main:focus-visible,
  body[data-view="estimate"] .mobile-line-price-text:focus-visible,
  body[data-view="estimate"] .mobile-line-qty-pill:focus-visible,
  body[data-view="estimate"] .mobile-line-amount:focus-visible,
  body[data-view="estimate"] .mobile-line-include:focus-within {
    outline: 2px solid #13394A;
    outline-offset: 2px;
    border-radius: 8px;
  }

  body[data-view="estimate"] .mobile-line-tools {
    display: flex;
    grid-column: 3 / 5;
    grid-row: 3;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
    padding-top: 3px;
  }

  body[data-view="estimate"] .mobile-line-tools .line-status-actions {
    display: contents;
  }

  body[data-view="estimate"] .mobile-line-tools .button,
  body[data-view="estimate"] .mobile-line-tools .line-mod-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 32px;
    min-height: 30px;
    padding: 0 8px;
    border-radius: 7px;
    font-size: 10.5px;
    font-weight: 800;
    line-height: 1;
    text-transform: none;
  }

  body[data-view="estimate"] .mobile-line-tools .mobile-edit-line-button {
    min-width: 30px;
    padding-inline: 0;
    font-size: 15px;
  }

  body[data-view="estimate"] .mobile-line-tools .mobile-delete-line-button {
    color: #B04A3A;
    background: #FFF7F4;
  }

  body[data-view="estimate"] .mobile-line-metrics,
  body[data-view="estimate"] .mobile-line-actions,
  body[data-view="estimate"] .mobile-line-top {
    display: none !important;
  }

  body[data-view="estimate"] .line-table .section-title-row {
    display: block;
    border: 0;
  }

  body[data-view="estimate"] .line-table .section-title-row td {
    display: block;
    height: auto;
    padding: 8px 16px 4px;
    border: 0;
    color: #7B8A8F;
    background: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
  }

  body[data-view="estimate"] .line-table .section-title-row.is-spaced-group td {
    padding-top: 18px;
    border-top: 10px solid #eef3f2;
  }

  body[data-view="estimate"] .line-table tbody > .section-title-row.is-spaced-group:first-child td {
    padding-top: 8px;
    border-top: 0;
  }

  body[data-view="estimate"] .line-table .total-row,
  body[data-view="estimate"] .line-table .total-row.is-rental-total {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    min-width: 0;
    width: 100%;
    margin: 0;
    padding: 8px 16px;
    border: 0;
    border-bottom: 1px solid var(--cg-line);
    border-radius: 0;
    background: #F7F9F9;
  }

  body[data-view="estimate"] .line-table .total-row td,
  body[data-view="estimate"] .line-table .total-row.is-rental-total td {
    display: none;
    padding: 0;
    border: 0;
    background: transparent;
  }

  body[data-view="estimate"] .line-table .total-row td:nth-child(2),
  body[data-view="estimate"] .line-table .total-row td:nth-child(3),
  body[data-view="estimate"] .line-table .total-row td:nth-child(4),
  body[data-view="estimate"] .line-table .total-row.is-rental-total td:nth-child(2),
  body[data-view="estimate"] .line-table .total-row.is-rental-total td:nth-child(3),
  body[data-view="estimate"] .line-table .total-row.is-rental-total td:nth-child(4) {
    display: block;
    min-width: 0;
  }

  body[data-view="estimate"] .line-table .discount-summary-row {
    display: block;
    padding: 0 16px 8px;
    border-bottom: 1px solid var(--cg-line);
    background: #F7F9F9;
  }

  body[data-view="estimate"] .line-table .discount-summary-row td {
    display: none;
  }

  body[data-view="estimate"] .line-table .discount-summary-row td:nth-child(3) {
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
  }

  body[data-view="estimate"] .desk-total-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 12px;
    width: 100%;
    min-width: 0 !important;
    padding: 12px 16px max(18px, env(safe-area-inset-bottom));
  }

  body[data-view="estimate"] .desk-pay-row {
    grid-column: 1;
    min-width: 0;
  }

  body[data-view="estimate"] .desk-discount-pill {
    grid-column: 1;
    justify-self: start;
    margin: 0;
  }

  body[data-view="estimate"] .mobile-total-jump-button {
    display: inline-flex;
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    align-items: center;
    justify-content: center;
    min-width: 86px;
    min-height: 44px;
    border-color: #F0E3A8;
    color: #13394A;
    background: #FCEE8D;
    font-weight: 800;
  }
}

@media print {
  @page {
    size: A4;
    margin: 0;
  }

  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body {
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: white !important;
  }

  body > :not(.print-sheet) {
    display: none !important;
  }

  .topbar,
  .workspace,
  .modal-backdrop,
  .password-screen,
  .toast {
    display: none !important;
  }

  .print-sheet {
    display: block !important;
    position: static !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 12mm !important;
    color: #1d2528;
    font-family: Inter, Arial, sans-serif;
    background: #ffffff !important;
    box-sizing: border-box;
  }

  .print-page {
    display: grid;
    gap: 14px;
    margin: 0 auto !important;
    break-before: avoid !important;
    page-break-before: avoid !important;
  }

  .print-page + .print-page {
    break-before: page !important;
    page-break-before: always !important;
  }

  .print-hero {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid #d9e0da;
    border-radius: 10px;
    background: #f7faf7;
  }

  .print-brand {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .print-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    color: #ffffff;
    background: #20282b;
    font-size: 14px;
    font-weight: 850;
  }

  .print-kicker {
    margin-bottom: 3px;
    color: #167a65;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .print-sheet h1 {
    margin: 0;
    color: #20282b;
    font-size: 22px;
    line-height: 1.08;
    letter-spacing: 0;
  }

  .print-meta-grid,
  .print-total-strip {
    display: grid;
    gap: 8px;
  }

  .print-meta-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: start;
  }

  .print-total-strip {
    grid-template-columns: repeat(auto-fit, minmax(44mm, 1fr));
  }

  .print-meta-card,
  .print-metric-card {
    min-height: 42px;
    padding: 10px;
    border: 1px solid #dce1dc;
    border-radius: 8px;
    background: #ffffff;
  }

  .print-meta-card--client {
    grid-column: span 2;
  }

  .print-meta-card--project {
    grid-column: span 3;
  }

  .print-meta-card--type {
    grid-column: span 2;
  }

  .print-meta-card--price-date {
    grid-column: span 2;
  }

  .print-meta-card--dates {
    grid-column: 1 / -1;
    min-height: 0;
    padding: 9px 10px 10px;
  }

  .print-meta-grid span,
  .print-metric-card span,
  .print-metric-card small {
    display: block;
    color: #667178;
    font-size: 9px;
    font-weight: 680;
    text-transform: uppercase;
  }

  .print-meta-grid strong,
  .print-metric-card strong {
    display: block;
    margin-top: 4px;
    color: #20282b;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.2;
  }

  .print-meta-card--type strong {
    font-size: 12px;
    font-weight: 650;
  }

  .print-meta-card--price-date strong {
    color: #4b565b;
    font-size: 11px;
    font-weight: 600;
  }

  .print-meta-card--dates strong {
    margin-top: 5px;
    font-size: 10px;
    line-height: 1.28;
    font-weight: 500;
  }

  .print-shift-date-list {
    display: grid;
    gap: 2px;
  }

  .print-shift-date-list span {
    display: block;
    color: #20282b;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.28;
    text-transform: none;
    overflow-wrap: anywhere;
  }

  .print-metric-card strong {
    color: #0f5f4d;
    font-size: 20px;
    font-weight: 820;
  }

  .print-metric-card small {
    margin-top: 3px;
    color: #667178;
    text-transform: none;
  }

  .print-shift-title {
    break-before: auto;
    break-after: avoid;
    page-break-after: avoid;
    break-inside: avoid;
    padding: 4px 0 2px;
    border: 0;
    border-radius: 0;
    color: #20282b;
    background: transparent;
    box-shadow: none;
    text-align: center;
  }

  .print-shift-title h2 {
    margin: 0;
    color: #20282b;
    font-size: 22px;
    line-height: 1.12;
    font-weight: 850;
  }

  .print-shift-title + .print-section {
    break-before: avoid;
    page-break-before: avoid;
  }

  .print-shift-details {
    display: block;
    padding-top: 12mm;
    break-before: page;
    page-break-before: always;
  }

  .print-shift-block {
    display: block;
  }

  .print-shift-block > * + * {
    margin-top: 14px;
  }

  .print-shift-block + .print-shift-block {
    margin-top: 0;
    break-before: page;
    page-break-before: always;
  }

  .print-rentals-heading {
    break-inside: avoid;
    padding: 10px 12px;
    border-radius: 10px;
    color: #ffffff;
    background: #1f9b9d;
  }

  .print-rentals-heading h2 {
    margin: 0;
    font-size: 16px;
    line-height: 1.1;
  }

  .print-section {
    break-inside: avoid-page;
    page-break-inside: avoid;
    overflow: visible;
    border: 1px solid #d9e0da;
    border-radius: 10px;
    background: #ffffff;
  }

  .print-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    color: white;
    background: #1f9b9d;
    break-after: avoid;
    page-break-after: avoid;
  }

  .print-section.is-external-rental {
    break-inside: avoid-page;
    page-break-inside: avoid;
    border-color: #c98265;
  }

  .print-section-head + .print-table {
    break-before: avoid;
    page-break-before: avoid;
  }

  .print-section.is-external-rental .print-section-head {
    background: #9c3f1e;
  }

  .print-section.is-external-rental .print-table th {
    color: #3a1b10;
    background: #f7e1d6;
  }

  .print-section.is-short-print-section {
    display: inline-block;
    width: 100%;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .print-section.is-short-print-section .print-section-head,
  .print-section.is-short-print-section .print-table,
  .print-section.is-short-print-section tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .print-shift-overview-section {
    break-inside: avoid;
  }

  .print-shift-overview-section .print-section-head {
    padding: 12px 14px;
    color: #ffffff;
    background: #126c5b;
    border-bottom: 0;
  }

  .print-shift-overview-section .print-section-head h2 {
    color: #ffffff;
    font-size: 15px;
    font-weight: 760;
  }

  .print-shift-overview-section .print-table th {
    color: #4b565b;
    background: #f3f5f2;
    font-weight: 760;
  }

  .print-section-head h2 {
    margin: 0;
    font-size: 13px;
    letter-spacing: 0;
  }

  .print-section-head span {
    color: rgba(255, 255, 255, 0.86);
    font-size: 10px;
    font-weight: 750;
  }

  .print-section-follow-note {
    display: grid;
    justify-items: center;
    gap: 5px;
    margin: 12px 0 2px;
    padding: 8px 12px 0;
    color: #20282b;
    text-align: center;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .print-section-follow-note p {
    margin: 0;
    font-size: 12px;
    font-weight: 760;
    line-height: 1.3;
  }

  .print-section-follow-note span {
    display: block;
    color: #167a65;
    font-size: 15px;
    font-weight: 850;
    line-height: 1;
    letter-spacing: 0.18em;
  }

  .print-expense-summary-section {
    margin-bottom: 14px;
    overflow: hidden;
    border: 1px solid #126c5b;
    border-radius: 8px;
    background: #ffffff;
  }

  .print-expense-summary-section .print-section-head {
    padding: 11px 12px;
    color: #ffffff;
    background: #126c5b;
    border-bottom: 0;
  }

  .print-expense-summary-section .print-section-head h2 {
    color: #ffffff;
    font-size: 14px;
    font-weight: 780;
    text-transform: none;
  }

  .print-expense-summary-section .print-summary-table {
    border-right: 0;
    border-left: 0;
  }

  .print-expense-summary-section .print-summary-table th {
    color: #20282b;
    background: #f1f4f1;
    font-weight: 760;
  }

  .print-expense-summary-section .print-table .is-group-row td {
    color: #115f51;
    background: #eef7f4;
    font-weight: 760;
  }

  .print-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
  }

  .print-table th,
  .print-table td {
    padding: 7px 8px;
    border-bottom: 1px solid #e1e6e1;
    text-align: left;
    vertical-align: top;
    font-size: 10px;
    line-height: 1.25;
  }

  .print-table th {
    color: #20282b;
    background: #f0f3ef;
    font-size: 9px;
    font-weight: 850;
    text-transform: uppercase;
  }

  .print-table tbody tr:last-child td {
    border-bottom: 0;
  }

  .print-table .is-money,
  .print-table .is-number {
    text-align: right;
    white-space: nowrap;
  }

  .print-table .is-total td {
    border-top: 2px solid #20282b;
    background: #ffdf66;
    font-weight: 850;
  }

  .print-table .is-group-row td {
    padding: 8px 10px;
    border-top: 2px solid #c8d2cd;
    border-bottom: 1px solid #cfd8d3;
    color: #115f51;
    background: #eef7f4;
    font-weight: 800;
  }

  .print-table .is-group-row td span {
    display: inline-block;
    margin-right: 8px;
  }

  .print-table .is-group-row td strong {
    color: #667178;
    font-size: 9px;
    font-weight: 750;
  }

  .print-table .is-external-group td {
    color: #7a2f16;
    background: #fff1e8;
    border-top-color: #cf8b6d;
  }

  .print-table .is-shift-separator td {
    padding: 6px 10px 5px;
    border-top: 2px solid #cf8b6d;
    border-bottom: 1px solid #efd5c7;
    color: #7a2f16;
    background: #fff8f2;
    font-size: 9px;
    font-weight: 850;
    text-transform: uppercase;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .print-table .is-shift-separator span {
    display: inline-block;
  }

  .print-table .is-group-total td {
    color: #20282b;
    background: #f8f9f6;
    font-weight: 750;
  }

  .print-table .is-external-rental-summary td:first-child {
    color: #7a2f16;
    font-weight: 850;
  }

  .print-table .is-external-rental-summary td:first-child::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 6px;
    border-radius: 999px;
    background: #9c3f1e;
    vertical-align: 1px;
  }

  .print-summary-table .is-summary-child td:first-child {
    padding-left: 24px;
  }

  .print-summary-table .is-summary-info td {
    color: #4b565b;
    background: #fbfcfa;
  }

  .print-summary-table .is-shift-summary-row td {
    padding-top: 9px;
    padding-bottom: 9px;
    border-top: 1px solid #dfe8e2;
    border-bottom: 1px solid #dfe8e2;
    color: #20282b;
    background: #ffffff;
    font-size: 10.3px;
    font-weight: 500;
  }

  .print-summary-table .is-shift-summary-row td:first-child {
    padding-left: 14px;
    color: #20282b;
    font-size: 11.2px;
    font-weight: 720;
    box-shadow: inset 3px 0 0 #20282b;
  }

  .print-summary-table .is-shift-summary-row .is-money {
    color: #20282b;
    font-weight: 720;
  }

  .print-summary-table .is-shift-summary-row td:last-child {
    color: #4b565b;
    font-weight: 500;
  }

  .print-summary-table .is-summary-note td {
    padding: 8px 10px;
    color: #4b565b;
    background: #fbfcfa;
    font-size: 9.5px;
  }

  .print-summary-table .is-summary-note span {
    display: inline-block;
    margin-right: 8px;
    color: #20282b;
    font-weight: 750;
  }

  .print-summary-table .is-summary-note strong {
    font-weight: 500;
  }

  .print-comment-list {
    margin: 0;
    padding-left: 13px;
  }

  .print-comment-list li + li {
    margin-top: 2px;
  }

  .print-crew-summary {
    display: grid;
    gap: 3px;
    min-width: 0;
  }

  .print-crew-summary.is-single {
    display: block;
  }

  .print-crew-single,
  .print-crew-total {
    color: #20282b;
    font-weight: 650;
  }

  .print-crew-items {
    display: grid;
    gap: 1px;
    margin: 1px 0 0;
    padding-left: 15px;
    color: #7e8c8b;
    font-size: 7px;
    line-height: 1.18;
    font-weight: 400;
  }

  .print-crew-item {
    padding-left: 1px;
    min-width: 0;
  }

  .print-crew-item strong {
    color: #667574;
    font-size: inherit;
    font-weight: 560;
  }

  .print-crew-item span {
    margin-left: 3px;
  }

  .print-summary-group-note {
    display: inline-block;
    margin-left: 8px;
    color: #4b565b;
    font-size: 9.5px;
    font-weight: 500;
    vertical-align: top;
  }

  .print-summary-group-note .print-comment-list {
    display: inline-grid;
  }

  .print-summary-table .is-overtime-summary td {
    background: #fffdf5;
  }

  .print-summary-table .is-overtime-detail-row td,
  .print-summary-table .is-shift-overtime-row td {
    color: #4b565b;
    background: #fbfcfa;
    font-size: 9px;
  }

  .print-summary-table .is-overtime-detail-row td:first-child,
  .print-summary-table .is-shift-overtime-row td:first-child {
    padding-left: 32px;
    color: #20282b;
    font-weight: 620;
  }

  .print-summary-table .is-overtime-detail-row .is-money,
  .print-summary-table .is-shift-overtime-row .is-money {
    color: #20282b;
    font-weight: 720;
  }

  .print-empty {
    padding: 18px;
    color: #667178;
    font-size: 11px;
    text-align: center;
    background: #f8f9f6;
  }

  .print-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid #dce1dc;
    color: #667178;
    font-size: 9px;
  }

  .print-footer strong {
    color: #20282b;
  }

  .print-operator-code {
    margin-right: auto;
    color: #c3cbc5;
    font-size: 7px;
    letter-spacing: 0.02em;
  }

  .print-sheet.is-client-print,
  .print-sheet:has(.client-print-document) {
    padding: 0 !important;
    overflow: visible !important;
  }

  .print-sheet .client-print-document {
    width: 100%;
    margin: 0;
    overflow: visible;
    color: #1e292b;
    font-family: Archivo, Arial, sans-serif;
  }

  .client-print-document .client-print-page {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    min-height: auto;
    max-width: none;
    margin: 0 auto !important;
    padding: 0 0 10mm;
    overflow: visible;
    background: #ffffff;
    box-sizing: border-box;
  }

  .client-print-document .client-print-page + .client-print-page {
    break-before: page !important;
    page-break-before: always !important;
  }

  .client-print-project-hero {
    display: block;
    width: 100%;
    margin: 0 0 8mm;
    padding: 40px 28mm 34px;
    color: #ffffff;
    background: #13394A;
    box-sizing: border-box;
  }

  .client-print-brand-row,
  .client-print-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-width: 0;
  }

  .client-print-brand-left {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .client-print-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    color: #13394A;
    background: #ffffff;
    font-size: 15px;
    font-weight: 800;
  }

  .client-print-wordmark {
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.16em;
  }

  .client-print-kicker,
  .client-print-meta-cell span,
  .client-print-rental-labels {
    text-transform: uppercase;
  }

  .client-print-kicker {
    color: #9fc4c0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.16em;
  }

  .client-print-project-hero h1 {
    max-width: 132mm;
    margin: 28px 0 0;
    color: #ffffff;
    font-size: 30px;
    line-height: 1.15;
    font-weight: 800;
  }

  .client-print-hero-total,
  .client-print-shift-total {
    align-self: center;
    text-align: right;
  }

  .client-print-meta-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 18px 40px;
    margin-top: 20px;
  }

  .client-print-meta-cell {
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .client-print-meta-cell span {
    display: block;
    margin-bottom: 4px;
    color: #9fc4c0;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
  }

  .client-print-meta-cell strong {
    display: block;
    color: #ffffff;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 600;
  }

  .client-print-meta-cell:has(.is-wide) {
    flex-basis: 100%;
  }

  .client-print-date-chip-list {
    display: flex !important;
    flex-wrap: wrap;
    gap: 6px;
  }

  .client-print-date-chip-list span {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 4px;
    color: #dce9e7;
    background: rgba(255, 255, 255, 0.12);
    font-size: 10.5px;
    font-weight: 400;
    line-height: 1.15;
    text-transform: none;
  }

  .client-print-overview {
    break-inside: avoid;
    page-break-inside: avoid;
    width: 176mm;
    margin: 0 auto;
  }

  .client-print-overview h2 {
    margin: 0 0 10px;
    color: #1a2422;
    font-size: 16px;
    line-height: 1.15;
    font-weight: 700;
  }

  .client-print-overview-table {
    border: 0;
    border-radius: 0;
    overflow: visible;
    background: #ffffff;
  }

  .client-print-overview-head,
  .client-print-overview-row {
    display: grid;
    grid-template-columns: 28mm 24mm 30mm 36mm minmax(0, 1fr);
    align-items: start;
    column-gap: 0;
    box-sizing: border-box;
    min-width: 0;
  }

  .client-print-overview-head {
    padding: 0 0 6px;
    border-bottom: 2px solid #13394A;
    color: #5c6869;
    background: transparent;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .client-print-overview-head span:nth-child(5),
  .client-print-overview-row > span:nth-child(5) {
    padding-left: 16px;
  }

  .client-print-overview-row {
    min-height: 0;
    padding: 5px 0;
    border-bottom: 1px solid #edf2f1;
    color: #1e292b;
    font-size: 10.5px;
    line-height: 1.28;
    font-weight: 400;
  }

  .client-print-overview-row > span:nth-child(5) {
    color: #8a9895;
    font-size: 10.5px;
  }

  .client-print-overview-row strong {
    font-size: 12px;
    font-weight: 600;
  }

  .client-print-overview-row.is-child {
    min-height: 0;
    padding-top: 4px;
    padding-bottom: 4px;
    color: #526063;
    background: #fbfcfb;
    font-size: 9px;
  }

  .client-print-overview-row.is-child strong {
    grid-column: 1 / span 2;
    padding-left: 8mm;
    font-size: 9.4px;
    font-weight: 620;
  }

  .client-print-overview-row.is-child > .client-print-mono {
    display: none;
  }

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

  .client-print-overview-row.client-print-total-row {
    min-height: 0;
    border-top: 2px solid #1e292b;
    color: #1e292b;
    background: #fcee8d;
    font-weight: 760;
    padding: 10px 6px;
  }

  .client-print-follow-note {
    display: grid;
    justify-items: center;
    gap: 4px;
    margin: 30px auto 0;
    max-width: 125mm;
    color: #1e292b;
    text-align: center;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .client-print-follow-note strong {
    margin: 0;
    font-size: 16px;
    line-height: 1.28;
    font-weight: 700;
  }

  .client-print-follow-note small {
    display: block;
    color: #8a9895;
    font-size: 11.5px;
    line-height: 1.25;
    font-weight: 400;
  }

  .client-print-follow-note span {
    color: #13394A;
    font-size: 17px;
    font-weight: 820;
    letter-spacing: 0.18em;
  }

  .client-print-shift-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12mm;
    width: 100%;
    margin: 0;
    padding: 18px 28mm;
    color: #ffffff;
    background: #13394A;
    box-sizing: border-box;
  }

  .client-print-shift-hero > div:first-child {
    display: flex;
    align-items: baseline;
    gap: 12px;
  }

  .client-print-shift-hero h1 {
    margin: 0;
    color: #ffffff;
    font-size: 19px;
    line-height: 1;
    font-weight: 800;
  }

  .client-print-shift-hero div > span {
    display: block;
    margin-top: 0;
    color: #9fc4c0;
    font-size: 12px;
    font-weight: 400;
  }

  .client-print-main-band {
    break-inside: avoid;
    page-break-inside: avoid;
    width: 100%;
    margin: 0 0 30px;
    padding: 28px 17mm 26px;
    border-radius: 0;
    background: #E3EDF1;
    box-sizing: border-box;
  }

  .client-print-main-card {
    overflow: hidden;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 0 0 1px rgba(19, 57, 74, 0.11);
  }

  .client-print-main-title {
    padding: 10px 20px;
    color: #ffffff;
    background: #13394A;
    font-size: 13px;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .client-print-main-table {
    display: grid;
  }

  .client-print-main-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr) 42mm;
    align-items: start;
    column-gap: 8px;
    min-height: 0;
    padding: 8px 20px;
    box-sizing: border-box;
    border-bottom: 1px solid #edf2f1;
    color: #1e292b;
    font-size: 12px;
    line-height: 1.25;
    font-weight: 400;
  }

  .client-print-main-row > strong {
    font-size: 12px;
    font-weight: 400;
  }

  .client-print-main-note {
    color: #8a9895;
    font-size: 10.5px;
    font-weight: 400;
  }

  .client-print-main-row.is-overtime {
    background: #fbf9ee;
  }

  .client-print-main-total {
    min-height: 0;
    border-top: 2px solid #1e292b;
    border-bottom: 0;
    background: #fcee8d;
    padding-top: 9px;
    padding-bottom: 9px;
  }

  .client-print-main-total strong {
    font-size: 12.5px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .client-print-overtime-note {
    margin-top: 10px;
    color: #5e706d;
    font-size: 10.5px;
    line-height: 1.28;
    font-weight: 480;
  }

  .client-print-details {
    display: grid;
    gap: 14px;
    width: 176mm;
    margin: 0 auto;
  }

  .client-print-details h2 {
    margin: 0;
    padding-top: 0;
    border-top: 0;
    color: #1a2422;
    font-size: 15px;
    line-height: 1.1;
    font-weight: 800;
  }

  .client-print-rental-panel {
    overflow: hidden;
    border-radius: 8px;
    background: #f3f5f4;
    break-inside: auto;
    page-break-inside: auto;
    box-shadow: 0 0 0 1px #d9dfdc;
  }

  .client-print-rental-panel.is-short-panel {
    break-inside: avoid-page;
    page-break-inside: avoid;
  }

  .client-print-rental-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 16px;
    box-sizing: border-box;
    color: var(--rental-ink);
    background: var(--rental-bg);
    break-after: avoid;
    page-break-after: avoid;
  }

  .client-print-rental-head h3 {
    margin: 0;
    color: var(--rental-ink);
    font-size: 11.5px;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .client-print-rental-head span {
    color: var(--rental-ink);
    font-size: 10px;
    font-weight: 400;
  }

  .client-print-rental-table {
    display: grid;
  }

  .client-print-rental-divider {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px 3px;
    border-top: 1px solid #E3E9EA;
    color: #899795;
    background: rgba(255, 255, 255, 0.26);
    font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 8px;
    line-height: 1;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    break-after: avoid;
    page-break-after: avoid;
  }

  .client-print-rental-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #dfe7e5;
  }

  .client-print-rental-divider.is-spaced-group {
    margin-top: 5mm;
  }

  .client-print-rental-table > .client-print-rental-divider:first-child {
    border-top: 0;
    margin-top: 0;
  }

  .client-print-rental-labels,
  .client-print-rental-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 30mm 46mm;
    align-items: start;
    column-gap: 8px;
    box-sizing: border-box;
    min-width: 0;
  }

  .client-print-rental-labels {
    padding: 6px 16px;
    color: #596566;
    background: #eef1ef;
    font-size: 8px;
    font-weight: 780;
  }

  .client-print-rental-row {
    padding: 5px 16px;
    border-top: 1px solid #E3E9EA;
    color: #1e292b;
    font-size: 11.5px;
    line-height: 1.24;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .client-print-overview-head > *,
  .client-print-overview-row > *,
  .client-print-main-row > *,
  .client-print-rental-head > *,
  .client-print-rental-labels > *,
  .client-print-rental-row > * {
    min-width: 0;
  }

  .client-print-rental-row strong {
    display: block;
    font-weight: 400;
  }

  .client-print-rental-row div > span {
    display: block;
    margin-top: 2px;
    color: #8a9895;
    font-size: 10px;
    font-weight: 440;
  }

  .client-print-money,
  .client-print-rental-labels span:nth-child(n + 2),
  .client-print-rental-row > span:nth-child(n + 2) {
    text-align: right;
  }

  .client-print-mono,
  .client-print-mono-value,
  .client-print-price-pair,
  .client-print-operator {
    font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  }

  .client-print-mono {
    color: #8a9895;
    font-size: 10.5px;
    font-weight: 400;
  }

  .client-print-mono-value {
    color: #1e292b;
    font-size: 12px;
    font-weight: 400;
    white-space: nowrap;
  }

  .client-print-mono-value.is-strong {
    font-weight: 600;
  }

  .client-print-mono-value.is-muted {
    color: #6b7778;
    text-decoration: line-through;
    text-decoration-thickness: 1px;
  }

  .client-print-price-pair {
    display: inline-flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 5px;
    max-width: 100%;
    color: #ffffff;
    font-size: 14px;
    font-weight: 760;
    white-space: nowrap;
  }

  .client-print-price-pair span {
    color: rgba(255, 255, 255, 0.64);
    text-decoration: line-through;
    text-decoration-thickness: 1.2px;
  }

  .client-print-price-pair b {
    color: rgba(255, 255, 255, 0.55);
    font-weight: 650;
  }

  .client-print-price-pair strong {
    color: #fcee8d;
    font-size: 19px;
    font-weight: 600;
  }

  .client-print-price-pair.is-compact {
    gap: 3px;
    color: #1e292b;
    font-size: 10px;
  }

  .client-print-price-pair.is-compact span {
    color: #697778;
  }

  .client-print-price-pair.is-compact b {
    color: #7a8586;
  }

  .client-print-price-pair.is-compact strong {
    color: #1e292b;
    font-size: 11.5px;
  }

  .client-print-bonus {
    display: inline-block;
    padding: 1px 6px 2px;
    border-radius: 999px;
    color: var(--rental-ink);
    background: var(--rental-bg);
    font-size: 8px;
    font-weight: 720;
  }

  .client-print-footer {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    width: 176mm;
    margin: auto auto 0;
    padding-top: 12px;
    border-top: 1px solid #dfe7e5;
    color: #768081;
    font-size: 9.5px;
    font-weight: 400;
    letter-spacing: 0.02em;
  }

  .client-print-footer span:last-child {
    text-align: right;
  }
}

@media (max-width: 1180px) {
  body[data-view="estimate"],
  body[data-view="estimate"] .app-shell,
  body[data-view="estimate"] .workspace,
  body[data-view="estimate"] .estimate-desk,
  body[data-view="estimate"] .desk-shell,
  body[data-view="estimate"] .desk-content,
  body[data-view="estimate"] .desk-list,
  body[data-view="estimate"] .desk-project-area {
    color-scheme: light;
    color: var(--cg-ink);
    background: var(--cg-bg) !important;
  }

  body[data-view="estimate"] .desk-topbar,
  body[data-view="estimate"] .desk-shift-strip,
  body[data-view="estimate"] .desk-shift-strip .shift-body,
  body[data-view="estimate"] .shift-panel > .panel-body,
  body[data-view="estimate"] .estimate-add-row,
  body[data-view="estimate"] .line-table-wrap,
  body[data-view="estimate"] .line-table,
  body[data-view="estimate"] .line-table tbody,
  body[data-view="estimate"] .mobile-line-card,
  body[data-view="estimate"] .catalog-picker-modal,
  body[data-view="estimate"] .estimate-catalog-popover {
    color: var(--cg-ink);
    background: var(--cg-surface) !important;
  }

  body[data-view="estimate"] .desk-project-title strong,
  body[data-view="estimate"] .mobile-line-title,
  body[data-view="estimate"] .line-table .total-row td,
  body[data-view="estimate"] .line-table .total-row.is-rental-total td {
    color: var(--cg-ink);
  }

  body[data-view="estimate"] .desk-project-meta,
  body[data-view="estimate"] .mobile-line-meta,
  body[data-view="estimate"] .mobile-line-price-text,
  body[data-view="estimate"] .line-table .section-title-row td {
    color: var(--cg-mute);
  }

  body[data-view="estimate"] .shift-panel .input,
  body[data-view="estimate"] .shift-panel .select,
  body[data-view="estimate"] .shift-panel .textarea,
  body[data-view="estimate"] .estimate-add-search,
  body[data-view="estimate"] .date-picker-button {
    color-scheme: light;
    color: var(--cg-ink);
    border-color: var(--cg-line-2);
    background: var(--cg-surface);
  }

  body[data-view="estimate"] .line-table .section-title-row td,
  body[data-view="estimate"] .line-table .total-row,
  body[data-view="estimate"] .line-table .total-row.is-rental-total,
  body[data-view="estimate"] .line-table .discount-summary-row {
    background: #F7F9F9 !important;
  }

  body[data-view="estimate"] .desk-sidebar {
    background: transparent !important;
  }

  body[data-view="estimate"] .desk-total-card {
    color: var(--cg-ink);
    border-top: 1px solid var(--cg-line);
    background: var(--cg-surface) !important;
    box-shadow: 0 -12px 34px rgba(19, 57, 74, 0.12);
  }

  body[data-view="estimate"] .desk-pay-row span {
    color: var(--cg-mute);
  }

  body[data-view="estimate"] .desk-pay-row strong {
    color: var(--cg-teal-900);
  }

  body[data-view="estimate"] .desk-discount-pill {
    color: var(--cg-yellow-ink);
    background: var(--cg-yellow-panel);
  }
}

/* Staff and payouts brand pass, 2026-08-04. */
body[data-view="staff"] {
  color: var(--cg-ink);
  background: var(--cg-bg);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
}

body[data-view="staff"] .database-flow {
  flex: 1;
  padding: 14px 16px 64px;
  overflow: auto;
}

body[data-view="staff"] .staff-flow {
  max-width: 1320px;
}

body[data-view="staff"] .staff-database-panel {
  border-color: var(--cg-line);
  border-radius: 10px;
  box-shadow: none;
}

body[data-view="staff"] .staff-database-panel .panel-title {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

body[data-view="staff"] .staff-database-panel .panel-subtitle,
body[data-view="staff"] .database-save-note {
  color: var(--cg-mute);
  font-size: 12px;
  font-weight: 400;
}

.staff-card {
  min-width: 0;
  border-color: var(--cg-line);
  border-radius: 8px;
  background: var(--cg-surface);
  box-shadow: none;
}

.staff-editor-grid,
.staff-editor-section,
.staff-position-stack,
.staff-card-stack,
.staff-position-row,
.staff-payment-card-row,
.staff-position-row > *,
.staff-payment-card-row > * {
  min-width: 0;
}

.staff-card-head,
.staff-editor-section-head {
  align-items: flex-end;
}

.staff-editor-section-head span,
.payouts-section-head span,
.payout-shift-head {
  color: var(--cg-mute);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
}

.staff-archive summary {
  color: var(--cg-mute);
  font-weight: 600;
}

body[data-view="estimate"] .payouts-modal {
  width: min(1120px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  gap: 12px;
  overflow: auto;
}

body[data-view="estimate"] .payouts-modal .modal-head {
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--cg-line);
}

body[data-view="estimate"] .payouts-modal .modal-head h2 {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 17px;
  font-weight: 600;
}

body[data-view="estimate"] .payouts-modal .modal-copy {
  color: var(--cg-mute);
  font-size: 12.5px;
}

.payouts-summary-strip {
  grid-template-columns: minmax(120px, 0.8fr) repeat(3, minmax(120px, 1fr)) minmax(96px, 0.7fr);
  gap: 8px;
}

.payouts-summary-strip > div,
.payout-rate-field {
  min-width: 0;
  min-height: 46px;
  padding: 8px 10px;
  border-color: var(--cg-line);
  border-radius: 7px;
  background: var(--cg-surface);
}

.payouts-summary-strip span,
.payout-rate-field span {
  color: var(--cg-mute);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
}

.payouts-summary-strip strong,
.payout-rate-field .input {
  color: var(--cg-ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 15px;
  font-weight: 600;
}

.payout-rate-field .input {
  min-height: 24px;
}

.payouts-layout {
  grid-template-columns: minmax(0, 1fr);
  overflow: visible;
}

.payouts-layout > *,
.payouts-workbench,
.payouts-preview,
.payouts-section,
.payout-slot-card,
.payout-rental-row {
  min-width: 0;
}

.payouts-preview {
  position: static;
  width: 100%;
  padding: 10px;
  border-color: var(--cg-line);
  border-radius: 8px;
  background: var(--cg-surface);
  box-shadow: none;
}

.payouts-preview-head span {
  color: var(--cg-ink);
  font-size: 13.5px;
  font-weight: 600;
}

.payouts-preview-text {
  min-height: 250px;
  max-height: 44vh;
  padding: 10px;
  border-color: var(--cg-line-2);
  border-radius: 7px;
  color: var(--cg-ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12.5px;
  line-height: 1.52;
}

.payouts-section {
  gap: 8px;
}

.payouts-section-head {
  align-items: baseline;
  padding-top: 2px;
}

.payouts-section-head h3 {
  color: var(--cg-ink);
  font-size: 15px;
  font-weight: 600;
}

.payout-shift-group {
  gap: 6px;
}

.payout-shift-head {
  padding: 0 2px;
}

.payout-slot-stack,
.payout-rental-stack {
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  background: var(--cg-surface);
}

.payout-slot-card,
.payout-rental-row {
  border: 0;
  border-bottom: 1px solid var(--cg-line-3);
  border-radius: 0;
  background: var(--cg-surface);
  box-shadow: none;
}

.payout-slot-stack .payout-slot-card:last-child,
.payout-rental-stack .payout-rental-row:last-child {
  border-bottom: 0;
}

.payout-slot-card.is-selected {
  border-color: var(--cg-line-3);
  background: var(--cg-teal-050);
  box-shadow: inset 3px 0 0 var(--cg-teal-900);
}

.payout-slot-main,
.payout-rental-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.payout-slot-eyebrow,
.payout-slot-main small,
.payout-rental-row span,
.payout-rental-row small,
.payout-selected-position {
  color: var(--cg-mute);
  font-size: 11.5px;
  font-weight: 400;
}

.payout-slot-main strong,
.payout-rental-row strong {
  color: var(--cg-ink);
  font-size: 13.5px;
  font-weight: 600;
}

.payout-slot-total,
.payout-rental-row > div:last-child {
  min-width: 96px;
  color: var(--cg-ink);
  font-family: "IBM Plex Mono", monospace;
  text-align: right;
}

.payout-slot-total strong,
.payout-rental-row > div:last-child strong {
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
  font-weight: 600;
}

.payout-slot-total span,
.payout-rental-row > div:last-child span {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
}

.payout-candidate-grid {
  gap: 6px;
}

.payout-candidate {
  min-height: 34px;
  padding: 6px 8px;
  border-color: var(--cg-line-2);
  border-radius: 6px;
  color: var(--cg-ink);
  background: var(--cg-surface);
  font-size: 12.5px;
}

.payout-candidate strong {
  font-weight: 600;
}

.payout-candidate span,
.payout-empty-candidates {
  color: var(--cg-mute);
  font-size: 11.5px;
}

.payout-candidate.is-selected {
  border-color: var(--cg-teal-900);
  color: var(--cg-ink);
  background: var(--cg-teal-100);
}

.payout-candidate.is-selected span {
  color: var(--cg-ink-3);
}

.payout-slot-edit {
  grid-template-columns: auto auto minmax(90px, 0.45fr) minmax(140px, 1fr) minmax(90px, 0.45fr) minmax(180px, 1.2fr);
  gap: 8px;
  min-width: 0;
  padding-top: 8px;
  border-top: 1px solid var(--cg-line-3);
}

.payout-slot-edit .field-label {
  min-width: 0;
}

.payout-slot-edit .input,
.payout-slot-edit .select {
  width: 100%;
}

.payout-check {
  min-height: 31px;
  color: var(--cg-ink);
  font-size: 12.5px;
  font-weight: 500;
}

@media (min-width: 1181px) {
  body[data-view="staff"] .topbar {
    display: none;
  }

  body[data-view="staff"] .workspace {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  body[data-view="staff"] .desk-rail {
    display: flex;
  }
}

@media (max-width: 1180px) {
  body[data-view="staff"] .database-desk,
  body[data-view="staff"] .database-shell {
    display: block;
    min-height: 0;
    overflow: visible;
  }

  body[data-view="staff"] .database-topbar {
    display: none;
  }

  body[data-view="staff"] .database-flow {
    padding: 0;
    overflow: visible;
  }

  .staff-editor-grid,
  .staff-position-row,
  .staff-payment-card-row,
  .payout-slot-edit,
  .payout-slot-main,
  .payout-rental-row {
    grid-template-columns: 1fr;
  }

  .payout-slot-total,
  .payout-rental-row > div:last-child {
    text-align: left;
  }
}

@media (max-width: 760px) {
  body[data-view="estimate"] .payouts-modal {
    width: 100%;
    max-height: calc(100vh - 20px);
    padding: 14px;
  }

  body[data-view="estimate"] .payouts-modal .modal-head {
    align-items: stretch;
    flex-direction: column;
  }

  body[data-view="estimate"] .payouts-modal .modal-head-actions {
    justify-content: stretch;
  }

  body[data-view="estimate"] .payouts-modal .modal-head-actions .button {
    flex: 1;
  }

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

  .payouts-summary-strip .is-warning {
    grid-column: 1 / -1;
  }

  .payouts-preview-text {
    max-height: 36vh;
  }
}

@media (max-width: 520px) {
  .payouts-summary-strip {
    grid-template-columns: 1fr;
  }
}

/* Staff ledger redesign, 2026-08-04. */
body[data-view="staff"] .staff-database-panel .panel-header {
  min-height: 46px;
  padding: 10px 14px;
}

body[data-view="staff"] .staff-database-panel .panel-body {
  padding: 10px 14px 14px;
}

body[data-view="staff"] .db-controls-row {
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

body[data-view="staff"] .db-controls-row .input {
  min-height: 32px;
  font-size: 12.5px;
}

body[data-view="staff"] .database-save-note {
  min-height: 32px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body[data-view="staff"] .staff-db-stack {
  gap: 8px;
}

.staff-ledger-record {
  display: block;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-color: var(--cg-line);
  border-radius: 8px;
  background: var(--cg-surface);
}

.staff-person-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(260px, 1.25fr) minmax(210px, 1fr) 122px 74px;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 0 10px;
  color: var(--cg-ink);
  cursor: pointer;
  list-style: none;
}

.staff-person-row:focus {
  outline: none;
}

.staff-person-row:focus-visible {
  outline: 1.5px solid var(--cg-teal-900);
  outline-offset: -1.5px;
}

.staff-person-row::-webkit-details-marker {
  display: none;
}

.staff-person-row::marker {
  content: "";
}

.staff-ledger-record[open] .staff-person-row {
  border-bottom: 1px solid var(--cg-line);
  background: var(--cg-teal-050);
}

.staff-person-name,
.staff-person-positions,
.staff-person-cards,
.staff-person-counts,
.staff-person-edit {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-person-name {
  color: var(--cg-ink);
  font-size: 13.5px;
  font-weight: 600;
}

.staff-person-positions,
.staff-person-cards {
  color: var(--cg-ink-4);
  font-size: 12.5px;
}

.staff-person-positions {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
}

.staff-person-cards {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
}

.staff-person-counts {
  color: var(--cg-mute);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  text-align: right;
}

.staff-person-edit {
  color: var(--cg-teal-900);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
}

.staff-ledger-body {
  display: grid;
  gap: 0;
}

.staff-ledger-head {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(220px, 0.8fr) auto;
  gap: 10px;
  align-items: end;
  min-width: 0;
  padding: 9px 10px;
  border-bottom: 1px solid var(--cg-line);
  background: var(--cg-surface);
}

.staff-ledger-name {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.staff-ledger-name span,
.staff-mini-head span {
  color: var(--cg-mute);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  line-height: 1.2;
  text-transform: uppercase;
}

.staff-ledger-name .input {
  min-height: 31px;
  color: var(--cg-ink);
  font-size: 13px;
  font-weight: 500;
}

.staff-ledger-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding-bottom: 3px;
  color: var(--cg-mute);
  font-size: 11.5px;
  line-height: 1.25;
}

.staff-ledger-meta span {
  color: var(--cg-ink-3);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

.staff-ledger-meta small {
  overflow: hidden;
  color: var(--cg-mute);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-ledger-record .staff-card-actions {
  align-items: end;
  justify-content: flex-end;
}

.staff-ledger-record .staff-card-actions .button {
  min-height: 31px;
  padding: 0 10px;
}

.staff-ledger-record .staff-editor-grid {
  grid-template-columns: minmax(360px, 0.85fr) minmax(430px, 1.15fr);
  gap: 0;
}

.staff-ledger-record .staff-editor-section {
  gap: 0;
  min-width: 0;
}

.staff-ledger-record .staff-editor-section:first-child {
  border-right: 1px solid var(--cg-line);
}

.staff-ledger-record .staff-editor-section-head {
  min-height: 31px;
  padding: 0 8px 0 10px;
  border-bottom: 1px solid var(--cg-line-3);
  background: var(--cg-panel);
}

.staff-ledger-record .staff-editor-section-head span {
  font-size: 10px;
}

.staff-ledger-record .staff-editor-section-head .button {
  min-height: 26px;
  padding: 0 8px;
  font-size: 11px;
}

.staff-mini-table {
  display: grid;
  min-width: 0;
  overflow: hidden;
}

.staff-position-row,
.staff-payment-card-row {
  display: grid;
  gap: 6px;
  align-items: center;
  min-width: 0;
  min-height: 38px;
  padding: 4px 8px;
  border-bottom: 1px solid var(--cg-line-3);
  background: var(--cg-surface);
}

.staff-position-row {
  grid-template-columns: minmax(130px, 1fr) 78px 78px 78px 31px;
}

.staff-payment-card-row {
  grid-template-columns: 104px minmax(120px, 0.85fr) minmax(180px, 1.15fr) 31px;
}

.staff-position-row:last-child,
.staff-payment-card-row:last-child {
  border-bottom: 0;
}

.staff-mini-head {
  min-height: 26px;
  padding-top: 0;
  padding-bottom: 0;
  background: var(--cg-panel);
}

.staff-mini-head span:nth-child(2),
.staff-mini-head span:nth-child(3),
.staff-mini-head span:nth-child(4) {
  text-align: right;
}

.staff-mini-head + .staff-position-row,
.staff-mini-head + .staff-payment-card-row {
  border-top: 0;
}

.staff-position-row:not(.staff-mini-head) .input,
.staff-position-row:not(.staff-mini-head) .select,
.staff-payment-card-row:not(.staff-mini-head) .input,
.staff-payment-card-row:not(.staff-mini-head) .select {
  width: 100%;
  min-height: 30px;
  padding: 0 8px;
  border-color: var(--cg-line-2);
  border-radius: 6px;
  color: var(--cg-ink);
  background: var(--cg-surface);
  font-size: 12.5px;
}

.staff-number-input,
.staff-card-number-input {
  font-family: "IBM Plex Mono", monospace;
}

.staff-number-input {
  text-align: right;
}

.staff-row-remove {
  width: 31px;
  min-width: 31px;
  min-height: 30px;
  padding: 0;
}

.staff-archive {
  margin-top: 10px;
}

.staff-archive summary {
  min-height: 34px;
  padding: 9px 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.staff-list-row {
  display: grid;
  grid-template-columns: 36px minmax(130px, 0.55fr) minmax(280px, 1.35fr) minmax(110px, 0.35fr) 92px;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 6px 8px;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  color: var(--cg-ink);
  background: var(--cg-surface);
  cursor: pointer;
}

.staff-list-row:hover,
.staff-list-row:focus-visible {
  border-color: var(--cg-teal-900);
  outline: none;
}

.staff-list-row.has-warning {
  border-color: var(--cg-yellow-line);
}

.staff-list-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--cg-teal-900);
  background: var(--cg-teal-100);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 600;
}

.staff-list-row.has-warning .staff-list-avatar {
  color: var(--cg-yellow-ink);
  background: var(--cg-yellow-panel);
}

.staff-list-person,
.staff-list-chips,
.staff-list-card {
  min-width: 0;
}

.staff-list-person strong,
.staff-list-person small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-list-person strong {
  color: var(--cg-ink);
  font-size: 13.5px;
  font-weight: 600;
}

.staff-list-person small {
  margin-top: 1px;
  color: var(--cg-mute);
  font-size: 11.5px;
}

.staff-list-chips {
  display: flex;
  gap: 5px;
  overflow: hidden;
  flex-wrap: nowrap;
}

.staff-chip {
  display: inline-flex;
  align-items: center;
  max-width: 210px;
  height: 25px;
  padding: 0 8px;
  overflow: hidden;
  border: 1px solid var(--cg-line-2);
  border-radius: 7px;
  color: var(--cg-ink-3);
  background: var(--cg-surface);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-chip.is-driver {
  border-color: var(--cg-yellow-line);
  color: var(--cg-yellow-ink);
  background: var(--cg-yellow-panel);
}

.staff-chip.is-muted {
  color: var(--cg-mute);
  background: var(--cg-panel);
}

.staff-list-card {
  overflow: hidden;
  color: var(--cg-ink-4);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-list-card.is-warning {
  color: var(--cg-yellow-ink);
}

.staff-list-edit {
  min-height: 30px;
}

.staff-settings-modal {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  gap: 12px;
}

.staff-settings-body,
.staff-settings-section,
.staff-settings-name {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.staff-settings-name span,
.staff-settings-note,
.staff-driver-hint {
  color: var(--cg-mute);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.staff-driver-section {
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  background: var(--cg-panel);
}

.staff-driver-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--cg-ink);
  font-size: 13px;
  font-weight: 600;
}

.staff-driver-toggle input {
  width: 20px;
  height: 20px;
  accent-color: var(--cg-teal-900);
}

.staff-driver-categories {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.staff-driver-category {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 30px;
  border: 1px solid var(--cg-line-2);
  border-radius: 8px;
  color: var(--cg-ink-3);
  background: var(--cg-surface);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 600;
}

.staff-driver-category.is-active {
  border-color: var(--cg-teal-900);
  color: #fff;
  background: var(--cg-teal-900);
}

.staff-driver-hint {
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-settings-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
}

.staff-settings-save-state {
  color: var(--cg-mute);
  font-size: 12px;
  text-align: right;
}

@media (max-width: 1180px) {
  .staff-person-row {
    grid-template-columns: minmax(130px, 0.75fr) minmax(220px, 1.1fr) minmax(180px, 1fr) 112px 64px;
  }

  .staff-ledger-record .staff-editor-grid {
    grid-template-columns: 1fr;
  }

  .staff-ledger-record .staff-editor-section:first-child {
    border-right: 0;
    border-bottom: 1px solid var(--cg-line);
  }

  .staff-position-row {
    grid-template-columns: minmax(130px, 1fr) repeat(3, minmax(72px, 0.5fr)) 31px;
  }

  .staff-payment-card-row {
    grid-template-columns: 104px minmax(140px, 0.8fr) minmax(180px, 1fr) 31px;
  }
}

@media (max-width: 760px) {
  body[data-view="staff"] .db-controls-row,
  .staff-ledger-head {
    grid-template-columns: 1fr;
  }

  .staff-person-row {
    grid-template-columns: 1fr auto;
    gap: 3px 8px;
    min-height: 0;
    padding: 8px;
  }

  .staff-person-name {
    grid-column: 1;
    font-size: 14px;
  }

  .staff-person-edit {
    grid-column: 2;
    grid-row: 1;
  }

  .staff-person-positions,
  .staff-person-cards,
  .staff-person-counts {
    grid-column: 1 / -1;
    text-align: left;
  }

  .staff-ledger-record .staff-card-actions {
    justify-content: stretch;
  }

  .staff-ledger-record .staff-card-actions .button {
    flex: 1;
  }

  .staff-mini-head {
    display: none;
  }

  .staff-position-row,
  .staff-payment-card-row {
    min-height: 0;
    padding: 8px;
  }

  .staff-position-row {
    grid-template-columns: 1fr 1fr;
  }

  .staff-position-row .select,
  .staff-payment-card-row .staff-card-number-input {
    grid-column: 1 / -1;
  }

  .staff-payment-card-row {
    grid-template-columns: 1fr 1fr;
  }

  .staff-row-remove {
    width: 100%;
  }

  .staff-list-row {
    grid-template-columns: 36px minmax(0, 1fr) 44px;
    gap: 8px;
    min-height: 56px;
  }

  .staff-list-chips,
  .staff-list-card {
    grid-column: 2 / -1;
  }

  .staff-list-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 1px;
  }

  .staff-list-edit {
    grid-column: 3;
    grid-row: 1;
    width: 44px;
    min-width: 44px;
    padding: 0;
    overflow: hidden;
    color: transparent;
  }

  .staff-list-edit::before {
    content: "›";
    color: var(--cg-ink-3);
    font-size: 22px;
    line-height: 1;
  }

  .staff-driver-section,
  .staff-settings-actions {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .staff-driver-hint,
  .staff-settings-save-state {
    text-align: left;
  }
}

/* Crew picker in estimate lines, 2026-08-04. */
.crew-line-picker-thumb {
  gap: 1px;
  border: 1px solid var(--cg-line-2);
  color: var(--cg-ink);
  background: var(--cg-teal-100);
}

body[data-view="estimate"] .crew-line-picker-thumb {
  width: 34px;
  height: 32px;
  border: 1px solid var(--cg-line-2);
  border-radius: 8px;
}

.crew-line-picker-thumb.is-missing {
  border-color: #e0aea5;
  color: #a34234;
  background: #fff1ee;
  box-shadow: inset 0 0 0 1px rgba(176, 74, 58, 0.11);
}

.crew-line-picker-thumb.is-complete {
  border-color: #96c6a8;
  color: #1f6543;
  background: #edf8f0;
  box-shadow: inset 0 0 0 1px rgba(31, 101, 67, 0.11);
}

.crew-line-picker-thumb.is-overflow {
  border-color: var(--cg-yellow-line);
  color: var(--cg-yellow-ink);
  background: var(--cg-yellow-panel);
  box-shadow: inset 0 0 0 1px rgba(122, 93, 0, 0.1);
}

.crew-line-picker-thumb .crew-thumb-code {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
}

.crew-line-picker-thumb small {
  color: inherit;
  font-family: "IBM Plex Mono", monospace;
  font-size: 9.5px;
  font-weight: 500;
  line-height: 1;
}

.crew-picker-modal {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  gap: 12px;
  overflow: auto;
}

.crew-picker-modal .modal-head {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--cg-line);
}

.crew-picker-modal .modal-head h2 {
  font-size: 17px;
  font-weight: 600;
}

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

.crew-picker-summary > div {
  min-width: 0;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--cg-line);
  border-radius: 7px;
  background: var(--cg-surface);
}

.crew-picker-summary span,
.crew-picker-label {
  color: var(--cg-mute);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.crew-picker-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--cg-ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 15px;
  font-weight: 600;
}

.crew-picker-summary .is-danger,
.payouts-summary-strip .is-danger {
  border-color: #e7c5be;
  background: #fbf0ee;
}

.crew-picker-summary .is-danger span,
.payouts-summary-strip .is-danger span,
.crew-picker-summary .is-danger strong,
.payouts-summary-strip .is-danger strong {
  color: var(--cg-clay);
}

.crew-picker-summary .is-ok {
  background: var(--cg-teal-050);
}

.crew-picker-summary .is-warning {
  border-color: var(--cg-yellow-line);
  background: var(--cg-yellow-panel);
}

.crew-picker-summary .is-warning span,
.crew-picker-summary .is-warning strong {
  color: var(--cg-yellow-ink);
}

.crew-picker-overflow-alert {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--cg-yellow-line);
  border-radius: 7px;
  color: var(--cg-yellow-ink);
  background: var(--cg-yellow-panel);
}

.crew-picker-overflow-alert strong,
.crew-picker-overflow-alert span {
  display: block;
}

.crew-picker-overflow-alert strong {
  color: var(--cg-yellow-ink);
  font-size: 13px;
  font-weight: 600;
}

.crew-picker-overflow-alert span {
  margin-top: 2px;
  font-size: 12px;
}

.crew-picker-fixed-gaffer {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--cg-line);
  border-radius: 7px;
  background: var(--cg-panel);
}

.crew-picker-fixed-gaffer > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  color: var(--cg-teal-900);
  background: var(--cg-yellow);
  font-family: "IBM Plex Mono", monospace;
  font-size: 18px;
  font-weight: 600;
}

.crew-picker-fixed-gaffer strong,
.crew-picker-fixed-gaffer small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crew-picker-fixed-gaffer strong {
  color: var(--cg-ink);
  font-size: 13px;
  font-weight: 600;
}

.crew-picker-fixed-gaffer small {
  margin-top: 2px;
  color: var(--cg-mute);
  font-size: 11.5px;
}

.crew-picker-selected-row.is-locked {
  background: var(--cg-teal-050);
}

.crew-picker-lock {
  color: var(--cg-mute);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.crew-picker-toolbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.crew-picker-scope-link,
.crew-picker-inline-action {
  border: 0;
  padding: 0;
  color: var(--cg-teal-900);
  background: transparent;
  font: 500 12px "IBM Plex Sans", system-ui, sans-serif;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.crew-picker-selected,
.crew-picker-selected-stack,
.crew-picker-candidates {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.crew-picker-selected-stack,
.crew-picker-candidates {
  padding: 8px;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  background: var(--cg-surface);
}

.crew-picker-candidates {
  grid-template-columns: repeat(auto-fill, minmax(164px, 1fr));
}

.crew-picker-selected-row,
.crew-picker-candidate {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 42px;
  padding: 7px 8px;
  border: 1px solid var(--cg-line-3);
  border-radius: 7px;
  background: var(--cg-surface);
}

.crew-picker-candidate {
  grid-template-columns: 34px minmax(0, 1fr);
  text-align: left;
  cursor: pointer;
}

.crew-picker-candidate:hover,
.crew-picker-candidate:focus-visible {
  border-color: var(--cg-teal-900);
  outline: none;
}

.crew-picker-candidate.is-selected {
  border-color: var(--cg-teal-900);
  background: var(--cg-teal-100);
}

.crew-picker-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  color: var(--cg-teal-900);
  background: var(--cg-teal-100);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 600;
}

.crew-picker-selected-row strong,
.crew-picker-candidate strong {
  display: block;
  overflow: hidden;
  color: var(--cg-ink);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crew-picker-selected-row small,
.crew-picker-candidate small {
  display: block;
  overflow: hidden;
  color: var(--cg-mute);
  font-size: 11.5px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crew-picker-empty {
  padding: 10px;
  border: 1px dashed var(--cg-line-2);
  border-radius: 7px;
  color: var(--cg-mute);
  background: var(--cg-surface);
}

.crew-picker-empty.is-danger,
.crew-picker-selected-row.is-danger,
.payout-missing-alert,
.payout-slot-card.is-missing {
  border-color: #e7c5be;
  background: #fbf0ee;
}

.payout-missing-alert {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid #e7c5be;
  border-radius: 7px;
  color: var(--cg-clay);
}

.payout-missing-alert strong {
  color: var(--cg-clay);
  font-size: 13px;
  font-weight: 600;
}

.payout-missing-alert span {
  color: var(--cg-clay);
  font-size: 12px;
}

@media (max-width: 760px) {
  .crew-picker-modal {
    width: 100%;
    max-height: calc(100vh - 20px);
    padding: 14px;
  }

  .crew-picker-modal .modal-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .crew-picker-summary,
  .crew-picker-candidates {
    grid-template-columns: 1fr 1fr;
  }

  .crew-picker-selected-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .crew-picker-selected-row .button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .crew-picker-overflow-alert,
  .crew-picker-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .crew-picker-toolbar {
    display: grid;
  }
}

@media (max-width: 520px) {
  .crew-picker-summary,
  .crew-picker-candidates {
    grid-template-columns: 1fr;
  }
}

/* Payout compact modal, 2026-08-04. */
body[data-view="estimate"] .payouts-modal {
  width: min(900px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.payouts-control-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 160px);
  gap: 8px;
  align-items: stretch;
}

.payout-status-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  background: var(--cg-panel);
}

.payout-control-label,
.payout-staff-field > span,
.payout-slot-edit .field-label > span,
.payout-adjustment summary {
  color: var(--cg-mute);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.payout-status-panel small {
  display: block;
  margin-top: 2px;
  color: var(--cg-ink-4);
  font-size: 12px;
}

.payout-status-tabs {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--cg-line-2);
  border-radius: 8px;
  background: var(--cg-surface);
}

.payout-status-button {
  min-height: 32px;
  padding: 0 11px;
  border: 0;
  border-right: 1px solid var(--cg-line-3);
  background: transparent;
  color: var(--cg-ink-3);
  font: 500 12px "IBM Plex Sans", system-ui, sans-serif;
  white-space: nowrap;
  cursor: pointer;
}

.payout-status-button:last-child {
  border-right: 0;
}

.payout-status-button.is-active {
  background: var(--cg-teal-900);
  color: #fff;
}

.payouts-summary-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.payouts-summary-strip .is-danger {
  border-color: #e7c5be;
  background: #fbf0ee;
}

.payouts-summary-strip .is-danger span,
.payouts-summary-strip .is-danger strong {
  color: var(--cg-clay);
}

.payouts-layout {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.payouts-preview {
  order: 10;
}

.payouts-preview-text {
  min-height: 190px;
  max-height: 34vh;
}

.payout-feedback-field {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.payout-feedback-field span {
  color: var(--cg-mute);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.payout-feedback-field textarea {
  min-height: 82px;
  resize: vertical;
  padding: 10px;
  border: 1px solid var(--cg-line-2);
  border-radius: 7px;
  color: var(--cg-ink);
  background: #fff;
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
}

.payout-feedback-field small {
  color: var(--cg-mute);
  font-size: 11.5px;
  line-height: 1.35;
}

.payouts-preview-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.payout-slot-card {
  gap: 0;
  padding: 0;
}

.payout-slot-main {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(230px, 0.8fr) minmax(92px, auto);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px 12px;
}

.payout-slot-copy {
  min-width: 0;
}

.payout-slot-copy strong,
.payout-slot-copy small,
.payout-slot-eyebrow {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payout-staff-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.payout-staff-select {
  width: 100%;
  min-width: 0;
}

.payout-slot-total {
  min-width: 92px;
}

.payout-slot-edit {
  display: grid;
  grid-template-columns: auto minmax(86px, 0.35fr) minmax(210px, 1fr) auto auto;
  gap: 8px;
  align-items: end;
  min-width: 0;
  padding: 8px 12px 10px;
  border-top: 1px solid var(--cg-line-3);
  background: rgba(255, 255, 255, 0.54);
}

.payout-slot-edit .button {
  min-height: 32px;
}

.payout-driver-money {
  max-width: 110px;
}

.payout-adjustment {
  min-width: 0;
  align-self: stretch;
  border: 1px solid var(--cg-line-2);
  border-radius: 7px;
  background: var(--cg-surface);
}

.payout-adjustment summary {
  min-height: 32px;
  padding: 8px 10px;
  color: var(--cg-ink-3);
  cursor: pointer;
  list-style-position: inside;
}

.payout-adjustment[open] {
  grid-column: 1 / -1;
}

.payout-adjustment-fields {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(100px, 0.35fr);
  gap: 8px;
  padding: 0 10px 10px;
}

.payout-selected-position {
  grid-column: 1 / -1;
  padding-top: 2px;
}

.payout-slot-note {
  padding: 0 12px 10px;
  color: var(--cg-clay);
  font-size: 12px;
}

.payout-role-stack {
  display: grid;
  gap: 8px;
}

.payout-role-row {
  display: grid;
  grid-template-columns: minmax(160px, 0.55fr) minmax(280px, 1fr) minmax(96px, auto);
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  background: var(--cg-surface);
}

.payout-role-row.is-missing {
  border-color: var(--cg-yellow-line);
  background: var(--cg-yellow-panel);
}

.payout-role-head,
.payout-role-total {
  min-width: 0;
}

.payout-role-head strong,
.payout-role-head small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payout-role-head strong {
  color: var(--cg-ink);
  font-size: 13.5px;
  font-weight: 700;
}

.payout-role-head small {
  margin-top: 2px;
  color: var(--cg-mute);
  font-size: 11.5px;
}

.payout-role-warning {
  color: var(--cg-yellow-ink) !important;
}

.payout-role-count {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 6px;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  color: var(--cg-teal-900);
  background: var(--cg-teal-100);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  font-weight: 600;
}

.payout-role-row.is-missing .payout-role-count,
.payout-role-row.is-overflow .payout-role-count {
  color: var(--cg-yellow-ink);
  background: var(--cg-yellow-bg);
}

.payout-role-people {
  display: flex;
  gap: 7px;
  min-width: 0;
  flex-wrap: wrap;
}

.payout-person-pill {
  display: inline-flex;
  align-items: stretch;
  min-width: 112px;
  min-height: 38px;
  overflow: hidden;
  border: 1px solid var(--cg-line-2);
  border-radius: 8px;
  color: var(--cg-ink-3);
  background: var(--cg-surface);
  text-align: left;
}

button.payout-person-pill {
  display: inline-grid;
  align-content: center;
  padding: 5px 10px;
}

.payout-person-pill strong,
.payout-person-pill small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payout-person-pill strong {
  font-size: 13px;
  font-weight: 600;
}

.payout-person-pill small {
  margin-top: 1px;
  color: var(--cg-mute);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
}

.payout-person-pill.is-selected {
  border-color: var(--cg-teal-900);
  background: var(--cg-teal-900);
}

.payout-person-pill.is-selected strong {
  color: #fff;
}

.payout-person-pill.is-selected small {
  color: #9dbdc8;
}

.payout-person-pill.has-extra small,
.payout-person-pill.has-extra .payout-person-tail {
  color: var(--cg-yellow);
}

.payout-person-main {
  display: grid;
  align-content: center;
  min-width: 102px;
  padding: 5px 10px;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.payout-person-main:disabled {
  cursor: default;
}

.payout-person-tail {
  width: 30px;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  background: transparent;
  font-size: 18px;
  font-weight: 600;
}

.payout-person-pill.is-dashed {
  border-style: dashed;
  color: var(--cg-ink-3);
}

.payout-person-pill.is-once {
  border-color: var(--cg-yellow-line);
  color: var(--cg-yellow-ink);
  background: var(--cg-yellow-bg);
}

.payout-role-total {
  text-align: right;
}

.payout-role-total strong,
.payout-role-total span,
.payout-person-modal-total strong,
.payout-person-modal-total span {
  display: block;
  font-family: "IBM Plex Mono", monospace;
}

.payout-role-total strong,
.payout-person-modal-total strong {
  color: var(--cg-ink);
  font-size: 16px;
  font-weight: 700;
}

.payout-role-total span,
.payout-person-modal-total span {
  margin-top: 2px;
  color: var(--cg-mute);
  font-size: 11px;
}

.payout-person-modal {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  gap: 12px;
}

.payout-person-body,
.payout-person-section {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.payout-extra-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 88px 34px;
  gap: 7px;
  align-items: center;
}

.payout-extra-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.payout-person-label,
.payout-person-extra-total {
  color: var(--cg-mute);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.payout-person-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.team-settings-modal,
.payouts-wizard-modal {
  gap: 12px;
}

.team-settings-summary,
.payout-wizard-steps {
  display: grid;
  gap: 8px;
}

.team-settings-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.team-settings-summary > div {
  display: grid;
  gap: 3px;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  background: var(--cg-panel);
}

.team-settings-summary span,
.payout-wizard-step small,
.payout-step-head span,
.payout-attachment-note,
.payout-manual-meta span {
  color: var(--cg-mute);
}

.team-settings-summary span,
.payout-wizard-step span,
.payout-step-head span {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.team-settings-summary strong {
  color: var(--cg-ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 18px;
  font-weight: 650;
}

.team-settings-summary .is-danger {
  border-color: #e7c5be;
  background: #fbf0ee;
}

.team-settings-summary .is-ok {
  border-color: var(--cg-teal-200);
  background: var(--cg-teal-100);
}

.payout-wizard-steps {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.payout-wizard-step {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 2px 8px;
  align-items: center;
  min-height: 56px;
  padding: 8px 10px;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  color: var(--cg-ink);
  background: var(--cg-surface);
  text-align: left;
}

.payout-wizard-step span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: var(--cg-teal-900);
  background: var(--cg-teal-100);
}

.payout-wizard-step strong {
  overflow: hidden;
  color: var(--cg-ink);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payout-wizard-step small {
  grid-column: 2;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payout-wizard-step.is-active {
  border-color: var(--cg-teal-900);
  background: var(--cg-teal-900);
}

.payout-wizard-step.is-active span {
  color: var(--cg-teal-900);
  background: var(--cg-yellow);
}

.payout-wizard-step.is-active strong,
.payout-wizard-step.is-active small {
  color: #fff;
}

.payout-wizard-body,
.payout-step-grid,
.payout-step-panel,
.payout-form-stack {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.payout-step-grid {
  grid-template-columns: minmax(0, 1fr);
}

.payout-step-panel {
  padding: 12px 14px;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  background: var(--cg-surface);
}

.payout-step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.payout-step-head h3 {
  margin: 0;
  color: var(--cg-ink);
  font-size: 16px;
  font-weight: 600;
}

.payout-step-head span {
  display: block;
  margin-top: 3px;
}

.payout-form-row,
.payout-manual-main {
  display: grid;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.payout-form-row {
  grid-template-columns: 150px 110px 94px minmax(150px, 1fr) minmax(120px, 0.6fr) 34px;
}

.payout-form-row.is-debt {
  border-left: 3px solid var(--cg-clay);
  padding-left: 8px;
}

.payout-manual-row {
  display: grid;
  gap: 7px;
  padding: 9px;
  border: 1px solid var(--cg-line-2);
  border-radius: 8px;
  background: var(--cg-panel);
}

.payout-manual-main {
  grid-template-columns: minmax(190px, 1.1fr) minmax(94px, 0.35fr) minmax(150px, 0.8fr) minmax(140px, 0.7fr) 34px;
}

.payout-manual-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  color: var(--cg-mute);
  font-size: 11.5px;
}

.payout-manual-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payout-manual-meta strong {
  flex: 0 0 auto;
  color: var(--cg-ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 600;
}

.payout-attachment-note {
  padding: 10px 12px;
  border: 1px dashed var(--cg-line-2);
  border-radius: 8px;
  background: var(--cg-panel);
  font-size: 12px;
  line-height: 1.4;
}

.payout-attachments {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  background: #fff;
}

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

.payout-attachments-head h4 {
  margin: 0;
  color: var(--cg-ink);
  font-size: 14px;
  font-weight: 650;
}

.payout-attachments-head span {
  display: block;
  margin-top: 2px;
  color: var(--cg-mute);
  font-size: 12px;
}

.payout-upload-button {
  cursor: pointer;
  white-space: nowrap;
}

.payout-attachment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
}

.payout-attachment-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 34px;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 7px;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  background: var(--cg-panel);
}

.payout-attachment-card img {
  width: 54px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
  background: #eef3f4;
}

.payout-attachment-card strong,
.payout-attachment-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payout-attachment-card strong {
  color: var(--cg-ink);
  font-size: 12px;
  font-weight: 600;
}

.payout-attachment-card span {
  color: var(--cg-mute);
  font-size: 11px;
}

.payout-summary-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(360px, 1fr);
  gap: 12px;
  align-items: start;
}

.payout-wizard-footer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding-top: 2px;
}

.payout-wizard-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

/* Payout wizard fit pass, 2026-08-05. The wizard must behave like a
   compact work dialog even inside Telegram/WebView-sized windows. */
.payouts-wizard-modal {
  width: min(860px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  min-width: 0;
  overflow-x: hidden;
}

.payouts-wizard-modal .modal-head,
.payouts-wizard-modal .modal-head > div,
.payout-wizard-body,
.payout-step-panel,
.payout-summary-layout,
.payouts-preview,
.payouts-preview-text,
.payout-feedback-field,
.payout-feedback-field textarea {
  min-width: 0;
}

.payouts-wizard-modal .modal-head h2 {
  font-size: 17px;
  font-weight: 600;
}

.payouts-wizard-modal .modal-copy {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payouts-wizard-modal .payout-wizard-steps {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.payouts-wizard-modal .payout-wizard-step {
  min-height: 50px;
}

.payouts-wizard-modal .payout-wizard-step strong {
  font-weight: 600;
}

.payouts-wizard-modal .payouts-summary-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.payouts-wizard-modal .payouts-summary-strip .is-danger {
  grid-column: auto;
}

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

.payouts-control-row {
  grid-template-columns: minmax(0, 1fr) minmax(112px, 136px);
}

.payout-status-panel {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}

.payout-status-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
}

.payout-status-button {
  min-width: 0;
  padding: 0 8px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.payouts-preview-text {
  width: 100%;
}

@media (max-width: 980px) {
  .payouts-wizard-modal {
    width: calc(100vw - 24px);
    padding: 14px;
  }

  .payouts-wizard-modal .payout-wizard-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .payouts-wizard-modal .payouts-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .payouts-wizard-modal .payouts-summary-strip .is-danger {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .payouts-wizard-modal {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    padding: 12px;
    border-radius: 14px;
  }

  .payouts-wizard-modal .modal-head {
    align-items: stretch;
    flex-direction: column;
  }

  .payouts-wizard-modal .modal-copy {
    white-space: normal;
  }

  .payouts-wizard-modal .payout-wizard-steps,
  .payouts-wizard-modal .payouts-summary-strip,
  .payouts-control-row {
    grid-template-columns: 1fr;
  }

  .payout-wizard-footer {
    grid-template-columns: 1fr;
  }

  .payout-wizard-footer > div:empty {
    display: none;
  }

  .payout-wizard-footer > .button,
  .payout-wizard-actions,
  .payout-wizard-actions .button,
  .payouts-preview-actions .button {
    width: 100%;
  }
}

@media (max-width: 760px) {
  body[data-view="estimate"] .payouts-modal {
    width: 100%;
    max-height: calc(100vh - 20px);
  }

  .payouts-control-row,
  .payout-status-panel,
  .payout-slot-main,
  .payout-slot-edit,
  .payout-role-row,
  .payout-extra-row,
  .payout-wizard-steps,
  .team-settings-summary,
  .payout-summary-layout,
  .payout-form-row,
  .payout-manual-main,
  .payout-person-actions,
  .payout-adjustment-fields {
    grid-template-columns: 1fr;
  }

  .payout-status-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .payout-status-button {
    padding: 0 6px;
  }

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

  .payout-slot-total {
    min-width: 0;
    text-align: left;
  }

  .payout-driver-money {
    max-width: none;
  }

  .payout-role-total {
    text-align: left;
  }

  .payout-role-people {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .payout-person-pill {
    min-width: 0;
    width: 100%;
  }

  .payout-attachments-head {
    align-items: stretch;
    flex-direction: column;
  }

  .payout-upload-button {
    justify-content: center;
    width: 100%;
  }

  .payout-wizard-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }
}

@media (max-width: 520px) {
  .payouts-summary-strip {
    grid-template-columns: 1fr;
  }

  .payout-attachment-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  body[data-view="estimate"] .project-workflow-card {
    padding: 12px;
  }

  body[data-view="estimate"] .project-workflow-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-view="estimate"] .project-workflow-head h2 {
    font-size: 20px;
  }

  body[data-view="estimate"] .project-workflow-step {
    min-height: 52px;
  }
}

/* One visual language for selected tabs and the keyboard cursor. */
.modal-panel.cloud-modal .cloud-tab.is-active,
.modal-panel.cloud-modal .cloud-admin-owner-tab.is-active {
  min-height: 34px;
  margin: 5px 0;
  padding: 0 10px;
  border: 1px solid #13394a;
  border-radius: 6px;
  color: #fff;
  background: #13394a;
}

.modal-panel.cloud-modal .cloud-admin-owner-tab.is-active::after {
  display: none;
}

.modal-panel.cloud-modal .cloud-tab.is-active b,
.modal-panel.cloud-modal .cloud-admin-owner-tab.is-active b {
  border-color: rgba(255, 255, 255, 0.28);
  color: #13394a;
  background: rgba(255, 255, 255, 0.9);
}

.modal-panel.cloud-modal [data-cloud-keyboard-nav].is-keyboard-active {
  border-color: #13394a !important;
  color: #fff !important;
  background: #13394a !important;
  outline: none !important;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.62) !important;
}

.modal-panel.cloud-modal [data-cloud-keyboard-nav].is-keyboard-active .project-action-icon,
.modal-panel.cloud-modal [data-cloud-keyboard-nav].is-keyboard-active span,
.modal-panel.cloud-modal [data-cloud-keyboard-nav].is-keyboard-active strong,
.modal-panel.cloud-modal [data-cloud-keyboard-nav].is-keyboard-active small,
.modal-panel.cloud-modal [data-cloud-keyboard-nav].is-keyboard-active em,
.modal-panel.cloud-modal [data-cloud-keyboard-nav].is-keyboard-active s {
  color: inherit !important;
}

.modal-panel.cloud-modal [data-cloud-keyboard-nav].is-keyboard-active small,
.modal-panel.cloud-modal [data-cloud-keyboard-nav].is-keyboard-active s {
  opacity: 0.72;
}

.modal-panel.cloud-modal [data-cloud-keyboard-nav].is-keyboard-active b,
.modal-panel.cloud-modal [data-cloud-keyboard-nav].is-keyboard-active .cloud-status-chip {
  border-color: rgba(255, 255, 255, 0.28) !important;
  color: #fff !important;
  background: rgba(255, 255, 255, 0.16) !important;
}

.modal-panel.cloud-modal .cloud-project-open.is-keyboard-active {
  border-radius: 6px;
}

/* Cloud admin overview polish: quieter metrics and distinct keyboard focus. */
.modal-panel.cloud-modal {
  --cloud-focus-ring: rgba(19, 57, 74, 0.16);
}

.modal-panel.cloud-modal .cloud-admin-overview {
  gap: 14px;
  padding: 14px 18px 18px;
  background: var(--cg-panel);
}

.modal-panel.cloud-modal .cloud-admin-owner-tabs {
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0;
  border: 0;
}

.modal-panel.cloud-modal .cloud-admin-owner-tab {
  min-height: 38px;
  margin: 0;
  padding: 0 9px 0 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--cg-ink-4);
  background: transparent;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.modal-panel.cloud-modal .cloud-admin-owner-tab:hover,
.modal-panel.cloud-modal .cloud-admin-owner-tab:focus-visible {
  border-color: var(--cg-line-2);
  color: var(--cg-ink);
  background: var(--cg-surface);
}

.modal-panel.cloud-modal .cloud-admin-owner-tab.is-active {
  min-height: 38px;
  margin: 0;
  border-color: var(--cg-teal-900);
  color: #fff;
  background: var(--cg-teal-900);
}

.modal-panel.cloud-modal .cloud-admin-owner-tab.is-active b {
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.modal-panel.cloud-modal .cloud-admin-owner-tab.is-keyboard-active:not(.is-active),
.modal-panel.cloud-modal .cloud-tab.is-keyboard-active:not(.is-active) {
  min-height: 34px;
  margin: 5px 0;
  padding: 0 10px;
  border: 1px solid var(--cg-teal-900) !important;
  border-radius: 6px;
  border-color: var(--cg-teal-900) !important;
  color: var(--cg-ink) !important;
  background: var(--cg-surface) !important;
  box-shadow: 0 0 0 3px var(--cloud-focus-ring) !important;
}

.modal-panel.cloud-modal .cloud-admin-owner-tab.is-keyboard-active:not(.is-active) {
  min-height: 38px;
  margin: 0;
  border-radius: 7px;
}

.modal-panel.cloud-modal .cloud-admin-owner-tab.is-keyboard-active:not(.is-active) b,
.modal-panel.cloud-modal .cloud-tab.is-keyboard-active:not(.is-active) b {
  border-color: var(--cg-line-2) !important;
  color: var(--cg-teal-900) !important;
  background: var(--cg-panel) !important;
}

.modal-panel.cloud-modal .cloud-admin-metrics {
  gap: 8px;
}

.modal-panel.cloud-modal .cloud-admin-metric {
  min-height: 76px;
  align-content: center;
  gap: 8px;
  padding: 13px 14px;
  border-color: var(--cg-line-2);
  border-radius: 8px;
  background: var(--cg-surface);
}

.modal-panel.cloud-modal .cloud-admin-metric span {
  color: var(--cg-mute);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.modal-panel.cloud-modal .cloud-admin-metric strong {
  color: var(--cg-ink);
  font-size: 24px;
  line-height: 1;
}

.modal-panel.cloud-modal .cloud-admin-metric.is-zero {
  border-color: var(--cg-line);
  background: var(--cg-panel);
}

.modal-panel.cloud-modal .cloud-admin-metric.is-zero span {
  color: var(--cg-mute);
}

.modal-panel.cloud-modal .cloud-admin-metric.is-action {
  border-color: var(--cg-yellow-line);
  background: var(--cg-yellow-panel);
}

.modal-panel.cloud-modal .cloud-admin-metric.is-ready {
  border-color: #cfe2d8;
  background: #edf6f1;
}

.modal-panel.cloud-modal .cloud-admin-metric.is-ready strong {
  color: #2f6b52;
}

.modal-panel.cloud-modal .cloud-admin-metric.is-danger {
  border-color: #ebd2cc;
  background: #fbedea;
}

.modal-panel.cloud-modal .cloud-admin-list {
  min-height: 220px;
  overflow: hidden auto;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--cg-surface);
}

.modal-panel.cloud-modal .cloud-admin-list .cloud-empty {
  min-height: 150px;
  border: 0;
  background: transparent;
}

@media (max-width: 720px) {
  .modal-panel.cloud-modal .cloud-admin-overview {
    gap: 10px;
    padding: 10px 12px 12px;
  }

  .modal-panel.cloud-modal .cloud-admin-owner-tabs {
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal-panel.cloud-modal .cloud-admin-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal-panel.cloud-modal .cloud-admin-metric {
    min-height: 68px;
    padding: 11px 12px;
  }

  .modal-panel.cloud-modal .cloud-admin-metric strong {
    font-size: 21px;
  }

  .modal-panel.cloud-modal .cloud-admin-list {
    min-height: 180px;
    padding: 0 12px;
  }
}

/* Project center: four real stages, one primary action. */
body[data-view="estimate"] .project-workflow-card {
  display: grid;
  gap: 0;
  overflow: visible;
  border: 1px solid #dae2e3;
  border-radius: 8px;
  padding: 0;
  background: #fff;
}

body[data-view="estimate"] .project-workflow-card.has-discount-flag {
  border-color: #f0e3a8;
  background: #fffcef;
}

body[data-view="estimate"] .project-workflow-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 14px 16px 10px;
}

body[data-view="estimate"] .project-workflow-heading {
  appearance: none;
  display: grid;
  gap: 3px;
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  font: inherit;
}

body[data-view="estimate"] button.project-workflow-heading {
  cursor: pointer;
}

body[data-view="estimate"] button.project-workflow-heading:focus-visible {
  border-radius: 4px;
  outline: 2px solid #13394a;
  outline-offset: 4px;
}

body[data-view="estimate"] .project-workflow-heading > span {
  color: #677579;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body[data-view="estimate"] .project-workflow-heading h2 {
  margin: 0;
  color: #101f24;
  font-size: 21px;
  font-weight: 750;
  line-height: 1.12;
}

body[data-view="estimate"] .project-workflow-heading p {
  margin: 0;
  max-width: 780px;
  color: #5e6d72;
  font-size: 12.5px;
  line-height: 1.4;
}

body[data-view="estimate"] .project-workflow-head-state {
  display: flex;
  align-items: center;
  gap: 9px;
}

body[data-view="estimate"] .project-workflow-flag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid #dae2e3;
  border-radius: 5px;
  padding: 0 9px;
  color: #324348;
  background: #f7f9f9;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

body[data-view="estimate"] .project-workflow-flag.is-discount {
  border-color: #f0e3a8;
  color: #7a5d00;
  background: #fff4bd;
}

body[data-view="estimate"] .project-workflow-toggle-mark {
  width: 9px;
  height: 9px;
  border-right: 2px solid #677579;
  border-bottom: 2px solid #677579;
  transform: rotate(225deg) translate(-1px, -1px);
}

body[data-view="estimate"] .project-workflow-card.is-collapsed .project-workflow-toggle-mark {
  transform: rotate(45deg) translate(-1px, -1px);
}

body[data-view="estimate"] .project-workflow-steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 7px 0 14px;
}

body[data-view="estimate"] .project-workflow-steps::before,
body[data-view="estimate"] .project-workflow-steps::after {
  content: "";
  position: absolute;
  top: 12px;
  left: 12.5%;
  height: 2px;
}

body[data-view="estimate"] .project-workflow-steps::before {
  right: 12.5%;
  background: #dae2e3;
}

body[data-view="estimate"] .project-workflow-steps::after {
  width: var(--workflow-progress);
  background: #13394a;
}

body[data-view="estimate"] .project-workflow-step {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 0 4px;
  color: #95a1a5;
  background: transparent;
  text-align: center;
}

body[data-view="estimate"] .project-workflow-step > span {
  display: block;
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #c5cecf;
  box-shadow: 0 0 0 1px #c5cecf;
}

body[data-view="estimate"] .project-workflow-step strong {
  color: inherit;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.18;
  overflow-wrap: normal;
}

body[data-view="estimate"] .project-workflow-step.is-done {
  color: #5e6d72;
  background: transparent;
}

body[data-view="estimate"] .project-workflow-step.is-done > span {
  background: #13394a;
  box-shadow: 0 0 0 1px #13394a;
}

body[data-view="estimate"] .project-workflow-step.is-current {
  color: #101f24;
  background: transparent;
  box-shadow: none;
}

body[data-view="estimate"] .project-workflow-step.is-current > span {
  width: 12px;
  height: 12px;
  margin-top: -1px;
  background: #13394a;
  box-shadow: 0 0 0 2px #13394a;
}

body[data-view="estimate"] .project-workflow-stage-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 0 16px 12px;
}

body[data-view="estimate"] .project-workflow-stage-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border-radius: 6px;
  padding: 0 12px;
  font-size: 11.5px;
  font-weight: 700;
}

body[data-view="estimate"] .project-workflow-stage-button.is-previous {
  justify-self: start;
}

body[data-view="estimate"] .project-workflow-stage-button.is-next {
  justify-self: end;
  border-color: #13394a;
  color: #fff;
  background: #13394a;
}

body[data-view="estimate"] .project-workflow-turn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px 12px;
}

body[data-view="estimate"] .project-workflow-turn > span {
  color: #677579;
  font-size: 11px;
  font-weight: 650;
}

body[data-view="estimate"] .project-workflow-turn > div {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #dae2e3;
  border-radius: 6px;
  background: #f7f9f9;
}

body[data-view="estimate"] .project-workflow-turn button {
  min-width: 88px;
  min-height: 32px;
  border: 0;
  padding: 0 12px;
  color: #5e6d72;
  background: transparent;
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
}

body[data-view="estimate"] .project-workflow-turn button + button {
  border-left: 1px solid #dae2e3;
}

body[data-view="estimate"] .project-workflow-turn button.is-active {
  color: #fff;
  background: #13394a;
}

body[data-view="estimate"] .project-workflow-turn button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

body[data-view="estimate"] .project-workflow-next {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border: 0;
  border-top: 1px solid #e7ecec;
  border-radius: 0;
  padding: 12px 16px;
  background: #f7f9f9;
}

body[data-view="estimate"] .project-workflow-next-copy {
  display: grid;
  gap: 2px;
}

body[data-view="estimate"] .project-workflow-next-copy > span {
  color: #677579;
  font-family: "IBM Plex Mono", monospace;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body[data-view="estimate"] .project-workflow-next-copy > strong {
  color: #101f24;
  font-size: 15px;
  font-weight: 750;
}

body[data-view="estimate"] .project-workflow-next-copy > p {
  margin: 0;
  color: #677579;
  font-size: 11.5px;
  line-height: 1.35;
}

body[data-view="estimate"] .project-workflow-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  max-width: none;
}

body[data-view="estimate"] .project-workflow-actions > .button {
  min-height: 40px;
  border-radius: 6px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 700;
}

body[data-view="estimate"] .project-workflow-actions > .button.primary {
  border-color: #13394a;
  color: #fff;
  background: #13394a;
}

body[data-view="estimate"] .project-workflow-actions .button span {
  color: inherit;
}

body[data-view="estimate"] .project-workflow-menu {
  position: relative;
}

body[data-view="estimate"] .project-workflow-menu summary {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid #dae2e3;
  border-radius: 6px;
  color: #324348;
  background: #fff;
  font-size: 18px;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}

body[data-view="estimate"] .project-workflow-menu summary::-webkit-details-marker {
  display: none;
}

body[data-view="estimate"] .project-workflow-menu[open] summary {
  border-color: #13394a;
  color: #fff;
  background: #13394a;
}

body[data-view="estimate"] .project-workflow-menu > div {
  position: absolute;
  z-index: 20;
  top: 46px;
  right: 0;
  display: grid;
  width: 220px;
  overflow: hidden;
  border: 1px solid #dae2e3;
  border-radius: 7px;
  padding: 5px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(16, 31, 36, 0.16);
}

body[data-view="estimate"] .project-workflow-menu .button {
  justify-content: flex-start;
  min-height: 38px;
  border: 0;
  border-radius: 4px;
  padding: 0 10px;
  background: transparent;
  text-align: left;
}

body[data-view="estimate"] .project-workflow-menu .button:hover,
body[data-view="estimate"] .project-workflow-menu .button:focus-visible {
  color: #101f24;
  background: #f1f4f5;
}

body[data-view="estimate"] .project-workflow-crm {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border-top: 1px solid #e7ecec;
  padding: 0 16px;
  color: #677579;
  background: #fff;
  font-size: 10.5px;
  font-weight: 600;
}

body[data-view="estimate"] .project-workflow-crm > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #95a1a5;
}

body[data-view="estimate"] .project-workflow-crm.is-ok > span {
  background: #2f7b65;
}

body[data-view="estimate"] .project-workflow-crm.is-warning {
  color: #7a5d00;
}

body[data-view="estimate"] .project-workflow-crm.is-warning > span {
  background: #d4aa21;
}

body[data-view="estimate"] .project-workflow-card.is-collapsed {
  grid-template-columns: minmax(150px, auto) minmax(300px, 1fr) auto;
  align-items: center;
}

body[data-view="estimate"] .project-workflow-card.is-collapsed .project-workflow-head {
  padding: 10px 14px;
}

body[data-view="estimate"] .project-workflow-card.is-collapsed .project-workflow-heading > span,
body[data-view="estimate"] .project-workflow-card.is-collapsed .project-workflow-heading p,
body[data-view="estimate"] .project-workflow-card.is-collapsed .project-workflow-turn,
body[data-view="estimate"] .project-workflow-card.is-collapsed .project-workflow-stage-nav,
body[data-view="estimate"] .project-workflow-card.is-collapsed .project-workflow-crm,
body[data-view="estimate"] .project-workflow-card.is-collapsed .project-workflow-next-copy {
  display: none;
}

body[data-view="estimate"] .project-workflow-card.is-collapsed .project-workflow-heading h2 {
  font-size: 16px;
}

body[data-view="estimate"] .project-workflow-card.is-collapsed .project-workflow-steps {
  padding: 10px 0;
}

body[data-view="estimate"] .project-workflow-card.is-collapsed .project-workflow-steps::before,
body[data-view="estimate"] .project-workflow-card.is-collapsed .project-workflow-steps::after {
  top: 15px;
}

body[data-view="estimate"] .project-workflow-card.is-collapsed .project-workflow-next {
  display: block;
  border: 0;
  padding: 8px 12px;
  background: transparent;
}

body[data-view="estimate"] .desk-content.is-closed-estimate :is(button, input, textarea, select, [contenteditable="true"], label) {
  cursor: not-allowed;
}

.closed-estimate-lock-modal {
  max-width: 560px;
}

.closed-estimate-lock-modal .modal-copy {
  max-width: 46ch;
}

.crm-lead-confirm-modal {
  max-width: 590px;
}

.crm-lead-confirm-note {
  margin: 2px 0 18px;
  border-left: 3px solid #c89c24;
  padding: 10px 12px;
  color: #5f563b;
  background: #fff9e8;
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 760px) {
  body[data-view="estimate"] .project-workflow-head {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 12px 12px 9px;
  }

  body[data-view="estimate"] .project-workflow-heading h2 {
    font-size: 19px;
  }

  body[data-view="estimate"] .project-workflow-heading p {
    font-size: 12px;
  }

  body[data-view="estimate"] .project-workflow-steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 7px 0 13px;
  }

  body[data-view="estimate"] .project-workflow-step {
    min-height: 0;
    padding: 0 2px;
  }

  body[data-view="estimate"] .project-workflow-step strong {
    font-size: 9.5px;
  }

  body[data-view="estimate"] .project-workflow-stage-nav {
    gap: 8px;
    padding: 0 12px 11px;
  }

  body[data-view="estimate"] .project-workflow-stage-button {
    width: 100%;
    min-width: 0;
    padding: 0 10px;
  }

  body[data-view="estimate"] .project-workflow-stage-button.is-previous {
    justify-content: flex-start;
  }

  body[data-view="estimate"] .project-workflow-stage-button.is-next {
    justify-content: flex-end;
  }

  body[data-view="estimate"] .project-workflow-turn {
    display: grid;
    gap: 6px;
    padding: 0 12px 11px;
  }

  body[data-view="estimate"] .project-workflow-turn > div,
  body[data-view="estimate"] .project-workflow-turn button {
    width: 100%;
  }

  body[data-view="estimate"] .project-workflow-next {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 11px 12px;
  }

  body[data-view="estimate"] .project-workflow-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: stretch;
  }

  body[data-view="estimate"] .project-workflow-actions > .button.primary {
    flex: 1 1 180px;
    width: auto;
  }

  body[data-view="estimate"] .project-workflow-actions > .button:not(.primary) {
    flex: 1 1 140px;
    width: auto;
  }

  body[data-view="estimate"] .project-workflow-menu {
    flex: 0 0 40px;
  }

  body[data-view="estimate"] .project-workflow-crm {
    padding: 0 12px;
  }

  body[data-view="estimate"] .project-workflow-card.is-collapsed {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  body[data-view="estimate"] .project-workflow-card.is-collapsed .project-workflow-steps {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  body[data-view="estimate"] .project-workflow-card.is-collapsed .project-workflow-next {
    grid-column: 2;
    grid-row: 1;
  }
}
