:root {
  --bg: #f3efe8;
  --bg-deep: #e7e0d2;
  --surface: rgba(255, 252, 247, 0.82);
  --surface-strong: rgba(255, 252, 247, 0.96);
  --surface-contrast: #13232d;
  --text: #17242b;
  --muted: #62717a;
  --line: rgba(23, 36, 43, 0.11);
  --line-strong: rgba(23, 36, 43, 0.18);
  --accent: #b5662c;
  --accent-strong: #8f4b18;
  --teal: #1f5a63;
  --teal-soft: rgba(31, 90, 99, 0.1);
  --green: #2f6a4b;
  --green-soft: rgba(47, 106, 75, 0.12);
  --amber: #9d671b;
  --amber-soft: rgba(157, 103, 27, 0.12);
  --slate-soft: rgba(23, 36, 43, 0.06);
  --danger: #8b3b31;
  --danger-soft: rgba(139, 59, 49, 0.12);
  --shadow-lg: 0 24px 60px rgba(31, 40, 46, 0.12);
  --shadow-md: 0 16px 32px rgba(31, 40, 46, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --control-height: 48px;
}

.payroll-layout {
  align-items: start;
}

.payroll-batch-list {
  display: grid;
  gap: 12px;
}

.payroll-pipeline-grid {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
}

.payroll-pipeline-tile.active {
  transform: translateY(-1px);
}

.payroll-batch-card {
  width: 100%;
  text-align: left;
}

.payroll-detail-panel,
.payroll-batches-panel,
.payroll-import-mode-panel,
.payroll-workspace-panel,
.payroll-builder-panel {
  min-height: 100%;
}

.payroll-batch-fields {
  margin-bottom: 14px;
}

.payroll-active-batch-card,
.payroll-preview-panel {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
}

.payroll-active-batch-card {
  display: grid;
  gap: 4px;
}

.payroll-import-panel {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid var(--border-color, rgba(15, 23, 42, 0.12));
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.8);
}

.payroll-import-actions,
.payroll-import-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.payroll-date-selection {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.payroll-date-chip {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  text-align: left;
}

.payroll-date-chip.active {
  border-color: rgba(20, 83, 45, 0.32);
  background: rgba(220, 252, 231, 0.9);
}

.payroll-date-chip:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.payroll-date-chip.is-muted {
  opacity: 0.65;
}

.payroll-import-preview-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding-left: 20px;
}

.payroll-workspace-panel,
.payroll-builder-panel {
  margin-top: 18px;
}

.payroll-home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.payroll-builder-stepper {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.payroll-builder-stepper .step-button {
  min-height: 74px;
  padding: 14px 16px;
  border-radius: 12px;
}

.payroll-builder-stepper .step-button span,
.payroll-builder-stepper .step-button.complete span {
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  color: inherit;
}

.payroll-builder-stepper .step-button.active {
  border-color: rgba(31, 90, 99, 0.34);
  box-shadow: inset 0 -3px 0 var(--accent);
}

.payroll-builder-step-panel {
  display: grid;
  gap: 16px;
}

.payroll-source-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.payroll-secondary-work-sources {
  display: grid;
  gap: 14px;
  padding-top: 4px;
}

.payroll-candidate-list {
  display: grid;
  gap: 12px;
}

.payroll-candidate-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.payroll-custom-form {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
}

.payroll-builder-totals {
  margin-top: 0;
}

.payroll-payout-summary {
  margin-top: 10px;
}

.payroll-payout-crew-group {
  display: grid;
  gap: 8px;
}

.payroll-payout-crew-group h4 {
  margin: 0;
}

.payroll-job-list {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.payroll-crew-section {
  display: grid;
  gap: 12px;
}

.payroll-crew-section-header {
  padding: 12px 0 4px;
  border-bottom: 1px solid rgba(23, 36, 43, 0.1);
}

.payroll-crew-subtotal {
  min-width: min(100%, 260px);
}

.payroll-job-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
}

.payroll-metric-stack {
  margin-top: 12px;
}

.payroll-breakdown,
.payroll-history {
  margin-top: 16px;
}

.payroll-history-list {
  margin: 0;
  padding-left: 18px;
}

.payroll-history-list li {
  display: grid;
  gap: 2px;
  margin-bottom: 8px;
}

.payroll-payment-grid {
  margin-top: 14px;
}

.payroll-payment-entry {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.payroll-payment-entry:last-child {
  border-bottom: 0;
}

.payroll-payment-display,
.payroll-payment-edit {
  display: grid;
  gap: 8px;
}

.payroll-payment-actions {
  justify-content: flex-start;
  margin-top: 6px;
}

.payroll-adjust-panel {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(31, 90, 99, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.74);
}

.payroll-adjust-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.payroll-adjust-choice-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
}

.payroll-adjust-actions,
.payroll-builder-footer-actions {
  justify-content: flex-end;
}

.payroll-more-details {
  margin-top: 12px;
}

.payroll-line-editor-panel {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(31, 90, 99, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.74);
}

.payroll-line-editor-list {
  display: grid;
  gap: 10px;
}

.payroll-line-editor-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 180px) auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.68);
}

.payroll-line-editor-row small {
  display: block;
  color: var(--muted);
}

.payroll-line-editor-actions {
  justify-content: flex-end;
}

.payroll-pay-selection-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 8px;
  align-items: end;
  width: min(260px, 100%);
}

.payroll-pay-selection-row label {
  display: grid;
  gap: 4px;
}

.payroll-pay-selection-row span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.payroll-workspace-panel .record-actions,
.payroll-builder-panel .record-actions {
  gap: 8px;
}

.payroll-workspace-panel .button,
.payroll-builder-panel .button {
  border-width: 1px;
}

.payroll-workspace-primary-action {
  background: var(--accent);
  border-color: var(--accent-strong);
  color: #fff;
}

.payroll-workspace-success-action {
  background: var(--green);
  border-color: rgba(47, 106, 75, 0.55);
  color: #fff;
}

.payroll-workspace-secondary-action {
  border-color: rgba(31, 90, 99, 0.28);
  background: var(--teal-soft);
  color: var(--teal);
}

.payroll-workspace-warning-action {
  border-color: rgba(157, 103, 27, 0.34);
  background: var(--amber-soft);
  color: var(--amber);
}

.payroll-workspace-danger-action {
  border-color: rgba(139, 59, 49, 0.34);
  background: var(--danger-soft);
  color: var(--danger);
}

.detail-payroll-history-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.payroll-history-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(23, 36, 43, 0.1);
  background: rgba(255, 255, 255, 0.58);
}

.compact-empty {
  padding: 14px;
  margin-top: 12px;
}

@media (max-width: 900px) {
  .payroll-job-card {
    grid-template-columns: 1fr;
  }

  .payroll-line-editor-row {
    grid-template-columns: 1fr;
  }

  .payroll-import-actions,
  .payroll-import-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(181, 102, 44, 0.18), transparent 30%),
    radial-gradient(circle at right 10% top 10%, rgba(31, 90, 99, 0.2), transparent 24%),
    linear-gradient(180deg, #faf6ef 0%, #ede5d8 48%, #f5f0e8 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.34), transparent 82%);
}

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

button {
  cursor: pointer;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(2.4rem, 4vw, 4rem);
  line-height: 0.96;
}

h2 {
  font-size: clamp(1.45rem, 2.2vw, 2.1rem);
  line-height: 1.04;
}

h3 {
  font-size: 1.08rem;
}

p {
  margin: 0;
}

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

.app-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
}

.topbar,
.surface-panel,
.proposal-card,
.summary-card,
.storage-badge,
.detail-toolbar,
.builder-footer {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
}

.topbar,
.surface-panel,
.proposal-card,
.summary-card,
.detail-toolbar,
.builder-footer {
  border-radius: var(--radius-xl);
}

.topbar {
  position: sticky;
  top: 16px;
  z-index: 10;
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.brand-button,
.nav-link,
.crumb-button,
.status-button,
.filter-chip,
.step-button,
.pipeline-tile,
.record-card button {
  appearance: none;
  border: 0;
  background: transparent;
}

.brand-button {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 0;
  text-align: left;
  color: var(--text);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--surface-contrast), #29404d);
  color: #fff7ee;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand-button strong,
.brand-button small {
  display: block;
}

.brand-button small {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.environment-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--slate-soft);
  color: var(--text);
}

.environment-badge[data-environment="LIVE"] {
  background: var(--green-soft);
  border-color: rgba(47, 106, 75, 0.2);
  color: var(--green);
}

.environment-badge[data-environment="TEST"] {
  background: var(--danger-soft);
  border-color: rgba(139, 59, 49, 0.22);
  color: var(--danger);
}

.environment-mode-warning {
  margin: 0;
  padding: 10px 18px;
  background: var(--danger);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
}

.environment-mode-warning[hidden] {
  display: none;
}

.topnav,
.topbar-actions,
.hero-actions,
.dashboard-primary-actions,
.topbar-end,
.detail-button-row,
.detail-action-cluster,
.panel-controls,
.chip-row,
.tab-strip,
.detail-toolbar-actions,
.footer-actions,
.launchpad-actions,
.pill-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.topnav {
  justify-content: center;
}

.topbar-end {
  justify-content: flex-end;
  align-self: stretch;
  gap: 10px;
}

.header-search {
  width: 100%;
  min-width: 0;
  max-width: 620px;
  align-self: stretch;
  justify-self: center;
}

.nav-link {
  padding: 11px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--muted);
  font-weight: 700;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.nav-link:hover,
.button:hover,
.tab-button:hover,
.step-button:hover,
.filter-chip:hover,
.pipeline-tile:hover,
.crumb-button:hover,
.status-button:hover {
  transform: translateY(-1px);
}

.nav-link.active {
  background: rgba(31, 90, 99, 0.14);
  color: var(--teal);
  border-color: rgba(31, 90, 99, 0.22);
  box-shadow: inset 0 0 0 1px rgba(31, 90, 99, 0.06);
}

