﻿:root {
  --ink: #1f2937;
  --muted: #5f6b7a;
  --line: #d5dde5;
  --soft: #f4f7f8;
  --panel: #ffffff;
  --teal: #0b6b63;
  --teal-dark: #07574f;
  --teal-soft: #e9f5f3;
  --blue: #1d4ed8;
  --blue-soft: #eff6ff;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.07);
  --yellow: #f2c94c;
  --red: #dc2626;
  --orange: #f59e0b;
  --green: #16a34a;
  --service: #16a34a;
  --service-dark: #15803d;
  --service-soft: #dcfce7;
  --insulation: #0891b2;
  --insulation-dark: #155e75;
  --insulation-soft: #cffafe;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  line-height: 1.45;
}

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

input[title],
select[title],
textarea[title],
label[title] {
  cursor: help;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  border-radius: 8px;
  min-height: 40px;
  padding: 9px 13px;
  background: var(--teal);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

button:disabled,
button[data-busy="true"] {
  opacity: 0.58;
  cursor: wait;
}

button.secondary,
.billing-draft-actions a,
.section-head button,
.planning-head button,
.job-actions button,
.job-actions a,
.lead-contact-actions a,
.action-row a,
.action-row button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--teal);
  text-decoration: none;
}

button.danger {
  border: 1px solid #fecaca;
  background: #dc2626;
  color: #fff;
}

.hidden {
  display: none !important;
}

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

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

.login-card {
  width: min(460px, 100%);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 28px;
  background: var(--panel);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
}

.login-card img,
.logo {
  width: min(280px, 100%);
  display: block;
}

.login-card h1 {
  margin: 22px 0 8px;
}

.login-card p,
.topbar p,
.section-head p {
  color: var(--muted);
}

.login-actions {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.login-form {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.login-remember {
  margin: 2px 0 4px;
}

.login-message,
.demo-label,
.sync-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.login-message:not(:empty),
.sync-status:not(:empty) {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #f8fafc;
}

.sync-status {
  margin: -6px 0 14px;
}

.sync-status.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.sync-status.error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.demo-label {
  margin-top: 18px;
  font-weight: 800;
}

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

.sidebar {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-right: 1px solid var(--line);
  padding: 18px;
  background: #fff;
  position: sticky;
  top: 0;
}

.sidebar nav {
  display: grid;
  gap: 8px;
}

.sidebar nav button {
  justify-content: flex-start;
  text-align: left;
  background: transparent;
  color: var(--ink);
}

.sidebar nav button.active {
  background: #e7f4f2;
  color: var(--teal);
}

.more-nav-wrap,
.new-action-wrap,
.top-search {
  position: relative;
}

.more-menu,
.new-action-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  right: 0;
  min-width: 210px;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.sidebar .more-menu {
  left: 0;
  right: auto;
}

.more-menu button,
.new-action-menu button {
  justify-content: flex-start;
  text-align: left;
  background: transparent;
  color: var(--ink);
}

.more-menu button:hover,
.new-action-menu button:hover {
  background: var(--teal-soft);
  color: var(--teal);
}

.user-card {
  margin-top: auto;
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--soft);
}

.user-card span,
small {
  color: var(--muted);
}

.data-mode {
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.data-mode.online {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.user-card button {
  margin-top: 8px;
  background: #334155;
}

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

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

.topbar h1 {
  margin: 0 0 4px;
}

.top-actions,
.action-row,
.job-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.top-actions {
  align-items: flex-start;
  justify-content: flex-end;
}

.top-search {
  width: min(420px, 42vw);
}

.quick-reminder-button {
  white-space: nowrap;
}

.crm-assistant-button {
  gap: 7px;
  white-space: nowrap;
  border-color: #bfdbfe !important;
  background: #eff6ff !important;
  color: #1d4ed8 !important;
}

.crm-assistant-button[aria-expanded="true"] {
  border-color: #2563eb !important;
  background: #dbeafe !important;
}

.assistant-queue-badge {
  display: inline-flex;
  min-width: 20px;
  min-height: 20px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 1px 6px;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.top-search input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  background: #fff;
}

.top-search-results {
  position: absolute;
  z-index: 25;
  top: calc(100% + 6px);
  right: 0;
  width: min(520px, 90vw);
  max-height: 70vh;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.mobile-bottom-nav {
  display: none;
}

.mobile-more-menu {
  display: none;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 12px 0 4px;
}

.lead-contact-actions a,
.action-row a,
.action-row button,
.inline-more-actions summary {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--teal);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.1;
  text-decoration: none;
}

.inline-more-actions {
  position: relative;
  display: inline-flex;
}

.inline-more-actions summary {
  list-style: none;
  cursor: pointer;
}

.inline-more-actions summary::-webkit-details-marker {
  display: none;
}

.inline-more-actions[open] summary {
  border-color: var(--teal);
  background: #ecfeff;
}

.inline-more-actions:not([open]) > div {
  display: none;
}

.inline-more-actions > div {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  right: 0;
  width: min(280px, calc(100vw - 24px));
  min-width: 0;
  max-width: calc(100vw - 24px);
  box-sizing: border-box;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.inline-more-actions > div a,
.inline-more-actions > div button {
  width: 100%;
  justify-content: flex-start;
}

.inline-more-actions .danger {
  border-color: #fecaca;
  background: #fff;
  color: var(--red);
}

.inline-more-actions .danger:hover {
  background: #fef2f2;
  color: var(--red);
}

.map-primary-action {
  border-color: #5eead4 !important;
  background: #ccfbf1 !important;
  color: #115e59 !important;
  font-weight: 850 !important;
}

.customer-star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
  color: var(--yellow);
  font-size: 0.95em;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(15, 23, 42, 0.22);
}

.customer-star.empty {
  color: #cbd5e1;
  text-shadow: none;
}

.star-icon-toggle {
  width: 31px;
  min-width: 31px;
  min-height: 31px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #cbd5e1;
  vertical-align: middle;
}

.star-icon-toggle span {
  color: var(--yellow);
  font-size: 18px;
  line-height: 1;
  text-shadow: none;
}

.star-icon-toggle:not(.active) span {
  color: #cbd5e1;
}

.star-icon-toggle.active {
  border-color: #f2c94c;
  background: #fff8dc;
  color: #7a5200;
}

.customer-status-toggle {
  min-height: 31px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-right: 6px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  vertical-align: middle;
}

.customer-status-toggle span {
  color: #cbd5e1;
  font-size: 16px;
  line-height: 1;
}

.customer-status-toggle em {
  font-style: normal;
}

.customer-status-toggle.active {
  border-color: #fecaca;
  background: #fff1f2;
  color: #9f1239;
}

.customer-status-toggle.active span {
  color: #e11d48;
}

.cash-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  margin-right: 6px;
  border-radius: 999px;
  background: #facc15;
  color: #713f12;
  font-size: 12px;
  font-weight: 1000;
  line-height: 1;
}

.action-row .book-primary,
.route-card-actions .book-primary {
  border-color: #86efac;
  background: #dcfce7;
  color: #166534;
}

.action-row .contact-primary,
.lead-contact-actions .contact-primary {
  border-color: #fcd34d;
  background: #fffbeb;
  color: #92400e;
}

.contact-log-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: -2px 0 4px;
}

.contact-log-presets button {
  min-height: 34px;
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: #9a3412;
  padding: 6px 9px;
  font-size: 12px;
}

.action-row .reminder-primary {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.action-row .order-primary,
.quick-actions .order-primary {
  border-color: #99f6e4;
  background: #ccfbf1;
  color: #0f766e;
}

.customer-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 10px 0 14px;
}

.customer-controls.compact {
  margin-top: 8px;
}

.payment-control {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(78px, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.payment-control button {
  min-height: 34px;
  border: 0;
  border-radius: 0;
  padding: 7px 10px;
  background: #fff;
  color: var(--muted);
  font-weight: 900;
}

.payment-control button + button {
  border-left: 1px solid var(--line);
}

.payment-control button.active {
  background: #ffe8a3;
  color: #6b4a00;
}

.tag-toggle {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  background: #fff;
  color: var(--teal);
  font-weight: 900;
}

.tag-toggle.active {
  border-color: var(--teal);
  background: #e7f4f2;
  color: var(--teal);
}

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

.dashboard-focus-grid,
.metric-grid,
.dashboard-grid {
  display: grid;
  gap: 12px;
}

.dashboard-focus-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin-bottom: 12px;
}

.start-worklist-panel {
  margin-bottom: 12px;
}

.google-insights-panel {
  margin-bottom: 12px;
  overflow: hidden;
}

.google-insights-head {
  align-items: flex-start;
  margin-bottom: 12px;
}

.google-insights-head h2,
.google-insights-detail-grid h3 {
  margin: 0;
}

.google-insights-head p {
  margin: 3px 0 0;
  color: var(--muted);
}

.google-insights-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.google-insights-links a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.google-insights-links a:hover,
.google-insights-links a:focus-visible {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.google-period-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.google-period-navigation {
  min-width: min(100%, 430px);
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr) auto;
  gap: 7px;
  align-items: center;
}

.google-period-navigation strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
  text-align: center;
}

.google-period-navigation button,
.google-period-options button,
.google-query-toggle {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 10px;
  background: #fff;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.google-period-navigation button:disabled {
  opacity: 0.42;
  cursor: default;
}

.google-period-options {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.google-period-options button {
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
}

.google-period-options button:last-child {
  border-right: 0;
}

.google-period-options button[aria-pressed="true"] {
  background: var(--teal);
  color: #fff;
}

.google-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.customer-action-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  align-items: stretch;
}

.customer-action-bar > *,
.customer-action-bar > .inline-more-actions,
.customer-action-bar > .inline-more-actions > summary {
  min-width: 0;
  width: 100%;
}

.customer-action-bar > a,
.customer-action-bar > button,
.customer-action-bar > .inline-more-actions > summary {
  min-height: 42px;
  padding: 9px 11px;
  font-size: 14px;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
}

.google-metric {
  min-width: 0;
  min-height: 88px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
}

.google-metric > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.google-metric strong {
  overflow-wrap: anywhere;
  font-size: 24px;
  line-height: 1.05;
}

.google-metric small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.google-metric small.positive {
  color: var(--service-dark);
}

.google-metric small.negative {
  color: #b45309;
}

.google-insights-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.google-insights-detail-grid > div {
  min-width: 0;
}

.google-insights-detail-grid h3 {
  font-size: 14px;
}

.google-trend {
  height: 128px;
  display: grid;
  grid-template-columns: repeat(var(--google-columns, 14), minmax(4px, 1fr));
  gap: 4px;
  align-items: end;
  margin-top: 10px;
  padding-top: 8px;
  border-bottom: 1px solid var(--line);
}

.google-trend > span {
  height: 112px;
  display: grid;
  grid-template-rows: 1fr 18px;
  align-items: end;
  gap: 3px;
}

.google-trend i {
  width: 100%;
  height: var(--google-bar);
  min-height: 7px;
  display: block;
  border-radius: 3px 3px 0 0;
  background: var(--teal);
}

.google-trend small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
  white-space: nowrap;
}

.google-query-list {
  display: grid;
  gap: 0;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.google-query-list li {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  padding: 6px 0;
  border-bottom: 1px solid #edf1f4;
}

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

.google-query-list span,
.google-query-list a {
  overflow: hidden;
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.google-page-list a,
.google-index-issues a {
  color: var(--ink);
  text-decoration: none;
}

.google-page-list a:hover,
.google-page-list a:focus-visible,
.google-index-issues a:hover,
.google-index-issues a:focus-visible {
  color: var(--teal);
  text-decoration: underline;
}

.google-query-list strong,
.google-query-list small {
  font-size: 11px;
}

.google-query-list strong {
  color: var(--teal);
}

.google-query-list small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.google-query-toggle {
  width: 100%;
  margin-top: 7px;
  background: var(--teal-soft);
  text-align: center;
}

.google-index-summary {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding: 9px 10px;
  border-left: 4px solid var(--line-strong);
  background: #f8fafc;
}

.google-index-summary.is-ok {
  border-left-color: var(--service);
  background: #f0fdf4;
}

.google-index-summary.has-warning {
  border-left-color: #d97706;
  background: #fffbeb;
}

.google-index-summary.has-error {
  border-left-color: var(--danger);
  background: #fff5f5;
}

.google-index-summary strong {
  color: var(--ink);
  font-size: 13px;
}

.google-index-summary span,
.google-index-summary small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

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

.google-index-issues li {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, auto);
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #edf1f4;
  font-size: 11px;
}

.google-index-issues li:last-child {
  border-bottom: 0;
}

.google-index-issues span {
  color: #9a5b08;
  text-align: right;
}

.google-index-ok {
  margin: 8px 0 0;
  color: var(--service-dark);
  font-size: 12px;
  font-weight: 800;
}

.google-business-summary,
.google-insights-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
}

.google-business-summary {
  margin-top: 12px;
  padding: 9px 10px;
  border-left: 4px solid var(--service);
  background: #f0fdf4;
  color: #355348;
  font-size: 12px;
}

.google-business-summary strong {
  color: var(--service-dark);
}

.google-business-summary a,
.google-insights-meta a {
  margin-left: auto;
  color: var(--teal);
  font-weight: 900;
}

