:root {
  --bg-home: #c8e6d0;
  --bg-leads: #85b8e8;
  --bg-projects: #f0a983;
  --bg-contacts: #b8d4b8;
  --bg-new: #c4a8d4;
  --bg-schedule: #b2dfdb;
  --bg-settings: #cdd6db;
  --bg-cashflow: #fde8b5;
  --bg-suppliers: #f4d0bc;
  --surface: #ffffff;
  --surface-soft: #f6f3f2;
  --surface-high: #eae7e7;
  --text: #2d2d2d;
  --muted: #7a7a72;
  --primary: #366548;
  --secondary: #395f94;
  --orange: #e8845a;
  --green: #5a8a6a;
  --purple: #9b59b6;
  --gold: #f4a620;
  --border: #e6e6e6;
  --outline: #c1c9c0;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  background: var(--bg-home);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-home);
  -webkit-font-smoothing: antialiased;
}

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

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.screen {
  width: 100%;
  min-height: 100vh;
  padding: 0 12px 112px;
}

.screen.home { background: var(--bg-home); }
.screen.leads { background: var(--bg-leads); }
.screen.live-projects { background: var(--bg-projects); }
.screen.schedule { background: var(--bg-schedule); }
.screen.contacts { background: var(--bg-contacts); }
.screen.new-project { background: var(--bg-new); }
.screen.settings { background: var(--bg-settings); }
.screen.suppliers { background: var(--bg-suppliers); }
.screen.project-hq { background: #c5dcf5; }
.screen.project-hq.live { background: #fad5c0; }

.screen-inner {
  width: min(100%, 430px);
  margin: 0 auto;
  padding: 0 0 28px;
}

.top-shell {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: 0 -12px 12px;
  padding: 8px 12px;
  background: var(--page-bg, var(--bg-home));
  box-shadow: 0 8px 14px rgba(45, 45, 45, 0.04);
}

.compact-top-shell {
  margin-bottom: 10px;
  padding-top: 7px;
  padding-bottom: 7px;
}

.compact-header {
  gap: 0;
}

.screen.home { --page-bg: var(--bg-home); }
.screen.leads { --page-bg: var(--bg-leads); }
.screen.live-projects { --page-bg: var(--bg-projects); }
.screen.schedule { --page-bg: var(--bg-schedule); }
.screen.contacts { --page-bg: var(--bg-contacts); }
.screen.new-project { --page-bg: var(--bg-new); }
.screen.settings { --page-bg: var(--bg-settings); }
.screen.suppliers { --page-bg: var(--bg-suppliers); }
.screen.cashflow { background: var(--bg-cashflow); --page-bg: var(--bg-cashflow); }
.screen.project-hq { --page-bg: #c5dcf5; }
.screen.project-hq.live { --page-bg: #fad5c0; }

.auth-screen {
  display: grid;
  min-height: 100vh;
  padding-bottom: 24px;
  place-items: center;
  background: var(--bg-home);
}

.auth-inner {
  width: min(100%, 430px);
}

.auth-card {
  display: grid;
  gap: 16px;
  padding: 24px 22px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.auth-brand {
  justify-content: center;
  padding-bottom: 4px;
}

.auth-card h1 {
  margin: 0;
}

.auth-card p {
  margin: 0;
  color: var(--muted);
}

.auth-card .auth-welcome-message {
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  line-height: 22px;
  text-align: center;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.notice-card {
  padding: 10px 12px;
  border: 1px solid rgba(57, 95, 148, 0.2);
  border-radius: 8px;
  background: rgba(213, 227, 255, 0.55);
  color: var(--secondary);
  font-size: 13px;
  font-weight: 700;
}

.field-help {
  margin: -2px 0 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 17px;
}

.appbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 12px 8px;
}

.appbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-size: 20px;
  font-weight: 700;
}

.appbar-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: var(--primary);
  font-size: 15px;
  font-weight: 800;
}

.icon-svg {
  width: 1.25em;
  height: 1.25em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.appbar img {
  height: 52px;
  width: auto;
  object-fit: contain;
}

.header,
.home-header {
  display: grid;
  gap: 4px;
}

.mini-brand {
  display: flex;
}

.company {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.2;
}

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

h1 {
  color: var(--text);
  font-size: 24px;
  font-weight: 800;
  line-height: 32px;
  letter-spacing: 0;
}

h2 {
  font-size: 20px;
  line-height: 28px;
}

h3 {
  font-size: 16px;
  line-height: 24px;
}

.muted {
  color: var(--muted);
}

.stats-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-bottom: 16px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.home-control-strip {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 66px;
}

.home-settings-button {
  display: grid;
  min-width: 0;
  place-items: center;
  align-content: center;
  gap: 4px;
  border-left: 1px solid var(--outline);
  border-radius: 0 12px 12px 0;
  color: var(--text);
}

.home-settings-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
}

.home-settings-icon svg {
  width: 24px;
  height: 24px;
}

.home-settings-button small {
  font-size: 9px;
  font-weight: 800;
}

.stat {
  min-width: 0;
  padding: 16px;
}

.home-private-stat {
  display: block;
  width: 100%;
  color: var(--text);
  text-align: left;
}

.home-private-stat:active {
  background: rgba(45, 107, 115, 0.06);
}

.home-private-stat strong {
  white-space: nowrap;
}

.stat + .stat {
  border-left: 1px solid var(--outline);
}

.stat-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #414942;
  font-size: 10px;
  line-height: 14px;
}

.coin-icon {
  color: var(--gold);
  font-size: 10px;
  font-weight: 900;
}

.stat strong {
  display: block;
  margin-top: 5px;
  color: #1b1c1c;
  font-size: 16px;
  font-weight: 800;
  line-height: 24px;
}

.scope-change-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

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

.home-primary-grid .tile {
  min-height: 76px;
  aspect-ratio: auto;
  padding: 10px 8px;
}

.home-action-window {
  margin-bottom: 10px;
}

.home-action-window .activity-head {
  padding: 10px 12px;
}

.home-action-window .activity-head > div {
  display: grid;
  gap: 1px;
}

.home-action-window .activity-head .company {
  margin: 0;
  font-size: 9px;
}

.activity-view-all {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--secondary);
  background: rgba(57, 95, 148, 0.1);
  font-size: 11px;
  font-weight: 900;
}

.home-action-list {
  max-height: 170px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 12px;
}

.home-action-list .activity-icon {
  width: 32px;
  height: 32px;
}

.home-navigation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.home-navigation-tile {
  display: grid;
  min-width: 0;
  min-height: 78px;
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 9px 5px;
  border-radius: 10px;
  color: var(--text);
  background: #ffffff;
  box-shadow: var(--shadow);
  text-align: center;
}

.home-navigation-tile .tile-icon {
  width: 34px;
  height: 34px;
}

.home-navigation-tile strong {
  font-size: 11px;
  line-height: 1.15;
}

.tile,
.project-card,
.contact-card,
.form-panel,
.card,
.settings-card,
.activity-card,
.spotlight-card {
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.tile {
  display: flex;
  min-height: 112px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 14px 8px;
  color: var(--text);
  text-align: center;
  transition: background-color 0.18s ease, transform 0.15s ease;
}

.wide-tool-button {
  display: flex;
  width: 100%;
  min-height: 76px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 0 24px;
  padding: 14px;
  border-radius: 10px;
  color: var(--text);
  background: #ffffff;
  box-shadow: var(--shadow);
  font-weight: 900;
}

.home-business-button {
  margin-bottom: 8px;
}

.page-intro {
  margin: -3px 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.business-hq-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.business-group-list {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.business-group-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.business-group-card h2,
.business-group-card p {
  margin: 0;
}

.business-group-card p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

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

.business-group-grid .business-hq-tile {
  aspect-ratio: auto;
  min-height: 82px;
}

.business-hq-tile {
  display: flex;
  min-width: 0;
  aspect-ratio: 1 / 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 6px;
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
  box-shadow: var(--shadow);
  text-align: center;
}

.business-hq-tile:active {
  transform: scale(0.96);
}

.business-hq-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: var(--tile-colour);
}

.business-hq-icon svg {
  width: 23px;
  height: 23px;
}

.business-hq-tile strong {
  max-width: 100%;
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.business-result-hero {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
  padding: 18px;
}

.business-result-hero > span,
.business-health-grid span,
.business-breakdown span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.business-result-hero > strong {
  color: var(--primary);
  font-size: 30px;
  line-height: 1.1;
}

.business-result-hero.watch > strong {
  color: #7b5200;
}

.business-result-hero.attention > strong {
  color: #8f1e16;
}

.business-result-hero p,
.business-health-grid small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.business-planning-form {
  margin-bottom: 12px;
}

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

.business-breakdown,
.business-health-grid {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.business-breakdown {
  grid-template-columns: 1fr 1fr;
  padding: 14px;
}

.business-breakdown > div,
.business-health-grid > article {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.business-breakdown strong,
.business-health-grid strong {
  font-size: 18px;
}

.business-health-grid {
  grid-template-columns: 1fr 1fr;
}

.business-document-upload {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.business-document-card {
  display: grid;
  gap: 10px;
}

.business-document-card.expiring {
  border-left: 4px solid #f4a620;
}

.business-document-card p {
  color: var(--muted);
  font-size: 12px;
}

.cutlist-upload-button {
  position: relative;
  cursor: pointer;
  text-align: center;
}

.cutlist-upload-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.cutlist-upload-button.disabled {
  opacity: 0.45;
  pointer-events: none;
}

@media (max-width: 620px) {
  .settings-three-col,
  .business-breakdown,
  .business-health-grid {
    grid-template-columns: 1fr;
  }

  .home-control-strip {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 58px;
  }

  .home-control-strip .stat {
    padding: 12px 10px;
  }

  .home-control-strip .stat-label {
    gap: 4px;
    font-size: 9px;
  }

  .home-control-strip .stat strong {
    font-size: 14px;
  }
}

.wide-tool-button .tile-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.flow-wide-button {
  margin: 0 0 14px;
}

.tile:hover {
  background: var(--surface-high);
}

.tile:active,
.project-card:active,
.contact-card:active,
.nav-item:active,
.action-tile:active,
.wide-tool-button:active,
.activity-item:active {
  transform: scale(0.95);
}

.tile-icon,
.action-icon,
.nav-icon {
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--tile-colour, var(--primary));
  font-weight: 800;
}

.tile-icon {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  font-size: 20px;
}

.tile span:last-child {
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
}

.tile.disabled {
  opacity: 0.68;
}

.dashboard-tools {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.dashboard-tools:empty {
  display: none;
}

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

.dashboard-tools .primary-button,
.dashboard-tools .back-hq-button,
.dashboard-tools .upload-button {
  width: 100%;
}

.column-editor {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px;
}

.activity-card {
  overflow: hidden;
  margin-bottom: 16px;
}

.activity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--outline);
  background: #ffffff;
}

.activity-head h2 {
  color: var(--primary);
  font-size: 14px;
  font-weight: 800;
}

.activity-head span {
  color: var(--secondary);
  font-size: 10px;
  text-decoration: underline;
}

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

.activity-section-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.activity-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
}

.activity-icon.leads {
  background: var(--bg-leads);
}

.activity-icon.projects {
  background: var(--bg-projects);
}

.activity-icon.todo {
  background: var(--green);
}

.activity-icon.event {
  background: #607d8b;
}

.activity-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.activity-item strong {
  display: block;
  font-size: 14px;
  line-height: 20px;
}

.activity-item small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 14px;
}

.spotlight-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.spotlight-image {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.56)),
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.6), transparent 18%),
    linear-gradient(135deg, #d8c2a5, #f7f3ed 42%, #9fbf9e);
}