.nav-link:hover,
.nav-link:focus-visible {
  background: rgba(31, 90, 99, 0.08);
  border-color: rgba(31, 90, 99, 0.12);
}

.storage-badge {
  padding: 12px 14px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  border-radius: 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

.button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 800;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
  box-shadow: none;
}

.button[data-photo-import-status="missing-key"] {
  box-shadow: inset 0 0 0 1px rgba(157, 103, 27, 0.28), 0 14px 28px rgba(31, 90, 99, 0.16);
}

.button.primary {
  background: linear-gradient(135deg, var(--accent) 0%, #cb7b38 100%);
  color: #fff8f2;
  box-shadow: 0 14px 28px rgba(181, 102, 44, 0.22);
}

.button.secondary {
  background: linear-gradient(135deg, var(--teal) 0%, #2a7280 100%);
  color: #f3fbfb;
  box-shadow: 0 14px 28px rgba(31, 90, 99, 0.2);
}

.button.ghost {
  background: rgba(255, 255, 255, 0.48);
  color: var(--text);
  border: 1px solid var(--line);
}

.button.primary:hover,
.button.primary:focus-visible {
  box-shadow: 0 16px 30px rgba(181, 102, 44, 0.26);
}

.button.secondary:hover,
.button.secondary:focus-visible {
  box-shadow: 0 16px 30px rgba(31, 90, 99, 0.24);
}

.button.ghost:hover,
.button.ghost:focus-visible {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(23, 36, 43, 0.16);
  box-shadow: 0 10px 20px rgba(23, 36, 43, 0.06);
}

.view-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.view {
  display: none;
  flex-direction: column;
  gap: 20px;
  animation: view-rise 220ms ease;
}

.view.active {
  display: flex;
}

@keyframes view-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.view-hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
  padding: 10px 4px 0;
}

.hero-copy,
.section-heading {
  display: grid;
  gap: 6px;
}

.subsection-heading {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid rgba(23, 36, 43, 0.08);
}

.subsection-heading h3,
.subsection-heading p {
  margin: 0;
}

.advanced-options {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(23, 36, 43, 0.08);
}

.advanced-options summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
  color: var(--text);
  font-weight: 800;
  list-style: none;
  cursor: pointer;
}

.advanced-options summary::-webkit-details-marker {
  display: none;
}

.advanced-options summary::after {
  content: "+";
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--teal);
  background: rgba(255, 255, 255, 0.64);
}

.advanced-options[open] summary::after {
  content: "-";
}

.advanced-options summary:focus-visible {
  outline: 3px solid rgba(31, 90, 99, 0.22);
  outline-offset: 4px;
  border-radius: 8px;
}

.advanced-options .subsection-heading:first-of-type {
  margin-top: 12px;
  padding-top: 0;
  border-top: 0;
}

.hero-text,
.muted,
.review-card p,
.summary-card small,
.path-step p,
.proposal-total span,
.metric-row span,
.activity-item time,
.empty-state p,
.draft-label {
  color: var(--muted);
}