.google-insights-meta {
  margin-top: 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.google-insights-meta.stale {
  color: #9a5b08;
}

.dashboard-queue-details {
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.dashboard-queue-details > summary {
  min-height: 46px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  padding: 10px 14px;
  color: var(--ink);
  font-weight: 950;
  cursor: pointer;
}

.dashboard-queue-details > summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-queue-details[open] > summary {
  border-bottom: 1px solid var(--line);
}

.dashboard-queue-details > .dashboard-grid {
  padding: 12px;
}

.start-worklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.start-worklist button {
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 10px;
  align-content: center;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 8px;
  padding: 13px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.start-worklist button:hover {
  filter: brightness(0.985);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.start-worklist span {
  color: var(--teal-dark, var(--teal));
  font-weight: 900;
}

.start-worklist strong {
  align-self: center;
  font-size: 26px;
  line-height: 1;
}

.start-worklist button.new {
  border-color: #fdba74;
  background: #fff7ed;
}

.start-worklist button.new span,
.start-worklist button.new strong {
  color: #9a3412;
}

.start-worklist button.followup,
.start-worklist button.today {
  border-color: #93c5fd;
  background: #eff6ff;
}

.start-worklist button.followup span,
.start-worklist button.followup strong,
.start-worklist button.today span,
.start-worklist button.today strong {
  color: #1d4ed8;
}

.start-worklist button.assistant {
  border-color: #67e8f9;
  background: #ecfeff;
}

.start-worklist button.assistant span,
.start-worklist button.assistant strong {
  color: #0e7490;
}

.start-worklist button.reminder,
.start-worklist button.move {
  border-color: #c4b5fd;
  background: #f5f3ff;
}

.start-worklist button.reminder span,
.start-worklist button.reminder strong,
.start-worklist button.move span,
.start-worklist button.move strong {
  color: #6d28d9;
}

.start-worklist button.completion {
  border-color: #fca5a5;
  background: #fef2f2;
}

.start-worklist button.completion span,
.start-worklist button.completion strong {
  color: #b91c1c;
}

.start-worklist button.billing {
  border-color: #fcd34d;
  background: #fffbeb;
}

.start-worklist button.billing span,
.start-worklist button.billing strong {
  color: #92400e;
}

.start-worklist button.service {
  border-color: #86efac;
  background: #f0fdf4;
}

.start-worklist button.service span,
.start-worklist button.service strong {
  color: #166534;
}

.start-worklist button.quality {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.start-worklist button.quality span,
.start-worklist button.quality strong {
  color: #475569;
}

.start-worklist-empty {
  grid-column: 1 / -1;
  display: grid;
  gap: 3px;
  border: 1px solid #86efac;
  border-left: 5px solid var(--green);
  border-radius: 8px;
  padding: 14px;
  background: #fffbeb;
  color: #92400e;
}

.start-worklist-empty span {
  color: #475569;
  font-weight: 700;
}

.dashboard-extra-actions {
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.dashboard-extra-actions summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 9px 12px;
  color: var(--teal);
  font-weight: 900;
  cursor: pointer;
}

.dashboard-extra-actions summary::-webkit-details-marker {
  display: none;
}

.dashboard-extra-actions summary::after {
  content: "Vis";
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-extra-actions[open] summary::after {
  content: "Skjul";
}

.dashboard-extra-body {
  display: grid;
  gap: 12px;
  padding: 0 12px 12px;
}

.dashboard-extra-actions:not([open]) .dashboard-extra-body {
  display: none;
}

.dashboard-extra-body .dashboard-focus-grid,
.dashboard-extra-body .metric-grid {
  margin-bottom: 0;
}

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

.reminder-group {
  display: grid;
  gap: 7px;
}

.reminder-group h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 13px;
}

.reminder-group h3 span {
  min-width: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 7px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.reminder-group > div {
  display: grid;
  gap: 7px;
}

.reminder-list .reminder-card.overdue {
  border-color: #fecaca;
  background: #fff1f2;
}

.reminder-list .reminder-card.today {
  border-color: #fde68a;
  background: #fffbeb;
}

.reminder-list strong,
.reminder-list span,
.reminder-list small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.reminder-list strong {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.reminder-urgency {
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 2px 6px;
  color: #0f766e;
  background: #ecfdf5;
  font-size: 11px;
  font-weight: 900;
}

.reminder-card.overdue .reminder-urgency {
  color: #b91c1c;
  background: #fff;
}

.reminder-card.today .reminder-urgency {
  color: #92400e;
  background: #fff;
}

.reminder-list small {
  color: var(--muted);
  font-weight: 800;
}

.reminder-list .reminder-actions {
  grid-row: span 3;
  display: grid;
  gap: 5px;
  align-content: center;
}

.reminder-list .reminder-actions button,
.reminder-list .reminder-actions a {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  font-size: 12px;
  text-decoration: none;
}

.order-admin-tools {
  margin: 8px 0 10px;
}

.order-admin-tools summary {
  width: fit-content;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 11px;
  background: #fff;
  color: var(--teal);
  font-weight: 900;
  cursor: pointer;
}

.order-admin-tools[open] summary {
  margin-bottom: 8px;
}

.order-admin-tools:not([open]) + .order-list .order-select {
  display: none;
}

.global-search-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.global-search-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 900;
}

.global-search-panel input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 16px;
}

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

.global-search-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.global-search-group-title {
  margin: 4px 2px 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.global-search-results button {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 4px 10px;
  align-items: center;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.global-search-results button:hover,
.global-search-results button:focus-visible {
  border-color: var(--teal);
  background: #f0fdfa;
}

.global-search-results span {
  grid-row: span 2;
  align-self: stretch;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #e7f4f2;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 900;
}

.global-search-results strong,
.global-search-results small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.global-search-results small {
  color: var(--muted);
  font-weight: 700;
}

.global-search-results .global-search-more {
  position: sticky;
  bottom: 0;
  display: flex;
  grid-template-columns: none;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-color: #9ccbc5;
  background: var(--teal-soft);
  color: var(--teal-dark);
  text-align: center;
}

.dashboard-focus-grid button {
  min-height: 118px;
  display: grid;
  gap: 5px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.dashboard-focus-grid button:hover {
  border-color: var(--teal);
  background: #f0fdfa;
}

.dashboard-focus-grid span {
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 900;
}

.dashboard-focus-grid strong {
  font-size: 32px;
  line-height: 1;
}

.dashboard-focus-grid small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}

.metric-grid button {
  min-height: 92px;
  display: grid;
  gap: 4px;
  align-content: center;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.metric-grid strong {
  font-size: 28px;
}

.dashboard-grid {
  grid-template-columns: 1.2fr 0.8fr;
}

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

.quality-list button {
  min-height: 50px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.quality-list button:hover {
  border-color: #d97706;
  background: #fff7ed;
}

.quality-list span {
  min-width: 34px;
  border-radius: 999px;
  padding: 4px 9px;
  background: #fef3c7;
  color: #92400e;
  font-weight: 900;
  text-align: center;
}

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

.section-head h2,
.section-head p {
  margin: 0;
}

.list-panel-toolbar {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.list-panel-toolbar h2 {
  margin: 0;
}

.list-view-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(74px, 1fr));
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 2px;
  background: #f1f5f9;
}

.list-view-switch button {
  min-height: 32px;
  border: 0;
  border-radius: 5px;
  padding: 6px 10px;
  background: transparent;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
  box-shadow: none;
}

.list-view-switch button:hover {
  background: #e2e8f0;
}

.list-view-switch button.active {
  background: #ffffff;
  color: var(--teal-dark);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.14);
}

.customer-layout {
  display: grid;
  grid-template-columns: minmax(310px, 0.85fr) minmax(430px, 1.15fr);
  gap: 12px;
}

.leads-layout,
.orders-layout {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(460px, 1.15fr);
  gap: 12px;
}

#customersView.details-list-open .customer-list-panel,
#customersView.details-list-open .customer-detail,
#leadsView.details-list-open .lead-list-panel,
#leadsView.details-list-open .lead-detail {
  grid-column: 1 / -1;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 10px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  color: var(--ink);
}

.customer-list,
.lead-list,
.order-list,
.compact-list,
.compact-action-list,
.job-list,
.tech-jobs,
.recent-list {
  display: grid;
  gap: 8px;
}

.job-group {
  display: grid;
  gap: 8px;
}

.job-group h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.job-group h3 span {
  border-radius: 999px;
  padding: 2px 8px;
  background: #e7f4f2;
  color: var(--teal-dark);
  font-size: 11px;
  text-transform: none;
}

.job-group > div {
  display: grid;
  gap: 8px;
}

.recent-panel {
  margin-top: 12px;
}

.recent-panel > summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
}

.recent-panel[open] > summary {
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 9px;
}

.ai-registration-panel {
  margin-bottom: 12px;
  border-color: #b9e4df;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfb 100%);
}

.ai-registration-panel[open] {
  display: block;
}

.ai-registration-panel:not([open]) > .ai-registration-body {
  display: none;
}

.ai-registration-summary {
  list-style: none;
  cursor: pointer;
}

.ai-registration-summary::-webkit-details-marker {
  display: none;
}

.ai-registration-summary span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ai-registration-summary strong {
  color: var(--teal-dark);
  font-size: 16px;
}

.ai-registration-summary small {
  color: var(--muted);
  font-weight: 800;
}

.ai-registration-body {
  margin-top: 14px;
}

.ai-registration-panel .section-head p {
  color: var(--muted);
  font-weight: 700;
}

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

.ai-paste-zone {
  display: grid;
  gap: 10px;
  border: 1px dashed #9fc9c4;
  border-radius: var(--radius);
  background: #f8fcfb;
  padding: 12px;
}

.ai-paste-zone.dragging {
  border-color: var(--teal);
  background: #edf9f6;
}

.ai-paste-zone > strong {
  color: var(--ink);
  font-size: 16px;
}

.ai-paste-zone > span {
  color: var(--muted);
  font-weight: 700;
}

.ai-registration-panel textarea {
  resize: vertical;
}

.lead-filter-details {
  position: relative;
  min-width: 170px;
}

.lead-filter-details summary {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px 12px;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.lead-filter-details summary::-webkit-details-marker {
  display: none;
}

.lead-filter-details select {
  margin-top: 8px;
  width: 100%;
}

.lead-source-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 8px;
}

.lead-source-filters button {
  min-height: 36px;
  border: 1px solid var(--line);
  background: #fff;
  color: #475569;
  padding: 7px 9px;
  font-size: 12px;
}

.lead-source-filters button.active {
  border-color: #7dd3fc;
  background: #f0f9ff;
  color: #075985;
}

.order-filter-details {
  position: relative;
  min-width: 155px;
}

.order-filter-details summary {
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.order-filter-details summary::-webkit-details-marker {
  display: none;
}

.order-filter-details select {
  margin-top: 8px;
}

.ai-attachment-list {
  display: grid;
  gap: 8px;
}

.ai-attachment-list article {
  display: grid;
  grid-template-columns: 74px 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 8px;
}

.ai-attachment-list img {
  width: 74px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.ai-attachment-list div {
  display: grid;
  gap: 2px;
}

.ai-attachment-list span,
.ai-attachment-list small {
  color: var(--muted);
  font-weight: 700;
}

.crm-attachment-list {
  display: grid;
  gap: 8px;
}

.crm-attachment-list article {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #f8fafc;
}

.crm-attachment-list.compact article {
  grid-template-columns: 36px minmax(0, 1fr) auto;
  padding: 7px;
}

.attachment-icon {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  background: #ecfeff;
  color: #0f766e;
  font-size: 11px;
  font-weight: 950;
}

.crm-attachment-list strong,
.crm-attachment-list span,
.crm-attachment-list small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.crm-attachment-list span,
.crm-attachment-list small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.installation-attachments {
  display: grid;
  gap: 8px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fbfdff;
}

.installation-attachments > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.ai-registration-draft {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.ai-registration-draft.attention {
  animation: aiDraftAttention 1.4s ease-out;
}

@keyframes aiDraftAttention {
  0% {
    box-shadow: 0 0 0 0 rgba(13, 122, 110, 0.35);
    background: #e9f8f4;
  }
  100% {
    box-shadow: 0 0 0 12px rgba(13, 122, 110, 0);
    background: transparent;
  }
}

.ai-draft-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #bddbd8;
  border-radius: var(--radius);
  background: #eef9f6;
  padding: 12px;
  margin-bottom: 10px;
}

.ai-draft-summary span {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.ai-draft-summary h3 {
  margin: 4px 0;
  font-size: 18px;
}

.ai-draft-summary p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.ai-draft-summary > strong {
  white-space: nowrap;
  border-radius: 999px;
  padding: 7px 10px;
  background: #fff;
  color: var(--teal-dark);
  border: 1px solid #bddbd8;
}

.ai-warning-list {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.ai-warning-list article,
.ai-warning-list.ok {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
  border-radius: var(--radius);
  padding: 9px 10px;
  border: 1px solid #ead28c;
  background: #fff8df;
  color: #6b4e00;
}

.ai-warning-list article.critical {
  border-color: #f2b8b5;
  background: #fff0f0;
  color: #9d2222;
}

.ai-warning-list article.info,
.ai-warning-list.ok {
  border-color: #bfe0d8;
  background: #eefaf5;
  color: var(--teal-dark);
}

.ai-link-hint,
.intake-link-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.ai-link-hint {
  border: 1px solid #bfe0d8;
  border-radius: 8px;
  padding: 8px 10px;
  margin: 0 0 10px;
  background: #f0fdfa;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 850;
}

.ai-link-hint strong {
  font-weight: 950;
}

.ai-selected-customer-notice {
  display: grid;
  gap: 3px;
  margin-bottom: 10px;
  border: 1px solid #9fd2c8;
  border-radius: 8px;
  padding: 10px 12px;
  background: #e9f8f4;
  color: #0c5f55;
}

.ai-selected-customer-notice.empty {
  border-color: #f1c37d;
  background: #fff7e8;
  color: #7a4a00;
}

.ai-selected-customer-notice strong {
  font-weight: 950;
}

.ai-selected-customer-notice span {
  font-size: 13px;
  font-weight: 750;
}

.ai-registration-outcome {
  display: grid;
  gap: 3px;
  margin: 0 0 10px;
  border-left: 4px solid var(--teal);
  padding: 8px 10px;
  background: #f7fbfa;
  color: var(--ink);
}

.ai-registration-outcome strong {
  font-size: 14px;
  font-weight: 950;
}

.ai-registration-outcome span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.lead-address-note {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.ai-assistant-proposal {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  border-top: 1px solid #bfdbfe;
  border-bottom: 1px solid #bfdbfe;
  padding: 12px 0;
  background: #f8fbff;
}

.ai-assistant-proposal .section-head {
  padding: 0 10px;
}

.ai-assistant-proposal label {
  display: grid;
  gap: 5px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.assistant-draft-badge,
.assistant-action-kind,
.intake-source-badge {
  width: fit-content;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 3px 7px;
  background: #eff6ff;
  color: #1d4ed8 !important;
  font-size: 11px !important;
  font-weight: 900;
}

.intake-source-badge.sms {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534 !important;
}

.intake-source-badge.website {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e !important;
}

.intake-assistant-hint {
  width: fit-content;
  border-left: 3px solid #2563eb;
  padding: 3px 7px;
  background: #eff6ff;
  color: #1e3a8a !important;
}

.assistant-recipient-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  color: #334155;
  font-size: 12px;
}

.assistant-ready {
  width: fit-content;
  color: #166534;
  font-size: 12px;
  font-weight: 900;
}

.assistant-blockers {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.assistant-blockers li {
  border: 1px solid #fbbf24;
  border-radius: 999px;
  padding: 3px 7px;
  background: #fffbeb;
  color: #92400e;
  font-size: 11px;
  font-weight: 850;
}

.assistant-planning-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin: 0 10px;
  border-left: 4px solid #f59e0b;
  padding: 9px 10px;
  background: #fffbeb;
}

.assistant-planning-card.ready {
  border-left-color: #16a34a;
  background: #f0fdf4;
}

.assistant-planning-card.historical-data {
  border-left-color: #2563eb;
  background: #eff6ff;
}

.assistant-planning-card > div {
  display: grid;
  gap: 3px;
}

.assistant-planning-card span,
.assistant-planning-card small {
  color: #475569;
  line-height: 1.35;
}

.assistant-proposal-actions {
  justify-content: flex-start;
  padding: 0 10px;
}

.intake-link-hints span {
  width: fit-content;
  max-width: 100%;
  border: 1px solid #bfe0d8;
  border-radius: 999px;
  padding: 3px 8px;
  background: #f0fdfa;
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.ai-field-meta {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.35;
}

.ai-original-source {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 8px;
}

.ai-original-source summary {
  cursor: pointer;
  color: var(--teal-dark);
  font-weight: 900;
}

.ai-original-source pre {
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  color: var(--ink);
  font: 13px/1.45 Consolas, "Courier New", monospace;
}

.ai-draft-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 12px;
}

.ai-draft-form {
  display: grid;
  gap: 10px;
}

.ai-draft-form label,
.ai-match-panel {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.ai-draft-form input,
.ai-draft-form select,
.ai-draft-form textarea {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

.ai-two-cols {
  display: grid;
  grid-template-columns: minmax(120px, 0.45fr) minmax(160px, 1fr);
  gap: 8px;
}

.checkbox-line {
  grid-template-columns: auto 1fr;
  align-items: center;
  color: var(--ink);
}

.checkbox-line input {
  width: auto;
}

.form-hint {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.completion-payment {
  margin: 12px 0 6px;
  padding: 10px 12px;
  border: 1px solid #dbe7ee;
  border-radius: 8px;
  background: #f8fafc;
}

.ai-save-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ai-save-row span:not(.compact-help) {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.compact-help {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 900;
  cursor: help;
}

.ai-match-panel {
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #f3f7f8;
}

.ai-match-panel h3,
.ai-match-panel p {
  margin: 0;
}

.ai-match-panel p {
  color: var(--muted);
  font-weight: 700;
}

.ai-selected-customer {
  border: 1px dashed #9ccac4;
  border-radius: 8px;
  padding: 9px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.ai-selected-customer button {
  margin-top: 8px;
  padding: 7px 9px;
  font-size: 12px;
}

.ai-candidate-list {
  display: grid;
  gap: 8px;
}

.ai-candidate-list button {
  display: grid;
  gap: 4px;
  justify-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.ai-candidate-list button.active,
.ai-candidate-list button:hover {
  border-color: var(--teal);
  background: #e6f5f3;
}

.ai-candidate-list span,
.ai-candidate-list small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.recent-list button {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--soft);
  color: var(--ink);
  text-align: left;
}

.recent-list button:hover {
  border-color: var(--teal);
  background: #eefaf8;
}

.recent-list time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.recent-list p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.customer-list {
  max-height: calc(100vh - 190px);
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.customer-search-summary,
.mobile-customer-back {
  display: none;
}

.customer-list.search-pending {
  pointer-events: none;
  opacity: 0.55;
}

.customer-list.details-mode,
.lead-list.details-mode {
  display: block;
  overflow: hidden;
}

.crm-detail-table-scroll {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  -webkit-overflow-scrolling: touch;
}

.customer-list.details-mode .crm-detail-table-scroll {
  max-height: calc(100vh - 190px);
}

.lead-list.details-mode .crm-detail-table-scroll {
  max-height: calc(100vh - 315px);
}

.crm-detail-table {
  width: 100%;
  min-width: 1240px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--ink);
  font-size: 12px;
}

.customer-detail-table {
  min-width: 1460px;
}

.crm-detail-table th,
.crm-detail-table td {
  min-width: 0;
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
}

.crm-detail-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

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

.crm-detail-table th:last-child,
.crm-detail-table td:last-child {
  border-right: 0;
}

.crm-detail-table tbody tr {
  cursor: pointer;
  outline: 0;
}

.crm-detail-table tbody tr:hover td,
.crm-detail-table tbody tr:focus td {
  background: #f7fbfb;
}

.crm-detail-table tbody tr.active td {
  background: #e7f4f2;
}

.crm-detail-table .crm-table-main-column {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #ffffff;
  box-shadow: 1px 0 0 #cbd5e1;
}

.crm-detail-table th:first-child {
  left: 0;
  z-index: 4;
  box-shadow: 1px 0 0 #cbd5e1;
}

.crm-table-value {
  min-width: 0;
  display: grid;
  gap: 3px;
  line-height: 1.3;
}

.crm-table-value strong,
.crm-table-value small {
  min-width: 0;
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
}

.crm-table-value strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  -webkit-line-clamp: 2;
}

.crm-table-value small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  -webkit-line-clamp: 2;
}

.crm-table-value strong .customer-star,
.crm-table-value strong .cash-badge {
  margin-right: 4px;
}

.crm-table-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 4px 6px;
  background: #f8fafc;
  color: #475569;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.crm-table-status.status-followup,
.crm-table-status.status-needs_offer {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.crm-table-status.status-offer_sent,
.crm-table-status.status-email,
.crm-table-status.status-sms {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.crm-table-status.status-won,
.crm-table-status.status-website {
  border-color: #99f6e4;
  background: #f0fdfa;
  color: #0f766e;
}

.crm-table-status.status-assistant {
  border-color: #a5f3fc;
  background: #ecfeff;
  color: #0e7490;
}

.crm-table-status.status-lost,
.crm-table-status.status-resolved,
.crm-table-status.status-note {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #475569;
}

.crm-table-status.customer-status-red {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.crm-table-status.customer-status-yellow {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.crm-table-status.customer-status-green {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.customer-detail-table th:nth-child(1),
.customer-detail-table td:nth-child(1) {
  width: 190px;
}

.customer-detail-table th:nth-child(2),
.customer-detail-table td:nth-child(2) {
  width: 145px;
}

.customer-detail-table th:nth-child(3),
.customer-detail-table td:nth-child(3) {
  width: 145px;
}

.customer-detail-table th:nth-child(4),
.customer-detail-table td:nth-child(4) {
  width: 210px;
}

.customer-detail-table th:nth-child(5),
.customer-detail-table td:nth-child(5) {
  width: 220px;
}

.customer-detail-table th:nth-child(6),
.customer-detail-table td:nth-child(6) {
  width: 230px;
}

.customer-detail-table th:nth-child(7),
.customer-detail-table td:nth-child(7) {
  width: 190px;
}

.customer-detail-table th:nth-child(8),
.customer-detail-table td:nth-child(8) {
  width: 160px;
}

.inbox-detail-table th:nth-child(1),
.inbox-detail-table td:nth-child(1) {
  width: 190px;
}

.inbox-detail-table th:nth-child(2),
.inbox-detail-table td:nth-child(2) {
  width: 145px;
}

.inbox-detail-table th:nth-child(3),
.inbox-detail-table td:nth-child(3) {
  width: 190px;
}

.inbox-detail-table th:nth-child(4),
.inbox-detail-table td:nth-child(4) {
  width: 190px;
}

.inbox-detail-table th:nth-child(5),
.inbox-detail-table td:nth-child(5) {
  width: 285px;
}

.inbox-detail-table th:nth-child(6),
.inbox-detail-table td:nth-child(6) {
  width: 185px;
}

.inbox-detail-table th:nth-child(7),
.inbox-detail-table td:nth-child(7) {
  width: 115px;
}

.lead-list,
.order-list {
  max-height: calc(100vh - 315px);
  overflow: auto;
}

.order-bulk-actions {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.order-bulk-actions label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
}

.order-bulk-actions input {
  width: auto;
}

.order-bulk-actions span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.order-list-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
}

.order-list-row.active button {
  border-color: var(--teal);
  background: #e7f4f2;
}

.order-select {
  min-width: 54px;
  justify-items: center;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 6px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 11px;
}

.order-select input {
  width: auto;
}

.customer-list button,
.lead-list button,
.order-list button,
.compact-list button {
  min-height: 58px;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.customer-list button.active {
  border-color: var(--teal);
  background: #e7f4f2;
}

.customer-list button {
  border-left-width: 5px;
}

.customer-list button.customer-status-red {
  border-left-color: var(--red);
}

.customer-list button.customer-status-yellow {
  border-left-color: var(--orange);
}

.customer-list button.customer-status-green {
  border-left-color: var(--green);
}

.customer-list button.customer-status-missing {
  border-left-color: #64748b;
}

.lead-list button,
.order-list button {
  grid-template-columns: 1fr;
  align-items: start;
  gap: 6px;
}

.lead-list button.lead-list-card {
  border-left-width: 5px;
}

.lead-list button.status-followup {
  border-left-color: #f97316;
}

.lead-list button.status-needs_offer {
  border-left-color: #eab308;
}

.lead-list button.status-offer_sent {
  border-left-color: #2563eb;
}

.lead-list button.status-won {
  border-left-color: #16a34a;
}

.lead-list button.status-lost,
.lead-list button.status-resolved {
  border-left-color: #64748b;
}

.lead-list button.inbox-source-website {
  border-left: 5px solid #0f766e;
}

.lead-list button.inbox-source-intake {
  border-left: 5px solid #2563eb;
}

.lead-list button.inbox-source-assistant {
  border-left: 5px solid #0891b2;
}

.order-list-row > button {
  border-left-width: 5px;
}

.order-list-row.status-unscheduled > button {
  border-left-color: #f59e0b;
}

.order-list-row.status-scheduled > button {
  border-left-color: #2563eb;
}

.order-list-row.status-completed > button {
  border-left-color: #16a34a;
}

.order-list-row.status-cancelled > button {
  border-left-color: #64748b;
}

.order-list-row.billing-ready > button {
  border-left-color: #dc2626;
  background: #fff7f7;
}

.lead-list button.active,
.order-list button.active {
  border-color: var(--teal);
  background: #e7f4f2;
}

.customer-list small {
  grid-column: 2;
}

.lead-list small,
.lead-list span,
.order-list small,
.order-list span {
  color: var(--muted);
  font-size: 12px;
}

.lead-list .lead-card-next {
  color: var(--teal);
  font-weight: 950;
}

.lead-list .lead-card-focus {
  width: fit-content;
  max-width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 4px 8px;
  background: #f8fafc;
  color: #475569;
  font-weight: 900;
}

.lead-list .lead-card-focus.overdue {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.lead-list .lead-card-focus.today {
  border-color: #99f6e4;
  background: #f0fdfa;
  color: #0f766e;
}

.lead-list .lead-card-focus.reply {
  border-color: #5eead4;
  background: #ccfbf1;
  color: #115e59;
}

.lead-list .lead-card-focus.missing {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.lead-list .lead-card-focus.tomorrow,
.lead-list .lead-card-focus.later {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.lead-list .lead-card-preview {
  line-height: 1.35;
}

.inbox-source-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 2px 6px;
  background: #f8fafc;
  color: #475569;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
}

.inbox-source-badge.website {
  border-color: #99f6e4;
  background: #f0fdfa;
  color: #0f766e;
}

.inbox-source-badge.email,
.inbox-source-badge.sms {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.inbox-source-badge.assistant {
  border-color: #a5f3fc;
  background: #ecfeff;
  color: #0e7490;
}

.lead-list button.inbox-show-more {
  min-height: 44px;
  display: flex;
  justify-content: center;
  border-left: 1px solid var(--line);
  color: var(--teal-dark);
  text-align: center;
}

.lead-list strong,
.order-list strong {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.lead-metrics,
.order-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.inbox-filter-cards {
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
}

.inbox-filter-cards button {
  min-height: 58px;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
}

.inbox-filter-cards strong {
  font-size: 20px;
  line-height: 1;
}

.inbox-filter-cards span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.2;
}

.lead-metrics button.active,
.order-metrics button.active {
  border-width: 2px;
  border-color: var(--teal);
  background: #ccfbf1;
  color: #0f766e;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.10);
}

.inbox-filter-cards button[data-lead-inbox-tab="new"] {
  border-left: 5px solid #f97316;
}

.inbox-filter-cards button[data-lead-inbox-tab="followup"] {
  border-left: 5px solid #2563eb;
}

.inbox-filter-cards button[data-lead-inbox-tab="drafts"] {
  border-left: 5px solid #0891b2;
}

.inbox-filter-cards button[data-lead-inbox-tab="archive"] {
  border-left: 5px solid #64748b;
}

.inbox-filter-cards button[data-lead-inbox-tab="new"].active {
  border-color: #fb923c;
  background: #fff7ed;
  color: #9a3412;
}

.inbox-filter-cards button[data-lead-inbox-tab="followup"].active {
  border-color: #60a5fa;
  background: #eff6ff;
  color: #1d4ed8;
}

.inbox-filter-cards button[data-lead-inbox-tab="drafts"].active {
  border-color: #22d3ee;
  background: #ecfeff;
  color: #0e7490;
}

.inbox-filter-cards button[data-lead-inbox-tab="archive"].active {
  border-color: #94a3b8;
  background: #f1f5f9;
  color: #334155;
}

.lead-stage-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin: -4px 0 12px;
}

.lead-stage-filters button {
  display: flex;
  min-width: 0;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px;
  color: #475569;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
}

.lead-stage-filters button span {
  min-width: 0;
  overflow-wrap: normal;
  word-break: normal;
}

.lead-stage-filters button strong {
  flex: 0 0 auto;
  min-width: 24px;
  border-radius: 999px;
  padding: 2px 6px;
  color: inherit;
  background: #eef2f7;
  text-align: center;
}

.lead-stage-filters button.active {
  border-color: #60a5fa;
  color: #1d4ed8;
  background: #eff6ff;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.10);
}

.lead-stage-filters button.active strong {
  background: #dbeafe;
}

.inbox-detail-heading {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.inbox-detail-heading span {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.inbox-detail-heading h2 {
  margin: 0;
  font-size: 22px;
}

.inbox-detail-source-card {
  display: block;
}

.inbox-detail-source-card > article {
  border: 0;
  padding: 0;
}

.inbox-intake-detail pre {
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.inbox-assistant-detail .assistant-action-main {
  min-width: 0;
}

.order-metrics button[data-order-filter-shortcut="active"] {
  border-left: 5px solid #0f766e;
}

.order-metrics button[data-order-filter-shortcut="unscheduled"] {
  border-left: 5px solid #f59e0b;
}

.order-metrics button[data-order-filter-shortcut="scheduled"] {
  border-left: 5px solid #2563eb;
}

.order-metrics button[data-order-filter-shortcut="billing_ready"] {
  border-left: 5px solid #dc2626;
}

.order-metrics button[data-order-filter-shortcut="completed"] {
  border-left: 5px solid #16a34a;
}

.order-metrics button[data-order-filter-shortcut="all"] {
  border-left: 5px solid #64748b;
}

.order-metrics button[data-order-filter-shortcut="unscheduled"].active {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #92400e;
}

.order-metrics button[data-order-filter-shortcut="scheduled"].active {
  border-color: #60a5fa;
  background: #eff6ff;
  color: #1d4ed8;
}

.order-metrics button[data-order-filter-shortcut="billing_ready"].active {
  border-color: #f87171;
  background: #fef2f2;
  color: #991b1b;
}

.order-metrics button[data-order-filter-shortcut="completed"].active {
  border-color: #4ade80;
  background: #f0fdf4;
  color: #166534;
}

.order-metrics button[data-order-filter-shortcut="all"].active {
  border-color: #94a3b8;
  background: #f1f5f9;
  color: #334155;
}

.inbox-tabs,
.job-tabs,
.insulation-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}

.inbox-tabs button,
.job-tabs button,
.insulation-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.inbox-tabs button.active,
.job-tabs button.active,
.insulation-tabs button.active {
  border-color: var(--teal);
  background: #ccfbf1;
  color: #0f766e;
}

.website-submission-inbox {
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
  background: #f0f9ff;
}

.website-submission-inbox .compact {
  margin-bottom: 8px;
}

.website-submission-inbox h3,
.website-submission-inbox p {
  margin: 0;
}

.website-submission-list {
  display: grid;
  gap: 7px;
}

.website-hidden-submissions {
  margin-top: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #f8fafc;
}

.website-hidden-submissions summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.website-hidden-submissions .website-submission-list {
  margin-top: 8px;
}

.website-hidden-cleanup {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.website-hidden-cleanup button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.website-submission-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.website-submission-list article.selected {
  border-color: var(--teal);
  background: #f0fdfa;
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.14);
}

.website-submission-list.compact article {
  border-color: var(--line);
  background: #fff;
}

.website-submission-list article > div:first-child {
  display: grid;
  gap: 6px;
}

.website-submission-card-summary {
  display: grid;
  gap: 4px;
}

.website-submission-card-summary small {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  line-height: 1.4;
}

.website-submission-attachment-badge {
  width: fit-content;
  max-width: 100%;
  border: 1px solid #7dd3fc;
  border-radius: 999px;
  padding: 3px 7px;
  background: #e0f2fe;
  color: #075985 !important;
}

.website-submission-card-more {
  min-width: 0;
  border-top: 1px solid #e2e8f0;
  padding-top: 6px;
}

.website-submission-card-more > summary,
.website-submission-more-list > summary {
  min-height: 34px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.website-submission-card-expanded {
  display: grid;
  gap: 8px;
  padding-top: 7px;
}

.website-submission-more-list {
  margin-top: 8px;
  border-top: 1px dashed #7dd3fc;
  padding-top: 7px;
}

.website-submission-more-list > .website-submission-list {
  margin-top: 7px;
}

.website-submission-search-hint {
  display: block;
  margin-top: 8px;
}

.website-submission-list span,
.website-submission-list small {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.website-submission-message {
  display: grid;
  gap: 3px;
  margin-top: 2px;
  border-left: 3px solid #38bdf8;
  padding: 7px 10px;
  background: #f8fafc;
}

.website-submission-message strong {
  color: var(--ink);
  font-size: 13px;
}

.website-submission-message p {
  margin: 0;
  color: #334155;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
  max-height: 190px;
  overflow: auto;
  overscroll-behavior: contain;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.website-message-full {
  margin-top: 2px;
}

.website-message-full > summary {
  width: fit-content;
  min-height: 34px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.website-message-full p {
  max-height: min(50vh, 520px);
  margin-top: 6px;
}

@media (max-width: 620px) {
  .website-submission-inbox {
    padding: 8px;
  }

  .website-submission-list article {
    padding: 9px 10px;
  }

  .website-submission-message p {
    max-height: 170px;
  }

  .website-hidden-cleanup {
    align-items: stretch;
    flex-direction: column;
  }

  .website-hidden-cleanup button {
    width: 100%;
  }
}

.website-submission-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 5px;
  margin: 4px 0 0;
}

.website-submission-fields div {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 6px;
  align-items: start;
  padding: 5px 7px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
}

.website-submission-fields dt,
.website-submission-fields dd {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.website-address-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-top: 7px;
  border: 1px solid #cfe4df;
  border-radius: 7px;
  padding: 7px 8px;
  background: #f2fbf8;
}

.website-address-actions .mini-action-row {
  flex: 0 0 auto;
}

.website-address-actions .button-link,
.street-view-action {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 13px;
  background: #fff;
  color: var(--teal);
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 620px) {
  .website-address-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .website-address-actions .mini-action-row > * {
    flex: 1 1 0;
  }
}

.website-submission-fields dt {
  color: var(--muted);
  font-weight: 950;
}

.website-submission-fields dd {
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.website-submission-list strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.website-submission-list .mini-action-row {
  justify-content: flex-start;
}

.website-submission-list .mini-action-row button {
  flex: 1 1 124px;
  min-width: 0;
  white-space: normal;
}

.website-import-health {
  display: grid;
  gap: 2px;
  width: fit-content;
  max-width: 100%;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 6px 8px;
  background: #eff6ff;
}

.website-import-health strong,
.website-import-health span {
  display: block;
  color: #1d4ed8;
  font-size: 12px;
  line-height: 1.25;
}

.website-import-health span {
  font-weight: 800;
}

.website-import-health.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.website-import-health.ok strong,
.website-import-health.ok span {
  color: #166534;
}

.website-import-health.warning {
  border-color: #fde68a;
  background: #fffbeb;
}

.website-import-health.warning strong,
.website-import-health.warning span {
  color: #92400e;
}

.website-import-health.danger {
  border-color: #fecaca;
  background: #fef2f2;
}

.website-import-health.danger strong,
.website-import-health.danger span {
  color: #991b1b;
}

.website-attachment-alert {
  display: grid;
  gap: 3px;
  width: fit-content;
  max-width: 100%;
  border: 1px solid #fbbf24;
  border-radius: 8px;
  padding: 7px 9px;
  background: #fffbeb;
}

.website-attachment-alert strong,
.website-attachment-alert span {
  display: block;
  color: #92400e;
  font-size: 12px;
  line-height: 1.3;
}

.website-attachment-alert span {
  font-weight: 800;
}

.website-stored-attachments {
  display: grid;
  gap: 5px;
  padding: 7px 9px;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  background: #f0fdfa;
}

.website-stored-attachments > strong {
  color: #115e59;
  font-size: 12px;
}

.website-submission-extra {
  margin-top: 2px;
}

.website-submission-extra > summary {
  width: fit-content;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.website-submission-extra[open] > summary {
  margin-bottom: 6px;
}

.website-raw-details {
  width: 100%;
}

.website-raw-details summary {
  color: var(--teal);
  font-weight: 900;
  cursor: pointer;
}

.website-raw-details pre {
  max-height: 220px;
  overflow: auto;
  margin: 8px 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.website-workflow-hint {
  display: grid;
  gap: 2px;
  width: fit-content;
  max-width: 100%;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 6px 8px;
  background: #eff6ff;
}

.website-workflow-hint strong,
.website-workflow-hint span {
  display: block;
  color: #1d4ed8;
  font-size: 12px;
  line-height: 1.25;
}

.website-workflow-hint span {
  font-weight: 800;
}

.website-workflow-hint.service {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.website-workflow-hint.service strong,
.website-workflow-hint.service span {
  color: #166534;
}

.website-workflow-hint.duplicate {
  border-color: #fdba74;
  background: #fff7ed;
}

.website-workflow-hint.duplicate strong,
.website-workflow-hint.duplicate span {
  color: #9a3412;
}

.intake-inbox-panel {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px;
  margin: 12px 0;
  background: #f8fafc;
}

.intake-inbox-panel h3,
.intake-inbox-panel p {
  margin: 0;
}

.intake-inbox-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  cursor: pointer;
}

.intake-inbox-details > summary span {
  display: grid;
  gap: 2px;
}

.intake-inbox-details > summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.intake-inbox-details > summary em {
  min-width: 30px;
  border-radius: 999px;
  padding: 5px 8px;
  background: #e2e8f0;
  color: var(--ink);
  font-size: 12px;
  font-style: normal;
  font-weight: 950;
  text-align: center;
}

.intake-inbox-details[open] > summary {
  margin-bottom: 10px;
}

.mobile-lead-back {
  display: none;
}

.intake-inbox-list {
  display: grid;
  gap: 8px;
}

.intake-inbox-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.intake-inbox-list article > div:first-child {
  display: grid;
  gap: 3px;
}

.intake-inbox-list span,
.intake-inbox-list small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.mini-action-row {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.assistant-action-queue {
  margin: 0 0 12px;
  scroll-margin-top: 84px;
  border: 1px solid #93c5fd;
  border-left: 5px solid #2563eb;
  padding: 12px;
  background: #f8fbff;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.08);
}

.assistant-action-queue h3,
.assistant-action-queue p {
  margin: 0;
}

.assistant-action-group {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.assistant-action-group + .assistant-action-group {
  border-top: 1px solid #dbeafe;
  padding-top: 12px;
}

.assistant-action-group-head,
.assistant-action-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
}

.assistant-action-group-head {
  justify-content: space-between;
}

.assistant-action-group-head h4,
.assistant-action-group-head p {
  margin: 0;
}

.assistant-action-group-head h4 {
  color: var(--ink);
  font-size: 14px;
}

.assistant-action-group-head p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.assistant-action-group-head > strong {
  color: var(--muted);
  font-size: 13px;
}

.assistant-action-list {
  display: grid;
  gap: 8px;
}

.assistant-action-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 10px;
  background: #fff;
}

.assistant-action-list article.assistant-action-focus {
  border-color: #2563eb;
  outline: 4px solid rgba(37, 99, 235, 0.16);
}

.assistant-action-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.assistant-action-main > span:not(.assistant-action-kind) {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.assistant-action-status {
  width: fit-content;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 3px 7px;
  background: #f8fafc;
  color: #475569;
  font-size: 11px;
  font-weight: 900;
}

.assistant-action-status.ready {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.assistant-action-status.approved {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1e40af;
}

.assistant-action-status.sent {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.assistant-action-status.error {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #991b1b;
}

.assistant-action-status.review,
.assistant-action-status.planning {
  border-color: #fcd34d;
  background: #fffbeb;
  color: #92400e;
}

.assistant-action-status.draft,
.assistant-action-status.invoice {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1e40af;
}

.assistant-action-date {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.assistant-action-next,
.assistant-action-error {
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.assistant-action-draft-details {
  margin-top: 4px;
  border-top: 1px solid #e2e8f0;
  padding-top: 7px;
}

.assistant-action-draft-details summary {
  cursor: pointer;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
}

.assistant-action-draft-editor {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.assistant-action-draft-editor label {
  display: grid;
  gap: 4px;
  color: #334155;
  font-size: 11px;
  font-weight: 900;
}

.assistant-action-draft-editor input,
.assistant-action-draft-editor textarea {
  width: 100%;
  min-width: 0;
  color: #0f172a;
  font: inherit;
  font-weight: 500;
}

.assistant-action-draft-editor textarea {
  resize: vertical;
  white-space: pre-wrap;
}

.assistant-action-draft-recipient {
  display: grid;
  gap: 2px;
  color: #334155;
  font-size: 11px;
}

.assistant-booking-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 6px;
  margin: 6px 0 0;
}

.assistant-booking-details > div {
  display: grid;
  gap: 2px;
  border: 1px solid #dbeafe;
  border-radius: 6px;
  padding: 7px 8px;
  background: #f8fbff;
}

.assistant-booking-details dt,
.assistant-booking-details dd {
  margin: 0;
}

.assistant-booking-details dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.assistant-booking-details dd {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.assistant-action-next {
  color: #334155;
  font-weight: 850;
}

.assistant-action-error {
  border-left: 3px solid #ef4444;
  padding: 4px 7px;
  background: #fef2f2;
  color: #991b1b;
  font-weight: 800;
}

.button-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 13px;
  background: #fff;
  color: var(--teal);
  font-weight: 800;
  text-decoration: none;
}

.billing-queue-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: stretch;
}

.compact-list .billing-queue-main {
  width: 100%;
  grid-template-columns: 12px minmax(0, 1fr);
  grid-template-areas:
    "status title"
    ". meta"
    ". hint";
  align-content: center;
  align-items: start;
}

.billing-queue-main > .dot {
  grid-area: status;
  margin-top: 3px;
}

.billing-queue-main > strong {
  grid-area: title;
}

.billing-queue-main > span:not(.dot) {
  grid-area: meta;
  min-width: 0;
}

.billing-queue-main > small {
  grid-area: hint;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.billing-queue-card > .secondary {
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  white-space: nowrap;
}

.mini-action-row .order-primary {
  border-color: #99f6e4;
  background: #ccfbf1;
  color: #0f766e;
}

.website-duplicate-hint {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  border: 1px solid #fdba74;
  border-radius: 999px;
  padding: 3px 8px;
  background: #fff7ed;
  color: #9a3412;
  overflow-wrap: anywhere;
}

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

.compact-action-card.move {
  border-color: #ddd6fe;
  background: #fbfaff;
}

.compact-action-card strong,
.compact-action-card span,
.compact-action-card small {
  display: block;
}

.compact-action-card span,
.compact-action-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.compact-action-card small {
  color: #5b21b6;
}

.lead-metrics button,
.order-metrics button {
  min-height: 72px;
  color: var(--ink);
  background: #fff;
}

.lead-metrics.inbox-filter-cards button {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 4px;
  min-height: 58px;
}

.lead-metrics strong,
.order-metrics strong {
  display: block;
  font-size: 24px;
}

.lead-metrics.inbox-filter-cards strong {
  font-size: 20px;
}

.lead-metrics.inbox-filter-cards span {
  margin-top: 0;
}

.insulation-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1.25fr) minmax(320px, 0.75fr);
  gap: 12px;
  align-items: start;
}

.insulation-layout.single-panel {
  grid-template-columns: minmax(0, 1fr);
}

.insulation-calculator,
.insulation-customers,
.insulation-documents {
  display: grid;
  gap: 12px;
}

.insulation-calculator {
  grid-row: span 2;
}

.insulation-layout.single-panel .insulation-calculator {
  grid-row: auto;
}

.insulation-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.insulation-offer-customer {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: 10px;
  align-items: end;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 12px;
  background: #f0fdff;
}

.insulation-mode-switch {
  display: inline-flex;
  gap: 0;
  margin: 12px 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f3f7f8;
}

.insulation-mode-switch button {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}

.insulation-mode-switch button.active {
  background: var(--teal);
  color: #fff;
}

.insulation-mode-panel {
  margin-top: 0;
}

.insulation-selected-customer {
  display: grid;
  gap: 3px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
}

.insulation-selected-customer span {
  color: var(--muted);
  font-size: 13px;
}

.rental-panel {
  display: grid;
  gap: 12px;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  padding: 12px;
  background: linear-gradient(135deg, #fff7ed, #ffffff);
}

.rental-panel h3,
.rental-panel p {
  margin: 0;
}

.rental-panel p,
.rental-price-note span {
  color: var(--muted);
}

.rental-input-grid {
  display: grid;
  grid-template-columns: minmax(120px, 0.35fr) minmax(170px, 0.45fr) minmax(240px, 1fr);
  gap: 10px;
  align-items: end;
}

.rental-price-note {
  display: grid;
  gap: 4px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.rental-image-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(90px, 1fr));
  gap: 8px;
}

.rental-image-grid a {
  display: grid;
  gap: 5px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 6px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}

.rental-image-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  background: #f8fafc;
}

.rental-image-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.insulation-input-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.5fr) minmax(110px, 0.6fr) minmax(110px, 0.6fr) auto;
  gap: 10px;
  align-items: end;
}

.insulation-input-grid.compact {
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  align-items: end;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 12px;
  background: #f0fdff;
}

.insulation-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.45fr);
  gap: 12px;
  align-items: start;
}

.insulation-lines,
.insulation-customer-list,
.document-list {
  display: grid;
  gap: 8px;
}

.insulation-line,
.insulation-customer-card,
.document-list a {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

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

.insulation-line span,
.insulation-line small,
.insulation-customer-card span,
.insulation-customer-card p,
.document-list span {
  color: var(--muted);
  font-size: 13px;
}

.insulation-line button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--teal);
}

.insulation-summary {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 8px;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 14px;
  background: linear-gradient(180deg, #ecfeff, #ffffff);
}

.insulation-summary h3,
.insulation-summary p {
  margin: 0;
}

.insulation-summary div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.insulation-summary div strong {
  color: var(--ink);
}

.insulation-summary .grand {
  border-radius: 8px;
  padding: 8px;
  background: var(--insulation-soft);
  color: var(--insulation-dark);
  font-weight: 900;
}

.insulation-summary hr {
  width: 100%;
  border: 0;
  border-top: 1px solid #bae6fd;
}

.insulation-offer-panel {
  display: grid;
  gap: 10px;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 12px;
  background: #f8feff;
}

.insulation-offer-panel textarea {
  min-height: 360px;
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.45;
  resize: vertical;
}

.document-list a {
  color: var(--ink);
  text-decoration: none;
}

.document-list a:hover {
  border-color: var(--insulation);
  background: #ecfeff;
}

.insulation-customer-list {
  max-height: 520px;
  overflow: auto;
}

.insulation-customer-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.insulation-customer-card strong {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.lead-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-right: 6px;
  border-radius: 999px;
  padding: 4px 8px;
  background: #f1f5f9;
  color: #334155;
  font-size: 11px;
  font-weight: 900;
}

.lead-badge.needs_offer {
  background: #fef3c7;
  color: #92400e;
}

.lead-badge.offer_sent {
  background: #dbeafe;
  color: #1d4ed8;
}

.lead-badge.followup {
  background: #ede9fe;
  color: #6d28d9;
}

.lead-badge.won {
  background: #dcfce7;
  color: #166534;
}

.lead-badge.lost {
  background: #fee2e2;
  color: #991b1b;
}

.lead-badge.resolved {
  background: #e2e8f0;
  color: #334155;
}

.order-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-right: 6px;
  border-radius: 999px;
  padding: 4px 8px;
  background: #e2e8f0;
  color: #334155;
  font-size: 11px;
  font-weight: 900;
}

.order-badge.unscheduled {
  background: #fef3c7;
  color: #92400e;
}

.order-badge.scheduled {
  background: #dbeafe;
  color: #1d4ed8;
}

.order-badge.completed {
  background: #dcfce7;
  color: #166534;
}

.order-badge.cancelled {
  background: #fee2e2;
  color: #991b1b;
}

.order-badge.billing.ready {
  background: #ffedd5;
  color: #9a3412;
}

.order-badge.billing.draft {
  background: #e0f2fe;
  color: #075985;
}

.order-badge.billing.sent,
.order-badge.billing.paid {
  background: #dcfce7;
  color: #166534;
}

.order-badge.job {
  background: #e0f2fe;
  color: #075985;
}

.order-badge.job.draft {
  background: #f1f5f9;
  color: #475569;
}

.order-badge.job.planned {
  background: #e0f2fe;
  color: #075985;
}

.order-badge.job.in_progress {
  background: #ede9fe;
  color: #6d28d9;
}

.order-badge.job.completed {
  background: #dcfce7;
  color: #166534;
}

.order-badge.job.cancelled,
.order-badge.job.missing {
  background: #fee2e2;
  color: #991b1b;
}

.job-flow {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  border: 1px solid #bfdbfe;
  border-left: 5px solid #2563eb;
  border-radius: 8px;
  padding: 12px;
  background: #eff6ff;
}

.job-flow.compact {
  margin: 10px 0;
  padding: 10px;
}

.job-flow.summary-only {
  gap: 0;
}

.settled-order-details {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.settled-order-details > summary {
  min-height: 46px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  color: #334155;
  font-weight: 950;
  cursor: pointer;
}

.settled-order-details[open] > summary {
  border-bottom: 1px solid var(--line);
}

.settled-order-details > div {
  padding: 12px;
}

.job-flow.billing,
.job-flow.overdue {
  border-color: #fed7aa;
  border-left-color: var(--orange);
  background: #fff7ed;
}

.job-flow.move {
  border-color: #ddd6fe;
  border-left-color: #7c3aed;
  background: #f5f3ff;
}

.job-flow.complete,
.job-flow.done {
  border-color: #bbf7d0;
  border-left-color: var(--green);
  background: #f0fdf4;
}

.job-flow.unscheduled {
  border-color: #fde68a;
  border-left-color: #d97706;
  background: #fffbeb;
}

.job-flow-head {
  display: grid;
  gap: 3px;
}

.job-flow-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.job-flow-head strong {
  font-size: 18px;
}

.job-flow-head em {
  color: #334155;
  font-style: normal;
  font-weight: 800;
}

.job-flow-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.job-flow-steps li {
  min-width: 0;
  display: grid;
  gap: 5px;
  justify-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.job-flow-steps li span {
  width: 18px;
  height: 18px;
  border: 2px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
}

.job-flow-steps li.done {
  color: #166534;
}

.job-flow-steps li.done span {
  border-color: var(--green);
  background: var(--green);
}

.job-flow-steps li.current {
  color: #1d4ed8;
}

.job-flow-steps li.current span {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.job-flow-steps li.warn {
  color: #9a3412;
}

.job-flow-steps li.warn span {
  border-color: var(--orange);
  background: var(--orange);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.16);
}

.job-next-action {
  display: grid !important;
  gap: 2px;
  margin: 6px 0 8px !important;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 7px 9px;
  background: rgba(255, 255, 255, 0.74);
  color: #1e3a8a !important;
}

.job-next-action strong,
.job-next-action span {
  margin: 0 !important;
  color: inherit !important;
}

.job-next-action span {
  font-size: 12px;
  font-weight: 750;
}

.job-next-action.billing,
.job-next-action.overdue {
  border-color: #fed7aa;
  color: #9a3412 !important;
  background: rgba(255, 247, 237, 0.88);
}

.job-next-action.followup {
  border-color: #bae6fd;
  color: #075985 !important;
  background: rgba(240, 249, 255, 0.92);
}

.job-next-action.move {
  border-color: #ddd6fe;
  color: #6d28d9 !important;
  background: rgba(245, 243, 255, 0.9);
}

.job-next-action.complete,
.job-next-action.done {
  border-color: #bbf7d0;
  color: #166534 !important;
  background: rgba(240, 253, 244, 0.92);
}

.quick-work-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}

.quick-work-actions button {
  min-height: 36px;
}

.lead-stage-box {
  display: grid;
  gap: 4px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.lead-stage-box strong {
  font-size: 18px;
}

.lead-stage-box span {
  color: var(--muted);
}

.lead-stage-box.needs_offer,
.lead-stage-box.offer_sent {
  background: #fffbeb;
  border-color: #fcd34d;
}

.lead-stage-box.won {
  background: #f0fdf4;
  border-color: #86efac;
}

.lead-stage-box.lost {
  background: #fef2f2;
  border-color: #fecaca;
}

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

.lead-workflow span {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  text-align: center;
}

.lead-workflow i {
  display: inline-grid;
  place-items: center;
  width: 18px;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  font-style: normal;
  font-size: 11px;
}

.lead-workflow span.done {
  border-color: #99f6e4;
  background: #ecfdf5;
  color: #0f766e;
}

.lead-workflow span.done i {
  background: var(--teal);
  color: #fff;
}

.lead-workflow span.current {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.lead-workflow span.current i {
  background: #2563eb;
  color: #fff;
}

.lead-workflow.compact {
  grid-template-columns: minmax(0, 1fr);
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fef2f2;
}

.lead-workflow.compact span {
  display: block;
  min-height: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  text-transform: uppercase;
}

.lead-workflow.compact strong {
  color: var(--red);
}

.lead-next-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin: 12px 0;
  border: 1px solid #bfdbfe;
  border-left: 5px solid var(--teal);
  border-radius: 8px;
  padding: 14px;
  background: #eff6ff;
}

.lead-next-action span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.lead-next-action strong {
  display: block;
  margin-top: 3px;
  font-size: 18px;
}

.lead-next-action p {
  margin: 4px 0 0;
  color: var(--muted);
}

.lead-focus-schedule {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.78);
}

.lead-focus-schedule > div {
  min-width: 0;
}

.lead-focus-schedule span {
  color: var(--muted);
  font-size: 11px;
  text-transform: none;
}

.lead-focus-schedule strong {
  margin: 1px 0 0;
  font-size: 13px;
}

.lead-focus-schedule small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.lead-focus-schedule.overdue {
  border-color: #fecaca;
  background: #fff7f7;
}

.lead-focus-schedule.today {
  border-color: #99f6e4;
  background: #f0fdfa;
}

.lead-focus-schedule.reply {
  border-color: #5eead4;
  background: #ecfdf5;
  box-shadow: inset 4px 0 0 #0f766e;
}

.lead-focus-schedule.missing {
  border-color: #fde68a;
  background: #fffdf2;
}

.lead-next-action.needs_offer {
  border-color: #fcd34d;
  border-left-color: var(--orange);
  background: #fffbeb;
}

.lead-next-action.offer_sent {
  border-color: #bfdbfe;
  border-left-color: #2563eb;
  background: #eff6ff;
}

.lead-next-action.won {
  border-color: #86efac;
  border-left-color: var(--green);
  background: #f0fdf4;
}

.lead-next-action.lost {
  border-color: #fecaca;
  border-left-color: var(--red);
  background: #fef2f2;
}

.lead-next-action.resolved {
  border-color: #cbd5e1;
  border-left-color: #64748b;
  background: #f8fafc;
}

.lead-archived-details {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.lead-archived-details > summary {
  min-height: 46px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  color: #334155;
  font-weight: 950;
  cursor: pointer;
}

.lead-archived-details[open] > summary {
  border-bottom: 1px solid var(--line);
}

.lead-archived-details > div {
  padding: 12px;
}

.lead-readiness {
  display: grid;
  gap: 8px;
  margin: -2px 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.lead-readiness > strong {
  color: var(--ink);
  font-size: 13px;
}

.lead-readiness > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lead-readiness span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 950;
}

.lead-readiness span.ok {
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.lead-readiness span.missing {
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.lead-next-actions,
.lead-contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}

.lead-next-actions button,
.lead-contact-actions a,
.lead-contact-actions button {
  min-height: 36px;
  white-space: nowrap;
}

.lead-next-actions .order-primary {
  border: 1px solid #99f6e4;
  background: #ccfbf1;
  color: #0f766e;
}

.lead-next-actions [data-lead-set-status="won"] {
  border-color: #86efac;
  background: #fff;
  color: #166534;
}

.lead-next-actions [data-lead-set-status="won"]:hover {
  background: #f0fdf4;
}

.lead-current-status {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 10px;
  background: #f8fafc;
  color: #334155;
  font-weight: 900;
}

.lead-email-tools-collapsed > summary {
  cursor: pointer;
  color: var(--teal);
  font-weight: 950;
}

.lead-email-tools-collapsed > .detail-section {
  margin-top: 12px;
}

.lead-contact-panel .section-title-row {
  align-items: flex-start;
}

.lead-extra-facts {
  margin-top: 8px;
}

.lead-extra-facts > summary {
  width: fit-content;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  background: #fff;
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
}

.lead-extra-facts .facts {
  margin-top: 8px;
}

.lead-quick-note {
  display: grid;
  gap: 10px;
}

.lead-quick-note .section-title-row {
  align-items: flex-start;
}

.lead-quick-note textarea {
  width: 100%;
  min-height: 68px;
  resize: vertical;
  line-height: 1.45;
}

.lead-note-current {
  max-height: 160px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.embedded-customer-card {
  border-color: #dbeafe;
  background: #f8fbff;
}

.embedded-customer-card .section-title-row p {
  margin-top: 4px;
  color: var(--muted);
}

.lead-status-control {
  display: grid;
  gap: 5px;
  margin-bottom: 10px;
  color: var(--muted);
  font-weight: 900;
}

.lead-note-editor {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  color: var(--muted);
  font-weight: 900;
}

.lead-status-actions,
.lead-template-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.lead-advanced-actions {
  background: #fbfdff;
}

.lead-advanced-actions > details > summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 950;
}

.lead-advanced-grid {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.lead-status-actions button,
.lead-template-buttons button {
  min-height: 36px;
  padding: 8px 10px;
}

.lead-template-section p {
  margin-top: 0;
  color: var(--muted);
}

.lead-offer-section {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.lead-offer-heading {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 14px;
}

.lead-offer-heading h3 {
  margin: 2px 0 4px;
  font-size: 20px;
}

.lead-offer-heading p {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
}

.lead-offer-heading > span {
  flex: 0 0 auto;
  padding: 7px 9px;
  border: 1px solid #b9ded2;
  border-radius: 6px;
  background: #edf9f5;
  color: #116453;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.lead-offer-eyebrow {
  color: var(--teal) !important;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

.lead-offer-step-number {
  display: inline-grid;
  width: 24px;
  height: 24px;
  margin-right: 7px;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-size: 12px;
  font-weight: 950;
}

.lead-offer-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 10px;
}

.lead-offer-grid label {
  min-width: 0;
}

.lead-offer-main-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
}

.lead-offer-section textarea {
  min-height: 108px;
  resize: vertical;
}

.lead-offer-settings {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
}

.lead-offer-advanced-settings {
  margin-top: 12px;
  background: #f8fafc;
}

.lead-offer-settings > summary {
  cursor: pointer;
  color: var(--teal);
  font-size: 13px;
  font-weight: 950;
}

.lead-offer-settings .lead-offer-grid {
  margin-top: 8px;
}

.lead-offer-text-details textarea {
  min-height: 180px;
}

.lead-offer-documents {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.lead-offer-documents .check-row {
  margin: 0;
  flex: 1 1 320px;
}

.lead-offer-documents small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  line-height: 1.35;
}

.lead-offer-documents a {
  white-space: normal;
  overflow-wrap: anywhere;
}

.offer-product-documents {
  flex: 1 1 100%;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.offer-product-documents strong {
  color: var(--ink);
}

.offer-product-documents a {
  display: inline-block;
  margin-right: 8px;
}

.lead-offer-context {
  min-width: 0;
  display: grid;
  gap: 8px;
  border-radius: 0;
  background: transparent;
}

.lead-offer-context .check-row.compact {
  justify-self: end;
  margin: 0;
  gap: 6px;
  white-space: nowrap;
}

.lead-offer-context-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 8px;
}

.lead-offer-context-grid label {
  min-width: 0;
}

.lead-offer-context-grid label:last-child {
  grid-column: 1 / -1;
}

.lead-offer-context-grid textarea {
  min-height: 74px;
}

.lead-offer-builder {
  min-width: 0;
  display: grid;
  gap: 8px;
  border-radius: 0;
  background: transparent;
}

.lead-offer-builder-head,
.lead-offer-builder-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.lead-offer-builder-head small,
.lead-offer-builder-footer small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  line-height: 1.35;
}

.lead-offer-builder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  min-width: 0;
}

.lead-offer-builder-actions button {
  min-height: 40px;
}

.lead-offer-line-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 8px;
  align-items: end;
}

.lead-offer-line-grid label {
  min-width: 0;
}

.lead-offer-line-grid button {
  min-height: 40px;
}

.lead-offer-line-advanced {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
}

.lead-offer-line-advanced > summary {
  cursor: pointer;
  color: var(--teal);
  font-size: 13px;
  font-weight: 950;
}

.lead-offer-line-advanced-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(92px, 0.35fr) minmax(120px, 0.45fr);
  gap: 8px;
  margin-top: 8px;
}

.lead-offer-line-advanced-grid label {
  min-width: 0;
}

.lead-offer-standard-installation,
.lead-offer-option-prices {
  margin: 2px 0 0;
}

.lead-offer-builder textarea {
  min-height: 96px;
}

.lead-offer-delivery {
  display: grid;
  gap: 10px;
}

.lead-offer-text-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}

.lead-offer-text-details > summary {
  cursor: pointer;
  color: var(--teal);
  font-weight: 950;
}

.lead-offer-text-details textarea {
  width: 100%;
  min-height: 180px;
  margin-top: 10px;
  background: #fff;
}

.lead-offer-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.lead-offer-primary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.lead-offer-preview-button,
.lead-offer-send {
  min-width: 170px;
  min-height: 42px;
}

.lead-offer-actions button,
.lead-offer-actions summary {
  min-height: 36px;
}

.lead-offer-more-actions {
  justify-self: end;
}

.lead-offer-preview {
  min-width: 0;
  margin: 12px 0 2px;
  overflow: hidden;
  border: 1px solid #b8ccd5;
  border-radius: 8px;
  background: #e8eff2;
}

.lead-offer-preview[hidden] {
  display: none;
}

.lead-offer-preview > header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #fff;
  border-bottom: 1px solid #cbd8de;
}

.lead-offer-preview > header div {
  display: grid;
  gap: 2px;
}

.lead-offer-preview > header small {
  color: var(--muted);
}

.lead-offer-preview iframe {
  display: block;
  width: 100%;
  min-height: 680px;
  border: 0;
  background: #f1f5f7;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #94a3b8;
}

.dot.red,
.status.red {
  background: var(--red);
}

.dot.yellow,
.status.yellow {
  background: var(--orange);
}

.dot.green,
.status.green {
  background: var(--green);
}

.dot.missing,
.status.missing {
  background: #64748b;
}

.dot.inactive,
.status.inactive {
  background: #94a3b8;
}

.customer-title h2 {
  margin: 10px 0 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 28px;
}

.quick-title h3 {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.customer-title p {
  margin: 0 0 12px;
}

.title-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.status {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 9px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.soft-pill {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
  font-weight: 800;
}

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

.context-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.customer-work-summary {
  display: grid;
  grid-template-columns: 1.25fr repeat(2, minmax(130px, 0.7fr));
  gap: 8px;
  margin: 10px 0 12px;
}

.customer-work-summary article {
  min-height: 74px;
  display: grid;
  gap: 3px;
  align-content: center;
  border: 1px solid var(--line);
  border-left: 5px solid #94a3b8;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.intake-inbox-list article.active {
  border-color: var(--teal);
  background: #effaf7;
  box-shadow: 0 0 0 2px rgba(13, 122, 110, 0.12);
}

.customer-work-summary article.attention {
  border-left-color: var(--orange);
  background: #fff7ed;
}

.customer-work-summary article.warning {
  border-left-color: #d97706;
  background: #fffbeb;
}

.customer-work-summary article.ok {
  border-left-color: var(--green);
}

.customer-work-summary article.next-action {
  align-content: start;
}

.customer-next-action-button {
  width: fit-content;
  min-height: 32px;
  margin-top: 5px;
  padding: 6px 10px;
  font-size: 12px;
  text-decoration: none;
}

.customer-work-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.customer-work-summary strong {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.2;
}

.customer-work-summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.customer-work-summary.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 0;
}

.customer-contact-pulse {
  display: grid;
  gap: 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 12px;
  margin: 0 0 12px;
  background: #f8fbff;
}

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

.customer-pulse-head h3 {
  margin: 0 0 3px;
  font-size: 15px;
}

.customer-pulse-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.customer-pulse-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.customer-pulse-actions button {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 12px;
}

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

.customer-pulse-grid.single {
  grid-template-columns: minmax(0, 1fr);
}

.customer-pulse-grid article {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.customer-pulse-grid article > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
}

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

.customer-pulse-grid li {
  display: grid;
  gap: 2px;
  border-left: 4px solid #93c5fd;
  padding: 1px 0 1px 8px;
  min-width: 0;
}

.customer-pulse-grid li.overdue,
.customer-pulse-grid li.today {
  border-left-color: var(--orange);
}

.customer-pulse-grid li.muted {
  border-left-color: #cbd5e1;
}

.customer-pulse-grid time,
.customer-pulse-grid strong,
.customer-pulse-grid span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.customer-pulse-grid time {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.customer-pulse-grid strong {
  color: var(--ink);
  font-size: 13px;
}

.customer-pulse-grid li span {
  color: #475569;
  font-size: 12px;
  line-height: 1.35;
}

.customer-pulse-grid li small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.tag-row,
.tag-details > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.compact-tags-section {
  padding: 0;
  overflow: visible;
}

.compact-tags-details {
  display: grid;
}

.compact-tags-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.compact-tags-details > summary::-webkit-details-marker {
  display: none;
}

.compact-tags-details > summary span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.compact-tags-details > summary strong {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.compact-tags-details > summary small {
  color: var(--muted);
  font-weight: 800;
}

.compact-tags-details > summary em {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--teal);
  background: #fff;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.compact-tags-details[open] > summary {
  border-bottom: 1px solid var(--line);
}

.compact-tags-details[open] > summary em {
  border-color: var(--teal);
  background: #ecfeff;
}

.compact-tags-details > .tag-row,
.compact-tags-details > .muted {
  margin: 10px 12px 12px;
}

.tag-details > div {
  min-width: min(320px, 80vw);
}

.facts.compact {
  margin: 10px 0 0;
}

.facts div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--soft);
}

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

.facts dd {
  min-width: 0;
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.copy-field {
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.contact-person-fact dt {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
  color: var(--ink);
}

.contact-person-fact dt small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.contact-person-fact .copy-field a {
  overflow-wrap: anywhere;
}

.copy-phone-button {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px 8px;
  background: #fff;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.detail-section {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.detail-section h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.customer-more-sections {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.customer-more-sections > summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  cursor: pointer;
  padding: 12px;
  color: var(--teal);
  font-weight: 900;
}

.customer-more-sections > summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.customer-more-sections > summary::-webkit-details-marker {
  display: none;
}

.customer-more-sections > summary::after {
  content: " +";
}

.customer-more-sections[open] > summary::after {
  content: " -";
}

.customer-more-sections > div {
  display: grid;
  gap: 10px;
  max-height: min(560px, 62vh);
  overflow: auto;
  overscroll-behavior: contain;
  border-top: 1px solid var(--line);
  padding: 10px;
  background: #f8fafc;
}

.embedded-customer-details > div,
.customer-warning-group > div {
  max-height: min(440px, 58vh);
}

.customer-more-sections .detail-section {
  margin-top: 0;
}

.section-title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-title-row h3 {
  margin: 0;
}

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

.inline-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.lead-contact-actions a,
.inline-action-row button,
.section-actions button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}

.detail-section p {
  margin: 0;
}

.customer-order-list,
.customer-offer-list,
.order-booking-list {
  display: grid;
  gap: 8px;
}

.customer-order-list article,
.customer-offer-list article,
.order-booking-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}

.customer-offer-summary .section-title-row > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.customer-offer-list article {
  grid-template-columns: 1fr;
  border-left: 4px solid #0f766e;
}

.customer-offer-list article.draft {
  border-left-color: #f59e0b;
}

.customer-offer-list time {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.customer-order-list strong,
.customer-offer-list strong,
.order-booking-list strong {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.customer-order-list span,
.customer-offer-list span,
.order-booking-list span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.customer-order-list small,
.customer-offer-list small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-section.attention {
  border-color: #fed7aa;
  background: #fff7ed;
}

.duplicate-notice,
.lead-match-notice {
  padding: 0;
}

.duplicate-notice > summary,
.lead-match-notice > summary {
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  list-style: none;
}

.duplicate-notice > summary::-webkit-details-marker,
.lead-match-notice > summary::-webkit-details-marker {
  display: none;
}

.duplicate-notice:not([open]) > :not(summary),
.lead-match-notice:not([open]) > :not(summary) {
  display: none;
}

.duplicate-notice > summary span,
.lead-match-notice > summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.duplicate-notice > p,
.lead-match-notice > p,
.duplicate-notice > .duplicate-links,
.lead-match-notice > .lead-match-list {
  margin-left: 12px;
  margin-right: 12px;
}

.duplicate-notice > .duplicate-links,
.lead-match-notice > .lead-match-list {
  margin-bottom: 12px;
}

.lead-match-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.lead-match-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid #fdba74;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.lead-match-list strong,
.lead-match-list span,
.lead-match-list small {
  display: block;
}

.lead-match-list span,
.lead-match-list small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.duplicate-links {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.duplicate-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.duplicate-open-button {
  min-height: 44px;
  display: grid;
  gap: 2px;
  justify-items: start;
  border: 1px solid #fdba74;
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.duplicate-open-button:hover {
  border-color: #f59e0b;
  background: #fffbeb;
}

.duplicate-links span {
  color: var(--muted);
  font-size: 13px;
}

.duplicate-dismiss-button {
  min-width: 96px;
  white-space: nowrap;
}

@media (max-width: 620px) {
  .lead-match-list article,
  .duplicate-link-row {
    grid-template-columns: 1fr;
  }

  .duplicate-dismiss-button {
    justify-self: start;
  }
}

.lookup-block {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.lookup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.lookup-actions a {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  padding: 6px 9px;
  background: #fff;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

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

.equipment-heading {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.equipment-heading > span,
.installation-kind-icon {
  display: inline-grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border: 1px solid #99f6e4;
  border-radius: 7px;
  background: #ecfdf5;
  color: #0f766e;
  font-size: 16px;
  line-height: 1;
}

.installation-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--teal);
  border-radius: 8px;
  padding: 10px;
  background: var(--soft);
}

.installation-card.red {
  border-left-color: var(--red);
}

.installation-card.yellow {
  border-left-color: var(--orange);
}

.installation-card.green {
  border-left-color: var(--green);
}

.installation-card.inactive {
  opacity: 0.72;
  border-left-color: #94a3b8;
  background: #f8fafc;
}

.installation-card.metadata-ghost {
  border-left-color: #f59e0b;
  background: #fff7ed;
}

.installation-card .installation-warning {
  color: #9a3412;
  font-weight: 900;
}

.installation-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.installation-card span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 7px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.installation-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.installation-meta-pills span {
  border-color: #99f6e4;
  background: #ecfdf5;
  color: #0f766e;
}

.installation-card p,
.installation-card small {
  margin: 0;
  overflow-wrap: anywhere;
}

.installation-card .service-area-state {
  width: fit-content;
  padding: 3px 7px;
  border: 1px solid #a7f3d0;
  border-radius: 5px;
  background: #ecfdf5;
  color: #065f46;
  font-weight: 800;
}

.installation-card .service-area-state.needs-review {
  border-color: #fbbf24;
  background: #fffbeb;
  color: #92400e;
}

.installation-card button {
  justify-self: start;
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}

.installation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}

.installation-card .access-inline,
.job-card .access-inline {
  color: #9a3412;
  font-weight: 900;
}

.installation-card details {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.installation-card summary {
  width: fit-content;
  color: var(--teal);
  font-weight: 900;
  cursor: pointer;
}

.timeline-list,
.invoice-list {
  display: grid;
  gap: 8px;
}

.timeline-list article,
.invoice-list article {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--soft);
}

.activity-timeline-panel {
  display: grid;
  gap: 10px;
}

.activity-timeline-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(118px, 0.28fr);
  gap: 8px;
}

.activity-timeline-toolbar input,
.activity-timeline-toolbar select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
}

.activity-timeline-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.activity-timeline-toggle {
  justify-self: start;
}

.activity-timeline-panel .timeline-list article:focus-visible {
  outline: 3px solid rgba(13, 148, 136, 0.25);
  outline-offset: 2px;
}

.timeline-list article.legacy-reminder {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.timeline-list time,
.invoice-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.timeline-list p,
.invoice-list p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.timeline-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.timeline-note.expandable-text {
  border: 0;
  padding: 0;
  background: transparent;
}

.timeline-hint {
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
}

.timeline-list article button {
  justify-self: start;
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}

.invoice-list article {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.invoice-list a {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--teal);
  font-weight: 800;
  text-decoration: none;
}

.invoice-payment-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 10px;
  background: var(--soft);
}

.invoice-payment-row strong,
.invoice-payment-row span {
  display: block;
}

.invoice-payment-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.invoice-payment-row .payment-control button {
  min-height: 30px;
  padding: 6px 9px;
  font-size: 12px;
}

.note-box,
.empty-state {
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
  background: #f8fafc;
}

.expandable-text {
  overflow-wrap: anywhere;
}

.expandable-text > summary {
  display: grid;
  gap: 8px;
  cursor: pointer;
  list-style: none;
}

.expandable-text > summary::-webkit-details-marker {
  display: none;
}

.expandable-text > summary span {
  display: block;
  color: inherit;
}

.expandable-text > summary em {
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 9px;
  color: var(--teal);
  background: #fff;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.expandable-text[open] > summary em {
  border-color: var(--teal);
  background: #ecfeff;
}

.expandable-text > div {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  color: inherit;
}

.empty-state.compact {
  padding: 10px 12px;
}

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

.settings-summary,
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.settings-summary article,
.settings-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.settings-summary strong {
  display: block;
  margin-bottom: 3px;
  font-size: 22px;
}

.settings-summary span,
.settings-grid p {
  margin: 0;
  color: var(--muted);
}

.settings-section {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.settings-section .section-head.compact {
  margin-bottom: 12px;
}

.settings-section label {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.settings-section input,
.settings-section select,
.settings-section textarea {
  width: 100%;
  min-width: 0;
}

.settings-section textarea {
  resize: vertical;
  line-height: 1.45;
}

.offer-template-editor-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.offer-template-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px;
}

.offer-template-editor summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  color: var(--text);
  font-weight: 900;
}

.offer-template-editor summary span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.offer-template-editor[open] {
  background: #fff;
}

.product-catalog-create {
  margin: 12px 0;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  padding: 10px 12px;
  background: #f0fdfa;
}

.product-catalog-create > summary {
  color: var(--teal);
  font-weight: 900;
  cursor: pointer;
}

.product-catalog-create form,
.product-catalog-row form {
  margin-top: 12px;
}

.product-catalog-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.product-catalog-form-grid label {
  margin: 0;
}

.product-catalog-form-grid .product-name-field,
.product-catalog-form-grid .product-alias-field {
  grid-column: span 2;
}

.product-catalog-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 240px) auto;
  gap: 8px;
  align-items: center;
  margin: 12px 0;
}

.product-catalog-toolbar span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.product-catalog-list {
  display: grid;
  gap: 8px;
}

.product-catalog-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.product-catalog-row.inactive {
  background: #f8fafc;
  opacity: 0.72;
}

.product-catalog-row > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  cursor: pointer;
}

.product-catalog-row > summary span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.product-catalog-row > summary strong,
.product-catalog-row > summary small {
  overflow-wrap: anywhere;
}

.product-catalog-row > summary small {
  color: var(--muted);
  font-weight: 750;
}

.product-catalog-row > summary em {
  color: var(--ink);
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.product-catalog-actions {
  margin-top: 12px;
}

.settings-grid h3 {
  margin: 0 0 6px;
}

.legacy-tag-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.legacy-tag-summary article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}

.legacy-tag-summary strong {
  display: block;
  margin-bottom: 3px;
  font-size: 20px;
}

.legacy-tag-summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.legacy-tag-details {
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.legacy-tag-details summary {
  color: var(--teal);
  font-weight: 900;
  cursor: pointer;
}

.legacy-tag-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.legacy-tag-list span {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #f8fafc;
}

.legacy-tag-list small {
  color: var(--muted);
  font-weight: 750;
}

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

.tag-settings-list article {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(180px, 1.3fr) auto;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.tag-settings-list article > div:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.tag-settings-list strong,
.tag-settings-list span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.tag-settings-list span {
  color: var(--muted);
}

.tag-settings-list input {
  min-width: 0;
}

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

.profile-list article {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(3, minmax(130px, 1fr)) auto auto;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.profile-list article.inactive {
  background: #f8fafc;
}

.profile-list article > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.profile-list article > div strong,
.profile-list article > div span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.profile-list label {
  min-width: 0;
}

.profile-list input,
.profile-list select {
  min-width: 0;
}

.profile-row-actions {
  display: grid;
  gap: 6px;
}

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

.user-invite-grid label {
  margin: 0;
}

.timesheet-month-label {
  min-width: 160px;
  margin: 0;
}

.timesheet-admin-list {
  display: grid;
  gap: 8px;
}

.timesheet-admin-list article {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.timesheet-admin-list article > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.timesheet-admin-list small,
.timesheet-admin-list span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.time-status {
  display: inline-flex;
  width: fit-content;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 3px 8px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 850;
}

.time-status.submitted {
  border-color: #fcd34d;
  background: #fffbeb;
  color: #92400e;
}

.time-status.approved {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.profile-active-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  padding: 6px 10px;
  background: #f0fdf4;
  color: #166534;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.profile-active-status.inactive {
  border-color: #fecaca;
  background: #fff1f2;
  color: #991b1b;
}

.profile-self {
  display: inline-flex;
  margin-left: 6px;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  padding: 2px 7px;
  background: #f0fdf4;
  color: #166534;
  font-size: 11px;
  vertical-align: middle;
}

.planning-head {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.installation-card .installation-card-title {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.installation-card .installation-card-title strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.installation-card .installation-kind-icon {
  border: 1px solid #99f6e4;
  border-radius: 7px;
  padding: 0;
  background: #ecfdf5;
  color: #0f766e;
  font-size: 15px;
}

.planning-period-nav {
  display: grid;
  grid-template-columns: minmax(110px, auto) minmax(220px, 1fr) minmax(110px, auto);
  gap: 8px;
  align-items: center;
}

.copy-field > span,
.copy-field > a {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.planning-period-nav button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.planning-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  align-items: center;
}

.plan-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.plan-tabs button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.plan-tabs button.active {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal);
}

.planning-period-nav strong {
  min-width: 220px;
  text-align: center;
  text-transform: capitalize;
}

.planning-head button,
.planning-more-tools summary {
  min-height: 40px;
  padding: 8px 12px;
}

.planning-resource-filter {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.planning-resource-filter select {
  width: auto;
  min-width: 150px;
  min-height: 28px;
  border: 0;
  padding: 0 26px 0 0;
  background-color: transparent;
  color: var(--ink);
}

.planning-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(220px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.planning-day {
  min-width: 220px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #f8fafc;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.planning-day.today {
  border-color: var(--teal);
  background: #f0fdfa;
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.18);
}

.planning-day.drag-over {
  border-color: var(--orange);
  background: #fff7ed;
  box-shadow: inset 0 0 0 2px rgba(245, 158, 11, 0.32), 0 8px 18px rgba(146, 64, 14, 0.12);
}

.drop-hint {
  display: none;
  margin: 8px 0;
  border: 1px dashed rgba(245, 158, 11, 0.65);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 247, 237, 0.92);
  color: #92400e;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.planning-day.drag-over .drop-hint {
  display: block;
}

.planning-day.drag-over .drop-hint::before {
  content: "Slipp på ønsket klokkeslett i 15-minutters steg.";
}

.drop-hint[data-drop-label]::after {
  content: attr(data-drop-label);
  display: block;
  margin-top: 3px;
  color: #7c2d12;
  font-size: 11px;
}

.day-timeline-wrap,
.day-overview {
  display: grid;
  gap: 6px;
  margin: 10px 0;
  padding: 8px;
  border: 1px solid #dbe7ee;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.day-time-row,
.day-time-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.day-time-summary strong {
  color: var(--ink);
}

.day-timeline {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 6px;
}

.timeline-axis,
.timeline-grid {
  position: relative;
  height: 520px;
}

.timeline-axis .timeline-hour-line {
  display: none;
}

.timeline-grid .timeline-hour-label {
  display: none;
}

.timeline-hour-label {
  position: absolute;
  left: 0;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.timeline-hour-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed #cbd5e1;
}

.timeline-grid {
  overflow: hidden;
  border: 1px solid #dbe7ee;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.86), rgba(248,250,252,0.92));
}

.timeline-events {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.timeline-drop-zones {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: auto;
}

.timeline-drop-zone {
  position: absolute;
  left: 0;
  right: 0;
  display: block;
  pointer-events: auto;
  border-top: 1px solid transparent;
  background: transparent;
}

.timeline-drop-zone.hour {
  border-top-color: transparent;
}

.timeline-drop-zone.half {
  border-top-style: dashed;
  border-top-color: transparent;
}

.planning-day.drag-over .timeline-drop-zone {
  border-top-color: rgba(245, 158, 11, 0.28);
  background: rgba(255, 247, 237, 0.54);
}

.planning-day.drag-over .timeline-drop-zone.hour {
  border-top-color: rgba(245, 158, 11, 0.62);
}

.planning-day.drag-over .timeline-drop-zone.half {
  border-top-color: rgba(245, 158, 11, 0.44);
}

.timeline-drop-zone span {
  position: absolute;
  top: 3px;
  right: 4px;
  display: none;
  border-radius: 999px;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.92);
  color: #92400e;
  font-size: 10px;
  font-weight: 950;
}

.planning-day.drag-over .timeline-drop-zone.active,
.planning-day.drag-over .timeline-drop-zone:hover {
  background: rgba(255, 237, 213, 0.88);
  box-shadow: inset 0 0 0 2px rgba(245, 158, 11, 0.35);
}

.timeline-drop-zone.active span,
.timeline-drop-zone:hover span {
  display: block;
}

.timeline-event {
  position: absolute;
  left: 5px;
  right: 5px;
  pointer-events: auto;
  min-height: 42px;
  overflow: hidden;
  border: 1px solid rgba(22, 163, 74, 0.28);
  border-left: 4px solid var(--service);
  border-radius: 8px;
  padding: 6px 7px;
  background: linear-gradient(135deg, #d8f8e3, #f0fdf4);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.timeline-event:hover {
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
  transform: translateY(-1px);
}

.timeline-event.planning-booking-focus,
.job-card.planning-booking-focus {
  z-index: 8;
  outline: 4px solid rgba(37, 99, 235, 0.9);
  outline-offset: 3px;
  box-shadow: 0 0 0 8px rgba(37, 99, 235, 0.2), 0 14px 30px rgba(15, 23, 42, 0.2);
  animation: planning-booking-focus-pulse 0.9s ease-in-out 2;
}

.job-card.planning-booking-focus {
  position: relative;
}

@keyframes planning-booking-focus-pulse {
  50% {
    outline-color: rgba(14, 116, 144, 0.95);
    box-shadow: 0 0 0 12px rgba(14, 116, 144, 0.18), 0 14px 30px rgba(15, 23, 42, 0.22);
  }
}

.timeline-event[draggable="true"] {
  cursor: grab;
}

.timeline-event.dragging {
  opacity: 0.55;
  cursor: grabbing;
}

.timeline-event.moving,
.job-card.moving {
  opacity: 0.7;
  cursor: progress;
  pointer-events: none;
}

.timeline-event strong,
.timeline-event span,
.timeline-event em {
  display: block;
  line-height: 1.2;
}

.timeline-event strong {
  color: var(--ink);
  font-size: 12px;
}

.timeline-event span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.timeline-event em {
  margin-top: 3px;
  color: #0f5132;
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
}

.timeline-event.befaring {
  border-color: rgba(245, 158, 11, 0.36);
  border-left-color: var(--orange);
  background: linear-gradient(135deg, #fff1cf, #fff8e8);
}

.timeline-event.reparasjon {
  border-color: rgba(99, 102, 241, 0.34);
  border-left-color: #6366f1;
  background: linear-gradient(135deg, #e0e7ff, #f5f6ff);
}

.timeline-event.installasjon {
  border-color: rgba(37, 99, 235, 0.30);
  border-left-color: #2563eb;
  background: linear-gradient(135deg, #e3edff, #f3f7ff);
}

.timeline-event.blaseisolering {
  border-color: rgba(8, 145, 178, 0.34);
  border-left-color: var(--insulation);
  background: linear-gradient(135deg, #cffafe, #f0fdff);
}

.timeline-event.done {
  border-color: rgba(34, 197, 94, 0.35);
  border-left-color: var(--green);
  background: linear-gradient(135deg, #dcfce7, #f0fdf4);
}

.timeline-event.settled {
  opacity: 0.68;
  border-color: rgba(100, 116, 139, 0.28);
  border-left-color: #94a3b8;
  background: linear-gradient(135deg, #e2e8f0, #f8fafc);
  box-shadow: none;
}

.timeline-event.settled em {
  color: #475569;
}

.timeline-event.needs-move {
  border-color: rgba(124, 58, 237, 0.30);
  border-left-color: #7c3aed;
  background: linear-gradient(135deg, #ede9fe, #faf7ff);
}

.timeline-event.overlap {
  border-color: rgba(220, 38, 38, 0.58);
  border-left-color: var(--red);
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.14), 0 8px 18px rgba(220, 38, 38, 0.13);
}

.timeline-event.overlap em {
  color: #991b1b;
}

.timeline-empty {
  position: absolute;
  inset: 8px;
  display: grid;
  place-items: center;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
}

.day-time-bar {
  position: relative;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.day-time-bar i {
  position: absolute;
  top: 0;
  bottom: 0;
  min-width: 4px;
  border-radius: 999px;
  background: var(--teal);
}

.day-time-bar i.service {
  background: var(--service);
}

.day-time-bar i.befaring {
  background: #f59e0b;
}

.day-time-bar i.installasjon {
  background: #2563eb;
}

.day-time-bar i.blaseisolering {
  background: var(--insulation);
}

.day-time-bar i.free {
  background: #bbf7d0;
}

.day-free-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.day-free-chips span,
.day-free-chips small {
  border-radius: 999px;
  padding: 3px 7px;
  background: #ecfdf5;
  color: #047857;
  font-size: 10px;
  font-weight: 800;
}

.day-free-chips small {
  background: #f1f5f9;
  color: var(--muted);
}

.route-planner {
  display: grid;
  gap: 16px;
}

.route-step,
.route-selection {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: #f8fafc;
}

.route-step-head {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.route-step-head span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.route-step-head h3,
.route-step-head p {
  margin: 0;
}

.route-step-head p {
  color: var(--muted);
  font-size: 13px;
}

.route-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 10px;
  border: 1px solid #d7e5e8;
  border-radius: 10px;
  padding: 12px;
  background: #fff;
}

.route-controls.primary {
  border-color: #bae6fd;
  background: #eff6ff;
}

.route-controls.route-day-frame {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-top: 10px;
}

.route-advanced,
.route-calendar-details,
.service-campaign-tracking,
.service-area-review {
  border: 1px solid #d7e5e8;
  border-radius: 10px;
  background: #fff;
}

.route-advanced summary,
.route-calendar-details summary,
.service-campaign-tracking > summary,
.service-area-review > summary {
  cursor: pointer;
  padding: 10px 12px;
  color: var(--teal);
  font-weight: 900;
}

.service-campaign-tracking > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.service-campaign-tracking > summary strong {
  color: #475569;
  font-size: 12px;
}

.service-campaign-body {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 12px;
}

.service-campaign-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.service-campaign-metrics span {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  border: 1px solid #d7e5e8;
  border-radius: 6px;
  padding: 5px 8px;
  background: #f8fafc;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
}

.service-campaign-metrics span strong {
  color: var(--ink);
  font-size: 14px;
}

.service-campaign-metrics .capacity.available {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.service-campaign-metrics .capacity.full {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.service-campaign-metrics .capacity.over {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.service-campaign-list {
  display: grid;
  gap: 8px;
}

.service-campaign-member {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-left: 4px solid #94a3b8;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.service-campaign-member.accepted,
.service-campaign-member.booked {
  border-left-color: #16a34a;
}

.service-campaign-member.later {
  border-left-color: #2563eb;
}

.service-campaign-member.declined,
.service-campaign-member.no_reply {
  border-left-color: #cbd5e1;
  background: #f8fafc;
}

.service-campaign-member > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.service-campaign-member > header div,
.service-campaign-member > header strong,
.service-campaign-member > header span,
.service-campaign-member > small {
  min-width: 0;
}

.service-campaign-member > header strong,
.service-campaign-member > header span,
.service-campaign-member > small {
  display: block;
  overflow-wrap: anywhere;
}

.service-campaign-member > header span,
.service-campaign-member > small {
  color: var(--muted);
  font-size: 12px;
}

.service-campaign-member > header em {
  flex: 0 0 auto;
  border-radius: 6px;
  padding: 4px 7px;
  background: #eef2f7;
  color: #334155;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

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

.service-campaign-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.service-campaign-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  background: #fff;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.service-area-review > summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.service-area-review > summary strong {
  color: #475569;
  font-size: 12px;
}

.service-area-review.has-critical > summary strong {
  color: #9a3412;
}

.service-area-review-body {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 12px;
}

.service-area-review-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 320px);
  gap: 10px;
}

.service-area-review-list {
  display: grid;
  gap: 8px;
}

.service-area-review-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.85fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 4px solid #94a3b8;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.service-area-review-row.is-critical {
  border-left-color: #ea580c;
  background: #fffaf5;
}

.service-area-review-info,
.service-area-review-actions {
  min-width: 0;
}

.service-area-review-info {
  display: grid;
  gap: 3px;
}

.service-area-review-info span,
.service-area-review-info small {
  overflow-wrap: anywhere;
}

.service-area-review-info span {
  color: #334155;
  font-size: 13px;
}

.service-area-review-info small {
  color: var(--muted);
}

.service-area-review-title {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.service-area-review-title .warning-badge {
  border-radius: 999px;
  padding: 3px 7px;
  background: #ffedd5;
  color: #9a3412;
  font-size: 10px;
  font-weight: 900;
}

.service-area-review-suggestion {
  color: #0f766e !important;
  font-weight: 800;
}

.service-area-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: end;
}

.service-area-review-actions label {
  flex: 1 1 220px;
}

.service-area-review-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  background: #fff;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.route-advanced .route-controls,
.route-calendar-details .booking-month {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0 0 10px 10px;
}

.check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding-top: 20px;
}

.check-label input {
  width: auto;
}

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

.route-customer-results,
.route-selected-customers,
.route-results,
.route-missing-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.route-customer-results button,
.route-selected-customers article,
.route-missing-list button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.route-customer-results span,
.route-selected-customers span,
.route-missing-list span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.route-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 10px;
  background: #f0fdf4;
  color: #166534;
  font-weight: 800;
}

.route-summary span { color: inherit; }

.route-summary small {
  flex-basis: 100%;
  color: inherit;
  font-size: 12px;
  font-weight: 800;
}

.route-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.route-summary.verified {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.route-summary.route-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.route-card.route-card-warning {
  border-color: #f59e0b;
  background: #fffbeb;
}

.route-eta {
  display: block;
  width: fit-content;
  margin-top: 8px;
  border-radius: 8px;
  padding: 6px 9px;
  background: #e0f2fe;
  color: #075985;
  font-size: 13px;
}

.route-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  font-weight: 900;
}

.route-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.route-title em {
  border-radius: 999px;
  padding: 3px 8px;
  background: #e7f4f2;
  color: var(--teal);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.route-card p,
.route-card small {
  display: block;
  margin: 5px 0 0;
}

.route-drive-estimate {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  width: fit-content;
  margin-top: 8px;
  border-radius: 8px;
  padding: 6px 8px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
  font-weight: 800;
}

.route-drive-estimate.medium {
  background: #ecfdf5;
  color: #166534;
}

.route-drive-estimate.google {
  background: #ecfdf5;
  color: #166534;
}

.route-drive-estimate.missing {
  background: #fef2f2;
  color: #b91c1c;
}

.route-drive-estimate em {
  border-radius: 999px;
  padding: 2px 7px;
  background: rgba(255, 255, 255, 0.72);
  color: inherit;
  font-size: 11px;
  font-style: normal;
  text-transform: uppercase;
}

.route-access {
  border-left: 3px solid var(--orange);
  padding-left: 8px;
  color: #9a3412;
}

.route-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  min-width: 172px;
}

.route-card-actions a,
.route-card-actions button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 8px;
  background: #fff;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.route-card-actions button.book-primary {
  border-color: #86efac;
  background: #dcfce7;
  color: #166534;
}

.route-card-actions .route-message-button.sms,
.route-overflow-actions .route-message-button.sms {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.route-card-actions .route-message-button.email,
.route-overflow-actions .route-message-button.email {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}

.route-booking-month {
  max-width: 620px;
  margin-top: 0;
}

.route-overflow,
.route-missing,
.route-help {
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

.route-overflow {
  max-height: 420px;
  overflow: auto;
}

.route-missing {
  max-height: 360px;
  overflow: auto;
}

.route-overflow h3,
.route-missing h3 {
  margin: 0 0 8px;
}

.route-overflow article {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px 12px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  margin-top: 8px;
  cursor: pointer;
}

.route-overflow article span {
  color: var(--muted);
  font-size: 13px;
}

.route-overflow-actions {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
}

.route-overflow-card:hover .route-overflow-actions,
.route-overflow-card:focus-within .route-overflow-actions {
  display: flex;
}

.route-overflow-actions a,
.route-overflow-actions button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 8px;
  background: #fff;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.route-help {
  display: grid;
  gap: 4px;
  color: var(--muted);
}

.day-head {
  display: grid;
  gap: 2px;
  margin-bottom: 10px;
}

.day-head span,
.day-head em {
  color: var(--muted);
  font-size: 12px;
}

.day-head small {
  width: fit-content;
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--teal);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

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

.day-job-details {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.day-job-details > summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 8px 10px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 950;
}

.day-job-details > summary::-webkit-details-marker {
  display: none;
}

.day-job-details > summary::after {
  content: " +";
  margin-left: auto;
}

.day-job-details[open] > summary::after {
  content: " -";
}

.day-job-details > .day-jobs {
  border-top: 1px solid var(--line);
  padding: 8px;
  max-height: min(520px, 68vh);
  overflow: auto;
  overscroll-behavior: contain;
}

.job-card {
  border: 1px solid rgba(22, 163, 74, 0.28);
  border-left: 4px solid var(--service);
  border-radius: 8px;
  padding: 10px;
  background: linear-gradient(135deg, #dcfce7, #f5fff8);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04), inset 0 0 0 1px rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.job-card:hover {
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

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

.job-card.dragging {
  opacity: 0.6;
  cursor: grabbing;
}

.job-card.installasjon {
  border-color: rgba(37, 99, 235, 0.28);
  border-left-color: #2563eb;
  background: linear-gradient(135deg, #e2edff, #f4f7ff);
}

.job-card.befaring {
  border-color: rgba(245, 158, 11, 0.34);
  border-left-color: var(--orange);
  background: linear-gradient(135deg, #fff0c8, #fff8ea);
}

.job-card.reparasjon {
  border-color: rgba(99, 102, 241, 0.34);
  border-left-color: #6366f1;
  background: linear-gradient(135deg, #e0e7ff, #f7f8ff);
}

.job-card.blaseisolering {
  border-color: rgba(8, 145, 178, 0.34);
  border-left-color: var(--insulation);
  background: linear-gradient(135deg, #cffafe, #f4feff);
}

.job-card.done {
  border-color: rgba(34, 197, 94, 0.35);
  border-left-color: var(--green);
  background: linear-gradient(135deg, #dcfce7, #f2fdf5);
}

.job-card.settled {
  opacity: 0.76;
  border-color: rgba(100, 116, 139, 0.28);
  border-left-color: #94a3b8;
  background: linear-gradient(135deg, #e2e8f0, #f8fafc);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.job-card.settled:hover {
  opacity: 0.94;
}

.job-card.needs-move {
  border-color: rgba(124, 58, 237, 0.30);
  border-left-color: #7c3aed;
  background: linear-gradient(135deg, #ede9fe, #faf7ff);
}

.job-card.overlap {
  border-color: rgba(220, 38, 38, 0.55);
  border-left-color: var(--red);
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.12), 0 8px 20px rgba(220, 38, 38, 0.10);
}

.job-card span,
.job-card small,
.job-card p {
  display: block;
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
}

.job-card strong {
  display: block;
  margin-bottom: 5px;
}

.overlap-note {
  border-radius: 8px;
  padding: 6px 8px;
  color: #991b1b !important;
  background: rgba(254, 226, 226, 0.86);
  font-weight: 900;
}

.job-meta {
  font-weight: 900;
}

.job-type-pill {
  width: fit-content;
  display: inline-flex !important;
  align-items: center;
  margin-bottom: 6px !important;
  border-radius: 999px;
  padding: 3px 8px;
  color: #075985 !important;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 11px !important;
  font-weight: 950;
}

.job-type-pill.service {
  color: var(--service-dark) !important;
}

.job-type-pill.befaring {
  color: #92400e !important;
}

.job-type-pill.reparasjon {
  color: #3730a3 !important;
}

.job-type-pill.installasjon {
  color: #1d4ed8 !important;
}

.job-type-pill.blaseisolering {
  color: var(--insulation-dark) !important;
}

.done-pill {
  width: fit-content;
  border-radius: 999px;
  padding: 3px 8px;
  background: #dcfce7;
  color: #166534 !important;
  font-size: 11px !important;
  font-weight: 900;
}

.invoice-pill {
  width: fit-content;
  border-radius: 999px;
  padding: 3px 8px;
  background: #fef3c7;
  color: #92400e !important;
  font-size: 11px !important;
  font-weight: 900;
}

.invoice-pill.overdue {
  background: #fee2e2;
  color: #991b1b !important;
}

.invoice-pill.invoiced {
  background: #dcfce7;
  color: #166534 !important;
}

.invoice-pill.draft {
  background: #e0f2fe;
  color: #075985 !important;
}

.invoice-pill.paid {
  background: #fef3c7;
  color: #92400e !important;
}

.invoice-pill.followup {
  background: #e0f2fe;
  color: #075985 !important;
}

.invoice-pill.move {
  background: #ede9fe;
  color: #5b21b6 !important;
}

.invoice-pill.overlap {
  background: #fee2e2;
  color: #991b1b !important;
}

.move-note {
  color: #5b21b6 !important;
  font-weight: 800;
}

.job-actions a,
.job-actions button {
  min-height: 32px;
  padding: 6px 8px;
  border-radius: 7px;
  font-size: 12px;
}

.modal {
  width: min(820px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  overflow: auto;
  overflow-x: hidden;
  border: 0;
  border-radius: 10px;
  padding: 0;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.25);
}

.modal::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.attachment-preview-dialog {
  width: min(980px, calc(100vw - 24px));
}

.attachment-preview-shell {
  padding: 18px;
}

.attachment-preview-status {
  min-height: 20px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.attachment-preview-body {
  min-height: 220px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.attachment-preview-body img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100dvh - 220px);
  object-fit: contain;
  background: #fff;
}

.attachment-preview-body iframe {
  width: 100%;
  height: min(70dvh, 720px);
  border: 0;
  background: #fff;
}

.attachment-preview-body p {
  max-width: 520px;
  margin: 0;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.attachment-preview-actions a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 9px 13px;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.side-modal {
  width: min(520px, calc(100vw - 18px));
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 0 0 auto;
  border: 0;
  border-left: 1px solid var(--line);
  padding: 0;
  background: #fff;
  box-shadow: -24px 0 60px rgba(15, 23, 42, 0.2);
}

.side-modal::backdrop {
  background: rgba(15, 23, 42, 0.28);
}

.side-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 16px;
  overflow: auto;
}

.crm-assistant-panel {
  position: fixed;
  z-index: 60;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(460px, calc(100vw - 18px));
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: #fff;
  box-shadow: -24px 0 60px rgba(15, 23, 42, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateX(102%);
  pointer-events: none;
  transition: transform 180ms ease, opacity 180ms ease, visibility 180ms step-end;
}

.crm-assistant-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  pointer-events: auto;
  transition: transform 180ms ease, opacity 180ms ease, visibility 0s;
}

.crm-assistant-head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 14px 14px 12px;
  background: #fff;
}

.crm-assistant-head h2,
.crm-assistant-head p {
  margin: 0;
}

.crm-assistant-head h2 {
  margin-top: 2px;
  font-size: 20px;
}

.crm-assistant-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.crm-assistant-kicker {
  display: block;
  color: #2563eb;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.crm-assistant-head-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.crm-assistant-head-actions button {
  min-height: 36px;
  padding: 7px 9px;
  font-size: 12px;
}

.crm-assistant-queue-button span {
  display: inline-flex;
  min-width: 19px;
  min-height: 19px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  margin-left: 3px;
  padding: 1px 5px;
  background: #f59e0b;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

.crm-assistant-mode-tabs {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  border-bottom: 1px solid var(--line);
  padding: 7px 12px;
  background: #f8fafc;
}

.crm-assistant-mode-tabs button {
  min-height: 38px;
  border: 1px solid transparent;
  padding: 7px 10px;
  background: transparent;
  color: #475569;
  font-size: 12px;
}

.crm-assistant-mode-tabs button[aria-selected="true"] {
  border-color: #94a3b8;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.crm-assistant-mode-tabs .crm-assistant-queue-button[aria-selected="true"] {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #92400e;
}

.crm-assistant-chat-view {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.crm-assistant-head-actions .crm-assistant-close {
  width: 36px;
  min-width: 36px;
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.crm-assistant-context {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  border-bottom: 1px solid var(--line);
  padding: 9px 14px;
  background: #f8fafc;
}

.crm-assistant-context > span,
.crm-assistant-context > strong,
.crm-assistant-context > small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.crm-assistant-context > span {
  color: #2563eb;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.crm-assistant-context > strong {
  grid-column: 1;
  font-size: 13px;
}

.route-selected-customers article > div {
  display: grid;
  gap: 6px;
}

.route-selected-customers article label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.route-selected-customers article.needs-attention {
  border-color: #f59e0b;
  background: #fffbeb;
}

.route-selection-warning {
  color: #b45309;
  font-weight: 900;
}

.crm-assistant-context > small {
  grid-column: 1;
  color: var(--muted);
  font-size: 11px;
}

.crm-assistant-context .crm-assistant-context-state {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  border-radius: 999px;
  padding: 4px 7px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 10px;
  font-weight: 900;
}

.crm-assistant-memories {
  flex: 0 0 auto;
  border-bottom: 1px solid #c7d2fe;
  padding: 8px 14px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 11px;
}

.crm-assistant-memories strong,
.crm-assistant-memories span {
  display: block;
}

.crm-assistant-memories span {
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-assistant-memories details > summary {
  cursor: pointer;
  list-style-position: inside;
}

.crm-assistant-memory-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.crm-assistant-memory-list > div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid #c7d2fe;
  padding-top: 6px;
}

.crm-assistant-memory-list span {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.crm-assistant-memory-list small {
  display: block;
  margin-bottom: 2px;
  color: #6366f1;
  font-weight: 850;
}

.crm-assistant-memory-list button {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 4px 7px;
  font-size: 10px;
}

.crm-assistant-thread-drawer {
  flex: 0 0 auto;
  max-height: min(48vh, 410px);
  overflow: auto;
  border-bottom: 1px solid var(--line);
  padding: 10px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.crm-assistant-thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.crm-assistant-thread-head > div {
  min-width: 0;
}

.crm-assistant-thread-head strong,
.crm-assistant-thread-head span {
  display: block;
}

.crm-assistant-thread-head span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.crm-assistant-thread-head button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 9px;
  font-size: 12px;
}

.crm-assistant-thread-list {
  display: grid;
  gap: 6px;
}

.crm-assistant-thread-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.crm-assistant-thread-row > button:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
  justify-items: start;
  border: 1px solid var(--line);
  padding: 8px 10px;
  background: #f8fafc;
  color: var(--ink);
  text-align: left;
}

.crm-assistant-thread-row > button:first-child.active {
  border-color: #60a5fa;
  background: #eff6ff;
}

.crm-assistant-thread-row strong,
.crm-assistant-thread-row small {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-assistant-thread-row small {
  color: var(--muted);
  font-weight: 700;
}

.crm-assistant-thread-row .crm-assistant-archive-thread {
  width: 38px;
  min-width: 38px;
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.crm-assistant-thread-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--muted);
  text-align: center;
}

.crm-assistant-error {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 10px 12px 0;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fef2f2;
  color: #991b1b;
  font-size: 12px;
}

.crm-assistant-error span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.crm-assistant-error button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 6px 8px;
  border-color: #fecaca;
  background: #fff;
  color: #991b1b;
  font-size: 11px;
}

.crm-assistant-messages {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px;
  scroll-behavior: smooth;
}

.crm-assistant-empty {
  width: min(340px, 100%);
  margin: auto;
  display: grid;
  gap: 10px;
  padding: 20px 0;
  text-align: center;
}

.crm-assistant-empty .crm-assistant-empty-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  justify-self: center;
  border-radius: 14px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 22px;
  font-weight: 900;
}

.crm-assistant-empty h3,
.crm-assistant-empty p {
  margin: 0;
}

.crm-assistant-empty h3 {
  font-size: 18px;
}

.crm-assistant-empty p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.crm-assistant-starters {
  display: grid;
  gap: 6px;
}

.crm-assistant-starters button {
  min-height: 38px;
  border: 1px solid var(--line);
  padding: 8px 10px;
  background: #fff;
  color: var(--teal);
  font-size: 12px;
  text-align: left;
}

.crm-assistant-message {
  max-width: 88%;
  display: grid;
  gap: 5px;
  align-self: flex-start;
}

.crm-assistant-message.user {
  align-self: flex-end;
}

.crm-assistant-message-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.crm-assistant-message.user .crm-assistant-message-meta {
  justify-content: flex-end;
}

.crm-assistant-message-body {
  border: 1px solid var(--line);
  border-radius: 4px 14px 14px 14px;
  padding: 10px 12px;
  background: #f8fafc;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.crm-assistant-message.user .crm-assistant-message-body {
  border-color: #0f766e;
  border-radius: 14px 4px 14px 14px;
  background: var(--teal);
  color: #fff;
}

.crm-assistant-message.system .crm-assistant-message-body {
  border-style: dashed;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.crm-assistant-memory-proposal {
  display: grid;
  gap: 2px;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  padding: 7px 9px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 11px;
  line-height: 1.4;
}

.crm-assistant-memory-proposal strong,
.crm-assistant-memory-proposal span {
  overflow-wrap: anywhere;
}

.crm-assistant-message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.crm-assistant-message-actions button {
  min-height: 28px;
  border: 1px solid var(--line);
  padding: 4px 7px;
  background: #fff;
  color: var(--muted);
  font-size: 10px;
}

.crm-assistant-message-actions button.saved,
.crm-assistant-message-actions button[aria-pressed="true"] {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.crm-assistant-loading {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 16px;
}

.crm-assistant-loading i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #64748b;
  animation: crm-assistant-pulse 1s infinite ease-in-out;
}

.crm-assistant-loading i:nth-child(2) {
  animation-delay: 140ms;
}

.crm-assistant-loading i:nth-child(3) {
  animation-delay: 280ms;
}

@keyframes crm-assistant-pulse {
  0%, 70%, 100% { opacity: 0.3; transform: translateY(0); }
  35% { opacity: 1; transform: translateY(-2px); }
}

.crm-assistant-suggestions {
  flex: 0 0 auto;
  max-height: min(34vh, 280px);
  display: grid;
  gap: 8px;
  overflow: auto;
  border-bottom: 1px solid #bfdbfe;
  padding: 10px 12px;
  background: #f8fbff;
}

.crm-assistant-suggestions > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.crm-assistant-suggestions > header strong,
.crm-assistant-suggestions > header span {
  display: block;
}

.crm-assistant-suggestions > header span {
  margin-top: 2px;
  color: #475569;
  font-size: 10px;
}

.crm-assistant-suggestions > header button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 6px 8px;
  font-size: 11px;
}

.crm-assistant-suggestion-card {
  display: grid;
  gap: 5px;
  border: 1px solid #bfdbfe;
  border-left: 4px solid #2563eb;
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
}

.crm-assistant-suggestion-card > span {
  width: fit-content;
  border-radius: 999px;
  padding: 3px 6px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.crm-assistant-suggestion-card > strong,
.crm-assistant-suggestion-card > p,
.crm-assistant-suggestion-card > small {
  margin: 0;
  overflow-wrap: anywhere;
}

.crm-assistant-suggestion-details {
  color: #334155;
  font-size: 11px;
}

.crm-assistant-suggestion-details summary {
  cursor: pointer;
  color: #1d4ed8;
  font-weight: 900;
}

.crm-assistant-suggestion-details p {
  margin: 7px 0 0;
  white-space: pre-wrap;
}

.route-campaign-entry {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.route-lunch-marker {
  display: block;
  width: fit-content;
  margin-top: 8px;
  border: 1px solid #fbbf24;
  border-radius: 8px;
  padding: 4px 8px;
  background: #fffbeb;
  color: #92400e;
  font-size: 12px;
  font-weight: 800;
}

.route-campaign-actions {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.route-campaign-actions label {
  min-width: 112px;
}

.route-campaign-entry small {
  max-width: 680px;
  color: var(--muted);
  line-height: 1.4;
}

.crm-assistant-suggestion-card > p {
  max-height: 4.5em;
  overflow: hidden;
  color: #334155;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.crm-assistant-suggestion-card > small {
  color: #475569;
  font-size: 10px;
  font-weight: 800;
}

.crm-assistant-suggestion-card.error {
  border-color: #fecaca;
  border-left-color: #dc2626;
}

.crm-assistant-more-suggestions {
  width: 100%;
  min-height: 38px;
  font-size: 12px;
}

.crm-assistant-review-view {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
}

.crm-assistant-review-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  background: #fff;
}

.crm-assistant-review-head strong,
.crm-assistant-review-head span {
  display: block;
}

.crm-assistant-review-head strong {
  color: var(--ink);
  font-size: 15px;
}

.crm-assistant-review-head span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.crm-assistant-review-head button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 9px;
  font-size: 11px;
}

.crm-assistant-review-filters {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  border-bottom: 1px solid var(--line);
  padding: 7px 10px;
  background: #fff;
}

.crm-assistant-review-filters button {
  min-width: 0;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid transparent;
  padding: 6px 7px;
  background: transparent;
  color: #475569;
  font-size: 10px;
}

.crm-assistant-review-filters button[aria-pressed="true"] {
  border-color: #94a3b8;
  background: #f8fafc;
  color: var(--ink);
}

.planning-more-tools {
  position: relative;
}

.planning-more-tools > summary {
  width: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  list-style: none;
}

.planning-more-tools > summary::-webkit-details-marker {
  display: none;
}

.planning-more-tools[open] > summary {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal);
}

.planning-more-tools > div {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.planning-more-tools > div button {
  width: 100%;
}

.planning-day-picker {
  display: none;
}

.planning-mobile-edit {
  display: none;
}

.crm-assistant-review-filters button span {
  min-width: 19px;
  min-height: 19px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  padding: 1px 5px;
  background: #e2e8f0;
  color: #334155;
  font-size: 9px;
  font-weight: 900;
}

.crm-assistant-review-content {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px;
}

.crm-assistant-review-list {
  display: grid;
  gap: 7px;
}

.crm-assistant-review-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  padding: 9px;
  background: #fff;
}

.crm-assistant-review-row-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.crm-assistant-review-row-main > strong,
.crm-assistant-review-row-main > span,
.crm-assistant-review-row-main > small {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.crm-assistant-review-row-main > strong {
  color: var(--ink);
  font-size: 13px;
}

.crm-assistant-review-row-main > span {
  max-height: 2.8em;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.crm-assistant-review-row-main > small {
  color: #334155;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.35;
}

.crm-assistant-review-row > button {
  min-width: 112px;
  min-height: 40px;
  padding: 7px 9px;
  font-size: 11px;
}

.crm-assistant-review-more {
  width: 100%;
  min-height: 40px;
  margin-top: 8px;
}

.crm-assistant-review-empty {
  display: grid;
  gap: 4px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 24px 16px;
  background: #fff;
  color: var(--muted);
  text-align: center;
}

.crm-assistant-review-empty strong {
  color: var(--ink);
}

.crm-assistant-review-detail .assistant-action-list article {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.crm-assistant-review-detail .assistant-action-list > article > .mini-action-row {
  position: sticky;
  z-index: 2;
  bottom: -10px;
  width: calc(100% + 20px);
  justify-content: flex-start;
  margin: 4px -10px -10px;
  border-top: 1px solid var(--line);
  padding: 9px 10px calc(9px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 -6px 14px rgba(15, 23, 42, 0.08);
}

.crm-assistant-review-detail .assistant-action-list > article > .mini-action-row > * {
  flex: 1 1 140px;
}

.assistant-queue-summary {
  align-items: center;
}

.assistant-queue-clear {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.assistant-inbox-review-list {
  margin-top: 10px;
}

.crm-assistant-workflow-card {
  display: grid;
  gap: 7px;
  border: 1px solid #99f6e4;
  border-left: 4px solid #0f766e;
  border-radius: 9px;
  padding: 10px;
  background: #f0fdfa;
}

.crm-assistant-workflow-card.attention {
  border-color: #fed7aa;
  border-left-color: #c2410c;
  background: #fff7ed;
}

.crm-assistant-workflow-card > span {
  width: fit-content;
  border-radius: 999px;
  padding: 3px 6px;
  background: #ccfbf1;
  color: #115e59;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.crm-assistant-workflow-card.attention > span {
  background: #ffedd5;
  color: #9a3412;
}

.crm-assistant-workflow-card > strong,
.crm-assistant-workflow-card > p,
.crm-assistant-workflow-card > small {
  margin: 0;
  overflow-wrap: anywhere;
}

.crm-assistant-workflow-card > p {
  color: #134e4a;
  font-size: 12px;
  line-height: 1.4;
}

.crm-assistant-workflow-card > small {
  color: #475569;
  font-size: 10px;
  font-weight: 800;
}

.crm-assistant-workflow-card .mini-action-row {
  margin-top: 2px;
}

.crm-assistant-form {
  flex: 0 0 auto;
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  background: #fff;
}

.crm-assistant-form textarea {
  width: 100%;
  min-height: 68px;
  max-height: 180px;
  resize: vertical;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 11px;
  background: #fff;
  color: var(--ink);
  line-height: 1.4;
}

.crm-assistant-form textarea:focus {
  outline: 3px solid rgba(37, 99, 235, 0.16);
  border-color: #2563eb;
}

.crm-assistant-form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.crm-assistant-form-foot span {
  color: var(--muted);
  font-size: 10px;
}

.crm-assistant-form-foot button {
  min-width: 78px;
}

.mobile-more-menu .mobile-assistant-entry {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

@media (prefers-reduced-motion: reduce) {
  .crm-assistant-panel {
    transition: none;
  }

  .crm-assistant-loading i {
    animation: none;
  }
}

@media (max-width: 760px) {
  body.crm-assistant-open {
    overflow: hidden;
  }

  .crm-assistant-button {
    display: none;
  }

  .crm-assistant-panel {
    z-index: 80;
    inset: 0;
    width: auto;
    max-width: none;
    height: auto;
    max-height: 100dvh;
    border-left: 0;
    box-shadow: none;
  }

  .crm-assistant-panel > *,
  .crm-assistant-chat-view,
  .crm-assistant-suggestions,
  .crm-assistant-form,
  .crm-assistant-form textarea,
  .crm-assistant-starters,
  .crm-assistant-starters button {
    min-width: 0;
    max-width: 100%;
  }

  .crm-assistant-form textarea,
  .crm-assistant-starters button {
    width: 100%;
  }

  .crm-assistant-head {
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
  }

  .crm-assistant-head-actions button {
    min-height: 42px;
  }

  .crm-assistant-head-actions #crmAssistantThreadsButton {
    font-size: 0;
  }

  .crm-assistant-head-actions #crmAssistantThreadsButton::after {
    content: "Historikk";
    font-size: 11px;
  }

  .crm-assistant-message {
    max-width: 92%;
  }

  .crm-assistant-suggestions {
    max-height: 34vh;
  }

  .crm-assistant-review-row {
    grid-template-columns: 1fr;
  }

  .crm-assistant-review-row > button {
    width: 100%;
  }

  .crm-assistant-review-filters button {
    flex-direction: column;
    gap: 2px;
    min-height: 46px;
    line-height: 1.15;
  }

  .assistant-inbox-review-list .crm-assistant-review-row {
    grid-template-columns: 1fr;
  }

  .crm-assistant-panel.review-mode .crm-assistant-head {
    align-items: center;
    padding-block: calc(8px + env(safe-area-inset-top, 0px)) 8px;
  }

  .crm-assistant-panel.review-mode .crm-assistant-kicker,
  .crm-assistant-panel.review-mode .crm-assistant-head p {
    display: none;
  }

  .crm-assistant-panel.review-mode .crm-assistant-head h2 {
    margin: 0;
    font-size: 17px;
  }

  .crm-assistant-form textarea {
    min-height: 58px;
    resize: none;
    font-size: 16px;
  }
}

@media (max-width: 420px) {
  .crm-assistant-head {
    gap: 8px;
    flex-wrap: wrap;
  }

  .crm-assistant-head p {
    display: none;
  }

  .crm-assistant-head-actions {
    width: 100%;
    justify-content: flex-end;
    gap: 4px;
  }

  .crm-assistant-head-actions button {
    padding: 6px 7px;
  }

  .crm-assistant-panel.review-mode .crm-assistant-head {
    flex-wrap: nowrap;
  }

  .crm-assistant-panel.review-mode .crm-assistant-head-actions {
    width: auto;
    margin-left: auto;
  }
}

.quick-title h3 {
  margin: 10px 0 4px;
  font-size: 24px;
}

.quick-title p {
  margin: 0 0 12px;
  color: var(--muted);
}

.quick-job-focus {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  border: 1px solid rgba(99, 102, 241, 0.28);
  border-left: 5px solid #6366f1;
  border-radius: 10px;
  padding: 12px;
  background: linear-gradient(135deg, #eef2ff, #ffffff 56%);
}

.quick-field-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(96px, 0.7fr);
  gap: 8px;
}

.quick-field-actions a {
  min-width: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  background: #fff;
  color: var(--teal);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: normal;
}

.quick-job-focus.service {
  border-color: rgba(22, 163, 74, 0.28);
  border-left-color: var(--service);
  background: linear-gradient(135deg, #dcfce7, #ffffff 56%);
}

.quick-job-focus.installasjon {
  border-color: rgba(37, 99, 235, 0.30);
  border-left-color: #2563eb;
  background: linear-gradient(135deg, #e2edff, #ffffff 56%);
}

.quick-job-focus.befaring {
  border-color: rgba(245, 158, 11, 0.34);
  border-left-color: var(--orange);
  background: linear-gradient(135deg, #fff0c8, #ffffff 56%);
}

.quick-job-focus.blaseisolering {
  border-color: rgba(8, 145, 178, 0.34);
  border-left-color: var(--insulation);
  background: linear-gradient(135deg, #cffafe, #ffffff 56%);
}

.quick-job-head {
  display: grid;
  gap: 5px;
}

.quick-job-head strong {
  color: var(--ink);
  font-size: 17px;
}

.quick-job-head em,
.job-billing-hint,
.quick-job-note {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

.job-billing-hint {
  margin: 0;
}

.quick-job-note {
  margin: 0;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.quick-facts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 14px 0;
}

.quick-facts div,
.quick-block {
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--soft);
}

.quick-block.booking {
  border-left: 4px solid var(--teal);
  background: #f0fdfa;
}

.quick-block.attention {
  border-color: #fed7aa;
  background: #fff7ed;
}

.quick-block span,
.quick-block p,
.quick-facts dt {
  color: var(--muted);
}

.quick-facts dt {
  font-size: 12px;
  font-weight: 800;
}

.quick-facts dd {
  min-width: 0;
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.billing-contact-check {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  padding: 10px;
  background: #f0fdfa;
}

.billing-contact-check.missing {
  border-color: #fdba74;
  background: #fff7ed;
}

.billing-contact-check > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.billing-contact-check strong,
.billing-contact-check span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.billing-contact-check > div > strong {
  font-size: 12px;
}

.quick-actions {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.quick-actions button.star-toggle {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--teal);
}

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

.technician-help {
  margin: 0 0 16px;
}

.technician-help article,
.tech-flow-help {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px 14px;
}

.technician-help strong {
  display: block;
  margin-bottom: 6px;
}

.technician-help ol {
  margin: 0;
  padding-left: 18px;
}

.technician-help li + li {
  margin-top: 4px;
}

.tech-flow-help {
  margin: 8px 0 0;
}

.technician-actions input {
  width: auto;
  min-width: 160px;
}

.technician-actions select {
  width: auto;
  min-width: 130px;
}

.technician-timesheet {
  margin: 0 0 16px;
}

.technician-timesheet-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.technician-timesheet-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
}

.technician-timesheet-details > summary span {
  display: grid;
  gap: 2px;
}

.technician-timesheet-details > summary small {
  color: var(--muted);
}

.technician-timesheet-details > summary em {
  color: var(--teal);
  font-style: normal;
  font-weight: 900;
}

.technician-time-list {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 12px;
  background: #f8fafc;
}

.technician-time-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 0.7fr)) minmax(180px, 1.4fr) auto;
  gap: 8px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.technician-time-row label {
  min-width: 0;
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.technician-time-row input,
.technician-time-row select {
  width: 100%;
  min-width: 0;
}

.technician-time-summary,
.technician-time-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.technician-time-actions {
  grid-column: 1 / -1;
}

.technician-jobs-heading {
  margin: 4px 0 0;
  font-size: 18px;
}

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

.job-card {
  cursor: pointer;
}

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

#bookingDialog form {
  border-top: 6px solid var(--service);
  background: linear-gradient(135deg, #f0fdf4, #ffffff 46%);
}

#bookingDialog.booking-service form {
  border-top-color: var(--service);
  background: linear-gradient(135deg, #dcfce7, #ffffff 48%);
}

#bookingDialog.booking-befaring form {
  border-top-color: var(--orange);
  background: linear-gradient(135deg, #fff0c8, #ffffff 48%);
}

#bookingDialog.booking-reparasjon form {
  border-top-color: #6366f1;
  background: linear-gradient(135deg, #e0e7ff, #ffffff 48%);
}

#bookingDialog.booking-installasjon form {
  border-top-color: #2563eb;
  background: linear-gradient(135deg, #e2edff, #ffffff 48%);
}

#bookingDialog.booking-blaseisolering form {
  border-top-color: var(--insulation);
  background: linear-gradient(135deg, #cffafe, #ffffff 48%);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.modal-head h2 {
  margin: 0;
}

.modal-head button {
  width: 44px;
  min-height: 44px;
  padding: 0;
  background: #e2e8f0;
  color: var(--ink);
}

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

.form-wide {
  grid-column: 1 / -1;
}

.form-advanced-details {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.form-advanced-details > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 9px 12px;
  color: #334155;
  font-weight: 900;
  cursor: pointer;
}

.form-advanced-details[open] > summary {
  border-bottom: 1px solid var(--line);
  background: #f1f5f9;
}

.form-advanced-body {
  padding: 12px;
}

.legacy-customer-fields {
  background: #fffbeb;
  border-color: #fde68a;
}

.legacy-customer-fields[open] > summary {
  background: #fef3c7;
  border-color: #fde68a;
}

.check-row {
  min-height: 46px;
  display: flex;
  flex-direction: row !important;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--soft);
  font-weight: 900;
}

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

.tag-catalog {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}

.tag-chip {
  display: inline-flex;
  flex-direction: row !important;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.tag-chip.active {
  border-color: #99f6e4;
  background: #ccfbf1;
  color: #0f766e;
}

.tag-chip input {
  width: auto;
  min-height: auto;
}

.tag-catalog-empty {
  color: var(--muted);
  font-size: 13px;
}

.dialog-message {
  margin-bottom: 12px;
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 800;
}

.dialog-message.error {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.dialog-message.ok {
  border: 1px solid #f59e0b;
  background: #fffbeb;
  color: #92400e;
}

.dialog-message.info {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e40af;
}

.lead-status-summary,
.lead-status-order-fields {
  min-width: 0;
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

#leadStatusDialog,
#leadStatusDialog form,
#leadStatusDialog label,
#leadStatusDialog textarea,
#leadStatusDialog select,
#leadStatusDialog input {
  min-width: 0;
  max-width: 100%;
}

#leadStatusDialog form {
  overflow-x: hidden;
}

.accepted-offer-panel {
  display: grid;
  gap: 6px;
  border: 1px solid #86efac;
  border-left: 4px solid #15803d;
  border-radius: 8px;
  padding: 10px;
  background: #f0fdf4;
}

.accepted-offer-panel label {
  color: #14532d;
  font-weight: 950;
}

.accepted-offer-panel select {
  margin-top: 5px;
  background: #fff;
}

.accepted-offer-panel p {
  margin: 0;
  color: #166534;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.lead-status-summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

.lead-status-summary strong {
  color: var(--ink);
  font-size: 18px;
}

.lead-status-summary span {
  color: var(--muted);
  font-weight: 800;
}

.lead-status-order-fields {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  overflow-x: hidden;
}

.lead-status-order-summary {
  display: grid;
  gap: 3px;
  border-left: 4px solid #15803d;
  padding: 8px 10px;
  background: #f0fdf4;
}

.lead-status-order-summary span,
.lead-status-order-summary small {
  color: #166534;
  font-size: 12px;
  font-weight: 800;
}

.lead-status-order-summary strong {
  color: #14532d;
  line-height: 1.35;
}

.lead-status-price-controls {
  grid-template-columns: minmax(78px, 0.55fr) minmax(130px, 1fr) minmax(82px, 0.6fr);
  margin-top: 0;
}

.lead-status-search-field {
  grid-column: 1 / -1;
}

.lead-status-preset-field {
  grid-column: 1 / -1;
}

.lead-status-qty-field {
  grid-column: 1 / 2;
}

.lead-status-unit-price-field {
  grid-column: 2 / 3;
}

.lead-status-discount-field {
  grid-column: 3 / 4;
}

.lead-status-price-controls button {
  grid-column: 1 / -1;
  min-height: 40px;
}

.lead-status-order-fields .completion-price-total {
  margin-top: -4px;
}

.lead-status-product-editor {
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
}

.lead-status-product-editor > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 10px 12px;
  color: var(--ink);
  font-weight: 900;
}

.lead-status-product-editor[open] > summary {
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.lead-status-product-editor-body {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 0 10px 10px;
}

.lead-status-next-step {
  display: grid;
  gap: 6px;
  margin: 0;
  border: 0;
  padding: 0;
}

.lead-status-installation-hint {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.lead-status-next-step legend {
  margin-bottom: 4px;
  padding: 0;
  color: var(--ink);
  font-weight: 900;
}

.lead-status-next-step .check-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
}

.lead-status-next-step .check-row > span {
  display: grid;
  gap: 2px;
}

.lead-status-next-step .check-row small {
  color: var(--muted);
  font-weight: 700;
}

.manual-copy-fallback {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 9999;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
}

.manual-copy-fallback div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.manual-copy-fallback button {
  min-height: 34px;
  padding: 0 10px;
}

.manual-copy-fallback [aria-label="Lukk kopieringsboks"] {
  width: 34px;
  padding: 0;
}

.manual-copy-fallback p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.manual-copy-fallback textarea {
  font-size: 16px;
  min-height: 84px;
  resize: none;
}

@media (max-width: 760px) {
  .manual-copy-fallback {
    right: 10px;
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    width: calc(100vw - 20px);
  }
}

.completion-summary {
  display: grid;
  min-width: 0;
  gap: 4px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
  overflow-wrap: anywhere;
}

.completion-summary strong {
  color: var(--ink);
  font-size: 18px;
}

.completion-summary span,
.completion-summary p {
  min-width: 0;
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.completion-summary ul {
  margin: 6px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.completion-price-details {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.completion-price-details summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 900;
}

.completion-price-controls {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  margin-top: 10px;
}

.completion-price-controls > label,
.completion-price-controls > fieldset,
.completion-price-controls > button,
.lead-status-order-fields label,
.lead-status-order-fields textarea,
.lead-status-order-fields select,
.lead-status-order-fields input {
  min-width: 0;
  max-width: 100%;
}

.price-discount-editor {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 4px 6px;
  margin: 0;
  border: 0;
  padding: 0;
}

.price-discount-editor legend {
  grid-column: 1 / -1;
  margin: 0 0 1px;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.price-discount-mode {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.price-discount-mode label {
  display: block;
  margin: 0 !important;
  cursor: pointer;
}

.price-discount-mode input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  opacity: 0;
  pointer-events: none;
}

.price-discount-mode span {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--line);
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.price-discount-mode label:last-child span {
  border-right: 0;
}

.price-discount-mode input:checked + span {
  background: var(--teal);
  color: #fff;
}

.price-discount-mode input:focus-visible + span {
  outline: 3px solid rgba(13, 148, 136, 0.22);
  outline-offset: -3px;
}

.price-discount-editor > input {
  min-width: 0;
  width: 100%;
}

.price-discount-editor > small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

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

.completion-price-details textarea {
  width: 100%;
  max-width: 100%;
  margin-top: 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  resize: vertical;
}

.completion-price-total {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.billing-draft-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.billing-draft-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 8px;
  padding: 9px 13px;
  font-weight: 800;
}

.completion-attachment-section {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.completion-attachment-list {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.completion-attachment-list ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.completion-attachment-list li {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 8px;
  align-items: center;
  padding: 6px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--soft);
}

.completion-attachment-list li > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.completion-attachment-list .remove-pending-attachment {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid #fecaca;
  background: #fff;
  color: #b91c1c;
  font-size: 20px;
  line-height: 1;
}

.completion-attachment-list small {
  color: var(--muted);
  font-weight: 700;
}

.crm-attachment-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}

.crm-attachment-actions .remove-crm-attachment {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid #fecaca;
  background: #fff;
  color: #b91c1c;
  font-size: 20px;
  line-height: 1;
}

@media (max-width: 900px) {
  .completion-price-controls:not(.lead-status-price-controls) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .completion-price-controls {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .modal {
    width: calc(100vw - 12px);
    max-width: calc(100vw - 12px);
    max-height: calc(100dvh - 12px);
    border-radius: 8px;
  }

  .modal form {
    padding: 12px;
  }

  .compact-modal {
    max-width: calc(100vw - 12px);
  }

  .lead-status-order-fields {
    padding-top: 10px;
  }

  .lead-status-price-controls,
  .lead-status-search-field,
  .lead-status-preset-field,
  .lead-status-qty-field,
  .lead-status-unit-price-field,
  .lead-status-discount-field {
    grid-column: 1 / -1;
  }

  .lead-status-price-controls button {
    width: 100%;
  }

  .modal-actions {
    gap: 8px;
  }

  .modal-actions button {
    flex: 1 1 0;
    min-width: 0;
  }

  #leadStatusDialog .modal-actions {
    position: sticky;
    z-index: 3;
    bottom: -12px;
    margin-right: -12px;
    margin-left: -12px;
    border-top: 1px solid var(--line);
    padding: 10px 12px 12px;
    background: #fff;
  }
}

.choice-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.choice-stack label {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.choice-stack input {
  width: auto;
  min-height: auto;
  margin-top: 3px;
}

.choice-stack span {
  display: grid;
  gap: 2px;
}

.choice-stack small {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.35;
}

.compact-modal {
  max-width: min(520px, calc(100vw - 12px));
}

.confirm-text {
  margin: 0 0 16px;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.45;
  white-space: pre-line;
}

.completion-installation {
  display: block;
  margin: 0 0 12px;
}

.hidden-select {
  display: none;
}

.booking-customer-picker {
  position: relative;
}

.booking-customer-results {
  display: grid;
  gap: 6px;
}

.booking-customer-results button,
.booking-result-empty {
  min-height: 46px;
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.booking-customer-results button.active {
  border-color: var(--teal);
  background: #e7f4f2;
}

.booking-customer-results span,
.booking-result-empty {
  color: var(--muted);
  font-size: 12px;
}

.booking-month {
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}

.booking-month-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.booking-month-head strong {
  text-align: center;
  text-transform: capitalize;
}

.booking-month-head button {
  min-height: 34px;
  padding: 6px 10px;
}

.planning-mode-toggle {
  display: inline-flex;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  background: #fff;
}

.planning-mode-toggle button {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  padding: 5px 10px;
  background: transparent;
  color: var(--muted);
}

.planning-mode-toggle button.active {
  background: rgba(15, 118, 110, 0.12);
  color: var(--teal-dark);
}

.planning-month-overview {
  display: grid;
  gap: 10px;
  margin: 12px 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

.planning-month-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.planning-month-summary strong {
  color: var(--ink);
  text-transform: capitalize;
}

.planning-month-summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.planning-month-grid .month-day {
  min-height: 72px;
}

.planning-month-grid .month-day small {
  min-height: 14px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
}

.planning-month-grid .month-day.selected {
  outline: 2px solid rgba(15, 118, 110, 0.24);
  border-color: var(--teal);
  background: var(--teal-soft);
}

.booking-month-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.booking-month-legend span {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.legend-dot,
.month-day i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.service,
.month-day i.service {
  background: var(--service);
}

.legend-dot.reparasjon,
.month-day i.reparasjon {
  background: #6366f1;
}

.legend-dot.befaring,
.month-day i.befaring {
  background: var(--orange);
}

.legend-dot.installasjon,
.month-day i.installasjon {
  background: #2563eb;
}

.legend-dot.blaseisolering,
.month-day i.blaseisolering {
  background: var(--insulation);
}

.booking-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.month-weekday {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.month-empty {
  min-height: 44px;
}

.month-day {
  min-height: 44px;
  display: grid;
  gap: 2px;
  align-content: center;
  justify-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
  background: #fff;
  color: var(--ink);
}

.month-day.light {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.month-day.some {
  border-color: #fed7aa;
  background: #fff7ed;
}

.month-day.busy {
  border-color: #fecaca;
  background: #fef2f2;
}

.month-day.selected {
  outline: 3px solid rgba(15, 118, 110, 0.24);
  border-color: var(--teal);
}

.month-day.today {
  border-color: var(--teal);
  box-shadow: inset 0 0 0 2px rgba(15, 118, 110, 0.28);
}

.month-day.today span::after {
  content: "i dag";
  display: block;
  margin-top: 1px;
  color: var(--teal-dark);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}

.month-day span {
  font-weight: 900;
}

.month-day em {
  min-height: 13px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.month-day b {
  min-height: 8px;
  display: flex;
  gap: 3px;
}

.booking-day-agenda {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.day-agenda-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
}

.day-agenda-head span {
  color: var(--muted);
  font-weight: 900;
}

.day-agenda-free {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.day-agenda-preview {
  border: 1px solid rgba(22, 163, 74, 0.28);
  border-radius: 8px;
  padding: 7px 9px;
  background: #f0fdf4;
  color: #166534;
  font-size: 12px;
  font-weight: 900;
}

.day-agenda-preview.conflict {
  border-color: rgba(220, 38, 38, 0.24);
  background: #fef2f2;
  color: #991b1b;
}

.free-slot {
  border: 0;
  border-radius: 999px;
  padding: 4px 8px;
  background: #dcfce7;
  color: #166534;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.free-slot.busy {
  cursor: default;
  background: #fee2e2;
  color: #991b1b;
}

.day-agenda-list {
  display: grid;
  gap: 6px;
}

.day-agenda-job {
  border: 1px solid rgba(22, 163, 74, 0.28);
  border-left: 4px solid var(--service);
  border-radius: 8px;
  padding: 8px 9px;
  background: linear-gradient(135deg, #dcfce7, #f5fff8);
}

.day-agenda-job.befaring {
  border-color: rgba(245, 158, 11, 0.34);
  border-left-color: var(--orange);
  background: linear-gradient(135deg, #fff0c8, #fff9ee);
}

.day-agenda-job.reparasjon {
  border-color: rgba(99, 102, 241, 0.34);
  border-left-color: #6366f1;
  background: linear-gradient(135deg, #e0e7ff, #f8f9ff);
}

.day-agenda-job.installasjon {
  border-color: rgba(37, 99, 235, 0.28);
  border-left-color: #2563eb;
  background: linear-gradient(135deg, #e2edff, #f7f9ff);
}

.day-agenda-job.blaseisolering {
  border-color: rgba(8, 145, 178, 0.34);
  border-left-color: var(--insulation);
  background: linear-gradient(135deg, #cffafe, #f4feff);
}

.day-agenda-job:not(.same-resource) {
  opacity: 0.68;
}

.day-agenda-job strong,
.day-agenda-job span {
  display: block;
}

.day-agenda-job span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.modal label:not(.form-grid label) {
  margin-top: 10px;
}

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

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

  .sidebar {
    min-height: auto;
    position: static;
  }

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

  .customer-layout,
  .leads-layout,
  .orders-layout,
  .insulation-layout,
  .insulation-workspace,
  .dashboard-grid,
  .dashboard-focus-grid,
  .metric-grid,
  .lead-metrics,
  .order-metrics,
  .lead-next-action,
  .lead-offer-grid,
  .lead-offer-context-grid,
  .lead-offer-line-grid,
  .lead-offer-line-advanced-grid,
  .lead-offer-builder-head,
  .lead-offer-builder-footer,
  .insulation-offer-customer,
  .rental-input-grid,
  .rental-image-grid,
  .profile-list article,
  .tag-settings-list article,
  .user-invite-grid,
  .timesheet-admin-list article,
  .technician-time-row,
  .product-catalog-form-grid,
  .product-catalog-toolbar,
  .global-search-results button,
  .ai-draft-grid,
  .insulation-input-grid,
  .insulation-input-grid.compact,
  .route-controls {
    grid-template-columns: 1fr;
  }

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

  .google-insights-detail-grid {
    grid-template-columns: 1fr;
  }

  .route-card {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .route-card-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

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

  .compact-action-card .mini-action-row {
    justify-content: flex-start;
  }

  .global-search-results span {
    grid-row: auto;
    place-items: start;
    width: fit-content;
    padding: 6px 8px;
  }

  .route-overflow-actions {
    display: flex;
  }

  .topbar,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .job-flow-steps {
    grid-template-columns: repeat(5, minmax(54px, 1fr));
    overflow-x: auto;
    padding-bottom: 3px;
  }
}

@media (max-width: 620px) {
  .main {
    min-width: 0;
    max-width: 100%;
    padding: 12px;
  }

  .main > .view,
  .panel,
  .leads-layout,
  .customer-layout,
  .orders-layout,
  .customer-detail,
  .lead-detail,
  .order-detail {
    min-width: 0;
    max-width: 100%;
  }

  .side-modal {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-left: 0;
  }

  .side-panel {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    padding: 12px;
  }

  .attachment-preview-dialog {
    width: calc(100vw - 12px);
    max-width: calc(100vw - 12px);
    max-height: calc(100dvh - 12px);
  }

  .attachment-preview-shell {
    padding: 12px;
  }

  .attachment-preview-body {
    min-height: 180px;
  }

  .attachment-preview-body img {
    max-height: calc(100dvh - 205px);
  }

  .attachment-preview-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .attachment-preview-actions > * {
    width: 100%;
  }

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

  .form-grid,
  .facts,
  .search-row,
  .order-bulk-actions,
  .order-list-row,
  .intake-inbox-list article,
  .assistant-action-list article,
  .assistant-planning-card,
  .billing-queue-card,
  .customer-order-list article,
  .order-booking-list article,
  .ai-attachment-list article,
  .ai-draft-summary,
  .technician-actions,
  .route-customer-results button,
  .route-selected-customers article,
  .route-missing-list button,
  .insulation-customer-card,
  .ai-two-cols,
  .insulation-line {
    grid-template-columns: 1fr;
  }

  .technician-actions input,
  .technician-actions select,
  .technician-actions button {
    width: 100%;
  }

  .ai-draft-summary,
  .ai-attachment-list article {
    display: grid;
  }

  .ai-draft-summary > strong,
  .ai-attachment-list button {
    justify-self: start;
  }

  .intake-inbox-list .mini-action-row,
  .assistant-action-list .mini-action-row,
  .customer-order-list article > button,
  .order-booking-list article > button {
    justify-self: start;
  }

  .assistant-action-list .mini-action-row,
  .assistant-proposal-actions,
  .billing-queue-card > button {
    width: 100%;
  }

  .assistant-action-list .mini-action-row > *,
  .assistant-proposal-actions > * {
    flex: 1 1 140px;
  }

  .job-flow-head strong {
    font-size: 16px;
  }

  .job-flow-steps {
    grid-template-columns: repeat(auto-fit, minmax(46px, 1fr));
    gap: 8px 4px;
    overflow-x: visible;
    padding-bottom: 0;
  }

  .job-flow-steps li {
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.15;
  }

  .timeline-axis,
  .timeline-grid {
    height: 430px;
  }
}

@media (max-width: 760px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .app {
    display: block;
    padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px));
  }

  .sidebar {
    display: none;
  }

  .main {
    padding: 12px;
  }

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

  .settings-summary article {
    min-width: 0;
    padding: 10px;
  }

  .settings-summary article:last-child {
    grid-column: 1 / -1;
  }

  .attachment-preview-dialog {
    width: calc(100vw - 12px);
    max-width: calc(100vw - 12px);
    max-height: calc(100dvh - 12px);
  }

  .attachment-preview-shell {
    padding: 12px;
  }

  .attachment-preview-body {
    min-height: 180px;
  }

  .attachment-preview-body img {
    max-height: calc(100dvh - 205px);
  }

  .attachment-preview-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .attachment-preview-actions > * {
    width: 100%;
  }

  #leadsView .lead-list-panel {
    display: flex;
    flex-direction: column;
  }

  #leadsView .lead-list-panel > .section-head {
    order: 1;
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .list-panel-toolbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .list-view-switch {
    grid-template-columns: repeat(2, minmax(68px, 1fr));
  }

  .customer-list.details-mode .crm-detail-table-scroll,
  .lead-list.details-mode .crm-detail-table-scroll {
    max-height: 66dvh;
  }

  #leadsView .lead-list-panel > .search-row {
    order: 2;
    margin-bottom: 8px;
  }

  #leadsView .lead-list-panel > .lead-metrics {
    order: 3;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 0 10px;
  }

  #leadsView .lead-list-panel > .lead-stage-filters {
    order: 4;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 0 10px;
  }

  #leadsView .lead-list-panel > .lead-stage-filters button:first-child {
    grid-column: 1 / -1;
  }

  #ordersView .order-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #ordersView .order-metrics button {
    min-height: 64px;
  }

  #leadsView .lead-list-panel > #websiteSubmissionInbox {
    order: 5;
  }

  #leadsView .lead-list-panel > #leadList {
    order: 6;
    max-height: none;
    overflow: visible;
  }

  #leadsView:not(.mobile-detail-open) .lead-detail {
    display: none;
  }

  #leadsView.mobile-detail-open > .ai-registration-panel,
  #leadsView.mobile-detail-open > .assistant-action-queue,
  #leadsView.mobile-detail-open > .intake-inbox-panel,
  #leadsView.mobile-detail-open .lead-list-panel {
    display: none;
  }

  #leadsView.mobile-detail-open .leads-layout {
    display: block;
  }

  #leadsView.mobile-detail-open .lead-detail {
    display: block;
  }

  #customersView:not(.mobile-detail-open) .customer-detail {
    display: none;
  }

  #customersView.mobile-detail-open .customer-list-panel {
    display: none;
  }

  #customersView.mobile-detail-open .customer-layout,
  #customersView.mobile-detail-open .customer-detail {
    display: block;
  }

  #customersView .customer-list {
    max-height: none;
    overflow: visible;
  }

  #customersView .customer-list button {
    min-height: 68px;
    border-radius: 8px;
    padding: 10px;
  }

  #customersView .customer-list strong,
  #customersView .customer-list small {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .customer-search-summary {
    display: block;
    min-height: 20px;
    margin: -2px 0 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
  }

  .customer-search-prompt {
    min-height: 92px;
    display: grid;
    place-items: center;
  }

  .mobile-customer-back {
    display: inline-flex;
    align-items: center;
    width: auto;
    margin-bottom: 10px;
  }
  .mobile-lead-back {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: auto;
    margin-bottom: 10px;
  }

  .topbar {
    position: static;
    padding: 10px 0 8px;
    background: var(--soft);
  }

  .topbar h1 {
    font-size: 24px;
  }

  .top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  #importSeedButton {
    grid-column: 1 / -1;
  }

  .top-search {
    width: 100%;
  }

  .quick-reminder-button {
    justify-self: end;
  }

  .top-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    width: 100%;
    max-height: calc(100dvh - 220px);
  }

  .new-action-wrap {
    grid-column: 1 / -1;
    justify-self: end;
  }

  .new-action-menu {
    right: 0;
    width: min(260px, 88vw);
  }

  input,
  select,
  textarea {
    min-height: 44px;
    font-size: 16px;
  }

  button {
    min-height: 44px;
  }

  .action-row a,
  .action-row button,
  .customer-detail button,
  .lead-detail button,
  .order-detail button,
  .job-actions a,
  .job-actions button,
  .lead-next-actions button,
  .lead-contact-actions a,
  .lead-contact-actions button,
  .copy-phone-button,
  .planning-head button,
  .plan-tabs button,
  .inbox-tabs button,
  .job-tabs button,
  .insulation-tabs button {
    min-height: 44px;
  }

  .copy-phone-button {
    padding: 8px 12px;
    font-size: 13px;
  }

  .payment-control button,
  .invoice-payment-row .payment-control button,
  .tag-toggle {
    min-height: 44px;
  }

  .view details > summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .booking-month-head button {
    min-height: 44px;
  }

  .lead-stage-box span,
  .lead-next-action p {
    display: none;
  }

  .customer-work-summary,
  .customer-work-summary.compact {
    grid-template-columns: minmax(0, 1fr);
  }

  .customer-work-summary article {
    min-height: 64px;
  }

  .customer-pulse-head,
  .customer-pulse-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .customer-pulse-head {
    display: grid;
  }

  .customer-pulse-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  .customer-pulse-actions button,
  .contact-log-presets button {
    min-width: 0;
    width: 100%;
    white-space: normal;
  }

  .lead-next-action {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    padding: 12px;
  }

  .lead-offer-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .lead-offer-heading {
    display: grid;
  }

  .lead-offer-heading > span {
    justify-self: start;
    white-space: normal;
  }

  .lead-offer-primary-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .lead-offer-preview-button,
  .lead-offer-send {
    width: 100%;
    min-width: 0;
  }

  .lead-offer-preview iframe {
    min-height: 560px;
  }

  .lead-offer-builder-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
  }

  .lead-offer-more-actions {
    justify-self: stretch;
  }

  .lead-offer-more-actions summary {
    justify-content: center;
  }

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

  .lead-workflow span {
    justify-content: flex-start;
    text-align: left;
  }

  .lead-next-action strong {
    font-size: 16px;
  }

  .customer-detail .action-row,
  #customerQuickContent .action-row,
  .order-detail .action-row,
  .order-detail .job-actions,
  .job-card .job-actions,
  .lead-contact-actions,
  .lead-next-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
    justify-content: stretch;
    max-width: 100%;
    min-width: 0;
    overflow-x: visible;
    overflow-y: visible;
    padding-bottom: 4px;
  }

  .customer-detail .action-row > *,
  #customerQuickContent .action-row > *,
  .order-detail .action-row > *,
  .order-detail .job-actions > *,
  .job-card .job-actions > *,
  .lead-contact-actions > *,
  .lead-next-actions > * {
    min-width: 0;
    width: 100%;
    white-space: normal;
  }

  .lead-contact-actions a,
  .lead-contact-actions button,
  .lead-next-actions button,
  .customer-detail .action-row a,
  .customer-detail .action-row button,
  #customerQuickContent .action-row a,
  #customerQuickContent .action-row button,
  .order-detail .action-row a,
  .order-detail .action-row button,
  .order-detail .job-actions a,
  .order-detail .job-actions button,
  .job-card .job-actions a,
  .job-card .job-actions button,
  .customer-detail .inline-more-actions,
  #customerQuickContent .inline-more-actions,
  .order-detail .inline-more-actions,
  .job-card .inline-more-actions,
  .lead-next-actions .inline-more-actions {
    justify-content: center;
  }

  .customer-detail .inline-more-actions,
  #customerQuickContent .inline-more-actions,
  .order-detail .inline-more-actions,
  .job-card .inline-more-actions,
  .lead-next-actions .inline-more-actions {
    display: block;
    position: static;
    grid-column: 1 / -1;
  }

  .customer-detail .inline-more-actions summary,
  #customerQuickContent .inline-more-actions summary,
  .order-detail .inline-more-actions summary,
  .job-card .inline-more-actions summary,
  .lead-next-actions .inline-more-actions summary {
    width: 100%;
  }

  .customer-detail .inline-more-actions > div,
  #customerQuickContent .inline-more-actions > div,
  .order-detail .inline-more-actions > div,
  .job-card .inline-more-actions > div,
  .lead-next-actions .inline-more-actions > div {
    position: static;
    width: 100%;
    max-width: 100%;
    margin-top: 6px;
    box-shadow: none;
    white-space: normal;
  }

  .detail-section.lead-contact-panel {
    padding: 10px;
  }

  input[type="checkbox"],
  input[type="radio"] {
    width: 20px;
    min-width: 20px;
    height: 20px;
    min-height: 20px;
  }

  .customer-detail,
  .lead-detail,
  .order-detail {
    scroll-margin-top: 12px;
    scroll-margin-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }

  .star-icon-toggle {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .customer-status-toggle {
    min-height: 44px;
    padding: 0 12px;
    font-size: 13px;
  }

  .customer-status-toggle span {
    font-size: 18px;
  }

  .planning-resource-filter {
    min-height: 44px;
  }

  .planning-resource-filter select {
    min-height: 44px;
  }

  .product-catalog-form-grid,
  .product-catalog-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-catalog-form-grid .product-name-field,
  .product-catalog-form-grid .product-alias-field {
    grid-column: auto;
  }

  .product-catalog-toolbar span {
    white-space: normal;
  }

  .product-catalog-row > summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-catalog-row > summary em {
    white-space: normal;
  }

  .mobile-bottom-nav {
    position: fixed;
    z-index: 40;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #fff;
    box-shadow: 0 -8px 22px rgba(15, 23, 42, 0.08);
  }

  .mobile-bottom-nav button {
    min-height: 58px;
    border-radius: 0;
    padding: 6px 4px;
    background: #fff;
    color: var(--ink);
    font-size: 12px;
  }

  .mobile-bottom-nav button.active {
    background: var(--teal-soft);
    color: var(--teal);
  }

  .app.technician-mode .mobile-bottom-nav [data-tech-mobile] {
    order: 1;
  }

  .app.technician-mode .mobile-bottom-nav [data-view="customers"] {
    order: 2;
  }

  .app.technician-mode .mobile-bottom-nav [data-view="planning"] {
    order: 3;
  }

  .app.technician-mode .mobile-bottom-nav [data-mobile-more-toggle] {
    order: 4;
  }

  .mobile-more-menu {
    position: fixed;
    z-index: 45;
    right: 10px;
    bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    left: 10px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px;
    background: #fff;
    box-shadow: 0 -10px 28px rgba(15, 23, 42, 0.14);
  }

  .mobile-more-menu.hidden {
    display: none;
  }

  .mobile-more-menu button {
    min-height: 44px;
    justify-content: flex-start;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--ink);
    font-size: 13px;
  }

  .mobile-more-menu button.active {
    border-color: var(--teal);
    background: var(--teal-soft);
    color: var(--teal);
  }

  .mobile-more-menu .mobile-logout {
    grid-column: 1 / -1;
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
  }

  .planning-head {
    gap: 8px;
  }

  .planning-period-nav {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 6px;
  }

  .planning-period-nav strong {
    min-width: 0;
    padding-inline: 2px;
    font-size: 14px;
    line-height: 1.2;
    text-align: center;
  }

  .planning-period-nav button {
    width: 44px;
    min-width: 44px;
    padding-inline: 8px;
    font-size: 20px;
  }

  .planning-period-nav button span:not([aria-hidden="true"]) {
    display: none;
  }

  .planning-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    justify-content: stretch;
    align-items: stretch;
  }

  .planning-toolbar > .planning-mode-toggle {
    grid-column: 1;
    grid-row: 1;
  }

  .planning-toolbar > #todayButton {
    grid-column: 2;
    grid-row: 1;
  }

  .planning-toolbar > .planning-more-tools {
    grid-column: 3;
    grid-row: 1;
  }

  .planning-toolbar > .planning-resource-filter {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .planning-head button,
  .planning-mode-toggle,
  .planning-resource-filter {
    width: 100%;
  }

  .planning-mode-toggle {
    justify-content: stretch;
  }

  .planning-mode-toggle button {
    flex: 1;
  }

  .planning-resource-filter {
    grid-column: 1 / -1;
    justify-content: space-between;
  }

  .planning-resource-filter select {
    flex: 1;
    min-width: 0;
  }

  .planning-more-tools > div {
    position: fixed;
    top: auto;
    right: 12px;
    bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    left: 12px;
    min-width: 0;
  }

  .planning-day-picker:not(.hidden) {
    display: grid;
    grid-template-columns: repeat(7, minmax(38px, 1fr));
    gap: 4px;
    margin: 4px 0 10px;
  }

  .planning-day-picker button {
    min-width: 0;
    min-height: 54px;
    display: grid;
    grid-template-rows: auto auto;
    place-items: center;
    gap: 0;
    position: relative;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 5px 2px;
    background: #fff;
    color: var(--muted);
  }

  .planning-day-picker button span {
    font-size: 10px;
    font-weight: 900;
    text-transform: capitalize;
  }

  .planning-day-picker button strong {
    color: var(--ink);
    font-size: 15px;
  }

  .planning-day-picker button em {
    min-width: 16px;
    min-height: 16px;
    display: grid;
    place-items: center;
    position: absolute;
    top: -5px;
    right: -3px;
    border-radius: 999px;
    background: var(--orange);
    color: #fff;
    font-size: 9px;
    font-style: normal;
    font-weight: 950;
  }

  .planning-day-picker button em:empty {
    display: none;
  }

  .planning-day-picker button.today {
    border-color: rgba(15, 118, 110, 0.5);
  }

  .planning-day-picker button.active {
    border-color: var(--teal);
    background: var(--teal-soft);
    box-shadow: inset 0 0 0 1px var(--teal);
    color: var(--teal-dark);
  }

  .planning-month-overview {
    gap: 6px;
    margin: 4px 0 0;
    padding: 8px;
  }

  .planning-month-summary {
    display: block;
  }

  .planning-month-summary span {
    font-size: 12px;
  }

  .planning-month-overview .booking-month-legend {
    display: none;
  }

  .planning-month-grid .month-day {
    min-height: 52px;
    padding: 3px 1px;
  }

  .planning-month-grid .month-day.free em,
  .planning-month-grid .month-day small {
    display: none;
  }

  .planning-month-grid .month-day em {
    min-height: 0;
    font-size: 9px;
  }

  .planning-board {
    display: block;
    margin: 0;
    overflow: visible;
  }

  .planning-day {
    display: none;
    width: 100%;
    min-width: 0;
    padding: 10px;
  }

  .planning-day.mobile-selected {
    display: block;
  }

  .planning-day .day-timeline-wrap,
  .planning-day .drop-hint {
    display: none;
  }

  .planning-day .day-head {
    grid-template-columns: 1fr auto;
    align-items: baseline;
  }

  .planning-day .day-head strong {
    text-transform: capitalize;
  }

  .planning-day .day-head span,
  .planning-day .day-head small {
    justify-self: end;
  }

  .planning-day .day-head em {
    grid-column: 1 / -1;
  }

  #planningView .day-job-details {
    margin-top: 0;
    border: 0;
    background: transparent;
  }

  #planningView .day-job-details > summary {
    display: none;
  }

  #planningView .day-job-details > .day-jobs {
    border: 0;
    padding: 0;
    max-height: none;
    overflow: visible;
  }

  #planningView .job-card .workflow-inline {
    display: none;
  }

  #planningView .planning-mobile-edit {
    display: inline-flex;
  }

  .day-timeline {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .timeline-axis,
  .timeline-grid {
    height: 360px;
  }

  .planning-day.is-empty .drop-hint,
  .planning-day.is-empty .day-timeline-wrap {
    display: none;
  }

  .planning-day.is-empty .empty-state {
    min-height: 72px;
    display: grid;
    place-items: center;
  }

  #routeplannerView .route-planner {
    gap: 12px;
  }

  #routeplannerView .route-planner > .section-head > div,
  #routeplannerView .route-step-head p,
  #routeplannerView .route-selection > .section-head p,
  #routeplannerView .route-help {
    display: none;
  }

  #routeplannerView .route-step,
  #routeplannerView .route-selection,
  #routeplannerView .route-controls {
    border-radius: 8px;
    padding: 10px;
  }

  .service-campaign-tracking > summary,
  .service-area-review > summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .service-campaign-controls {
    grid-template-columns: minmax(0, 1fr);
  }

  .route-campaign-entry,
  .route-campaign-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .route-campaign-actions label,
  #routeCampaignButton {
    width: 100%;
  }

  .service-campaign-member > header {
    align-items: flex-start;
    flex-direction: column;
  }

  .service-campaign-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .service-campaign-actions button,
  .service-campaign-actions a,
  #serviceCampaignRefreshButton {
    width: 100%;
  }

  .service-area-review-toolbar,
  .service-area-review-row {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .service-area-review-actions label {
    grid-column: 1 / -1;
  }

  .service-area-review-actions button,
  .service-area-review-actions a {
    width: 100%;
  }

  #routeplannerView .route-actions,
  #routeplannerView .route-card-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  #routeplannerView .route-actions button,
  #routeplannerView .route-card-actions a,
  #routeplannerView .route-card-actions button,
  #routeOpenMapsButton {
    width: 100%;
  }

  #routeplannerView .route-card-actions a,
  #routeplannerView .route-card-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .activity-timeline-toolbar,
  .lead-focus-schedule {
    grid-template-columns: minmax(0, 1fr);
  }

  .lead-focus-schedule button {
    width: 100%;
  }

  .start-worklist {
    grid-template-columns: 1fr;
  }

  .start-worklist button {
    min-height: 88px;
  }

  .order-bulk-actions {
    display: none;
  }
}

@media (max-width: 420px) {
  .top-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .top-search,
  #importSeedButton,
  .crm-assistant-button {
    grid-column: 1 / -1;
  }

  .new-action-wrap {
    grid-column: 2;
    width: 100%;
    justify-self: stretch;
  }

  .quick-reminder-button {
    grid-column: 1;
    width: 100%;
    justify-content: center;
  }

  #newActionButton {
    width: 100%;
    justify-content: center;
  }

  .new-action-menu {
    left: 0;
    right: 0;
    width: 100%;
    min-width: 0;
  }

  .job-card .job-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .quick-field-actions {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 600px) {
  .google-insights-panel {
    padding: 11px;
  }

  .google-insights-head,
  .google-insights-links {
    width: 100%;
  }

  .google-insights-links a {
    flex: 1 1 130px;
    justify-content: center;
  }

  .google-period-toolbar,
  .google-period-navigation,
  .google-period-options {
    width: 100%;
  }

  .google-period-navigation {
    min-width: 0;
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .google-period-navigation button {
    padding-inline: 8px;
  }

  .google-period-options button {
    flex: 1 1 0;
  }

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

  .google-metric {
    min-height: 82px;
  }

  .google-metric strong {
    font-size: 21px;
  }

  .google-trend {
    gap: 2px;
  }

  .google-trend > span:nth-child(even) small {
    visibility: hidden;
  }

  .google-business-summary a,
  .google-insights-meta a {
    width: 100%;
    margin-left: 0;
  }
}

/* Unified CRM interaction and typography pass, 2026-08-22. */
h1,
h2,
h3,
h4,
button,
input,
select,
textarea,
summary,
.status,
.soft-pill {
  letter-spacing: 0;
}

h1,
h2,
h3,
h4 {
  color: var(--ink);
  font-weight: 700;
  line-height: 1.2;
}

button,
.action-row a,
.job-actions a,
.lead-contact-actions a,
.billing-draft-actions a,
.inline-more-actions summary {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}

button,
.action-row a,
.job-actions a,
.lead-contact-actions a,
.billing-draft-actions a,
input,
select,
textarea,
summary {
  border-radius: 8px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.28);
  outline-offset: 2px;
}

button:not(:disabled):active,
.action-row a:active,
.job-actions a:active {
  transform: translateY(1px);
}

input,
select,
textarea {
  border-color: #cbd5df;
  font-weight: 500;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #6b9be8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

label,
.planning-resource-filter,
.modal label:not(.choice-stack label) {
  color: #44505f;
  font-weight: 650;
}

.panel {
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.section-head h2,
.view-head h2 {
  font-size: 20px;
}

.section-head p,
.view-subtitle,
.context-hint {
  color: var(--muted);
  font-weight: 450;
}

.status,
.soft-pill,
.invoice-pill,
.job-type-pill,
.done-pill {
  font-weight: 700 !important;
}

.plan-tabs {
  gap: 18px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
  padding: 0;
}

.plan-tabs button {
  min-height: 42px;
  margin-bottom: -1px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  padding: 8px 2px;
  background: transparent;
  color: var(--muted);
  font-weight: 650;
}

.plan-tabs button.active {
  border-color: var(--teal);
  background: transparent;
  color: var(--teal-dark);
}

.planning-mode-toggle {
  gap: 2px;
  border-color: var(--line);
  border-radius: 8px;
  padding: 3px;
  background: #eef2f5;
}

.planning-mode-toggle button {
  min-height: 34px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 650;
}

.planning-mode-toggle button.active {
  background: #fff;
  color: var(--teal-dark);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

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

.planning-resource-filter,
.planning-month-summary span,
.booking-month-legend {
  font-weight: 600;
}

.customer-title h2 {
  margin-top: 8px;
  font-size: 24px;
}

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

.customer-action-bar {
  align-items: center;
  justify-content: flex-start;
}

.customer-key-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1px;
  margin: 8px 0 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.customer-key-facts > div {
  min-width: 0;
  display: grid;
  gap: 2px;
  align-content: center;
  min-height: 58px;
  padding: 9px 11px;
  background: #fff;
}

.customer-key-facts span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
}

.customer-key-facts strong {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.customer-work-summary span,
.customer-work-summary small,
.customer-more-sections > summary span {
  font-weight: 600;
}

.customer-work-summary strong,
.customer-more-sections > summary {
  font-weight: 700;
}

.map-primary-action {
  border-color: #b7c8e8 !important;
  background: var(--blue-soft) !important;
  color: #174ea6 !important;
  font-weight: 700 !important;
}

.job-card {
  border-color: #cfe2d4;
  border-left-color: var(--service);
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  text-align: left;
  transform: none;
}

.job-card:hover {
  border-color: #aacfb5;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  transform: none;
}

.job-card.installasjon {
  border-color: #cbdcf8;
  border-left-color: #2563eb;
  background: #f8fbff;
}

.job-card.befaring {
  border-color: #ead8b5;
  border-left-color: #d97706;
  background: #fffcf5;
}

.job-card.reparasjon {
  border-color: #d8d5ef;
  border-left-color: #6366f1;
  background: #fafaff;
}

.job-card.blaseisolering {
  border-color: #bfe1e9;
  border-left-color: var(--insulation);
  background: #f7fdff;
}

.job-card.done {
  border-color: #c9ded0;
  border-left-color: var(--green);
  background: #f7fbf8;
}

.job-card.settled {
  border-color: #d5dce4;
  border-left-color: #8492a3;
  background: #f4f6f8;
  box-shadow: none;
  opacity: 0.88;
}

.job-card.needs-move {
  border-color: #d9cff2;
  border-left-color: #7c3aed;
  background: #fbfaff;
}

.job-card.overlap {
  border-color: #e7a9a9;
  border-left-color: var(--red);
  background: #fffafa;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.08);
}

.job-card span,
.job-card small,
.job-card p {
  color: var(--muted);
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
}

.job-card strong,
.job-card .job-meta {
  font-weight: 700;
  text-align: left;
}

.job-card .job-actions {
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}

.job-card .job-actions a,
.job-card .job-actions button,
.job-card .inline-more-actions summary {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: var(--line);
  background: #fff;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 650;
  text-align: center;
}

.job-card .job-actions .order-primary {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.planning-month-overview {
  background: #f7f9fa;
}

.planning-month-grid .month-day {
  border-color: #d6dee6;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
}

.planning-month-grid .month-day.selected {
  border-color: var(--teal);
  outline: 3px solid rgba(11, 107, 99, 0.13);
  background: #edf8f6;
}

.planning-month-grid .month-day small,
.planning-month-grid .month-day em {
  font-weight: 600;
}

.planning-month-agenda {
  min-width: 0;
  display: grid;
  gap: 10px;
  margin-top: 4px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.planning-month-agenda > header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: end;
  justify-content: space-between;
}

.planning-month-agenda > header span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
}

.planning-month-agenda > header h3 {
  margin: 2px 0 0;
  font-size: 17px;
  text-transform: capitalize;
}

.planning-month-agenda > header small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.planning-month-agenda-list {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 8px;
}

.modal {
  border-radius: 8px;
  overflow: hidden;
}

.modal form {
  max-height: calc(100dvh - 24px);
  overflow: auto;
  background: #fff;
}

#bookingDialog form,
#bookingDialog.booking-service form,
#bookingDialog.booking-befaring form,
#bookingDialog.booking-reparasjon form,
#bookingDialog.booking-installasjon form,
#bookingDialog.booking-blaseisolering form {
  background: #fff;
}

.modal-head {
  position: sticky;
  z-index: 4;
  top: -18px;
  margin: -18px -18px 14px;
  border-bottom: 1px solid var(--line);
  padding: 14px 18px 12px;
  background: #fff;
}

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

.modal form > .modal-actions {
  position: sticky;
  z-index: 4;
  bottom: -18px;
  margin: 14px -18px -18px;
  border-top: 1px solid var(--line);
  padding: 12px 18px 16px;
  background: #fff;
}

@media (max-width: 760px) {
  .customer-title h2 {
    font-size: 21px;
  }

  .customer-key-facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .customer-key-facts > div {
    min-height: 52px;
  }

  .customer-action-bar,
  .job-card .job-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .customer-action-bar > *,
  .job-card .job-actions > * {
    width: 100%;
    min-width: 0;
  }

  .planning-toolbar {
    justify-content: stretch;
  }

  .planning-month-agenda {
    scroll-margin-top: 8px;
  }

  .planning-month-agenda-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .modal form {
    max-height: calc(100dvh - 12px);
  }

  .modal-head {
    top: -12px;
    margin: -12px -12px 12px;
    padding: 12px;
  }

  .modal form > .modal-actions {
    bottom: -12px;
    margin: 12px -12px -12px;
    padding: 10px 12px 12px;
  }
}