.spotlight-image span {
  position: absolute;
  left: 14px;
  bottom: 12px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
}

.spotlight-card strong {
  display: block;
  font-size: 14px;
}

.spotlight-card p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

/* Dashboard: prevent page scroll from competing with column scroll */
.dashboard-screen {
  height: 100vh;
  height: 100dvh;
  min-height: unset;
  overflow: hidden;
  padding-bottom: 0;
}

.dashboard-screen .screen-inner {
  padding-bottom: 0;
}

/* Horizontal scroll container.
   overflow-x:auto with NO height forces columns to own all horizontal gestures.
   align-items:flex-start lets each column be its natural height (capped by max-height). */
/* .columns is just a viewport window — no scroll, overflow:hidden clips the track */
.columns {
  overflow: hidden;
}

/* .columns-track holds all pipeline columns and moves via transform.
   All columns are painted upfront so scroll is pure compositor — no paint
   ever happens mid-gesture, giving identical smoothness in both directions. */
.columns-track {
  display: flex;
  gap: 12px;
  padding: 2px 12px 14px;
  align-items: flex-start;
  will-change: transform;
  transform: translateX(0);
  transition: transform 320ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* IMPORTANT: overflow must be the shorthand — never set overflow-x/overflow-y
   separately here, as browsers convert overflow-y:visible → auto which creates
   a competing vertical scroll container that swallows horizontal swipe events. */
.pipeline-column {
  flex: 0 0 min(85vw, 360px);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 210px);
  max-height: calc(100dvh - 210px);
  overflow: hidden;
  padding: 0 2px;
  scroll-snap-align: center;
  will-change: transform;
  transform: translateZ(0);
}

.pipeline-column.managing {
  padding: 10px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.35);
}

.column-heading {
  flex: 0 0 auto;
  z-index: 5;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  margin: 0 0 10px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 12px rgba(45, 45, 45, 0.08);
}

.column-body {
  display: grid;
  min-height: 0;
  gap: 10px;
  align-content: start;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: none; /* JS handles all scroll — prevents browser claiming touch before we decide direction */
  padding: 0 2px 64px;
}

.column-number {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: var(--primary);
  font-size: 13px;
  font-weight: 900;
}

.column-title {
  color: var(--primary);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.column-title-input {
  width: 100%;
  min-height: 38px;
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  background: #ffffff;
  font-weight: 800;
}

.column-lock {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.delete-column-button {
  min-height: 38px;
  border-radius: 8px;
  color: #ffffff;
  background: #b1241a;
  font-size: 13px;
  font-weight: 900;
}

.dashboard-header {
  grid-template-columns: 1fr auto;
  align-items: end;
}

.manage-column-button {
  min-height: 30px;
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(45, 45, 45, 0.1);
  font-size: 11px;
  font-weight: 800;
}

.manage-column-button.active {
  color: #ffffff;
  background: #284f83;
}

.project-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  color: var(--text);
  text-align: left;
}

/* Contact cards are slim — just name + action buttons on one row */
.contact-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--text);
  text-align: left;
}