.eyebrow {
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

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

.schedule-summary-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.schedule-summary-strip.has-crew-filter {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.schedule-summary-strip .summary-card {
  padding: 18px 18px 16px;
  gap: 6px;
}

.schedule-summary-strip .summary-card strong {
  font-size: clamp(1.35rem, 2.3vw, 1.82rem);
}

.schedule-summary-strip .summary-card small {
  font-size: 0.81rem;
}

.schedule-summary-action {
  justify-self: start;
  margin-top: 4px;
  padding: 8px 12px;
  font-size: 0.82rem;
  line-height: 1.1;
}

.dashboard-hero,
.dashboard-advanced,
.pipeline-card {
  display: grid;
  gap: 20px;
}

.dashboard-hero,
.schedule-hero {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(242, 234, 221, 0.96)),
    var(--surface);
}

.dashboard-primary-actions {
  justify-content: flex-end;
}

.dashboard-action-stack {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.dashboard-utility-actions {
  display: flex;
  justify-content: flex-end;
}

.dashboard-utility-actions .button {
  padding: 9px 14px;
  font-size: 0.88rem;
}

.schedule-toolbar,
.schedule-toolbar-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.schedule-toolbar {
  justify-content: flex-end;
}

.schedule-week-block {
  min-width: 220px;
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(23, 36, 43, 0.08);
  display: grid;
  gap: 6px;
}

.schedule-week-block strong {
  font-size: 1.2rem;
  line-height: 1.1;
}

.schedule-crew-filter-card {
  justify-items: stretch;
}

.schedule-crew-filter-control {
  width: 100%;
  max-width: 100%;
}

.schedule-crew-filter-control select {
  width: 100%;
  min-width: 0;
  font-weight: 800;
}

.schedule-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
  gap: 18px;
  align-items: start;
}

.schedule-grid {
  display: grid;
  grid-template-columns: repeat(var(--schedule-visible-day-count, 7), minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.schedule-grid-header {
  display: grid;
  gap: 6px;
}

.schedule-grid-title {
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.schedule-instruction {
  margin: 0;
  color: rgba(23, 36, 43, 0.78);
  font-size: 0.95rem;
  font-weight: 600;
}

.schedule-day {
  display: grid;
  gap: 12px;
  min-height: 194px;
  padding: 14px 12px 12px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(23, 36, 43, 0.08);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.schedule-day.current-week {
  background: rgba(247, 251, 250, 0.92);
  border-color: rgba(31, 90, 99, 0.14);
  box-shadow: inset 0 0 0 1px rgba(31, 90, 99, 0.03);
}

.schedule-day.today {
  border-color: rgba(31, 90, 99, 0.34);
  background: linear-gradient(180deg, rgba(228, 243, 241, 0.98), rgba(255, 255, 255, 0.96));
  box-shadow: 0 12px 24px rgba(31, 90, 99, 0.08);
}

.schedule-day.active {
  border-width: 2px;
  border-color: rgba(31, 90, 99, 0.65);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 0 0 1px rgba(31, 90, 99, 0.14), 0 16px 32px rgba(31, 90, 99, 0.12);
}

.schedule-day.today.active {
  background: linear-gradient(180deg, rgba(223, 240, 237, 0.98), rgba(255, 255, 255, 0.98));
  box-shadow: 0 0 0 1px rgba(31, 90, 99, 0.16), 0 18px 36px rgba(31, 90, 99, 0.16);
}

.schedule-day.drop-target {
  border-color: rgba(31, 90, 99, 0.52);
  background: linear-gradient(180deg, rgba(229, 243, 241, 0.98), rgba(255, 255, 255, 0.98));
  box-shadow: inset 0 0 0 1px rgba(31, 90, 99, 0.14), 0 16px 30px rgba(31, 90, 99, 0.12);
}

.schedule-day.active.drop-target {
  box-shadow: inset 0 0 0 1px rgba(31, 90, 99, 0.16), 0 18px 34px rgba(31, 90, 99, 0.14);
}

.schedule-day.today.drop-target {
  background: linear-gradient(180deg, rgba(220, 238, 235, 0.99), rgba(255, 255, 255, 0.99));
}

.schedule-day.outside-month {
  background: rgba(255, 255, 255, 0.32);
  border-color: rgba(23, 36, 43, 0.06);
}

.schedule-day.outside-month.current-week {
  background: rgba(248, 250, 250, 0.48);
  border-color: rgba(31, 90, 99, 0.08);
}

.schedule-day.outside-month.today {
  background: linear-gradient(180deg, rgba(235, 243, 241, 0.7), rgba(255, 255, 255, 0.42));
  border-color: rgba(31, 90, 99, 0.16);
}

.schedule-day.outside-month.drop-target {
  background: linear-gradient(180deg, rgba(232, 240, 238, 0.72), rgba(255, 255, 255, 0.5));
  border-color: rgba(31, 90, 99, 0.2);
}

.schedule-day-header {
  display: grid;
  gap: 6px;
}

.schedule-day-header h3 {
  font-size: 1rem;
}

.schedule-day-meta {
  min-height: 1.1rem;
  font-size: 0.82rem;
}

.schedule-day.outside-month .eyebrow,
.schedule-day.outside-month .muted,
.schedule-day.outside-month h3 {
  color: #7c878d;
}

.schedule-job-list,
.crew-sheet-jobs {
  display: grid;
  gap: 10px;
}

.schedule-job-list {
  min-width: 0;
  align-content: start;
  gap: 7px;
}

.schedule-job-card {
  appearance: none;
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-align: left;
  display: grid;
  gap: 4px;
  padding: 10px 11px 10px 12px;
  border-radius: 15px;
  border: 1px solid rgba(23, 36, 43, 0.08);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  overflow: hidden;
  box-shadow: 0 5px 12px rgba(23, 36, 43, 0.05);
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.schedule-job-card[data-schedule-card-tone="scheduled"] {
  border-color: rgba(31, 90, 99, 0.16);
  border-left: 4px solid rgba(31, 90, 99, 0.42);
  background: linear-gradient(180deg, rgba(242, 249, 248, 0.98), rgba(255, 255, 255, 0.97));
  box-shadow: 0 7px 16px rgba(31, 90, 99, 0.08);
}

.schedule-job-card.has-crew {
  border-left-color: var(--schedule-crew-color, rgba(31, 90, 99, 0.42));
}

.schedule-job-card.has-crew:hover,
.schedule-job-card.has-crew:focus-visible,
.schedule-day.active .schedule-job-card.has-crew {
  border-left-color: var(--schedule-crew-color, rgba(31, 90, 99, 0.56));
}

.schedule-crew-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 20px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(23, 36, 43, 0.06);
  border: 1px solid color-mix(in srgb, var(--schedule-crew-color, #1f5a63) 38%, transparent);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-job-card[draggable="true"] {
  cursor: grab;
}

.schedule-job-card[draggable="true"]:active,
.schedule-job-card.is-dragging {
  cursor: grabbing;
}

.schedule-job-card.is-dragging {
  opacity: 0.56;
  box-shadow: 0 8px 16px rgba(31, 90, 99, 0.1);
}

.schedule-job-card:hover,
.schedule-job-card:focus-visible {
  border-color: rgba(31, 90, 99, 0.24);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 18px rgba(31, 90, 99, 0.1);
}

.schedule-job-card[data-schedule-card-tone="scheduled"]:hover,
.schedule-job-card[data-schedule-card-tone="scheduled"]:focus-visible {
  border-color: rgba(31, 90, 99, 0.24);
  border-left-color: rgba(31, 90, 99, 0.56);
  background: linear-gradient(180deg, rgba(238, 247, 245, 0.99), rgba(255, 255, 255, 0.98));
  box-shadow: 0 11px 20px rgba(31, 90, 99, 0.1);
}

.schedule-day.active .schedule-job-card[data-schedule-card-tone="scheduled"] {
  border-color: rgba(31, 90, 99, 0.2);
  border-left-color: rgba(31, 90, 99, 0.48);
  background: linear-gradient(180deg, rgba(239, 247, 246, 0.99), rgba(255, 255, 255, 0.98));
  box-shadow: 0 8px 17px rgba(31, 90, 99, 0.09);
}

.schedule-day.today .schedule-job-card[data-schedule-card-tone="scheduled"] {
  background: linear-gradient(180deg, rgba(236, 247, 245, 0.99), rgba(255, 255, 255, 0.98));
}

.schedule-day.outside-month .schedule-job-card[data-schedule-card-tone="scheduled"] {
  border-color: rgba(31, 90, 99, 0.12);
  border-left-color: rgba(31, 90, 99, 0.28);
  background: linear-gradient(180deg, rgba(248, 251, 250, 0.94), rgba(255, 255, 255, 0.9));
  box-shadow: 0 5px 12px rgba(23, 36, 43, 0.04);
}

.schedule-job-title {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.24;
  letter-spacing: -0.01em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  white-space: normal;
  word-break: break-word;
}

.schedule-job-overflow {
  display: inline-flex;
  align-self: start;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(31, 90, 99, 0.12);
  background: rgba(31, 90, 99, 0.09);
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.schedule-day-empty {
  color: var(--muted);
}

.crew-sheet-panel {
  display: grid;
  gap: 18px;
}

.crew-sheet-panel-header {
  display: grid;
  gap: 12px;
}

.crew-sheet-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.crew-sheet-actions .button {
  padding: 9px 14px;
  font-size: 0.84rem;
}

.crew-sheet-job {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(23, 36, 43, 0.08);
}

.crew-sheet-job-header,
.crew-sheet-materials {
  display: grid;
  gap: 8px;
}

.crew-sheet-job-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.crew-sheet-crew-badge {
  font-size: 0.74rem;
}

.schedule-crew-assignment-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.schedule-crew-assignment-field span {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
}

.schedule-crew-assignment-field select {
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
}

.crew-sheet-assignment-field {
  grid-template-columns: minmax(120px, auto) minmax(180px, 1fr);
  align-items: center;
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(31, 90, 99, 0.18);
  border-radius: 8px;
  background: rgba(31, 90, 99, 0.07);
}

.crew-sheet-assignment-field span {
  color: var(--accent-strong);
}

.schedule-job-crew-select {
  justify-self: stretch;
}

.summary-card {
  padding: 22px;
  display: grid;
  gap: 8px;
}

.summary-card.accent {
  background:
    linear-gradient(135deg, rgba(31, 90, 99, 0.12), rgba(255, 252, 247, 0.94)),
    var(--surface);
}

.summary-label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.summary-card strong {
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  line-height: 1;
}

.surface-panel {
  padding: 24px;
}

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

.launchpad-card,
.pipeline-card {
  display: grid;
  gap: 20px;
}

.path-list {
  display: grid;
  gap: 14px;
}

.path-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(23, 36, 43, 0.08);
}

.path-step span,
.step-button span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(181, 102, 44, 0.12);
  color: var(--accent-strong);
  font-weight: 800;
}

.path-step strong,
.step-button strong,
.review-card h3,
.record-title,
.activity-item strong {
  display: block;
  margin-bottom: 4px;
}

.soft-pill,
.detail-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 800;
}

.soft-pill {
  background: rgba(23, 36, 43, 0.06);
  color: var(--text);
}

.pipeline-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.pipeline-tile {
  padding: 18px 16px;
  text-align: left;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(23, 36, 43, 0.1);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.pipeline-tile:hover,
.pipeline-tile:focus-visible {
  background: rgba(255, 255, 255, 0.74);
  border-color: rgba(31, 90, 99, 0.18);
  box-shadow: 0 12px 24px rgba(31, 90, 99, 0.08);
}

.pipeline-tile.active {
  background: linear-gradient(180deg, rgba(242, 249, 248, 0.96), rgba(255, 255, 255, 0.8));
  border-color: rgba(31, 90, 99, 0.28);
  box-shadow: inset 0 -2px 0 rgba(31, 90, 99, 0.32), 0 14px 28px rgba(31, 90, 99, 0.08);
}

.pipeline-tile strong,
.pipeline-tile span,
.pipeline-tile small {
  display: block;
}

.pipeline-tile strong {
  margin-bottom: 4px;
  font-size: 1.2rem;
}

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

.panel-controls {
  justify-content: flex-end;
  gap: 10px;
}

.search-field {
  display: flex;
  align-items: center;
  min-width: min(320px, 100%);
  min-height: var(--control-height);
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
}

.topbar .environment-badge,
.topbar .button {
  min-height: var(--control-height);
}

.topbar-end .button {
  white-space: nowrap;
}

.dashboard-advanced-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.dashboard-advanced .storage-badge {
  min-height: auto;
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
}

.search-field input:focus {
  outline: none;
}

.filter-chip {
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 800;
  color: var(--muted);
  background: rgba(23, 36, 43, 0.06);
  box-shadow: inset 0 0 0 1px rgba(23, 36, 43, 0.02);
  transition: background 180ms ease, color 180ms ease, transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.filter-chip:hover,
.filter-chip:focus-visible {
  background: rgba(31, 90, 99, 0.09);
  border-color: rgba(31, 90, 99, 0.12);
}

.filter-chip.active {
  background: rgba(31, 90, 99, 0.14);
  color: var(--teal);
  border-color: rgba(31, 90, 99, 0.24);
  box-shadow: inset 0 -2px 0 rgba(31, 90, 99, 0.36);
}

.proposal-list {
  display: grid;
  gap: 12px;
}

.record-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(23, 36, 43, 0.1);
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.record-card:hover,
.record-card:focus-within {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(23, 36, 43, 0.16);
  box-shadow: 0 12px 26px rgba(23, 36, 43, 0.08);
}

.record-card.record-card-in-filter-view {
  border-color: rgba(31, 90, 99, 0.18);
  background: linear-gradient(180deg, rgba(247, 251, 250, 0.96), rgba(255, 255, 255, 0.8));
}

.record-card.record-card-status-match,
.record-card.record-card-needs-scheduling {
  border-color: rgba(31, 90, 99, 0.28);
  box-shadow: 0 14px 28px rgba(31, 90, 99, 0.08);
}

.record-card.record-card-needs-scheduling {
  background: linear-gradient(180deg, rgba(249, 246, 239, 0.98), rgba(255, 255, 255, 0.86));
  border-color: rgba(157, 103, 27, 0.26);
}

.record-main,
.record-meta,
.record-stats,
.record-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.record-main {
  flex-direction: column;
  gap: 7px;
}

.record-meta {
  align-items: center;
  gap: 8px;
}

.record-title {
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: 1.28rem;
  line-height: 1.08;
}

.record-customer,
.record-address {
  color: var(--muted);
  line-height: 1.3;
}

.record-stats {
  margin-top: 2px;
}

.record-reminder {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 800;
}

.filter-helper-copy {
  max-width: 360px;
  font-size: 0.84rem;
  line-height: 1.35;
  text-align: right;
}

.detail-pill {
  background: rgba(23, 36, 43, 0.06);
  color: var(--text);
}

.status-pill[data-status="draft"],
.status-button[data-status-choice="draft"].active {
  background: rgba(23, 36, 43, 0.08);
  color: var(--text);
}

.status-pill[data-status="finalized"],
.status-button[data-status-choice="finalized"].active {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-pill[data-status="approved"],
.status-button[data-status-choice="approved"].active {
  background: var(--green-soft);
  color: var(--green);
}

.status-pill[data-status="needs_scheduling"] {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-pill[data-status="invoice"],
.status-button[data-status-choice="invoice"].active {
  background: rgba(31, 90, 99, 0.12);
  color: var(--teal);
}

.status-pill[data-status="completed"],
.status-button[data-status-choice="completed"].active {
  background: rgba(19, 35, 45, 0.1);
  color: var(--surface-contrast);
}

.record-actions {
  align-items: center;
  justify-content: flex-end;
  align-content: center;
}

.empty-state {
  padding: 42px 24px;
  text-align: center;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.48);
  border: 1px dashed rgba(23, 36, 43, 0.16);
}

.crumb-button {
  justify-self: start;
  padding: 0;
  color: var(--teal);
  font-weight: 800;
}

.draft-indicator {
  min-width: 200px;
  padding: 20px 22px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(19, 35, 45, 0.96), rgba(38, 62, 76, 0.92));
  color: #f3fafb;
  box-shadow: var(--shadow-lg);
}

.draft-indicator strong {
  display: block;
  margin-top: 8px;
  font-size: 1.5rem;
}

.builder-action-bar {
  padding: 16px 18px;
}

.builder-action-row,
.photo-viewer-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.builder-action-row {
  justify-content: flex-end;
}

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

.step-button {
  display: grid;
  gap: 6px;
  justify-items: start;
  padding: 18px;
  border-radius: 20px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(23, 36, 43, 0.08);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.step-button small {
  color: inherit;
}

.step-button.active {
  color: var(--text);
  border-color: rgba(31, 90, 99, 0.2);
  background: rgba(255, 255, 255, 0.72);
}

.step-button.complete span {
  background: rgba(47, 106, 75, 0.14);
  color: var(--green);
}

.builder-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.24fr) minmax(320px, 0.76fr);
  gap: 18px;
  align-items: start;
}

.builder-sidebar {
  display: grid;
  gap: 18px;
}

.builder-form,
.settings-layout {
  display: grid;
  gap: 18px;
}

.settings-section {
  display: block;
}

.settings-section-summary {
  cursor: pointer;
  list-style: none;
}

.settings-section-summary::-webkit-details-marker {
  display: none;
}

.settings-section-summary .section-heading {
  position: relative;
  padding-right: 34px;
}

.settings-section-summary .section-heading::after {
  content: "+";
  position: absolute;
  top: 0;
  right: 0;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(23, 36, 43, 0.08);
  color: var(--ink);
  font-weight: 800;
}

.settings-section[open] .settings-section-summary .section-heading::after {
  content: "-";
}

.settings-save-bar {
  position: sticky;
  top: 82px;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.settings-save-status {
  margin: 0;
}

.settings-section .field-grid,
.settings-section > label,
.settings-section > .muted,
.settings-section > .optional-upgrades-settings {
  margin-top: 16px;
}

.account-panel {
  display: grid;
  gap: 16px;
}

.auth-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
}

.auth-controls label {
  min-width: 0;
}

.auth-controls .button {
  min-height: 46px;
}

.account-helper {
  margin: 0;
}

.cloud-backup-controls {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.cloud-backup-status {
  margin: 0;
}

.cloud-backup-status[data-status="failed"],
.cloud-backup-status[data-status="partial"] {
  color: var(--danger);
}

.cloud-backup-status[data-status="succeeded"] {
  color: var(--teal);
}

.device-sync-status-panel {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.device-sync-status-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.device-sync-status-header h3 {
  margin: 0;
  font-size: 1rem;
}

.device-sync-status-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.device-sync-status-grid div {
  min-width: 0;
}

.device-sync-status-grid dt {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.device-sync-status-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.cloud-auto-sync-panel,
.cloud-download-preview-panel,
.cloud-settings-sync-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.cloud-auto-sync-header,
.cloud-download-preview-header,
.cloud-settings-sync-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.cloud-auto-sync-header h3,
.cloud-auto-sync-header p,
.cloud-download-preview-header h3,
.cloud-download-preview-header p,
.cloud-settings-sync-header h3,
.cloud-settings-sync-header p {
  margin: 0;
}

.cloud-download-preview-actions,
.cloud-settings-sync-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.cloud-download-preview-grid,
.cloud-settings-sync-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 10px;
  margin: 0;
}

.cloud-download-preview-grid div,
.cloud-settings-sync-grid div {
  min-width: 0;
}

.cloud-download-preview-grid dt,
.cloud-settings-sync-grid dt {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.cloud-download-preview-grid dd,
.cloud-settings-sync-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.cloud-settings-impact {
  display: grid;
  gap: 4px;
}

.cloud-settings-impact p {
  margin: 0;
}

.cloud-settings-impact-warning {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(180, 83, 9, 0.28);
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.1);
  color: #92400e;
  font-weight: 700;
}

.cloud-auto-sync-toggle {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 700;
}

.cloud-auto-sync-toggle input {
  inline-size: 18px;
  block-size: 18px;
}

.cloud-manual-sync-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.cloud-manual-sync-panel summary {
  cursor: pointer;
  font-weight: 700;
}

.cloud-manual-sync-panel > p {
  margin: 0;
}

.cloud-manual-restore-mode,
.cloud-manual-restore-phrase {
  display: grid;
  gap: 5px;
  width: min(100%, 520px);
}

.cloud-manual-restore-mode span,
.cloud-manual-restore-phrase span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.cloud-manual-restore-mode select,
.cloud-manual-restore-phrase input {
  width: 100%;
}

.cloud-manual-restore-phrase {
  margin: 10px 0 0;
}

.cloud-awareness-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.cloud-awareness-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.cloud-awareness-header h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.cloud-awareness-helper {
  margin: 0;
  max-width: 62rem;
}

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

.cloud-awareness-grid div {
  min-width: 0;
}

.cloud-awareness-grid dt {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.cloud-awareness-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.cloud-awareness-grid dd[data-status="pending"],
.cloud-awareness-grid dd[data-status="unavailable"] {
  color: var(--danger);
}

.cloud-awareness-grid dd[data-status="current"] {
  color: var(--teal);
}

.cloud-restore-viewer {
  display: grid;
  gap: 14px;
  padding-top: 8px;
}

.cloud-restore-header,
.cloud-restore-grid {
  display: grid;
  gap: 12px;
}

.cloud-restore-header {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.cloud-restore-header h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.cloud-restore-status {
  margin: 0;
}

.cloud-restore-status[data-status="failed"],
.cloud-restore-status[data-status="partial"] {
  color: var(--danger);
}

.cloud-restore-status[data-status="succeeded"] {
  color: var(--teal);
}

.cloud-restore-grid {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.cloud-restore-list {
  display: grid;
  gap: 8px;
}

.cloud-restore-item {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.cloud-restore-run-btn {
  width: 100%;
  text-align: left;
}

.cloud-restore-run-btn[aria-pressed="true"] {
  border-color: var(--accent);
  background: rgba(31, 90, 99, 0.08);
}

.cloud-restore-record-row {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
}

.cloud-restore-record-row input {
  margin-top: 3px;
}

.cloud-restore-item-title {
  margin: 0;
  font-weight: 800;
}

.cloud-restore-item-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.cloud-download-conflict-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.cloud-download-conflict-differences {
  display: grid;
  gap: 8px;
  margin-top: 6px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(31, 90, 99, 0.06);
}

.cloud-download-conflict-differences-title,
.cloud-download-conflict-other {
  margin: 0;
}

.cloud-download-conflict-differences-title {
  font-weight: 800;
}

.cloud-download-conflict-difference {
  display: grid;
  gap: 2px;
  font-size: 0.88rem;
}

.cloud-download-conflict-difference-long summary {
  cursor: pointer;
  font-weight: 800;
}

.cloud-download-conflict-value {
  display: grid;
  gap: 2px;
  margin-top: 6px;
}

.cloud-download-conflict-value pre {
  max-height: 180px;
  margin: 0;
  padding: 8px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
}

.cloud-download-conflict-other {
  font-size: 0.82rem;
}

.settings-subsection-title {
  margin: 18px 0 4px;
  font-size: 0.98rem;
}

.settings-subsection-copy {
  margin: 0;
}

.nested-settings-panel {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(23, 36, 43, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
}

.nested-settings-panel .settings-subsection-title {
  margin-top: 0;
}

.optional-upgrades-settings {
  padding: 10px 12px;
  border: 1px solid rgba(23, 36, 43, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.36);
}

.optional-upgrades-master {
  padding-top: 0;
}

.optional-upgrade-options-panel {
  margin-top: 8px;
}

.crew-list-panel {
  display: grid;
  gap: 12px;
}

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

.crew-settings-row {
  display: grid;
  grid-template-columns: 80px minmax(150px, 1fr) minmax(150px, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 12px;
  border: 1px solid rgba(23, 36, 43, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.42);
}

.crew-color-field input {
  min-height: 42px;
  padding: 4px;
}

.crew-active-field {
  min-height: 42px;
  padding: 10px 0 0;
}

.settings-label-with-help {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.help-icon {
  position: relative;
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1px solid rgba(23, 36, 43, 0.18);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  cursor: help;
}

.help-icon::after {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 30;
  width: min(280px, 72vw);
  padding: 8px 10px;
  border: 1px solid rgba(23, 36, 43, 0.12);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(23, 36, 43, 0.14);
  color: var(--text);
  background: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  content: attr(aria-label);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.help-icon:hover::after,
.help-icon:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.help-icon:hover,
.help-icon:focus-visible {
  border-color: rgba(31, 107, 109, 0.5);
  color: var(--accent-strong);
}

.help-icon:focus-visible {
  outline: 3px solid rgba(45, 112, 145, 0.22);
  outline-offset: 2px;
}

.button.danger,
.button.ghost.danger {
  color: #9b2f2f;
  border-color: rgba(155, 47, 47, 0.2);
}

.button.ghost.danger:hover,
.button.ghost.danger:focus-visible {
  background: rgba(155, 47, 47, 0.08);
}

.schedule-hidden-days-notice {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(23, 36, 43, 0.08);
}

.step-panel,
.detail-panel {
  display: none;
}

.step-panel.active,
.detail-panel.active {
  display: block;
}

.sticky-panel {
  position: sticky;
  top: 108px;
}

.field-grid {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.field-grid:first-of-type {
  margin-top: 0;
}

.proposal-editor-heading {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.proposal-editor-heading h3 {
  margin-bottom: 4px;
}

.proposal-text-status {
  margin: 0;
}

.proposal-text-editor {
  border: 1px solid rgba(23, 36, 43, 0.08);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  margin: 14px 0;
  padding: 16px;
}

.proposal-text-editor textarea {
  min-height: 16rem;
  resize: vertical;
  width: 100%;
}

.proposal-text-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.leafguard-action-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(23, 36, 43, 0.08);
}

.leafguard-action-copy {
  display: grid;
  gap: 6px;
}

.leafguard-action-copy strong,
.leafguard-action-copy p,
.builder-active-job-copy {
  margin: 0;
}

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

.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.one-col {
  grid-template-columns: minmax(0, 1fr);
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 10px;
  border-radius: 18px;
  transition: background 160ms ease, box-shadow 160ms ease;
}

label.needs-review {
  background: rgba(157, 103, 27, 0.12);
  box-shadow: inset 0 0 0 1px rgba(157, 103, 27, 0.22);
}

input,
select,
textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(23, 36, 43, 0.14);
  padding: 13px 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.84);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(31, 90, 99, 0.38);
  box-shadow: 0 0 0 4px rgba(31, 90, 99, 0.1);
}

.count-picker {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  border-radius: 16px;
  border: 1px solid rgba(23, 36, 43, 0.14);
  background: rgba(255, 255, 255, 0.84);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.count-picker:focus-within {
  border-color: rgba(31, 90, 99, 0.38);
  box-shadow: 0 0 0 4px rgba(31, 90, 99, 0.1);
}

.count-picker input {
  border: 0;
  border-radius: 16px 0 0 16px;
  background: transparent;
  box-shadow: none;
}

.count-picker input:focus {
  box-shadow: none;
}

.count-picker-toggle {
  min-width: 46px;
  border: 0;
  border-left: 1px solid rgba(23, 36, 43, 0.1);
  border-radius: 0 16px 16px 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.95rem;
  cursor: pointer;
}

.count-picker.has-custom-value .count-picker-toggle {
  color: var(--teal);
}

.count-picker-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 20;
  display: none;
  max-height: 390px;
  overflow-y: auto;
  padding: 8px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(23, 36, 43, 0.1);
  box-shadow: var(--shadow-lg);
}

.count-picker.open .count-picker-menu {
  display: grid;
}

.count-picker-option {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
}

.count-picker-option:hover,
.count-picker-option.active {
  background: rgba(31, 90, 99, 0.1);
  color: var(--teal);
}

[data-downspout-config].is-hidden {
  display: none;
}

[hidden],
[data-gutter-config].is-hidden,
.is-hidden {
  display: none !important;
}

.checkbox-row {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 0;
  padding-top: 34px;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.workday-toggle-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.workday-toggle-grid .checkbox-row {
  min-height: 52px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(23, 36, 43, 0.08);
}

.health-score {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(31, 90, 99, 0.1), rgba(255, 255, 255, 0.72));
}

.health-score strong {
  font-size: 2rem;
  line-height: 1;
}

.review-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.review-summary {
  margin-top: 14px;
}

.photo-review-actions,
.settings-inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 14px;
}

.photo-review-required-list {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.photo-review-field {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(23, 36, 43, 0.08);
}

.photo-review-field[data-review-state="pending"] {
  box-shadow: inset 0 0 0 1px rgba(157, 103, 27, 0.22);
  background: rgba(157, 103, 27, 0.08);
}

.photo-review-field[data-review-state="edited"] {
  box-shadow: inset 0 0 0 1px rgba(47, 106, 75, 0.18);
  background: rgba(47, 106, 75, 0.08);
}

.photo-review-field.is-empty {
  color: var(--muted);
  justify-content: flex-start;
}

.photo-review-field-meta,
.photo-review-field-actions {
  display: grid;
  gap: 8px;
}

.photo-review-field-actions {
  justify-items: end;
}

.compact-review-list {
  margin-top: 14px;
}

#photo-review-status[data-review-status="reviewed"] {
  background: var(--green-soft);
  color: var(--green);
}

#photo-review-status[data-review-status="needs_review"] {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-pill[data-review-status="edited"] {
  background: var(--green-soft);
  color: var(--green);
}

.check-list,
.bullet-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
}

.check-list {
  padding-left: 0;
  list-style: none;
}

.check-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
}

.check-list li::before {
  content: "○";
  color: var(--muted);
  font-weight: 800;
}

.check-list li.complete::before {
  content: "●";
  color: var(--green);
}

.metric-stack {
  display: grid;
  gap: 12px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(23, 36, 43, 0.08);
}

.metric-section-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.metric-row strong {
  font-size: 1.06rem;
}

.metric-row.total-row {
  padding-top: 8px;
}

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

.builder-active-job-copy {
  margin-top: 14px;
}

.review-panel,
.review-grid {
  display: grid;
  gap: 16px;
}

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

.review-card {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(23, 36, 43, 0.08);
}

.review-card.wide {
  grid-column: 1 / -1;
}

.builder-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
}

.detail-hero {
  align-items: center;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.detail-hero .hero-copy {
  gap: 2px;
}

.detail-hero h1 {
  margin: 0;
}

.detail-hero .hero-text {
  max-width: none;
  margin: 0;
}

.detail-header-actions,
.status-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.detail-action-cluster {
  justify-content: flex-end;
  position: relative;
}

.detail-status-select-field {
  min-height: 48px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.detail-status-select-field span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.detail-status-select-field select {
  min-height: 48px;
  border-radius: 999px;
  border: 1px solid rgba(23, 36, 43, 0.1);
  padding: 0 42px 0 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.7);
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(23, 36, 43, 0.02);
}

.detail-actions-menu {
  position: relative;
}

.detail-actions-menu summary {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  list-style: none;
  cursor: pointer;
}

.detail-actions-menu summary::-webkit-details-marker {
  display: none;
}

.detail-actions-list {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  display: grid;
  min-width: 220px;
  gap: 6px;
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(23, 36, 43, 0.1);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.detail-actions-list .button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  border-radius: var(--radius-sm);
  text-align: left;
}

.status-button {
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 800;
  color: var(--muted);
  background: rgba(23, 36, 43, 0.06);
  box-shadow: inset 0 0 0 1px rgba(23, 36, 43, 0.02);
  transition: transform 180ms ease, background 180ms ease, color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.status-button:hover,
.status-button:focus-visible {
  background: rgba(31, 90, 99, 0.08);
  border-color: rgba(31, 90, 99, 0.12);
}

.detail-schedule-controls {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.detail-leafguard-control {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(23, 36, 43, 0.08);
}

.detail-leafguard-copy {
  display: grid;
  gap: 3px;
}

.detail-leafguard-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-leafguard-copy strong {
  margin: 0;
}

.detail-schedule-field {
  min-width: 220px;
  padding: 0;
  background: transparent;
}

.detail-schedule-field span {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-schedule-note {
  max-width: 260px;
  font-size: 0.85rem;
  text-align: right;
}

.detail-schedule-warning {
  width: min(280px, 100%);
  margin: 0;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(139, 59, 49, 0.24);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: left;
}

.detail-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
}

.detail-notes-panel {
  gap: 14px;
}

.detail-notes-panel textarea {
  min-height: 88px;
  resize: vertical;
}

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

.detail-notes-actions .button {
  min-height: 38px;
  padding: 8px 14px;
}

.tab-button {
  appearance: none;
  border: 0;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 800;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.tab-button:hover,
.tab-button:focus-visible {
  background: rgba(31, 90, 99, 0.08);
  border-color: rgba(31, 90, 99, 0.12);
}

.tab-button.active {
  background: rgba(31, 90, 99, 0.14);
  color: var(--teal);
  border-color: rgba(31, 90, 99, 0.22);
  box-shadow: inset 0 -2px 0 rgba(31, 90, 99, 0.32);
}

.proposal-card {
  overflow: hidden;
}

.proposal-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 26px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.76), rgba(246, 240, 231, 0.92));
}

.proposal-company {
  font-size: 1.34rem;
  font-weight: 800;
}

.proposal-total {
  text-align: right;
}

.proposal-total strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
}

.proposal-body {
  display: grid;
  gap: 22px;
  padding: 26px;
}

.preformatted,
.text-output {
  white-space: pre-wrap;
  word-break: break-word;
}

.addon-banner {
  display: none;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(47, 106, 75, 0.1);
  border: 1px dashed rgba(47, 106, 75, 0.24);
  color: var(--green);
}

.addon-banner.active {
  display: grid;
}

.addon-section h3,
.addon-section p {
  margin: 0;
}

.addon-section p {
  margin-top: 6px;
  font-weight: 800;
}

.table-panel {
  overflow: hidden;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(23, 36, 43, 0.08);
}

th {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.stats-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  margin: 0;
}

.stats-list dt {
  font-weight: 800;
  color: var(--muted);
}

.stats-list dd {
  margin: 0;
  text-align: right;
  font-weight: 800;
}

.text-output {
  margin: 0;
  min-height: 220px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(19, 35, 45, 0.94);
  color: #f5fbff;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
  line-height: 1.55;
  overflow-x: auto;
}

.compact-output {
  min-height: 170px;
}

.activity-list {
  display: grid;
  gap: 12px;
}

.activity-list.compact .activity-item:nth-child(n + 4) {
  display: none;
}

.activity-item {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(23, 36, 43, 0.08);
}

.activity-item-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.activity-detail-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 6px;
}

.adjusted-indicator {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.detail-pricing-heading {
  gap: 10px;
}

.detail-pricing-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.detail-pricing-editor-grid {
  margin-top: 0;
}

.detail-pricing-total-field {
  grid-column: 1 / -1;
}

.detail-pricing-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(19, 35, 45, 0.36);
  backdrop-filter: blur(10px);
}

.modal-backdrop.is-hidden {
  display: none;
}

.modal-card {
  width: min(100%, 480px);
  display: grid;
  gap: 16px;
  padding: 28px;
  border-radius: 28px;
  background: rgba(255, 252, 247, 0.98);
  border: 1px solid rgba(23, 36, 43, 0.12);
  box-shadow: var(--shadow-lg);
}

.schedule-detail-modal-card {
  width: min(100%, 940px);
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.schedule-rollback-modal-card {
  width: min(100%, 560px);
}

.payroll-crew-scope-card {
  width: min(100%, 520px);
}

.cloud-backup-modal-card {
  width: min(100%, 560px);
}

.cloud-backup-summary {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.cloud-backup-summary p {
  margin: 0;
}

.schedule-rollback-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.schedule-rollback-preview {
  margin: 0;
  padding: 13px 14px;
  border-radius: 16px;
  background: rgba(31, 90, 99, 0.09);
  color: var(--accent-strong);
  font-size: 0.94rem;
  font-weight: 800;
}

.schedule-rollback-preview[data-state="empty"] {
  background: rgba(157, 103, 27, 0.1);
  color: #8f5e18;
}

.detail-schedule-picker-card {
  width: min(100%, 1120px);
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  grid-template-rows: auto auto auto minmax(0, 1fr);
  overflow: hidden;
}

.detail-schedule-picker-header,
.detail-schedule-picker-toolbar {
  display: grid;
  gap: 14px;
}

.detail-schedule-picker-header {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.detail-schedule-picker-toolbar {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.detail-schedule-picker-crew-field {
  width: min(240px, 100%);
}

.detail-assigned-crew-field {
  margin-top: 2px;
}

.detail-schedule-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 4px 4px 0;
}

.detail-schedule-picker-day {
  cursor: default;
}

.detail-schedule-picker-day .schedule-job-list {
  align-content: start;
  min-height: 78px;
}

.detail-schedule-picker-day-btn {
  align-self: end;
  width: 100%;
  margin-top: 4px;
}

.schedule-detail-modal-header,
.schedule-detail-modal-body {
  display: grid;
  gap: 16px;
}

.schedule-detail-modal-body {
  min-height: 0;
  overflow-y: auto;
  align-content: start;
  padding-right: 4px;
}

.schedule-detail-modal-footer {
  padding-top: 2px;
}

.schedule-detail-table-wrap {
  border-radius: 18px;
  border: 1px solid rgba(23, 36, 43, 0.08);
  background: rgba(255, 255, 255, 0.52);
}

.schedule-detail-table td:first-child {
  font-weight: 700;
  min-width: 240px;
}

.schedule-detail-table th:nth-child(n + 2),
.schedule-detail-table td:nth-child(n + 2) {
  text-align: right;
  white-space: nowrap;
}

.schedule-detail-totals {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(23, 36, 43, 0.08);
}

.photo-import-confirm-card {
  width: min(100%, 520px);
}

.photo-import-confirm-summary {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(23, 36, 43, 0.08);
}

.photo-import-confirm-filename,
.photo-import-confirm-status {
  font-size: 1.08rem;
  font-weight: 700;
  word-break: break-word;
}

.photo-import-confirm-status[data-status="supported"] {
  color: var(--green);
}

.photo-import-confirm-status[data-status="heic"] {
  color: var(--amber);
}

.photo-import-confirm-status[data-status="unsupported"] {
  color: var(--danger);
}

.photo-import-confirm-status[data-status="loading"] {
  color: var(--accent-strong);
}

#photo-import-confirm-modal[data-loading="true"] .photo-import-confirm-status::before {
  content: "";
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  margin-right: 8px;
  border: 2px solid rgba(31, 90, 99, 0.22);
  border-top-color: var(--accent-strong);
  border-radius: 999px;
  animation: spin 800ms linear infinite;
  vertical-align: -0.08em;
}

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

.photo-viewer-card {
  width: min(100%, 1080px);
  height: calc(100vh - 40px);
  height: calc(100dvh - 40px);
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  gap: 18px;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.photo-viewer-header {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
}

.photo-viewer-header h2 {
  word-break: break-word;
}

.photo-viewer-count {
  margin: 0;
}

.photo-viewer-frame {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
  min-height: 0;
  overflow: hidden;
}

.photo-viewer-frame.photo-viewer-frame-single {
  grid-template-columns: minmax(0, 1fr);
}

.photo-viewer-thumbnails {
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.photo-viewer-thumbnail {
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 1px solid rgba(23, 36, 43, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.photo-viewer-thumbnail[data-selected="true"] {
  border-color: rgba(31, 90, 99, 0.42);
  box-shadow:
    0 0 0 2px rgba(31, 90, 99, 0.14),
    var(--shadow-md);
}

.photo-viewer-thumbnail:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.photo-viewer-thumbnail-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-viewer-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 18px;
  border-radius: 22px;
  background: rgba(19, 35, 45, 0.08);
  border: 1px solid rgba(23, 36, 43, 0.08);
}

.photo-viewer-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  border-radius: 18px;
  object-fit: contain;
  object-position: center;
  box-shadow: var(--shadow-md);
}

.photo-viewer-empty {
  text-align: center;
  max-width: 540px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1000;
  width: min(340px, calc(100vw - 32px));
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(19, 35, 45, 0.94);
  color: #f5fbff;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 2026 visual refresh: concept-aligned shell, cards, filters, and responsive polish. */
:root {
  --bg: #f7f6f2;
  --bg-deep: #eeece6;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --surface-contrast: #053f3b;
  --text: #111827;
  --muted: #5f6875;
  --line: #dde3e8;
  --line-strong: #c9d2d9;
  --accent: #b2561e;
  --accent-strong: #9a3f0d;
  --teal: #00605b;
  --teal-soft: #e8f4f3;
  --green: #17683d;
  --green-soft: #eaf5ee;
  --amber: #a34b0b;
  --amber-soft: #fff0e7;
  --slate-soft: #f4f6f7;
  --danger: #a13f10;
  --danger-soft: #fff0e7;
  --shadow-lg: 0 24px 70px rgba(15, 23, 42, 0.11);
  --shadow-md: 0 12px 30px rgba(15, 23, 42, 0.07);
  --radius-xl: 10px;
  --radius-lg: 10px;
  --radius-md: 8px;
  --radius-sm: 8px;
  --control-height: 44px;
}

body {
  font-family: Inter, "Avenir Next", "Segoe UI", Arial, sans-serif;
  background:
    linear-gradient(90deg, rgba(247, 246, 242, 0) 0, rgba(247, 246, 242, 0) 260px, rgba(255, 255, 255, 0.44) 260px),
    var(--bg);
}

body::before {
  display: none;
}

h1,
h2,
h3 {
  font-family: Inter, "Avenir Next", "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
  color: var(--text);
}

h1 {
  font-size: clamp(1.75rem, 2.3vw, 2.35rem);
  line-height: 1.08;
}

h2 {
  font-size: clamp(1.15rem, 1.45vw, 1.45rem);
  line-height: 1.18;
}

h3 {
  font-size: 1rem;
  line-height: 1.25;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.pipeline-tile:focus-visible,
.filter-chip:focus-visible,
.step-button:focus-visible,
.record-card button:focus-visible {
  outline: 3px solid rgba(0, 96, 91, 0.24);
  outline-offset: 2px;
}

.app-shell {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 0;
}

.app-sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 28px 22px;
  overflow-y: auto;
  color: #f8fffc;
  background:
    radial-gradient(circle at left top, rgba(255, 255, 255, 0.12), transparent 32%),
    linear-gradient(180deg, #004f49 0%, #003b37 58%, #00302d 100%);
  box-shadow: 10px 0 30px rgba(5, 63, 59, 0.12);
}

.app-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 28px 28px;
}

.topbar,
.surface-panel,
.proposal-card,
.summary-card,
.storage-badge,
.detail-toolbar,
.builder-footer {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: none;
  backdrop-filter: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(280px, 520px) auto;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  min-height: 64px;
  padding: 0 0 16px;
  background: rgba(247, 246, 242, 0.94);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.sidebar-brand {
  display: block;
}

.brand-button {
  gap: 12px;
  color: inherit;
}

.brand-mark {
  width: 56px;
  height: 56px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-size: 1.2rem;
  letter-spacing: 0;
}

.brand-button strong {
  color: #fff;
  font-size: 1.22rem;
  line-height: 1.05;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-button small {
  color: rgba(255, 255, 255, 0.76);
  letter-spacing: 0.12em;
}

.sidebar-section {
  display: grid;
  gap: 10px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.28);
}

.sidebar-nav {
  padding-top: 0;
  border-top: 0;
}

.sidebar-section-label {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-end,
.sidebar-actions,
.sidebar-nav {
  align-items: stretch;
  justify-content: stretch;
}

.sidebar-nav .button,
.sidebar-actions .button {
  width: 100%;
  justify-content: flex-start;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 8px;
  text-align: left;
  color: #f7fffc;
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
}

.sidebar-nav .button:hover,
.sidebar-nav .button:focus-visible,
.sidebar-nav .button.active,
.sidebar-actions .button:hover,
.sidebar-actions .button:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.08);
  transform: none;
}

.sidebar-actions .button.primary,
.sidebar-actions .button.secondary {
  background: transparent;
  color: #fff;
  border-color: transparent;
  box-shadow: none;
}

.sidebar-actions .button.primary::before,
.sidebar-actions .button.secondary::before,
.sidebar-actions .button.ghost::before,
.sidebar-nav .button::before {
  content: "";
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-radius: 5px;
  opacity: 0.95;
}

.sidebar-actions .button.primary::before {
  border-radius: 50%;
}

.sidebar-actions .button.primary::after {
  content: "+";
  margin-left: -28px;
  width: 18px;
  color: #ff8a2a;
  text-align: center;
  pointer-events: none;
}

.sidebar-actions .button {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-status {
  display: grid;
  gap: 8px;
  margin-top: auto;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.84rem;
}

.sidebar-status .storage-badge {
  justify-content: flex-start;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  box-shadow: none;
  font-weight: 700;
}

.sidebar-status p {
  color: rgba(255, 255, 255, 0.72);
}

.header-search {
  justify-self: start;
  max-width: 520px;
}

.search-field {
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff;
  border-color: var(--line);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

.topbar-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
}

.topbar-status-copy {
  display: block;
  max-width: min(34vw, 340px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
}

.environment-badge {
  min-height: auto;
  padding: 0 0 0 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.98rem;
}

.environment-badge::before {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  margin-left: -18px;
  margin-top: 3px;
  border-radius: 50%;
  background: var(--green);
}

.environment-badge[data-environment="LIVE"],
.environment-badge[data-environment="TEST"] {
  background: transparent;
  border: 0;
  color: var(--text);
}

.view-stack,
.view,
.builder-form,
.settings-layout {
  gap: 22px;
}

.view {
  animation: none;
}

/* Review fixes: keep the concept cleaner and remove overdrawn decoration. */
.summary-card {
  min-height: 128px;
  padding: 24px;
}

.summary-card::before {
  display: none;
}

.environment-badge {
  padding-left: 0;
}

.environment-badge::before {
  display: none;
}

.sidebar-nav .button,
.sidebar-actions .button {
  min-height: 42px;
  padding: 9px 2px;
  color: rgba(255, 255, 255, 0.9);
  background: transparent;
  border-color: transparent;
  border-radius: 6px;
}

.sidebar-nav .button::before,
.sidebar-actions .button::before,
.sidebar-actions .button.primary::after {
  display: none;
}

.sidebar-nav .button:hover,
.sidebar-nav .button:focus-visible,
.sidebar-actions .button:hover,
.sidebar-actions .button:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  border-color: transparent;
}

.sidebar-nav .button.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.86);
}

.sidebar-actions .button.primary,
.sidebar-actions .button.secondary,
.sidebar-actions .button.ghost {
  background: transparent;
  color: #fff;
  border-color: transparent;
}

.record-card {
  grid-template-columns: 1fr;
  gap: 12px;
}

.record-main {
  grid-template-columns: minmax(180px, 1fr) minmax(110px, auto) minmax(130px, auto);
  gap: 10px 16px;
}

.record-actions {
  max-width: none;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
}

.record-actions .button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 10px;
  font-size: 0.78rem;
  white-space: nowrap;
}

.dashboard-hero,
.schedule-hero,
.view-hero {
  padding: 2px 2px 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.dashboard-hero {
  display: block;
}

.hero-copy,
.section-heading {
  gap: 6px;
}

.hero-copy .eyebrow {
  display: none;
}

.hero-text,
.muted {
  line-height: 1.45;
}

.surface-panel,
.proposal-card,
.summary-card,
.detail-toolbar,
.builder-footer,
.modal-card {
  border-radius: 10px;
}

.surface-panel {
  padding: 22px;
}

.summary-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

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

.schedule-summary-strip.has-crew-filter {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.summary-card {
  position: relative;
  min-height: 156px;
  align-content: center;
  gap: 10px;
  padding: 18px;
  overflow: hidden;
}

.summary-card::before {
  content: "";
  display: none;
}

.summary-card:nth-child(2)::before {
  background: var(--green-soft);
  border-color: rgba(23, 104, 61, 0.18);
}

.summary-card:nth-child(3)::before,
.summary-card.accent::before {
  background: var(--amber-soft);
  border-color: rgba(178, 86, 30, 0.2);
}

.summary-card:nth-child(4)::before {
  background: var(--amber-soft);
  border-color: rgba(157, 103, 27, 0.2);
}

.summary-card:nth-child(5)::before {
  background: var(--green-soft);
}

.summary-card strong {
  max-width: 100%;
  font-size: clamp(1.45rem, 1.7vw, 1.9rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

#detail-overview-total,
#detail-overview-profit {
  font-size: clamp(1.25rem, 1.45vw, 1.6rem);
  white-space: nowrap;
}

#detail-leafguard-status {
  font-size: clamp(1.35rem, 1.55vw, 1.75rem);
}

.summary-label {
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.summary-card small {
  font-size: 0.78rem;
  line-height: 1.3;
}

.summary-card[data-schedule-state="needs_schedule"] strong,
.summary-card[data-schedule-state="needs_schedule"] .detail-schedule-warning {
  color: var(--danger);
}

.summary-card-action {
  width: 100%;
  min-height: 34px;
  margin-top: 2px;
  justify-content: center;
  padding: 7px 10px;
  font-size: 0.84rem;
}

.material-status-options {
  display: grid;
  gap: 6px;
}

.material-status-option {
  width: 100%;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.64);
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.material-status-option.active[data-material-status="not_ordered"] {
  border-color: rgba(139, 59, 49, 0.3);
  background: var(--danger-soft);
  color: var(--danger);
}

.material-status-option.active[data-material-status="ordered"] {
  border-color: rgba(202, 138, 4, 0.42);
  background: rgba(254, 240, 138, 0.62);
  color: #6b5300;
}

.material-status-option.active[data-material-status="delivered"] {
  border-color: rgba(47, 106, 75, 0.32);
  background: var(--green-soft);
  color: var(--green);
}

.pipeline-card {
  gap: 18px;
  padding: 0;
  overflow: hidden;
}

.pipeline-card > .panel-header-row {
  margin: 0;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
}

.pipeline-card .filter-helper-copy {
  max-width: none;
  color: var(--teal);
  font-weight: 700;
}

.pipeline-grid {
  grid-template-columns: repeat(5, minmax(156px, 1fr));
  gap: 16px;
  padding: 18px 16px 20px;
  overflow-x: auto;
}

.pipeline-tile {
  min-height: 136px;
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 20px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: none;
}

.pipeline-tile:hover,
.pipeline-tile:focus-visible {
  background: #fff;
  border-color: rgba(0, 96, 91, 0.32);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
  transform: none;
}

.pipeline-tile.active {
  background: #fff6f0;
  border-color: #ef7c31;
  box-shadow: inset 0 0 0 1px rgba(239, 124, 49, 0.2);
}

.pipeline-tile .status-pill {
  width: fit-content;
  padding: 0;
  background: transparent;
  font-size: 0.96rem;
  font-weight: 700;
}

.pipeline-tile strong {
  margin: 0;
  color: var(--text);
  font-size: 1.6rem;
  font-weight: 800;
}

.pipeline-tile small {
  color: var(--text);
  font-size: 1rem;
}

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

.today-focus-panel {
  display: grid;
  gap: 18px;
}

.focus-list {
  display: grid;
  gap: 12px;
}

.focus-list p {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.focus-list p:last-child {
  border-bottom: 0;
}

.focus-list span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.today-focus-alert {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.today-focus-alert:last-child {
  border-bottom: 0;
}

.today-focus-alert-body {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.today-focus-alert-header {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.today-focus-alert-header strong {
  font-size: 0.95rem;
  line-height: 1.25;
}

.today-focus-alert p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.today-focus-count {
  display: inline-grid;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
}

.today-focus-alert[data-today-focus-severity="attention"] .today-focus-count {
  border-color: rgba(185, 28, 28, 0.24);
  background: rgba(254, 226, 226, 0.72);
  color: #991b1b;
}

.today-focus-alert[data-today-focus-severity="followup"] .today-focus-count {
  border-color: rgba(180, 83, 9, 0.24);
  background: rgba(254, 243, 199, 0.72);
  color: #92400e;
}

.today-focus-action {
  align-self: center;
  white-space: nowrap;
}

.today-focus-empty {
  padding: 10px 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.panel-header-row {
  align-items: center;
  margin-bottom: 18px;
}

.panel-controls {
  gap: 10px;
}

.chip-row {
  gap: 8px;
}

.filter-chip {
  padding: 7px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

.filter-chip.active {
  color: var(--accent-strong);
  background: var(--amber-soft);
  border-color: rgba(178, 86, 30, 0.24);
  box-shadow: none;
}

.filter-helper-copy {
  font-size: 0.84rem;
  line-height: 1.35;
}

.proposal-list {
  gap: 0;
  border-top: 1px solid var(--line);
}

.record-card {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 20px 22px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
}

.record-card:last-child {
  border-bottom: 0;
}

.record-card:hover,
.record-card:focus-within,
.record-card.record-card-in-filter-view,
.record-card.record-card-status-match,
.record-card.record-card-needs-scheduling {
  background: #fff;
  border-color: var(--line);
  box-shadow: none;
  transform: none;
}

.record-main {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(120px, 0.7fr) minmax(160px, 0.9fr);
  gap: 12px 18px;
  align-items: center;
}

.record-meta {
  grid-column: 2;
  grid-row: 1 / span 4;
  display: grid;
  justify-items: start;
  align-content: center;
  gap: 8px;
}

.record-title {
  grid-column: 1;
  margin: 0;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
}

.record-customer,
.record-address {
  grid-column: 1;
  font-size: 0.9rem;
}

.record-stats {
  grid-column: 3;
  grid-row: 1 / span 4;
  display: grid;
  justify-items: start;
  gap: 7px;
  margin: 0;
}

.record-actions {
  max-width: 360px;
  justify-content: flex-end;
}

.record-actions .button,
.detail-action-cluster .button,
.crew-sheet-actions .button,
.modal-actions .button {
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.84rem;
}

.button {
  min-height: 42px;
  border-radius: 8px;
  padding: 10px 15px;
  font-weight: 750;
}

.button.primary,
.button.secondary {
  background: var(--teal);
  color: #fff;
  box-shadow: none;
}

.button.primary:hover,
.button.primary:focus-visible,
.button.secondary:hover,
.button.secondary:focus-visible {
  background: #004f49;
  box-shadow: none;
}

.button.ghost {
  background: #fff;
  color: var(--teal);
  border-color: var(--line);
}

.button.ghost:hover,
.button.ghost:focus-visible {
  background: var(--teal-soft);
  border-color: rgba(0, 96, 91, 0.24);
  box-shadow: none;
}

.soft-pill,
.detail-pill,
.status-pill {
  border-radius: 6px;
  padding: 6px 9px;
  font-size: 0.78rem;
}

.status-pill[data-status="draft"] {
  background: #f2f4f5;
  color: #38414a;
}

.status-pill[data-status="finalized"] {
  background: #eaf3ff;
  color: #1e5c9a;
}

.status-pill[data-status="approved"] {
  background: var(--green-soft);
  color: var(--green);
}

.status-pill[data-status="needs_scheduling"] {
  background: var(--amber-soft);
  color: var(--accent-strong);
}

.status-pill[data-status="invoice"] {
  background: var(--teal-soft);
  color: var(--teal);
}

.empty-state {
  padding: 34px 22px;
  border-radius: 8px;
  background: #fff;
  border: 1px dashed var(--line-strong);
}

input,
select,
textarea {
  border-radius: 8px;
}

.step-button,
.path-step,
.crew-sheet-job,
.payroll-active-batch-card,
.payroll-preview-panel,
.payroll-import-panel,
.photo-import-confirm-summary,
.schedule-detail-totals {
  border-radius: 8px;
  background: #fff;
  border-color: var(--line);
}

.modal-backdrop {
  background: rgba(17, 24, 39, 0.48);
}

.toast {
  border-radius: 8px;
  background: #083f3b;
}

.summary-card {
  min-height: 128px;
  padding: 24px;
}

.summary-card::before,
.environment-badge::before,
.sidebar-nav .button::before,
.sidebar-actions .button::before,
.sidebar-actions .button.primary::after {
  display: none;
}

.environment-badge {
  padding-left: 0;
}

.sidebar-nav .button,
.sidebar-actions .button {
  min-height: 42px;
  padding: 9px 2px;
  color: rgba(255, 255, 255, 0.9);
  background: transparent;
  border-color: transparent;
  border-radius: 6px;
  box-shadow: none;
}

.sidebar-nav .button:hover,
.sidebar-nav .button:focus-visible,
.sidebar-actions .button:hover,
.sidebar-actions .button:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  border-color: transparent;
}

.sidebar-nav .button.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.86);
}

.sidebar-actions .button.primary,
.sidebar-actions .button.secondary,
.sidebar-actions .button.ghost {
  background: transparent;
  color: #fff;
  border-color: transparent;
  box-shadow: none;
}

.record-card {
  grid-template-columns: 1fr;
  gap: 12px;
}

.record-main {
  grid-template-columns: minmax(180px, 1fr) minmax(110px, auto) minmax(130px, auto);
  gap: 10px 16px;
}

.record-actions {
  max-width: none;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
}

.record-actions .button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 10px;
  font-size: 0.78rem;
  white-space: nowrap;
}

.sidebar-actions .button {
  transition: background 160ms ease, box-shadow 160ms ease, color 160ms ease, transform 160ms ease;
}

.sidebar-actions .button:hover,
.sidebar-actions .button:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.78);
  transform: none;
}

.sidebar-actions .button:active {
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 3px 0 0 #fff;
  transform: translateY(1px);
}

#payroll-import-layout.payroll-layout {
  grid-template-columns: minmax(0, 1fr);
}

.payroll-import-mode-panel {
  display: grid;
  gap: 18px;
}

.payroll-import-panel {
  margin-top: 0;
}

.payroll-date-selection {
  grid-template-columns: repeat(7, minmax(132px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.payroll-date-chip {
  align-content: start;
  min-width: 132px;
  min-height: 176px;
  padding: 14px;
  gap: 12px;
}

.payroll-date-chip:disabled {
  opacity: 0.76;
}

.payroll-date-heading {
  display: grid;
  gap: 2px;
}

.payroll-date-heading strong {
  font-size: 0.92rem;
  line-height: 1.15;
}

.payroll-date-heading span {
  color: var(--muted);
  font-size: 0.86rem;
}

.payroll-date-job-list {
  pointer-events: none;
}

.payroll-date-job-card {
  display: block;
  padding: 8px 9px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(31, 90, 99, 0.07);
}

.payroll-date-empty {
  display: block;
  padding: 9px 0;
  font-size: 0.82rem;
  line-height: 1.25;
}

.payroll-date-chip.active .payroll-date-job-card {
  border-color: rgba(31, 90, 99, 0.24);
  border-left-color: rgba(31, 90, 99, 0.6);
  background: #fff;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .app-main {
    padding: 20px;
  }

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

  .dashboard-workspace,
  .schedule-layout,
  .builder-layout,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .record-main {
    grid-template-columns: minmax(0, 1fr) minmax(140px, auto);
  }

  .record-meta,
  .record-stats {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 860px) {
  body {
    background: var(--bg);
  }

  .app-shell {
    display: block;
  }

  .app-sidebar {
    position: static;
    height: auto;
    padding: 18px;
    gap: 18px;
  }

  .sidebar-brand .brand-button {
    width: 100%;
  }

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

  .sidebar-section-label,
  .sidebar-status {
    grid-column: 1 / -1;
  }

  .app-main {
    padding: 18px;
  }

  .cloud-restore-header,
  .cloud-restore-grid,
  .device-sync-status-header,
  .device-sync-status-grid,
  .cloud-awareness-header,
  .cloud-awareness-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    position: static;
    grid-template-columns: 1fr;
    padding-bottom: 10px;
  }

  .header-search {
    max-width: none;
    width: 100%;
  }

  .topbar-status {
    justify-content: flex-start;
  }

  .topbar-status-copy {
    max-width: 100%;
  }

  .auth-controls {
    grid-template-columns: 1fr;
  }

  .summary-strip,
  .pipeline-grid,
  .stepper,
  .review-grid,
  .two-col,
  .three-col,
  .stats-list {
    grid-template-columns: 1fr;
  }

  .summary-card {
    min-height: 118px;
    padding: 18px;
  }

  .panel-header-row,
  .record-card,
  .record-main,
  .record-actions,
  .detail-toolbar,
  .builder-action-bar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .record-actions {
    max-width: none;
    justify-content: stretch;
  }

  .record-actions .button,
  .builder-action-row .button,
  .photo-viewer-actions .button {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .sidebar-nav,
  .sidebar-actions {
    grid-template-columns: 1fr;
  }

  .app-main {
    padding: 14px;
  }

  .surface-panel {
    padding: 18px;
  }

  .summary-card {
    padding: 20px;
  }

  .summary-card::before {
    position: static;
    transform: none;
    margin-bottom: 8px;
  }
}

@media (max-width: 1220px) {
  .topbar {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .header-search,
  .topbar-end {
    width: 100%;
  }

  .topbar-end {
    justify-content: flex-start;
  }

  .topnav {
    justify-content: flex-start;
  }

  .topbar-actions,
  .panel-controls,
  .detail-toolbar {
    width: 100%;
    justify-content: flex-start;
  }

  .dashboard-hero {
    grid-template-columns: 1fr;
  }

  .dashboard-primary-actions {
    justify-content: flex-start;
  }

  .dashboard-action-stack,
  .dashboard-utility-actions {
    justify-items: start;
    justify-content: flex-start;
  }

  .schedule-hero,
  .schedule-layout {
    grid-template-columns: 1fr;
  }

  .schedule-toolbar {
    justify-content: flex-start;
  }

  .summary-strip,
  .pipeline-grid,
  .stepper {
    grid-template-columns: repeat(5, minmax(120px, 1fr));
  }

  .dashboard-grid,
  .builder-layout,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .schedule-grid {
    gap: 10px;
  }

  .schedule-detail-modal-card {
    width: min(100%, 760px);
  }

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

  .detail-schedule-picker-card {
    width: min(100%, 760px);
  }

  .detail-schedule-picker-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sticky-panel {
    position: static;
  }
}

@media (max-width: 820px) {
  .app-shell {
    padding: 14px;
    gap: 18px;
  }

  .view-hero,
  .dashboard-hero,
  .schedule-hero,
  .proposal-header,
  .builder-action-bar,
  .builder-footer,
  .record-card,
  .photo-viewer-header,
  .panel-header-row,
  .detail-toolbar,
  .activity-item-header {
    grid-template-columns: 1fr;
    display: grid;
  }

  .summary-strip,
  .stepper,
  .review-grid,
  .crew-settings-row,
  .two-col,
  .three-col,
  .stats-list {
    grid-template-columns: 1fr;
  }

  .leafguard-action-row {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .builder-action-row,
  .photo-viewer-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .builder-action-row .button,
  .photo-viewer-actions .button {
    width: 100%;
  }

  .schedule-grid {
    gap: 8px;
  }

  .schedule-toolbar,
  .schedule-toolbar-actions,
  .schedule-rollback-header,
  .detail-schedule-picker-header,
  .detail-schedule-picker-toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .workday-toggle-grid {
    grid-template-columns: 1fr;
  }

  .detail-schedule-picker-grid {
    grid-template-columns: 1fr;
  }

  .crew-sheet-actions {
    width: 100%;
  }

  .crew-sheet-actions .button,
  .schedule-summary-action {
    width: 100%;
    justify-self: stretch;
  }

  .schedule-day {
    min-height: 164px;
    padding: 12px;
    gap: 8px;
  }

  .schedule-job-card {
    padding: 8px 9px;
  }

  .schedule-job-title {
    font-size: 0.84rem;
  }

  .count-picker-menu {
    max-height: 320px;
  }

  .proposal-total,
  .status-group,
  .record-actions,
  .detail-action-cluster,
  .detail-header-actions {
    justify-content: flex-start;
    text-align: left;
  }

  .detail-action-cluster,
  .detail-action-cluster .button,
  .detail-status-select-field,
  .detail-status-select-field select,
  .detail-actions-menu {
    width: 100%;
  }

  .detail-actions-list {
    left: 0;
    right: auto;
    width: min(100%, 320px);
  }

  .detail-schedule-controls {
    justify-items: start;
  }

  .detail-schedule-note {
    max-width: none;
    text-align: left;
  }

  .filter-helper-copy {
    max-width: none;
    text-align: left;
  }

  .detail-leafguard-control {
    width: 100%;
    justify-content: space-between;
  }

  .search-field {
    min-width: 100%;
  }

  .modal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .photo-viewer-card {
    height: calc(100vh - 28px);
    height: calc(100dvh - 28px);
  }

  .photo-viewer-frame,
  .photo-viewer-frame.photo-viewer-frame-single {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .photo-viewer-thumbnails {
    display: none !important;
  }

  .schedule-detail-modal-card {
    padding: 22px;
    max-height: calc(100vh - 28px);
    max-height: calc(100dvh - 28px);
  }

  .detail-schedule-picker-card {
    padding: 22px;
    max-height: calc(100vh - 28px);
    max-height: calc(100dvh - 28px);
  }

  .schedule-detail-table td:first-child {
    min-width: 180px;
  }

  .schedule-detail-modal-body {
    padding-right: 2px;
  }
}
