:root {
  --ink: #172026;
  --muted: #66717a;
  --line: #d9e0e4;
  --paper: #f7f8f5;
  --panel: #ffffff;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --amber: #b7791f;
  --red: #b42318;
  --blue: #2458a7;
  --green: #287d3c;
  --shadow: 0 12px 32px rgba(23, 32, 38, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

.unsubscribe-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #f4f7fb;
  color: #15233b;
}

.unsubscribe-page main {
  width: min(480px, 100%);
  background: white;
  border: 1px solid #dce4ef;
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(28, 48, 80, .12);
  padding: 32px;
}

.unsubscribe-page h1 { margin: 0 0 12px; font-size: 28px; }
.unsubscribe-page p { line-height: 1.55; color: #526178; }
.unsubscribe-page button { width: 100%; border: 0; border-radius: 12px; padding: 14px 18px; background: #0f6bff; color: white; font-weight: 700; }
.unsubscribe-page button:disabled { opacity: .55; cursor: wait; }
.unsubscribe-page #result { min-height: 24px; margin-top: 16px; }

.preference-page {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at top left, rgba(15, 107, 255, .14), transparent 38%),
    linear-gradient(145deg, #f7f9fc, #edf3fa);
  color: #15233b;
}
.preference-card { width: min(680px, 100%); padding: clamp(24px, 5vw, 44px); border: 1px solid rgba(197, 210, 228, .82); border-radius: 24px; background: rgba(255, 255, 255, .97); box-shadow: 0 28px 80px rgba(28, 48, 80, .14); }
.preference-header { margin-bottom: 26px; }
.preference-kicker { display: inline-block; margin-bottom: 10px; color: #0f6bff; font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.preference-header h1 { margin: 0; font-size: clamp(1.85rem, 5vw, 2.55rem); line-height: 1.08; letter-spacing: -.035em; }
.preference-header p, .preference-help, .preference-privacy { color: #526178; line-height: 1.55; }
.preference-card fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.preference-card legend { padding: 0; font-size: 1.05rem; font-weight: 800; }
.preference-help { margin: 8px 0 18px; font-size: .92rem; }
.preference-topics { display: grid; gap: 10px; }
.preference-topic { display: grid; grid-template-columns: auto 1fr; gap: 13px; align-items: start; padding: 16px; border: 1px solid #dce4ef; border-radius: 14px; background: #fbfcfe; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.preference-topic:hover { border-color: #9dbef4; box-shadow: 0 8px 24px rgba(28, 73, 145, .08); transform: translateY(-1px); }
.preference-topic:has(input:focus-visible) { outline: 3px solid rgba(15, 107, 255, .24); outline-offset: 2px; }
.preference-topic input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: #0f6bff; }
.preference-topic span { display: grid; gap: 4px; }
.preference-topic small { color: #66748a; line-height: 1.4; }
.preference-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.preference-actions button { min-height: 48px; border: 1px solid #0f6bff; border-radius: 12px; padding: 12px 16px; background: #0f6bff; color: white; font: inherit; font-weight: 750; cursor: pointer; }
.preference-actions .preference-secondary { border-color: #c5d0df; background: white; color: #33445e; }
.preference-actions button:disabled { opacity: .55; cursor: wait; }
.preference-notice { margin: 0 0 20px; padding: 14px 16px; border-left: 4px solid #e5a522; border-radius: 8px; background: #fff8e8; color: #654b14; line-height: 1.5; }
.preference-notice-error { border-left-color: #c63e4f; background: #fff0f2; color: #762330; }
.preference-status { min-height: 24px; margin: 18px 0 0; color: #526178; line-height: 1.45; }
.preference-status[data-kind="success"] { color: #176d46; font-weight: 700; }
.preference-status[data-kind="error"] { color: #a22b3d; font-weight: 700; }
.preference-privacy { margin: 20px 0 0; padding-top: 18px; border-top: 1px solid #e5ebf2; font-size: .82rem; }

@media (max-width: 600px) {
  .preference-page { display: block; padding: 0; background: white; }
  .preference-card { min-height: 100vh; padding: 24px 18px; border: 0; border-radius: 0; box-shadow: none; }
  .preference-actions { grid-template-columns: 1fr; }
}

.customer-decision-page { min-height: 100vh; margin: 0; padding: 24px; background: #eef2f3; color: var(--ink); }
.customer-decision-card { width: min(720px, 100%); margin: 0 auto; display: grid; gap: 18px; background: white; border-radius: 12px; padding: 24px; box-shadow: 0 18px 50px rgba(22,33,38,.12); }
.customer-decision-card form { display: grid; gap: 14px; }
.customer-quote-lines { display: grid; border-block: 1px solid var(--line); }
.customer-quote-lines > div, .customer-quote-total { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; }
.customer-quote-total { font-size: 1.2rem; }
.customer-order-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.customer-order-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.customer-order-panel { border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: #fbfcfa; }
.customer-order-panel h2 { margin: 0 0 10px; font-size: 1rem; }
.customer-order-panel p { margin: 6px 0; color: var(--muted); line-height: 1.45; }
.customer-order-list { display: grid; gap: 10px; }
.customer-order-line { border-left: 4px solid var(--teal); padding: 10px 12px; background: #f3f8f7; border-radius: 6px; }
.customer-order-line strong, .customer-order-line span { display: block; }
.customer-order-line span { color: var(--muted); margin-top: 4px; }
.customer-order-refresh { border: 1px solid var(--teal); background: white; color: var(--teal-dark); border-radius: 8px; padding: 10px 14px; font-weight: 800; }
.proof-review-card { width: min(820px, 100%); }
.proof-page-list { display: grid; gap: 16px; }
.proof-page-card { display: grid; gap: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 18px; background: #fbfcfa; }
.proof-page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.proof-page-heading strong, .proof-page-heading span { display: block; }
.proof-page-heading div > span { margin-top: 4px; color: var(--muted); }
.proof-page-decision { border-top: 1px solid var(--line); padding-top: 14px; }

@media (max-width: 560px) {
  .customer-decision-page { padding: 10px; }
  .customer-decision-card { padding: 18px; border-radius: 8px; }
  .customer-order-grid { grid-template-columns: 1fr; }
  .proof-page-heading { flex-direction: column; }
  .proof-page-card { padding: 14px; }
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(22, 33, 38, 0.88);
  padding: 20px;
}

.login-screen.hidden {
  display: none;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 22px 60px rgba(0,0,0,0.28);
}

.login-card [hidden] {
  display: none !important;
}

.login-brand {
  color: var(--ink);
  border-bottom-color: var(--line);
  padding-left: 0;
}

.login-brand span {
  color: var(--muted);
}

.login-hints {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

#local-login-fields {
  display: grid;
  gap: 12px;
}

.login-provider {
  display: grid;
  place-items: center;
  text-decoration: none;
}

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

button {
  cursor: pointer;
}

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

.sidebar {
  background: #162126;
  color: white;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 6px 8px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.brand span,
.sidebar-foot,
.assistant-head span,
.panel-head span,
.eyebrow {
  color: var(--muted);
  font-size: 12px;
}

.brand span,
.assistant-head span {
  display: block;
  color: rgba(255,255,255,0.62);
  margin-top: 2px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #0f766e, #b7791f);
  border-radius: 8px;
  font-weight: 800;
  letter-spacing: 0;
}

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

.nav-button {
  width: 100%;
  border: 0;
  border-radius: 6px;
  text-align: left;
  padding: 11px 12px;
  background: transparent;
  color: rgba(255,255,255,0.76);
}

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

.sidebar-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  color: rgba(255,255,255,0.66);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: #34d399;
}

.main {
  min-width: 0;
  padding: 28px;
}

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

.eyebrow {
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.1;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
}

h3 {
  font-size: 15px;
  margin-bottom: 8px;
}

.top-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.global-search {
  position: relative;
  width: min(360px, 32vw);
}

.global-search > input,
.board-search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  padding: 11px 13px;
  font: inherit;
  box-sizing: border-box;
}

.global-search-results {
  display: none;
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 46px rgba(25, 38, 62, .18);
  overflow: hidden;
}

.global-search-results.open { display: grid; }

.global-search-results button {
  display: grid;
  gap: 3px;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: white;
  padding: 11px 13px;
  cursor: pointer;
}

.global-search-results button:hover { background: #f3f7ff; }
.global-search-results span { color: var(--muted); font-size: 12px; }

.notification-center {
  position: relative;
}

.notification-toggle {
  position: relative;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 13px;
  background: white;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.notification-toggle.has-unread { border-color: #e5a92f; }

.notification-toggle > span {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: #d64545;
  color: white;
  font-size: 11px;
  line-height: 16px;
  box-sizing: border-box;
}

.install-app-button {
  min-height: 40px;
  border: 1px solid #1d625d;
  border-radius: 9px;
  padding: 0 13px;
  background: #e6f5f2;
  color: #164f4b;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.install-app-button:hover,
.install-app-button:focus-visible {
  background: #d5ede9;
}

.install-app-button[hidden] { display: none; }

.notification-panel {
  position: absolute;
  z-index: 50;
  top: calc(100% + 10px);
  right: 0;
  width: min(430px, calc(100vw - 40px));
  max-height: min(680px, 75vh);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  box-shadow: 0 22px 60px rgba(25, 38, 62, .22);
}

.notification-panel-head {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: white;
}

.notification-panel-head > div,
.notification-item > span:last-child,
.notification-empty {
  display: grid;
  gap: 3px;
}

.notification-panel-head span,
.notification-item small,
.notification-empty span {
  color: var(--muted);
  font-size: 12px;
}

.notification-list { display: grid; }

.notification-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 13px 14px;
  background: white;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.notification-item.unread { background: #fffaf0; }
.notification-item:hover { background: #f4f8f7; }

.notification-severity {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 999px;
  background: #5c7880;
}

.notification-item.warning .notification-severity { background: #e5a92f; }
.notification-item.critical .notification-severity { background: #d64545; }
.notification-item.read .notification-severity { opacity: .35; }

.notification-empty { padding: 26px 18px; text-align: center; }

.board-search {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.board-match-count {
  color: var(--teal-dark);
  font-size: 13px;
}

.job-view-toolbar {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7faf9;
}

.job-view-chips,
.job-view-personal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
}

.job-view-chip {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  background: white;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.job-view-chip.active {
  border-color: var(--teal);
  background: var(--teal);
  color: white;
}

.job-view-personal label {
  min-width: min(280px, 100%);
}

.job-board-filter-grid {
  display: grid;
  grid-template-columns: minmax(230px, 2fr) repeat(6, minmax(120px, 1fr)) auto auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

.job-scan-control {
  display: grid;
  gap: 5px;
  align-self: end;
}

.job-scan-control .secondary-button {
  min-height: 40px;
  white-space: nowrap;
}

.job-scan-status {
  max-width: 180px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
}

.job-scan-status.success { color: var(--teal-dark); }
.job-scan-status.error { color: var(--red); }

.task-board-filter-grid {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) repeat(4, minmax(120px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.task-board-row {
  grid-template-columns: minmax(240px, 2fr) minmax(150px, 0.8fr) minmax(220px, 1fr) auto;
}

.task-board-row.task-overdue {
  border-left: 4px solid var(--red);
}

.board-risk-filter {
  padding-bottom: 1px;
  white-space: nowrap;
}

.board-view-status {
  min-height: 22px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.marketing-row { grid-template-columns: minmax(240px, 2fr) auto minmax(220px, 1fr) auto; }

.segment-rule-builder,
.journey-step-builder,
.campaign-rule-summary {
  display: grid;
  gap: 10px;
}

.segment-rule-row,
.journey-step-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.4fr) minmax(110px, 0.8fr) minmax(130px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.segment-rule-row label {
  margin: 0;
}

.journey-step-row {
  grid-template-columns: 110px minmax(180px, 1fr) auto;
  align-items: start;
}

.journey-step-row label { margin: 0; }
.journey-step-row .journey-step-body { grid-column: 1 / -1; }
.journey-step-row textarea { min-height: 120px; }

.campaign-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

.campaign-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.campaign-card-head > div:first-child,
.campaign-card .notice {
  display: grid;
  gap: 4px;
}

.campaign-card-head span,
.campaign-card .notice span {
  color: var(--muted);
  font-size: 12px;
}

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

.campaign-rule-summary > span {
  padding: 7px 9px;
  border-radius: 6px;
  background: #eef4f2;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 700;
}

.campaign-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  gap: 8px;
}

.campaign-stat-grid > span {
  display: grid;
  gap: 3px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 11px;
}

.campaign-stat-grid strong {
  color: var(--ink);
  font-size: 16px;
}

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

.integration-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: #fff;
}

.integration-card > div:first-child { display: grid; gap: 4px; }
.integration-card span { color: var(--muted); font-size: 12px; }
.integration-card .job-actions { grid-column: 1 / -1; }

.user-pill {
  display: grid;
  gap: 2px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  min-width: 150px;
}

.user-pill span {
  color: var(--muted);
  font-size: 12px;
}

.primary-button,
.secondary-button,
.danger-button,
.ghost-button,
.small-button {
  border-radius: 6px;
  border: 1px solid transparent;
  min-height: 38px;
  padding: 0 14px;
  font-weight: 700;
}

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

.secondary-button {
  background: #22313a;
  color: white;
}

.danger-button {
  background: #b42318;
  color: white;
}

.ghost-button,
.small-button {
  background: white;
  border-color: var(--line);
  color: var(--ink);
}

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

.view {
  display: none;
}

.active-view {
  display: block;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(112px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: var(--shadow);
  min-height: 94px;
}

.kpi strong {
  display: block;
  font-size: 28px;
  line-height: 1;
  margin-bottom: 10px;
}

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

.two-col,
.workspace-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

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

.workflow-hero-panel {
  border-color: #b6d8d0;
}

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

.stack {
  display: grid;
  gap: 10px;
}

.notice,
.row-card,
.job-card,
.inventory-card,
.chat-message,
.automation-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: white;
}

.notice {
  border-left: 4px solid var(--teal);
}

.notice.warn {
  border-left-color: var(--amber);
}

.notice.danger {
  border-left-color: var(--red);
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  font-size: 13px;
}

.timeline-item span {
  color: var(--muted);
}

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

.form-grid.one-col {
  grid-template-columns: 1fr;
}

.pricing-result:empty {
  display: none;
}

.pricing-result {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.price-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 16px;
  align-items: center;
}

.price-summary > div {
  display: grid;
  gap: 4px;
}

.price-summary span,
.price-summary small {
  color: var(--muted);
}

.price-summary strong {
  font-size: 1.05rem;
}

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

.quote-options {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.quote-options summary {
  cursor: pointer;
  font-weight: 800;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding-top: 10px;
}

.optional-field {
  display: none;
}

.show-all .optional-field {
  display: grid;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  color: var(--ink);
  background: white;
  min-height: 40px;
}

.customer-picker {
  position: relative;
}

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

.customer-picker input {
  padding-right: 34px;
}

.customer-new-button {
  min-height: 40px;
}

.customer-picker-menu {
  position: absolute;
  z-index: 12;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  display: none;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.customer-picker.open .customer-picker-menu {
  display: block;
}

.customer-choice {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-bottom: 1px solid #edf1f2;
  background: white;
  text-align: left;
  padding: 8px 10px;
  color: var(--ink);
  font-weight: 700;
}

.customer-choice span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.customer-choice:hover,
.customer-choice.active {
  background: #eff8f6;
}

.customer-choice.new {
  color: var(--teal-dark);
  border-bottom: 0;
}

.address-lookup {
  position: relative;
}

.address-lookup-menu {
  position: absolute;
  z-index: 16;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  display: none;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.address-lookup.open .address-lookup-menu {
  display: block;
}

.address-choice {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-bottom: 1px solid #edf1f2;
  background: white;
  text-align: left;
  padding: 8px 10px;
  color: var(--ink);
  font-weight: 700;
}

.address-choice span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.address-choice:hover {
  background: #eff8f6;
}

.stage-select {
  min-height: 30px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.check-row {
  grid-template-columns: auto 1fr;
  align-items: center;
  color: var(--ink);
  min-height: 40px;
}

.check-row input {
  width: 18px;
  height: 18px;
  min-height: 18px;
}

.table-like {
  display: grid;
  gap: 10px;
}

.row-card {
  display: grid;
  grid-template-columns: minmax(160px, 1.5fr) repeat(4, minmax(96px, 1fr)) auto;
  gap: 12px;
  align-items: center;
}

.row-card span,
.job-meta,
.inventory-card span {
  color: var(--muted);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 99px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
  background: #e9f3f1;
  color: var(--teal-dark);
  white-space: nowrap;
}

.badge.warn {
  background: #fff4da;
  color: #815a12;
}

.badge.danger {
  background: #fee4e2;
  color: var(--red);
}

.badge.blue {
  background: #e8f1ff;
  color: var(--blue);
}

.job-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  gap: 14px;
  align-items: start;
}

.job-board-section {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.job-board-section > h3 {
  margin: 0;
  font-size: 15px;
}

.job-section-columns {
  display: grid;
  gap: 10px;
}

.job-column {
  min-width: 0;
  background: #f1f4f2;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.job-column h4 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 13px;
}

.job-card {
  display: grid;
  gap: 9px;
  margin-bottom: 10px;
}

.compact-job-card {
  gap: 0;
  cursor: pointer;
  outline: none;
}

.compact-job-card:hover,
.compact-job-card:focus {
  border-color: var(--teal);
  box-shadow: 0 10px 24px rgba(33, 77, 71, 0.12);
}

.job-card-summary {
  display: grid;
  gap: 5px;
}

.job-card-summary span,
.job-card-summary em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.3;
}

.job-card-summary strong {
  font-size: 13px;
}

.job-hover-detail {
  display: none;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #dbe5e2;
}

.compact-job-card:hover .job-hover-detail,
.compact-job-card:focus .job-hover-detail,
.compact-job-card:focus-within .job-hover-detail {
  display: grid;
}

.job-card strong {
  line-height: 1.2;
}

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

.task-list {
  display: grid;
  gap: 4px;
  font-size: 12px;
}

.task-list div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid #edf1f2;
  padding-top: 4px;
}

.job-ticket-modal {
  width: min(920px, 100%);
}

.job-ticket-view {
  padding: 18px;
}

.job-ticket-view header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.job-ticket-view h1 {
  margin: 0 0 6px;
  font-size: 24px;
}

.job-ticket-view h2 {
  margin: 20px 0 8px;
  font-size: 16px;
}

.job-ticket-view .grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.job-ticket-view .box {
  min-height: 74px;
  border: 1px solid var(--line);
  padding: 10px;
}

.job-ticket-view table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.job-ticket-view th,
.job-ticket-view td {
  border: 1px solid var(--line);
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.job-ticket-view th {
  background: #edf3f1;
}

.workflow-assignment-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(180px, 1fr);
  gap: 10px;
  align-items: center;
  margin: 0;
}

.workflow-assignment-row span {
  font-weight: 800;
}

.workflow-step-builder {
  display: grid;
  gap: 10px;
}

.workflow-step-create {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(260px, 1.2fr) auto;
  gap: 10px;
  align-items: end;
}

.workflow-step-create fieldset {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 40px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.workflow-step-create legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.workflow-step-list {
  display: grid;
  gap: 8px;
}

.workflow-step-pill {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #f8faf9;
}

.workflow-step-pill span {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 12px;
}

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

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

.selectable-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  cursor: pointer;
}

.selectable-card:has(input:checked) {
  border-color: var(--teal);
  box-shadow: inset 4px 0 0 var(--teal);
}

.selectable-card input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-height: 20px;
}

.meter {
  height: 8px;
  background: #edf1f2;
  border-radius: 99px;
  overflow: hidden;
}

.meter div {
  height: 100%;
  background: var(--green);
}

.meter.low div {
  background: var(--red);
}

.code-box {
  background: #101820;
  color: #e8f1f2;
  border-radius: 8px;
  padding: 14px;
  overflow: auto;
  max-height: 320px;
  font-size: 12px;
}

.ai-proposal-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.ai-proposal-result {
  min-height: 150px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.assistant {
  background: #fdfdfb;
  border-left: 1px solid var(--line);
  height: 100vh;
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.assistant-head {
  padding: 18px;
  background: #172026;
  color: white;
}

.chat-log {
  overflow: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-message {
  font-size: 13px;
  line-height: 1.45;
}

.chat-message.user {
  border-color: #b6d5d1;
  background: #eff8f6;
}

.chat-message strong {
  display: block;
  margin-bottom: 4px;
}

.chat-form {
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  border-top: 1px solid var(--line);
}

.chat-form button {
  border: 0;
  background: var(--teal);
  color: white;
  border-radius: 6px;
  padding: 0 12px;
  font-weight: 800;
}

.assistant-output {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%) translateY(20px);
  background: #172026;
  color: white;
  padding: 10px 14px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  box-shadow: var(--shadow);
  max-width: min(560px, calc(100vw - 28px));
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(22, 33, 38, 0.62);
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-card {
  width: min(780px, 100%);
  max-height: min(760px, 92vh);
  overflow: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.24);
  padding: 18px;
}

.modal-actions {
  margin-top: 14px;
  justify-content: flex-end;
}

.install-guide {
  width: min(520px, 100%);
}

.install-guide ol {
  display: grid;
  gap: 12px;
  padding-left: 24px;
  margin: 22px 0;
  line-height: 1.5;
}

.artwork-upload {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--soft);
  font-weight: 700;
}

.artwork-upload input {
  width: 100%;
  font-weight: 400;
}

.task-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.accounting-mapping-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) repeat(4, minmax(130px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
}

.accounting-mapping-heading span {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.accounting-mapping-form label {
  margin: 0;
}

.report-filter-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 220px)) auto auto;
  gap: 10px;
  align-items: end;
}

.report-filter-form label {
  margin: 0;
}

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

.report-metric {
  display: grid;
  align-content: start;
  gap: 5px;
  min-height: 86px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.report-metric > span,
.report-metric small,
.report-supplier span,
.report-trend-row > span,
.report-bar-label > span,
#report-attention .notice span {
  color: var(--muted);
  font-size: 12px;
}

.report-metric strong {
  font-size: 19px;
}

.report-supplier-list,
.report-trend {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.report-supplier {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto minmax(130px, auto);
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.report-supplier div:first-child,
#report-attention .notice {
  display: grid;
  gap: 4px;
}

.report-trend-row {
  display: grid;
  grid-template-columns: 72px repeat(2, minmax(180px, 1fr)) minmax(115px, auto);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.report-bar-label {
  display: grid;
  gap: 5px;
}

.report-bar-track {
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: #e8efed;
}

.report-bar {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: var(--teal);
}

.report-bar.invoiced {
  background: #2f6fed;
}

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

  .assistant {
    grid-column: 1 / -1;
    height: 420px;
    position: static;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

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

  .job-board {
    grid-template-columns: 1fr;
  }

  .job-board-filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .task-board-filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 15;
    height: auto;
    padding: 10px 12px;
    min-width: 0;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
  }

  .nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: thin;
    padding-bottom: 4px;
    width: 100%;
    max-width: 100%;
  }

  .sidebar .brand {
    padding: 2px 0 10px;
    margin-bottom: 8px;
  }

  .sidebar .brand-mark {
    width: 34px;
    height: 34px;
  }

  .sidebar .brand span,
  .sidebar-foot {
    display: none;
  }

  .nav-button {
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
    padding: 9px 12px;
  }

  .main {
    padding: 18px;
    min-width: 0;
  }

  .topbar,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions,
  .global-search { width: 100%; }

  .install-app-button { flex: 1 1 auto; }

  .notification-panel {
    position: fixed;
    top: 92px;
    right: 18px;
    left: 18px;
    width: auto;
    max-height: calc(100vh - 112px);
  }

  .marketing-row { grid-template-columns: 1fr; }
  .job-view-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .job-view-chip { flex: 0 0 auto; }
  .job-view-personal { display: grid; grid-template-columns: 1fr 1fr; }
  .job-view-personal label { grid-column: 1 / -1; min-width: 0; }
  .job-board-filter-grid { grid-template-columns: 1fr 1fr; }
  .job-board-filter-grid .board-search { grid-column: 1 / -1; }
  .job-scan-control { grid-column: 1 / -1; }
  .job-scan-control .secondary-button { width: 100%; }
  .job-scan-status { max-width: none; }
  .job-board-filter-grid .ghost-button { width: 100%; }
  .task-board-filter-grid { grid-template-columns: 1fr 1fr; }
  .task-board-filter-grid .board-search { grid-column: 1 / -1; }
  .task-board-filter-grid .ghost-button { width: 100%; }
  .task-board-row { grid-template-columns: 1fr; }
  .segment-rule-row,
  .journey-step-row,
  .campaign-rule-summary,
  .campaign-stat-grid { grid-template-columns: 1fr; }
  .campaign-card-head { flex-direction: column; }
  .integration-grid { grid-template-columns: 1fr; }
  .task-row { grid-template-columns: 1fr; }
  .accounting-mapping-form { grid-template-columns: 1fr; }

  .kpi-grid,
  .two-col,
  .workspace-grid,
  .form-grid,
  .price-summary,
  .inventory-grid,
  .workflow-assignment-row,
  .workflow-step-create {
    grid-template-columns: 1fr;
  }

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

  .report-filter-form,
  .report-metrics,
  .report-supplier,
  .report-trend-row {
    grid-template-columns: 1fr;
  }
}