.contact-main {
  flex: 1;
  min-width: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.project-card strong,
.contact-card strong,
.contact-main strong {
  font-size: 16px;
}

.managing-card {
  cursor: default;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  width: fit-content;
  padding: 5px 8px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.move-project-control {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.move-project-control select {
  width: 100%;
  min-height: 40px;
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  background: #f5f5f5;
}

.empty {
  padding: 16px;
  border: 1px dashed rgba(45, 45, 45, 0.18);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.contact-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.contact-actions .action-button,
.contact-actions .upload-button {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 12px;
  white-space: nowrap;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.contacts-search-wrap {
  margin-bottom: 12px;
}

.contacts-search-input {
  width: 100%;
  min-height: 44px;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 15px;
  color: var(--text);
  background: rgba(255,255,255,0.85);
  outline: 0;
}

.contacts-search-input:focus {
  border-color: var(--primary);
  background: #ffffff;
}

.search-prompt {
  padding: 24px 16px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.contact-project-section {
  display: grid;
  gap: 10px;
  margin: 16px 0 14px;
}

.contact-project-section h2 {
  color: var(--primary);
  font-size: 18px;
}

.contact-hq-picker {
  display: grid;
  gap: 10px;
  margin: 16px 0;
  padding: 14px;
}

.contact-hq-picker h3 {
  color: var(--primary);
  font-size: 16px;
}

.action-button,
.primary-button,
.ghost-button {
  min-height: 44px;
  border-radius: 8px;
  padding: 11px 14px;
  font-weight: 800;
  text-align: center;
}

.action-button,
.primary-button {
  color: #ffffff;
  background: var(--green);
}

.ghost-button {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
}

.form-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
}

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

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

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  background: #f5f5f5;
  outline: 0;
}

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

.project-hero,
.site-notes,
.todo-summary {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
  padding: 16px;
}

.project-hero {
  gap: 10px;
  padding: 12px 14px;
}

.project-hero.project-tone-lead,
.todo-summary.project-tone-lead {
  background: var(--bg-leads);
  border-color: rgba(255, 255, 255, 0.72);
}

.project-hero.project-tone-live,
.todo-summary.project-tone-live {
  background: var(--bg-projects);
  border-color: rgba(255, 255, 255, 0.72);
}

.project-hero.project-tone-lead .muted,
.project-hero.project-tone-live .muted,
.todo-summary.project-tone-lead .muted,
.todo-summary.project-tone-live .muted {
  color: rgba(45, 45, 45, 0.76);
}

.project-value-standard {
  margin-top: 5px;
  font-size: 15px;
  font-weight: 900;
}

.project-value-summary {
  display: grid;
  gap: 2px;
  margin-top: 2px;
  padding-top: 6px;
  border-top: 1px solid rgba(45, 45, 45, 0.12);
}

.project-value-summary > span {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px 9px;
}

.project-value-summary small {
  color: rgba(45, 45, 45, 0.72);
  font-size: 11px;
  font-weight: 800;
}

.project-value-summary strong {
  font-size: 18px;
}

.project-value-summary p {
  color: rgba(45, 45, 45, 0.74);
  font-size: 11px;
}

.project-value-summary .project-value-pending {
  color: #7b5200;
  font-weight: 900;
}

.todo-summary {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.todo-summary .company {
  color: rgba(45, 45, 45, 0.7);
  font-size: 13px;
  font-weight: 800;
}

.todo-summary strong {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(45, 45, 45, 0.72);
  font-size: 16px;
}

.todo-list {
  display: grid;
  gap: 0;
  margin-bottom: 14px;
  overflow: hidden;
}

.flow-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  margin-bottom: 14px;
}

.flow-current-result {
  display: grid;
  gap: 10px;
}

.flow-voice-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.flow-toggle {
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid rgba(57, 95, 148, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.flow-listen-button {
  min-height: 42px;
}

.flow-voice-picker {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(180px, 1.4fr) minmax(110px, 0.8fr) minmax(110px, 0.8fr) auto;
  align-items: end;
}

.flow-voice-picker .field {
  margin: 0;
}

.flow-voice-picker input[type="range"] {
  width: 100%;
  accent-color: #395f94;
}

.flow-test-voice {
  min-height: 42px;
}

.flow-voice-guide {
  border: 1px solid rgba(57, 95, 148, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.flow-voice-guide summary {
  padding: 11px 12px;
  color: #395f94;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
}

.flow-voice-guide-body {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.flow-voice-guide-body section {
  display: grid;
  gap: 3px;
}

.flow-voice-guide-body strong {
  font-size: 13px;
}

.flow-voice-guide-body p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.flow-message {
  max-width: 88%;
  padding: 12px 14px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid rgba(57, 95, 148, 0.14);
}

.flow-message p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

.flow-message.user {
  justify-self: end;
  background: #395f94;
}

.flow-message.user p {
  color: #ffffff;
}

.flow-task-list {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.flow-task-list.empty,
.flow-empty {
  padding: 10px 12px;
  border: 1px dashed rgba(57, 95, 148, 0.24);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
}

.flow-task-chip {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid rgba(57, 95, 148, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  text-align: left;
}

.flow-task-chip small {
  color: var(--muted);
  font-size: 12px;
}

.flow-input-row {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto;
  align-items: end;
}

.flow-input-row textarea {
  min-height: 76px;
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  resize: vertical;
  background: #f5f5f5;
}

.flow-action-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.flow-action {
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0, 137, 123, 0.1);
}

.flow-action.pending {
  background: rgba(244, 166, 32, 0.16);
  border: 1px solid rgba(184, 95, 56, 0.24);
}

.flow-action strong,
.flow-action small {
  color: var(--text);
  overflow-wrap: anywhere;
}

.flow-action small {
  font-size: 12px;
  color: var(--muted);
}

.flow-email-action pre {
  margin: 4px 0 0;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.flow-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.flow-action-buttons .primary-button,
.flow-action-buttons .ghost-button {
  min-height: 38px;
  padding: 9px 12px;
  text-decoration: none;
}

.todo-toolbar {
  position: sticky;
  top: 70px;
  z-index: 9;
  margin-bottom: 10px;
  padding: 8px 0;
  background: #c5dcf5;
}

.screen.project-hq.live .todo-toolbar {
  background: #fad5c0;
}

@media (max-width: 720px) {
  .flow-voice-picker {
    grid-template-columns: 1fr;
  }
}

.todo-item {
  display: block;
  padding: 0;
  transition: background-color 0.16s ease;
}

.todo-item + .todo-item {
  border-top: 1px solid var(--border);
}

.todo-item.complete {
  background: #eef8ee;
}

.todo-row {
  display: grid;
  width: 100%;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.todo-check {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 2px solid var(--outline);
  border-radius: 8px;
  background: #ffffff;
}

.todo-check-placeholder {
  display: block;
  width: 24px;
  height: 24px;
}

.todo-check.edit-spacer:not(.checked) {
  visibility: hidden;
}

.todo-check.checked {
  border-color: var(--green);
  background: var(--green);
}

.todo-check.checked::after {
  content: "";
  width: 8px;
  height: 12px;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  transform: rotate(40deg) translateY(-1px);
}

.todo-copy strong {
  display: block;
  color: var(--text);
  font-size: 14px;
}

.todo-copy small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.todo-item.complete .todo-copy strong,
.todo-item.complete .todo-copy small {
  text-decoration: line-through;
}

.todo-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 0 14px 14px 50px;
}

.todo-actions .primary-button,
.todo-actions .ghost-button {
  min-height: 38px;
  padding: 8px;
  font-size: 12px;
}

.todo-actions .danger {
  color: var(--tertiary, #b1241a);
}

.todo-item.editing {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
}

.todo-edit-form {
  display: grid;
  gap: 8px;
}

.todo-edit-form input,
.todo-edit-form textarea {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  background: #f5f5f5;
}

.todo-edit-form textarea {
  min-height: 78px;
  resize: vertical;
}

.todo-edit-form .todo-actions {
  grid-template-columns: 1fr 1fr;
  padding: 0;
}

.full-width-button {
  width: 100%;
}

.back-hq-button {
  display: block;
  min-height: 46px;
  border-radius: 8px;
  padding: 12px 14px;
  color: #ffffff;
  background: #284f83;
  box-shadow: var(--shadow);
  font-weight: 900;
  text-align: center;
}

.upload-button {
  min-height: 44px;
  border-radius: 8px;
  padding: 11px 14px;
  color: #ffffff;
  background: #395f94;
  box-shadow: var(--shadow);
  font-weight: 900;
  text-align: center;
}

.communication-strip,
.action-grid {
  margin-bottom: 14px;
}

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

.action-tile {
  display: grid;
  gap: 8px;
  justify-items: center;
  align-content: center;
  min-height: 82px;
  padding: 10px 8px;
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.action-tile--full {
  grid-column: 1 / -1;
}

.scope-protection-strip {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px 16px;
  color: var(--text);
  text-align: left;
}

.scope-protection-strip span {
  display: grid;
  gap: 3px;
}

.scope-protection-strip small {
  color: var(--muted);
  font-size: 12px;
}

.scope-protection-strip b {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: #9b59b6;
}

.scope-change-form {
  margin-bottom: 12px;
}

.scope-add-button {
  margin-bottom: 12px;
}

.scope-change-list {
  margin-bottom: 12px;
}

.scope-change-card {
  border-left: 4px solid #f4a620;
}

.scope-change-card.approved {
  border-left-color: #5a8a6a;
}

.scope-change-card.declined {
  border-left-color: #b1241a;
  opacity: 0.72;
}

.scope-change-head small,
.scope-impact-row {
  color: var(--muted);
  font-size: 11px;
}

.scope-impact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.scope-approval-note {
  padding: 9px;
  border-radius: 8px;
  background: rgba(90, 138, 106, 0.1);
}

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

.project-info-tabs button {
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid rgba(45, 45, 45, 0.08);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
}

.project-info-tabs button.active {
  color: #ffffff;
  background: #2d6b73;
}

.next-action-label {
  justify-self: start;
  padding: 4px 8px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--secondary);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.action-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 18px;
}

.order-toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.order-count {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(45, 45, 45, 0.72);
  font-size: 18px;
  font-weight: 900;
}

.order-list,
.materials-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.order-card,
.material-card {
  display: grid;
  gap: 9px;
  padding: 14px;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.order-card strong,
.material-card strong {
  font-size: 15px;
}

.order-card span,
.material-card span,
.material-card small {
  color: var(--muted);
  font-size: 13px;
}

.order-card dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
}

.order-card dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.order-card dd {
  margin: 2px 0 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

/* ── Schedule: month calendar view ──────────────────────────────────── */
.cal-nav {
  position: sticky;
  top: 118px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 -2px 10px;
  padding: 8px 2px;
  background: var(--page-bg, var(--bg-schedule));
}

.screen.schedule .cal-nav {
  position: static;
  z-index: auto;
  margin: 6px 0 0;
  padding: 8px 0 0;
}

.screen.schedule {
  height: 100vh;
  height: 100dvh;
  min-height: unset;
  overflow: hidden;
}

.screen.schedule .screen-inner {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}

.screen.schedule .schedule-top-shell {
  position: relative;
  top: auto;
  flex: 0 0 auto;
  z-index: 20;
  margin-bottom: 6px;
}

.screen.schedule .page-intro {
  margin-bottom: 8px;
  font-size: 12px;
  line-height: 1.35;
}

.cal-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.7);
  color: var(--primary);
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
  flex: 0 0 auto;
}

.cal-month-label {
  flex: 1;
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

.cal-today-btn {
  min-height: unset;
  padding: 7px 12px;
  font-size: 12px;
  flex: 0 0 auto;
}

.cal-grid-card {
  overflow: hidden;
  margin-bottom: 10px;
  padding: 0;
}

.screen.schedule .cal-grid-card {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
}

.cal-weekdays span {
  padding: 5px 2px;
  border-right: 1px solid var(--border);
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
}

.cal-weekdays span:last-child {
  border-right: 0;
}

.screen.schedule .cal-week {
  flex: 1 1 0;
  min-height: 66px;
  border-bottom: 1px solid var(--border);
  background-image: repeating-linear-gradient(
    to right,
    transparent 0,
    transparent calc(14.285714% - 1px),
    var(--border) calc(14.285714% - 1px),
    var(--border) 14.285714%
  );
}

.screen.schedule .cal-week:last-child { border-bottom: none; }

.cal-day-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.cal-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3px 0 2px;
  background: transparent;
  border-right: 1px solid var(--border);
}

.cal-day:last-child { border-right: none; }

.cal-day-num {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}

.cal-day.today .cal-day-num {
  background: var(--secondary);
  color: #ffffff;
  font-weight: 800;
}

.cal-day.faded .cal-day-num {
  color: var(--muted);
  opacity: 0.45;
}

.cal-pay-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  margin-top: 1px;
}

/* Bars overlay: CSS grid with 7 cols, rows determined by --lanes */
.cal-bars {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: repeat(var(--lanes, 1), 18px);
  gap: 1px;
  padding: 1px 2px 3px;
}

.cal-bar {
  min-width: 0;
  height: 18px;
  border-radius: 3px;
  padding: 0 3px;
  color: #ffffff;
  background: var(--project-colour, var(--secondary));
  border-left: 3px solid rgba(255, 255, 255, 0.55);
  font-size: 8px;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 3px;
  opacity: 0.95;
}

.cal-bar .stage-pill,
.cal-bar .bar-pay {
  min-width: 12px;
  height: 12px;
  border-radius: 3px;
  font-size: 8px;
}

.cal-bar.production { background-image: linear-gradient(135deg, rgba(255,255,255,0.18) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.18) 50%, rgba(255,255,255,0.18) 75%, transparent 75%, transparent); background-size: 8px 8px; }
.cal-bar.install { box-shadow: inset 0 -3px 0 rgba(255, 255, 255, 0.36); }
.cal-bar.event { background: #607d8b; border-left-color: rgba(255, 255, 255, 0.76); }

/* Keep old schedule-editor and modal styles intact */
.schedule-editor {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

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

.schedule-empty-editor {
  margin-bottom: 14px;
}

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

.photo-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.photo-button {
  display: grid;
  place-items: center;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.photo-slot {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.65);
  font-size: 12px;
  font-weight: 800;
}

.photo-preview {
  position: relative;
  overflow: hidden;
  margin: 0;
  aspect-ratio: 1;
  border-radius: 8px;
  background: #f5f5f5;
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-preview button {
  position: absolute;
  right: 6px;
  bottom: 6px;
  min-height: 30px;
  border-radius: 999px;
  padding: 6px 9px;
  color: #ffffff;
  background: rgba(177, 36, 26, 0.92);
  font-size: 11px;
  font-weight: 800;
}

.customer-type-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.simplified-project-form {
  gap: 12px;
}

.advanced-options {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.58);
}

.advanced-options summary {
  cursor: pointer;
  padding: 12px 14px;
  color: var(--secondary);
  font-size: 13px;
  font-weight: 900;
}

.advanced-options-content {
  display: grid;
  gap: 12px;
  padding: 0 12px 12px;
}

.type-btn {
  min-height: 48px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: rgba(255, 255, 255, 0.55);
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  transition: all 0.15s ease;
}

.type-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.contact-select-list {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  padding: 2px 0;
}

.contact-select-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: rgba(255, 255, 255, 0.55);
  color: var(--text);
  text-align: left;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.contact-select-item strong {
  font-size: 14px;
}

.contact-select-item span {
  color: var(--muted);
  font-size: 12px;
}

.contact-select-item.selected {
  border-color: var(--primary);
  background: #ffffff;
}

.no-results {
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

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

.settings-card {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.settings-card p {
  color: var(--muted);
  font-size: 13px;
}

.workflow-readiness-card {
  border: 1px solid rgba(57, 95, 148, 0.22);
  background: rgba(255, 255, 255, 0.82);
}

.workflow-readiness-card.needs-work {
  border-color: rgba(177, 36, 26, 0.28);
}

.workflow-status-pill {
  justify-self: start;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(90, 138, 106, 0.16);
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.workflow-status-pill.warning {
  background: rgba(177, 36, 26, 0.12);
  color: #8f1e16;
}

.workflow-issue-list {
  display: grid;
  gap: 6px;
}

.workflow-issue-list p {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.workflow-issue-list span {
  color: var(--muted);
  font-size: 12px;
}

.trigger-method-options {
  display: grid;
  gap: 7px;
  padding: 9px;
  border: 1px solid rgba(45, 45, 45, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
}

.trigger-method-options > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.trigger-method-options .settings-toggle {
  min-height: 34px;
  padding: 6px 8px;
}

.trigger-contact-method {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(57, 95, 148, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.trigger-contact-method + .trigger-contact-method {
  margin-top: 8px;
}

.trigger-contact-method > strong {
  font-size: 14px;
}

.archived-lead-list {
  margin-bottom: 14px;
}

.archived-lead-card {
  gap: 10px;
}

.archived-lead-card small {
  color: var(--muted);
}

.close-lead-button {
  color: #8f1e16;
  border-color: rgba(177, 36, 26, 0.22);
  background: rgba(255, 255, 255, 0.72);
}

.contact-archive-actions {
  margin: 12px 0;
}

.workshop-tools-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.workshop-tool-list {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.workshop-list-tile {
  display: grid;
  width: 100%;
  min-height: 92px;
  grid-template-columns: 56px 1fr;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
  box-shadow: var(--shadow);
}

.workshop-list-tile:active {
  transform: scale(0.98);
}

.workshop-list-icon {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border-radius: 8px;
  background: var(--secondary);
  color: #ffffff;
  font-weight: 900;
}

.workshop-list-tile strong,
.workshop-list-tile small {
  display: block;
}

.workshop-list-tile strong {
  font-size: 17px;
  line-height: 23px;
}

.workshop-list-tile small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 17px;
}

.workshop-tool-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.workshop-tool-visual {
  display: grid;
  min-height: 74px;
  place-items: center;
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(57, 95, 148, 0.2), rgba(90, 138, 106, 0.16)),
    #ffffff;
}

.workshop-tool-visual span {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 14px;
  background: #ffffff;
  color: var(--secondary);
  font-size: 20px;
  font-weight: 900;
  box-shadow: var(--shadow);
}

.workshop-tool-copy h3 {
  margin: 0;
}

.workshop-tool-copy p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.workshop-tool-copy small {
  display: block;
  margin-top: 6px;
  color: var(--secondary);
  font-size: 11px;
  font-weight: 700;
  line-height: 15px;
}

.workshop-tool-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.workshop-tool-inputs label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.workshop-tool-inputs input {
  width: 100%;
  min-height: 38px;
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  background: #ffffff;
  color: var(--text);
}

.workshop-tool-result {
  display: block;
  padding: 10px;
  border-radius: 8px;
  background: rgba(90, 138, 106, 0.14);
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
}

.cutlist-screen .screen-inner {
  width: min(100%, 230mm);
}

.cutlist-toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.cutlist-project-label {
  font-size: 13px;
  padding: 8px 0;
}

.cutlist-project-select {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.cutlist-project-select select {
  width: 100%;
  min-height: 42px;
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  background: #ffffff;
  color: var(--text);
}

.cutlist-save-status {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.cutlist-optimizer-summary {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.cutlist-material-prompt {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.cutlist-material-prompt form {
  display: grid;
  gap: 10px;
}

.cutlist-start-card {
  display: grid;
  gap: 14px;
}

.cutlist-start-card .settings-list {
  gap: 8px;
}

.cutlist-optimizer-summary p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(90, 138, 106, 0.12);
  font-size: 12px;
}

.cutlist-optimizer-summary span,
.cutlist-optimizer-summary small {
  color: var(--muted);
  font-size: 12px;
}

.cutlist-optimizer-settings {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.cutlist-optimizing-modal {
  align-items: center;
  text-align: center;
}

.hourglass-loader {
  width: 34px;
  height: 46px;
  border: 3px solid var(--secondary);
  border-top-color: var(--orange);
  border-bottom-color: var(--orange);
  border-radius: 18px;
  animation: hourglass-spin 1.1s ease-in-out infinite;
}

@keyframes hourglass-spin {
  0%, 35% { transform: rotate(0deg); }
  70%, 100% { transform: rotate(180deg); }
}

.cutlist-plan {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.cutlist-plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text);
  font-size: 12px;
}

.cutlist-plan-board {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 120px;
  border: 2px solid #303030;
  background:
    linear-gradient(90deg, rgba(48, 48, 48, 0.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(48, 48, 48, 0.05) 1px, transparent 1px),
    #f8f5ef;
  background-size: 24px 24px;
}

.cutlist-plan-usable {
  position: absolute;
  border: 1px dashed rgba(177, 36, 26, 0.5);
  background: rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

.cutlist-plan-part {
  position: absolute;
  display: grid;
  min-width: 18px;
  min-height: 18px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #395f94;
  background: rgba(74, 111, 165, 0.24);
  color: #203a5e;
  text-align: center;
}

.cutlist-plan-part strong {
  font-size: 11px;
  line-height: 13px;
}

.cutlist-plan-part small {
  max-width: 100%;
  padding: 0 2px;
  color: #203a5e;
  font-size: 8px;
  line-height: 10px;
}

.cutlist-plan-part em {
  color: #203a5e;
  font-size: 8px;
  font-style: normal;
  line-height: 10px;
}

.cutlist-a4 {
  width: 100%;
  margin: 0 auto 18px;
  padding: 12px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  background: #ffffff;
  color: #202020;
  box-shadow: var(--shadow);
}

.cutlist-title-block {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.cutlist-title-main {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #202020;
}

.cutlist-title-main h2 {
  font-size: 22px;
  line-height: 28px;
}

.cutlist-title-main strong {
  color: #202020;
  font-size: 12px;
}

.cutlist-title-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.cutlist-title-grid label {
  display: grid;
  gap: 3px;
  color: #555555;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.cutlist-title-grid input {
  width: 100%;
  min-height: 34px;
  border: 1px solid #b8b8b8;
  border-radius: 0;
  padding: 6px 8px;
  background: #ffffff;
}

.cutlist-ref-field {
  background: #f4f4f4 !important;
  color: #555;
  cursor: default;
  font-weight: 600;
}

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

.cutlist-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.cutlist-table th,
.cutlist-table td {
  border: 1px solid #8f8f8f;
  padding: 0;
  vertical-align: middle;
}

.cutlist-table th {
  height: 30px;
  padding: 6px;
  background: #efefef;
  font-size: 11px;
  text-align: left;
}

.cutlist-table th:nth-child(1),
.cutlist-table td:nth-child(1) {
  width: 44px;
  text-align: center;
}

.cutlist-table th:nth-child(2) {
  width: 190px;
}

.cutlist-table th:nth-child(3),
.cutlist-table th:nth-child(4) {
  width: 92px;
}

.cutlist-table th:nth-child(5) {
  width: 150px;
}

.cutlist-number {
  color: #202020;
  font-weight: 900;
}

.cutlist-table input,
.cutlist-table select {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 0;
  padding: 6px 7px;
  background: #ffffff;
  color: #202020;
  font-size: 12px;
}

.cutlist-table select {
  cursor: pointer;
}

.project-file-card {
  display: grid;
  gap: 10px;
}

.communication-preview {
  max-height: 220px;
  margin: 0;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow: auto;
}

.communication-thread-shell {
  display: grid;
  gap: 14px;
}

.communication-thread-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(45, 45, 45, 0.08);
  border-radius: 8px;
  background: #ffffff;
}

.communication-thread-header h2,
.communication-thread-header p {
  margin: 0;
}

.communication-thread-header p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.communication-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.communication-code {
  display: inline-block;
  margin-bottom: 6px;
  color: #2d6b73;
  font-size: 12px;
  font-weight: 900;
}

.communication-thread {
  display: grid;
  gap: 12px;
}

.communication-message {
  display: grid;
  width: min(88%, 680px);
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(45, 45, 45, 0.08);
  border-radius: 8px;
  background: #ffffff;
}

.communication-message.incoming {
  justify-self: start;
  border-left: 4px solid #2d6b73;
}

.communication-message.outgoing {
  justify-self: end;
  border-right: 4px solid #6f4a7e;
  background: #f8f5fa;
}

.communication-message h3 {
  margin: 0;
  font-size: 14px;
}

.communication-message-head,
.email-capture-address {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.communication-message-head > div {
  display: grid;
  gap: 2px;
}

.communication-message-head small,
.communication-direction {
  color: var(--muted);
  font-size: 11px;
}

.communication-direction {
  font-weight: 800;
}

.communication-note {
  margin-top: 8px;
}

.communication-notes-section {
  margin-top: 14px;
}

.email-capture-address {
  padding: 12px;
  border-radius: 8px;
  background: rgba(45, 107, 115, 0.08);
}

.email-capture-setup {
  display: grid;
  gap: 14px;
}

.email-capture-setup h2,
.email-capture-setup h3,
.email-capture-setup p {
  margin: 0;
}

.email-capture-benefit,
.email-code-explainer,
.email-capture-result {
  display: grid;
  gap: 5px;
  padding: 13px;
  border-radius: 8px;
}

.email-capture-benefit {
  border-left: 4px solid #2d6b73;
  background: rgba(45, 107, 115, 0.08);
}

.email-code-explainer {
  background: rgba(111, 74, 126, 0.08);
}

.email-capture-result {
  border-left: 4px solid #5a8a6a;
  background: rgba(90, 138, 106, 0.1);
}

.email-capture-benefit p,
.email-code-explainer p,
.email-capture-result p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.email-capture-address > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.email-capture-address strong {
  overflow-wrap: anywhere;
}

.email-capture-steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
}

@media (max-width: 640px) {
  .communication-thread-header {
    display: grid;
  }

  .communication-thread-header .primary-button {
    width: 100%;
  }

  .communication-header-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .communication-message {
    width: 94%;
  }
}

.production-spec-card,
.production-section-card {
  gap: 14px;
}

.production-spec-grid {
  display: grid;
  gap: 12px;
}

.production-spec-grid textarea {
  min-height: 86px;
}

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

.supplier-order-group {
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.supplier-order-head {
  display: flex;
  width: 100%;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.supplier-order-head span:first-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.supplier-order-head strong {
  font-size: 16px;
  line-height: 22px;
}

.supplier-order-head small {
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.supplier-order-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 14px 12px;
}

.disabled-link {
  display: grid;
  min-height: 44px;
  place-items: center;
  opacity: 0.6;
}

.supplier-call-list {
  display: grid;
  gap: 0;
  margin: 0 14px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.supplier-call-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  padding: 10px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}

.supplier-call-row:last-child {
  border-bottom: 0;
}

.supplier-call-row small {
  grid-column: 1 / -1;
  color: var(--muted);
  line-height: 17px;
}

.compact-order-list {
  margin: 0 14px 14px;
}

.finance-editor-card,
.finance-file-card {
  gap: 14px;
}

.finance-line-list {
  display: grid;
  gap: 8px;
}

.finance-line-row {
  display: grid;
  grid-template-columns: 1fr 76px 96px;
  gap: 8px;
}

.finance-line-row input {
  min-width: 0;
}

.finance-sync-fields {
  padding: 12px;
  border-radius: 8px;
  background: rgba(96, 125, 139, 0.12);
}

.finance-document-preview {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.finance-doc-head,
.finance-doc-meta,
.finance-doc-totals {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.finance-doc-head img {
  max-width: 150px;
  max-height: 70px;
  object-fit: contain;
}

.finance-doc-head strong {
  display: block;
  font-size: 22px;
  text-align: right;
}

.finance-doc-head span,
.finance-doc-head small {
  display: block;
  text-align: right;
}

.finance-doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

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

.finance-doc-totals {
  justify-content: flex-end;
  flex-wrap: wrap;
}

@media (max-width: 520px) {
  .finance-line-row {
    grid-template-columns: 1fr;
  }

  .finance-doc-head,
  .finance-doc-meta {
    display: grid;
  }
}

.cutlist-table input:focus,
.cutlist-table select:focus,
.cutlist-title-grid input:focus {
  outline: 2px solid var(--secondary);
  outline-offset: -2px;
}

@media (min-width: 390px) {
  .workshop-tools-grid {
    grid-template-columns: 1fr 1fr;
  }

  .workshop-tool-inputs {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 900px) {
  .screen.cutlist-screen {
    padding-right: 24px;
    padding-left: 24px;
  }

  .cutlist-a4 {
    width: 210mm;
    min-height: 297mm;
    padding: 14mm;
  }

  .cutlist-toolbar {
    grid-template-columns: minmax(220px, 1fr) repeat(6, auto);
    align-items: end;
  }

  .cutlist-title-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .cutlist-title-grid label:nth-child(7) {
    grid-column: span 2;
  }

  .cutlist-table {
    min-width: 0;
  }
}

@media print {
  .top-shell,
  .cutlist-toolbar,
  .nav,
  .cutlist-optimizer-settings,
  .cutlist-material-prompt,
  .cutlist-screen .back-hq-button {
    display: none !important;
  }

  .screen,
  .screen-inner {
    width: 210mm !important;
    min-height: auto;
    padding: 0 !important;
    background: #ffffff !important;
  }

  .cutlist-a4 {
    width: 210mm;
    min-height: 297mm;
    margin: 0;
    padding: 10mm;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    break-after: page;
    page-break-after: always;
  }

  .cutlist-a4:last-of-type {
    break-after: auto;
    page-break-after: auto;
  }

  body.print-cutlist-only .cutlist-optimizer-summary {
    display: none !important;
  }

  body.print-optimizer-only .cutlist-a4,
  body.print-optimizer-only .cutlist-save-status,
  body.print-optimizer-only datalist {
    display: none !important;
  }

  body.print-optimizer-only .cutlist-optimizer-summary {
    display: grid !important;
    gap: 8mm;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  body.print-optimizer-only .cutlist-plan {
    break-after: page;
    page-break-after: always;
    border-color: #222222;
    box-shadow: none;
  }

  body.print-optimizer-only .cutlist-plan:last-of-type {
    break-after: auto;
    page-break-after: auto;
  }
}

.nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  padding: 8px 12px calc(16px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 -8px 20px rgba(45, 45, 45, 0.12);
  backdrop-filter: blur(12px);
}

.nav-inner {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  width: min(100%, 430px);
  margin: 0 auto;
}

.nav-item {
  display: grid;
  gap: 4px;
  justify-items: center;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  font-weight: 800;
}

.nav-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  font-size: 16px;
  /* No opacity reduction — icons stay full brightness on every page */
}

.nav-item.active {
  color: var(--primary);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: end center;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  padding: 12px 12px max(12px, env(safe-area-inset-bottom));
  background: rgba(45, 45, 45, 0.42);
  overflow: hidden;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.modal {
  width: min(100%, 430px);
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px - env(safe-area-inset-bottom));
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
  border-radius: 12px;
  background: #ffffff;
  box-shadow: var(--shadow);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

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

.quick-add-option {
  display: grid;
  min-width: 0;
  min-height: 118px;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 12px 9px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.82);
  text-align: center;
}

.quick-add-option > span:last-child {
  display: grid;
  gap: 3px;
}

.quick-add-option small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
}

.quick-add-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  color: #ffffff;
  background: var(--secondary);
}

.quick-add-icon svg {
  width: 21px;
  height: 21px;
}

.full-action-list {
  max-height: 65vh;
  overflow-y: auto;
}

.schedule-modal {
  max-height: min(88vh, 720px);
}

.modal-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
}

.modal-close {
  min-height: 38px;
  padding: 8px 10px;
}

.onboarding-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: end center;
  padding: 16px;
  background: rgba(45, 45, 45, 0.36);
}

.onboarding-card,
.onboarding-panel {
  width: min(100%, 520px);
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 40px rgba(45, 45, 45, 0.18);
}

.onboarding-panel {
  position: fixed;
  right: 16px;
  z-index: 70;
  max-height: min(72vh, 560px);
  overflow-y: auto;
  transition: opacity 160ms ease, visibility 160ms ease;
}

.onboarding-panel.is-playing {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.onboarding-panel.bottom {
  bottom: 16px;
}

.onboarding-panel.top {
  top: 16px;
}

@media (max-width: 620px) {
  .onboarding-panel {
    left: 12px;
    right: 12px;
    width: auto;
    max-height: 58vh;
  }

  .onboarding-panel.top {
    top: 12px;
  }

  .onboarding-panel.bottom {
    bottom: 12px;
  }
}

.onboarding-kicker,
.onboarding-progress {
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.onboarding-card h2,
.onboarding-panel h2 {
  margin: 0;
  font-size: 22px;
  line-height: 28px;
}

.onboarding-card p,
.onboarding-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 22px;
}

.onboarding-progress,
.onboarding-actions,
.onboarding-audio-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.onboarding-actions {
  justify-content: stretch;
}

.onboarding-actions button {
  flex: 1;
}

.onboarding-audio-row {
  justify-content: flex-start;
  padding: 10px;
  border-radius: 8px;
  background: rgba(90, 138, 106, 0.12);
}

.onboarding-audio-row span {
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.onboarding-close {
  min-height: 34px;
  padding: 7px 10px;
}

.onboarding-highlight {
  position: relative;
  z-index: 45;
  outline: 3px solid rgba(54, 101, 72, 0.85);
  outline-offset: 6px;
  box-shadow: 0 0 0 10px rgba(54, 101, 72, 0.16);
  animation: onboarding-focus-pulse 1.8s ease-in-out infinite;
}

@keyframes onboarding-focus-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 8px rgba(54, 101, 72, 0.12);
  }
  50% {
    box-shadow: 0 0 0 14px rgba(54, 101, 72, 0.2);
  }
}

button:disabled {
  cursor: default;
  opacity: 0.45;
}

@media (min-width: 760px) {
  .screen {
    padding-top: 0;
  }

  .screen-inner {
    width: min(100%, 760px);
  }

  .tile-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .pipeline-column {
    flex-basis: 340px;
  }

  .onboarding-backdrop {
    place-items: center;
  }
}

/* ── Order cards ─────────────────────────────── */
.order-card {
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.65);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 8px;
}

.order-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.order-tick {
  display: grid;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  color: #ffffff;
}

.order-tick.checked {
  border-color: var(--green);
  background: var(--green);
}

.order-tick svg {
  width: 14px;
  height: 14px;
}

.order-copy {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 3px;
}

.order-copy strong {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-copy small {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-badge {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  color: #ffffff;
}

.ordered-badge {
  background: var(--green);
}

.order-card .todo-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
  gap: 8px;
  padding: 0 14px 14px;
}

.order-card.editing {
  border: 2px solid var(--primary);
}

.order-edit-form {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.order-add-form {
  margin-bottom: 14px;
}

.order-add-form h3 {
  font-size: 15px;
  margin-bottom: 4px;
}

/* ── Materials page ──────────────────────────── */
.materials-section {
  display: grid;
  gap: 0;
  padding: 0;
  overflow: hidden;
  margin-bottom: 12px;
}

.materials-section-title {
  padding: 12px 14px 10px;
  font-size: 13px;
  font-weight: 800;
  color: var(--primary);
  border-bottom: 1px solid var(--border);
}

.material-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.material-row:last-child {
  border-bottom: none;
}

.material-tick {
  display: grid;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  color: #ffffff;
}

.material-tick.checked {
  border-color: var(--green);
  background: var(--green);
}

.material-tick svg {
  width: 12px;
  height: 12px;
}

.material-info {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.material-info strong {
  font-size: 13px;
}

.material-info small {
  color: var(--muted);
  font-size: 11px;
}

.material-cost {
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.suppliers-link-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  margin-bottom: 12px;
}

.suppliers-link-card h3 {
  font-size: 14px;
}

/* ── Suppliers page ──────────────────────────── */
.supplier-card {
  width: 100%;
  gap: 6px;
  padding: 14px;
  text-align: left;
  cursor: pointer;
}

.supplier-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.supplier-chevron {
  color: var(--muted);
  font-size: 20px;
  font-weight: 300;
  line-height: 1;
}

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

.supplier-link {
  display: block;
  color: var(--secondary);
  font-size: 13px;
  text-decoration: underline;
}

/* ── Supplier detail ─────────────────────────── */
.supplier-detail-card {
  display: grid;
  gap: 0;
  padding: 0;
  overflow: hidden;
  margin-bottom: 12px;
}

.supplier-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.supplier-contact-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.supplier-detail-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  text-decoration: none;
}

.supplier-detail-row:last-child {
  border-bottom: none;
}

.supplier-detail-label {
  flex: 0 0 90px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding-top: 1px;
}

.supplier-detail-section {
  border-top: 1px solid var(--border);
}

.supplier-detail-section h3 {
  padding: 10px 16px 4px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.danger {
  color: #c0392b;
}

.materials-section-title.standalone {
  font-size: 13px;
  font-weight: 800;
  color: var(--primary);
  padding: 4px 0 8px;
  margin-bottom: 0;
}

.order-toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

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

.header-brand-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.page-help-button {
  display: grid;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(54, 101, 72, 0.42);
  border-radius: 50%;
  background: #fff;
  color: var(--primary);
  font-family: Georgia, serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 3px 10px rgba(45, 45, 45, 0.08);
}

.page-help-button:hover,
.page-help-button:focus-visible {
  background: rgba(90, 138, 106, 0.12);
  border-color: var(--primary);
}

.required-setup-screen {
  min-height: 100vh;
  padding: 24px 14px;
  background: #f4f5f2;
}

.required-setup-inner {
  width: min(100%, 650px);
  margin: 0 auto;
}

.required-setup-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.required-setup-brand .buildflow-header-logo {
  width: min(300px, 76vw);
  height: 96px;
}

.required-setup-card {
  width: 100%;
  gap: 18px;
  padding: clamp(20px, 5vw, 34px);
}

.required-setup-card h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.15;
}

.required-setup-card > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.required-setup-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.required-setup-benefits {
  display: grid;
  gap: 10px;
}

.required-setup-benefits > div {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-left: 4px solid var(--secondary);
  background: rgba(90, 138, 106, 0.09);
}

.required-setup-benefits span,
.required-setup-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 19px;
}

.required-setup-address {
  margin: 0;
}

.forwarding-test-subject {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px dashed rgba(54, 101, 72, 0.5);
  border-radius: 6px;
  background: rgba(90, 138, 106, 0.08);
  overflow-wrap: anywhere;
}

.forwarding-test-subject small {
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
}

.button-link {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.success-notice {
  border-color: rgba(54, 101, 72, 0.45);
  background: rgba(90, 138, 106, 0.12);
}

.title-row h1 {
  min-width: 0;
}

.page-title-block {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.page-title-block h1 {
  overflow-wrap: anywhere;
}

.page-action-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
}

.page-action-row .manage-column-button {
  flex: 0 0 auto;
}

.page-company {
  overflow: hidden;
  font-size: 12px;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-read-panel {
  gap: 0;
  overflow: hidden;
  padding: 0;
}

.contact-read-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--border);
}

.contact-read-row:last-child {
  border-bottom: 0;
}

.contact-read-row > span:first-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.copyable-value {
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  overflow-wrap: anywhere;
  user-select: text;
}

.danger-button {
  background: #b1241a;
}

.ghost-button.danger {
  color: #b1241a;
}

.project-hero-main {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.project-hero-heading,
.project-hero-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.project-hero-heading h2,
.project-hero-meta p {
  min-width: 0;
  margin: 0;
}

.project-hero-heading h2 {
  font-size: 18px;
  line-height: 1.2;
}

.project-hero-value {
  flex: 0 0 auto;
  font-size: 17px;
  line-height: 1.2;
}

.project-hero-meta p {
  color: rgba(45, 45, 45, 0.78);
  font-size: 12px;
  line-height: 1.3;
}

.project-hero-meta .badge {
  flex: 0 0 auto;
}

/* ── Cashflow page ───────────────────────────────────────────────────── */
.period-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}

.period-btn {
  padding: 9px 4px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: rgba(255,255,255,0.55);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  transition: all 0.15s ease;
}

.period-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.cf-card {
  display: grid;
  padding: 0;
  overflow: hidden;
  margin-bottom: 12px;
}

.cf-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.cf-card-head h2 {
  font-size: 16px;
}

.cf-card-head p {
  font-size: 12px;
  margin-top: 2px;
}

.cf-total {
  font-size: 18px;
  font-weight: 800;
  white-space: nowrap;
}

.cf-incoming {
  color: var(--primary);
}

.cf-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
}

.cf-line:last-of-type {
  border-bottom: none;
}

.cf-line-info {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.cf-line-info strong {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cf-line-info small {
  color: var(--muted);
  font-size: 11px;
}

.cf-line-amount {
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.cf-line-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.overhead-line.paused {
  opacity: 0.58;
  background: rgba(96, 125, 139, 0.06);
}

.overhead-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.overhead-actions .ghost-button {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 11px;
}

.cf-delete-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(177,36,26,0.1);
  color: #b1241a;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.cf-empty {
  padding: 14px 16px;
  color: var(--muted);
  font-size: 13px;
}

.cf-add-form {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}

.overhead-form {
  background: rgba(255, 255, 255, 0.68);
}

.overhead-recovery-card {
  padding-bottom: 14px;
}

.overhead-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px;
}

.overhead-metrics div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.overhead-metrics span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.overhead-metrics strong {
  color: var(--text);
  font-size: 20px;
}

.overhead-hours-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 0 16px;
}

.overhead-recovery-card > .field-help {
  padding: 10px 16px 0;
}

@media (max-width: 620px) {
  .overhead-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .overhead-line .cf-line-right {
    width: 100%;
    justify-content: space-between;
  }

  .overhead-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .overhead-metrics,
  .overhead-hours-form {
    grid-template-columns: 1fr;
  }
}

.cf-summary {
  padding: 20px 16px;
  text-align: center;
  margin-bottom: 12px;
}

.cf-summary.cf-positive {
  border-color: rgba(90,138,106,0.4);
  background: rgba(90,138,106,0.08);
}

.cf-summary.cf-negative {
  border-color: rgba(177,36,26,0.3);
  background: rgba(177,36,26,0.06);
}

.cf-summary-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.cf-net {
  display: block;
  font-size: 36px;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 8px;
}

.cf-summary.cf-positive .cf-net { color: var(--primary); }
.cf-summary.cf-negative .cf-net { color: #b1241a; }

.overhead-metrics small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.trigger-editor-mini {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--outline);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.trigger-editor-mini label,
.compact-field span {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.trigger-editor-mini input,
.trigger-editor-mini select,
.trigger-editor-mini textarea,
.compact-field select,
.compact-field input {
  width: 100%;
  min-height: 38px;
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
}

.trigger-editor-mini textarea {
  resize: vertical;
}

.trigger-action-card {
  border-color: rgba(57, 95, 148, 0.25);
  background: rgba(255, 255, 255, 0.86);
}

.trigger-action-stack {
  display: grid;
  gap: 8px;
}

.reminder-grid {
  display: grid;
  gap: 8px;
}

.cal-event-dot {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--purple);
  box-shadow: 0 0 0 2px #fff;
}

.cf-mini-totals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 8px 0;
}

.cf-mini-totals span {
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.65);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.cf-line.paid {
  margin-inline: -6px;
  padding-inline: 6px;
  border-radius: 8px;
  background: rgba(90, 138, 106, 0.14);
}

.email-template-group {
  gap: 10px;
}

.email-template-row {
  display: grid;
  gap: 2px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.email-template-row small {
  color: var(--muted);
  font-size: 12px;
}

.cal-day {
  position: relative;
}

.trigger-editor-note {
  color: var(--secondary);
  font-size: 11px;
  font-weight: 900;
}

.reminder-date-row {
  display: grid;
  gap: 8px;
}

.trigger-outcome-actions {
  display: grid;
  gap: 8px;
}

.user-settings-form {
  gap: 14px;
}

.settings-section-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.settings-section-nav button {
  min-height: 40px;
  padding: 8px;
  border: 1px solid rgba(45, 45, 45, 0.08);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.66);
  font-size: 12px;
  font-weight: 900;
}

.settings-section-nav button.active {
  color: #ffffff;
  background: var(--secondary);
}

.user-settings-form > section {
  display: none;
}

.user-settings-form[data-active-section="profile"] > section:nth-of-type(1),
.user-settings-form[data-active-section="email"] > section:nth-of-type(2),
.user-settings-form[data-active-section="account"] > section:nth-of-type(3),
.user-settings-form[data-active-section="account"] > section:nth-of-type(11),
.user-settings-form[data-active-section="preferences"] > section:nth-of-type(4),
.user-settings-form[data-active-section="materials"] > section:nth-of-type(5),
.user-settings-form[data-active-section="finance"] > section:nth-of-type(6),
.user-settings-form[data-active-section="finance"] > section:nth-of-type(7),
.user-settings-form[data-active-section="notifications"] > section:nth-of-type(8),
.user-settings-form[data-active-section="workflow"] > section:nth-of-type(9),
.user-settings-form[data-active-section="workflow"] > section:nth-of-type(10) {
  display: grid;
}

.settings-save-button {
  position: sticky;
  bottom: 82px;
  z-index: 5;
  width: 100%;
}

.settings-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.settings-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.settings-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.settings-toggle.locked-toggle {
  align-items: flex-start;
  border-color: rgba(113, 121, 114, 0.35);
  background: rgba(255, 255, 255, 0.42);
  color: var(--muted);
}

.settings-toggle.locked-toggle input {
  accent-color: var(--muted);
  opacity: 0.65;
}

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

.settings-toggle.locked-toggle small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
}

#buildflowEmail[readonly] {
  color: var(--secondary);
  background: #ffffff;
  font-weight: 800;
}

.business-logo-img,
.business-logo-placeholder {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.business-logo-img {
  object-fit: contain;
  padding: 5px;
}

.business-logo-placeholder {
  color: var(--primary);
  font-size: 15px;
  font-weight: 900;
}

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

.logo-preview .business-logo-img,
.logo-preview .business-logo-placeholder {
  width: 64px;
  height: 64px;
}

.logo-upload-button {
  display: grid;
  min-height: 44px;
  place-items: center;
}

.trigger-choice-modal {
  gap: 12px;
}

.trigger-choice-footer {
  display: grid;
  width: 100%;
  margin-top: 4px;
}

.trigger-popup-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.action-section {
  border-color: rgba(90, 138, 106, 0.28);
  background: rgba(90, 138, 106, 0.12);
}

.delay-section {
  border-color: rgba(177, 36, 26, 0.18);
  background: rgba(177, 36, 26, 0.08);
}

.trigger-popup-heading {
  display: grid;
  gap: 2px;
}

.trigger-popup-heading strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.trigger-popup-heading span,
.trigger-template-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.trigger-template-note {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  font-weight: 800;
}

.delay-section .delay-button.primary-button {
  background: #8f4a45;
}

.delay-section .delay-button.upload-button,
.delay-section .delay-button.ghost-button {
  color: #7b332f;
  background: rgba(255, 255, 255, 0.7);
}

.notification-settings-card {
  gap: 14px;
}

.notification-day-list {
  display: grid;
  gap: 8px;
}

.notification-day-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 8px;
  align-items: center;
}

.notification-day-row input[type="time"] {
  width: 100%;
  min-height: 42px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--text);
  font-weight: 800;
}

@media (max-width: 390px) {
  .notification-day-row {
    grid-template-columns: 1fr;
  }
}



.notification-break-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(96, 125, 139, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.58);
}


.screen.home .appbar {
  min-height: 72px;
  align-items: center;
}

.home-logo-bar {
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  padding-bottom: 4px;
}

.home-logo-bar .internal-brand {
  grid-column: 2;
}

.home-logo-bar > .business-logo-img,
.home-logo-bar > .business-logo-placeholder {
  grid-column: 3;
  justify-self: end;
}

.screen.home .appbar > .business-logo-img,
.screen.home .appbar > .business-logo-placeholder {
  width: 64px;
  height: 64px;
  aspect-ratio: 1;
  align-self: center;
  object-fit: contain;
  border-radius: 14px;
}

.todo-date-field {
  margin-top: 8px;
}

.todo-due {
  color: var(--secondary);
  font-weight: 800;
}

.todo-due.overdue,
.todo-item.overdue .todo-copy strong {
  color: #9f332b;
}

.todo-item.overdue {
  border-color: rgba(177, 36, 26, 0.22);
  background: rgba(255, 218, 214, 0.42);
}

.payment-settings-card {
  gap: 12px;
}

.payment-stage-list {
  display: grid;
  gap: 8px;
}

.payment-stage-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 8px;
}

.payment-stage-row input {
  min-height: 42px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font-weight: 800;
}


.schedule-key {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  padding: 0 2px 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.schedule-key span {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.schedule-key b,
.stage-pill,
.bar-pay {
  display: inline-grid;
  min-width: 14px;
  height: 14px;
  place-items: center;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  font-size: 9px;
  font-weight: 900;
}

.bar-pay {
  margin-left: auto;
}

.schedule-bar,
.schedule-block {
  background: var(--project-colour, var(--secondary));
}


.schedule-day-modal,
.schedule-day-list,
.schedule-event-form {
  display: grid;
  gap: 10px;
}

.schedule-day-row {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  text-align: left;
}

.schedule-day-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.cal-day {
  border: 0;
  border-right: 1px solid var(--border);
  text-align: left;
}

.cal-day:last-child {
  border-right: 0;
}


.updates-card {
  padding: 0 4px 8px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.updates-logo-burst {
  position: relative;
  display: grid;
  min-height: 188px;
  place-items: center;
  overflow: visible;
  isolation: isolate;
}

.updates-logo-burst img {
  position: relative;
  z-index: 2;
  width: min(260px, 76vw);
  height: auto;
  opacity: 0;
  transform: scale(0.18) rotate(-8deg);
  filter: drop-shadow(0 12px 18px rgba(45, 45, 45, 0.2));
  will-change: transform, opacity;
}

.updates-logo-burst.is-visible img {
  animation: logo-pop 2.1s cubic-bezier(0.2, 0.85, 0.22, 1) both;
}

.updates-logo-burst span {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: hsl(calc(174 + (var(--i) * 9)) 62% 34%);
  opacity: 0;
  transform:
    translate(-50%, -50%)
    rotate(calc(var(--i) * 30deg))
    translateX(0)
    scale(0.2);
  animation-delay: calc(var(--i) * 70ms);
  will-change: transform, opacity;
}

.updates-logo-burst.is-visible span {
  animation: logo-spark 2.1s ease-out both;
  animation-delay: calc(var(--i) * 70ms);
}

.updates-logo-burst span:nth-child(odd) {
  width: 8px;
  height: 18px;
  border-radius: 999px;
  background: #6c2f7f;
}

.updates-logo-burst span:nth-child(3n) {
  width: 12px;
  height: 12px;
  background: #007f73;
}

.updates-copy {
  display: grid;
  gap: 6px;
  padding: 0 10px;
}

.updates-link {
  width: fit-content;
  color: var(--secondary);
  font-size: 12px;
  font-weight: 900;
  text-decoration: underline;
}

@keyframes logo-pop {
  0% {
    opacity: 0;
    transform: scale(0.18) rotate(-8deg);
  }
  18% {
    opacity: 1;
    transform: scale(1.18) rotate(2deg);
  }
  34% {
    transform: scale(0.92) rotate(-1deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.03) rotate(0deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes logo-spark {
  0%, 8% {
    opacity: 0;
    transform:
      translate(-50%, -50%)
      rotate(calc(var(--i) * 30deg))
      translateX(0)
      scale(0.2);
  }
  24% {
    opacity: 0.95;
    transform:
      translate(-50%, -50%)
      rotate(calc(var(--i) * 30deg))
      translateX(calc(72px + (var(--i) * 3px)))
      scale(1);
  }
  62% {
    opacity: 0;
    transform:
      translate(-50%, -50%)
      rotate(calc(var(--i) * 30deg))
      translateX(calc(106px + (var(--i) * 3px)))
      scale(0.35);
  }
  100% {
    opacity: 0;
  }
}


.supplier-category-card,
.materials-library-card {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.category-chip-grid {
  display: grid;
  gap: 8px;
}

.category-chip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.category-chip input,
.category-add-row input {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.78);
}

.category-chip button {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #ffffff;
  background: #b1241a;
  font-weight: 900;
}

.category-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.material-library-card {
  display: grid;
  gap: 8px;
}

.material-library-card strong,
.material-library-card small {
  display: block;
}

.material-library-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.stock-pill {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  color: #ffffff;
  background: var(--green);
  font-size: 11px;
  font-weight: 900;
}

.compact-form {
  padding: 0;
}

.category-filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 8px;
}

.category-filter {
  flex: 0 0 auto;
  min-height: 34px;
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--muted);
  background: rgba(255,255,255,0.66);
  font-size: 12px;
  font-weight: 900;
}

.category-filter.active {
  color: #ffffff;
  background: var(--secondary);
}

.compact-list,
.materials-compact-list {
  display: grid;
  gap: 8px;
}

.material-library-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.material-detail-pop {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.material-detail-pop p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.materials-action-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  margin-bottom: 14px;
}

.materials-action-card h3 {
  font-size: 15px;
  margin-bottom: 3px;
}

.supplier-name-list {
  max-height: 420px;
  overflow-y: auto;
  padding-right: 2px;
}

.supplier-name-card {
  padding: 12px 14px;
}

.supplier-name-card .supplier-card-head h3 {
  font-size: 14px;
}

.material-add-project-form {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.62);
}

.library-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
  padding: 0 16px 12px;
}

.schedule-action-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 8px;
  margin-bottom: 8px;
}

.supplier-action-row {
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
}

.schedule-project-picker .settings-list {
  max-height: 54vh;
  overflow-y: auto;
}

.compact-top-shell h1 {
  font-size: 22px;
  line-height: 28px;
}

.dashboard-header.compact-header {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.start-position-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(57, 95, 148, 0.18);
  background: rgba(255, 255, 255, 0.55);
}

.start-position-panel h3 {
  font-size: 14px;
}

.stage-select-panel.hidden {
  display: none;
}

.internal-brand {
  display: flex;
  width: auto;
  flex: 0 0 auto;
  justify-content: flex-end;
  padding-bottom: 0;
  line-height: 1;
}

.screen.home .internal-brand,
.home-brand {
  padding-bottom: 4px;
}

.buildflow-header-logo {
  display: block;
  width: 162px;
  height: 54px;
  object-fit: contain;
}

.compact-top-shell .buildflow-header-logo,
.schedule-top-shell .buildflow-header-logo {
  width: 177px;
  height: 60px;
}

.home-brand .buildflow-header-logo {
  width: 177px;
  height: 60px;
}

.auth-brand {
  justify-content: center;
}

.auth-brand .buildflow-header-logo {
  width: min(320px, 82vw);
  height: 116px;
}

.header-right {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

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

.home-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  align-items: center;
  gap: 12px;
}

.home-title-row > .business-logo-img,
.home-title-row > .business-logo-placeholder {
  width: 64px;
  height: 64px;
  aspect-ratio: 1;
  justify-self: end;
  object-fit: contain;
  border-radius: 14px;
}

@media (max-width: 520px) {
  .header-brand-group {
    gap: 6px;
  }

  .header-brand-group .buildflow-header-logo,
  .compact-top-shell .header-brand-group .buildflow-header-logo,
  .schedule-top-shell .header-brand-group .buildflow-header-logo,
  .header-brand-group .home-brand .buildflow-header-logo {
    width: 132px;
    height: 48px;
  }

  .required-setup-card h1 {
    font-size: 26px;
  }
}

@media (max-width: 380px) {
  .header-brand-group .buildflow-header-logo,
  .compact-top-shell .header-brand-group .buildflow-header-logo,
  .schedule-top-shell .header-brand-group .buildflow-header-logo,
  .header-brand-group .home-brand .buildflow-header-logo {
    width: 118px;
  }
}

/* ===== Launch splash ===== */

#launch-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: var(--bg-home);
  transition: opacity 420ms ease;
}

#launch-splash.splash-leaving {
  opacity: 0;
  pointer-events: none;
}

.launch-splash-burst {
  position: relative;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.launch-splash-burst img {
  position: relative;
  z-index: 2;
  width: min(280px, 72vw);
  height: auto;
  filter: drop-shadow(0 12px 18px rgba(45, 45, 45, 0.2));
  animation: logo-pop 1.6s cubic-bezier(0.2, 0.85, 0.22, 1) both;
  will-change: transform, opacity;
}

.launch-splash-burst span {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: hsl(calc(174 + (var(--i) * 9)) 62% 34%);
  opacity: 0;
  animation: logo-spark 1.6s ease-out both;
  animation-delay: calc(var(--i) * 55ms);
  will-change: transform, opacity;
}

.launch-splash-burst span:nth-child(odd) {
  width: 8px;
  height: 18px;
  background: #6c2f7f;
}

.launch-splash-burst span:nth-child(3n) {
  width: 12px;
  height: 12px;
  background: #007f73;
}

/* ===== Screen transitions (route changes only) ===== */

.screen.screen-enter {
  animation: screen-enter 220ms ease-out both;
}

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

/* ===== Button press ripple ===== */

.has-ripple {
  position: relative;
  overflow: hidden;
}

.press-ripple {
  position: absolute;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.22;
  transform: scale(0);
  animation: press-ripple 480ms ease-out both;
  pointer-events: none;
}

@keyframes press-ripple {
  to {
    transform: scale(2.6);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .launch-splash-burst img,
  .launch-splash-burst span,
  .screen.screen-enter,
  .press-ripple {
    animation: none !important;
  }
  .launch-splash-burst img {
    opacity: 1;
    transform: none;
  }
  #launch-splash {
    transition: none;
  }
}
